/* Anietje boekhouding — stijl "pastel consumer": rustige grond, witte kaarten zonder schaduw,
   één groot hoekradius en per sportschool een eigen zachte tint (lichte tegel, donkere inkt). */
:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #f2f8fd;
  --sunk: #f6f7f9;
  --ink: #1b1d1f;
  --ink-2: #3a3d40;
  --muted: #5c6064;
  --line: #e6e6e6;
  --rule: #f0f1f2;
  --line-2: #d6d9dd;
  --accent: #1d5fd6;
  --accent-2: #174fb4;
  --accent-soft: #dcf1ff;
  --accent-ink: #0a3a80;
  --on-accent: #ffffff;
  --positive: #2f7a45;
  --danger: #c41c29;
  --warn: #92400e;
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fff4dc; --pill-warning-ink: #7a3a08;
  --pill-neutral-bg: #eef1f4; --pill-neutral-ink: #3a3d40;
  /* tinten per klant: tegel, inkt, datamarkering (≥ 3:1 op wit) */
  --t0-bg: #dcf1ff; --t0-ink: #0a3a80; --t0-mark: #1d5fd6;
  --t1-bg: #fdedd3; --t1-ink: #6b3a05; --t1-mark: #b45309;
  --t2-bg: #d6f1f3; --t2-ink: #0d4a54; --t2-mark: #2a8798;
  --t3-bg: #fde3ea; --t3-ink: #7d1937; --t3-mark: #c2416b;
  --t4-bg: #e6f0d5; --t4-ink: #3a4d12; --t4-mark: #5f7d1f;
  --radius: 20px;
  --radius-control: 10px;
  --gap: 16px;
  --sidebar: 240px;
  --font: "Manrope", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315;
    --surface: #1a1d20;
    --surface-2: #1f2a38;
    --sunk: #16181b;
    --ink: #eceef0;
    --ink-2: #c9cdd1;
    --muted: #9aa1a8;
    --line: #2a2e33;
    --rule: #23272b;
    --line-2: #3a3f45;
    --accent: #6f9ff5;
    --accent-2: #8db4f8;
    --accent-soft: #1b2c48;
    --accent-ink: #c4d8ff;
    --on-accent: #0b1730;
    --positive: #6fc28a;
    --danger: #ff8a80;
    --warn: #f0b860;
    --pill-positive-bg: #17301f; --pill-positive-ink: #a6e4b8;
    --pill-negative-bg: #3a1a1a; --pill-negative-ink: #ffb3ab;
    --pill-warning-bg: #352812; --pill-warning-ink: #f6cd85;
    --pill-neutral-bg: #262a2f; --pill-neutral-ink: #c9cdd1;
    --t0-bg: #1b2c48; --t0-ink: #c4d8ff; --t0-mark: #6f9ff5;
    --t1-bg: #3a2810; --t1-ink: #f6cf98; --t1-mark: #e39a45;
    --t2-bg: #123236; --t2-ink: #a9e3e8; --t2-mark: #4fb3c2;
    --t3-bg: #3a1825; --t3-ink: #f7b8cb; --t3-mark: #e2789a;
    --t4-bg: #25300f; --t4-ink: #cfe3a3; --t4-mark: #98bb4f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font); font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin: 0; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono, .amount, .num, .money { font-variant-numeric: tabular-nums; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.boot { padding: 40vh 20px 0; text-align: center; color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- merk ---------- */
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.brand-text small { font-size: 12px; color: var(--muted); }
.logo-mark { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: var(--on-accent); flex: none; }
.logo-mark .ico { width: 28px; height: 28px; stroke-width: 1.8; }
.logo-mark.small { width: 34px; height: 34px; border-radius: 10px; }
.logo-mark.small .ico { width: 20px; height: 20px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 24px 12px 16px; background: var(--bg);
}
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a, .me-link {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500;
}
.nav a .ico { color: var(--muted); }
.nav a:hover, .me-link:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.nav a.active, .me-link.active { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); font-weight: 600; }
.nav a.active .ico { color: var(--ink); }
.me { display: flex; align-items: center; gap: 4px; padding-top: 12px; }
.me-link { flex: 1; min-width: 0; padding: 6px 8px; }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me-text strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--muted); font-size: 12px; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 600; flex: none; }
main { padding: 32px 40px 96px 24px; max-width: 1200px; width: 100%; min-width: 0; outline: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin: 6px 0 0; max-width: 62ch; font-size: 15px; color: var(--ink-2); }
.page-head p.muted { color: var(--muted); }
.page-head a:not(.btn) { text-decoration: none; font-size: 14px; }
.finding { color: var(--ink-2); }
.finding strong { color: var(--ink); font-weight: 600; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); margin-bottom: var(--gap); align-items: start; }
.grid-2.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.grid-2 > .card, .stack > .card { margin-bottom: 0; }

