:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-muted: #faf7f0;
  --ink: #1f2428;
  --muted: #687076;
  --line: #ded7cb;
  --line-strong: #c8beb0;
  --accent: #0a6b5d;
  --accent-strong: #064c43;
  --accent-soft: #e3f3ee;
  --warning: #a86110;
  --warning-soft: #fff4df;
  --danger: #a23a2e;
  --danger-soft: #fde9e6;
  --success: #2f7d52;
  --success-soft: #e4f3e9;
  --shadow: 0 12px 30px rgba(31, 36, 40, 0.08);
  --font-display: "Aptos Display", "Segoe UI Variable Display", "Segoe UI Semibold", "Segoe UI", sans-serif;
  --font-body: "Aptos", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", Consolas, monospace;
  --text-xs: 0.76rem;
  --text-sm: 0.86rem;
  --text-md: 0.95rem;
  --text-lg: 1.08rem;
  --text-xl: 1.36rem;
  --text-2xl: 1.72rem;
  --weight-regular: 400;
  --weight-medium: 550;
  --weight-semibold: 650;
  --weight-bold: 720;
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  font-size: 15px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(135deg, rgba(10, 107, 93, 0.08), transparent 32rem),
    linear-gradient(180deg, #f7f4ee 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  line-height: 1.5;
  letter-spacing: -0.006em;
  font-feature-settings: "kern" 1, "liga" 1, "tnum" 1;
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  color: #1d2529;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.025em;
  line-height: 1.16;
}
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); }
strong { font-weight: var(--weight-semibold); }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 0.6rem 0.68rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  color: #4f5960;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.045em;
  text-transform: uppercase;
  background: rgba(250, 247, 240, 0.72);
}
td {
  font-size: var(--text-sm);
  line-height: 1.45;
}
tr:hover td { background: rgba(227, 243, 238, 0.22); }
pre {
  max-height: 340px;
  overflow: auto;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.5;
  background: var(--surface-muted);
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.body-text-panel {
  max-height: 360px;
  margin: 0.15rem 0 0;
  padding: 0.15rem 0 0;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.45;
}
.body-text-header-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.35rem;
}
.body-text-label {
  color: var(--accent-strong);
  font-weight: var(--weight-semibold);
}
.body-text-line {
  white-space: pre-wrap;
}
.body-text-blank {
  height: 0.55rem;
}
.source-disclosure {
  margin-top: 0.55rem;
  border-top: 1px solid var(--line);
  padding-top: 0.35rem;
}
.source-disclosure summary {
  padding: 0.25rem 0;
}
.empty-panel {
  margin-top: 0.25rem;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: var(--text-sm);
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1rem 0;
}
summary {
  cursor: pointer;
  font-weight: var(--weight-semibold);
  padding: 0.35rem 0;
}
details + details { margin-top: 0.65rem; }
input, select, textarea, button {
  font: inherit;
  border-radius: 9px;
  border: 1px solid var(--line);
  padding: 0.55rem 0.68rem;
}
input, select, textarea {
  min-width: 0;
  background: #fff;
  color: var(--ink);
}
input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  padding: 0;
  accent-color: var(--accent);
}
textarea {
  min-height: 90px;
  resize: vertical;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(10, 107, 93, 0.18);
  border-color: var(--accent);
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0;
  padding: 0.7rem;
}
legend {
  color: var(--muted);
  font-weight: var(--weight-semibold);
  padding: 0 0.3rem;
}
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0.5rem 0.72rem;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: var(--weight-semibold);
  line-height: 1.1;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease, opacity 120ms ease;
}
button:hover, .button:hover {
  transform: translateY(-1px);
  text-decoration: none;
}
button:disabled, .button[aria-disabled="true"] {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}
.btn-sm, .table-action {
  min-height: 28px;
  padding: 0.34rem 0.52rem;
  border-radius: 8px;
  font-size: var(--text-sm);
}
.secondary { background: #496a65; }
.danger { background: var(--danger); }
.ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.button-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}

.shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  min-height: 100vh;
  padding: 1.25rem 1rem;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 10;
}
.brand h1 { font-size: 1.18rem; }
.brand .muted { margin: 0.25rem 0 0; font-size: var(--text-sm); }
.sidebar nav {
  display: grid;
  gap: 0.2rem;
  margin: 1.25rem 0;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  color: #2f383d;
  font-weight: var(--weight-medium);
  letter-spacing: -0.005em;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}
.main {
  grid-column: 2;
  min-width: 0;
  padding: 1.25rem 1.35rem 2.5rem;
}
.user-card {
  margin-top: 0.85rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--text-sm);
}
.user-display-name {
  color: var(--ink);
  font-weight: var(--weight-semibold);
  word-break: break-word;
}

.manual-ingest-control {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: grid;
  justify-items: stretch;
  gap: 0.35rem;
}
.manual-ingest-button {
  min-height: 34px;
  width: 100%;
  border-radius: 10px;
  padding: 0.48rem 0.8rem;
  box-shadow: none;
}
.manual-ingest-status {
  min-height: 1.1rem;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  box-shadow: none;
}
.manual-ingest-status:empty { display: none; }
.manual-ingest-status[data-state="success"] { color: var(--success); }
.manual-ingest-status[data-state="warning"] { color: var(--warning); }
.manual-ingest-status[data-state="error"] { color: var(--danger); }

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: grid;
  gap: 0.45rem;
  width: min(360px, calc(100vw - 2rem));
}
.toast {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--danger); }

.hero, .section-header { margin: 0 0 1rem 0; }
.split-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.085em;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}
.muted { color: var(--muted); }
.compact { font-size: var(--text-sm); }
.mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.45;
  margin-top: 0.35rem;
}
.money { text-align: right; white-space: nowrap; }
.amount-flag { color: var(--warning); font-weight: var(--weight-bold); }
.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.grid-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 0.9rem;
}
.grid-two + .grid-two,
.stacked-card {
  margin-top: 0.9rem;
}
.card {
  background: var(--surface);
  border: 1px solid rgba(200, 190, 176, 0.72);
  border-radius: 14px;
  padding: 0.95rem;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 0.75rem; }
.metric strong {
  display: block;
  margin-top: 0.35rem;
  font-size: var(--text-2xl);
  line-height: 1;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}
.pill.warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.pill.success {
  background: var(--success-soft);
  color: var(--success);
}
.pill.muted-pill {
  background: rgba(102, 111, 112, 0.12);
  color: var(--muted);
}

.queue-card { margin-bottom: 0.9rem; overflow: hidden; }
.queue-title {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 0.65rem;
}
.queue-title h3 { margin: 0.1rem 0 0; }
.queue-pending { border-top: 4px solid var(--warning); }
.queue-approved { border-top: 4px solid var(--success); }
.queue-rejected { border-top: 4px solid var(--danger); }
.table-scroll { overflow-x: auto; }
.review-table th,
.review-table td { white-space: nowrap; }
.review-table .vendor-cell,
.review-table .issue-cell { min-width: 220px; white-space: normal; }
.review-table .vendor-name {
  display: block;
  max-width: 260px;
  font-weight: var(--weight-semibold);
}
.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: var(--text-xs);
}
.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: var(--weight-semibold);
}
.table-action:hover { text-decoration: none; }
.table-sort-button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.table-sort-button:hover {
  color: var(--accent-strong);
  transform: none;
}
.table-sort-button span {
  margin-left: 0.18rem;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: -0.12em;
}
.table-sort-button[data-direction="asc"] span::after {
  content: " asc";
  color: transparent;
  font-size: 0;
}
.table-sort-button[data-direction="desc"] span::after {
  content: " desc";
  color: transparent;
  font-size: 0;
}

