/* WLI Billing app shell. Tokens first; every screen uses these names (old Phase 1 names kept as aliases). */
:root {
  --ink: #2b2d42;          /* text: WeLoveIt dark slate */
  --ink-2: #f3f4f7;        /* sidebar hover */
  --muted: #5e6577;        /* secondary text */
  --faint: #8a93a3;        /* placeholders, axis text */
  --paper: #f3f4f7;        /* app background: light grey */
  --sheet: #ffffff;        /* panels */
  --rule: #e3e6ec;         /* hairlines */
  --rule-2: #cfd4dd;       /* inputs */
  --brand: #ea2127;        /* WeLoveIt red */
  --primary: #d41920;      /* buttons: brand red, darkened for 4.9:1 white text */
  --primary-hover: #b3141a;
  --grey: #8e99ad;         /* WeLoveIt grey */
  --brand-soft: #fdecec;
  --accent: #4b5878;       /* links: slate grey */
  --accent-soft: #eceef3;
  --good: #11845b;  --good-soft: #e3f3ec;
  --wait: #9a6206;  --wait-soft: #fbf1dc;
  --late: #b8212b;  --late-soft: #fbe8e8;
  --billed: #3d5a99;       /* chart: billed */
  --age-0: #5b7bc0; --age-1: #d99a1e; --age-2: #d2552b; --age-3: #9b2335;
  --radius: 10px; --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(26, 31, 44, .06), 0 4px 16px rgba(26, 31, 44, .04);
  --font: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --display: "Bricolage Grotesque", "Hanken Grotesk", "Segoe UI", sans-serif;
  /* Phase 1 aliases */
  --teal: var(--accent); --teal-soft: var(--accent-soft); --red: var(--late); --red-soft: var(--late-soft); --amber: var(--wait); --amber-soft: var(--wait-soft);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); font-feature-settings: "tnum" 1, "lnum" 1; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
