/* Zar - ledger-book styling: green-bar tables, DIN-style figures, indigo actions */

@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/barlow-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --desk: #edf0ee;
  --paper: #ffffff;
  --paper-2: #f6f8f7;
  --band: #eff6f0;
  --hover: #e6eefb;
  --ink: #17212e;
  --ink-2: #566170;
  --ink-3: #8a93a0;
  --rule: #d8dfda;
  --rule-2: #c3ccc6;
  --indigo: #2b3c91;
  --indigo-ink: #22307a;
  --indigo-wash: #e9ecf8;
  --on-indigo: #ffffff;
  --khata: #a8192e;
  --ledger-rule: rgba(168, 25, 46, .45);
  --good: #0aac23; --good-text: #006c10; --good-wash: #e3f5e6;
  --warn: #fbb315; --warn-text: #7a4f00; --warn-wash: #fff4d6;
  --serious: #f18a59; --serious-text: #9a3f12; --serious-wash: #fde9de;
  --crit: #dc3c3d; --crit-text: #b42324; --crit-wash: #fbe3e3;
  --series-1: #3a52c4;
  --c1: #257de0; --c2: #f47230; --c3: #00b894; --c4: #f2a600; --c5: #ee7fac; --c6: #008a17; --c7: #6a4ce2; --c8: #ec4647;
  --grid: #e7e7e7; --axis: #c2c2c2;
  --shadow: 0 18px 50px rgba(16, 24, 32, .18), 0 2px 6px rgba(16, 24, 32, .08);
  --r-s: 6px; --r-m: 10px;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --side: 236px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --desk: #0f1513;
  --paper: #18201d;
  --paper-2: #1d2723;
  --band: #1b2521;
  --hover: #232c45;
  --ink: #e8edea;
  --ink-2: #a3ada8;
  --ink-3: #707b76;
  --rule: #2b3631;
  --rule-2: #3b4842;
  --indigo: #8e9cf0;
  --indigo-ink: #aab5f5;
  --indigo-wash: #242b48;
  --on-indigo: #10152e;
  --khata: #e0566a;
  --ledger-rule: rgba(224, 86, 106, .5);
  --good-text: #53c556; --good-wash: #16301c;
  --warn-text: #fbc94d; --warn-wash: #33290f;
  --serious-text: #f6a37c; --serious-wash: #3a2418;
  --crit-text: #f17b7b; --crit-wash: #3a1b1c;
  --series-1: #7d8ce8;
  --c1: #338ced; --c2: #e76624; --c3: #00a888; --c4: #d28e05; --c5: #e24d8b; --c6: #0aac23; --c7: #9887ef; --c8: #eb6263;
  --grid: #303030; --axis: #474747;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--desk);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: 4px; }
.num, td.r, th.r { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side {
  background: var(--paper); border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 18px 18px 16px; border-bottom: 1px solid var(--rule); }
.brand svg { flex: none; }
.brand b { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.2; }
.brand span { font-size: 12.5px; color: var(--ink-2); }
.nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: var(--r-s);
  color: var(--ink); font-weight: 500; position: relative;
}
.nav a svg { width: 18px; height: 18px; flex: none; stroke: var(--ink-2); }
.nav a:hover { background: var(--paper-2); text-decoration: none; }
.nav a.on { background: var(--indigo-wash); color: var(--indigo); }
.nav a.on svg { stroke: var(--indigo); }
.nav a.on::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 2px; background: var(--indigo); }
.nav .sep { height: 1px; background: var(--rule); margin: 8px 6px; }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--crit-text); background: var(--crit-wash); padding: 0 7px; border-radius: 9px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--rule); padding: 12px 14px; font-size: 13px; }
.side-foot .who { font-weight: 600; }
.side-foot .links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.side-foot button { background: none; border: 0; padding: 0; color: var(--indigo); cursor: pointer; font-size: 13px; }

.main { min-width: 0; padding: 22px 28px 60px; }
.topbar { display: none; }

.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: 22px; font-weight: 600; margin: 0; line-height: 1.2; }
.page-head .sub { color: var(--ink-2); margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }

/* ---------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: var(--r-s); border: 1px solid var(--rule-2);
  background: var(--paper); color: var(--ink); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--paper-2); text-decoration: none; }
.btn svg { width: 16px; height: 16px; stroke: currentColor; }
.btn.primary { background: var(--indigo); border-color: var(--indigo); color: var(--on-indigo); }
.btn.primary:hover { background: var(--indigo-ink); }
.btn.danger { color: var(--crit-text); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--indigo); }
.btn.ghost:hover { background: var(--indigo-wash); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--indigo); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }

input[type=text], input[type=number], input[type=date], input[type=password], input[type=search], input[type=tel], select, textarea {
  height: 34px; padding: 0 10px; border: 1px solid var(--rule-2); border-radius: var(--r-s);
  background: var(--paper); min-width: 0; width: 100%;
}
textarea { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; line-height: 1.4; }
input[type=number] { font-variant-numeric: tabular-nums; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--indigo); outline-offset: -1px; border-color: var(--indigo); }
input[readonly] { background: var(--paper-2); color: var(--ink-2); }
label.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
label.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--indigo); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .help { font-size: 12.5px; color: var(--ink-3); font-style: normal; }
.grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid .full { grid-column: 1 / -1; }
.err-box { background: var(--crit-wash); color: var(--crit-text); border-radius: var(--r-s); padding: 9px 12px; font-weight: 500; }
.note-box { background: var(--warn-wash); color: var(--warn-text); border-radius: var(--r-s); padding: 9px 12px; }
.info-box { background: var(--indigo-wash); color: var(--indigo-ink); border-radius: var(--r-s); padding: 10px 12px; }
:root[data-theme="dark"] .info-box { color: var(--ink); }

/* filter row */
.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px;
  padding: 8px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-m);
}
.filters select, .filters input { width: auto; height: 32px; }
.filters .range { display: flex; gap: 6px; align-items: center; }
.filters .range input { width: 142px; }
.filters .grow { flex: 1; min-width: 160px; }
.filters .lbl { font-size: 13px; color: var(--ink-2); margin-left: 4px; }
.seg { display: inline-flex; border: 1px solid var(--rule-2); border-radius: var(--r-s); overflow: hidden; }
.seg button { border: 0; background: var(--paper); padding: 0 11px; height: 30px; cursor: pointer; color: var(--ink-2); font-weight: 500; }
.seg button + button { border-left: 1px solid var(--rule-2); }
.seg button.on { background: var(--indigo-wash); color: var(--indigo); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin: 0 0 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--ink-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--indigo); border-bottom-color: var(--indigo); }

/* ---------------------------------------------------------------- panels */
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-m); }
.panel + .panel, .panel + .cols, .cols + .panel, .cols + .cols, .strip + .panel, .strip + .cols { margin-top: 16px; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.panel-h h2 { font-size: 15px; font-weight: 600; margin: 0; }
.panel-h .sub { color: var(--ink-2); font-size: 13px; }
.panel-h .actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.panel-b { padding: 14px 16px; }
.panel-b.flush { padding: 0; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cols.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.cols > .panel + .panel { margin-top: 0; }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-2); }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* the ledger strip: KPI row as one ruled band, not separate cards */
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-m); overflow: hidden; }
.strip .cell { padding: 14px 18px 15px; border-left: 1px solid var(--rule); min-width: 0; }
.strip .cell:first-child { border-left: 0; }
.strip .lbl { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.strip .val { font-size: 26px; font-weight: 600; line-height: 1.15; margin-top: 3px; letter-spacing: -.01em; white-space: nowrap; }
.strip .val small { font-size: 15px; font-weight: 500; color: var(--ink-2); margin-left: 2px; }
.strip .foot { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.delta.up { color: var(--good-text); }
.delta.down { color: var(--crit-text); }

.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-m); overflow: hidden; margin-bottom: 16px; }
.hero .main-fig { padding: 20px 22px 18px; }
.hero .lbl { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.hero .fig { font-size: 48px; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; margin: 6px 0 4px; }
.hero .fig .cur { font-size: 22px; font-weight: 600; color: var(--ink-2); margin-right: 6px; letter-spacing: 0; }
.hero .owes { border-left: 1px solid var(--rule); padding: 14px 18px; }
.hero .owes h3 { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }

/* segmented bar (tall) */
.segbar { display: flex; height: 28px; gap: 2px; margin: 14px 0 8px; }
.segbar > div { border-radius: 4px; min-width: 2px; display: flex; align-items: center; padding: 0 8px; font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; vertical-align: 0; }
.legend i.line { height: 2px; width: 14px; border-radius: 1px; vertical-align: 3px; }

/* ranked bars / meter list */
.bars { display: flex; flex-direction: column; }
.bars .row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.bars .row + .row { border-top: 1px solid var(--rule); }
.bars .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .track { height: 10px; position: relative; }
.bars .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
.bars .v { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; font-weight: 500; }
.bars .v small { color: var(--ink-2); font-weight: 400; margin-left: 6px; }
.bars a.row { color: inherit; }
.bars a.row:hover { background: var(--paper-2); text-decoration: none; }

/* ---------------------------------------------------------------- tables: the ledger */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--ink-2); background: var(--paper-2);
  padding: 8px 10px; border-bottom: 1px solid var(--rule-2); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.t th.sort { cursor: pointer; user-select: none; }
