/* HooWoo UI.
   Visual idea: a bookkeeping office. Pages are ledger paper with a faint cool green-grey tint and white cards
   ruled in hairlines. The sidebar is the dark cloth spine of the book, and each module keeps its own coloured
   index tab on it, as binders do. The open page takes that tab colour into its title tab, card icons, filters
   and figures. Figures are set in black ink and negatives in red ink; states are stamp inks with a drawn glyph.
   Ornament comes only from measure and from the tabs. No glows, glass or gradients.
   Colours are tokens on :root; dark values repeat under both dark scopes, chosen for the dark surface. */
:root {
  color-scheme: light;
  --bg: #e4ece8;
  --paper: #eef4f1;
  --surface: #ffffff;
  --surface-2: #f4f8f6;
  --sunk: #e8efeb;
  --hover: rgba(20, 70, 52, 0.06);
  --press: rgba(20, 70, 52, 0.11);
  --line: #d2dfd7;
  --line-strong: #b7c8be;
  --rule: #c5d4cb;
  /* ledger rule: the blue hairline under table heads, as on a ledger page */
  --ledger-rule: #9db5cb;
  --text: #14201b;
  --text-2: #44544c;
  --text-3: #56655c;
  --ink: #14201b;
  --brand: #1d6b51;
  --brand-ink: #165a43;
  --brand-hi: #23805f;
  --brand-soft: #dcece3;
  --brand-line: #9cc7b2;
  --on-brand: #ffffff;
  --ochre: #8f5405;
  --ochre-soft: #f6ebd6;
  --red-ink: #b3261e;
  --amber: #b26f0a;
  --amber-soft: #f6ebd6;
  --amber-ink: #8a4f02;
  /* the spine: a deep bottle-green cloth in both themes */
  --spine: #173d33;
  --spine-2: #1f4a3f;
  --spine-line: rgba(220, 240, 228, 0.12);
  --spine-ink: #e3efe8;
  --spine-icon: #a9c6b8;
  --spine-muted: #9ab4a7;
  --spine-hi: #9fe6c3;
  /* module index tabs: one hue per module, with a tint, a text ink and a pale tone for the dark spine.
     Workspace slate cyan, Sales ledger green, Purchases amber, Finance ink blue, Team rose, Insights moss,
     Settings plum-slate. Icons and tabs keep 3:1 on the surfaces; text inks keep 4.5:1. */
  --mod-work: #0f7396; --mod-work-soft: #e2f1f6; --mod-work-ink: #0d5f7c; --mod-work-spine: #7fd3e8;
  --mod-sales: #1f7f3f; --mod-sales-soft: #e3f3e6; --mod-sales-ink: #17672f; --mod-sales-spine: #8ed9a4;
  --mod-purch: #a35f00; --mod-purch-soft: #f9f0d8; --mod-purch-ink: #7d4800; --mod-purch-spine: #efc35c;
  --mod-fin: #2d56b8; --mod-fin-soft: #e7edfa; --mod-fin-ink: #23449a; --mod-fin-spine: #9dbcf5;
  --mod-team: #b8336a; --mod-team-soft: #f9e7ef; --mod-team-ink: #962755; --mod-team-spine: #f2a3c3;
  --mod-insight: #5f8a0f; --mod-insight-soft: #eef5dc; --mod-insight-ink: #4b6d0b; --mod-insight-spine: #c9e082;
  --mod-settings: #6b4fa8; --mod-settings-soft: #eeeaf7; --mod-settings-ink: #55398a; --mod-settings-spine: #cbb8ef;
  /* the open module, set on .shell by the spine link that is open; the brand when no module is open */
  --m: var(--brand);
  --m-soft: var(--brand-soft);
  --m-ink: var(--brand-ink);
  --m-spine: var(--spine-hi);
  /* module hues: muted inks for user-chosen colours (events, currencies); never decoration */
  --h-cobalt: #2f62b0; --h-azure: #1f7aa8; --h-lagoon: #17816a; --h-emerald: #2a7d4c;
  --h-lime: #5f7d1a; --h-saffron: #a86d0c; --h-tangerine: #b65a1e; --h-coral: #b8443a;
  --h-rose: #b0446f; --h-orchid: #8a4ca8; --h-iris: #5a50b8; --h-slate: #5b6770;
  /* categorical chart slots: validated order (adjacent CVD and normal-vision floors pass) */
  --s1: #2f6db5; --s2: #c97a12; --s3: #1f9a6e; --s4: #8a56c2;
  --s5: #c4473b; --s6: #0f8fae; --s7: #7d8f1f; --s8: #d2618f;
  --s2-ink: #9a5d08;
  /* sequential ink blue for ageing buckets, light to dark */
  --seq-1: #b9cfe9; --seq-2: #86abd8; --seq-3: #5688c4; --seq-4: #2f6db5; --seq-5: #1d4d87;
  /* status: always with a glyph and a label; the words take the same stamp inks */
  --st-good: #1d6e46; --st-warn: #8a5600; --st-bad: #b3261e; --st-info: #2a5ea0; --st-muted: #56605a;
  --ok-bg: #e0f0e6; --ok-ink: #17603a;
  --warn-bg: #f8eed6; --warn-ink: #7a4b00;
  --bad-bg: #f9e3df; --bad-ink: #a3211a;
  --info-bg: #e2eaf6; --info-ink: #22508c;
  --muted-bg: #e5eae6; --muted-ink: #4f5a53;
  --neg-ink: #b3261e;
  --track: #e0e8e3;
  --track-strong: #bccac1;
  --grid: #dae4de;
  --baseline: #a5b6ab;
  --tip-bg: #14201b;
  --tip-ink: #f3f6f3;
  --login-bg: #e4ece8;
  --la-line: rgba(20, 32, 27, 0.09);
  --la-line-strong: rgba(20, 32, 27, 0.26);
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 0 rgba(20, 32, 27, 0.03);
  --shadow-lift: 0 1px 2px rgba(20, 32, 27, 0.06), 0 8px 24px -14px rgba(20, 32, 27, 0.22);
  --shadow-pop: 0 2px 6px rgba(20, 32, 27, 0.08), 0 18px 40px -18px rgba(20, 32, 27, 0.35);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: "Ubuntu", "Noto Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Ubuntu Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* legacy names still referenced by inline styles */
  --side-ink: var(--spine-ink);
  --side-icon: var(--spine-icon);
  --side-muted: var(--spine-muted);
  --card-base: var(--surface);
  --card-border: var(--line);
  --primary-a: var(--brand);
  --primary-b: var(--brand-ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101614;
    --paper: #141c19;
    --surface: #18201c;
    --surface-2: #151d19;
    --sunk: #0f1512;
    --hover: rgba(205, 235, 218, 0.06);
    --press: rgba(205, 235, 218, 0.10);
    --line: #243029;
    --line-strong: #36453d;
    --rule: #2c3a33;
    --ledger-rule: #3d5a72;
    --text: #e7ede9;
    --text-2: #aab6af;
    --text-3: #8d9a93;
    --ink: #e7ede9;
    --brand: #5fbf96;
    --brand-ink: #7fd0ab;
    --brand-hi: #74cca5;
    --brand-soft: rgba(95, 191, 150, 0.13);
    --brand-line: rgba(95, 191, 150, 0.45);
    --on-brand: #0b1a13;
    --ochre: #d9a046;
    --ochre-soft: rgba(217, 160, 70, 0.13);
    --red-ink: #f39a8f;
    --amber: #d9a046;
    --amber-soft: rgba(217, 160, 70, 0.13);
    --amber-ink: #e8bd73;
    --spine: #0a211a;
    --spine-2: #12302a;
    --spine-line: rgba(220, 240, 228, 0.09);
    --spine-icon: #9fbdae;
    --spine-muted: #8fa89b;
    --spine-hi: #8fe0bd;
    --mod-work: #6cc6e0; --mod-work-soft: rgba(108, 198, 224, 0.13); --mod-work-ink: #93d9ee; --mod-work-spine: #7fd3e8;
    --mod-sales: #6fcf93; --mod-sales-soft: rgba(111, 207, 147, 0.13); --mod-sales-ink: #92dcab; --mod-sales-spine: #8ed9a4;
    --mod-purch: #e6b24f; --mod-purch-soft: rgba(230, 178, 79, 0.13); --mod-purch-ink: #f0c96f; --mod-purch-spine: #efc35c;
    --mod-fin: #8db3f2; --mod-fin-soft: rgba(141, 179, 242, 0.14); --mod-fin-ink: #abc9f7; --mod-fin-spine: #9dbcf5;
    --mod-team: #f08fb6; --mod-team-soft: rgba(240, 143, 182, 0.13); --mod-team-ink: #f5aac8; --mod-team-spine: #f2a3c3;
    --mod-insight: #c3da6e; --mod-insight-soft: rgba(195, 218, 110, 0.13); --mod-insight-ink: #d3e68e; --mod-insight-spine: #c9e082;
    --mod-settings: #bba9ea; --mod-settings-soft: rgba(187, 169, 234, 0.14); --mod-settings-ink: #cdbff3; --mod-settings-spine: #cbb8ef;
    --h-cobalt: #7ea4e6; --h-azure: #62b2dc; --h-lagoon: #4fc2a6; --h-emerald: #6cc58f;
    --h-lime: #a6c25a; --h-saffron: #ddb05a; --h-tangerine: #e79a5e; --h-coral: #ec8a7e;
    --h-rose: #e486ab; --h-orchid: #c597e0; --h-iris: #a59cf0; --h-slate: #a2adb5;
    --s1: #4f8ad6; --s2: #c27f1f; --s3: #2fa679; --s4: #9a74d6;
    --s5: #d85f52; --s6: #2a9dbb; --s7: #839626; --s8: #cf6b99;
    --s2-ink: #e0a85a;
    --seq-1: #24384f; --seq-2: #2f5583; --seq-3: #4a79b6; --seq-4: #77a3dc; --seq-5: #b1cdf0;
    --st-good: #7fdaa4; --st-warn: #e8c27c; --st-bad: #f39a8f; --st-info: #9cc3f0; --st-muted: #aeb9b2;
    --ok-bg: rgba(127, 218, 164, 0.12); --ok-ink: #9be3b8;
    --warn-bg: rgba(232, 194, 124, 0.13); --warn-ink: #efd19a;
    --bad-bg: rgba(243, 154, 143, 0.13); --bad-ink: #f5aea5;
    --info-bg: rgba(156, 195, 240, 0.13); --info-ink: #b6d3f5;
    --muted-bg: rgba(174, 185, 178, 0.11); --muted-ink: #bcc6c0;
    --neg-ink: #f39a8f;
    --track: #1f2a25;
    --track-strong: #3a4941;
    --grid: #1d2823;
    --baseline: #4b5a52;
    --tip-bg: #e7ede9;
    --tip-ink: #121815;
    --login-bg: #101614;
    --la-line: rgba(220, 235, 226, 0.07);
    --la-line-strong: rgba(220, 235, 226, 0.22);
    --shadow: none;
    --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 10px 28px -16px rgba(0, 0, 0, 0.8);
    --shadow-pop: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 22px 48px -20px rgba(0, 0, 0, 0.9);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101614;
  --paper: #141c19;
  --surface: #18201c;
  --surface-2: #151d19;
  --sunk: #0f1512;
  --hover: rgba(205, 235, 218, 0.06);
  --press: rgba(205, 235, 218, 0.10);
  --line: #243029;
  --line-strong: #36453d;
  --rule: #2c3a33;
  --ledger-rule: #3d5a72;
  --text: #e7ede9;
  --text-2: #aab6af;
  --text-3: #8d9a93;
  --ink: #e7ede9;
  --brand: #5fbf96;
  --brand-ink: #7fd0ab;
  --brand-hi: #74cca5;
  --brand-soft: rgba(95, 191, 150, 0.13);
  --brand-line: rgba(95, 191, 150, 0.45);
  --on-brand: #0b1a13;
  --ochre: #d9a046;
  --ochre-soft: rgba(217, 160, 70, 0.13);
  --red-ink: #f39a8f;
  --amber: #d9a046;
  --amber-soft: rgba(217, 160, 70, 0.13);
  --amber-ink: #e8bd73;
  --spine: #0a211a;
  --spine-2: #12302a;
  --spine-line: rgba(220, 240, 228, 0.09);
  --spine-icon: #9fbdae;
  --spine-muted: #8fa89b;
  --spine-hi: #8fe0bd;
  --mod-work: #6cc6e0; --mod-work-soft: rgba(108, 198, 224, 0.13); --mod-work-ink: #93d9ee; --mod-work-spine: #7fd3e8;
  --mod-sales: #6fcf93; --mod-sales-soft: rgba(111, 207, 147, 0.13); --mod-sales-ink: #92dcab; --mod-sales-spine: #8ed9a4;
  --mod-purch: #e6b24f; --mod-purch-soft: rgba(230, 178, 79, 0.13); --mod-purch-ink: #f0c96f; --mod-purch-spine: #efc35c;
  --mod-fin: #8db3f2; --mod-fin-soft: rgba(141, 179, 242, 0.14); --mod-fin-ink: #abc9f7; --mod-fin-spine: #9dbcf5;
  --mod-team: #f08fb6; --mod-team-soft: rgba(240, 143, 182, 0.13); --mod-team-ink: #f5aac8; --mod-team-spine: #f2a3c3;
  --mod-insight: #c3da6e; --mod-insight-soft: rgba(195, 218, 110, 0.13); --mod-insight-ink: #d3e68e; --mod-insight-spine: #c9e082;
  --mod-settings: #bba9ea; --mod-settings-soft: rgba(187, 169, 234, 0.14); --mod-settings-ink: #cdbff3; --mod-settings-spine: #cbb8ef;
  --h-cobalt: #7ea4e6; --h-azure: #62b2dc; --h-lagoon: #4fc2a6; --h-emerald: #6cc58f;
  --h-lime: #a6c25a; --h-saffron: #ddb05a; --h-tangerine: #e79a5e; --h-coral: #ec8a7e;
  --h-rose: #e486ab; --h-orchid: #c597e0; --h-iris: #a59cf0; --h-slate: #a2adb5;
  --s1: #4f8ad6; --s2: #c27f1f; --s3: #2fa679; --s4: #9a74d6;
  --s5: #d85f52; --s6: #2a9dbb; --s7: #839626; --s8: #cf6b99;
  --s2-ink: #e0a85a;
  --seq-1: #24384f; --seq-2: #2f5583; --seq-3: #4a79b6; --seq-4: #77a3dc; --seq-5: #b1cdf0;
  --st-good: #7fdaa4; --st-warn: #e8c27c; --st-bad: #f39a8f; --st-info: #9cc3f0; --st-muted: #aeb9b2;
  --ok-bg: rgba(127, 218, 164, 0.12); --ok-ink: #9be3b8;
  --warn-bg: rgba(232, 194, 124, 0.13); --warn-ink: #efd19a;
  --bad-bg: rgba(243, 154, 143, 0.13); --bad-ink: #f5aea5;
  --info-bg: rgba(156, 195, 240, 0.13); --info-ink: #b6d3f5;
  --muted-bg: rgba(174, 185, 178, 0.11); --muted-ink: #bcc6c0;
  --neg-ink: #f39a8f;
  --track: #1f2a25;
  --track-strong: #3a4941;
  --grid: #1d2823;
  --baseline: #4b5a52;
  --tip-bg: #e7ede9;
  --tip-ink: #121815;
  --login-bg: #101614;
  --la-line: rgba(220, 235, 226, 0.07);
  --la-line-strong: rgba(220, 235, 226, 0.22);
  --shadow: none;
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 10px 28px -16px rgba(0, 0, 0, 0.8);
  --shadow-pop: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 22px 48px -20px rgba(0, 0, 0, 0.9);
}

/* ---- base ---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { line-height: 1.25; font-weight: 500; }
a { color: inherit; }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--brand) 24%, transparent); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -0.01em; }
.wrap { overflow-wrap: anywhere; }
.muted-text { color: var(--text-3); font-size: 13px; }
.big { font-size: 26px; font-weight: 500; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }
.grow { flex: 1; font-size: 14px; }

/* ---- icons ---------------------------------------------------------------------------------
   Drawn for HooWoo: 1.5px ink outlines on a 24 grid, each with one solid mark (a needle hub,
   a selected cell, a total bar) that names the thing. The solid mark takes --ic-mark. */
.ic { display: inline-block; flex: none; vertical-align: middle; overflow: visible; }
.ic .mk { fill: var(--ic-mark, currentColor); stroke: none; }

/* ---- sign-in ----------------------------------------------------------------------- */
.login {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: var(--login-bg);
}
.login-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.la-frame, .la-axis { fill: none; stroke: var(--la-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.la-sq { fill: none; stroke: var(--la-line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.la-spiral {
  fill: none; stroke: var(--brand); stroke-width: 1; stroke-linecap: round; opacity: 0.8;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.8s var(--ease-out) 0.25s forwards;
}
.la-c { fill: none; stroke-width: 1; stroke-dasharray: 1 6; stroke: var(--la-line-strong); vector-effect: non-scaling-stroke; }
.la-ticks { fill: none; stroke: var(--la-line-strong); stroke-width: 1; }
.login-card {
  width: min(400px, 100%); color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 30px 28px 26px;
  box-shadow: var(--shadow-pop);
  animation: rise 0.6s var(--ease-out) both;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.login-card.done { opacity: 0; transform: translateY(-6px); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 8px; }
.login-brand h1 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tile-wrap { position: relative; width: 104px; }
.tile-main {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%;
  background: none; border: 1px solid transparent; color: var(--text); font: inherit; cursor: pointer; padding: 12px 6px 10px; border-radius: 10px;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.tile-main:hover, .tile-main:focus-visible { background: var(--hover); border-color: var(--line); }
.tile-name { font-size: 13px; font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-x {
  position: absolute; top: 2px; right: 4px; width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2);
  display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.tile-wrap:hover .tile-x, .tile-x:focus-visible { opacity: 1; }
@media (hover: none) { .tile-x { opacity: 1; } }
.tile-other .tile-ico {
  width: 64px; height: 64px; border-radius: 50%; border: 1px dashed var(--line-strong);
  display: grid; place-items: center; color: var(--text-2);
}
.who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.who strong { flex: 1; min-width: 0; font-weight: 500; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--brand-ink);
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; padding: 4px 2px; text-decoration: none;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- form controls ------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.input {
  min-height: 38px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; width: 100%; min-width: 0;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
textarea.input { padding: 9px 11px; line-height: 1.5; }
.input:hover { border-color: color-mix(in srgb, var(--line-strong) 60%, var(--text-3)); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.input::placeholder { color: var(--text-3); }
.input[readonly] { background: var(--surface-2); }
.input:disabled { background: var(--surface-2); color: var(--text-3); }
.select {
  padding-right: 32px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
input[type="date"], input[type="datetime-local"], input[type="time"] { font-variant-numeric: tabular-nums; }
.date-pop input { min-height: 36px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; }
.form-error { color: var(--bad-ink); margin: 0; font-size: 13.5px; font-weight: 500; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch .track {
  width: 36px; height: 20px; border-radius: 10px; background: var(--track-strong); position: relative; flex: none;
  transition: background 0.22s var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; transition: transform 0.22s var(--ease-out); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---- buttons --------------------------------------------------------------------------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.12s var(--ease);
}
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--m) 45%, var(--line-strong)); }
.btn:active { transform: translateY(1px); }
.btn .ic { color: var(--text-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary .ic { color: inherit; --ic-mark: currentColor; }
.btn.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
:root[data-theme="dark"] .btn.primary:hover { background: var(--brand-hi); border-color: var(--brand-hi); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary:hover { background: var(--brand-hi); border-color: var(--brand-hi); } }
.btn.danger { background: var(--surface); color: var(--bad-ink); border-color: color-mix(in srgb, var(--st-bad) 40%, var(--line)); }
.btn.danger .ic { color: inherit; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); border-color: transparent; }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2);
  cursor: pointer; text-decoration: none; transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn .ic { color: inherit; }

/* ---- shell ------------------------------------------------------------------------------- */
.shell { position: relative; display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.shell.arrive { animation: fade-in 0.45s var(--ease) both; }
.side {
  position: sticky; top: 0; height: 100vh; z-index: 30; overflow: visible;
  display: flex; flex-direction: column; gap: 4px; padding: 16px 12px 12px;
  background: var(--spine); color: var(--spine-ink);
  border-right: 1px solid var(--spine-line);
  --ic-mark: var(--spine-icon);
}
/* stitched edge of the spine: a row of fine ticks along the right side */
.side::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: 5px; width: 1px; pointer-events: none;
  background: repeating-linear-gradient(to bottom, var(--spine-line) 0 6px, transparent 6px 12px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; }
.brand-mark { position: relative; display: inline-flex; border-radius: 10px; outline: none; cursor: default; }
.brand-mark:focus-visible { outline: 2px solid var(--spine-hi); outline-offset: 3px; }
.about {
  position: absolute; left: 0; top: calc(100% + 10px); width: 268px; z-index: 60;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}
.about strong { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.about span { display: block; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.brand-mark:hover .about, .brand-mark:focus-visible .about, .brand-mark:focus-within .about { opacity: 1; transform: none; pointer-events: auto; }
.brand-name { font-size: 19px; font-weight: 500; color: #f1f6f2; letter-spacing: 0.01em; }
.nav-scroll {
  position: relative; flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto;
  scrollbar-width: none; margin: 0 -12px; padding: 0 12px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 8px, #000 calc(100% - 14px), transparent 100%);
}
.nav-scroll::-webkit-scrollbar { display: none; }
.nav { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 4px 0 8px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; margin-top: 10px; }
.nav-title { font-size: 11.5px; font-weight: 500; color: var(--spine-muted); padding: 6px 12px 4px; letter-spacing: 0.02em; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 11px; height: 34px; padding: 0 10px 0 12px; border-radius: 7px;
  color: var(--spine-ink); text-decoration: none; font-size: 14px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav-link > .ic { color: var(--spine-icon); transition: color 0.18s var(--ease); }
.nav-link:hover { background: rgba(220, 240, 228, 0.055); color: #fff; }
.nav-link:hover > .ic { color: #e6efe9; }
.nav-link[aria-current="page"] { color: #fff; background: color-mix(in srgb, var(--m-spine) 16%, transparent); }
.nav-link[aria-current="page"] > .ic { color: #fff; --ic-mark: var(--m-spine); }
.lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the index tab: a short rule that travels to the open page */
.nav-ind {
  position: absolute; left: -12px; top: 0; width: 3px; height: 18px; border-radius: 0 2px 2px 0;
  background: var(--m-spine); pointer-events: none; opacity: 0;
  transition: transform 0.38s var(--ease-out), opacity 0.2s var(--ease);
}
.nav-ind.on { opacity: 1; }
.badge-slot { display: inline-flex; margin-left: auto; }
.badge-count {
  font-size: 12px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; color: var(--brand-ink);
  min-width: 16px; text-align: right;
}
.side .badge-count { color: var(--spine-hi); }
.nav-count { margin-left: auto; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--spine-hi); }
.side-foot { display: flex; flex-direction: column; gap: 1px; padding-top: 8px; border-top: 1px solid var(--spine-line); margin-top: 4px; }
.user { position: relative; margin-top: 8px; }
.user-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; color: #fff; font: inherit; text-align: left; cursor: pointer;
  padding: 8px 10px; border-radius: 9px; border: 1px solid var(--spine-line); background: var(--spine-2);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.user-btn:hover { background: color-mix(in srgb, var(--spine-2) 80%, #fff 6%); border-color: rgba(220, 240, 228, 0.16); }
.user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-text strong { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-text span { font-size: 12px; color: var(--spine-muted); }
.user-chev { display: inline-flex; color: var(--spine-icon); flex: none; transition: transform 0.2s var(--ease); }
.user-btn[aria-expanded="true"] .user-chev { transform: rotate(180deg); }
.main { min-width: 0; display: flex; flex-direction: column; position: relative; z-index: 1; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 32px 14px; background: var(--bg);
  transition: box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.top::after {
  content: ""; position: absolute; left: 32px; right: 32px; bottom: 0; height: 1px; background: var(--line);
  opacity: 0; transition: opacity 0.2s var(--ease);
}
.top.stuck { background: color-mix(in srgb, var(--bg) 92%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.top.stuck::after { opacity: 1; }
.top-head { min-width: 0; display: flex; flex-direction: column; }
.top-title { margin: 0; font-size: 25px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-sub { margin: 3px 0 0; font-size: 13px; color: var(--text-3); }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.top-actions .icon-btn { width: 38px; height: 38px; }
.top-actions .new-btn { min-height: 38px; padding: 0 14px 0 12px; }
.sync-link[data-state="run"] .ic { animation: spin 2.4s linear infinite; }
.sync-link[data-state="bad"] { color: var(--st-bad); border-color: color-mix(in srgb, var(--st-bad) 45%, var(--line)); }
.content { padding: 8px 32px 56px; width: 100%; max-width: 1480px; }
.page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head > .btn, .page-head > .pop-wrap { margin-left: auto; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.seg-slot, .date-slot { display: contents; }
.list-meta { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; margin: 0; }
.bnav { display: none; }

/* page arrival: blocks rise into place one after another */
.page > * { animation: rise 0.42s var(--ease-out) both; }
.page > *:nth-child(2) { animation-delay: 0.04s; }
.page > *:nth-child(3) { animation-delay: 0.08s; }
.page > *:nth-child(4) { animation-delay: 0.12s; }
.page > *:nth-child(5) { animation-delay: 0.16s; }
.page > *:nth-child(n+6) { animation-delay: 0.2s; }
.page .page > * { animation: none; }

/* ---- header: global search and notifications ------------------------------------------- */
.gsearch {
  position: relative; display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 8px 0 12px;
  width: clamp(220px, 24vw, 340px); border-radius: var(--radius-sm); border: 1px solid var(--line-strong); color: var(--text-3);
  background: var(--surface); transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.gsearch:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.gsearch.pop-wrap { display: flex; }
.gs-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; }
.gs-input::placeholder { color: var(--text-3); }
.gs-input::-webkit-search-cancel-button { display: none; }
.gs-kbd {
  font: 500 11px/1 var(--mono); padding: 4px 6px; border-radius: 5px; white-space: nowrap;
  border: 1px solid var(--line); border-bottom-width: 2px; background: var(--surface-2); color: var(--text-3);
}
.gs-pop { top: calc(100% + 6px); left: 0; width: max(100%, 420px); max-height: min(70vh, 540px); overflow: auto; padding: 6px; }
.gs-group + .gs-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.gs-head { font-size: 12px; font-weight: 500; color: var(--text-3); padding: 6px 8px 4px; }
.gs-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; color: inherit; text-decoration: none; }
.gs-item:hover, .gs-item.on { background: var(--hover); }
.gs-item.on { box-shadow: inset 2px 0 0 var(--brand); }
.gs-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.gs-text strong { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-text span { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-none { margin: 0; padding: 14px 10px; color: var(--text-3); font-size: 14px; }
.bell-count {
  position: absolute; top: 3px; right: 4px; font-size: 10.5px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  color: var(--red-ink); background: var(--surface); padding: 1px 2px; border-radius: 3px;
}
.bell-pop { top: calc(100% + 6px); right: 0; width: 310px; }
.pop-title { font-size: 12.5px; font-weight: 500; color: var(--text-3); padding: 8px 10px 6px; }
.pop-empty { display: flex; align-items: center; gap: 8px; margin: 0; padding: 6px 10px 10px; color: var(--text-2); font-size: 14px; }
.pop-empty .ic { color: var(--st-good); }

/* ---- popovers and menus ------------------------------------------------------------- */
.pop-wrap { position: relative; display: inline-block; }
.pop {
  position: absolute; z-index: 60; min-width: 220px; color: var(--text); padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-pop);
  transform-origin: top right; animation: pop-in 0.16s var(--ease-out) both;
}
.new-menu { top: calc(100% + 6px); right: 0; min-width: 240px; }
.date-pop { top: calc(100% + 6px); left: 0; width: 280px; padding: 14px; display: flex; flex-direction: column; gap: 12px; transform-origin: top left; }
.pop-actions { display: flex; justify-content: flex-end; gap: 8px; }
.user .pop { bottom: calc(100% + 8px); left: 0; right: 0; min-width: 0; transform-origin: bottom left; }
.user-menu { width: 300px; right: auto !important; }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 7px; color: inherit;
  text-decoration: none; background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.pop-item:hover { background: var(--hover); }
.pop-item .ic, .pop-item .glyph { color: var(--text-3); }
.pop-item.on { color: var(--brand-ink); font-weight: 500; }
.pop-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; flex-wrap: wrap; }
.pop-row > .ic { color: var(--text-3); }
.pop-row .seg { flex: none; }

/* ---- segmented controls, chips, search ------------------------------------------------------- */
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 0; padding: 2px; border-radius: 8px;
  background: var(--sunk); border: 1px solid var(--line);
}
.field > .seg, .stack-form > .seg, .field > div > .seg { align-self: flex-start; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border: 0; background: transparent;
  color: var(--text-2); border-radius: 6px; font: inherit; font-size: 13px; font-weight: 400; cursor: pointer; white-space: nowrap;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 0 0 1px var(--line-strong), 0 1px 2px rgba(21, 27, 23, 0.06); }
.seg-btn .ic { color: var(--text-3); }
.seg-btn[aria-pressed="true"] .ic { color: var(--text); --ic-mark: var(--m); }
.seg-btn .count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; font-weight: 400; }
.seg-btn[aria-pressed="true"] .count { color: var(--brand-ink); }
.search {
  display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); color: var(--text-3); min-width: 200px; flex: 1 1 220px; max-width: 320px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.search-input { border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 14px; flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 2px; align-items: center; }
/* filter chips read as an index: text with a rule under the chosen one */
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 0;
  border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-2); font: inherit; font-size: 13.5px; cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.22s var(--ease);
}
.chip-btn:hover { color: var(--text); border-bottom-color: var(--line-strong); }
.chip-btn .count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip-btn[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--m); font-weight: 500; }
/* small facts beside a name: plain inked text, never a capsule */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 0; font-size: 12.5px; font-weight: 400;
  color: var(--text-2); white-space: nowrap; background: none; border: 0; text-decoration: none;
}
.chip .ic { color: var(--text-3); }
.chip.local { color: var(--ochre); font-weight: 500; }
.chip.local .ic { color: var(--ochre); }
.chip.link { color: var(--brand-ink); }
.chip.link .ic, .chip.copied .ic { color: inherit; }
.chip.copied { color: var(--text-3); }
.chip.cur { color: var(--text-3); font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.02em; }
.chip.budget { color: var(--brand-ink); }
.chip.ok-chip { color: var(--ok-ink); }
.chip.warn-chip { color: var(--warn-ink); }
.chip.link:hover, .chip.ok-chip:hover { text-decoration: underline; text-underline-offset: 3px; }
.src { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.src::before { content: "·"; margin-right: 5px; color: var(--line-strong); }
.marks { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; vertical-align: middle; }
.marks > * + .chip.local::before { content: "·"; margin-right: 1px; color: var(--line-strong); font-weight: 400; }
.marks > .src:first-child::before { content: none; }

/* ---- status marks: a glyph that names the state, then the word ----------------------------------- */
.status, .pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; white-space: nowrap;
  color: var(--text); background: none; padding: 0; border-radius: 0;
}
.status .sg, .pill .sg { flex: none; color: var(--st-muted); }
.st-ok .sg { color: var(--st-good); }
.st-warn .sg { color: var(--st-warn); }
.st-bad .sg { color: var(--st-bad); }
.st-info .sg { color: var(--st-info); }
.st-muted { color: var(--text-2); }
.st-bad { color: var(--text-2); }
.pill .dot { display: none; }

/* ---- cards and grids ----------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); min-width: 0; color: var(--text);
}
a.card { text-decoration: none; transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease-out); }
a.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; min-width: 0; }
.card-title { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 15px; font-weight: 500; letter-spacing: -0.005em; min-width: 0; color: var(--text); }
.card-title .ic, .card-title .glyph { color: var(--text-3); }
.card-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card-grid.budgets, .card-grid.rates { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card-grid.products { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card-grid.people { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-grid > .span-2 { grid-column: span 2; }
.dash-grid > .card { min-width: 0; }
.two-up { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.settings-grid > .card { min-width: 0; }
.asof { margin: 0; }

/* Figures sit in one ruled strip, a column each, like the head of a ledger page. */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.kpi-grid > .card, .kpi-grid > a.card {
  border: 0; border-radius: 0; box-shadow: none; background: none; margin: 0 -1px -1px 0;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 14px 18px;
}
.kpi-grid > a.card:hover { background: var(--surface-2); box-shadow: none; }
.kpi-grid .kpi-value { font-size: 22px; gap: 6px; }
.kpi-grid .kpi-value .num { overflow: hidden; text-overflow: ellipsis; }
.kpi { display: flex; flex-direction: column; gap: 6px; text-decoration: none; position: relative; overflow: hidden; }
.kpi-top { display: flex; align-items: center; gap: 8px; }
.kpi-top .glyph { --g: 18px; }
.kpi-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); min-width: 0; }
.kpi-label .ic { color: var(--text-3); }
.rec-kind { font-size: 12.5px; color: var(--text-3); }
.late .ic { color: inherit; }
.fact-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fact-val { font-weight: 500; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; min-width: 0; }
.fact-val .contact-top { gap: 10px; }
.paid-pct { margin-left: auto; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.paid-meter { margin-top: 4px; }
.paid-meter .meter-fill { background: var(--st-warn); }
.paid-meter.full .meter-fill { background: var(--brand); }
.kpi-value { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.kpi-cur { font-size: 12px; color: var(--text-3); font-weight: 400; font-family: var(--mono); letter-spacing: 0.02em; }
.kpi-sub { font-size: 12.5px; color: var(--text-3); }
.kpi .spark { height: 30px; margin-top: auto; }

/* per-currency totals: one ruled strip, a column per currency */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; align-items: stretch;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative;
}
.stat-row > .card.stat {
  border: 0; border-radius: 0; box-shadow: none; padding: 14px 18px 14px; background: none;
  border-right: 1px solid var(--line); margin-right: -1px;
}
.stat-label { display: inline-flex; align-items: center; gap: 2px; }
.stat-label .info { width: 18px; height: 18px; }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 12.5px; color: var(--text-3); }
.stat-main { font-size: 21px; font-weight: 500; letter-spacing: -0.015em; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.stat-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; margin: 0; }
.stat-grid > div, .budget-stats > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stat-grid dt { font-size: 12px; color: var(--text-3); }
.stat-grid dd { margin: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--text-2); }

/* pipeline strip: a ruled row of counters; the chosen one is underlined */
.stages {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stage {
  --tone: var(--st-muted);
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 16px 13px;
  border: 0; border-right: 1px solid var(--line); background: none; cursor: pointer; text-align: left; font: inherit; color: var(--text);
  transition: background 0.18s var(--ease);
}
.stage:last-child { border-right: 0; }
.stage:hover { background: var(--surface-2); }
.stage::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 2px; background: var(--tone);
  transform: scaleX(0); transform-origin: left; transition: transform 0.32s var(--ease-out);
}
.stage.on::after { transform: scaleX(1); }
.stage strong { font-size: 22px; font-weight: 500; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.stage span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.stage span::before { content: ""; width: 8px; height: 2px; background: var(--tone); flex: none; }
.stage.tone-info { --tone: var(--st-info); }
.stage.tone-ok { --tone: var(--st-good); }
.stage.tone-warn { --tone: var(--st-warn); }
.stage.tone-bad { --tone: var(--st-bad); }

/* expense type tiles */
.type-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.type-tile {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-align: left; font: inherit; color: var(--text); cursor: pointer;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.type-tile:hover { border-color: var(--line-strong); }
.type-tile[aria-pressed="true"] { border-color: var(--m); box-shadow: inset 0 0 0 1px var(--m); }
.type-ico { grid-row: 1 / span 3; }
.type-tile strong { font-size: 14px; font-weight: 500; }
.type-tile .num { font-size: 13.5px; text-align: left; color: var(--text-2); }

/* ---- tables -------------------------------------------------------------------------- */
.table-wrap {
  overflow: auto; max-height: 72vh; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th {
  position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; font-size: 12.5px; font-weight: 500;
  color: var(--text-3); padding: 10px 14px 9px; border-bottom: 1px solid var(--ledger-rule); white-space: nowrap;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tbody tr { transition: background 0.12s var(--ease); }
.table tr.click:hover td, .table tr.click:focus-visible td { background: var(--surface-2); }
.table tr.click:focus-visible { outline: none; }
.table tr.click:focus-visible td:first-child { box-shadow: inset 2px 0 0 var(--brand); }
.table tr.muted td { color: var(--text-3); }
.table th.num, .table td.num { text-align: right; }
.table td .amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td .cur { margin-left: 5px; font-size: 11px; color: var(--text-3); font-family: var(--mono); letter-spacing: 0.02em; }
.table td .amt.neg, .amt.neg { color: var(--neg-ink); }
@media (max-width: 1100px) { .hide-md { display: none; } }
@media (max-width: 700px) { .hide-sm { display: none; } }
.docno { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.docno-txt { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0.005em; }
.edoc { color: var(--text-3); display: inline-grid; }
.person { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.person-name { min-width: 0; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.late { color: var(--red-ink); font-weight: 500; }
.diffs { display: flex; flex-direction: column; gap: 4px; }
.diff { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.diff code { background: var(--sunk); padding: 0 5px; border-radius: 4px; font-size: 12px; font-family: var(--mono); }
.diff-old { color: var(--text-3); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-3) 60%, transparent); }
.diff-new { color: var(--text); font-weight: 500; }

/* ---- avatars: people are round, organisations are square tiles carrying their real mark ---------- */
.av {
  position: relative; display: inline-grid; place-items: center; border-radius: 50%; flex: none; font-weight: 500;
  overflow: hidden; line-height: 1; user-select: none; letter-spacing: 0.01em;
  background: var(--av-bg, var(--sunk)); color: var(--av-ink, var(--text-2));
}
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.org { border-radius: 24%; box-shadow: inset 0 0 0 1px var(--av-ring, transparent); }
.av.org .logo-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 12%;
  background: #fff; opacity: 0; transition: opacity 0.45s var(--ease);
}
.av.org.has-logo { box-shadow: inset 0 0 0 1px rgba(21, 27, 23, 0.1); }
.av.org.has-logo .logo-img { opacity: 1; }
.av.org.has-logo .av-ini { opacity: 0; transition: opacity 0.3s var(--ease); }
.av-0 { --av-bg: #dfe8f3; --av-ink: #26507f; }
.av-1 { --av-bg: #f3e6d4; --av-ink: #7d4a10; }
.av-2 { --av-bg: #dcefe5; --av-ink: #1e6343; }
.av-3 { --av-bg: #ebe2f3; --av-ink: #5f3d84; }
.av-4 { --av-bg: #f4e0e2; --av-ink: #8a3237; }
.av-5 { --av-bg: #dcedf1; --av-ink: #1f5f6e; }
.av-6 { --av-bg: #e9edd8; --av-ink: #4f5d16; }
.av-7 { --av-bg: #f3e1ea; --av-ink: #873a60; }
:root[data-theme="dark"] .av-0 { --av-bg: #1f2c3b; --av-ink: #9fc0e6; }
:root[data-theme="dark"] .av-1 { --av-bg: #33281a; --av-ink: #e3b878; }
:root[data-theme="dark"] .av-2 { --av-bg: #1b3027; --av-ink: #8fd3b0; }
:root[data-theme="dark"] .av-3 { --av-bg: #2b2336; --av-ink: #c7aee6; }
:root[data-theme="dark"] .av-4 { --av-bg: #362224; --av-ink: #eba4a8; }
:root[data-theme="dark"] .av-5 { --av-bg: #1a2f34; --av-ink: #8ccbd9; }
:root[data-theme="dark"] .av-6 { --av-bg: #2a2f1b; --av-ink: #c3d07e; }
:root[data-theme="dark"] .av-7 { --av-bg: #35212c; --av-ink: #e6a6c6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .av-0 { --av-bg: #1f2c3b; --av-ink: #9fc0e6; }
  :root:not([data-theme="light"]) .av-1 { --av-bg: #33281a; --av-ink: #e3b878; }
  :root:not([data-theme="light"]) .av-2 { --av-bg: #1b3027; --av-ink: #8fd3b0; }
  :root:not([data-theme="light"]) .av-3 { --av-bg: #2b2336; --av-ink: #c7aee6; }
  :root:not([data-theme="light"]) .av-4 { --av-bg: #362224; --av-ink: #eba4a8; }
  :root:not([data-theme="light"]) .av-5 { --av-bg: #1a2f34; --av-ink: #8ccbd9; }
  :root:not([data-theme="light"]) .av-6 { --av-bg: #2a2f1b; --av-ink: #c3d07e; }
  :root:not([data-theme="light"]) .av-7 { --av-bg: #35212c; --av-ink: #e6a6c6; }
}
.side .av { --av-bg: #2a3d33; --av-ink: #cfe7da; }

/* info tooltip icon */
.info {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--text-3);
  cursor: help; flex: none; border: 0; transition: color 0.15s var(--ease);
}
.info:hover, .info:focus-visible { color: var(--text); }

/* empty and loading */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 36px 16px 44px; color: var(--text-2); }
.empty p { margin: 0; font-size: 14.5px; color: var(--text-2); }
.loading { display: flex; align-items: center; gap: 10px; padding: 24px 4px; color: var(--text-3); font-size: 13.5px; }
.spin {
  width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--line-strong); border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}
.feed { transition: opacity 0.2s var(--ease); display: flex; flex-direction: column; gap: 14px; }
.feed.busy { opacity: 0.5; pointer-events: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 4px 0; }
.pager-text { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---- contacts, products, people -------------------------------------------------------- */
.card.contact { display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; padding: 16px 18px; }
.contact-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.contact-id { min-width: 0; display: flex; flex-direction: column; gap: 1px; flex: 1; }
.contact-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-place { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); font-size: 12.5px; min-width: 0; }
.contact-place .ic { color: var(--text-3); }
.mini-set { display: flex; flex-direction: column; gap: 7px; }
.mini { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12.5px; }
.mini-label { color: var(--text-3); }
.mini-bar { height: 4px; width: 100%; display: block; border-radius: 2px; overflow: hidden; }
.mini-bar .hbar-bg { fill: var(--track); }
.mini-val { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; color: var(--text-2); }
.contact-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px;
  border-top: 1px solid var(--line); font-size: 12.5px; flex-wrap: wrap; color: var(--text-3);
}
.open-chip { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.open-chip.pos { color: var(--text); }
.open-chip.neg { color: var(--neg-ink); }
.open-chip .ic { color: var(--text-3); }
.card.product { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; }
.prod-top { display: flex; align-items: center; justify-content: space-between; }
.prod-name { font-weight: 500; overflow-wrap: anywhere; }
.prod-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); flex-wrap: wrap; }
.prod-meta .mono { color: var(--text-2); }
.prod-price { font-size: 19px; font-weight: 500; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.prod-price .cur { font-size: 11px; color: var(--text-3); margin-left: 5px; font-family: var(--mono); font-weight: 400; }
.contact-lines { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.contact-lines li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.contact-lines .ic { color: var(--text-3); }
.contact-lines span { overflow-wrap: anywhere; }
.card.person-card { display: flex; flex-direction: column; gap: 12px; }

/* ---- charts ------------------------------------------------------------------------------- */
.chart-wrap { min-width: 0; }
.chart-box { width: 100%; min-width: 0; position: relative; }
.chart-svg, .donut, .ring, .spark { display: block; overflow: visible; }
.chart-svg text.tick, .area-chart text.tick { font-size: 11px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.grid { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.base { stroke: var(--baseline); stroke-width: 1; shape-rendering: crispEdges; }
.bar { stroke: none; transition: opacity 0.2s var(--ease); }
.bars-svg:hover .bar { opacity: 0.55; }
.bars-svg:hover .bar-col:hover .bar, .bars-svg .bar:hover { opacity: 1; }
.bar.s-1 { fill: var(--s1); } .bar.s-2 { fill: var(--s2); } .bar.s-3 { fill: var(--s3); } .bar.s-4 { fill: var(--s4); }
.bar.s-5 { fill: var(--s5); } .bar.s-6 { fill: var(--s6); } .bar.s-7 { fill: var(--s7); } .bar.s-8 { fill: var(--s8); }
.area-chart { position: relative; }
.area-fill { fill-opacity: 0.1; stroke: none; }
.area-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cross { stroke: var(--text-3); stroke-width: 1; }
.dot-hi { stroke: var(--surface); stroke-width: 2; }
.chart-tip {
  position: absolute; transform: translate(-50%, calc(-100% - 10px)); background: var(--tip-bg); color: var(--tip-ink);
  padding: 6px 9px; border-radius: 6px; font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 5;
  font-variant-numeric: tabular-nums; box-shadow: var(--shadow-lift);
}
.spark { width: 100%; height: 30px; }
.spark-line { fill: none; stroke-width: 1.5; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.donut .track { stroke: var(--track); }
.donut-total { font-size: 26px; font-weight: 500; fill: var(--text); letter-spacing: -0.02em; }
.donut-sub { font-size: 12px; fill: var(--text-3); }
.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; font-size: 13px; min-width: 170px; flex: 1; }
.legend-list li { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.legend-list li:last-child { border-bottom: 0; }
.lg-label { flex: 1; color: var(--text-2); min-width: 0; }
.lg-val { font-variant-numeric: tabular-nums; font-weight: 500; }
.ring .track { stroke: var(--track); }
.ring-arc.ring-brand { stroke: var(--brand); }
.ring-arc.ring-warn { stroke: var(--st-warn); }
.ring-arc.ring-bad { stroke: var(--st-bad); }
.ring-text { font-size: 16px; font-weight: 500; fill: var(--text); font-variant-numeric: tabular-nums; }
.hbars { display: flex; flex-direction: column; gap: 2px; }
.hrow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 7px 8px; border-radius: 8px; transition: background 0.15s var(--ease); }
.hrow.click { cursor: pointer; }
.hrow.click:hover, .hrow.click:focus-visible { background: var(--surface-2); outline: none; }
.hrow-lead { display: inline-flex; }
.hrow-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hrow-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; min-width: 0; align-items: baseline; }
.hrow-label, .hrow-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.hrow-val { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.hrow-val .cur { margin-left: 5px; font-size: 11px; color: var(--text-3); font-weight: 400; font-family: var(--mono); }
.hbar { width: 100%; height: 4px; display: block; border-radius: 2px; background: var(--track); overflow: hidden; }
.hbar-bg { fill: var(--track); }
.hbar-fill {
  --c: var(--s1); display: block; height: 100%; min-width: 3px; border-radius: inherit; background: var(--c);
  transform-origin: left; animation: grow-x 0.9s var(--ease-out) both;
}
.hbar-fill.fill-2 { --c: var(--s2); }
.hbar-fill.fill-c { --c: var(--s1); }
.hbar-fill.fill-o { --c: var(--s2); }
.stack { width: 100%; height: 10px; display: block; border-radius: 3px; overflow: hidden; margin: 10px 0 12px; }
.stack .track { fill: var(--track); }
.ageing-head { display: flex; align-items: baseline; gap: 10px; }

/* fills and strokes per categorical slot and ramp */
.fill-1 { fill: var(--s1); } .fill-2 { fill: var(--s2); } .fill-3 { fill: var(--s3); } .fill-4 { fill: var(--s4); }
.fill-5 { fill: var(--s5); } .fill-6 { fill: var(--s6); } .fill-7 { fill: var(--s7); } .fill-8 { fill: var(--s8); }
.stroke-1 { stroke: var(--s1); color: var(--s1); } .stroke-2 { stroke: var(--s2); color: var(--s2); } .stroke-3 { stroke: var(--s3); color: var(--s3); } .stroke-4 { stroke: var(--s4); color: var(--s4); }
.stroke-5 { stroke: var(--s5); color: var(--s5); } .stroke-6 { stroke: var(--s6); color: var(--s6); } .stroke-7 { stroke: var(--s7); color: var(--s7); } .stroke-8 { stroke: var(--s8); color: var(--s8); }
.stroke-tone { stroke: var(--tone); }
.seg-1 { fill: var(--seq-1); } .seg-2 { fill: var(--seq-2); } .seg-3 { fill: var(--seq-3); } .seg-4 { fill: var(--seq-4); } .seg-5 { fill: var(--seq-5); }
.swatch.fill-1 { background: var(--s1); } .swatch.fill-2 { background: var(--s2); } .swatch.fill-3 { background: var(--s3); }
.swatch.fill-4 { background: var(--s4); } .swatch.fill-5 { background: var(--s5); } .swatch.fill-6 { background: var(--s6); }
.swatch.fill-7 { background: var(--s7); } .swatch.fill-8 { background: var(--s8); }
.swatch.seq-1 { background: var(--seq-1); } .swatch.seq-2 { background: var(--seq-2); } .swatch.seq-3 { background: var(--seq-3); }
.swatch.seq-4 { background: var(--seq-4); } .swatch.seq-5 { background: var(--seq-5); }

/* chart arrival: columns rise from the baseline, lines draw, segments sweep (first paint only) */
.anim .bar { transform-box: fill-box; transform-origin: 50% 100%; animation: grow-y 0.7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 28ms); }
.anim .bar.neg { transform-origin: 50% 0; }
.anim .area-line, .anim .spark-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s var(--ease-out) 0.1s forwards; }
.anim .area-fill { animation: fade-in 0.9s var(--ease) 0.35s both; }
.anim .seg { animation: fade-in 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
.anim .ring-arc { animation: sweep 1s var(--ease-out) both; }
.segbar-part { transform-origin: left; animation: grow-x 0.8s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }

/* ---- dashboard -------------------------------------------------------------------------------- */
/* the ledger strip: the four figures that matter, ruled into columns like a ledger page */
.ledger {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.lc {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 20px 14px; min-width: 0;
  color: inherit; text-decoration: none; border-right: 1px solid var(--line);
  transition: background 0.2s var(--ease);
}
.lc:last-child { border-right: 0; }
a.lc:hover { background: var(--surface-2); }
.lc-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); min-width: 0; }
.lc-label > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-label .ic { color: var(--text-3); }
.lc-open { margin-left: auto; color: var(--text-3); opacity: 0; transform: translate(-3px, 3px); transition: opacity 0.2s var(--ease), transform 0.25s var(--ease-out); }
a.lc:hover .lc-open { opacity: 1; transform: none; }
.lc-value { display: flex; align-items: baseline; gap: 7px; margin-top: 4px; font-size: 27px; font-weight: 500; letter-spacing: -0.025em; line-height: 1.15; min-width: 0; }
.lc-value .num { text-align: left; overflow: hidden; text-overflow: ellipsis; }
.lc-cur { font-size: 12px; font-weight: 400; color: var(--text-3); font-family: var(--mono); letter-spacing: 0.02em; }
.lc-meta { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); min-height: 18px; }
.lc-meta .warn { color: var(--red-ink); }
.lc-meta .warn .ic { color: var(--red-ink); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; font-weight: 500; color: var(--text-2); }
.delta.good { color: var(--st-good); }
.delta.bad { color: var(--red-ink); }
.micro { display: block; width: 100%; height: 34px; margin-top: 8px; overflow: visible; }
.micro rect { fill: var(--track-strong); }
.micro rect.now { fill: var(--brand); }
.micro .mbase { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.micro.anim rect { transform-box: fill-box; transform-origin: 50% 100%; animation: grow-y 0.6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 22ms); }

.dash-head { margin-bottom: 16px; align-items: flex-start; }
.dh { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.dh-text { min-width: 0; }
.dh-text .card-title { font-size: 15px; }
.open-link { width: 30px; height: 30px; border-color: transparent; background: transparent; flex: none; }
.open-link:hover { border-color: var(--line); background: var(--surface-2); }
.period-btn { min-height: 32px; gap: 7px; font-size: 13px; }
.period-btn .ic { color: var(--text-3); }
.period-pop { top: calc(100% + 6px); right: 0; min-width: 170px; }
.trend-chart { margin-top: 2px; }
.trend-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.trend-foot .legend { margin: 0 0 4px; font-size: 13px; }
.trend-sums { display: flex; flex-wrap: wrap; gap: 14px 0; }
.trend-sum { display: flex; flex-direction: column; gap: 2px; padding: 0 0 0 22px; margin-left: 22px; border-left: 1px solid var(--line); }
.trend-sum:first-child { margin-left: 0; }
.ts-label { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); }
.ts-label::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--sw, var(--s1)); }
.trend-sum.sales { --sw: var(--s1); }
.trend-sum.purchases { --sw: var(--s2); }
.ts-value { display: flex; align-items: baseline; gap: 6px; }
.ts-value strong { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.ts-cur { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }
.docs-card { display: flex; flex-direction: column; }
.segbar { display: flex; width: 100%; height: 28px; gap: 2px; margin: 4px 0 6px; }
.segbar-part { height: 100%; border-radius: 3px; min-width: 2px; }
.segbar-empty { flex: 1; height: 100%; border-radius: 3px; background: var(--track); }
.seg-legend { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.seg-legend li { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; min-width: 0; }
.seg-legend .lg-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg-legend .lg-pct { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; width: 40px; text-align: right; }
.seg-total { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.seg-total strong { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; }
.seg-total span { font-size: 13px; color: var(--text-3); }
.meter-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.meter-item { display: flex; flex-direction: column; gap: 7px; color: inherit; text-decoration: none; }
.meter-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.meter-top strong { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-top span { color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter { position: relative; height: 6px; border-radius: 3px; background: var(--track); }
.meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--brand); transform-origin: left; animation: grow-x 0.9s var(--ease-out) both; }
.meter-fill.warn { background: var(--st-warn); }
.meter-fill.bad { background: var(--st-bad); }
.meter-mark { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--text-3); opacity: 0.55; }

/* legacy dashboard pieces still used by other pages */
.rate-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.rate-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rate-item:last-child { border-bottom: 0; }
.rate-item strong { font-weight: 500; text-align: left; }
.chg { display: inline-flex; align-items: center; gap: 3px; font-weight: 500; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg.up { color: var(--st-good); }
.chg.down { color: var(--red-ink); }
.attn { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.attn-chip {
  display: flex; align-items: center; gap: 10px; padding: 9px 2px; color: var(--text); text-decoration: none;
  border-bottom: 1px solid var(--line); font-size: 13.5px; transition: color 0.15s var(--ease);
}
.attn li:last-child .attn-chip { border-bottom: 0; }
.attn-chip .ic { color: var(--st-warn); }
.attn-chip:hover { color: var(--brand-ink); }
.attn-chip span { flex: 1; min-width: 0; }
.attn-chip strong { font-variant-numeric: tabular-nums; font-weight: 500; }
.ok-line { display: flex; align-items: center; gap: 8px; color: var(--text-2); margin: 0; font-size: 13.5px; }
.ok-line .ic { color: var(--st-good); }
.local-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.local-tile {
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; color: inherit; text-decoration: none;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; align-items: flex-start;
  transition: background 0.15s var(--ease);
}
.local-tile:hover { background: var(--surface-2); }
.local-tile .num { font-size: 20px; font-weight: 500; text-align: left; }
.local-tile .glyph { color: var(--ochre); }


/* ---- budgets, rates, accounting ---------------------------------------------------- */
.card.budget { display: flex; flex-direction: column; gap: 12px; }
.budget-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.budget-head h3 { margin: 0; font-size: 15px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.budget-body { display: flex; gap: 18px; align-items: center; }
.ring-wrap { flex: none; }
.budget-stats { margin: 0; display: grid; gap: 7px; flex: 1; min-width: 0; }
.budget-stats dt { font-size: 12px; color: var(--text-3); }
.budget-stats dd { margin: 0; font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.budget-stats .neg dd { color: var(--neg-ink); }
.kw { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.mini-list h4 { margin: 0 0 4px; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.mini-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; font-size: 13px; }
.mini-row:hover .mini-name { color: var(--brand-ink); }
.mini-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.converter { margin-bottom: 2px; }
.convert-row { display: grid; grid-template-columns: 1.4fr 1fr auto 1fr; gap: 12px; align-items: end; }
.convert-row .swap { margin-bottom: 1px; }
.amount-in { font-size: 17px; font-weight: 500; font-variant-numeric: tabular-nums; }
.convert-result { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-height: 48px; }
.convert-result p { margin: 0; }
.convert-val { font-size: 32px; font-weight: 500; letter-spacing: -0.025em; display: flex; align-items: baseline; gap: 10px; }
.card.rate-card { display: flex; flex-direction: column; gap: 10px; }
.rate-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rate-main .big { font-size: 27px; }
.ageing-head .big { font-size: 25px; }

/* ---- reconciliation ------------------------------------------------------------------- */
.check-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.card.check {
  display: flex; flex-direction: column; gap: 6px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  border: 0; border-radius: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0;
  background: none; box-shadow: none; padding: 16px 18px; transition: background 0.18s var(--ease);
}
.card.check:hover { background: var(--surface-2); }
.card.check.open { background: var(--brand-soft); box-shadow: inset 2px 0 0 var(--brand); }
.check-top { display: flex; align-items: center; justify-content: space-between; }
.check-top .glyph { color: var(--st-good); }
.card.check.has .check-top .glyph { color: var(--st-warn); }
.check-count { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.check-title { font-size: 13px; color: var(--text-2); line-height: 1.4; }
.check-area { display: flex; flex-direction: column; gap: 14px; }
.change-area { display: flex; flex-direction: column; gap: 12px; }
.change-area > .toolbar { justify-content: space-between; }
.change-area > .card-head { margin: 0; }

/* ---- connections ----------------------------------------------------------------------- */
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.card.conn { display: flex; flex-direction: column; gap: 14px; }
.conn-head { display: flex; align-items: center; gap: 10px; }
.conn-head h2 { margin: 0; font-size: 16px; font-weight: 500; flex: 1; min-width: 0; }
.conn-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.conn-facts dt { font-size: 12px; color: var(--text-3); }
.conn-facts dd { margin: 2px 0 0; font-weight: 500; font-size: 14px; min-width: 0; font-variant-numeric: tabular-nums; }
.conn-models { list-style: none; margin: 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; font-size: 13px; }
.conn-models li { display: flex; justify-content: space-between; gap: 8px; color: var(--text-2); }
.card.progress { display: flex; flex-direction: column; gap: 10px; }
.progress-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.progress-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.history-slot .table td { font-size: 13px; }

/* ---- settings ---------------------------------------------------------------------------- */
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px; border: 1px dashed var(--line-strong);
  border-radius: var(--radius); cursor: pointer; text-align: center; color: var(--text-2);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop-text { font-size: 13px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.facts dt { font-size: 12px; color: var(--text-3); }
.facts dd { margin: 2px 0 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.pref-row:last-child { border-bottom: 0; }
.pref-row.switch { justify-content: space-between; width: 100%; }
.pref-row.switch .track { order: 2; }

/* ---- feedback --------------------------------------------------------------------------- */
.toasts {
  position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100;
  max-width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 9px; background: var(--surface);
  color: var(--text); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); font-size: 13.5px;
  animation: toast-in 0.32s var(--ease-out) both;
}
.toast.out { animation: toast-out 0.25s var(--ease) both; }
.toast .ic { flex: none; margin-top: 1px; }
.toast.ok .ic { color: var(--st-good); }
.toast.bad .ic { color: var(--st-bad); }
.toast.info .ic { color: var(--text-3); }
.scrim {
  position: fixed; inset: 0; background: rgba(12, 18, 15, 0.42); display: grid; place-items: center; padding: 16px; z-index: 90;
  animation: fade-in 0.18s var(--ease) both;
}
.dialog {
  width: min(480px, 100%); background: var(--surface); color: var(--text); border-radius: 12px; border: 1px solid var(--line);
  box-shadow: var(--shadow-pop); animation: rise 0.28s var(--ease-out) both;
}
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 16px; font-weight: 500; }
.dialog-head .icon-btn { border-color: transparent; background: transparent; width: 32px; height: 32px; }
.dialog-head .icon-btn:hover { background: var(--hover); }
.dialog-body { padding: 18px 20px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 12px 12px; }

/* ---- glyphs: an icon at a size; module colour is not used as decoration ------------------------- */
.glyph { --g: 28px; display: inline-grid; place-items: center; flex: none; width: var(--g); height: var(--g); color: var(--text-3); }
.glyph .ic { color: inherit; }
.glyph.solid { color: var(--text-2); }
.glyph.ct { --g: 18px; }
.glyph.mi { --g: 20px; }
.glyph.kpi-ico { --g: 24px; }
.glyph.type-ico, .glyph.prod-ico {
  --g: 38px; border-radius: 8px; background: var(--m-soft); box-shadow: none; color: var(--m-ink); --ic-mark: var(--m);
}
.glyph.conn-ico { --g: 40px; border-radius: 9px; background: var(--m-soft); box-shadow: none; color: var(--m-ink); --ic-mark: var(--m); }
.glyph.hero-ico { --g: 48px; border-radius: 10px; background: var(--m-soft); box-shadow: none; color: var(--m-ink); --ic-mark: var(--m); }
.glyph.gs-ico { --g: 20px; }

/* currency codes: set in the figure face, never a coloured capsule */
.card.stat { position: relative; overflow: hidden; }

/* ---- empty-state figure: a drafting frame with registration marks around the subject ----------------- */
.art { display: block; overflow: visible; color: var(--text-3); }
.art-frame { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 4; }
.art-reg { fill: none; stroke: var(--text-3); stroke-width: 1; opacity: 0.7; }
.art-rule { fill: none; stroke: var(--line-strong); stroke-width: 1; }
.art-ic { color: var(--text-2); --ic-mark: var(--brand); }
.empty .art { animation: rise 0.5s var(--ease-out) both; }

/* ---- spreadsheets ----------------------------------------------------------------------------
   A working ledger: hairline grid, figures right-aligned in ink (red when negative), data blocks set
   apart by a faint blue wash with a ruled head, one clean outline around the selection. */
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sheet-name { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 320px; }
.sheet-name > .ic { color: var(--text-3); --ic-mark: var(--m); }
.sheet-title {
  font: inherit; font-size: 20px; font-weight: 500; letter-spacing: -0.015em; color: var(--text); background: transparent;
  border: 0; border-bottom: 1px dashed transparent; border-radius: 0; padding: 2px 0; min-width: 0; width: min(440px, 100%);
  transition: border-color 0.18s var(--ease);
}
.sheet-title:hover { border-bottom-color: var(--line-strong); }
.sheet-title:focus { outline: none; border-bottom: 1px solid var(--brand); }
.sheet-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.sheet-status[data-state="saved"] .sg { color: var(--st-good); }
.sheet-status[data-state="failed"] { color: var(--bad-ink); }
.sheet-status[data-state="failed"] .sg { color: var(--st-bad); }
.sheet-status[data-state="saving"] .sg { animation: spin 1.1s linear infinite; }
.act-rule { width: 1px; height: 22px; background: var(--line-strong); margin: 0 4px; }
.icon-btn.pinned { color: var(--brand-ink); border-color: var(--brand-line); background: var(--brand-soft); }
.sheet-body { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.sheet-card-grid { padding: 0; flex: 1 1 560px; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.sheet-aside { flex: 0 1 270px; min-width: 230px; max-width: 100%; }
.sh-formula { display: flex; align-items: stretch; height: 40px; border-bottom: 1px solid var(--line-strong); background: var(--surface); }
.sh-name {
  flex: none; width: 96px; display: grid; place-items: center; font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
  border-right: 1px solid var(--line); background: var(--surface-2);
}
.sh-fx {
  flex: none; width: 38px; display: grid; place-items: center; font-family: Georgia, "DejaVu Serif", serif; font-style: italic;
  color: var(--text-3); font-size: 14px; border-right: 1px solid var(--line);
}
.sh-bar {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-family: var(--mono);
  font-size: 13px; padding: 0 12px; transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.sh-bar::placeholder { color: var(--text-3); font-family: var(--font); }
.sh-bar:focus { background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--brand); }
.sh-bar[readonly] { color: var(--text-3); }
.sh-wrap {
  overflow: auto; max-height: 62vh; outline: none; position: relative; background: var(--surface);
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.sh-wrap:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent); }
.sh-grid { display: grid; position: relative; width: max-content; min-width: 100%; font-size: 13px; }
.sh-h {
  position: sticky; z-index: 2; background: var(--surface-2); color: var(--text-3); font-size: 11.5px; font-weight: 500;
  text-align: center; user-select: none; height: var(--cell-h); line-height: var(--cell-h);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; overflow: hidden;
  font-variant-numeric: tabular-nums; transition: color 0.12s var(--ease), background 0.12s var(--ease);
}
.sh-col { top: 0; }
.sh-row { left: 0; z-index: 1; }
.sh-corner { top: 0; left: 0; z-index: 4; cursor: default; }
.sh-h:hover { color: var(--text); }
.sh-h.on { color: var(--brand-ink); background: color-mix(in srgb, var(--brand) 10%, var(--surface-2)); }
.sh-col.on { box-shadow: inset 0 -2px 0 var(--brand); }
.sh-row.on { box-shadow: inset -2px 0 0 var(--brand); }
.sh-c {
  position: relative; height: var(--cell-h); line-height: var(--cell-h); padding: 0 8px; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: cell;
  user-select: none; color: var(--text); background: var(--surface); font-variant-numeric: tabular-nums;
}
.sh-c.k-n { text-align: right; }
.sh-c.k-b { text-align: center; color: var(--text-2); font-size: 12px; letter-spacing: 0.02em; }
.sh-c.k-e { color: var(--bad-ink); font-family: var(--mono); font-size: 12px; }
.sh-c.neg { color: var(--neg-ink); }
.sh-c.blk { background: color-mix(in srgb, var(--s1) 4%, var(--surface)); }
.sh-c.blk-h { font-weight: 500; color: var(--text-2); background: color-mix(in srgb, var(--s1) 9%, var(--surface)); border-bottom-color: color-mix(in srgb, var(--s1) 38%, var(--line)); }
.sh-c.sel { background: color-mix(in srgb, var(--brand) 9%, var(--surface)); }
.sh-c.sel::after { content: ""; position: absolute; inset: 0; pointer-events: none; border: 0 solid var(--brand); }
.sh-c.st::after { border-top-width: 1.5px; }
.sh-c.sb::after { border-bottom-width: 1.5px; }
.sh-c.sl::after { border-left-width: 1.5px; }
.sh-c.sr::after { border-right-width: 1.5px; }
.sh-c.act { background: var(--surface); box-shadow: inset 0 0 0 2px var(--brand); z-index: 1; }
.sh-c.editing { padding: 0; overflow: visible; z-index: 3; box-shadow: 0 0 0 2px var(--brand), 0 8px 20px -8px rgba(0, 0, 0, 0.3); }
.sh-c.editing::after { display: none; }
.sh-input {
  width: 100%; height: 100%; border: 0; outline: 0; padding: 0 8px; margin: 0; background: var(--surface); color: var(--text);
  font-family: var(--mono); font-size: 12.5px; text-align: inherit;
}
.sh-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 12px 4px 6px;
  border-top: 1px solid var(--line); background: var(--surface-2); min-height: 40px;
}
.sh-sum { display: flex; gap: 18px; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.sh-sum strong { color: var(--text); font-weight: 500; margin-left: 4px; }
.sh-sum strong.neg { color: var(--neg-ink); }
.blk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.blk-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.blk-item > .ic { color: var(--text-3); --ic-mark: var(--s1); }
.blk-text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.blk-text strong { font-weight: 500; }
.blk-text > span { color: var(--text-3); font-size: 12px; }
.blk-text .mono { font-size: 11.5px; }
.blk-err { color: var(--bad-ink) !important; }
.icon-btn.blk-x { width: 28px; height: 28px; border-color: transparent; background: transparent; }
.icon-btn.blk-x:hover { border-color: var(--line); background: var(--surface-2); }
/* the list: each sheet opens with a ruled thumbnail */
.card.sheet-card { gap: 10px; padding: 0 0 12px; overflow: hidden; }
.sheet-card > :not(.sheet-thumb) { margin-left: 16px; margin-right: 16px; }
.sheet-card .contact-foot { color: var(--text-3); }
.sheet-thumb { height: 80px; padding: 8px 12px 0; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.sheet-thumb svg { display: block; }
.th-rule { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.th-head { fill: color-mix(in srgb, var(--s1) 12%, transparent); }
.th-text { fill: var(--track-strong); }
.th-num { fill: color-mix(in srgb, var(--text-3) 42%, transparent); transition: fill 0.25s var(--ease); }
a.sheet-card:hover .th-num { fill: color-mix(in srgb, var(--brand) 65%, transparent); }
.sheet-pin { color: var(--brand); display: inline-grid; }
.tpl-strip { display: flex; flex-direction: column; gap: 10px; }
.strip-title { margin: 4px 0 0; font-size: 13px; font-weight: 500; color: var(--text-3); }
.tpl-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tpl {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.tpl:hover { border-style: solid; border-color: var(--brand-line); background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
.tpl-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--m-soft); box-shadow: none; color: var(--m-ink); --ic-mark: var(--m); flex: none; }
.tpl-text { display: flex; flex-direction: column; min-width: 0; }
.tpl-text strong { font-weight: 500; font-size: 14px; }
.tpl-text span { font-size: 12.5px; color: var(--text-3); }
/* dashboards built from pinned sheets */
.board { display: flex; flex-direction: column; gap: 14px; }
.board + .board { margin-top: 10px; padding-top: 22px; border-top: 1px solid var(--line); }
.board-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.board-title { margin: 0; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.board-meta { color: var(--text-3); font-size: 13px; }
.board-head .link-btn { margin-left: auto; }

/* ---- calendar, helpdesk, chat ------------------------------------------------------------------ */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.cal-head { background: var(--surface); padding: 9px 10px 8px; font-size: 12px; font-weight: 500; color: var(--text-3); text-align: left; border-bottom: 1px solid var(--line-strong); }
.cal-head.we { color: color-mix(in srgb, var(--text-3) 70%, transparent); }
.cal-cell {
  background: var(--surface); min-height: 108px; padding: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 0; cursor: pointer;
  transition: background 0.15s var(--ease);
}
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.out { background: var(--paper); }
.cal-cell.out .cal-num { color: var(--text-3); }
.cal-cell.we:not(.out) { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.cal-num {
  align-self: flex-start; min-width: 26px; height: 24px; padding: 0 5px; border: 0; border-radius: 5px; font: inherit; font-size: 13px;
  font-weight: 500; cursor: pointer; background: transparent; color: var(--text); font-variant-numeric: tabular-nums; text-align: left;
}
.cal-num:hover { background: var(--hover); }
.cal-cell.today { box-shadow: inset 0 2px 0 var(--brand); }
.cal-cell.today .cal-num { background: var(--brand); color: var(--on-brand); text-align: center; }
.ev-chip {
  display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; padding: 2px 6px 2px 6px; border: 0; border-left: 2px solid var(--tone);
  border-radius: 0 4px 4px 0; background: transparent; color: var(--text); font: inherit; font-size: 12px; text-align: left; cursor: pointer;
  transition: background 0.15s var(--ease);
}
.ev-chip:hover { background: color-mix(in srgb, var(--tone) 10%, var(--surface)); }
.ev-chip .ic { color: var(--tone); flex: none; }
.ev-time { flex: none; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ev-title { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-more { background: none; border: 0; padding: 1px 6px; font: inherit; font-size: 12px; color: var(--text-3); text-align: left; cursor: pointer; }
.cal-more:hover { color: var(--brand-ink); }
.agenda { display: flex; flex-direction: column; gap: 18px; }
.agenda-day { display: flex; flex-direction: column; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.agenda-day h3 { margin: 0; padding: 10px 14px; font-size: 13px; font-weight: 500; color: var(--text-2); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.agenda-day.today h3 { color: var(--brand-ink); box-shadow: inset 2px 0 0 var(--brand); }
.ev-row {
  display: grid; grid-template-columns: auto 64px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-width: 0; text-align: left;
  font: inherit; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; cursor: pointer;
  transition: background 0.15s var(--ease);
}
.agenda-day .ev-row:last-child { border-bottom: 0; }
.ev-row:hover { background: var(--surface-2); }
.ev-row .ic { color: var(--tone); }
.ev-row .ev-title { font-weight: 500; }
.ticket-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; cursor: pointer; transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease); }
.ticket-card:hover, .ticket-card:focus-visible { border-color: var(--line-strong); box-shadow: var(--shadow-lift); outline: none; }
.ticket-card.late-card { border-color: color-mix(in srgb, var(--st-bad) 35%, var(--line)); }
.prio .pb { fill: var(--track-strong); }
.prio .pb.on { fill: var(--text-2); }
.prio-high .pb.on { fill: var(--st-warn); }
.prio-urgent .pb.on { fill: var(--st-bad); }
.due-mark { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.due-mark .ic { color: var(--text-3); }
.due-mark.late { color: var(--red-ink); font-weight: 500; }
.due-mark.late .ic { color: var(--red-ink); }
.chan-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line);
  transition: background 0.15s var(--ease);
}
.chan-row:hover { background: var(--surface-2); }
.chan-row.on { background: color-mix(in srgb, var(--brand) 7%, var(--surface)); box-shadow: inset 2px 0 0 var(--brand); }
.day-sep { position: relative; align-self: stretch; display: flex; justify-content: center; margin: 12px 0 4px; }
.day-sep::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.day-sep span { position: relative; padding: 0 10px; font-size: 12px; color: var(--text-3); background: var(--surface-2); }
.rate-code { font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: 0.02em; color: var(--text); }

/* ---- logo --------------------------------------------------------------------------------- */
.logo { display: block; flex: none; }
.logo .lg-body { fill: var(--logo-body, var(--brand)); }
.logo .lg-face { fill: var(--logo-face, var(--surface)); }
.logo .lg-pupil { fill: var(--logo-pupil, var(--ink)); }
.logo .lg-beak { fill: var(--logo-beak, var(--ochre)); }
.logo .lg-tick { stroke: var(--logo-tick, var(--logo-face, var(--surface))); stroke-width: 1.4; fill: none; stroke-linecap: round; }
.side .logo { --logo-body: #2e8a66; --logo-face: #e9f3ed; --logo-pupil: #10201a; --logo-beak: #e0a54c; --logo-tick: #bfe3cf; }
.logo.shine .lg-eye { transform-box: fill-box; transform-origin: center; animation: look 1.6s var(--ease-out) 0.6s both; }

/* ---- animations ---------------------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sweep { from { stroke-dashoffset: var(--len, 300); } to { stroke-dashoffset: 0; } }
@keyframes look { 0% { transform: translateX(0); } 35% { transform: translateX(-1.2px); } 70% { transform: translateX(1px); } 100% { transform: translateX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0s !important; transition-duration: 0.001ms !important; }
  .la-spiral, .anim .area-line, .anim .spark-line { stroke-dashoffset: 0; stroke-dasharray: none; }
}

/* ---- responsive ------------------------------------------------------------------------------ */
@media (max-width: 1240px) {
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger .lc:nth-child(2n) { border-right: 0; }
  .ledger .lc:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: 68px minmax(0, 1fr); }
  .side { padding: 14px 10px; align-items: stretch; }
  .side::after { display: none; }
  .brand { justify-content: center; padding: 0 0 12px; }
  .brand-name, .nav-title, .user-text, .user-chev, .lbl { display: none; }
  .nav-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--spine-line); }
  .nav-link { justify-content: center; padding: 0; height: 38px; }
  .nav-ind { left: -10px; }
  .badge-slot, .nav-count { position: absolute; top: 3px; right: 5px; margin: 0; font-size: 10.5px; }
  .user-btn { justify-content: center; padding: 6px; }
  .user-menu { width: 280px; }
  .gsearch { width: 220px; }
  .top { padding: 16px 24px 12px; }
  .top::after { left: 24px; right: 24px; }
  .content { padding: 8px 24px 48px; }
  .conn-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .top { flex-wrap: wrap; }
  .top-actions { flex: 1 1 auto; justify-content: flex-end; }
  .gsearch { flex: 1 1 0; width: auto; min-width: 0; max-width: 420px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-grid > .span-2 { grid-column: auto; }
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage:nth-child(2n) { border-right: 0; }
  .stage:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .settings-grid, .two-up { grid-template-columns: minmax(0, 1fr); }
  .convert-row { grid-template-columns: 1fr 1fr; }
  .seg-legend { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  body { font-size: 14px; }
  .shell { grid-template-columns: minmax(0, 1fr); padding-bottom: 0; }
  .side { display: none; }
  .top { padding: 12px 16px 10px; gap: 10px; }
  .top::after { left: 16px; right: 16px; }
  .top-title { font-size: 22px; }
  .top-sub { font-size: 12.5px; }
  .top-actions { width: 100%; gap: 8px; justify-content: flex-start; }
  .gsearch { max-width: none; height: 38px; }
  .gs-kbd { display: none; }
  .gs-pop { width: calc(100vw - 32px); }
  .icon-btn { width: 36px; height: 36px; }
  .content { padding: 10px 16px 104px; }
  .ledger { grid-template-columns: minmax(0, 1fr); }
  .ledger .lc { border-right: 0; border-bottom: 1px solid var(--line); }
  .ledger .lc:last-child { border-bottom: 0; }
  .lc-value { font-size: 24px; }
  .trend-sum { padding-left: 14px; margin-left: 14px; }
  .kpi-value { font-size: 22px; }
  .search { min-width: 0; flex-basis: 100%; max-width: none; }
  .toolbar { gap: 8px; }
  .seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .seg-btn { padding: 0 8px; }
  .bnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 2px; overflow-x: auto; scrollbar-width: none;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--spine); border-top: 1px solid var(--spine-line);
  }
  .bnav-link {
    position: relative; flex: 0 0 48px; height: 44px; display: grid; place-items: center; color: var(--spine-icon); border-radius: 8px; text-decoration: none;
    --ic-mark: var(--spine-icon);
  }
  .bnav-link[aria-current="page"] { color: #fff; background: color-mix(in srgb, var(--m-spine) 16%, transparent); --ic-mark: var(--m-spine); }
  .bnav-link[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 2px; border-radius: 0 0 2px 2px; background: var(--m-spine); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid, .card-grid.budgets, .card-grid.rates, .card-grid.products, .card-grid.people { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 14px 16px; }
  .conn-facts { grid-template-columns: minmax(0, 1fr); }
  .convert-row { grid-template-columns: minmax(0, 1fr); }
  .budget-body { flex-direction: column; align-items: stretch; }
  .login-card { padding: 22px 18px; }
  .user-menu { width: auto; }
}
@media (max-width: 360px) {
  .top-actions .btn span { display: none; }
}

/* ---- breadcrumbs, labelled filters, folding ------------------------------------------------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; font-size: 13px; line-height: 1.3; margin: 0 0 3px; min-width: 0; }
.crumb { color: var(--text-3); text-decoration: none; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.crumb:hover { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
.crumb::after { content: "\203A"; display: inline-block; margin: 0 7px; color: var(--text-3); text-decoration: none; }
.seg.labelled { align-items: center; }
.seg-label { font-size: 12px; color: var(--text-3); padding: 0 6px 0 8px; white-space: nowrap; }
.seg[data-set] .seg-label { color: var(--m-ink); }
.flt-btn .ic:last-child { color: var(--text-3); margin-left: -2px; }
.flt-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--m); color: var(--on-brand); font-size: 11.5px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.flt-pop { top: calc(100% + 6px); left: 0; width: max-content; max-width: min(92vw, 560px); padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; transform-origin: top left; }
.flt-pop .seg { max-width: 100%; }
.flt-pop .seg-slot { display: contents; }
.flt-pop .pop-wrap > .btn { border-color: var(--line-strong); }
.fold { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.fold-head {
  display: flex; align-items: center; gap: 9px; padding: 11px 16px; cursor: pointer; list-style: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 500; color: var(--text); user-select: none;
}
.fold-head::-webkit-details-marker { display: none; }
.fold-head:hover { background: var(--hover); }
.fold-head > .ic { color: var(--text-3); }
.fold-meta { color: var(--text-3); font-size: 12.5px; font-weight: 400; font-family: var(--mono); }
.fold-chev { display: inline-flex; margin-left: auto; color: var(--text-3); transition: transform 0.2s var(--ease); }
.fold[open] > .fold-head .fold-chev, .nav-fold.open .fold-chev, .fold-toggle[aria-expanded="true"] .ic { transform: rotate(180deg); }
.fold-body { padding: 0 12px 12px; }
.fold-body > .stat-row { border-color: var(--line); }
.card.foldable > .card-head { margin-bottom: 14px; }
.card.foldable.folded > .card-head { margin-bottom: 0; }
.card.foldable.folded > :not(.card-head) { display: none !important; }
.fold-click { cursor: pointer; user-select: none; }
.icon-btn.fold-toggle { width: 30px; height: 30px; border-color: transparent; background: transparent; margin-left: 2px; flex: none; }
.icon-btn.fold-toggle .ic { transition: transform 0.2s var(--ease); }
.icon-btn.fold-toggle:hover { background: var(--hover); }
.pop-sep { height: 1px; margin: 5px 6px; background: var(--line); }
.pop-row.pop-wide { flex-wrap: wrap; }
.pop-row.pop-wide .seg { width: 100%; }
.pop-row.pop-wide .seg-btn { flex: 1 1 0; justify-content: center; padding: 0 6px; }

/* ---- shortcuts: personal buttons under the page title ------------------------------------------ */
.shortcut-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0 32px 10px; min-width: 0; }
.shortcut-bar[hidden] { display: none; }
.sc-list { display: contents; }
.sc {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px 0 9px; max-width: 240px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); text-decoration: none; font-size: 13px;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.sc .ic { color: var(--text-3); }
.sc:hover { border-color: var(--brand-line); }
.sc[aria-current="page"] { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.sc[aria-current="page"] .ic { color: inherit; --ic-mark: var(--brand); }
.sc-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-add {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong); background: transparent; color: var(--text-3); font: inherit; font-size: 13px; cursor: pointer;
}
.sc-add:hover { color: var(--text); border-style: solid; background: var(--surface); }
.sc-pop { top: calc(100% + 6px); right: 0; width: 280px; }
.sc-pop .pop-item .ic { flex: none; }
.sc-icons { display: grid; grid-template-columns: repeat(auto-fill, 34px); gap: 6px; }
.sc-ico {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
}
.sc-ico:hover { border-color: var(--line-strong); color: var(--text); }
.sc-ico[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); --ic-mark: var(--brand); }
.sc-manage { display: flex; flex-direction: column; gap: 14px; }
.dialog .sc-manage { max-height: min(60vh, 480px); overflow: auto; }
.sc-group-title { margin: 0 0 6px; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.sc-rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.sc-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 12px; border-top: 1px solid var(--line); min-width: 0; }
.sc-row:first-child { border-top: 0; }
.sc-row > .ic { color: var(--text-3); }
.sc-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.sc-row-text strong { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-row-text span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-row-text:hover strong { color: var(--brand-ink); }
.icon-btn.sm { width: 30px; height: 30px; border-color: transparent; background: transparent; }
.icon-btn.sm:hover:not(:disabled) { background: var(--hover); }
.icon-btn.sm:disabled { opacity: 0.3; }
.sc-del.armed { color: var(--bad-ink); background: var(--bad-bg); }

/* ---- phones: a menu drawer and labelled bottom places ------------------------------------------- */
.drawer { position: fixed; inset: 0; z-index: 95; background: rgba(12, 18, 15, 0.42); animation: fade-in 0.18s var(--ease) both; }
.drawer-panel {
  position: absolute; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
  padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); background: var(--spine); color: var(--spine-ink); --ic-mark: var(--spine-icon);
  animation: slide-in 0.24s var(--ease-out) both;
}
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 10px; }
.drawer-head strong { flex: 1; font-size: 17px; font-weight: 500; color: #f1f6f2; }
.drawer-head .icon-btn { background: transparent; border-color: var(--spine-line); color: var(--spine-ink); }
.drawer .nav-link { font: inherit; font-size: 14px; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.drawer .nav-link[aria-current="page"] { color: #fff; background: color-mix(in srgb, var(--m-spine) 16%, transparent); }
.drawer .side-foot { margin-top: auto; }
@keyframes slide-in { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 700px) {
  .shortcut-bar { padding: 0 16px 10px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sc, .sc-add { flex: none; }
  .bnav { gap: 0; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); overflow: visible; }
  .bnav-link {
    flex: 1 1 0; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0;
    border: 0; background: none; font: inherit; cursor: pointer;
  }
  .bnav-link span { font-size: 10.5px; max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bnav-menu[aria-expanded="true"] { color: #fff; }
}
@media (max-width: 1100px) and (min-width: 701px) { .shortcut-bar { padding: 0 24px 10px; } }

/* ---- minimal layout: groups, filters and secondary panels fold away ---------------------------- */
.nav-toggle {
  display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 500;
  color: var(--spine-muted); cursor: pointer; border-radius: 6px; text-align: left;
}
.nav-toggle:hover { color: var(--spine-ink); background: rgba(220, 240, 228, 0.04); }
.nav-toggle .fold-chev { color: inherit; }
.nav-fold:not(.open) > .nav-link { display: none; }
.nav-fold.open > .nav-link { animation: rise 0.22s var(--ease-out) both; }
:root[data-layout="minimal"] .top-sub { display: none; }
:root[data-layout="minimal"] .top-title { font-size: 21px; }
:root[data-layout="minimal"] .card { border-color: transparent; box-shadow: none; }
:root[data-layout="minimal"] .page { gap: 12px; }
:root[data-layout="minimal"] .new-btn { width: 38px; padding: 0; }
:root[data-layout="minimal"] .new-btn span { display: none; }
:root[data-layout="minimal"] .top-actions .gsearch, .onav .gsearch {
  width: 38px; padding: 0 9px; cursor: text; transition: width 0.22s var(--ease-out), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
:root[data-layout="minimal"] .top-actions .gsearch:focus-within { width: min(320px, 52vw); }
:root[data-layout="minimal"] .gs-kbd { display: none; }
:root[data-layout="minimal"] .fold { border-color: transparent; }
@media (max-width: 1100px) {
  .nav-fold > .nav-link { display: flex !important; }
  .nav-toggle { display: none; }
}
@media (max-width: 700px) {
  :root[data-layout="minimal"] .top-actions .gsearch:focus-within { width: 100%; }
}

/* ---- module index tabs and stamp inks ------------------------------------------------------------
   Each module has one hue (--mod-*). The open page takes the hue of the module whose spine link is
   current and carries it as --m: the index tab, the title tab, card icons, filters and figures.
   Standard and Minimal only; the Odoo layout sets its own colours below. */
:root:not([data-layout="odoo"]) .shell:has(.nav-link[aria-current="page"][href="#/calendar"], .nav-link[aria-current="page"][href="#/helpdesk"], .nav-link[aria-current="page"][href="#/chat"], .nav-link[aria-current="page"][href="#/history"], .nav-link[aria-current="page"][href="#/outbox"]) {
  --m: var(--mod-work); --m-soft: var(--mod-work-soft); --m-ink: var(--mod-work-ink); --m-spine: var(--mod-work-spine);
}
:root:not([data-layout="odoo"]) .shell:has(.nav-link[aria-current="page"][href="#/sales"], .nav-link[aria-current="page"][href="#/invoices"], .nav-link[aria-current="page"][href="#/customers"], .nav-link[aria-current="page"][href="#/products"]) {
  --m: var(--mod-sales); --m-soft: var(--mod-sales-soft); --m-ink: var(--mod-sales-ink); --m-spine: var(--mod-sales-spine);
}
:root:not([data-layout="odoo"]) .shell:has(.nav-link[aria-current="page"][href="#/bills"], .nav-link[aria-current="page"][href="#/suppliers"]) {
  --m: var(--mod-purch); --m-soft: var(--mod-purch-soft); --m-ink: var(--mod-purch-ink); --m-spine: var(--mod-purch-spine);
}
:root:not([data-layout="odoo"]) .shell:has(.nav-link[aria-current="page"][href="#/accounting"], .nav-link[aria-current="page"][href="#/ledger"], .nav-link[aria-current="page"][href="#/budgets"], .nav-link[aria-current="page"][href="#/rates"], .nav-link[aria-current="page"][href="#/einvoices"], .nav-link[aria-current="page"][href="#/reconciliation"]) {
  --m: var(--mod-fin); --m-soft: var(--mod-fin-soft); --m-ink: var(--mod-fin-ink); --m-spine: var(--mod-fin-spine);
}
:root:not([data-layout="odoo"]) .shell:has(.nav-link[aria-current="page"][href="#/expenses"], .nav-link[aria-current="page"][href="#/people"], .nav-link[aria-current="page"][href="#/org"], .nav-link[aria-current="page"][href="#/timeoff"], .nav-link[aria-current="page"][href="#/timesheets"], .nav-link[aria-current="page"][href="#/personnel"]) {
  --m: var(--mod-team); --m-soft: var(--mod-team-soft); --m-ink: var(--mod-team-ink); --m-spine: var(--mod-team-spine);
}
:root:not([data-layout="odoo"]) .shell:has(.nav-link[aria-current="page"][href="#/dashboards"], .nav-link[aria-current="page"][href="#/sheets"], .nav-link[aria-current="page"][href="#/explore"], .nav-link[aria-current="page"][href="#/import"]) {
  --m: var(--mod-insight); --m-soft: var(--mod-insight-soft); --m-ink: var(--mod-insight-ink); --m-spine: var(--mod-insight-spine);
}
:root:not([data-layout="odoo"]) .shell:has(.nav-link[aria-current="page"][href="#/connections"], .nav-link[aria-current="page"][href="#/settings"]) {
  --m: var(--mod-settings); --m-soft: var(--mod-settings-soft); --m-ink: var(--mod-settings-ink); --m-spine: var(--mod-settings-spine);
}
.nav-link[href="#/calendar"] > .ic, .nav-link[href="#/helpdesk"] > .ic, .nav-link[href="#/chat"] > .ic, .nav-link[href="#/history"] > .ic, .nav-link[href="#/outbox"] > .ic { color: var(--mod-work-spine); --ic-mark: var(--mod-work-spine); }
.nav-link[href="#/sales"] > .ic, .nav-link[href="#/invoices"] > .ic, .nav-link[href="#/customers"] > .ic, .nav-link[href="#/products"] > .ic { color: var(--mod-sales-spine); --ic-mark: var(--mod-sales-spine); }
.nav-link[href="#/bills"] > .ic, .nav-link[href="#/suppliers"] > .ic { color: var(--mod-purch-spine); --ic-mark: var(--mod-purch-spine); }
.nav-link[href="#/accounting"] > .ic, .nav-link[href="#/ledger"] > .ic, .nav-link[href="#/budgets"] > .ic, .nav-link[href="#/rates"] > .ic, .nav-link[href="#/einvoices"] > .ic, .nav-link[href="#/reconciliation"] > .ic { color: var(--mod-fin-spine); --ic-mark: var(--mod-fin-spine); }
.nav-link[href="#/expenses"] > .ic, .nav-link[href="#/people"] > .ic, .nav-link[href="#/org"] > .ic, .nav-link[href="#/timeoff"] > .ic, .nav-link[href="#/timesheets"] > .ic, .nav-link[href="#/personnel"] > .ic { color: var(--mod-team-spine); --ic-mark: var(--mod-team-spine); }
.nav-link[href="#/dashboards"] > .ic, .nav-link[href="#/sheets"] > .ic, .nav-link[href="#/explore"] > .ic, .nav-link[href="#/import"] > .ic { color: var(--mod-insight-spine); --ic-mark: var(--mod-insight-spine); }
.nav-link[href="#/connections"] > .ic, .nav-link[href="#/settings"] > .ic { color: var(--mod-settings-spine); --ic-mark: var(--mod-settings-spine); }
.nav-group:has(> .nav-link[href="#/calendar"]) > .nav-title::before { background: var(--mod-work-spine); }
.nav-group:has(> .nav-link[href="#/sales"]) > .nav-title::before { background: var(--mod-sales-spine); }
.nav-group:has(> .nav-link[href="#/bills"]) > .nav-title::before { background: var(--mod-purch-spine); }
.nav-group:has(> .nav-link[href="#/accounting"]) > .nav-title::before { background: var(--mod-fin-spine); }
.nav-group:has(> .nav-link[href="#/expenses"]) > .nav-title::before { background: var(--mod-team-spine); }
.nav-group:has(> .nav-link[href="#/dashboards"]) > .nav-title::before { background: var(--mod-insight-spine); }
.apps-home .app-tile[href="#/calendar"] .app-ico { background: var(--mod-work-soft); color: var(--mod-work-ink); --ic-mark: var(--mod-work); }
.apps-home .app-tile[href="#/sales"] .app-ico { background: var(--mod-sales-soft); color: var(--mod-sales-ink); --ic-mark: var(--mod-sales); }
.apps-home .app-tile[href="#/bills"] .app-ico { background: var(--mod-purch-soft); color: var(--mod-purch-ink); --ic-mark: var(--mod-purch); }
.apps-home .app-tile[href="#/accounting"] .app-ico { background: var(--mod-fin-soft); color: var(--mod-fin-ink); --ic-mark: var(--mod-fin); }
.apps-home .app-tile[href="#/expenses"] .app-ico { background: var(--mod-team-soft); color: var(--mod-team-ink); --ic-mark: var(--mod-team); }
.apps-home .app-tile[href="#/dashboards"] .app-ico { background: var(--mod-insight-soft); color: var(--mod-insight-ink); --ic-mark: var(--mod-insight); }
.apps-home .app-tile[href="#/connections"] .app-ico, .apps-home .app-tile[href="#/settings"] .app-ico { background: var(--mod-settings-soft); color: var(--mod-settings-ink); --ic-mark: var(--mod-settings); }

.side ~ .main .top-title::before {
  content: ""; display: inline-block; width: 4px; height: 0.8em; margin-right: 11px; border-radius: 1px;
  background: var(--m); vertical-align: -0.02em;
}
.nav-title::before {
  content: ""; display: inline-block; width: 3px; height: 10px; margin-right: 7px; border-radius: 1px;
  background: var(--spine-muted); vertical-align: -1px;
}
.side :focus-visible, .drawer :focus-visible, .bnav :focus-visible { outline-color: var(--spine-hi); }
/* states: the words carry the stamp ink of their glyph */
.status.st-ok { color: var(--st-good); }
.status.st-warn { color: var(--st-warn); }
.status.st-bad { color: var(--st-bad); }
.status.st-info { color: var(--st-info); }
.status.st-muted { color: var(--st-muted); }
/* card heads: a tile in the page's module colour */
.card-title .glyph.ct { --g: 26px; border-radius: 7px; background: var(--m-soft); color: var(--m-ink); --ic-mark: var(--m); }
.card.kpi, .kpi-grid > .card, .stat-row > .card.stat { box-shadow: inset 0 2px 0 var(--m); }
.card.kpi .kpi-label .ic { color: var(--m); }
/* dashboard ledger: sales and purchases carry their module colours; the rest the page's */
.ledger > .lc { box-shadow: inset 0 2px 0 var(--m); }
.lc[href="#/invoices"] { background: color-mix(in srgb, var(--mod-sales-soft) 70%, var(--surface)); box-shadow: inset 0 2px 0 var(--mod-sales); }
.lc[href="#/invoices"] .lc-label .ic { color: var(--mod-sales); }
.lc[href="#/invoices"] .micro rect.now { fill: var(--mod-sales); }
.lc[href="#/bills"] { background: color-mix(in srgb, var(--mod-purch-soft) 70%, var(--surface)); box-shadow: inset 0 2px 0 var(--mod-purch); }
.lc[href="#/bills"] .lc-label .ic { color: var(--mod-purch); }
.lc[href="#/bills"] .micro rect.now { fill: var(--mod-purch); }
/* table rows and filters take the page's colour, lightly */
.table tr.click:hover td, .table tr.click:focus-visible td { background: color-mix(in srgb, var(--m) 7%, var(--surface)); }
.chip-btn:hover { border-bottom-color: var(--m-spine); }
/* apps page: one tile per app, the off ones dimmed and still */
.apps-home { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 12px; }
.apps-home .app-tile {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px 12px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none;
  font-size: 14px; font-weight: 500; text-align: center; transition: border-color 0.18s var(--ease), box-shadow 0.22s var(--ease);
}
.apps-home .app-tile:hover, .apps-home .app-tile:focus-visible { border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.apps-home .app-tile .app-ico {
  width: 56px; height: 56px; border: 0; border-radius: 14px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-ink); --ic-mark: var(--brand);
}
.apps-home .app-tile:hover .app-ico, .apps-home .app-tile:focus-visible .app-ico { border: 0; color: inherit; }
.apps-home .app-tile.off { cursor: default; opacity: 0.5; filter: grayscale(1); }
.apps-home .app-tile.off:hover { border-color: var(--line); box-shadow: none; }
.apps-home .app-tile.off .app-ico { background: var(--sunk); color: var(--text-3); --ic-mark: var(--text-3); }

/* ---- Odoo-like layout: an app switcher and the open app's menus across the top ------------------ */
:root[data-layout="odoo"] {
  --bg: #f4f5f7; --paper: #f8f9fa; --surface: #ffffff; --surface-2: #f8f9fa; --sunk: #eef0f3;
  --hover: rgba(33, 37, 41, 0.05); --press: rgba(33, 37, 41, 0.09);
  --line: #e2e5e9; --line-strong: #cfd4da; --rule: #dee2e6;
  --text: #212529; --text-2: #4a5059; --text-3: #6c737c; --ink: #212529;
  --brand: #714b67; --brand-ink: #5d3d55; --brand-hi: #84597a; --brand-soft: #f3ecf1; --brand-line: #c8a9bf; --on-brand: #ffffff;
  --link: #017e84; --radius: 5px; --radius-sm: 4px;
}
:root[data-layout="odoo"][data-theme="dark"] {
  --bg: #1b1d22; --paper: #202228; --surface: #24262d; --surface-2: #202228; --sunk: #1a1c21;
  --hover: rgba(230, 232, 236, 0.055); --press: rgba(230, 232, 236, 0.09);
  --line: #33363f; --line-strong: #444852; --rule: #3a3e47;
  --text: #e6e8ec; --text-2: #b3b8c1; --text-3: #8f959f; --ink: #e6e8ec;
  --brand: #b98aae; --brand-ink: #cfa3c4; --brand-hi: #c799bb; --brand-soft: rgba(185, 138, 174, 0.14); --brand-line: rgba(185, 138, 174, 0.45);
  --on-brand: #1b1d22; --link: #4fb8bd;
}
@media (prefers-color-scheme: dark) {
  :root[data-layout="odoo"]:not([data-theme="light"]) {
    --bg: #1b1d22; --paper: #202228; --surface: #24262d; --surface-2: #202228; --sunk: #1a1c21;
    --hover: rgba(230, 232, 236, 0.055); --press: rgba(230, 232, 236, 0.09);
    --line: #33363f; --line-strong: #444852; --rule: #3a3e47;
    --text: #e6e8ec; --text-2: #b3b8c1; --text-3: #8f959f; --ink: #e6e8ec;
    --brand: #b98aae; --brand-ink: #cfa3c4; --brand-hi: #c799bb; --brand-soft: rgba(185, 138, 174, 0.14); --brand-line: rgba(185, 138, 174, 0.45);
    --on-brand: #1b1d22; --link: #4fb8bd;
  }
}
:root[data-layout="odoo"] .shell { display: flex; flex-direction: column; }
.onav {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 12px 0 6px;
  background: var(--surface); border-bottom: 1px solid var(--line); color: var(--text);
}
.onav-apps {
  display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--text-2); cursor: pointer;
}
.onav-apps:hover, .onav-apps[aria-expanded="true"] { background: var(--hover); color: var(--text); }
.onav-app { font-size: 16px; font-weight: 500; color: var(--text); text-decoration: none; padding: 0 12px 0 6px; white-space: nowrap; }
.onav-menu { display: flex; align-items: stretch; height: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.onav-menu::-webkit-scrollbar { display: none; }
.onav-link {
  display: flex; align-items: center; gap: 6px; padding: 0 12px; font-size: 14px; color: var(--text-2); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.onav-link:hover { color: var(--text); background: var(--hover); }
.onav-link[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand); }
.onav-link .badge-count { color: var(--brand-ink); }
.onav-right { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; }
.onav-right > .icon-btn, .onav-right > .pop-wrap > .icon-btn { border-color: transparent; background: transparent; }
.onav-right > .icon-btn:hover, .onav-right > .pop-wrap > .icon-btn:hover { background: var(--hover); }
.onav .gsearch:focus-within { width: min(320px, 40vw); }
.onav .gs-kbd { display: none; }
.onav .user { margin: 0; }
.onav .user-btn { padding: 3px; border: 0; background: none; color: var(--text); }
.onav .user-btn:hover { background: var(--hover); }
.onav .user-text, .onav .user-chev { display: none; }
.onav .user .pop { top: calc(100% + 6px); bottom: auto; left: auto; right: 0; transform-origin: top right; }
.apps-pop {
  top: calc(100% + 6px); left: 0; width: min(560px, calc(100vw - 24px)); padding: 12px; transform-origin: top left;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 4px;
}
.app-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px; border-radius: var(--radius);
  color: var(--text); text-decoration: none; font-size: 13px; text-align: center;
}
.app-tile:hover { background: var(--hover); }
.app-tile .app-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--sunk); color: var(--text-2); border: 1px solid var(--line); }
.app-tile:hover .app-ico, .app-tile[aria-current="page"] .app-ico { color: var(--brand-ink); border-color: var(--brand-line); --ic-mark: var(--brand); }
:root[data-layout="odoo"] .top {
  top: 48px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 56px; z-index: 30;
}
:root[data-layout="odoo"] .top::after { display: none; }
:root[data-layout="odoo"] .top.stuck { background: var(--surface); }
:root[data-layout="odoo"] .top-head { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 0; }
:root[data-layout="odoo"] .crumbs { display: contents; font-size: 18px; }
:root[data-layout="odoo"] .crumb { color: var(--link); font-size: 18px; max-width: 280px; }
:root[data-layout="odoo"] .crumb::after { content: "/"; margin: 0 8px; color: var(--text-3); }
:root[data-layout="odoo"] .top-title { font-size: 18px; font-weight: 500; letter-spacing: 0; }
:root[data-layout="odoo"] .top-sub { display: none; }
:root[data-layout="odoo"] .shortcut-bar { padding: 8px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
:root[data-layout="odoo"] .content { padding: 16px 24px 48px; max-width: none; }
:root[data-layout="odoo"] .page { gap: 12px; }
:root[data-layout="odoo"] .page > * { animation: none; }
:root[data-layout="odoo"] .page-head > .btn.primary { order: -1; margin-left: 0; }
:root[data-layout="odoo"] .btn { min-height: 32px; padding: 0 12px; }
:root[data-layout="odoo"] .card { padding: 14px 16px; box-shadow: none; }
:root[data-layout="odoo"] .table { font-size: 13.5px; }
:root[data-layout="odoo"] .table th { padding: 8px 12px; color: var(--text); font-weight: 500; background: var(--surface-2); }
:root[data-layout="odoo"] .table td { padding: 6px 12px; }
:root[data-layout="odoo"] .table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
:root[data-layout="odoo"] .table tr.click:hover td { background: var(--sunk); }
:root[data-layout="odoo"] .toolbar.folded { gap: 0; flex: 0 1 560px; }
:root[data-layout="odoo"] .toolbar.folded > .search { max-width: none; flex: 1 1 auto; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
:root[data-layout="odoo"] .toolbar.folded > .flt > .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-left: -1px; min-height: 34px; }
:root[data-layout="odoo"] .toolbar.folded > .keep { margin-left: 8px; }
:root[data-layout="odoo"] .bnav { background: var(--surface); border-top-color: var(--line); }
:root[data-layout="odoo"] .bnav-link { color: var(--text-3); --ic-mark: var(--text-3); }
:root[data-layout="odoo"] .bnav-link[aria-current="page"] { color: var(--brand-ink); background: var(--brand-soft); --ic-mark: var(--brand); }
:root[data-layout="odoo"] .bnav-link[aria-current="page"]::after { background: var(--brand); }
@media (max-width: 900px) {
  .onav { padding: 0 8px 0 4px; }
  .onav-app { padding: 0 6px; }
  :root[data-layout="odoo"] .top, :root[data-layout="odoo"] .shortcut-bar { padding-left: 16px; padding-right: 16px; }
  :root[data-layout="odoo"] .content { padding: 12px 16px 104px; }
}
@media (max-width: 700px) {
  .onav-menu { display: none; }
  .onav .gsearch:focus-within { width: calc(100vw - 150px); }
  :root[data-layout="odoo"] .top-actions { width: auto; }
}
:root[data-layout="odoo"] .flt-pop { left: auto; right: 0; transform-origin: top right; }
:root[data-layout="odoo"] .main:has(.page-head > .btn.primary) .top-actions > .pop-wrap:has(.new-btn) { display: none; }
.card.foldable > .card-head { justify-content: flex-start; }
.card.foldable > .card-head > :first-child { margin-right: auto; }
/* menus opened from a page head stay above the blocks that follow it */
.page-head { position: relative; z-index: 5; }
/* the drawer always shows names, even where the side rail shows icons only */
.drawer .nav-group { margin-top: 10px; padding-top: 0; border-top: 0; }
.drawer .nav-title, .drawer .lbl { display: block; }
.drawer .nav-link { justify-content: flex-start; padding: 0 10px 0 12px; height: 40px; }
.drawer .badge-slot, .drawer .nav-count { position: static; margin-left: auto; font-size: 12px; }
.docno-txt.draft { color: var(--text-3); font-weight: 400; }
.more-pop { top: calc(100% + 6px); right: 0; min-width: 200px; display: flex; flex-direction: column; gap: 2px; transform-origin: top right; }
.more-pop .btn { width: 100%; justify-content: flex-start; border-color: transparent; background: none; font-weight: 400; }
.more-pop .btn:hover { background: var(--hover); }
.more-pop > .pop-wrap { display: block; }
/* a page block holding an open menu is lifted above the blocks around it */
.page > *:has(.pop:not([hidden])), .page > * > *:has(.pop:not([hidden])) { position: relative; z-index: 6; }

/* ---- time off and timesheets ---------------------------------------------------------------------- */
.acts { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.table td.row-acts { text-align: right; white-space: nowrap; }
.hr-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.hr-inline .input { width: auto; flex: 1 1 160px; min-width: 0; }
.hr-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.hr-holidays { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.hr-holidays li { display: flex; align-items: center; gap: 12px; padding: 7px 8px 7px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.hr-holidays li:first-child { border-top: 0; }
.ts-grid th[scope="row"] { font-weight: 400; white-space: nowrap; }
.ts-grid th.today { color: var(--brand-ink); }
.ts-grid td { padding: 4px 6px; }
.ts-cell { width: 64px; min-height: 30px; padding: 0 6px; text-align: right; font-variant-numeric: tabular-nums; }
.ts-grid td.locked .ts-cell { background: var(--sunk); color: var(--text-3); }
.ts-grid tfoot td, .ts-grid tfoot th { border-top: 1px solid var(--line-strong); padding: 8px 12px; font-weight: 500; }
.ts-week .seg-btn { min-height: 30px; }

/* ---- e-invoice simulation and the way back to Odoo -------------------------------------------------- */
.sim-banner { display: flex; align-items: flex-start; gap: 9px; margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; line-height: 1.45;
  background: var(--ok-bg); color: var(--ok-ink); }
.sim-banner .ic { flex: none; margin-top: 1px; }
.sim-banner.is-info { background: var(--info-bg); color: var(--info-ink); }
.sim-banner.is-bad { background: var(--warn-bg); color: var(--warn-ink); }
.sim-checks, .sim-steps { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.sim-checks { list-style: none; }
.sim-checks li { display: flex; align-items: flex-start; gap: 8px; }
.sim-checks li .ic { flex: none; margin-top: 2px; }
.sim-checks li.ok .ic { color: var(--st-good); }
.sim-checks li.bad { color: var(--bad-ink); }
.sim-checks li.skip { color: var(--text-3); }
.sim-steps { padding-left: 20px; }
.sim-sub { margin: 4px 0 6px; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.sim-request { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sim-request h3 { width: 100%; }
.sim-xml { max-height: 260px; overflow: auto; margin: 0; padding: 10px 12px; background: var(--sunk); border-radius: var(--radius-sm); font-size: 11.5px; white-space: pre; }
.dialog:has(.sim) { width: min(640px, 100%); }
.dialog .dialog-body:has(.sim), .dialog .dialog-body:has(.sim-banner) { max-height: min(70vh, 680px); overflow: auto; }
.odoo-warn { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--warn-ink); }
.odoo-warn li { display: flex; gap: 6px; align-items: flex-start; }
