:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #1d2733;
  --muted: #5d6b7a;
  --line: #dfe4ea;
  --line-soft: #edf0f3;
  /* Ledgerly brand: navy #0B2A5B with light blue #93C5FD (static/ledgerly-icon.svg) */
  --accent: #1e4b94;
  --accent-ink: #ffffff;
  --accent-soft: #e3edfb;
  --brand-light: #93c5fd;
  --side: #0b2a5b;
  --side-ink: #c8d6ec;
  --side-active: #17407d;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #9a6700;
  --warn-soft: #fff6dd;
  --ok: #18794e;
  --ok-soft: #e7f6ee;
  --info-soft: #e8f1fb;
  --info-ink: #175cd3;
  --th-bg: #fafbfc;
  --row-hover: #fafcfd;
  --label: #344150;
  --input-border: #c8d0d9;
  --input-bg: #ffffff;
  --btn-hover: #f3f5f7;
  --nav-title: #8ea6cb;
  --flash-ok: #0f5132; --flash-ok-line: #b7e2c8;
  --flash-error: #8a1c13; --flash-error-line: #f1c4bf;
  --flash-warn: #6b4a00; --flash-warn-line: #f2dc9b;
  --flash-info: #1849a9; --flash-info-line: #c4d9f5;
  --cleared: #f4fbf7;
  color-scheme: light;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