h1 { font: 650 26px/1.2 var(--font); letter-spacing: -.015em; margin: 0; }
h2 { font: 650 17px/1.3 var(--font); margin: 0 0 12px; }
h3 { font: 600 15px/1.3 var(--font); margin: 0 0 8px; }
p.sub, .sub { color: var(--muted); margin: 4px 0 0; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ───────── Shell ───────── */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: #fff; color: var(--ink); border-right: 1px solid var(--rule); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; color: var(--ink); font-weight: 700; font-size: 15px; }
.brand img { height: 64px; width: auto; display: block; }
.side .brand { justify-content: center; padding: 6px 10px 20px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; place-items: center; color: #fff; font: 800 15px/1 var(--display); }
.brand small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: #4a4f63; font-weight: 500; position: relative; }
.nav a:hover { background: var(--ink-2); color: var(--ink); text-decoration: none; }
.nav a[aria-current] { background: var(--brand-soft); color: #b3141a; font-weight: 650; }
.nav a[aria-current]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav a .count { margin-left: auto; font-size: 12px; font-weight: 700; background: var(--brand); color: #fff; border-radius: 10px; padding: 1px 7px; }
.nav-group { margin-top: 16px; padding: 0 12px 6px; font-size: 12px; font-weight: 600; color: var(--grey); }
.side-foot { margin-top: auto; border-top: 1px solid var(--rule); padding: 14px 10px 0; font-size: 13px; color: var(--muted); }
.side-foot .who { color: var(--ink); font-weight: 600; }
.side-foot form button { background: none; border: 0; color: var(--accent); padding: 6px 0 0; cursor: pointer; font: inherit; }
.side-foot form button:hover { color: var(--primary); background: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: rgba(245, 246, 248, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.search { flex: 1; min-width: 0; max-width: 520px; position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search input { width: 100%; padding: 9px 12px 9px 38px; border-radius: 9px; border: 1px solid var(--rule-2); background: var(--sheet); }
.top .spacer { flex: 1; }
.menu-toggle { display: none; }
.content { padding: 26px 28px 56px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* New-menu (details dropdown) */
.new { position: relative; }
.new summary { list-style: none; }
.new summary::-webkit-details-marker { display: none; }
.new .pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(26, 31, 44, .14); padding: 6px; min-width: 210px; z-index: 30; }
.new .pop a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 7px; color: var(--ink); }
.new .pop a:hover { background: var(--paper); text-decoration: none; }

/* ───────── Controls ───────── */
button, .btn { font: 600 14px/1 var(--font); display: inline-flex; align-items: center; gap: 8px; justify-content: center; background: var(--primary); color: #fff; border: 1px solid var(--primary); border-radius: 9px; padding: 10px 16px; cursor: pointer; text-decoration: none; white-space: nowrap; }
button:hover, .btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); text-decoration: none; }
button.quiet, .btn.quiet { background: var(--sheet); color: var(--ink); border-color: var(--rule-2); }
button.quiet:hover, .btn.quiet:hover { background: var(--paper); border-color: var(--grey); }
button.danger, .btn.danger { background: var(--sheet); color: var(--late); border-color: #efc4c6; }
button.danger:hover { background: var(--late-soft); }
button.good, .btn.good { background: var(--good); border-color: var(--good); }
button.good:hover { background: #0d6b49; border-color: #0d6b49; }
button.x { background: none; border: 0; color: var(--muted); padding: 6px; } button.x:hover { background: var(--paper); color: var(--ink); }
button.small, .btn.small { padding: 7px 11px; font-size: 13px; border-radius: 7px; }
label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 12px; }
input, select, textarea { font: 15px/1.4 var(--font); color: var(--ink); padding: 9px 11px; border: 1px solid var(--rule-2); border-radius: 8px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--grey); outline: 3px solid var(--brand-soft); outline-offset: 0; }
.grid { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.inline { display: inline; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 14px; } .check input { width: auto; }
.errors { color: var(--late); font-size: 13px; margin: -6px 0 12px; }

/* ───────── Surfaces ───────── */
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.panel-head + .panel-body { padding: 14px 20px 20px; }
.note { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; }
.ok { background: var(--good-soft); color: var(--good); } .warn { background: var(--wait-soft); color: var(--wait); } .bad { background: var(--late-soft); color: var(--late); }
.note.ok { border-color: #bfe3d3; } .note.warn { border-color: #f0d9a8; } .note.bad { border-color: #f1c3c5; }
code.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; font: 14px Consolas, monospace; background: var(--paper); padding: 12px; border-radius: 6px; }

/* Status chips: word + dot, never colour alone */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 20px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: #eef0f4; color: var(--muted); }
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag.ok { background: var(--good-soft); color: var(--good); } .tag.warn { background: var(--wait-soft); color: var(--wait); } .tag.bad { background: var(--late-soft); color: var(--late); }
.tag.draft { background: #fff; color: var(--muted); box-shadow: inset 0 0 0 1px var(--rule-2); }
.money { white-space: nowrap; }
.late-by { color: var(--late); font-size: 12.5px; font-weight: 600; }

/* ───────── Tables ───────── */
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: #fafbfc; position: sticky; top: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
table.rows tbody tr { cursor: pointer; }
table.rows tbody tr:hover td { background: #f8f9fb; }
table.rows td a.row-link { color: var(--ink); font-weight: 600; }
.cell-sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.what { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 0; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current] { color: var(--ink); border-color: var(--brand); }
.tabs a .n { font-weight: 500; color: var(--faint); margin-left: 4px; }
.toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.toolbar input { max-width: 320px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--rule); }
.pager nav { display: flex; gap: 6px; }

/* ───────── Dashboard ───────── */
.owed { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 26px 28px 22px; margin-bottom: 18px; }
.owed-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-end; }
.owed-figure { font: 700 clamp(38px, 4.4vw, 56px)/1 var(--display); letter-spacing: -.03em; margin-top: 6px; }
.owed-figure small { font: 600 18px var(--font); color: var(--muted); letter-spacing: 0; margin-right: 6px; }
.owed-split { display: flex; gap: 22px; flex-wrap: wrap; }
.owed-split div { min-width: 120px; }
.owed-split b { display: block; font: 650 20px/1.2 var(--display); letter-spacing: -.01em; }
.owed-split span { color: var(--muted); font-size: 13px; }
.ageing { display: flex; height: 18px; border-radius: 9px; overflow: hidden; gap: 2px; margin: 22px 0 12px; background: var(--paper); }
.ageing i { display: block; min-width: 4px; }
.ageing-key { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ageing-key a { color: var(--ink); display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; }
.ageing-key a:hover { background: var(--paper); text-decoration: none; }
.ageing-key .k { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.ageing-key .k i { width: 10px; height: 10px; border-radius: 3px; }
.ageing-key b { font-size: 16px; }
.ageing-key .n { color: var(--muted); font-size: 12.5px; }
.dash { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.chase td { vertical-align: middle; }
.days { font-weight: 700; color: var(--late); white-space: nowrap; }
.todo { display: grid; gap: 2px; }
.todo a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px; color: var(--ink); }
.todo a:hover { background: var(--paper); text-decoration: none; }
.todo .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--paper); color: var(--ink); flex: none; }
.todo .t { flex: 1; min-width: 0; } .todo .t span { display: block; color: var(--muted); font-size: 13px; }
.todo .v { font-weight: 700; white-space: nowrap; }
.month { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); margin-bottom: 18px; }
.month div { background: var(--sheet); padding: 16px 18px; }
.month span { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.month span i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.month b { display: block; font: 700 24px/1.2 var(--display); letter-spacing: -.02em; margin-top: 4px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .bar { transition: opacity .12s; }
.chart g.m:hover .bar, .chart g.m:focus .bar { opacity: .82; }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12.5px; padding: 8px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .1s; }
.chart .tip.on { opacity: 1; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend span { display: flex; align-items: center; gap: 6px; } .legend i { width: 10px; height: 10px; border-radius: 3px; }

/* ───────── Document page ───────── */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.paper { background: #fff; border: 1px solid var(--rule); border-radius: 4px; box-shadow: var(--shadow); padding: 48px 52px; min-height: 640px; }
.paper .doc-top { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.paper .doc-title { font: 700 30px/1 var(--display); letter-spacing: -.02em; text-align: right; }
.paper .parties { display: grid; grid-template-columns: 1fr 1fr .7fr; gap: 24px; margin-bottom: 30px; font-size: 14px; }
.paper .lbl { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.paper table th { background: none; border-bottom: 1.5px solid var(--ink); padding-left: 4px; padding-right: 4px; position: static; }
.paper table td { padding-left: 4px; padding-right: 4px; }
.paper .totals { width: 52%; margin: 12px 0 0 auto; }
.paper .totals td { border: 0; padding: 5px 4px; }
.paper .totals .grand td { border-top: 1.5px solid var(--ink); font-weight: 700; font-size: 16px; padding-top: 10px; }
.paper .totals .due td { background: var(--paper); font-weight: 700; }
.paper .extra { margin-top: 26px; white-space: pre-line; font-size: 14px; color: #39404f; }
.rail { position: sticky; top: 76px; display: grid; gap: 14px; }
.rail .panel { margin: 0; }
.balance { font: 700 34px/1.1 var(--display); letter-spacing: -.02em; margin: 6px 0 2px; }
.rail .acts { display: grid; gap: 8px; margin-top: 16px; }
.rail .acts .btn, .rail .acts button { width: 100%; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.timeline li { display: grid; grid-template-columns: 12px 1fr; gap: 12px; font-size: 14px; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--rule-2); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--rule); }
.timeline li.good::before { background: var(--good); } .timeline li.late::before { background: var(--late); } .timeline li.ink::before { background: var(--ink); }
.timeline time { display: block; color: var(--muted); font-size: 12.5px; }

/* Dialog */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(26, 31, 44, .28); }
dialog::backdrop { background: rgba(26, 31, 44, .45); }
dialog form { padding: 24px; }
dialog .dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
dialog .dlg-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.x { background: none; border: 0; color: var(--muted); padding: 6px; } .x:hover { background: var(--paper); color: var(--ink); }

/* Guest pages (sign-in) */
.guest { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #f3f4f7 0%, #e3e6ec 100%); }
.guest main { width: min(420px, 100%); background: var(--sheet); border-radius: 16px; padding: 32px; border: 1px solid var(--rule); border-top: 4px solid var(--brand); }
.guest .brand { color: var(--ink); padding: 0 0 22px; } .guest .brand img { height: 64px; }
.guest .panel { border: 0; padding: 0; margin: 16px 0 0; }
.guest form button[type=submit] { width: 100%; margin-top: 4px; }
.guest h1 { margin-bottom: 4px; }

/* ───────── Small screens ───────── */
@media (max-width: 1180px) { .dash, .doc-layout { grid-template-columns: minmax(0, 1fr); } .rail { position: static; } }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .panel.flush, .owed { overflow-x: auto; }
  .top .btn, .top summary { padding: 9px 12px; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  #menu:checked ~ .app .side { transform: none; box-shadow: 0 0 0 100vmax rgba(26, 31, 44, .4); }
  .menu-toggle { display: inline-flex; }
  .top, .content { padding-left: 16px; padding-right: 16px; }
  .paper { padding: 26px 18px; overflow-x: auto; } .paper .parties { grid-template-columns: 1fr; }
  .paper .doc-top { flex-direction: column-reverse; gap: 10px; } .paper .doc-title, .paper .doc-top div { text-align: left !important; }
  .paper .totals { width: 100%; }
  .top .new summary { font-size: 0; gap: 0; } .top .new summary svg { font-size: 14px; }
  .ageing-key { grid-template-columns: repeat(2, 1fr); }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .side, .top, .rail { display: none !important; } .app { display: block; } .paper { box-shadow: none; border: 0; } }

/* Bank & cash cards, segmented choice */
.money-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.money-card { display: flex; align-items: center; gap: 14px; color: var(--ink); margin: 0; }
a.money-card:hover { border-color: var(--grey); text-decoration: none; }
.money-card .ico { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--paper); flex: none; }
.money-card .t { flex: 1; min-width: 0; } .money-card .t span { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.money-card .v { font: 700 18px/1.2 var(--display); white-space: nowrap; }
.seg { display: flex; gap: 8px; margin-bottom: 14px; }
.seg label { flex: 1; display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule-2); border-radius: 9px; padding: 10px 12px; color: var(--ink); font-size: 14px; margin: 0; cursor: pointer; }
.seg label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.seg input { width: auto; accent-color: var(--brand); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
label.check.panel { display: flex; align-items: flex-start; gap: 12px; color: var(--ink); font-size: 14px; }

/* Period picker */
.period { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.period select { width: auto; } .period .custom { display: inline-flex; gap: 6px; align-items: center; } .period .custom input { width: auto; }
/* Dashboard pulse */
.pulse { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.pulse .panel { margin: 0; color: var(--ink); display: grid; gap: 6px; align-content: start; }
.pulse a.panel:hover { border-color: var(--grey); text-decoration: none; }
.pulse .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pulse b { font: 700 24px/1.15 var(--display); letter-spacing: -.02em; display: block; } .pulse b.in { color: var(--good); }
.pulse .pair span, .pulse .who { color: var(--muted); font-size: 13px; }
/* Cashbook band */
.split-band { display: grid; grid-template-columns: minmax(220px, .7fr) 2fr; gap: 14px; margin-bottom: 18px; }
.band-total, .band-cats { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; }
.band-total b { display: block; font: 700 32px/1.1 var(--display); letter-spacing: -.02em; margin-top: 6px; }
.band-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 18px; align-content: start; }
.band-cats a { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; color: var(--ink); padding: 6px 8px; border-radius: 7px; font-size: 14px; }
.band-cats a:hover, .band-cats a.on { background: var(--paper); text-decoration: none; }
.band-cats a i { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--brand); display: block; }
/* Reports */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.report-card { display: grid; gap: 4px; color: var(--ink); margin: 0; align-content: start; }
.report-card:hover { border-color: var(--grey); text-decoration: none; }
.report-card .ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--primary); margin-bottom: 8px; }
.report-card span:last-child { color: var(--muted); font-size: 14px; }
.summary-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
.summary-row .summary { margin: 0; } .summary b { display: block; font: 700 26px/1.2 var(--display); letter-spacing: -.02em; margin-top: 4px; }
tr.total-row td { font-weight: 700; border-top: 1.5px solid var(--ink); background: #fafbfc; }
/* Key accounts */
.ka-head { display: flex; gap: 48px; flex-wrap: wrap; margin: 8px 0 20px; }
.ka-bars { display: grid; gap: 6px; }
.ka-bar { display: grid; grid-template-columns: minmax(140px, 260px) 1fr auto; gap: 14px; align-items: center; color: var(--ink); padding: 3px 6px; border-radius: 6px; font-size: 14px; }
.ka-bar:hover { background: var(--paper); text-decoration: none; }
.ka-bar .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ka-bar .track { height: 14px; background: var(--paper); border-radius: 4px; overflow: hidden; }
.ka-bar .track i { display: block; height: 100%; background: var(--grey); border-radius: 0 4px 4px 0; } .ka-bar .track i.a { background: var(--billed); }
.ka-bar .v { font-weight: 600; white-space: nowrap; min-width: 150px; text-align: right; } .ka-bar em { font-style: normal; color: var(--muted); font-weight: 400; margin-left: 6px; }
.seg-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.seg-row a { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 14px; color: var(--ink); display: grid; gap: 6px; }
.seg-row a:hover { border-color: var(--grey); text-decoration: none; } .seg-row a.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.seg-row b { font: 700 24px/1 var(--display); }
@media (max-width: 900px) { .pulse, .split-band { grid-template-columns: minmax(0, 1fr); } .ka-bar { grid-template-columns: 1fr auto; } .ka-bar .track { grid-column: 1 / -1; grid-row: 2; } }
@media print { .period, .page-head .actions { display: none !important; } }

/* Write-off review */
.wo-bar { display: grid; grid-template-columns: auto auto 1fr; gap: 28px; align-items: end; position: sticky; top: 66px; z-index: 5; }
.wo-bar b { display: block; font: 700 24px/1.2 var(--display); letter-spacing: -.02em; }
.wo-act { display: flex; gap: 10px; align-items: end; }
@media (max-width: 900px) { .wo-bar { grid-template-columns: 1fr; position: static; } }

/* Company switcher */
.company-pick .pop { min-width: 260px; }
.pick-co { width: 100%; justify-content: space-between; background: none; color: var(--ink); border: 0; padding: 9px 10px; border-radius: 7px; font-weight: 500; }
.pick-co:hover { background: var(--paper); } .pick-co[aria-current] { background: var(--brand-soft); color: #b3141a; font-weight: 650; }
.pick-co span { color: var(--muted); font-size: 12px; font-weight: 500; }
