/* Kudu Expense Management — calm, neutral, data-first. Kudu palette: charcoal #1F2A33, LED green #2BD576, cream/warm greys. */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --border: #e4e1d8;
  --text: #1f2a33;
  --muted: #66717b;
  --accent: #2bd576;          /* Kudu LED green: fills (primary buttons, capture button, focus) */
  --accent-text: #0b7a43;     /* the same green, darkened for text and links on white (5.4:1) */
  --brand: #66717b;
  --accent-ink: #10202b;      /* text on a green fill */
  --accent-soft: #e4f6ec;
  --ok: #15803d;   --ok-soft: #e8f5ec;
  --warn: #b45309; --warn-soft: #fdf3e4;
  --bad: #b42318;  --bad-soft: #fdecea;
  --info: #3b5bdb; --info-soft: #edf1fd;
  --grey-soft: #edebe5;
  --violet: #7c3aed;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
/* Dark theme: follows the device unless the user chose Light (data-theme="light"); data-theme="dark" forces it. Set by static/theme.js. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151c22; --surface: #1f2a33; --surface-2: #26333d; --border: #34424d;
    --text: #e8ecef; --muted: #9aa7b2; --accent: #2bd576; --accent-text: #2bd576; --brand: #9aa7b2; --accent-ink: #10202b; --accent-soft: #163a2a;
    --ok: #4ade80; --ok-soft: #12301d; --warn: #fbbf24; --warn-soft: #33260c;
    --bad: #f87171; --bad-soft: #3a1717; --info: #93a8ff; --info-soft: #1b2346; --grey-soft: #2b3843; --violet: #c4b5fd;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #151c22; --surface: #1f2a33; --surface-2: #26333d; --border: #34424d;
    --text: #e8ecef; --muted: #9aa7b2; --accent: #2bd576; --accent-text: #2bd576; --brand: #9aa7b2; --accent-ink: #10202b; --accent-soft: #163a2a;
    --ok: #4ade80; --ok-soft: #12301d; --warn: #fbbf24; --warn-soft: #33260c;
    --bad: #f87171; --bad-soft: #3a1717; --info: #93a8ff; --info-soft: #1b2346; --grey-soft: #2b3843; --violet: #c4b5fd;
    --shadow: none; color-scheme: dark;
}
/* Logos: the Kudu logo comes in an ink version (light pages) and a light version (dark pages); show the right one */
.brand .logo.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand .logo.logo-light { display: none !important; }
  :root:not([data-theme="light"]) .brand .logo.logo-dark { display: block !important; }
}
:root[data-theme="dark"] .brand .logo.logo-light { display: none !important; }
:root[data-theme="dark"] .brand .logo.logo-dark { display: block !important; }
/* Theme switch: Auto / Light / Dark */
.theme-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.theme-switch button { border: 0; background: transparent; color: var(--muted); padding: 5px 10px; font: inherit; font-size: 12.5px; cursor: pointer; }
.theme-switch button + button { border-left: 1px solid var(--border); }
.theme-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.theme-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.side .foot .theme-switch { display: flex; margin: 8px 0 10px; }
.side .foot .theme-switch button { flex: 1; padding: 5px 6px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; position: sticky; top: 0;
        height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 4px 10px 18px; }