h3 { font-size: 14px; margin: 16px 0 8px; font-weight: 650; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* layout */
.shell { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 17px; padding: 4px 8px 14px; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; display: block; box-shadow: 0 0 0 1px rgba(147, 197, 253, .35); }
.auth-logo { display: block; height: 44px; width: auto; margin: 0 0 18px -4px; }
.company-switch { display: block; background: var(--side-active); color: #fff; border-radius: 6px; padding: 8px 10px; margin: 0 0 14px; font-weight: 600; }
.company-switch small { display: block; color: var(--side-ink); font-weight: 400; }
.company-switch:hover { text-decoration: none; filter: brightness(1.1); }
.nav-group { margin-bottom: 12px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--nav-title); padding: 4px 10px; }
.nav a { display: flex; justify-content: space-between; color: var(--side-ink); padding: 6px 10px; border-radius: 6px; }
.nav a:hover { background: var(--side-active); text-decoration: none; color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; font-weight: 600; }
.main { min-width: 0; }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 10px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar form { margin: 0; }
.topbar .fav-toggle { margin-right: auto; }
.profile-menu { position: relative; }
.pm-label { padding: 4px 10px 2px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.profile-menu > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px 4px 4px; border: 1px solid var(--line); border-radius: 999px; user-select: none; }
.profile-menu > summary::-webkit-details-marker { display: none; }
.profile-menu > summary:hover, .profile-menu[open] > summary { background: var(--row-hover); }
.profile-menu .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.profile-menu .caret { font-size: 11px; color: var(--muted); }
.profile-menu .pm-panel { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 6px; z-index: 50; }
.profile-menu .pm-head { padding: 8px 10px; display: flex; flex-direction: column; }
.profile-menu .pm-head small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.profile-menu .pm-panel a, .profile-menu .pm-signout { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; background: none; border: 0; box-shadow: none; font: inherit; cursor: pointer; }
.profile-menu .pm-panel a:hover, .profile-menu .pm-signout:hover, .profile-menu .pm-panel a.active { background: var(--row-hover); }
.profile-menu .pm-panel a.active { font-weight: 600; }
.profile-menu .pm-sep { height: 1px; background: var(--line); margin: 4px 0; }
@media (max-width: 700px) { .profile-menu .pm-name { display: none; } }
.topbar .fav-on { color: #b7791f; border-color: #e3b341; }
.nav-favorites { margin-bottom: 4px; border-bottom: 1px solid var(--side-active); padding-bottom: 4px; }
.nav-favorites a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.fav-table td { vertical-align: top; }
.fav-table form.inline { flex-wrap: nowrap; }
.fav-table td.tight form { gap: 4px; }
.content { padding: 22px 24px 60px; max-width: 1280px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* panels */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 16px 18px 0; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--th-bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:hover { background: var(--row-hover); }
tr.clickable { cursor: pointer; }
.table-wrap { overflow-x: auto; }
tfoot td { font-weight: 650; border-top: 1px solid var(--line); }
td.tight, th.tight { width: 1%; white-space: nowrap; }

/* report tables */
.report th { position: sticky; top: 0; }
.report td { padding: 5px 12px; border-bottom: none; }
.report tr.header td { font-weight: 650; padding-top: 12px; }
.report tr.subtotal td { font-weight: 600; border-top: 1px solid var(--line); }
.report tr.total td { font-weight: 650; border-top: 1px solid var(--line); background: var(--th-bg); }
.report tr.grand td { font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 3px double var(--ink); }
.report td.label { white-space: nowrap; }
.report td.label.d1 { padding-left: 28px; }
.report td.label.d2 { padding-left: 44px; }
.report td.label.d3 { padding-left: 60px; }
.report a { color: inherit; }
.report a:hover { color: var(--accent); }

/* forms */
label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 4px; color: var(--label); }
.field { margin-bottom: 14px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 3px; }
input[type=text], input[type=email], input[type=url], input[type=search], input[type=password], input[type=number], input[type=date], input[type=datetime-local],
input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 7px 9px; border: 1px solid var(--input-border); border-radius: 6px; background: var(--input-bg); font: inherit; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline > * { width: auto; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: auto; margin: 0; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; }
legend { font-weight: 650; padding: 0 6px; }

/* buttons */
.btn, button {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 6px; border: 1px solid var(--input-border);
  background: var(--input-bg); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover, button:hover { background: var(--btn-hover); text-decoration: none; }
.btn.primary, button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover, button.primary:hover { filter: brightness(1.07); }
.btn.danger, button.danger { color: var(--danger); border-color: var(--flash-error-line); }
.btn.danger:hover, button.danger:hover { background: var(--danger-soft); }
.btn.small, button.small { padding: 4px 9px; font-size: 12.5px; }
.btn.link, button.link { border: none; background: none; color: var(--accent); padding: 0; font-weight: 500; }
button[disabled] { opacity: .5; cursor: not-allowed; }

/* badges & flashes */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--line-soft); color: var(--muted); white-space: nowrap; }
.badge.ok, .badge.paid, .badge.categorized, .badge.matched, .badge.completed { background: var(--ok-soft); color: var(--ok); }
.badge.warn, .badge.overdue, .badge.unreviewed, .badge.in_progress { background: var(--warn-soft); color: var(--warn); }
.badge.danger, .badge.void, .badge.failed { background: var(--danger-soft); color: var(--danger); }
.badge.info, .badge.approved, .badge.awaiting, .badge.logged { background: var(--info-soft); color: var(--info-ink); }
.flashes { margin-bottom: 16px; }
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; border: 1px solid; }
.flash.ok { background: var(--ok-soft); border-color: var(--flash-ok-line); color: var(--flash-ok); }
.flash.error { background: var(--danger-soft); border-color: var(--flash-error-line); color: var(--flash-error); }
.flash.warn { background: var(--warn-soft); border-color: var(--flash-warn-line); color: var(--flash-warn); }
.flash.info { background: var(--info-soft); border-color: var(--flash-info-line); color: var(--flash-info); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs a.active { color: var(--accent); border-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs .count { background: var(--line-soft); border-radius: 999px; padding: 0 7px; font-size: 11px; margin-left: 4px; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: 100%; max-width: 420px; padding: 28px; }
.auth .brand { color: var(--ink); justify-content: center; padding-bottom: 18px; }
.qr { display: flex; justify-content: center; margin: 10px 0; }
.qr svg { width: 240px; height: 240px; background: #fff; image-rendering: pixelated; shape-rendering: crispEdges; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; background: var(--th-bg); padding: 14px; border-radius: 6px; border: 1px dashed var(--line); }
.secret { word-break: break-all; }

/* line items */
.lines td { padding: 4px 6px; }
.lines input, .lines select { padding: 5px 7px; }
.lines .del { color: var(--muted); border: none; background: none; font-size: 18px; padding: 0 6px; }
.totals { margin-left: auto; width: 320px; }
.totals td { border: none; padding: 4px 8px; }
.totals tr.grand td { font-size: 16px; font-weight: 700; border-top: 2px solid var(--ink); }

/* bank feed */
.feed td { vertical-align: top; }
.feed .desc { max-width: 340px; }
.feed .desc .memo { color: var(--muted); font-size: 12px; }
.feed form.quick { display: flex; gap: 6px; align-items: center; margin: 0; }
.feed form.quick select { min-width: 150px; max-width: 220px; }
.suggest { font-size: 11.5px; color: var(--accent); }
.bulkbar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--th-bg); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bulkbar select { width: auto; min-width: 180px; }

/* reconcile */
.recon-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 6px 0 12px; }
.recon-summary .stat.diff-zero { border-color: #9ad3b5; background: var(--ok-soft); }
.recon-summary .stat.diff-off { border-color: #f2dc9b; background: var(--warn-soft); }
tr.cleared { background: var(--cleared); }

/* chart */
.chart svg { width: 100%; height: 220px; }
.chart .legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.chart .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* invoice document */
.doc-sheet { background: #fff; max-width: 820px; margin: 0 auto; padding: 44px; border: 1px solid var(--line); border-radius: var(--radius); }
.doc-sheet .doc-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.doc-sheet .doc-title { font-size: 28px; font-weight: 300; letter-spacing: .04em; text-transform: uppercase; }
.doc-sheet table th { background: none; }
.doc-sheet .paid-stamp { color: var(--ok); border: 2px solid var(--ok); display: inline-block; padding: 4px 12px; border-radius: 6px; font-weight: 700; transform: rotate(-4deg); }
.public-bar { max-width: 820px; margin: 20px auto 12px; display: flex; justify-content: space-between; align-items: center; }

details > summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .grid.two, .grid.three, .grid.four, .recon-summary { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
}
@media print {
  .side, .topbar, .no-print, .public-bar, .flashes { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .card, .doc-sheet { border: none; box-shadow: none; padding: 0; }
  .content { padding: 0; max-width: none; }
}
.nowrap { white-space: nowrap; }

/* invoice templates */
.doc-sheet { --accent: #0b2a5b; --ink: #1d2733; --muted: #5d6b7a; --line: #dfe4ea; --line-soft: #edf0f3; --th-bg: #fafbfc;
  color: var(--ink); color-scheme: light; }
.doc-sheet .doc-logo { max-height: 72px; max-width: 240px; object-fit: contain; display: inline-block; }
.doc-sheet .doc-company { font-size: 20px; font-weight: 700; }
.doc-sheet .doc-title { color: var(--accent); }
.doc-sheet .doc-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: 4px; }
.doc-sheet .doc-lines thead th { border-bottom: 2px solid var(--accent); color: var(--ink); }
.doc-sheet .totals .grand td { border-top: 2px solid var(--accent); }
.doc-sheet.font-serif { font-family: Georgia, "Times New Roman", serif; }
.doc-sheet.layout-modern { padding-top: 0; overflow: hidden; }
.doc-sheet .doc-band { background: var(--accent); color: #fff; margin: 0 -44px 28px; padding: 26px 44px; display: flex; align-items: center; gap: 18px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-sheet .doc-band .band-name { font-size: 20px; font-weight: 700; flex: 1; }
.doc-sheet .doc-band .band-title { text-align: right; font-size: 26px; font-weight: 300; letter-spacing: .04em; text-transform: uppercase; }
.doc-sheet .doc-band .band-number { font-size: 14px; font-weight: 600; letter-spacing: 0; }
.doc-sheet .doc-band .doc-logo { background: #fff; border-radius: 6px; padding: 6px; max-height: 64px; }
.doc-sheet .doc-band.logo-right .doc-logo { order: 3; }
.doc-sheet .doc-band.logo-center { flex-wrap: wrap; justify-content: center; text-align: center; }
.doc-sheet .doc-band.logo-center .doc-logo { flex-basis: 100%; max-width: 240px; object-position: center; }
.doc-sheet.layout-compact { padding: 28px; font-size: 13px; }
.doc-sheet.layout-compact .doc-head { margin-bottom: 16px; }
.doc-sheet.layout-compact .doc-title { font-size: 20px; }
.doc-sheet.layout-compact .doc-company { font-size: 16px; }
.doc-sheet.layout-compact td, .doc-sheet.layout-compact th { padding-top: 4px; padding-bottom: 4px; }
.report-logo { max-height: 56px; max-width: 220px; object-fit: contain; display: block; margin-bottom: 8px; }
@media print { .doc-sheet .doc-band { margin: 0 0 24px; } }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; }
table.consolidated td.cons, table.consolidated th.cons { background: var(--ok-soft); font-weight: 600; }
table.consolidated td.elim, table.consolidated th.elim { color: var(--muted); }
.receipt-thumb { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 6px; border: 1px solid var(--line); background: var(--line-soft); color: var(--muted); font-size: 11px; font-weight: 700; flex: none; }
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.receipt-thumb:hover { text-decoration: none; border-color: var(--accent); }
.receipt-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.receipt-row form { margin: 0; }
.receipt-preview img { max-width: 100%; max-height: 720px; display: block; margin: 0 auto; border-radius: 6px; }
.receipt-preview iframe { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 6px; }

/* ---------------------------------------------------------------- themes (per user, Profile → Appearance) */
:root[data-accent="teal"]   { --accent: #0f766e; --accent-soft: #e6f4f2; --side: #102a35; --side-active: #1d4452; --nav-title: #7f98a5; --side-ink: #c9d6dd; }
:root[data-accent="blue"]   { --accent: #1d5fd1; --accent-soft: #e7effc; --side: #0f2240; --side-active: #1c3864; }
:root[data-accent="indigo"] { --accent: #4f46e5; --accent-soft: #eceafd; --side: #1a1a3d; --side-active: #2e2c66; }
:root[data-accent="purple"] { --accent: #7c3aed; --accent-soft: #f1e9fe; --side: #24173d; --side-active: #3b2862; }
:root[data-accent="green"]  { --accent: #16803c; --accent-soft: #e5f5ea; --side: #10291b; --side-active: #1d4430; }
:root[data-accent="orange"] { --accent: #c2410c; --accent-soft: #fdeee5; --side: #2c1a10; --side-active: #4a2c1b; }
:root[data-accent="rose"]   { --accent: #be123c; --accent-soft: #fde8ed; --side: #2d1219; --side-active: #4c1f2b; }
:root[data-accent="slate"]  { --accent: #334155; --accent-soft: #e9edf2; --side: #1a1f27; --side-active: #2d3541; }

:root[data-theme="dark"] {
  --bg: #0f1419; --panel: #171d24; --ink: #e3e8ee; --muted: #9aa7b4; --line: #2a333d; --line-soft: #222a33;
  --accent-soft: rgba(94, 234, 212, .12); --side: #0b1116; --side-active: #1d2a35;
  --danger: #f97066; --danger-soft: #3a1d1b; --warn: #f5b74f; --warn-soft: #3a2e12; --ok: #47c78a; --ok-soft: #12301f;
  --info-soft: #15263b; --info-ink: #84adff; --th-bg: #1b222a; --row-hover: #1c242d; --label: #c3cdd7;
  --input-border: #36414c; --input-bg: #11171d; --btn-hover: #222b35; --nav-title: #6f8593;
  --flash-ok: #a6e9c5; --flash-ok-line: #1f5b3b; --flash-error: #fdb3ab; --flash-error-line: #6b2620;
  --flash-warn: #f8d58f; --flash-warn-line: #6b5216; --flash-info: #b2ccff; --flash-info-line: #24426b;
  --cleared: #13261c; --shadow: none; --accent-ink: #0b1116; color-scheme: dark;
}
:root[data-theme="dark"][data-accent="navy"]   { --accent: #93c5fd; --side: #08183a; --side-active: #15315f; }
:root[data-theme="dark"][data-accent="teal"]   { --accent: #2dd4bf; }
:root[data-theme="dark"][data-accent="blue"]   { --accent: #6aa2ff; }
:root[data-theme="dark"][data-accent="indigo"] { --accent: #8b87ff; }
:root[data-theme="dark"][data-accent="purple"] { --accent: #b48cff; }
:root[data-theme="dark"][data-accent="green"]  { --accent: #4ade80; }
:root[data-theme="dark"][data-accent="orange"] { --accent: #fb923c; }
:root[data-theme="dark"][data-accent="rose"]   { --accent: #fb7185; }
:root[data-theme="dark"][data-accent="slate"]  { --accent: #a5b4c8; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0f1419; --panel: #171d24; --ink: #e3e8ee; --muted: #9aa7b4; --line: #2a333d; --line-soft: #222a33;
    --accent-soft: rgba(94, 234, 212, .12); --side: #0b1116; --side-active: #1d2a35;
    --danger: #f97066; --danger-soft: #3a1d1b; --warn: #f5b74f; --warn-soft: #3a2e12; --ok: #47c78a; --ok-soft: #12301f;
    --info-soft: #15263b; --info-ink: #84adff; --th-bg: #1b222a; --row-hover: #1c242d; --label: #c3cdd7;
    --input-border: #36414c; --input-bg: #11171d; --btn-hover: #222b35; --nav-title: #6f8593;
    --flash-ok: #a6e9c5; --flash-ok-line: #1f5b3b; --flash-error: #fdb3ab; --flash-error-line: #6b2620;
    --flash-warn: #f8d58f; --flash-warn-line: #6b5216; --flash-info: #b2ccff; --flash-info-line: #24426b;
    --cleared: #13261c; --shadow: none; --accent-ink: #0b1116; color-scheme: dark;
  }
  :root[data-theme="system"][data-accent="navy"]   { --accent: #93c5fd; --side: #08183a; --side-active: #15315f; }
  :root[data-theme="system"][data-accent="teal"]   { --accent: #2dd4bf; }
  :root[data-theme="system"][data-accent="blue"]   { --accent: #6aa2ff; }
  :root[data-theme="system"][data-accent="indigo"] { --accent: #8b87ff; }
  :root[data-theme="system"][data-accent="purple"] { --accent: #b48cff; }
  :root[data-theme="system"][data-accent="green"]  { --accent: #4ade80; }
  :root[data-theme="system"][data-accent="orange"] { --accent: #fb923c; }
  :root[data-theme="system"][data-accent="rose"]   { --accent: #fb7185; }
  :root[data-theme="system"][data-accent="slate"]  { --accent: #a5b4c8; }
}
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border: 1px solid var(--line); border-radius: 999px; font-weight: 500; cursor: pointer; margin: 0; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span { width: 18px; height: 18px; border-radius: 50%; background: var(--sw); }
.swatch[data-accent="navy"] { --sw: #0b2a5b; } .swatch[data-accent="teal"] { --sw: #0f766e; } .swatch[data-accent="blue"] { --sw: #1d5fd1; }
.swatch[data-accent="indigo"] { --sw: #4f46e5; } .swatch[data-accent="purple"] { --sw: #7c3aed; }
.swatch[data-accent="green"] { --sw: #16803c; } .swatch[data-accent="orange"] { --sw: #c2410c; }
.swatch[data-accent="rose"] { --sw: #be123c; } .swatch[data-accent="slate"] { --sw: #334155; }
.swatch:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* Intercompany reconciliation (consolidation) */
.stat.ic-ok { border-color: #9ad3b5; background: var(--ok-soft); }
.stat.ic-off { border-color: #f2dc9b; background: var(--warn-soft); }
details.ic-pair { margin-top: 14px; }
details.ic-pair > summary { font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 10px; }
.ic-h { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; }
table.ic-side { width: 100%; }
table.ic-side tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.ic-diff { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: flex-end; padding: 10px 4px 0; font-size: 13.5px; }
