:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: rgba(12, 12, 12, 0.9);
  --surface-2: rgba(18, 18, 18, 0.84);
  --surface-3: rgba(24, 24, 24, 0.76);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(242, 180, 109, 0.3);
  --text: #f5f1e8;
  --muted: rgba(245, 241, 232, 0.72);
  --muted-2: rgba(245, 241, 232, 0.48);
  --cyan: #f2b46d;
  --magenta: #8ab4ff;
  --green: #83e7ce;
  --amber: #f7d38c;
  --red: #ff9b9b;
  --blue: #dfe8ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --radius: 16px;
  --body-font: "Manrope", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --heading-font: "Funnel Display", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 14% 12%, rgba(255, 255, 255, 0.045), transparent 24rem),
    radial-gradient(circle at 82% 14%, rgba(242, 180, 109, 0.08), transparent 22rem),
    radial-gradient(circle at 50% 112%, rgba(138, 180, 255, 0.05), transparent 26rem),
    linear-gradient(180deg, #050505, #0a0a0a 48%, #050505);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 14px;
  letter-spacing: 0;
}

p {
  font-size: 16px;
}

button,
select,
input {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 7, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.brand img {
  width: 92px;
  height: auto;
  display: block;
}

.brand span {
  display: block;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-controls,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.context-controls label {
  display: grid;
  gap: 5px;
  min-width: 168px;
}

.context-controls span {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

select,
input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #0e1216;
  padding: 0 11px;
}

.button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  background: #12171d;
  padding: 0 13px;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(24, 216, 232, 0.65);
  background: #17212a;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.button-secondary {
  background: linear-gradient(135deg, rgba(24, 216, 232, 0.22), rgba(255, 75, 184, 0.16));
}

.button-ghost {
  background: transparent;
}

.button-small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #080a0c;
}

.kpi {
  min-height: 98px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 17px 20px;
  border-right: 1px solid var(--line);
}

.kpi:last-child {
  border-right: 0;
}

.kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.kpi strong {
  font-size: 24px;
  line-height: 1;
}

.kpi small {
  color: var(--muted-2);
  line-height: 1.35;
}

.workspace {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 318px;
  min-height: 0;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #07090b;
  padding: 16px 12px;
}

.workflow-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  background: transparent;
  padding: 9px 10px;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: var(--line);
  background: #10151a;
}

.nav-item.is-active {
  box-shadow: inset 3px 0 0 var(--cyan);
}

.nav-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--cyan);
  background: #0d1115;
  font-size: 12px;
  font-weight: 800;
}

.nav-item strong,
.nav-item small {
  display: block;
}

.nav-item small {
  margin-top: 2px;
  color: var(--muted-2);
}

.main-surface {
  min-width: 0;
  background: linear-gradient(180deg, rgba(18, 22, 27, 0.62), rgba(5, 6, 7, 0));
  padding: 22px;
}