table.t th.sort:hover { color: var(--ink); }
table.t th .arrow { color: var(--indigo); margin-left: 3px; }
table.t td { padding: 7px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.t tbody tr:nth-child(even) td { background: var(--band); }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--hover); }
table.t td.r, table.t th.r { text-align: right; white-space: nowrap; }
table.t td.c, table.t th.c { text-align: center; }
table.t tfoot td { font-weight: 600; background: var(--paper-2); border-top: 1px solid var(--rule-2); border-bottom: 0; white-space: nowrap; }
table.t tr.void td { color: var(--ink-3); text-decoration: line-through; }
table.t tr.void td.keep { text-decoration: none; }
table.t tr.sub td { background: var(--paper-2) !important; font-weight: 600; }
table.t .desc { max-width: 380px; }
table.t td.wrap { white-space: normal; }
/* ledger statement: the debit / credit / balance block is set off by a fine double red rule, as in an account book */
table.t.ledger td.dr, table.t.ledger th.dr { border-left: 3px double var(--ledger-rule); }
table.t.ledger td.bal, table.t.ledger th.bal { border-left: 3px double var(--ledger-rule); font-weight: 500; }
table.t.ledger tr.open td, table.t.ledger tr.close td { font-weight: 600; background: var(--paper-2) !important; }
.drcr { font-size: 11.5px; font-weight: 600; color: var(--ink-2); margin-left: 4px; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 1px 8px 1px 7px; border-radius: 10px; white-space: nowrap; background: var(--paper-2); color: var(--ink-2); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.chip.good { background: var(--good-wash); color: var(--good-text); }
.chip.warn { background: var(--warn-wash); color: var(--warn-text); }
.chip.serious { background: var(--serious-wash); color: var(--serious-text); }
.chip.crit { background: var(--crit-wash); color: var(--crit-text); }
.chip.info { background: var(--indigo-wash); color: var(--indigo); }
.chip.plain::before { display: none; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }

/* alerts */
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; padding: 9px 16px; border-top: 1px solid var(--rule); align-items: start; }
.alerts li:first-child { border-top: 0; }
.alerts .ico { width: 18px; height: 18px; margin-top: 1px; }
.alerts .t { font-weight: 500; }
.alerts .d { font-size: 13px; color: var(--ink-2); }
.insights { list-style: none; margin: 0; padding: 0; }
.insights li { padding: 10px 16px; border-top: 1px solid var(--rule); }
.insights li:first-child { border-top: 0; }
.insights b { font-weight: 600; }

/* charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart text.tick { font-size: 11.5px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .base { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .xhair { stroke: var(--ink-3); stroke-width: 1; pointer-events: none; }
.chart rect.col { fill: var(--series-1); }
.chart rect.col.dim { opacity: .35; }
.chart rect.col:hover { opacity: .8; }
.chart-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.chart-foot .linkbtn { margin-left: auto; font-size: 13px; }
#tip {
  position: fixed; z-index: 90; pointer-events: none; background: var(--paper); color: var(--ink);
  border: 1px solid var(--rule-2); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 13px;
  max-width: 300px; display: none;
}
#tip .tv { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
#tip .tr { display: flex; align-items: center; gap: 8px; }
#tip .tr i { width: 12px; height: 2px; border-radius: 1px; flex: none; }
#tip .tl { color: var(--ink-2); }

/* ---------------------------------------------------------------- modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 21, 19, .45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: var(--paper); border-radius: 12px; box-shadow: var(--shadow); width: min(640px, 100%); }
.modal.wide { width: min(980px, 100%); }
.modal-h { display: flex; align-items: center; padding: 16px 20px 12px; border-bottom: 1px solid var(--rule); }
.modal-h h2 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-h .x { margin-left: auto; background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink-2); padding: 2px 6px; }
.modal-b { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 16px; border-top: 1px solid var(--rule); }
.modal-f .left { margin-right: auto; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; z-index: 95; font-weight: 500; box-shadow: var(--shadow); max-width: 90vw; }
.toast.err { background: var(--crit-text); color: #fff; }

/* ---------------------------------------------------------------- bill form */
.lines { width: 100%; border-collapse: collapse; }
.lines th { font-size: 12.5px; color: var(--ink-2); font-weight: 600; text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--rule-2); white-space: nowrap; }
.lines td { padding: 6px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.lines td.r, .lines th.r { text-align: right; }
.lines input, .lines select { height: 32px; }
.lines .calc { font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 12px; text-align: right; }
.lines .hint { font-size: 12px; color: var(--ink-2); margin-top: 3px; white-space: normal; }
.lines .hint.bad { color: var(--crit-text); font-weight: 500; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; max-width: 420px; margin-left: auto; font-variant-numeric: tabular-nums; }
.totals .k { color: var(--ink-2); }
.totals .v { text-align: right; }
.totals .big { font-size: 20px; font-weight: 700; }
.words { font-size: 13px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .02em; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chips-row button { border: 1px solid var(--rule-2); background: var(--paper); border-radius: 14px; padding: 2px 10px; font-size: 12.5px; cursor: pointer; }
.chips-row button:hover { border-color: var(--indigo); color: var(--indigo); }

/* ---------------------------------------------------------------- login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: min(420px, 100%); background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 28px 28px 24px; }
.login .brand { border: 0; padding: 0 0 18px; }
.login h1 { font-size: 20px; margin: 0 0 4px; font-weight: 600; }
.login form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.login .btn { height: 40px; }
.login.wide { width: min(560px, 100%); }

.reports-nav { display: flex; flex-direction: column; gap: 1px; }
.reports-nav a { padding: 8px 12px; border-radius: var(--r-s); color: var(--ink); }
.reports-nav a:hover { background: var(--paper-2); text-decoration: none; }
.reports-nav a.on { background: var(--indigo-wash); color: var(--indigo); font-weight: 600; }
.reports-nav .grp { font-size: 12.5px; color: var(--ink-2); padding: 12px 12px 4px; font-weight: 600; }
.rep-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }

/* ---------------------------------------------------------------- print */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; color: #000; font-size: 12px; }
  .shell, .modal-bg, .toast, #tip, .topbar { display: none !important; }
  #print-root { display: block; }
  .pdoc { color: #000; }
  .pdoc table { border-collapse: collapse; width: 100%; }
  .pdoc th, .pdoc td { border: 1px solid #000; padding: 5px 6px; font-size: 11.5px; vertical-align: top; }
  .pdoc th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pdoc .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .pdoc .c { text-align: center; }
  .pdoc .title { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: .04em; margin: 0 0 4px; }
  .pdoc .co { text-align: center; font-size: 13px; margin-bottom: 10px; }
  .pdoc .meta { width: auto; margin: 10px 0 12px; }
  .pdoc .meta td { border: 0; padding: 2px 14px 2px 0; font-size: 13px; }
  .pdoc .meta td:first-child { font-weight: 700; }
  .pdoc .sig { display: flex; justify-content: space-between; margin-top: 70px; }
  .pdoc .sig div { width: 40%; border-top: 1px solid #000; padding-top: 4px; font-weight: 700; text-align: center; }
  .pdoc .words { color: #000; font-weight: 700; font-size: 11.5px; }
  .pdoc .note { margin-top: 18px; font-size: 11px; border: 1px solid #000; padding: 8px; }
  .pdoc .rpt-h { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
  .pdoc .rpt-h h1 { font-size: 18px; margin: 0; }
  .pdoc .stamp { font-size: 10.5px; color: #333; margin-top: 10px; }
  .pdoc .do-box td { font-size: 13px; padding: 8px; }
  .pdoc tfoot td { font-weight: 700; }
}

/* ---------------------------------------------------------------- small screens */
@media (max-width: 1100px) {
  .cols, .cols.c3, .cols.wide-left { grid-template-columns: 1fr; }
  .rep-layout { grid-template-columns: 1fr; }
  .reports-nav { flex-direction: row; flex-wrap: wrap; }
  .reports-nav .grp { width: 100%; padding-top: 6px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow); }
  .shell.nav-open .side { transform: none; }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--paper); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 40; }
  .topbar b { font-weight: 600; }
  .topbar button { background: none; border: 1px solid var(--rule-2); border-radius: var(--r-s); height: 34px; width: 38px; cursor: pointer; color: var(--ink); display: grid; place-items: center; }
  .topbar button svg { width: 20px; height: 20px; }
  .main { padding: 16px 14px 60px; }
  .hero { grid-template-columns: 1fr; }
  .hero .owes { border-left: 0; border-top: 1px solid var(--rule); }
  .hero .fig { font-size: 40px; }
  .grid, .grid.g3, .grid.g4 { grid-template-columns: 1fr; }
  .page-head .actions { margin-left: 0; }
  .filters .range input { width: 128px; }
}