/* ---------- kaarten ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 24px; margin-bottom: var(--gap); }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 560px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head.padded { padding: 20px 24px 0; }
.card-head .link { font-size: 14px; text-decoration: none; }
.empty { color: var(--muted); padding: 28px 20px; text-align: center; margin: 0; }
.hint { color: var(--muted); font-size: 14px; margin: 10px 0 0; }

/* jaarkaart: cijfers als één rij, gescheiden door dunne lijnen */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 24px; }
.figure { display: flex; flex-direction: column; gap: 4px; padding: 0 20px; border-left: 1px solid var(--rule); min-width: 0; }
.figure:first-child { padding-left: 0; border-left: 0; }
.figure-label { color: var(--muted); font-size: 14px; }
.figure-value { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.figure-value .cents { font-size: .6em; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.figure-value.zero { color: var(--muted); }
.figure-sub { font-size: 13px; color: var(--muted); }
.figure-sub.late { color: var(--danger); font-weight: 600; }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart .grid { stroke: var(--rule); }
.chart .axis { stroke: var(--line); }
.chart .cost-tick { stroke: var(--ink); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.legend .chip { font-size: 13px; }

/* ---------- klanttinten ---------- */
.t0 { --tint-bg: var(--t0-bg); --tint-ink: var(--t0-ink); --tint-mark: var(--t0-mark); }
.t1 { --tint-bg: var(--t1-bg); --tint-ink: var(--t1-ink); --tint-mark: var(--t1-mark); }
.t2 { --tint-bg: var(--t2-bg); --tint-ink: var(--t2-ink); --tint-mark: var(--t2-mark); }
.t3 { --tint-bg: var(--t3-bg); --tint-ink: var(--t3-ink); --tint-mark: var(--t3-mark); }
.t4 { --tint-bg: var(--t4-bg); --tint-ink: var(--t4-ink); --tint-mark: var(--t4-mark); }
.mono-tile {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--tint-bg, var(--pill-neutral-bg)); color: var(--tint-ink, var(--pill-neutral-ink));
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
}
.mono-tile.big { width: 52px; height: 52px; border-radius: 16px; font-size: 17px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; background: var(--tint-bg, var(--pill-neutral-bg)); color: var(--tint-ink, var(--pill-neutral-ink)); font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip i { width: 8px; height: 8px; border-radius: 3px; background: var(--tint-mark, var(--muted)); }

.kor-num { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-bottom: 14px; line-height: 1.15; }
.kor-num .muted { font-size: 16px; font-weight: 500; letter-spacing: 0; }
.kor p { margin: 14px 0 0; font-size: 14px; color: var(--ink-2); }
.bar { position: relative; height: 12px; background: var(--sunk); border-radius: 5px; overflow: hidden; display: flex; }
.bar > span { display: block; height: 100%; background: var(--tint-mark, var(--accent)); }
.bar.warn > span { background: var(--warn); }

/* ---------- lijsten en tabellen ---------- */
.list { list-style: none; margin: 0 -24px -24px; padding: 0; }
.card.flush .list { margin: 8px 0 0; }
.list li + li { border-top: 1px solid var(--rule); }
.list a, .li-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 24px; color: inherit; text-decoration: none; min-height: 68px; }
.list a:hover { background: var(--sunk); }
.list a > .who, .li-row > .who { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.list .who > span:last-child { min-width: 0; }
.list .who > span:last-child, .list a > span:first-child:not(.who), .li-row > span:first-child:not(.who) { display: flex; flex-direction: column; min-width: 0; }
.list strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.list small { color: var(--muted); font-size: 14px; }
.list .right { display: flex; align-items: center; gap: 12px; flex: none; }
.grid-2 .list .right { flex-direction: column; align-items: flex-end; gap: 4px; }
.list .who strong, .list .who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 13px; font-weight: 500; color: var(--muted); padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--ink); border-bottom: 0; }
.table.compact th, .table.compact td { padding: 9px 10px; }
.table.compact th:first-child, .table.compact td:first-child { padding-left: 0; }
.table.compact th:last-child, .table.compact td:last-child { padding-right: 0; }
.clickable { cursor: pointer; }
.clickable:hover td { background: var(--sunk); }
.statement td { padding: 10px 0; }
.statement .indent { padding-left: 20px; color: var(--ink-2); }
.statement .subtotal td { font-weight: 600; border-top: 1px solid var(--line); }
.statement .total td { font-weight: 600; font-size: 18px; border-top: 1px solid var(--ink); }

.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); white-space: nowrap; line-height: 1.4; }
.pill.open { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.pill.paid { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill.late { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill.draft { background: var(--accent-soft); color: var(--accent-ink); }
.pill.credit { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }
.pill.sent { background: transparent; color: var(--muted); padding-inline: 2px; font-weight: 500; }
.pill.unsent { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.pills { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.tag { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 8px; background: var(--tint-bg, var(--sunk)); color: var(--tint-ink, var(--ink-2)); }
.late-text { color: var(--danger); font-weight: 600; }

.tabs { display: flex; gap: 6px; margin-bottom: var(--gap); overflow-x: auto; scrollbar-width: none; padding: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 8px 14px; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; border-radius: 99px; text-decoration: none; white-space: nowrap; display: flex; gap: 8px; align-items: center; min-height: 38px; }
.tab:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.tab span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tab.active { background: var(--ink); color: var(--bg); }
.tab.active span { color: color-mix(in srgb, var(--bg) 70%, transparent); }

.filter-row { margin-bottom: 14px; }

/* ---------- detail ---------- */
.detail-top { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 22px; align-items: flex-start; }
.detail-top .who { display: flex; gap: 14px; align-items: center; min-width: 0; }
.detail-top .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.big-amount { font-size: 34px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 0 0 22px; padding: 16px; background: var(--sunk); border-radius: 14px; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.actions { display: flex; flex-direction: column; gap: 8px; }
.actions .btn { justify-content: flex-start; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; display: flex; flex-direction: column; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 20px; bottom: 2px; width: 1px; background: var(--line); }
.timeline small { color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--gap); }
.customer-card { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 10px; margin: 0; transition: background-color .15s; }
.customer-card:hover { background: color-mix(in srgb, var(--surface) 92%, var(--ink)); }
.cc-head { display: flex; gap: 14px; align-items: center; }
.cc-head > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.cc-head strong { font-size: 17px; font-weight: 600; }
.rates { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0; }
.cc-foot strong, .cc-foot .late-text { white-space: nowrap; }
.cc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 14px; padding-top: 14px; margin-top: auto; color: var(--ink-2); border-top: 1px solid var(--rule); }

/* ---------- formulieren ---------- */
button, .btn {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: var(--radius-control); padding: 8px 14px;
  border: 0; background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px; line-height: 1.3; min-height: 40px;
  transition: background-color .12s, transform .08s;
}
button:hover, .btn:hover { background: color-mix(in srgb, var(--ink) 11%, transparent); }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--accent); color: var(--on-accent); }
button.primary:hover, .btn.primary:hover { background: var(--accent-2); }
.btn.danger, button.danger { color: var(--danger); }
.danger-solid { background: var(--danger); color: #fff; }
.btn.small, button.small { min-height: 34px; padding: 6px 11px; font-size: 13px; }
.btn .ico { width: 17px; height: 17px; }
button.big { min-height: 48px; font-size: 15px; justify-content: center; }
button.link, .link { background: none; padding: 4px 0; color: var(--accent); min-height: 0; font-weight: 600; }
button.link:hover, .link:hover { background: none; text-decoration: underline; }
button:disabled { opacity: .55; cursor: default; }
.icon-btn { background: none; min-height: 34px; min-width: 34px; padding: 6px; color: var(--muted); border-radius: 10px; justify-content: center; display: inline-flex; }
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); color: var(--ink); }

label, .label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
label + label { margin-top: 14px; }
.form-grid label + label { margin-top: 0; }
input, select, textarea {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius-control); padding: 9px 12px; min-width: 0; width: 100%; min-height: 40px;
}
input[readonly] { background: var(--sunk); color: var(--muted); }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent); outline-offset: 0; border-color: var(--accent); }
.year-select { width: auto; min-height: 40px; padding: 7px 30px 7px 12px; font-weight: 600; border: 0; background-color: color-mix(in srgb, var(--ink) 7%, transparent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.span-all { grid-column: 1 / -1; }
.span-2 { grid-column: span 2; }
.filter-row select { width: auto; }

.helper { margin-bottom: 16px; padding: 16px; border-radius: 14px; background: var(--surface-2); }
.helper .row { margin-top: 12px; }
.days { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.day { flex-direction: row; margin: 0 !important; position: relative; }
.day input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; min-height: 0; }
.day span { display: inline-grid; place-items: center; width: 44px; height: 40px; border-radius: var(--radius-control); background: var(--surface); cursor: pointer; font-weight: 600; color: var(--ink-2); }
.day input:checked + span { background: var(--accent); color: var(--on-accent); }
.day input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.lines-wrap { overflow-x: auto; margin: 0 -8px; }
.lines { width: 100%; min-width: 620px; border-collapse: collapse; }
.lines th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 500; padding: 6px 8px; }
.lines td { padding: 4px 4px; }
.lines input { padding: 7px 10px; font-size: 14px; min-height: 38px; }
.lines .c-date { width: 156px; }
.lines .c-qty { width: 82px; }
.lines .c-price { width: 104px; }
.lines .c-amt { width: 104px; text-align: right; font-variant-numeric: tabular-nums; padding-right: 8px; font-weight: 600; }
.lines .c-del { width: 40px; }
.lines tfoot td { font-weight: 600; font-size: 17px; border-top: 1px solid var(--ink); padding: 12px 8px; text-align: left; }
.lines tfoot td.num { text-align: right; font-variant-numeric: tabular-nums; }

.rate-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rate-row { display: grid; grid-template-columns: 1fr 130px 36px; gap: 8px; align-items: center; }

.upload { margin-top: 14px; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-size: 15px; color: var(--ink); }
label.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
.file-btn { flex-direction: row; cursor: pointer; }

.sticky-actions {
  position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 14px 0; margin-top: 8px; background: var(--bg);
}

/* ---------- inloggen ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: 24px; padding: 36px 32px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-size: 26px; margin-top: 8px; }
.auth-card p { margin: 0; font-size: 15px; }
.auth-card label + label { margin-top: 0; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-text strong { font-size: 18px; }
.error-text { color: var(--danger); font-size: 14px; }

/* ---------- dialoog en melding ---------- */
dialog { border: 0; border-radius: 22px; padding: 0; background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 24px)); box-shadow: 0 24px 64px rgb(0 0 0 / .22); max-height: calc(100vh - 24px); }
dialog.wide { width: min(980px, calc(100vw - 24px)); }
dialog::backdrop { background: rgb(17 19 21 / .45); }
.dlg-body { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.dlg-body h2 { font-size: 20px; }
.dlg-body label + label { margin-top: 0; }
.summary { display: flex; justify-content: space-between; padding: 14px 16px; border-radius: 14px; background: var(--sunk); }
.summary strong { font-variant-numeric: tabular-nums; }
.pdf-frame { width: 100%; height: 75vh; border: 0; border-radius: 12px; background: #fff; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); z-index: 50;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
  box-shadow: 0 10px 30px rgb(0 0 0 / .18);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--danger); color: #fff; }

/* ---------- foto -> concept ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; margin-bottom: var(--gap); border-radius: 16px; background: var(--pill-warning-bg); color: var(--ink); }
.notice > .ico { color: var(--pill-warning-ink); flex: none; margin-top: 2px; }
.notice > div { flex: 1; min-width: 0; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice details { margin-top: 10px; }
.notice summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--pill-warning-ink); }
.notice pre { margin: 8px 0 0; padding: 12px 14px; background: color-mix(in srgb, var(--surface) 70%, transparent); border-radius: 10px; font: 14px/1.6 var(--font); white-space: pre-wrap; max-height: 320px; overflow: auto; }
.notice .icon-btn { font-size: 20px; line-height: 1; }
label.btn { cursor: pointer; flex-direction: row; gap: 7px; font-size: 14px; color: var(--ink); font-weight: 600; }
.scan-wait { text-align: center; padding-block: 32px; }
.spinner { width: 36px; height: 36px; margin: 0 auto 14px; border-radius: 50%; border: 3px solid var(--rule); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } * { transition: none !important; } }

.card.flush .inv-list { margin: 0; }
.table small.sub { display: block; color: var(--muted); font-size: 13px; }

/* ---------- smaller scherm ---------- */
@media (max-width: 1000px) {
  .grid-2, .grid-2.wide-left { grid-template-columns: minmax(0, 1fr); }
  .figures { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .figure:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 10; flex-direction: row;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 96%, transparent);
    border-top: 1px solid var(--line);
  }
  .brand, .me { display: none; }
  .nav { flex-direction: row; justify-content: space-around; gap: 0; }
  .nav a { flex-direction: column; gap: 3px; font-size: 11px; font-weight: 500; padding: 6px 2px; flex: 1; align-items: center; min-height: 52px; }
  .nav a .ico { width: 22px; height: 22px; }
  .nav a.active { background: none; color: var(--accent); font-weight: 600; }
  .nav a.active .ico { color: var(--accent); }
  main { padding: 20px 16px 112px; }
  h1 { font-size: 24px; }
  .card { padding: 18px; border-radius: 18px; }
  .card-head.padded { padding: 16px 18px 0; }
  .figure-value { font-size: 24px; }
  .figure { padding: 0 14px; }
  .big-amount { font-size: 28px; }
  .hide-sm { display: none; }
  .table th, .table td { padding: 10px 12px; }
  .span-2 { grid-column: 1 / -1; }
  .sticky-actions { bottom: 66px; }
  #toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .page-head { align-items: flex-start; gap: 14px; margin-bottom: 18px; }
  .page-head > .row { width: 100%; }
  .page-head > .row > .btn.primary { margin-left: auto; }
  .list { margin: 0 -18px -18px; }
  .list a, .li-row { padding: 12px 16px; gap: 10px; min-height: 64px; }
  .list a > .who { gap: 12px; }
  .mono-tile { width: 36px; height: 36px; border-radius: 11px; font-size: 13px; }
  .list .right { flex-direction: column; align-items: flex-end; gap: 4px; }
  .list .pills { flex-direction: column; align-items: flex-end; gap: 3px; }
  .detail-top { flex-direction: column; }
  .detail-top .right { align-items: flex-start; text-align: left; }
  .facts { grid-template-columns: 1fr 1fr; }

  /* regels als kaartjes op de telefoon */
  .lines-wrap { margin: 0; overflow: visible; }
  .lines, .lines tbody, .lines tfoot { display: block; width: 100%; min-width: 0; }
  .lines thead { display: none; }
  .lines tbody tr { display: grid; grid-template-columns: 1fr 52px 72px 28px; gap: 6px; padding: 12px 0; border-top: 1px solid var(--rule); }
  .lines tbody tr:has(.empty) { display: block; }
  .lines tbody td[class] { padding: 0; width: auto; min-width: 0; }
  .lines tbody input { width: 100%; min-width: 0; padding: 7px 8px; }
  .lines .c-desc { grid-column: 1 / 3; grid-row: 1; }
  .lines .c-amt { grid-column: 3; grid-row: 1; align-self: center; padding-right: 0; }
  .lines .c-del { grid-column: 4; grid-row: 1; align-self: center; }
  .lines .c-date { grid-column: 1; grid-row: 2; }
  .lines .c-qty { grid-column: 2; grid-row: 2; }
  .lines .c-price { grid-column: 3 / 5; grid-row: 2; }
  .lines tfoot tr { display: flex; justify-content: space-between; border-top: 1px solid var(--ink); }
  .lines tfoot td { border-top: 0; padding-inline: 0; }
  .lines tfoot td:empty { display: none; }
  .table.compact th, .table.compact td { padding: 8px 6px; font-size: 14px; }
}
@media (max-width: 420px) {
  .nav a span { font-size: 10px; }
  .figure-value { font-size: 21px; }
}