.main-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.12;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.main-heading p:last-child {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.content-region {
  display: grid;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 15, 18, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header p {
  margin: 3px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.panel-body {
  padding: 16px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.three-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-tile,
.work-item,
.issue-card,
.doc-card,
.answer-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f1318;
}

.metric-tile {
  min-height: 94px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.metric-tile span,
.field-label {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-tile strong {
  font-size: 24px;
  transform: translateY(-4px);
}

.metric-tile {
  background: #eef3f3 !important;
}

.metric-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.35;
  transform: translateY(-4px);
}

.work-list,
.issue-list,
.audit-list {
  display: grid;
  gap: 9px;
}

.issue-list {
  align-items: start;
}

.work-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
}

.work-item p,
.issue-card p,
.doc-card p,
.answer-box p {
  color: var(--muted);
  line-height: 1.45;
}

.work-item p:last-child,
.issue-card p:last-child,
.doc-card p:last-child,
.answer-box p:last-child {
  margin-bottom: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

td {
  color: #e9eef3;
}

tr:last-child td {
  border-bottom: 0;
}

.muted {
  color: var(--muted);
}

.subtle {
  color: var(--muted-2);
  font-size: 12px;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  color: var(--text);
  background: #11171d;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-cyan {
  color: #bff8ff;
  border-color: rgba(24, 216, 232, 0.38);
  background: rgba(24, 216, 232, 0.12);
}

.badge-green {
  color: #c9ffdf;
  border-color: rgba(55, 214, 122, 0.34);
  background: rgba(55, 214, 122, 0.12);
}

.badge-amber {
  color: #ffe8ad;
  border-color: rgba(244, 185, 66, 0.34);
  background: rgba(244, 185, 66, 0.13);
}

.badge-red {
  color: #ffc9c9;
  border-color: rgba(255, 97, 97, 0.34);
  background: rgba(255, 97, 97, 0.12);
}

.confidence {
  min-width: 112px;
  display: grid;
  gap: 5px;
}

.confidence-track {
  height: 7px;
  border-radius: 999px;
  background: #252c34;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.actions-row,
.prompt-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-grid {
  margin-bottom: 12px;
}

.prompt-chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #0f151a;
  padding: 0 13px;
  font-weight: 700;
}

.prompt-chip:hover {
  border-color: rgba(255, 75, 184, 0.58);
}

.ask-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.ask-form textarea {
  min-height: 40px;
  height: 40px;
  max-height: 40px;
  resize: none;
  overflow-y: auto;
  padding: 10px 12px;
}

.answer-box {
  padding: 16px;
}

.answer-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.issue-card {
  align-self: start;
  align-items: center;
  min-height: 0;
  padding: 10px;
  padding-bottom: 5px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.issue-card .button {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  align-self: flex-start;
}

.issue-card > .actions-row {
  align-items: center;
}

.issue-card > div:first-child,
.issue-card > .actions-row {
  transform: translate(15px, 18px);
}

.issue-card > .actions-row {
  transform: translate(-25px, -2px);
}

@media (max-width: 900px) {
  .issue-card {
    align-items: stretch;
  }
}

.issue-card h3 {
  transform: translateY(9px);
}

.recommended-action {
  width: fit-content;
  max-width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 12px;
  background: #b7c9cf;
  color: #fff;
}

.recommended-action img {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
}

.recommended-action p {
  margin: 0 !important;
  color: #fff;
  line-height: 1.35;
  transform: translateY(2px);
}

.issue-card .badge {
  border: 1px solid currentColor !important;
  color: #fff !important;
  font-weight: 600;
}

.issue-card .badge-cyan {
  border-color: #4b7180 !important;
  background: #5d7f89 !important;
}

.issue-card .badge-amber {
  border-color: #a17438 !important;
  background: #b48848 !important;
}

.issue-card .badge-red {
  border-color: #b65353 !important;
  background: #c96868 !important;
}

.issue-card .badge-green {
  border-color: #3d805b !important;
  background: #4e9d70 !important;
}

.issue-meta,
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.doc-card {
  min-width: 0;
  overflow: hidden;
}

.scan-thumb {
  min-height: 122px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(24, 216, 232, 0.12), transparent),
    repeating-linear-gradient(0deg, #151a20 0, #151a20 11px, #11161c 11px, #11161c 19px);
}

.scan-thumb strong {
  color: var(--text);
  font-size: 13px;
}

.scan-line {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.scan-line.short {
  width: 58%;
}

.scan-line.medium {
  width: 78%;
}

.doc-card .panel-body {
  display: grid;
  gap: 10px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.field {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: #0b1014;
}

.field strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.activity-panel {
  border-left: 1px solid var(--line);
  background: #07090b;
  padding: 16px;
}

.activity-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.activity-heading span {
  font-weight: 800;
}

.activity-heading strong {
  color: var(--muted);
  font-size: 12px;
}

.audit-entry {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0f1318;
  padding: 10px;
}

.audit-entry time {
  display: block;
  margin-bottom: 4px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
}

.audit-entry p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.live-region {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(120%);
  min-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #11171d;
  color: var(--text);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
  z-index: 20;
}

.live-region.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* VOID portfolio alignment */
.topbar,
.sidebar,
.activity-panel,
.kpi-strip {
  background: rgba(8, 8, 8, 0.78);
  backdrop-filter: blur(22px) saturate(1.04);
  -webkit-backdrop-filter: blur(22px) saturate(1.04);
}

.main-surface {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%),
    linear-gradient(180deg, rgba(18, 18, 18, 0.72), rgba(6, 6, 6, 0));
}

.brand span,
h1,
h2,
h3,
.kpi strong {
  font-family: var(--heading-font);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.eyebrow,
.kpi span,
.metric-tile span,
.field-label,
th,
.activity-heading strong,
.audit-entry time {
  color: var(--muted);
}

.button,
.prompt-chip,
.badge,
.nav-icon,
select,
input {
  border-radius: 999px;
}

.button {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.94);
  color: #050505;
}

.button-ghost {
  background: rgba(255, 255, 255, 0.04);
}

select,
input,
.prompt-chip {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.panel,
.metric-tile,
.work-item,
.issue-card,
.doc-card,
.answer-box,
.audit-entry {
  border-color: rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 22%, transparent 78%, rgba(255, 255, 255, 0.018)),
    rgba(18, 18, 18, 0.74);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 42px rgba(0, 0, 0, 0.14);
}

.nav-item:hover,
.nav-item.is-active {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
  box-shadow: inset 3px 0 0 var(--cyan);
}

.nav-icon,
.badge,
.prompt-chip {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.badge-cyan {
  color: #f8e7c8;
  border-color: rgba(242, 180, 109, 0.28);
  background: rgba(242, 180, 109, 0.12);
}

.badge-green {
  color: #dff8ef;
  border-color: rgba(131, 231, 206, 0.28);
  background: rgba(131, 231, 206, 0.12);
}

.badge-amber {
  color: #fff0c8;
  border-color: rgba(247, 211, 140, 0.28);
  background: rgba(247, 211, 140, 0.12);
}

.badge-red {
  color: #ffe0dc;
  border-color: rgba(255, 155, 155, 0.28);
  background: rgba(255, 155, 155, 0.12);
}

.confidence-track {
  background: rgba(255, 255, 255, 0.08);
}

.confidence-fill {
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.scan-thumb {
  background:
    linear-gradient(90deg, rgba(242, 180, 109, 0.1), transparent),
    repeating-linear-gradient(0deg, #151515 0, #151515 11px, #111111 11px, #111111 19px);
}

@media (max-width: 1240px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .context-controls,
  .topbar-actions {
    justify-content: start;
    flex-wrap: wrap;
  }

  .workspace {
    grid-template-columns: 216px minmax(0, 1fr);
  }

  .activity-panel {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .audit-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .doc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi {
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workflow-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .nav-item {
    min-width: 220px;
  }

  .main-heading,
  .panel-header,
  .work-item,
  .issue-card {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .split-grid,
  .three-grid,
  .doc-grid,
  .audit-list {
    grid-template-columns: 1fr;
  }

  .ask-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar,
  .main-surface {
    padding: 14px;
  }

  .brand {
    align-items: start;
    flex-direction: column;
    gap: 8px;
  }

  .context-controls,
  .topbar-actions {
    width: 100%;
  }

  .context-controls label,
  .button {
    width: 100%;
  }

  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* Rita light theme — shared with the Frontoffice surface. */
:root {
  color-scheme: light;
  --page: #ffffff;
  --shell: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f5f0e4;
  --surface-muted: #eee9dc;
  --line: rgba(62, 55, 42, 0.12);
  --line-strong: rgba(75, 104, 115, 0.24);
  --text: #34434a;
  --muted: #68767b;
  --muted-2: #8b989c;
  --cyan: #b7c9cf;
  --magenta: #e87979;
  --green: #62c989;
  --amber: #6f7f86;
  --red: #e87979;
  --blue: #dce6e6;
  --shadow: 0 22px 70px rgba(49, 70, 78, 0.12);
  --radius: 18px;
  --body-font: "Fustat", "Segoe UI", Helvetica, Arial, sans-serif;
  --heading-font: "Fustat", "Segoe UI", Helvetica, Arial, sans-serif;
}

body {
  background: var(--page);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 14px;
  letter-spacing: -0.005em;
}

.app-shell {
  width: min(100%, 1440px);
  margin: 0 auto;
  background: #fff;
}

body.dark-mode {
  --page: #172126;
  --shell: #1b272c;
  --surface: #243238;
  --surface-soft: #2b3a40;
  --surface-muted: #34464d;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(242, 180, 109, 0.3);
  --text: #f5f1e8;
  --muted: rgba(245, 241, 232, 0.72);
  --muted-2: rgba(245, 241, 232, 0.48);
  --cyan: #f2b46d;
  --blue: #dfe8ff;
  background: var(--page);
}

body.dark-mode .app-shell {
  background: var(--shell);
}

body.dark-mode .topbar,
body.dark-mode .kpi-strip,
body.dark-mode .workspace,
body.dark-mode .sidebar,
body.dark-mode .activity-panel,
body.dark-mode .main-surface {
  background: #1b272c;
}

body.dark-mode .profile-menu,
body.dark-mode .card,
body.dark-mode .panel,
body.dark-mode .work-card,
body.dark-mode .table-wrap,
body.dark-mode .query-card,
body.dark-mode .issue-card,
body.dark-mode .document-card,
body.dark-mode .audit-item,
body.dark-mode .activity-item {
  background: #243238;
  color: var(--text);
}

body.dark-mode .kpi,
body.dark-mode .work-item,
body.dark-mode .metric-tile {
  background: #2b3a40 !important;
  color: var(--text);
}

body.dark-mode select,
body.dark-mode input,
body.dark-mode textarea {
  background: #243238;
  color: var(--text);
}

.topbar {
  min-height: 84px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.brand img {
  width: 92px;
  height: 32px;
  object-fit: contain;
  object-position: left center;
}

.brand span,
.main-heading h1,
.activity-heading span,
.kpi strong {
  color: var(--text);
}

.context-controls label {
  min-width: 150px;
}

.context-controls span,
.kpi span {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

select,
input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: #fff;
}

.button {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  color: #4b6873;
  background: var(--blue);
  box-shadow: none;
}

.button:hover {
  border-color: transparent;
  background: #cbdcdf;
}

.button-secondary {
  color: #34434a;
  background: var(--blue);
}

.button-ghost {
  color: var(--muted);
  background: var(--surface-soft);
}

.topbar-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 5px 14px rgba(49, 70, 78, 0.08);
}

.kpi-strip {
  gap: 12px;
  padding: 18px 28px;
  border: 0;
  background: #fff;
}

.kpi {
  min-height: 100px;
  gap: 8px;
  padding: 18px;
  border: 0;
  border-radius: 18px;
  background: var(--surface-soft);
}

.kpi:nth-child(1) { background: rgba(98, 201, 137, 0.12); }
.kpi:nth-child(2) { background: rgba(232, 121, 121, 0.12); }
.kpi:nth-child(3) { background: #e2edef; }
.kpi:nth-child(4),
.kpi:nth-child(5) { background: #f5f0e4; }

.kpi strong { font-size: 25px; font-weight: 500; }
.kpi small { color: var(--muted); }

.workspace {
  grid-template-columns: 220px minmax(0, 1fr) 286px;
  gap: 0;
  background: #fff;
}

.sidebar,
.activity-panel {
  border-color: var(--line);
  background: #fff;
}

.sidebar { padding: 20px 16px; }
.workflow-nav { gap: 7px; }

.nav-item {
  min-height: 62px;
  border-radius: 14px;
  color: var(--text);
  padding: 9px 10px;
}

.nav-item:hover,
.nav-item.is-active {
  border-color: transparent;
  background: #e2edef;
}

.nav-item.is-active {
  box-shadow: inset 3px 0 0 #4b6873;
}

.nav-item small,
.activity-heading strong,
.activity-item small {
  color: var(--muted);
}

.nav-icon {
  color: #4b6873;
  background: var(--surface-soft);
  border-radius: 11px;
}

.main-surface { padding: 28px; background: #fff; }
.main-heading { border-bottom-color: var(--line); }
.eyebrow { color: #4b6873; }
.main-heading h1 { font-weight: 500; letter-spacing: -0.03em; }
.main-heading p { color: var(--muted); }

.activity-panel { padding: 22px 18px; }
.activity-heading { border-bottom-color: var(--line); }
.audit-item,
.activity-item { border-color: var(--line); background: #fff; }

.card,
.panel,
.work-card,
.table-wrap,
.query-card,
.issue-card,
.document-card {
  border-color: var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(49, 70, 78, 0.055);
}

.badge,
.status,
.chip { border-radius: 999px; }

@media (max-width: 900px) {
  .topbar { grid-template-columns: 1fr; }
  .context-controls,
  .topbar-actions { justify-content: flex-start; flex-wrap: wrap; }
  .workspace { grid-template-columns: 180px minmax(0, 1fr); }
  .activity-panel { display: none; }
}

/* Rita theme: borderless surfaces and controls. */
*,
*::before,
*::after {
  outline: none !important;
}

button,
select,
input,
textarea,
.topbar,
.kpi-strip,
.kpi,
.sidebar,
.activity-panel,
.nav-item,
.card,
.panel,
.work-card,
.table-wrap,
.query-card,
.issue-card,
.document-card,
.audit-item,
.activity-item {
  border-color: transparent !important;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Rita period header and profile menu. */
.brand span {
  display: none;
}

.context-controls {
  justify-content: center;
  min-width: 0;
}

.period-tabs {
  display: flex;
  position: relative;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.period-tabs button {
  position: relative;
  min-width: 34px;
  height: 40px;
  padding: 0 7px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
}

.period-tabs button:hover,
.period-tabs button.is-active {
  background: transparent;
  color: var(--text);
}

.period-tabs button.is-active::after {
  display: none;
}

.period-indicator {
  position: absolute;
  bottom: 1px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  pointer-events: none;
  transform: translateX(-50%);
  transition: left 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.year-option {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  background: #164463;
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
}

.profile-menu-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.topbar-avatar-button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.topbar-avatar-button:hover {
  background: transparent;
}

.topbar-avatar-button .topbar-avatar {
  display: block;
  width: 42px;
  height: 42px;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 230px;
  gap: 6px;
  padding: 20px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(49, 70, 78, 0.16);
}

.profile-menu[hidden] {
  display: none;
}

.profile-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.profile-menu button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  stroke-width: 1.8;
}

.profile-menu .profile-reset {
  margin-top: 4px;
}

.profile-menu button:hover {
  background: #e8f0f1;
  color: #164463;
  transform: translateX(2px);
}

.profile-menu button:hover svg {
  color: #164463;
}

body.dark-mode .profile-menu button:hover {
  background: #26343a;
  color: #f5f1e8;
}

body.dark-mode .profile-menu button:hover svg {
  color: #f2b46d;
}

/* Light Rita treatment for the overview work queue and control tiles. */
.work-item,
.metric-tile {
  border-color: transparent !important;
  background: #f7f2e9 !important;
  color: var(--text);
  box-shadow: none !important;
}

.metric-tile {
  background: #fafbfa !important;
}

.metric-tile > span {
  color: #53666d !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-tile > span svg {
  width: 15px;
  height: 15px;
  color: #4b7180;
  stroke-width: 2;
}

@media (min-width: 1001px) {
  .metric-tile {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "label value"
      "note value";
    align-content: center;
    align-items: center;
  }

  .metric-tile > span {
    grid-area: label;
    transform: translateX(20px);
  }

  .metric-tile > p {
    grid-area: note;
    transform: translateX(20px);
  }

  .metric-tile > strong {
    grid-area: value;
    transform: translateX(-20px);
  }
}

.work-item h3,
.metric-tile strong {
  color: var(--text);
}

.work-item p,
.metric-tile p,
.metric-tile span {
  color: var(--muted);
}

.activity-panel {
  border-left-color: transparent !important;
  background: #fbfaf7 !important;
  color: var(--text);
}

.activity-heading {
  border-bottom-color: transparent !important;
}

.activity-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.activity-icon {
  color: #4b6873;
  font-size: 17px;
  line-height: 1;
}

.audit-entry {
  border-color: transparent !important;
  background: #f7f2e9 !important;
  box-shadow: none !important;
}

.audit-entry p,
.audit-entry time {
  color: var(--muted);
}

.audit-entry p {
  font-size: 16px;
}

.year-modal[hidden] {
  display: none;
}

.year-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.year-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(52, 67, 74, 0.24);
  backdrop-filter: blur(2px);
}

.year-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 300px);
  max-height: min(520px, calc(100vh - 48px));
  padding: 20px 22px 18px;
  overflow: hidden;
  border: 0;
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(49, 70, 78, 0.18);
}

.year-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.year-dialog-header img {
  width: 22px;
  height: 22px;
}

.year-dialog-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

.year-dialog-close {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 25px;
  line-height: 20px;
}

.year-options {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.year-options button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  background: #e2edef;
  color: #4b6873;
  font: inherit;
  font-size: 15px;
}

.year-options button:hover,
.year-options button.is-selected {
  background: #4b6873;
  color: #fff;
}

.topbar-actions {
  gap: 12px;
}

/* Keep the period selector on its own centered row below the header controls. */
.topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand actions"
    "context context";
  row-gap: 4px;
}

.topbar .brand {
  grid-area: brand;
}

.topbar .context-controls {
  grid-area: context;
  width: 100%;
}

.topbar .topbar-actions {
  grid-area: actions;
  justify-self: end;
}

.period-tabs {
  width: min(100%, 980px);
  justify-content: space-between;
  gap: 8px;
}

.period-tabs button {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.year-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 40px;
  visibility: visible;
  opacity: 1;
}

.tenant-option {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  min-height: 40px;
  overflow: hidden;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: #e2edef;
  color: #4b6873;
  font: inherit;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tenant-option:hover {
  background: #d5e3e5;
}

.tenant-options button {
  text-align: left;
}

.main-heading h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 300;
}

.panel-header h2 {
  font-weight: 700;
}

.main-heading {
  position: relative;
  top: -20px;
}

.main-heading-action {
  display: flex;
  align-items: center;
  transform: translate(-20px, 10px);
}

.workspace:has(.activity-panel.is-collapsed) .main-heading-action {
  margin-right: 52px;
}

.view-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: transparent;
  color: #4b6873;
  font-size: 22px;
  font-weight: 500;
  position: relative;
  top: -3px;
  color: #4b6873;
}

.nav-item > span:last-child {
  display: flex;
  align-items: center;
}

.nav-item .nav-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  font-size: 22px;
  font-weight: 500;
  transform: translateY(-2px);
}

.nav-icon svg,
.work-icon svg,
.view-icon svg,
.activity-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
}

.work-icon svg {
  width: 22px;
  height: 22px;
}

.activity-icon {
  display: inline-flex;
}

.activity-toggle {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4b6873;
}

.activity-toggle:hover {
  background: transparent;
}

.activity-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 220ms ease;
}

.activity-panel.is-collapsed .activity-toggle svg {
  transform: none;
}

.activity-panel.is-collapsed .audit-list {
  display: none;
}

.workspace {
  position: relative;
  transition: grid-template-columns 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.workspace:has(.activity-panel.is-collapsed) {
  grid-template-columns: minmax(0, 1fr) 140px;
}

.activity-panel {
  overflow: hidden;
  transition: padding 300ms ease, background 300ms ease;
}

.activity-panel.is-collapsed {
  padding-right: 12px;
  padding-left: 12px;
}

.activity-panel.is-collapsed .activity-title {
  white-space: nowrap;
}

.workspace:has(.activity-panel.is-collapsed) {
  grid-template-columns: minmax(0, 1fr) 0;
}

.activity-panel.is-collapsed {
  width: 0;
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
}

.activity-reopen {
  position: absolute;
  top: 22px;
  right: 12px;
  z-index: 35;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #4b6873;
  opacity: 0;
  pointer-events: none;
  transform: translateX(32px);
  transition: opacity 220ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.activity-panel {
  background: #f1f3f2 !important;
  border-radius: 18px;
  transition: padding 300ms ease, background 300ms ease, opacity 260ms ease;
  transform: translateX(-30px);
}

.activity-panel .activity-heading,
.activity-panel .audit-list {
  opacity: 1;
  transition: opacity 220ms ease;
}

.activity-panel.is-collapsed .activity-heading,
.activity-panel.is-collapsed .audit-list {
  display: grid;
  opacity: 0;
}

/* The Activity gear remains one element and follows the panel edge. */
.activity-panel {
  position: relative;
  overflow: visible;
}

.activity-heading {
  position: relative;
  min-height: 28px;
}

.activity-title {
  display: block;
  width: 100%;
  height: 28px;
}

.activity-toggle {
  position: absolute;
  top: 0;
  left: 0;
}

.activity-panel.is-collapsed {
  padding-top: 22px !important;
}

.activity-panel.is-collapsed .activity-heading {
  display: block;
  opacity: 1;
}

.activity-panel.is-collapsed .activity-toggle {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  z-index: 40;
}

.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap table {
  width: 100%;
  table-layout: fixed;
}

.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap th,
.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap td {
  padding-right: 20px;
  padding-left: 20px;
}

.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap th:first-child,
.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap td:first-child {
  width: 18%;
}

.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap th:not(:first-child),
.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap td:not(:first-child) {
  width: 27.333%;
}

.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap table {
  min-width: 0;
}

.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap th,
.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap td {
  width: 25%;
  position: static;
}

.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap th:last-child,
.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap td:last-child {
  padding-right: 20px;
  text-align: right;
}

.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap th:first-child,
.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap td:first-child {
  width: 18%;
}

.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap th:nth-child(2),
.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap td:nth-child(2) {
  width: 48%;
}

.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap th:nth-child(3),
.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap td:nth-child(3) {
  width: 16%;
}

.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap th:last-child,
.workspace:has(.activity-panel.is-collapsed) main:has(.split-grid) .table-wrap td:last-child {
  width: 18%;
}

.activity-panel.is-collapsed ~ .activity-reopen {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.audit-entry {
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}

.activity-reopen svg {
  width: 18px;
  height: 18px;
  animation: none;
}

@keyframes activity-trigger-slide {
  0%,
  100% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
}

/* Workflow navigation sits below the overview cards as a light horizontal menu. */
.sidebar {
  border-right: 0 !important;
  border-bottom: 0 !important;
  padding: 10px 28px 16px;
  background: #fff !important;
}

.workflow-nav {
  display: flex;
  position: relative;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
}

.nav-item {
  width: auto;
  flex: 0 0 auto;
  min-height: 48px;
  grid-template-columns: 30px auto;
  gap: 4px;
  padding: 8px 14px;
  border: 0 !important;
  border-radius: 13px;
  background: transparent !important;
}

.nav-item:hover,
.nav-item.is-active {
  background: transparent !important;
  box-shadow: none;
}

.nav-item.is-active {
  box-shadow: none !important;
}

.nav-selection {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  height: 48px;
  border-radius: 13px;
  background: #e2edef;
  pointer-events: none;
  transition: left 300ms cubic-bezier(0.22, 1, 0.36, 1), width 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

body.dark-mode .sidebar {
  background: #1b272c !important;
}

body.dark-mode .nav-item {
  color: var(--text);
}

body.dark-mode .nav-item .nav-icon {
  color: #b7c9cf;
  background: #2b3a40;
}

body.dark-mode .nav-item:hover,
body.dark-mode .nav-item.is-active {
  color: #f5f1e8;
}

body.dark-mode .nav-selection {
  background: #2f454d;
}

body.dark-mode .brand img {
  filter: brightness(0) invert(1);
}

body.dark-mode .recommended-action {
  background: rgba(183, 201, 207, 0.5);
}

body.dark-mode .doc-confidence {
  color: #dce6e6;
  font-size: 13px;
  font-weight: 600;
}

body.dark-mode .confidence .subtle {
  color: #dce6e6;
  font-weight: 600;
}

body.dark-mode .doc-type {
  color: #dce6e6;
  font-weight: 600;
}

body.dark-mode .doc-id {
  color: #b9c9ce;
}

body.dark-mode .work-item {
  padding-top: 26px;
}

body.dark-mode .split-grid > .panel:first-child {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

body.dark-mode table td {
  color: #ffffff !important;
}

body.dark-mode table th {
  color: #9fb1b7 !important;
}

body.dark-mode table td .muted,
body.dark-mode table td small {
  color: #e5edf0 !important;
}

/* Frontoffice-style document cards. */
.doc-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.doc-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px 18px 14px;
  border: 0 !important;
  border-radius: 18px;
  background: rgba(232, 121, 121, 0.12) !important;
  box-shadow: none !important;
}

.doc-card:nth-child(3n) {
  background: rgba(98, 201, 137, 0.12) !important;
}

.doc-card:nth-child(3n + 1) {
  background: rgba(232, 121, 121, 0.12) !important;
}

.doc-card-top,
.doc-card-main,
.doc-card-bottom {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.doc-card-top {
  color: var(--muted);
  font-size: 11px;
}

.doc-card-top time {
  margin-left: auto;
  white-space: nowrap;
}

.doc-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #4b6873;
}

.doc-id {
  color: var(--muted-2);
}

.doc-card-main {
  justify-content: space-between;
}

.doc-card-main h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.doc-card-main p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.doc-card-finance {
  display: grid;
  justify-items: end;
  gap: 3px;
  flex: 0 0 auto;
}

.doc-card-finance strong {
  color: var(--red);
  font-size: 21px;
  font-weight: 500;
}

.doc-card:nth-child(3n) .doc-card-finance strong {
  color: var(--green);
}

.doc-card-finance span {
  color: var(--muted);
  font-size: 11px;
}

.doc-card-bottom {
  flex-wrap: wrap;
}

.doc-confidence {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #4b6873;
  font-size: 12px;
}

.doc-confidence img {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  object-fit: cover;
  box-shadow: none;
}

.doc-status {
  color: var(--green);
  font-size: 11px;
}

.doc-card-actions {
  display: flex;
  gap: 7px;
  margin-left: auto;
}

.doc-card-actions .button {
  min-height: 36px;
}

@media (max-width: 600px) {
  .doc-card-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .doc-card-finance {
    justify-items: start;
  }

  .doc-card-actions {
    width: 100%;
    margin-left: 0;
  }
}

/* Overview queue: horizontal actions above the control summary. */
.split-grid {
  grid-template-columns: minmax(0, 1fr);
}

.work-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  position: relative;
  top: -20px;
  margin-bottom: -20px;
}

.work-item {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 9px;
  min-height: 178px;
  padding: 16px;
  background: #f7f2e9 !important;
}

.work-item > div {
  width: 100%;
  text-align: center;
}

.work-item:nth-child(2) {
  background: rgba(232, 121, 121, 0.12) !important;
}

.work-item:nth-child(3) {
  background: #e2edef !important;
}

.work-item:nth-child(4) {
  background: rgba(98, 201, 137, 0.12) !important;
}

.work-item,
.work-item:nth-child(2),
.work-item:nth-child(3),
.work-item:nth-child(4) {
  background: transparent !important;
}

.work-item:nth-child(1) .work-icon,
.work-item:nth-child(1) .button {
  color: #ad8951;
}

.work-item:nth-child(2) .work-icon,
.work-item:nth-child(2) .button {
  color: #d97979;
}

.work-item:nth-child(3) .work-icon,
.work-item:nth-child(3) .button {
  color: #4b6873;
}

.work-item:nth-child(4) .work-icon,
.work-item:nth-child(4) .button {
  color: #58ad7b;
}

.work-item:nth-child(1) .button,
.work-item:nth-child(2) .button,
.work-item:nth-child(3) .button,
.work-item:nth-child(4) .button {
  color: #fff;
  box-shadow: none !important;
}

.work-item:nth-child(1) .button {
  background: #ad8951 !important;
}

.work-item:nth-child(2) .button {
  background: #d97979 !important;
}

.work-item:nth-child(3) .button {
  background: #4b6873 !important;
}

.work-item:nth-child(4) .button {
  background: #58ad7b !important;
}

.work-item:nth-child(1) h3 {
  color: #ad8951;
}

.work-item:nth-child(2) h3 {
  color: #d97979;
}

.work-item:nth-child(3) h3 {
  color: #4b6873;
}

.work-item:nth-child(4) h3 {
  color: #58ad7b;
}

.work-item .button {
  transition: filter 160ms ease;
}

.work-item .button:hover {
  filter: brightness(0.88);
}

.ai-action-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ai-action-button img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: none;
}

.ai-action-button,
.work-item .ai-action-button {
  position: relative;
  overflow: hidden;
  min-height: 38px;
  border: 0 !important;
  border-radius: 11px;
  background: #e2edef !important;
  color: #4b6873 !important;
  font-size: 12px;
  font-weight: 500;
}

.ai-action-button::after {
  display: none;
  position: absolute;
  top: -70%;
  left: -35%;
  width: 38%;
  height: 240%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
  content: "";
  pointer-events: none;
  transform: rotate(22deg) translateX(-420%);
  animation: rita-button-glare 14s ease-in-out infinite;
}

.ai-action-button > * {
  position: relative;
  z-index: 1;
}

.ai-action-button img {
  animation: rita-button-bump 8s ease-in-out infinite;
  transform-origin: 50% 90%;
}

@keyframes rita-button-bump {
  0%,
  78%,
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  82% {
    transform: translateY(-2px) scale(1.1) rotate(-4deg);
  }
  86% {
    transform: translateY(0) scale(0.96) rotate(3deg);
  }
  90% {
    transform: translateY(-1px) scale(1.04) rotate(-1deg);
  }
}

@keyframes rita-button-glare {
  0%,
  72% {
    transform: rotate(22deg) translateX(-420%);
  }
  84%,
  92% {
    transform: rotate(22deg) translateX(620%);
  }
  100% {
    transform: rotate(22deg) translateX(620%);
  }
}

.ai-action-button:hover,
.work-item .ai-action-button:hover {
  background: #d5e3e5 !important;
  color: #4b6873 !important;
  filter: none;
}

.work-item .button {
  width: 88%;
  margin-right: auto;
  margin-left: auto;
  color: #fff !important;
}

.work-item:nth-child(1) .ai-action-button,
.work-item:nth-child(1) .ai-action-button:hover {
  background: #ad8951 !important;
  color: #fff !important;
}

.work-item:nth-child(2) .ai-action-button,
.work-item:nth-child(2) .ai-action-button:hover {
  background: #d97979 !important;
  color: #fff !important;
}

.work-item:nth-child(4) .ai-action-button,
.work-item:nth-child(4) .ai-action-button:hover {
  background: #58ad7b !important;
  color: #fff !important;
}

.panel-header > .ai-action-button {
  position: relative;
  top: -6px;
}

.work-icon {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  background: transparent;
  color: #4b6873;
  font-size: 20px;
}

.work-item .button {
  width: 100%;
  justify-content: center;
  border: 0;
  background: transparent !important;
  color: #4b6873;
  box-shadow: none !important;
}

.work-item .button:hover {
  background: rgba(75, 104, 115, 0.08) !important;
}

.work-item:nth-child(1) .button:hover {
  background: #967442 !important;
  color: #fff !important;
}

.work-item:nth-child(2) .button:hover {
  background: #bd6262 !important;
  color: #fff !important;
}

.work-item:nth-child(3) .button:hover {
  background: #3a5660 !important;
  color: #fff !important;
}

.work-item:nth-child(4) .button:hover {
  background: #438c63 !important;
  color: #fff !important;
}

.kpi > span {
  font-size: 10px;
  letter-spacing: 0.015em;
}

.work-item h3 {
  margin-bottom: 6px;
}

.work-item .button {
  margin-top: auto;
}

.work-item .button {
  width: 65%;
  margin-right: auto;
  margin-left: auto;
}

.ai-action-button,
.work-item .ai-action-button,
.work-item:nth-child(1) .ai-action-button,
.work-item:nth-child(2) .ai-action-button,
.work-item:nth-child(4) .ai-action-button {
  background: #4f7180 !important;
  color: #fff !important;
}

.ai-action-button:hover,
.work-item .ai-action-button:hover,
.work-item:nth-child(1) .ai-action-button:hover,
.work-item:nth-child(2) .ai-action-button:hover,
.work-item:nth-child(4) .ai-action-button:hover {
  background: #3c5c69 !important;
  color: #fff !important;
}

.work-item .button {
  width: 52%;
  color: #fff !important;
}

.work-item:nth-child(1) .button,
.work-item:nth-child(1) .button:hover {
  background: #ad8951 !important;
}

.work-item:nth-child(2) .button,
.work-item:nth-child(2) .button:hover {
  background: #d97979 !important;
}

.work-item:nth-child(3) .button,
.work-item:nth-child(3) .button:hover {
  background: #4b6873 !important;
}

.work-item:nth-child(4) .button,
.work-item:nth-child(4) .button:hover {
  background: #58ad7b !important;
}

.ai-action-button,
.work-item .ai-action-button,
.work-item:nth-child(1) .ai-action-button,
.work-item:nth-child(2) .ai-action-button,
.work-item:nth-child(4) .ai-action-button {
  background: #e2edef !important;
  color: #4b6873 !important;
}

.ai-action-button:hover,
.work-item .ai-action-button:hover,
.work-item:nth-child(1) .ai-action-button:hover,
.work-item:nth-child(2) .ai-action-button:hover,
.work-item:nth-child(4) .ai-action-button:hover {
  background: #a5bbc2 !important;
  color: #385864 !important;
}

/* Keep section content clean: remove heading labels and divider rules. */
.panel-header:has(h2) {
  display: none;
}

.panel-header:has(.ai-action-button) {
  display: flex;
  border-bottom: 0;
}

.panel-header:has(.ai-action-button) h2 {
  display: none;
}

table th {
  color: #53666d;
}

table td {
  color: #53666d;
}

.table-wrap td {
  vertical-align: middle;
}

.reconciliation-table th,
.reconciliation-table td {
  width: 12%;
}

.reconciliation-table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}

.reconciliation-table col {
  width: auto !important;
}

.reconciliation-table col:nth-child(1) {
  width: 80px !important;
}

.reconciliation-table col:nth-child(2),
.reconciliation-table col:nth-child(3) {
  width: 230px !important;
}

.reconciliation-table col:nth-child(4) {
  width: 150px !important;
}

.reconciliation-table col:nth-child(5),
.reconciliation-table col:nth-child(6),
.reconciliation-table col:nth-child(7) {
  width: 120px !important;
}

.reconciliation-table col:nth-child(8) {
  width: 170px !important;
}

.reconciliation-table col:nth-child(1) { width: 7% !important; }
.reconciliation-table col:nth-child(2) { width: 22% !important; }
.reconciliation-table col:nth-child(3) { width: 22% !important; }
.reconciliation-table col:nth-child(4) { width: 12% !important; }
.reconciliation-table col:nth-child(5) { width: 10% !important; }
.reconciliation-table col:nth-child(6) { width: 10% !important; }
.reconciliation-table col:nth-child(7) { width: 9% !important; }
.reconciliation-table col:nth-child(8) { width: 8% !important; }

.reconciliation-table col:nth-child(1) { width: 7% !important; }
.reconciliation-table col:nth-child(2) { width: 24% !important; }
.reconciliation-table col:nth-child(3) { width: 24% !important; }
.reconciliation-table col:nth-child(4) { width: 13% !important; }
.reconciliation-table col:nth-child(5) { width: 12% !important; }
.reconciliation-table col:nth-child(6) { width: 12% !important; }
.reconciliation-table col:nth-child(7) { width: 8% !important; }

.reconciliation-table th,
.reconciliation-table td {
  width: auto !important;
}

.reconciliation-table th:first-child,
.reconciliation-table td:first-child {
  width: 60px !important;
  min-width: 60px;
}

.reconciliation-table th:nth-child(2),
.reconciliation-table td:nth-child(2) {
  width: 23%;
}

.reconciliation-table th,
.reconciliation-table td {
  width: auto !important;
  min-width: 0;
}

.reconciliation-table th:nth-child(4),
.reconciliation-table td:nth-child(4) {
  padding-left: 78px;
}

.confidence-heading {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.confidence-heading img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

.reconciliation-table th:nth-child(2),
.reconciliation-table td:nth-child(2),
.reconciliation-table th:nth-child(3),
.reconciliation-table td:nth-child(3) {
  padding-left: 40px;
}

.reconciliation-table th:nth-child(5),
.reconciliation-table td:nth-child(5),
.reconciliation-table th:nth-child(6),
.reconciliation-table td:nth-child(6) {
  padding-left: 30px;
}

.reconciliation-table th:nth-child(5),
.reconciliation-table td:nth-child(5) {
  vertical-align: middle;
}

.reconciliation-table td:nth-child(5) .confidence {
  align-content: center;
}

table th,
table td,
table tr:last-child td {
  border-bottom: 0 !important;
}

.table-wrap .badge {
  border: 0 !important;
  color: #fff !important;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
}

.table-wrap .badge-cyan {
  background: #5d7f89 !important;
}

.table-wrap .badge-amber {
  background: #b48848 !important;
}

.table-wrap .badge-red {
  background: #c96868 !important;
}

.table-wrap .badge-green {
  background: #4e9d70 !important;
}

.table-wrap td:has(.badge) {
  vertical-align: middle;
}

@media (max-width: 1000px) {
  .work-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .work-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.nav-icon {
  background: transparent !important;
  color: #4b6873;
}

.workspace {
  grid-template-columns: minmax(0, 1fr) 230px;
}

@media (max-width: 900px) {
  .workflow-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}

.rita-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 80;
  width: 66px;
  height: 66px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  animation: rita-float 3.2s ease-in-out infinite;
}

.rita-fab img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: none;
}

.rita-fab:hover {
  transform: translateY(-2px);
  animation-play-state: paused;
}

@keyframes rita-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.rita-chat-overlay[hidden],
.rita-drawer[hidden] {
  display: none;
}

.rita-chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(52, 67, 74, 0.18);
  backdrop-filter: blur(2px);
}

.rita-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  width: min(100%, 430px);
  padding: 20px 22px 18px;
  background: #fff;
  box-shadow: -12px 0 36px rgba(49, 70, 78, 0.14);
}

.rita-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rita-back,
.rita-close {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4b6873;
  font: inherit;
}

.rita-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
}

.rita-back:first-letter {
  font-size: 24px;
}

.rita-close {
  width: 28px;
  color: var(--muted);
  font-size: 25px;
}

.rita-drawer-intro {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 20px 0 26px;
}

.rita-drawer-intro img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: none;
}

.rita-drawer-intro h2 {
  margin: 0;
  color: var(--text);
  font-size: 23px;
  font-weight: 500;
  text-align: center;
}

.rita-chat-content {
  align-self: start;
  padding: 18px 14px;
  border-radius: 18px;
  background: #fbfaf7;
}

.rita-prompt-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.rita-prompt-grid button {
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  background: #e2edef;
  color: #4b6873;
  font: inherit;
  font-size: 12px;
}

.rita-prompt-grid button:hover {
  background: #d5e3e5;
}

.rita-response {
  margin-top: 16px;
  padding: 14px;
  border-radius: 13px;
  background: #f7f2e9;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.rita-response[hidden] {
  display: none;
}

.rita-response strong {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.rita-response p {
  margin: 0;
  color: var(--muted);
}

.rita-ask-form {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  background: #b7c9cf;
}

.rita-ask-form img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: none;
}

.rita-ask-form input,
.rita-ask-form textarea {
  min-height: 42px;
  height: 42px;
  max-height: 42px;
  resize: none;
  overflow-y: auto;
  border: 0 !important;
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff;
  color: var(--text);
}

.rita-ask-form button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #4b6873;
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

body.dark-mode .rita-chat-overlay {
  background: rgba(10, 18, 22, 0.58);
}

body.dark-mode .rita-drawer {
  background: #1b272c;
  box-shadow: -12px 0 36px rgba(5, 12, 15, 0.38);
}

body.dark-mode .rita-back,
body.dark-mode .rita-close {
  color: #dce6e6;
}

body.dark-mode .rita-chat-content {
  background: #243238;
}

body.dark-mode .rita-prompt-grid button {
  background: #2f454d;
  color: #dce6e6;
}

body.dark-mode .rita-prompt-grid button:hover {
  background: #3c5861;
}

body.dark-mode .rita-response {
  background: #2b3a40;
  color: #ffffff;
}

body.dark-mode .rita-response p {
  color: #dce6e6;
}

body.dark-mode .rita-ask-form {
  background: #40565e;
}

body.dark-mode .rita-ask-form input,
body.dark-mode .rita-ask-form textarea {
  background: #243238;
  color: #ffffff;
}

body.dark-mode .rita-ask-form button {
  background: #b7c9cf;
  color: #1b272c;
}

@media (max-width: 600px) {
  .rita-fab {
    right: 18px;
    bottom: 18px;
  }

  .rita-drawer {
    padding: 16px;
  }
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (max-width: 800px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 16px;
  }

  .period-tabs {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .period-tabs button {
    flex: 0 0 auto;
    min-width: max-content;
    padding-right: 4px;
    padding-left: 4px;
    font-size: 12px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .year-option {
    padding-right: 10px;
    padding-left: 10px;
  }

  .tenant-option {
    max-width: 145px;
  }
}