.brand { flex-direction: column; align-items: flex-start; gap: 2px; }
.brand .logo { height: 40px; width: auto; display: block; }
.brand .name { display: flex; flex-direction: column; line-height: 1.15; }
.brand .name small { font-size: 11px; font-weight: 500; color: var(--brand); letter-spacing: .02em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .badge { margin-left: auto; }
.side .foot { margin-top: auto; font-size: 13px; color: var(--muted); padding: 10px; border-top: 1px solid var(--border); }
.side .foot form { display: inline; }
.main { padding: 28px 32px 60px; max-width: 1200px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabbar { display: none; }

@media (max-width: 860px) {
  .shell { display: block; }
  .side { display: none; }
  .main { padding: 16px 16px 96px; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface);
            border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px;
              color: var(--muted); padding: 4px 0; position: relative; }
  .tabbar a.on { color: var(--accent-text); }
  .tabbar a:hover { text-decoration: none; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .snap { color: var(--accent-ink); }
  .tabbar .snap span.circle { background: var(--accent); width: 46px; height: 46px; border-radius: 50%; display: grid;
              place-items: center; margin-top: -20px; box-shadow: 0 4px 12px rgba(15,118,110,.35); }
  .tabbar .badge { position: absolute; top: 0; right: 22%; }
  .mobile-head { display: flex !important; }
  h1 { font-size: 20px; }
}
.mobile-head { display: none; align-items: center; justify-content: space-between; margin: -4px 0 14px; }
.mobile-head .brand { padding: 0; }

/* ---------- surfaces */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 18px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .split > .card + .card { margin-top: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px;
             border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .g2, .g3, .split { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 16px; }

.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 13px; color: var(--muted); }
a.stat { color: inherit; display: block; }
a.stat:hover { text-decoration: none; border-color: var(--accent); }

/* ---------- pills, badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px;
        font-weight: 600; white-space: nowrap; background: var(--grey-soft); color: var(--muted); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.matched, .pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.suggested, .pill.info { background: var(--info-soft); color: var(--info); }
.pill.missing, .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.lost, .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.no_receipt, .pill.personal { background: var(--grey-soft); color: var(--muted); }
.badge { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px;
         min-width: 20px; text-align: center; }
.badge.soft { background: var(--grey-soft); color: var(--muted); }

/* ---------- progress */
.progress { height: 8px; background: var(--grey-soft); border-radius: 99px; overflow: hidden; display: flex; }
.progress span { display: block; height: 100%; }
.progress .p-matched { background: var(--ok); }
.progress .p-no_receipt, .progress .p-personal { background: #9aa4b2; }
.progress .p-lost { background: var(--warn); }
.progress .p-suggested { background: var(--info); }
.progress.big { height: 12px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }

/* ---------- tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600;
     background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
tfoot td { font-weight: 700; background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
td .sub { display: block; font-size: 12.5px; color: var(--muted); }
tr.fee td { color: var(--muted); font-size: 13.5px; }

/* mobile: tables become stacked rows */
@media (max-width: 640px) {
  table.rows thead { display: none; }
  table.rows, table.rows tbody, table.rows tr, table.rows td { display: block; width: 100%; }
  table.rows tr { padding: 12px 14px; border-bottom: 1px solid var(--border); display: grid;
                  grid-template-columns: 1fr auto; gap: 2px 10px; }
  table.rows td { border: 0; padding: 0; }
  table.rows td.m-hide { display: none; }
  table.rows td.m-full { grid-column: 1 / -1; }
  table.rows td.num { text-align: right; }
}

/* ---------- filters / tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
          color: var(--text); font-size: 13.5px; }
.tabs a:hover { text-decoration: none; border-color: var(--accent); }
.tabs a.on { background: var(--text); border-color: var(--text); color: var(--surface); }
.tabs a .n { color: var(--muted); margin-left: 4px; }
.tabs a.on .n { color: inherit; opacity: .7; }

/* ---------- forms */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search],
select, textarea {
  width: 100%; padding: 9px 11px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
textarea { min-height: 70px; resize: vertical; }
.field { margin-bottom: 12px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 520px) { .fields { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 18px; height: 18px; }
.inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline .field { margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border-radius: 8px;
       border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
       font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- flash */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; border: 1px solid transparent; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.flash.info { background: var(--info-soft); color: var(--info); }
.notice { padding: 12px 14px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 14px; margin-bottom: 12px; }
.notice.info { background: var(--info-soft); color: var(--info); }

/* ---------- drop zone */
.drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted);
        background: var(--surface); transition: .15s; cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.drop strong { color: var(--text); }
.drop svg { width: 26px; height: 26px; margin-bottom: 4px; }
svg { max-width: 100%; }
.cand svg, .page-head svg { width: 16px; height: 16px; }
.drop input { display: none; }

/* ---------- documents */
.thumb { width: 44px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--surface-2);
         border: 1px solid var(--border); display: grid; place-items: center; font-size: 10px; color: var(--muted);
         font-weight: 700; flex: none; }
.doc-cell { display: flex; gap: 12px; align-items: center; min-width: 260px; }
.doc-cell .sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.preview { background: var(--surface-2); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden;
           position: sticky; top: 16px; }
.preview img { width: 100%; display: block; }
.preview iframe, .preview object { width: 100%; height: 78vh; border: 0; display: block; background: #fff; }
@media (max-width: 860px) { .preview { position: static; } .preview iframe, .preview object { height: 60vh; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.cand { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cand:last-child { border-bottom: 0; }
.cand .grow { flex: 1; min-width: 0; }
.cand .score { font-size: 12px; color: var(--muted); }

/* ---------- timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 18px; border-left: 2px solid var(--border); position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%;
                       background: var(--surface); border: 2px solid var(--border); }
.timeline li.comment::before { border-color: var(--accent); }
.timeline .when { font-size: 12px; color: var(--muted); }
.timeline .body { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; margin-top: 4px; white-space: pre-wrap; }

/* ---------- auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: 100%; max-width: 400px; padding: 28px; }
.auth .brand { flex-direction: column; text-align: center; gap: 12px; padding-bottom: 18px; font-size: 18px; }
.auth .brand { align-items: center; }
.auth .brand .logo { height: 220px; }
.auth .brand .name { font-weight: 600; font-size: 15px; color: var(--muted); }
.auth .brand .name small { font-size: 12px; margin-top: 2px; }
.qr { background: #fff; padding: 10px; border-radius: 10px; width: 220px; margin: 8px auto 12px; }
.qr svg { width: 100%; height: auto; display: block; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: var(--mono); font-size: 15px;
         background: var(--surface-2); padding: 14px; border-radius: 8px; margin: 12px 0; }
input.code { font-size: 22px; letter-spacing: .3em; text-align: center; font-family: var(--mono); }

/* ---------- snap */
.snap-wrap { max-width: 480px; margin: 0 auto; }
.snap-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
            width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; background: var(--accent); color: var(--accent-ink);
            font-weight: 700; font-size: 18px; cursor: pointer; border: 0; }
.snap-btn svg { width: 56px; height: 56px; }
.snap-item { display: flex; gap: 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); }
.snap-item img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent);
           animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- reports / print */
.report-head { margin-bottom: 18px; }
.summary-table td:first-child { color: var(--muted); }
/* KGT branding: sidebar footer + print header */
.side .foot .co { display: flex; white-space: nowrap; align-items: center; gap: 8px; font-size: 12px; color: var(--brand); margin-bottom: 8px; }
.print-brand { display: none; }

@media print {
  html:root:root { --bg: #fff; --surface: #fff; --surface-2: #f0eee8; --border: #e4e1d8; --text: #000; --muted: #555; --accent-text: #0b7a43; --grey-soft: #edebe5; color-scheme: light; }
  .brand .logo.logo-light { display: block !important; } .brand .logo.logo-dark { display: none !important; }
  .print-brand { display: flex !important; align-items: center; gap: 12px; padding-bottom: 10px; margin-bottom: 14px;
                 border-bottom: 2px solid #1F2A33; }
  .print-brand img { width: 44px; height: 44px; }
  .print-brand div { display: flex; flex-direction: column; }
  .print-brand strong { font-size: 15px; color: #000; }
  .print-brand span { font-size: 11px; color: #5b6670; }
  .side, .tabbar, .no-print, .mobile-head { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 11px; }
  .card { border: 0; box-shadow: none; padding: 0; }
  th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  th, td { padding: 4px 6px; }
  a { color: #000; }
  table { page-break-inside: auto; } tr { page-break-inside: avoid; }
}

/* filter bar: Search | Supplier | Category | Type, then From (under Search) | To (under Supplier) */
.filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; }
.filters .field { margin: 0; }
.filters .date-from { grid-column: 1; }
.filters .date-to { grid-column: 2; }
@media (max-width: 860px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters .wide { grid-column: 1 / -1; }
  .filters .date-from { grid-column: 1; }
  .filters .date-to { grid-column: 2; }
}

/* auto-crop controls under the receipt preview */
.crop-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.crop-bar svg { width: 14px; height: 14px; vertical-align: -2px; }

/* Multi-user */
.nav-label { margin: 14px 10px 4px; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kind-pick { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.kind-pick legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.kind { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--border);
        border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 400; }
.kind:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.kind input { width: 18px; height: 18px; flex: none; }
.kind small { display: block; color: var(--muted); font-size: 12px; }
.card-row { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-row:last-child { border-bottom: 0; }
.card-row .top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-bottom: 8px; }
.todo-list { list-style: none; margin: 10px 0 0; padding: 0; }
.todo-list li { padding: 7px 0; border-top: 1px solid var(--border); }
.todo-list a { display: flex; justify-content: space-between; gap: 10px; color: inherit; }
.scroll-x { overflow-x: auto; }

/* ---------- expenses: gallery / list of slips, quick look, print bar */
.view-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.view-switch button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted); padding: 7px 12px; font: inherit; font-size: 13.5px; cursor: pointer; }
.view-switch button + button { border-left: 1px solid var(--border); }
.view-switch button svg { width: 16px; height: 16px; }
.view-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.view-switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.docs-bar { margin-bottom: 14px; }
.docs-search { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.docs-search input[type=search] { flex: 1; min-width: 0; }
.docs-chips { align-items: center; margin-bottom: 12px; }
.docs-chips .grow { flex: 1; }
.docs-filters { margin-bottom: 14px; }
.docs-filters .filters { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 12px; }
.docs-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
.docs-tools .check { font-weight: 500; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; text-align: center; }
.doc-month { margin-bottom: 26px; }
.doc-month > header { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.doc-month > header h2 { margin: 0; font-size: 17px; }
.doc-month > header .check { margin-left: auto; }
.doc-month > header .check input { width: 16px; height: 16px; }

.doc-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.doc-card.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow); }
.doc-img { display: block; width: 100%; padding: 0; border: 0; background: var(--surface-2); cursor: zoom-in; overflow: hidden; }
.doc-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.doc-ph { display: grid; place-items: center; height: 100%; font-size: 12px; font-weight: 700; color: var(--muted); }
.doc-img:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.doc-title { font-weight: 600; color: var(--text); display: block; overflow-wrap: anywhere; }
.doc-facts { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.doc-desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sel-wrap { position: absolute; top: 8px; left: 8px; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; }
.sel-wrap input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.print-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.print-btn:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.print-btn svg { width: 17px; height: 17px; }
.print-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* gallery: big picture cards */
.view-gallery .doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.view-gallery .doc-card { display: flex; flex-direction: column; overflow: hidden; }
.view-gallery .doc-img { height: 210px; }
.view-gallery .doc-body { padding: 11px 13px 4px; flex: 1; }
.view-gallery .doc-end { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 13px 12px; flex-wrap: wrap; }
.view-gallery .doc-card > span.no-print { position: absolute; top: 8px; right: 8px; z-index: 2; }
.view-gallery .doc-amt { font-size: 16px; }
/* list: one compact row per slip */
.view-list .doc-cards { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.view-list .doc-card { display: grid; grid-template-columns: 30px 56px minmax(0, 1fr) auto 32px; align-items: center; gap: 12px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.view-list .doc-card:last-child { border-bottom: 0; }
.view-list .sel-wrap { position: static; width: 24px; height: 24px; border: 0; background: transparent; }
.view-list .doc-img { width: 56px; height: 70px; border-radius: 6px; border: 1px solid var(--border); }
.view-list .doc-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.view-list .doc-desc { -webkit-line-clamp: 1; }

/* print bar and quick look */
.printbar { position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-top: 8px;
            background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.printbar .grow { flex: 1; }
.printbar select { width: auto; padding: 6px 8px; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 12, 15, .92); display: grid; grid-template-rows: auto 1fr; color: #e8ecef; }
.lightbox.hidden { display: none !important; }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
.lb-top strong { display: block; font-size: 16px; }
.lb-top .muted { color: #9aa7b2; font-size: 13px; }
.lb-actions { display: flex; gap: 8px; align-items: center; }
.lb-stage { grid-row: 2; display: grid; place-items: center; padding: 0 64px 20px; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; }
.lb-stage iframe { width: min(900px, 100%); height: 100%; border: 0; border-radius: 6px; background: #fff; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lb-nav:hover { background: rgba(255, 255, 255, .24); }
.lb-nav svg { width: 22px; height: 22px; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
@media (max-width: 640px) {
  .docs-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .docs-chips::-webkit-scrollbar { display: none; }
  .docs-chips a { flex: none; white-space: nowrap; }
  .docs-chips .grow { display: none; }
  .docs-search .btn.primary { display: none; }
  .view-gallery .doc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .view-gallery .doc-img { height: 150px; }
  .view-gallery .doc-body { padding: 9px 10px 2px; }
  .view-gallery .doc-end { padding: 4px 10px 10px; }
  .view-list .doc-card { grid-template-columns: 26px 48px minmax(0, 1fr) 32px; }
  .view-list .doc-end { grid-column: 3 / 4; flex-direction: row; justify-content: space-between; width: 100%; }
  .view-list .doc-card > span.no-print { grid-column: 4; grid-row: 1; }
  .lb-stage { padding: 0 8px 70px; }
  .lb-nav { top: auto; bottom: 10px; transform: none; width: 48%; height: 44px; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .printbar { bottom: 62px; }
}
@media print { .doc-card .print-btn, .printbar, .lightbox { display: none !important; } }

/* ---------- inbox: what is waiting, and why */
.inbox-status { margin-bottom: 18px; }
.inbox-status header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.inbox-status h2 { margin: 0; font-size: 18px; }
.count-pill { background: var(--text); color: var(--surface); border-radius: 999px; padding: 1px 10px; font-size: 13px; font-weight: 700; }
.inbox-status > .muted { margin: 0 0 12px; }
.status-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); gap: 2px; margin-bottom: 12px; }
.status-bar .seg { min-width: 8px; }
.s-reading { --sc: var(--muted); } .s-waiting { --sc: var(--warn); } .s-suggested { --sc: var(--info); }
.s-not_on_statement { --sc: var(--violet); } .s-failed { --sc: var(--bad); }
.status-bar .seg { background: var(--sc); }
.status-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border);
        border-left: 4px solid var(--sc); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); }
.tile:hover { text-decoration: none; border-color: var(--sc); }
.tile.on { background: var(--surface-2); outline: 2px solid var(--sc); outline-offset: -1px; }
.tile.zero { opacity: .55; }
.tile .n { font-size: 24px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .lbl { font-weight: 600; font-size: 14px; }
.tile .hint { font-size: 12.5px; color: var(--muted); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.inbox-zero { display: flex; align-items: center; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.inbox-zero .tick { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); flex: none; }
.inbox-zero .tick svg { width: 22px; height: 22px; }
.inbox-zero div { display: flex; flex-direction: column; }
.filter-note { margin: 0 0 8px; }
@media (max-width: 640px) { .status-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile .hint { display: none; } .printbar .btn { flex: 1; } }

/* ---------- all checkboxes and radios in the Kudu green */
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent-text); }

/* ---------- people and cards: rows, status, side panel */
.warn-text { color: var(--warn); font-weight: 600; }
.people-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.person-row { display: grid; grid-template-columns: 44px minmax(190px, 1.3fr) minmax(190px, 1fr) minmax(150px, 1.2fr) minmax(120px, .9fr) 20px;
              align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--border); cursor: pointer; }
.person-row:last-child { border-bottom: 0; }
.person-row:hover { background: var(--surface-2); }
.person-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.person-row.is-off .who, .person-row.is-off .avatar { opacity: .55; }
.person-row .who { display: flex; flex-direction: column; min-width: 0; }
.person-row .who strong { font-size: 15px; }
.person-row .who .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-row .access { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.person-row .holds, .person-row .vehs { display: flex; flex-wrap: wrap; gap: 6px; }
.chev { color: var(--muted); display: grid; place-items: center; }
.chev svg { width: 16px; height: 16px; }
.avatar { --h: #3b82f6; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; font-weight: 700; font-size: 14px;
          letter-spacing: .02em; background: color-mix(in srgb, var(--h) 20%, var(--surface)); color: color-mix(in srgb, var(--h) 72%, var(--text)); }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }
.av0 { --h: #3b82f6; } .av1 { --h: #16a34a; } .av2 { --h: #d97706; } .av3 { --h: #db2777; } .av4 { --h: #7c3aed; } .av5 { --h: #0891b2; }
.role { display: inline-block; padding: 1px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--grey-soft); color: var(--muted); }
.role.r-admin { background: var(--accent-soft); color: var(--accent-text); }
.role.r-accountant { background: var(--info-soft); color: var(--info); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.s-active { color: var(--ok); } .status.s-invited { color: var(--warn); } .status.s-disabled { color: var(--muted); opacity: .8; }
.cchip { display: inline-flex; align-items: baseline; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
         background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.cchip small { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cchip.garage { background: var(--accent-soft); border-color: transparent; }
.cchip.garage small { color: var(--accent-text); }
.cchip.off { opacity: .5; text-decoration: line-through; }
.vchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 6px; font-size: 13px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); }
.vchip svg { width: 15px; height: 15px; color: var(--muted); }

.panel-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(8, 12, 15, .5); }
.panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 90; width: min(540px, 100%); background: var(--surface); border-left: 1px solid var(--border);
         box-shadow: -12px 0 40px rgba(0, 0, 0, .22); display: flex; flex-direction: column; }
.panel[hidden], .panel-backdrop[hidden] { display: none; }
.panel-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0 0 4px; font-size: 19px; }
.panel-head .grow { flex: 1; min-width: 0; }
.panel-body { padding: 18px 20px 40px; overflow-y: auto; flex: 1; }
.panel-body h3 { margin: 24px 0 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.panel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.panel-stats > div { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.panel-stats .n { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.panel-stats .l { font-size: 12px; color: var(--muted); }
.card-edit { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; background: var(--surface); }
.card-edit-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.card-edit-head .check { margin-left: auto; }
.card-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.panel-form .field { margin-bottom: 12px; }
@media (max-width: 1000px) {
  .person-row { grid-template-columns: 44px minmax(0, 1fr) auto 20px; row-gap: 8px; }
  .person-row .holds, .person-row .vehs { grid-column: 2 / 4; }
  .person-row .chev { grid-column: 4; grid-row: 1; }
}
@media (max-width: 640px) {
  .person-row { grid-template-columns: 44px minmax(0, 1fr) 20px; padding: 12px 14px; }
  .person-row .access { grid-column: 2 / 3; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
  .person-row .holds, .person-row .vehs { grid-column: 2 / 4; }
  .person-row .chev { grid-column: 3; grid-row: 1; }
  .panel { width: 100%; }
  .card-edit-grid { grid-template-columns: 1fr; }
  .panel-stats { grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------- my area: statement cards, grouped lines, sign-off footer */
.area-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 330px)); gap: 14px; margin-bottom: 18px; }
.area-tiles .card + .card { margin-top: 0; }
.tile-ok .value { color: var(--ok); }
.tile-warn .value { color: var(--warn); }
.stmt { margin-bottom: 22px; }
.stmt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.stmt-head h2 { margin: 0; font-size: 18px; }
.stmt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 14px; }
.stmt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stmt-card-head .who { display: flex; align-items: center; gap: 10px; }
.stmt-card-head .cchip { font-size: 15px; text-decoration: none; }
.stmt-card-head .tot { display: flex; flex-direction: column; align-items: flex-end; }
.stmt-card-head .tot strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.meter-row { display: flex; align-items: center; gap: 12px; margin: 12px 0 6px; }
.meter { flex: 1; height: 8px; border-radius: 999px; background: var(--grey-soft); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.meter-label { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.line-group h3 { display: flex; align-items: center; gap: 8px; margin: 16px 0 6px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); }
.count { display: inline-block; min-width: 20px; padding: 0 7px; border-radius: 999px; background: var(--grey-soft); color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 9px 0; border-top: 1px solid var(--border); }
.lines li:first-child { border-top: 0; }
.line-main { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 10px; color: var(--text); min-width: 0; }
.line-main:hover { text-decoration: none; }
.line-main:hover .desc { text-decoration: underline; }
.line-main .date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.line-main .desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.line-main .hintline { grid-column: 2; font-size: 12.5px; color: var(--info); }
.lines .amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.attach-form { margin: 0; }
.attach-form .btn svg { width: 15px; height: 15px; }
.more { display: inline-block; margin-top: 6px; }
.done-group { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.done-group summary { cursor: pointer; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; list-style: none; }
.done-group summary::-webkit-details-marker { display: none; }
.done-group summary::before { content: "\25B8"; color: var(--muted); font-size: 12px; transition: transform .15s; }
.done-group[open] summary::before { transform: rotate(90deg); }
.lines.done li { grid-template-columns: minmax(0, 1fr) auto minmax(140px, auto); }
.lines.done .desc { font-weight: 400; color: var(--muted); }
.done-state { font-size: 12.5px; text-align: right; }
.done-state a { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); }
.done-state svg { width: 14px; height: 14px; }
.sign-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.sign-footer .msg { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.warn-dot, .ok-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.warn-dot { background: var(--warn); } .ok-dot { background: var(--ok); }
.sign-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
@media (max-width: 640px) {
  .lines li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; }
  .lines li > form, .lines li > .btn { grid-column: 1 / 3; }
  .lines li > form .btn, .lines li > .btn { width: 100%; }
  .lines.done li { grid-template-columns: minmax(0, 1fr) auto; }
  .lines.done .done-state { grid-column: 1 / 3; text-align: left; }
  .sign-footer { flex-direction: column; align-items: stretch; }
  .sign-actions .btn { flex: 1; }
}

/* ---------- my area: compact document lists (waiting, claims) */
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 32px; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); cursor: pointer; }
.doc-list.no-thumb li { grid-template-columns: minmax(0, 1fr) auto 32px; }
.doc-list li:first-child { border-top: 0; }
.doc-list li:hover { background: var(--surface-2); }
.doc-list .dl-main { display: flex; flex-direction: column; min-width: 0; }
.doc-list .dl-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-list .dl-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.doc-list .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-list .pill { font-size: 11.5px; white-space: nowrap; }
.doc-list .dl-empty { display: block; padding: 16px; cursor: default; }
.doc-list .dl-empty:hover { background: transparent; }
.more-rows { border-top: 1px solid var(--border); }
.more-rows summary { cursor: pointer; padding: 10px 16px; font-size: 13.5px; font-weight: 600; color: var(--accent-text); }

/* ---------- round 1: claims rows, avatars, vehicles list */
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.who-chip { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.meter { width: 100%; height: 8px; border-radius: 999px; background: var(--grey-soft); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.doc-list .dl-main .sub { display: block; }
.doc-list .dl-thumb { display: block; line-height: 0; }
.claim-list li { grid-template-columns: 44px minmax(0, 1fr) auto 32px; cursor: default; }
.claim-list li:hover { background: transparent; }
.claim-actions { grid-column: 2 / -1; }
.claim-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.claim-form input[type=text] { flex: 1; min-width: 180px; }
.veh-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.veh-row { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(170px, 1.2fr) minmax(120px, .8fr) minmax(120px, .8fr) 20px; align-items: center; gap: 14px;
           padding: 12px 18px; border-bottom: 1px solid var(--border); color: var(--text); cursor: pointer; }
.veh-row:last-child { border-bottom: 0; }
.veh-row:hover { background: var(--surface-2); text-decoration: none; }
.veh-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.veh-row .reg { display: flex; flex-direction: column; min-width: 0; }
.veh-row .reg strong { font-size: 15px; letter-spacing: .02em; }
.veh-row .drv { display: flex; align-items: center; gap: 8px; min-width: 0; }
.veh-row .drv span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.veh-row.is-off { opacity: .6; }
.lic { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.lic::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lic.ok { color: var(--ok); } .lic.soon { color: var(--warn); } .lic.expired { color: var(--bad); }
.fuelchip { display: inline-block; padding: 1px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--grey-soft); color: var(--muted); }
@media (max-width: 900px) { .veh-row { grid-template-columns: minmax(0, 1fr) auto 20px; row-gap: 8px; } .veh-row .drv, .veh-row .meta { grid-column: 1 / 3; } .veh-row .chev { grid-column: 3; grid-row: 1; } }

/* ---------- round 2: statement tidy-ups, collapsible secondary cards */
.cchip.sm { padding: 0 7px; font-size: 12px; vertical-align: middle; }
details.more-card { padding: 0; }
details.more-card > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; padding: 14px 18px; font-weight: 600; font-size: 16px; }
details.more-card > summary::-webkit-details-marker { display: none; }
details.more-card > summary .muted { font-weight: 400; margin-left: auto; }
details.more-card > summary::before { content: "\25B8"; color: var(--muted); font-size: 12px; transition: transform .15s; order: -1; }
details.more-card[open] > summary::before { transform: rotate(90deg); }
details.more-card[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 14px; }
details.more-card > :not(summary) { margin-left: 18px; margin-right: 18px; }
details.more-card > form:last-child, details.more-card > :last-child:not(summary) { margin-bottom: 16px; }

/* ---------- round 3: activity feed, settings rows */
.activity { list-style: none; margin: 0; padding: 0; }
.act-day { padding: 8px 18px; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700;
           text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.act-day:first-child { border-top: 0; }
.act { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.act:last-child { border-bottom: 0; }
.act .avatar.sm { margin-top: 1px; }
.avatar.sys { background: var(--grey-soft); color: var(--muted); }
.avatar.sys svg { width: 13px; height: 13px; }
.act-main { min-width: 0; line-height: 1.45; }
.act-detail { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.act-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto 64px; gap: 8px; align-items: center; margin-bottom: 8px; }
.cat-row input[type=text] { width: 100%; }
.cat-row .save-fallback[hidden] { display: none; }
.cat-row.is-off input[type=text] { opacity: .55; }
.saved-note { font-size: 12px; color: var(--ok); min-width: 52px; }
@media (max-width: 640px) { .cat-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } .saved-note { display: none; } }