.review-workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(360px, 0.95fr);
  gap: 0.9rem;
  align-items: start;
}
.review-detail-layout {
  display: grid;
  gap: 0.9rem;
}
.review-top-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(380px, 0.95fr);
  gap: 0.9rem;
  align-items: start;
}
.review-decision-sections {
  display: grid;
  gap: 0;
}
.review-action-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: -0.35rem 0 0.9rem;
  padding: 0.72rem 0.82rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 10px 24px rgba(31, 36, 40, 0.08);
  backdrop-filter: blur(12px);
}
.review-action-title strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: -0.018em;
}
.review-action-title span { color: var(--muted); font-size: var(--text-sm); }
.summary-ledger {
  margin-top: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.summary-ledger-group {
  border-top: 1px solid var(--line);
}
.summary-ledger-group:first-child {
  border-top: 0;
}
.summary-ledger-group h4 {
  margin: 0;
  padding: 0.52rem 0.78rem;
  background: var(--surface-muted);
  color: #314047;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.015em;
}
.summary-ledger-grid {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr) 135px minmax(0, 1fr);
  margin: 0;
}
.summary-ledger-grid dt,
.summary-ledger-grid dd {
  min-height: 2.15rem;
  margin: 0;
  padding: 0.46rem 0.75rem;
  border-top: 1px solid rgba(56, 67, 73, 0.08);
}
.summary-ledger-grid dt:nth-of-type(1),
.summary-ledger-grid dd:nth-of-type(1),
.summary-ledger-grid dt:nth-of-type(2),
.summary-ledger-grid dd:nth-of-type(2) {
  border-top: 0;
}
.summary-ledger-grid dt {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  background: rgba(250, 247, 240, 0.52);
}
.summary-ledger-grid dd {
  color: var(--text);
  overflow-wrap: anywhere;
}
.summary-ledger-grid dd.money {
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-semibold);
}
.summary-ledger-grid-wide {
  grid-template-columns: 155px minmax(0, 1fr);
}
.summary-ledger-grid-wide dt:nth-of-type(2),
.summary-ledger-grid-wide dd:nth-of-type(2) {
  border-top: 1px solid rgba(56, 67, 73, 0.08);
}
.detail-list {
  display: grid;
  grid-template-columns: 135px 1fr;
  gap: 0.45rem 0.8rem;
}
.detail-list-compact {
  grid-template-columns: 125px minmax(0, 1fr);
  gap: 0.34rem 0.7rem;
}
.detail-list dt {
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.detail-list dd { margin: 0; }
.source-card {
  position: sticky;
  top: 5.2rem;
}
.source-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
.source-card-header h3 {
  margin: 0;
}
.review-top-grid .source-card {
  position: static;
}
.pdf-frame {
  width: 100%;
  min-height: calc(100vh - 13rem);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.pdf-frame-compact {
  min-height: 480px;
  max-height: 64vh;
}
.stack-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.stack-form label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-weight: var(--weight-medium);
}
.stack-form label.full { grid-column: 1 / -1; }
.form-control-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.15rem;
}
.checkbox-group,
.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.form-actions {
  justify-content: flex-end;
  margin-left: auto;
}
.checkbox-label {
  display: inline-flex !important;
  align-items: center;
  grid-template-columns: none !important;
  gap: 0.45rem !important;
  min-height: 38px;
}
.form-control-row .button {
  min-width: 145px;
}
.suggestions-list {
  display: grid;
  gap: 0.65rem;
}
.suggestion-item {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: start;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}
.inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.4rem 0 0;
}
.inline-gap {
  margin-top: 0.25rem;
}
.summary-with-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}
.itemized-summary-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  cursor: default;
}
details:not([open]) .itemized-summary-filter {
  display: none;
}
.itemized-summary-filter select {
  min-height: 30px;
  padding: 0.28rem 1.75rem 0.28rem 0.5rem;
  border-radius: 8px;
  font-size: var(--text-sm);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}
