:root {
  color-scheme: light;
  --ink: #27312b;
  --brand: #313e35;
  --brand-soft: #6f8d80;
  --sand: #e2dccf;
  --canvas: #f5f3ee;
  --surface: #ffffff;
  --surface-soft: #f0eee8;
  --line: #d9d6ce;
  --muted: #68716b;
  --positive: #2f6a4f;
  --positive-soft: #e5f1e9;
  --negative: #a0443f;
  --negative-soft: #f8e9e7;
  --warning: #86621e;
  --warning-soft: #fbf3dc;
  --shadow: 0 18px 45px rgb(49 62 53 / 9%);
  font-family: Lato, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--ink);
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgb(111 141 128 / 35%);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.login-shell {
  align-items: center;
  background:
    radial-gradient(circle at 14% 12%, rgb(226 220 207 / 75%), transparent 34rem),
    linear-gradient(145deg, #f7f5f0, #ece9e1);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
}

.login-card {
  background: var(--surface);
  border: 1px solid rgb(49 62 53 / 8%);
  border-radius: 22px;
  box-shadow: var(--shadow);
  max-width: 430px;
  padding: 42px;
  width: 100%;
}

.brand-mark {
  align-items: center;
  background: var(--brand);
  border-radius: 15px;
  color: var(--sand);
  display: inline-flex;
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  height: 50px;
  justify-content: center;
  margin-bottom: 28px;
  width: 50px;
}

.brand-mark.small {
  border-radius: 10px;
  font-size: 20px;
  height: 38px;
  margin: 0;
  width: 38px;
}

.eyebrow {
  color: var(--brand-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

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

h1 {
  color: var(--brand);
  font-family: Georgia, serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 12px;
}

h2 {
  color: var(--brand);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 5px;
}

.intro,
.page-heading p,
.section-heading p {
  color: var(--muted);
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.login-form label,
.report-actions label {
  display: grid;
  gap: 7px;
}

.login-form label > span,
.report-actions label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

input,
select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  min-height: 44px;
  padding: 10px 12px;
}

.button {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  min-height: 42px;
  padding: 9px 15px;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:hover {
  border-color: var(--brand-soft);
}

.button:active {
  transform: translateY(1px);
}

.button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 700;
}

.button.primary:hover {
  background: #253129;
}

.button.subtle {
  background: var(--surface-soft);
}

.button.ghost {
  background: transparent;
  border-color: transparent;
}

.button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.form-error {
  background: var(--negative-soft);
  border-radius: 8px;
  color: var(--negative);
  font-size: 14px;
  margin: 0;
  padding: 11px 12px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: rgb(245 243 238 / 94%);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 58px);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.brand-button {
  align-items: center;
  background: transparent;
  border: 0;
  display: flex;
  gap: 12px;
  padding: 0;
  text-align: left;
}

.brand-button strong,
.brand-button small {
  display: block;
}

.brand-button strong {
  color: var(--brand);
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 600;
}

.brand-button small {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 8px;
}

.source-badge,
.reconciliation-badge {
  background: var(--warning-soft);
  border-radius: 999px;
  color: var(--warning);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 9px;
}

.content {
  margin: 0 auto;
  max-width: 1480px;
  padding: clamp(32px, 5vw, 68px) clamp(16px, 4vw, 58px) 70px;
}

.page-heading {
  align-items: end;
  display: flex;
  gap: 30px;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-heading > div:first-child {
  max-width: 760px;
}

.page-heading p {
  margin-bottom: 0;
}

.updated-at {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  white-space: nowrap;
}

.loading-state {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 12px;
  min-height: 110px;
}

.loading-state::before {
  animation: spin 800ms linear infinite;
  border: 3px solid var(--sand);
  border-radius: 50%;
  border-top-color: var(--brand-soft);
  content: "";
  height: 22px;
  width: 22px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.notice {
  border-radius: 10px;
  line-height: 1.45;
  margin-bottom: 18px;
  padding: 13px 15px;
}

.notice.error {
  background: var(--negative-soft);
  color: var(--negative);
}

.notice.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.table-shell,
.statement-panel,
.chart-panel {
  background: var(--surface);
  border: 1px solid rgb(49 62 53 / 8%);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgb(49 62 53 / 5%);
}

.table-shell,
.statement-scroll {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 15px 16px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.number {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.company-name {
  color: var(--brand);
  font-weight: 700;
  min-width: 150px;
}

.company-name small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 400;
  margin-top: 4px;
}

.row-action {
  background: transparent;
  border: 0;
  color: var(--brand-soft);
  font-weight: 700;
  padding: 8px 2px;
  white-space: nowrap;
}

.row-action:hover {
  color: var(--brand);
}

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

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

.footnote {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 14px 4px 0;
}

.back-button {
  background: transparent;
  border: 0;
  color: var(--brand-soft);
  font-weight: 700;
  margin: 0 0 24px;
  padding: 0;
}

.result-heading {
  align-items: start;
}

.report-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.report-actions select {
  min-width: 210px;
}

.kpi-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid rgb(49 62 53 / 8%);
  border-radius: 14px;
  padding: 20px;
}

.kpi-card.accent {
  background: var(--brand);
  color: #fff;
}

.kpi-card > span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 9px;
}

.kpi-card.accent > span {
  color: var(--sand);
}

.kpi-card strong {
  display: block;
  font-size: clamp(20px, 2.4vw, 29px);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.chart-panel,
.statement-panel {
  margin-bottom: 18px;
  padding: 22px;
}

.section-heading {
  align-items: start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading p {
  font-size: 13px;
  margin-bottom: 0;
}

.monthly-chart {
  min-height: 230px;
  overflow-x: auto;
}

.monthly-chart svg {
  display: block;
  min-width: 720px;
  width: 100%;
}

.chart-axis {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-bar-positive {
  fill: var(--brand-soft);
}

.chart-bar-negative {
  fill: #b3655f;
}

.chart-label,
.chart-value {
  fill: var(--muted);
  font-family: inherit;
  font-size: 11px;
}

.chart-value {
  fill: var(--ink);
  font-weight: 700;
}

.quality-notices {
  margin-bottom: 18px;
}

.quality-notices:empty {
  display: none;
}

.quality-notices .notice:last-child {
  margin-bottom: 0;
}

.statement-heading {
  margin-bottom: 12px;
}

.reconciliation-badge.ok {
  background: var(--positive-soft);
  color: var(--positive);
}

.reconciliation-badge.fail {
  background: var(--negative-soft);
  color: var(--negative);
}

.statement-table {
  font-size: 13px;
  min-width: 980px;
}

.statement-table th,
.statement-table td {
  padding: 11px 12px;
}

.statement-table th:first-child,
.statement-table td:first-child {
  background: var(--surface);
  left: 0;
  min-width: 280px;
  position: sticky;
  z-index: 2;
}

.statement-table thead th {
  background: var(--surface-soft);
  position: sticky;
  top: 0;
  z-index: 3;
}

.statement-table thead th:first-child {
  background: var(--surface-soft);
  z-index: 4;
}

.statement-table .group-row td {
  font-weight: 700;
}

.statement-table .subtotal-row td {
  background: var(--surface-soft);
  color: var(--brand);
  font-weight: 800;
}

.statement-table .subtotal-row td:first-child {
  background: var(--surface-soft);
}

.statement-table .subtotal-row.net td {
  background: var(--brand);
  color: #fff;
}

.statement-table .subtotal-row.net td:first-child {
  background: var(--brand);
}

.statement-table .warning-row td {
  background: var(--warning-soft);
  color: var(--warning);
}

.statement-table .warning-row td:first-child {
  background: var(--warning-soft);
}

.statement-table .excluded-row td {
  color: var(--muted);
  font-style: italic;
}

.statement-table .account-row td {
  color: var(--muted);
  font-size: 12px;
}

.statement-table .account-row td:first-child {
  padding-left: 42px;
}

.statement-table .account-number {
  color: var(--brand-soft);
  display: inline-block;
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
  min-width: 54px;
}

.expand-button {
  align-items: center;
  background: transparent;
  border: 0;
  display: inline-flex;
  font-weight: inherit;
  gap: 8px;
  padding: 0;
  text-align: left;
}

.expand-icon {
  color: var(--brand-soft);
  display: inline-block;
  font-size: 12px;
  transition: transform 120ms ease;
}

.expand-button[aria-expanded="true"] .expand-icon {
  transform: rotate(90deg);
}

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 11px;
  justify-content: space-between;
  margin: 0 clamp(16px, 4vw, 58px);
  padding: 20px 0 28px;
}

.toast {
  background: var(--brand);
  border-radius: 10px;
  bottom: 22px;
  box-shadow: var(--shadow);
  color: #fff;
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 50;
}

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

  .result-heading {
    display: block;
  }

  .report-actions {
    justify-content: flex-start;
    margin-top: 22px;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .topbar-actions .button {
    min-height: 38px;
    padding: 7px 10px;
  }

  .page-heading {
    align-items: start;
    display: block;
  }

  .page-heading .updated-at {
    margin-top: 14px;
  }

  .overview-table th:nth-child(3),
  .overview-table td:nth-child(3),
  .overview-table th:nth-child(4),
  .overview-table td:nth-child(4),
  .overview-table th:nth-child(6),
  .overview-table td:nth-child(6) {
    display: none;
  }

  .report-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .report-actions select {
    min-width: 0;
    width: 100%;
  }

  .statement-panel,
  .chart-panel {
    border-radius: 12px;
    padding: 16px;
  }

  footer {
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 28px 22px;
  }

  .brand-button > span:last-child,
  #refresh-button,
  .source-badge {
    display: none;
  }

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

  .kpi-card {
    padding: 16px;
  }

  .section-heading {
    display: block;
  }

  .section-heading .updated-at,
  .reconciliation-badge {
    display: inline-block;
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
/* Monitor layout; palette/typography base copied from the existing Results release. */
.source-badge{display:inline-block;background:var(--surface-soft);border:1px solid var(--line);color:var(--brand);padding:5px 9px;border-radius:6px;font-size:12px;margin:4px 0}.source-badge.dropbox{background:#eaf0ee}.candidate-section{margin-top:48px;border-top:1px solid var(--line);padding-top:28px}.candidate-card{border-left:4px solid var(--brand-soft)}.candidate-card h3{font-family:Georgia,serif;font-size:23px;margin:22px 0 10px}.match-link{display:block;color:var(--brand);margin:12px 0}
.primary-button,.secondary-button{border:1px solid var(--line);border-radius:8px;padding:10px 16px;font-weight:600;background:var(--surface);font-size:13px}.primary-button{background:var(--brand);border-color:var(--brand);color:var(--sand)}.secondary-button:hover{background:var(--surface-soft)}.primary-button:disabled,.secondary-button:disabled{opacity:.6;cursor:wait}
.monitor-header{display:flex;justify-content:space-between;align-items:center;padding:22px 4vw;background:var(--surface);border-bottom:1px solid var(--line);gap:20px}.brand-link{display:flex;align-items:center;gap:14px;color:var(--brand);text-decoration:none;letter-spacing:.12em}.brand-link strong{display:block;letter-spacing:0;font-size:22px}.brand-link .brand-mark{margin:0}.header-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.monitor-main{max-width:1320px;margin:auto;padding:32px 36px 60px}.snapshot-status{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:38px;font-size:13px}.status-dot{width:8px;height:8px;border-radius:50%;background:var(--brand-soft)}.status-dot.warning{background:var(--warning)}.status-pill{display:inline-block;padding:5px 9px;border-radius:6px;background:var(--surface-soft);color:var(--muted);font-size:12px}.status-pill.warning{background:var(--warning-soft);color:var(--warning)}.lead-copy{max-width:820px;color:var(--muted);line-height:1.7;font-size:17px}.monitor-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;margin:28px 0}.monitor-kpi{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:22px}.monitor-kpi strong{display:block;font-size:34px;margin-top:8px;font-weight:500}.monitor-toolbar{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:30px 0 18px}.search{max-width:440px;width:100%;padding:12px 16px;border:1px solid var(--line);border-radius:9px;background:var(--surface)}.dossier-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}.dossier-card{display:block;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:24px;text-decoration:none;color:var(--ink);transition:box-shadow .15s}.dossier-card:hover{box-shadow:var(--shadow);border-color:var(--brand-soft)}.dossier-card.unassigned{background:var(--surface-soft)}.card-top{display:flex;justify-content:space-between;gap:10px;align-items:center}.card-top .eyebrow{margin:0}.dossier-card h2{font-size:24px;margin:22px 0 12px}.summary{line-height:1.7;min-height:82px;color:var(--muted)}.small-copy{font-size:12px}.card-counts{border-top:1px solid var(--line);padding-top:16px;display:flex;gap:9px 14px;flex-wrap:wrap;font-size:12px}.card-link{display:block;margin-top:20px;font-weight:600;color:var(--brand-soft)}.back-link{display:inline-block;margin-bottom:26px;text-decoration:none;color:var(--brand-soft)}.monitor-tabs{display:flex;gap:4px;flex-wrap:wrap;border-bottom:1px solid var(--line);margin-top:30px}.monitor-tabs a{padding:15px;color:var(--muted);text-decoration:none;border-bottom:3px solid transparent}.monitor-tabs a.active{color:var(--brand);border-color:var(--brand-soft);font-weight:600}.detail-panel{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:28px;margin-top:24px}.fact-row{padding:22px 0;border-top:1px solid var(--line)}.fact-description{font-size:16px;line-height:1.7;white-space:pre-wrap}.source-id{overflow-wrap:anywhere;font-size:12px}.empty-state{padding:30px 0;color:var(--muted)}.monitor-footer{text-align:center;padding:22px;font-size:12px;color:var(--muted);border-top:1px solid var(--line)}.login-card label{display:block;font-size:13px;margin:18px 0 8px}.login-card input{width:100%;padding:12px;border:1px solid var(--line);border-radius:8px}.login-card button{width:100%;margin-top:22px}.error-box{padding:16px;background:var(--negative-soft);color:var(--negative);border-radius:10px}#loginError{color:var(--negative)}
@media(max-width:1050px){.dossier-grid{grid-template-columns:repeat(2,1fr)}.monitor-header{align-items:flex-start}.header-actions{justify-content:flex-end}.monitor-kpis{grid-template-columns:repeat(2,1fr)}}@media(max-width:650px){.monitor-header{flex-direction:column;padding:18px}.header-actions{justify-content:flex-start}.monitor-main{padding:24px 18px}.dossier-grid{grid-template-columns:1fr}.monitor-kpis{gap:10px}.monitor-kpi{padding:16px}.monitor-tabs a{padding:12px 8px;font-size:13px}.snapshot-status{margin-bottom:24px}.detail-panel{padding:20px}.monitor-toolbar{align-items:flex-start;flex-direction:column}}

