/* Bill Desk — design tokens & components. No build step: edit this file directly. */
@font-face { font-family: "Lato"; src: url("../fonts/lato-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/lato-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #14213d;
  --ink-2: #1e2f52;
  --ink-3: #2b3f66;
  --paper: #f4f6f8;
  --surface: #ffffff;
  --line: #dde3e8;
  --line-strong: #c5ced6;
  --text: #14213d;
  --muted: #5b6b7f;
  --faint: #8a98a8;
  --accent: #1d4e89;
  --accent-hover: #163d6c;
  --accent-soft: #e6eef7;
  --green: #0f7b5f;
  --green-soft: #e2f2ec;
  --amber: #a8701a;
  --amber-bar: #d49a2c;
  --amber-soft: #fbf0db;
  --red: #b42318;
  --red-soft: #fce8e6;
  --track: #e8edf1;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 1px 1px rgba(20, 33, 61, .04);
  --font: "Lato", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar: 236px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--paper); font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; }
h1 { font-size: 24px; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 .75em; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.warn { color: var(--amber); }
:focus-visible { outline: 3px solid #7aa7e0; outline-offset: 2px; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #c9d3e3; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; background: linear-gradient(90deg, #0f7b5f 0 62%, #d49a2c 62% 82%, #b42318 82%); display: grid; place-items: center; color: #fff; font-size: 15px; }
.brand small { display: block; font-weight: 400; color: #8ea0bd; font-size: 11.5px; }
.nav { padding: 6px 10px 20px; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-group > span { display: block; padding: 0 10px 6px; font-size: 12px; color: #8093b3; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: #d5ddea; font-size: 14.5px; }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .75; }
.nav a:hover { background: var(--ink-2); text-decoration: none; color: #fff; }
.nav a.active { background: var(--ink-3); color: #fff; box-shadow: inset 3px 0 0 #4f9a83; }
.nav .count { margin-left: auto; background: var(--amber-bar); color: var(--ink); font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 10px; }
.sidebar-foot { padding: 12px 18px 18px; font-size: 12px; color: #7f91ae; border-top: 1px solid var(--ink-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 28px; background: rgba(244, 246, 248, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; cursor: pointer; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input[type=search] { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-size: 14px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 11px var(--font); color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; background: var(--paper); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(20, 33, 61, .14); max-height: 420px; overflow: auto; display: none; }
.search-results.open { display: block; }
.search-results a { display: block; padding: 9px 14px; color: var(--text); border-bottom: 1px solid var(--track); }
.search-results a:hover, .search-results a.hl { background: var(--accent-soft); text-decoration: none; }
.search-results .type { font-size: 12px; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.user-chip .role { font-size: 12px; color: var(--muted); display: block; line-height: 1.2; }
.content { padding: 24px 28px 48px; max-width: 1440px; width: 100%; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: #fff; color: var(--text); font: 600 14px var(--font); cursor: pointer; white-space: nowrap; line-height: 1.3; }
.btn:hover { background: #f7f9fa; text-decoration: none; border-color: #aab6c2; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-money { background: var(--green); border-color: var(--green); color: #fff; }
.btn-money:hover { background: #0b6550; border-color: #0b6550; }
.btn-danger { color: var(--red); border-color: #e7b4ae; }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--track); border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Cards & panels ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 18px; }

/* ---------- Ledger summary (signature element) ---------- */
.ledger { padding: 20px 22px; }
.ledger-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.ledger-figures > a, .ledger-figures > div { padding: 2px 18px 2px 0; color: inherit; display: block; }
.ledger-figures > * + * { padding-left: 18px; border-left: 1px solid var(--line); }
.ledger-figures a:hover { text-decoration: none; }
.ledger-figures a:hover .fig { text-decoration: underline; text-decoration-thickness: 1px; }
.fig-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.fig-label i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.fig { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; }
.fig-sub { font-size: 13px; color: var(--muted); }
.ledger-bar { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--track); margin-top: 18px; }
.ledger-bar span { display: block; height: 100%; }
.seg-collected { background: var(--green); }
.seg-outstanding { background: var(--amber-bar); }
.seg-overdue { background: var(--red); background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.18) 0 4px, transparent 4px 8px); }
.ledger-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.mini-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--track); min-width: 90px; }
.mini-bar span { display: block; height: 100%; }
.i-collected { background: var(--green); } .i-outstanding { background: var(--amber-bar); } .i-overdue { background: var(--red); } .i-invoiced { background: #8fa3b8; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 16px; color: inherit; display: block; }
a.stat:hover { border-color: var(--accent); text-decoration: none; }
.stat b { display: block; font-size: 20px; letter-spacing: -.01em; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.attention b { color: var(--red); }
.result-profit { color: var(--green); } .result-loss { color: var(--red); } .result-break-even { color: var(--muted); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 13px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
.tbl th.num { text-align: right; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--track); vertical-align: top; }
.tbl tbody tr:hover td { background: #f8fafb; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--line-strong); border-bottom: 0; background: #fafbfc; }
.tbl .sub { display: block; font-size: 12.5px; color: var(--muted); }
.tbl a.sort { color: var(--muted); }
.tbl td.actions-cell { white-space: nowrap; text-align: right; }
.tbl tr.is-cancelled td { color: var(--faint); text-decoration: line-through; text-decoration-color: rgba(138,152,168,.5); }
.tbl tr.is-cancelled td .badge, .tbl tr.is-cancelled td a { text-decoration: none; }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 10px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.badge-neutral { background: var(--track); color: #3d4f66; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-muted { background: #eef1f4; color: var(--faint); }
.badge-navy { background: #e3e9f4; color: #1f3864; }
.badge svg { width: 12px; height: 12px; vertical-align: -1px; margin-right: 4px; }
.pill { display: inline-block; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; font-size: 12.5px; color: var(--muted); background: #fff; }

/* ---------- Forms ---------- */
.form { max-width: 920px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .span-2 { grid-column: span 2; }
.field label, .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.field .opt { font-weight: 400; color: var(--faint); }
.help { font-size: 13px; color: var(--muted); margin: 5px 0 0; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; font: inherit; font-size: 14.5px; color: var(--text);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 78, 137, .15); }
.is-invalid { border-color: var(--red) !important; }
.field-error { color: var(--red); font-size: 13px; margin: 5px 0 0; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400 !important; }
.check input { margin-top: 3px; }
.input-prefix { display: flex; }
.input-prefix span { padding: 8px 10px; border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--paper); color: var(--muted); }
.input-prefix input { border-radius: 0 var(--radius) var(--radius) 0; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.section-title { font-size: 15px; font-weight: 700; margin: 26px 0 4px; }
.section-title + .help { margin: 0 0 12px; }
.calc { background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 8px 11px; color: var(--muted); }

/* Filters */
.filters { margin-bottom: 16px; }
.filters-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters-row .field { min-width: 150px; flex: 0 1 auto; }
.filters-row .field.grow { flex: 1 1 220px; }
.filters-row label { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.filters-row input, .filters-row select { padding: 6px 9px; font-size: 14px; }
.filters details > summary { cursor: pointer; color: var(--accent); font-size: 14px; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.filters details > summary::-webkit-details-marker { display: none; }
.filters details[open] > summary { margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 2px 6px 2px 10px; font-size: 13px; }
.chip a { color: var(--accent); font-weight: 700; padding: 0 4px; }
.multi { position: relative; }
.multi-list { max-height: 180px; overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 6px 8px; background: #fff; }
.multi-list label { display: flex; gap: 6px; font-weight: 400; font-size: 14px; color: var(--text); margin: 2px 0; }

/* Installment editor */
.inst-table td { padding: 6px 6px; border-bottom: 0; }
.inst-table input { padding: 6px 8px; }
.inst-summary { font-size: 13.5px; color: var(--muted); padding: 8px 6px; }
.inst-summary b { color: var(--text); }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius); padding: 11px 14px; margin-bottom: 16px; border: 1px solid; font-size: 14.5px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--green-soft); border-color: #b5dccd; color: #0b5a46; }
.alert-error { background: var(--red-soft); border-color: #f0bdb7; color: #8f1c13; }
.alert-info { background: var(--accent-soft); border-color: #c4d6ec; color: #173f6e; }
.alert-warn { background: var(--amber-soft); border-color: #ecd3a3; color: #7a5212; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a, .tabs button { padding: 9px 14px; color: var(--muted); border: 0; background: none; font: 600 14px var(--font); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .on { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel[hidden] { display: none; }

/* ---------- Definition list ---------- */
.dl { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; margin: 0; font-size: 14.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--line-strong); }
.timeline li.t-pay::before { border-color: var(--green); background: var(--green-soft); }
.timeline li.t-mail::before { border-color: var(--accent); background: var(--accent-soft); }
.timeline li.t-fail::before { border-color: var(--red); background: var(--red-soft); }
.timeline li.t-due::before { border-color: var(--amber-bar); }
.timeline .when { font-size: 12.5px; color: var(--muted); }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; font-family: var(--font); }
.chart .grid { stroke: var(--track); stroke-width: 1; }
.chart .axis { font-size: 11px; fill: var(--faint); }
.chart .cat { font-size: 12.5px; fill: var(--text); }
.chart .val { font-size: 11px; fill: var(--muted); }
.chart .inbar { font-size: 11px; fill: #fff; font-weight: 700; }
.chart .track { fill: var(--track); }
.chart a .cat { fill: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0 0 10px; padding: 0; font-size: 13px; color: var(--muted); }
.legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.empty-chart { color: var(--muted); padding: 30px 0; text-align: center; }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; gap: 10px; }
.pager .pages { display: flex; gap: 4px; }
.pager a, .pager span.cur { padding: 4px 10px; border-radius: 5px; border: 1px solid var(--line); color: var(--text); }
.pager span.cur { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 20px 60px rgba(20, 33, 61, .3); color: var(--text); }
dialog::backdrop { background: rgba(20, 33, 61, .45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.dlg-body { padding: 18px 20px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fafbfc; position: sticky; bottom: 0; }
.close-x { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; }
.attach-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.items-table input { min-width: 0; }
.email-preview { border: 1px solid var(--line); border-radius: var(--radius); }
.email-preview .meta { padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.email-preview .meta div { display: grid; grid-template-columns: 70px 1fr; }
.email-preview .meta span { color: var(--muted); }
.email-preview .body { padding: 14px 18px; font-size: 14px; max-height: 360px; overflow: auto; }
.email-preview .body table { font-size: 13.5px; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-art { background: var(--ink); color: #dfe6f1; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art h1 { color: #fff; font-size: 34px; max-width: 14ch; letter-spacing: -.02em; }
.auth-art p { color: #aebbd2; max-width: 42ch; font-size: 16px; }
.auth-ledger { margin: 28px 0; max-width: 420px; }
.auth-ledger .row { display: grid; grid-template-columns: 1fr auto; font-size: 14px; padding: 9px 0; border-bottom: 1px solid var(--ink-3); }
.auth-ledger .row b { color: #fff; }
.auth-ledger .ledger-bar { background: var(--ink-3); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 22px; margin-bottom: 4px; }
.auth-card .field { margin-top: 16px; }

/* ---------- Misc ---------- */
.kbd { font-size: 12px; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; background: var(--paper); }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; overflow-wrap: anywhere; }
pre.code { padding: 10px 12px; white-space: pre-wrap; display: block; }
.placeholder-list { display: flex; flex-wrap: wrap; gap: 6px; }
.placeholder-list button { font: 12.5px ui-monospace, Consolas, monospace; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 3px 7px; cursor: pointer; color: var(--accent); }
.diff { font-size: 12.5px; }
.diff del { color: var(--red); text-decoration: line-through; }
.diff ins { color: var(--green); text-decoration: none; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.inline-form { display: inline; }
.help-doc h2 { margin: 28px 0 8px; font-size: 18px; }
.help-doc h3 { margin: 18px 0 6px; }
.help-doc p, .help-doc li { max-width: 78ch; }
.help-doc li { margin-bottom: 4px; }
.footnote { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.scheduler-ok { color: var(--green); } .scheduler-bad { color: var(--red); }

@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
  .ledger-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .ledger-figures > :nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; width: 264px; transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(20, 33, 61, .45); }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 40px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .user-chip, .topbar-right a.btn-ghost, .topbar-right .lbl { display: none; }
  .topbar { gap: 8px; }
  .search kbd { display: none; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .fig { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .sidebar, .topbar, .no-print, .actions, .filters, .pager { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; font-size: 12px; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}
.filters summary svg, .btn svg, .nav a svg { flex: none; }
.filters summary svg { width: 15px; height: 15px; }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card:not([open]) > summary { border-bottom: 0; }
.menu-toggle svg { width: 20px; height: 20px; color: var(--ink); }
/* Bill progress stepper (a real sequence, so numbered) */
.stepper { display: flex; gap: 0; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: step; flex-wrap: wrap; }
.stepper li { flex: 1 1 140px; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); padding: 10px 12px; border-top: 3px solid var(--track); }
.stepper li span { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--track); color: var(--muted); }
.stepper li.done { color: var(--text); border-top-color: var(--green); }
.stepper li.done span { background: var(--green); color: #fff; }
/* Emails on/off switch */
.switch-form { display: inline; }
.switch { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 2px 0; cursor: pointer; font: 600 13px var(--font); color: var(--muted); }
.switch .knob { position: relative; width: 36px; height: 20px; border-radius: 10px; background: var(--line-strong); transition: background .15s; flex: none; }
.switch .knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(20,33,61,.3); transition: transform .15s; }
.switch[aria-checked="true"] { color: var(--green); }
.switch[aria-checked="true"] .knob { background: var(--green); }
.switch[aria-checked="true"] .knob::after { transform: translateX(16px); }
.switch[disabled] { cursor: not-allowed; opacity: .55; }
.switch.busy { opacity: .6; pointer-events: none; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; max-width: 380px; padding: 12px 16px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(20,33,61,.3); }
.toast.error { background: var(--red); }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.nav a .ext { margin-left: auto; display: inline-flex; }
.nav a .ext svg { width: 13px; height: 13px; opacity: .6; }

/* Consultancy invoice calculator */
.calc-box { margin: 18px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #f7f9fb; font-size: 14px; }
.calc-box .formula { font-size: 15px; }
.calc-box .formula b { font-size: 17px; }
.calc-box table { margin-top: 8px; border-collapse: collapse; }
.calc-box td { padding: 3px 18px 3px 0; }
.calc-box td.num { text-align: right; font-variant-numeric: tabular-nums; }
.calc-box tr.total td { border-top: 1px solid var(--line); font-weight: 700; padding-top: 6px; }
.tax-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tax-grid .chosen { outline: 2px solid var(--green); }
.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv td.num { text-align: right; font-variant-numeric: tabular-nums; }
.kv tr.total td { font-weight: 700; border-bottom: 0; }
.kv tr.sub td { color: var(--muted); font-size: 13px; padding: 2px 0 2px 12px; border-bottom: 0; }
@media (max-width: 760px) { .tax-grid { grid-template-columns: 1fr; } }
dialog.wide { width: min(720px, calc(100vw - 32px)); }
.backfill-table input { padding: 5px 7px; } .backfill-table td { vertical-align: middle; }