.ledger-card .queue-title {
  margin-bottom: 0.45rem;
}
.ledger-table th,
.ledger-table td {
  white-space: nowrap;
}
.ledger-table .vendor-cell {
  min-width: 240px;
  white-space: normal;
}
.ledger-table .ledger-source-cell {
  min-width: 210px;
  white-space: normal;
}
.report-filter-card {
  margin-bottom: 0.85rem;
  padding: 0.78rem;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(31, 36, 40, 0.06);
}
.report-filter-form {
  display: grid;
  gap: 0.55rem;
}
.report-filter-main,
.report-filter-secondary {
  display: grid;
  gap: 0.55rem;
  align-items: end;
}
.report-filter-main {
  grid-template-columns: minmax(300px, 1.45fr) 145px 145px 145px 145px auto;
}
.report-filter-secondary {
  grid-template-columns: 145px minmax(220px, 0.8fr) 190px 165px minmax(0, 1fr);
}
.report-filter-form label,
.report-advanced-grid label {
  display: grid;
  gap: 0.22rem;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.01em;
}
.report-filter-card input,
.report-filter-card select {
  width: 100%;
  min-height: 36px;
  padding: 0.42rem 0.55rem;
  border-radius: 9px;
  font-size: var(--text-sm);
}
.report-filter-card .button {
  min-height: 36px;
  padding: 0.46rem 0.7rem;
  border-radius: 9px;
}
.report-filter-actions {
  align-self: end;
  justify-content: flex-end;
  white-space: nowrap;
}
.report-advanced-filters,
.filter-chip-row {
  grid-column: 1 / -1;
}
.report-advanced-filters {
  border-top: 1px solid var(--line);
  margin-top: 0;
  padding-top: 0.2rem;
}
.report-advanced-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 0.65rem;
  padding-top: 0.35rem;
}
.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-top: 0.1rem;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  background: var(--surface-muted);
  color: #536067;
  border: 1px solid var(--line);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
.filter-chip.strong {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: transparent;
}
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.65rem;
}
.report-metric {
  padding: 0.78rem 0.9rem;
}
.report-metric span,
.report-secondary-summary span {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.report-metric strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.52rem;
  line-height: 1;
}
.report-metric.highlight {
  border-color: rgba(10, 107, 93, 0.24);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
}
.report-secondary-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding: 0.7rem 0.85rem;
}
.report-secondary-summary div {
  min-width: 0;
  padding-right: 0.65rem;
  border-right: 1px solid var(--line);
}
.report-secondary-summary div:last-child { border-right: 0; }
.report-secondary-summary strong {
  display: block;
  margin-top: 0.12rem;
  font-size: var(--text-md);
}
.report-results-card { margin-bottom: 0.85rem; }
.report-breakdown-drawer {
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: var(--shadow);
}
.report-breakdown-drawer summary {
  padding: 0.78rem 0.95rem;
}
.report-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
  padding: 0 0.85rem 0.85rem;
}
.report-breakdown-card {
  box-shadow: none;
}
.report-empty-state {
  display: grid;
  gap: 0.55rem;
  max-width: 820px;
}
.report-empty-state h3,
.report-empty-state p {
  margin: 0;
}
.report-table th,
.report-table td {
  white-space: nowrap;
}
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.login-panel {
  max-width: 520px;
  margin: 2rem;
  padding: 2rem;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.error-panel {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #f4c0b7;
}

@media (max-width: 1100px) {
  .review-workspace,
  .review-top-grid { grid-template-columns: 1fr; }
  .source-card { position: static; }
  .pdf-frame { min-height: 620px; }
  .pdf-frame-compact { min-height: 420px; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { grid-column: 1; padding: 1rem; }
  .manual-ingest-control {
    margin-top: 0.8rem;
  }
  .hero, .section-header { margin-right: 0; }
  .split-header, .review-action-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .summary-ledger-grid,
  .summary-ledger-grid-wide {
    grid-template-columns: 120px minmax(0, 1fr);
  }
  .summary-ledger-grid dt:nth-of-type(2),
  .summary-ledger-grid dd:nth-of-type(2) {
    border-top: 1px solid rgba(56, 67, 73, 0.08);
  }
  .stack-form { grid-template-columns: 1fr; }
  .form-control-row {
    align-items: stretch;
    flex-direction: column;
  }
  .form-actions {
    justify-content: flex-start;
    margin-left: 0;
  }
  .form-control-row .button {
    min-width: 0;
  }
  .report-filter-main,
  .report-filter-secondary {
    grid-template-columns: 1fr;
  }
  .report-search-field,
  .report-advanced-filters,
  .filter-chip-row {
    grid-column: auto;
  }
  .report-advanced-grid,
  .report-summary-grid,
  .report-secondary-summary {
    grid-template-columns: 1fr;
  }
  .report-secondary-summary div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 0.45rem;
  }
  .report-secondary-summary div:last-child { border-bottom: 0; }
  .report-filter-actions { justify-content: flex-start; }
  .detail-list { grid-template-columns: 1fr; }
}
