/* BNI Horizon debetnota's – huisstijl: BNI-rood, grijs en wit. Zijnavigatie links, werkvlak rechts; op gsm een balk bovenaan. */
/* Montserrat (SIL Open Font License, zie fonts/OFL.txt) – lokaal geserveerd, geen Google Fonts. */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/Montserrat-Regular.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/Montserrat-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/Montserrat-Bold.woff2") format("woff2"); }
:root {
  --bg: #F5F5F6; --surface: #FFFFFF; --sunk: #EDEDEF; --line: #DEDEE2;
  --fg: #1C1C1F; --muted: #5E5E66; --accent: #CC1728; --accent-soft: #FBE6E8; --on-accent: #FFFFFF;
  --info: #2F5E96; --info-soft: #E4ECF6;
  --sub: #945F00; --sub-soft: #FBEFD6;
  --ok: #1E7A4C; --ok-soft: #DDF1E6; --bad: #B3261E; --bad-soft: #F8E0DE;
  --s-paid: #3F6FA6; --s-open: #CC1728;
  --logo: url("logo-light.png");
  --f-display: "Montserrat", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Open Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
  --r: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113; --surface: #1A1A1D; --sunk: #232327; --line: #303036;
    --fg: #ECECEF; --muted: #A0A0A8; --accent: #EE4A57; --accent-soft: #3A1519; --on-accent: #FFFFFF;
    --info: #8DB4E6; --info-soft: #1C2A3B; --sub: #F0B947; --sub-soft: #382B10;
    --ok: #5CC98E; --ok-soft: #15301F; --bad: #F08A82; --bad-soft: #3A1A18;
    --s-paid: #5A8FD6; --s-open: #EE4A57;
    --logo: url("logo-dark.png");
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 14px; line-height: 1.5; }
a { color: var(--accent); }
.ic { width: 17px; height: 17px; flex: none; }

