/* Layout: fixed left rail of sections, scrolling ledger on the right; on phones the rail becomes a top strip. */
:root {
  --bg: #f5f5f9;
  --surface: #ffffff;
  --surface-2: #ededf3;
  --line: #dadbe4;
  --ink: #1b1c2e;
  --ink-2: #51536b;
  --ink-3: #80829a;
  --accent: #5558d6;
  --accent-ink: #ffffff;
  --accent-soft: #e9e9fb;
  --good: #1f7a4d;
  --good-soft: #dff3e6;
  --warn: #9a6400;
  --warn-soft: #fbefd2;
  --bad: #b3261e;
  --bad-soft: #fbe3e1;
  --neutral-soft: #e6e8e4;
  --spend: #8a7a5a;
  --shadow: 0 10px 30px rgba(20, 30, 26, 0.12);
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --radius: 6px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121320; --surface: #1a1b2b; --surface-2: #232439; --line: #33354f;
    --ink: #e9e9f1; --ink-2: #b0b2c6; --ink-3: #7f819a;
    --accent: #9b9cf7; --accent-ink: #12123a; --accent-soft: #2a2b58;
    --good: #6ccf94; --good-soft: #1d3a2a; --warn: #e2b04a; --warn-soft: #3d3010;
    --bad: #ef7b73; --bad-soft: #43201d; --neutral-soft: #2b3330; --spend: #b8a683;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121320; --surface: #1a1b2b; --surface-2: #232439; --line: #33354f;
  --ink: #e9e9f1; --ink-2: #b0b2c6; --ink-3: #7f819a;
  --accent: #9b9cf7; --accent-ink: #12123a; --accent-soft: #2a2b58;
  --good: #6ccf94; --good-soft: #1d3a2a; --warn: #e2b04a; --warn-soft: #3d3010;
  --bad: #ef7b73; --bad-soft: #43201d; --neutral-soft: #2b3330; --spend: #b8a683;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 600; }
h1 { font-size: 22px; letter-spacing: -0.01em; }
h2 { font-size: 16px; }
h3 { font-size: 13px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.right { text-align: right; }

/* ---- App shell ---- */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100%; }
.rail {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 4px 10px 12px; display: flex; align-items: center; gap: 10px; }
.brand img { width: 30px; height: auto; flex: none; }
.brand strong { display: block; font-size: 15px; line-height: 1.2; }
.brand span { color: var(--ink-3); font-size: 12px; }
.rail-search { position: relative; margin: 0 4px 8px; }
.rail-search input { padding: 7px 10px 7px 30px; font-size: 13px; background: var(--surface-2); border-color: transparent; }
.rail-search svg { position: absolute; left: 10px; top: 9px; width: 14px; height: 14px; color: var(--ink-3); pointer-events: none; }
.rail-search .hits { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 20; overflow: hidden; }
.rail-search .hits a { display: block; padding: 8px 10px; font-size: 13px; }
.rail-search .hits a:hover, .rail-search .hits a.on { background: var(--surface-2); }
.rail-search .hits .meta { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.rail a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius);
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.rail a:hover { background: var(--surface-2); color: var(--ink); }
.rail a.active { background: var(--accent-soft); color: var(--accent); }
.rail a .ico { width: 18px; height: 18px; flex: none; }
.rail .spacer { flex: 1; }
.rail .who { padding: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.main { min-width: 0; padding-block: 24px 48px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { width: 100%; padding: 4px 6px 8px; }
  .rail a { padding: 6px 10px; font-size: 13px; }
  .rail .spacer, .rail .who { display: none; }
  .main { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 16px 40px; }
}

/* ---- Buttons & inputs ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 500; line-height: 1.2;
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .rail a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: 0.55; cursor: default; }
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
textarea { min-height: 72px; resize: vertical; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.field { min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 160px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 12px; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---- Cards, tiles ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; min-width: 0; }
.tile .label { font-size: 12px; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.tile .value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 24px; font-weight: 500; margin-top: 4px; letter-spacing: -0.01em; }
.tile .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.tile.alert { border-color: var(--bad); }
.tile.alert .value { color: var(--bad); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.two-col .card + .card { margin-top: 0; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
tr.done td { color: var(--ink-3); text-decoration: line-through; }
td .row-actions { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.empty { padding: 28px 12px; text-align: center; color: var(--ink-3); }
.total-row td { font-weight: 600; border-top: 2px solid var(--line); }

/* ---- Status pills ---- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* ---- Owed-to-partner cards ---- */
.owed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.owed { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.owed .amt { font-family: var(--mono); font-size: 22px; font-variant-numeric: tabular-nums; }
.owed .name { font-weight: 600; }

/* ---- Chart ---- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); fill: var(--ink-3); font-size: 11px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar-rev { fill: var(--accent); }
.chart .bar-spend { fill: var(--spend); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--ink); fill-opacity: 0.05; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend .rev::before { background: var(--accent); }
.legend .spend::before { background: var(--spend); }
.tooltip { position: fixed; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 9px; border-radius: 4px; font-size: 12px; z-index: 50; box-shadow: var(--shadow); white-space: nowrap; }

/* ---- Modal ---- */
.backdrop { position: fixed; inset: 0; background: rgba(10, 16, 14, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 40; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; width: min(640px, 100%); box-shadow: var(--shadow); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal .body { padding: 18px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.error { color: var(--bad); font-size: 13px; margin-top: 8px; }
.attach { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; }

/* ---- Auth screens ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: min(480px, 100%); padding: 28px; }
.auth h1 { margin-bottom: 4px; }
.auth p { color: var(--ink-2); margin: 0 0 18px; }
.auth .partner { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-top: 12px; }

/* ---- Toast ---- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 6px; font-size: 13px; z-index: 60; box-shadow: var(--shadow); }
.toast.bad { background: var(--bad); color: #fff; }

/* ---- Detail lists ---- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.list { display: flex; flex-direction: column; }
.list .item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list .item:last-child { border-bottom: 0; }
.list .item .meta { color: var(--ink-3); font-size: 12px; }
.stripe-note { font-size: 12px; color: var(--ink-3); }

@media (prefers-reduced-motion: no-preference) {
  .modal { animation: pop 0.14s ease-out; }
  @keyframes pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ---- Navigation groups ---- */
.rail .group { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); font-weight: 600; padding: 12px 10px 4px; }
@media (max-width: 820px) { .rail .group { display: none; } }

/* ---- Banners ---- */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 16px; font-size: 13px; }
.banner.warn { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.banner.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.banner.good { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.banner code { font-family: var(--mono); font-size: 12px; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ---- Period strip (one chip per billing period) ---- */
.strip { display: inline-flex; gap: 3px; vertical-align: middle; }
.strip .chip { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 20px; padding: 0 5px; border-radius: 4px; font-size: 10.5px; font-weight: 600; background: var(--neutral-soft); color: var(--ink-3); white-space: nowrap; }
.strip .chip.paid { background: var(--good-soft); color: var(--good); }
.strip .chip.paid.override { background: var(--accent-soft); color: var(--accent); }
.strip .chip.due { background: var(--bad-soft); color: var(--bad); }
.strip .chip.upcoming { border: 1px dashed var(--line); background: transparent; }
.strip-legend { display: flex; gap: 12px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; }
.strip-legend .chip { min-width: 14px; height: 14px; padding: 0; }

/* ---- Dropdown menu (secondary row actions) ---- */
.dd { position: relative; display: inline-block; }
.dd summary { list-style: none; cursor: pointer; }
.dd summary::-webkit-details-marker { display: none; }
.dd[open] > summary::before { content: ""; position: fixed; inset: 0; z-index: 30; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 31; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; }
.dd-menu button, .dd-menu a { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: none; border-radius: 5px; cursor: pointer; color: var(--ink); text-decoration: none; font-size: 13px; }
.dd-menu button:hover, .dd-menu a:hover { background: var(--surface-2); }
.dd-menu .danger { color: var(--bad); }
.dd-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---- Attention list on the dashboard ---- */
.attn { display: flex; flex-direction: column; }
.attn .row { display: grid; grid-template-columns: 4px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.attn .row:last-child { border-bottom: 0; }
.attn .mark { width: 4px; height: 32px; border-radius: 2px; background: var(--line); }
.attn .mark.bad { background: var(--bad); }
.attn .mark.warn { background: var(--warn); }
.attn .what { font-weight: 500; }
.attn .meta { color: var(--ink-3); font-size: 12px; }
.attn .side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---- Switch ---- */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--ink); margin: 0; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; margin: 0; cursor: pointer; transition: background 0.15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 18px; }

/* ---- Misc ---- */
.field .help { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.link-box { display: flex; gap: 8px; }
.link-box input { font-family: var(--mono); font-size: 12px; }
.pill.subtle { background: transparent; border: 1px solid var(--line); }
.tile .value.text { font-family: var(--font); font-size: 16px; font-weight: 500; margin-top: 8px; }
pre.mail { white-space: pre-wrap; font-family: var(--font); background: var(--surface-2); padding: 12px; border-radius: 6px; margin: 0; font-size: 13px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
th .hint { font-weight: 400; text-transform: none; letter-spacing: 0; }
.tbl-sub .strip { margin-top: 2px; }

/* ---- Management doc grid ---- */
.mgmt-wrap { overflow-x: auto; }
.mgmt { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1100px; }
.mgmt th, .mgmt td { border-bottom: 1px solid var(--line); padding: 6px 6px; vertical-align: middle; }
.mgmt th.who, .mgmt td.who { position: sticky; left: 0; background: var(--surface); z-index: 2; min-width: 220px; text-align: left; border-right: 1px solid var(--line); }
.mgmt th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); text-align: center; white-space: nowrap; }
.mgmt th.cur { color: var(--accent); }
.mgmt td.who .plan { font-weight: 600; }
.mgmt td.who .sub { font-size: 11.5px; color: var(--ink-3); }
.mgmt tr.setup td.who { padding-left: 22px; }
.mgmt tr.setup td.who .plan { font-weight: 500; color: var(--ink-2); }
.mcell { text-align: center; font-size: 11.5px; font-weight: 600; min-width: 64px; border-left: 1px solid var(--line); }
.mcell > div { padding: 3px 4px; border-radius: 4px; white-space: nowrap; }
.mcell.paid > div { background: var(--good-soft); color: var(--good); }
.mcell.paid.covered > div { background: var(--good-soft); color: var(--good); opacity: 0.75; }
.mcell.paid.override > div { background: var(--accent-soft); color: var(--accent); }
.mcell.due > div { background: var(--bad-soft); color: var(--bad); }
.mcell.open > div { background: var(--warn-soft); color: var(--warn); }
.mcell.trial > div { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.mcell.upcoming > div { border: 1px dashed var(--line); color: var(--ink-3); font-weight: 400; }
.mcell.ended > div, .mcell.none > div { color: var(--ink-3); opacity: 0.5; }
.mcell .cancel { font-size: 10px; color: var(--bad); font-weight: 600; margin-top: 2px; white-space: nowrap; }
.mcell[data-cell], .mcell[data-inv] { cursor: pointer; }
.mcell[data-cell]:hover > div, .mcell[data-inv]:hover > div { outline: 2px solid var(--accent); }
.mgmt tfoot td { font-family: var(--mono); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; border-top: 2px solid var(--line); }
.mgmt tfoot td.who { text-align: left; font-family: var(--font); font-weight: 600; }
.mgmt tfoot tr.unpaid td { color: var(--bad); }
.mgmt tfoot tr.collected td { color: var(--good); }
.year-nav { display: inline-flex; align-items: center; gap: 4px; }
.year-nav strong { min-width: 56px; text-align: center; font-size: 16px; }

/* ---- Management doc v2 ---- */
.mgmt td.who .client { font-weight: 600; font-size: 14px; }
.mgmt td.who .client a { color: var(--ink); text-decoration: none; }
.mgmt td.who .client a:hover { text-decoration: underline; }
.mgmt td.who .plan { font-weight: 400; font-size: 12px; color: var(--ink-2); }
.mgmt td.who .flags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.mgmt td.who .flags .pill { font-size: 10.5px; padding: 1px 6px; }
.mgmt th.who, .mgmt td.who { min-width: 250px; }
.mcell.paid.waived > div { background: var(--neutral-soft); color: var(--ink-2); }
.mcell[data-cell] > div::after { content: ""; }
.mgmt tr.setup td.who .client { display: none; }
.range { display: inline-flex; align-items: center; gap: 6px; }
.range select { width: auto; padding: 6px 8px; }
.pw-field { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.decision { display: grid; gap: 8px; }
.decision label.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--ink); margin: 0; }
.decision label.opt input { width: auto; margin-top: 3px; }
.decision label.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.decision .opt .d { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.rec-row .amt.in { color: var(--good); }
.rec-row .amt.out { color: var(--bad); }
.rec-row .act { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }

/* ---- Dashboard: money this month ---- */
.card.money { margin-bottom: 16px; }
.money-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.money-grid .label { font-size: 12px; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.money-grid .big { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 500; margin: 4px 0 2px; letter-spacing: -0.01em; }
.money-grid .big.in { color: var(--good); }
.money-grid .big.out { color: var(--bad); }
.money-grid .sub { font-size: 12px; color: var(--ink-3); }
.money-grid .up { color: var(--good); } .money-grid .down { color: var(--bad); }

/* ---- Management doc: payment date, invoice chips ---- */
.mcell .paidon { font-size: 10px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; font-weight: 500; }
.mcell.inv { vertical-align: top; }
.ichip { display: flex; justify-content: space-between; gap: 4px; padding: 2px 5px; margin-bottom: 3px; border-radius: 4px; font-size: 10.5px; font-weight: 600; cursor: pointer; white-space: nowrap; background: var(--warn-soft); color: var(--warn); }
.ichip span { font-weight: 500; }
.ichip.paid { background: var(--good-soft); color: var(--good); }
.ichip.due { background: var(--bad-soft); color: var(--bad); }
.ichip.void { background: var(--neutral-soft); color: var(--ink-3); text-decoration: line-through; }
.ichip:hover { outline: 2px solid var(--accent); }
.range select { min-width: 0; }
.page-head .actions select { width: auto; }
.link-box { flex-wrap: wrap; }
.link-box input { flex: 1 1 260px; min-width: 0; }