/* Shell */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; height: 100vh; }
.logo-box { display: block; background: var(--logo) left center / contain no-repeat; height: 66px; margin: 0 6px 18px; }
.nv { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px; color: var(--muted); font-weight: 600; font-family: var(--f-display); font-size: 13.5px; text-decoration: none; }
.nv:hover { background: var(--sunk); color: var(--fg); }
.nv[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.hide-desktop { display: none; }
.nv-sep { height: 1px; background: var(--line); margin: 8px 4px; }
.side .foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 8px 0; display: flex; gap: 10px; align-items: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 12px; flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.foot .u { min-width: 0; flex: 1; font-size: 12.5px; line-height: 1.3; }
.foot .u a { color: var(--fg); font-weight: 600; text-decoration: none; display: block; }
.foot .u span { color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; }
main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Typografie */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
h1 { font-family: var(--f-display); font-weight: 700; font-size: 25px; margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-family: var(--f-display); font-weight: 600; font-size: 15px; margin: 0; }
.sub { color: var(--muted); margin: 2px 0 0; }
.eyebrow { font-family: var(--f-display); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--f-mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }

/* Blokken */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.panel + .panel { margin-top: 16px; }
.panel-h { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-b { padding: 16px; }
.panel-f { padding: 12px 16px; border-top: 1px solid var(--line); }
.grid { display: grid; gap: 16px; align-content: start; min-width: 0; }
.two { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.halves { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.mt { margin-top: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.inline { display: inline; }

/* Knoppen */
.btn { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-weight: 600; font-size: 13px; white-space: nowrap; text-decoration: none; line-height: 1.4; }
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.sm { padding: 4px 9px; font-size: 12px; }

/* Labels */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.warn { background: var(--sub-soft); color: var(--sub); }
.pill.acc { background: var(--accent-soft); color: var(--accent); }

/* Tabellen */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.dim td { color: var(--muted); }
tfoot td { border-top: 1.5px solid var(--fg); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
td.num { font-family: var(--f-mono); font-size: 13px; }
.who b { display: block; font-weight: 600; }
.who span { color: var(--muted); font-size: 12.5px; }
.who a { color: inherit; text-decoration: none; }
.who a:hover b { text-decoration: underline; }
td.c { text-align: center; }

/* KPI's */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .v { font-family: var(--f-display); font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .d { color: var(--muted); font-size: 12.5px; }
.kpi.hot .v { color: var(--accent); }

/* Aanwezigheid */
.dot { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; font-family: var(--f-mono); text-decoration: none; }
.dot.P { background: var(--ok); color: var(--surface); }
.dot.V { background: var(--sub); color: var(--surface); }
.dot.A { border: 1.5px dashed var(--line); color: var(--muted); }
.dot.E { background: var(--sunk); color: var(--muted); }
.dot.X { background: var(--sunk); color: var(--muted); }
.matrix td, .matrix th { padding: 7px 10px; }
.matrix th.c a { color: inherit; text-decoration: none; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot { width: 16px; height: 16px; font-size: 9px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.paid { background: var(--s-paid); }
.sw.open { background: var(--s-open); }
.alert { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.alert:last-child { border-bottom: 0; }
.alert i { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--info); }
.alert i.bad { background: var(--bad); }
.alert i.warn { background: var(--sub); }
.alert a { color: inherit; }

/* Meetings */
.dates { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; align-items: stretch; }
.date { min-width: 74px; padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); text-align: center; flex: none; text-decoration: none; color: var(--fg); }
.date small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.date b { font-family: var(--f-display); font-size: 18px; }
.date.empty b { color: var(--muted); }
.date.cancelled b { text-decoration: line-through; color: var(--muted); }
.date[aria-current="page"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.date.nav { display: grid; place-items: center; min-width: 44px; color: var(--muted); }
.att-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.att-row:last-child { border-bottom: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { cursor: pointer; padding: 5px 10px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--line); }
.seg label:last-of-type { border-right: 0; }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: -2px; }
.seg input.P:checked + label { background: var(--ok-soft); color: var(--ok); }
.seg input.V:checked + label { background: var(--sub-soft); color: var(--sub); }
.seg input.A:checked + label { background: var(--sunk); color: var(--fg); }
.subst { margin-top: 6px; max-width: 240px; padding: 4px 8px; font-size: 13px; }
.sticky-save { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; border-radius: 0 0 var(--r) var(--r); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chip { font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; }
.chip[aria-current="page"] { background: var(--fg); color: var(--surface); border-color: var(--fg); }

/* Formulieren */
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; min-width: 0; }
input, select, textarea { font: inherit; font-size: 14px; font-weight: 400; color: var(--fg); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fgrid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.check input { margin-top: 3px; }
.hint { font-size: 12.5px; color: var(--muted); background: var(--sunk); border-radius: 6px; padding: 10px 12px; }
.note-self { background: var(--accent-soft); border-radius: 6px; padding: 12px; }
.bill-form { display: flex; gap: 6px; align-items: center; flex: 1; max-width: 300px; min-width: 200px; }
details.pay summary { cursor: pointer; list-style: none; }
details.pay summary::-webkit-details-marker { display: none; }
details.pay[open] { position: relative; }
.pay-box { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; width: 260px; box-shadow: 0 10px 30px rgba(0, 0, 0, .16); display: grid; gap: 10px; }

/* Meldingen */
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; font-size: 13.5px; background: var(--info-soft); color: var(--info); }
.flash.success { background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--bad-soft); color: var(--bad); }
.flash.warn { background: var(--sub-soft); color: var(--sub); }
.copy { display: flex; gap: 8px; margin-top: 8px; }
.copy input { font-family: var(--f-mono); font-size: 12px; }

/* Grafiek */
.chart svg { display: block; width: 100%; height: auto; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--f-body); }
.chart .gr { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--muted); stroke-width: 1; }
.chart .paid { fill: var(--s-paid); }
.chart .open { fill: var(--s-open); }
.chart .lbl { fill: var(--fg); font-size: 11.5px; font-weight: 600; font-family: var(--f-mono); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--sunk); opacity: .6; }

/* Aanmeldschermen */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px; width: min(420px, 100%); display: flex; flex-direction: column; gap: 14px; }
.auth .logo-box { height: 80px; margin: 0 0 6px; background-position: center; }
.auth h1 { font-size: 20px; }
.qr-img { width: 180px; height: 180px; background: #fff; border-radius: 6px; padding: 6px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; height: auto; flex-direction: row; overflow-x: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); z-index: 10; align-items: center; }
  .side .logo-box { width: 92px; height: 34px; margin: 0 6px 0 0; flex: none; }
  .side .foot, .nv-sep { display: none; }
  .nv.hide-desktop { display: flex; }
  .nv span { white-space: nowrap; }
  .two, .halves { grid-template-columns: 1fr; }
  .kpis, .kpis.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) { .fgrid { grid-template-columns: 1fr; } .hide-sm { display: none; } }
@media print { .side, .btn { display: none; } .app { display: block; } }
