/* Gebaseerd op "FLOW V.4.0 — Flexible Library for Optimised Wireframes" door Little Miss Robot,
   gelicentieerd onder CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Aangepast: vertaald naar
   CSS-tokens met eigen elevation, radii en componenten. Little Miss Robot onderschrijft dit werk niet. */

/* =========================================================
   Flowstrength — BEHEER (admin) · FLOW v4.0 refined, licht
   Richting: Stripe / Linear: lichtgrijze sidebar met groepen,
   haarlijnkaarten, pill-knoppen, zachte elevation. Geen JS,
   geen inline stijlen (CSP). Werkt vanaf 320 px zonder
   horizontale scroll; tabellen stapelen onder 760 px.
   ====================================================== */

:root {
    --n-1000: #030217; --n-900: #100f2a; --n-800: #1e1f3b; --n-700: #333455; --n-600: #474b69;
    --n-500: #64698b; --n-400: #9498b8; --n-300: #cbcee1; --n-200: #ebebf5; --n-150: #f1f1f8;
    --n-100: #f8f8fc; --n-0: #ffffff;

    --bg: var(--n-0); --bg-subtle: var(--n-100); --surface: var(--n-0);
    --text: var(--n-1000); --text-2: var(--n-600); --text-3: var(--n-500);
    --border: var(--n-200); --border-strong: var(--n-300);

    --accent: #D9480F;
    --accent-ink: #ffffff;
    --accent-hover: color-mix(in srgb, var(--accent) 88%, #000);
    --accent-press: color-mix(in srgb, var(--accent) 78%, #000);
    --accent-soft: color-mix(in srgb, var(--accent) 9%, #fff);
    --accent-soft-2: color-mix(in srgb, var(--accent) 16%, #fff);
    --accent-text: color-mix(in srgb, var(--accent) 82%, #000);

    --success-600: #5f9605; --success-800: #3d5f06; --success-100: #f7fded; --success-200: #d6f3a7;
    --warning-600: #ea580c; --warning-800: #9a3412; --warning-100: #fff4e5; --warning-200: #fed7aa;
    --danger-600: #e81745; --danger-800: #9f1239; --danger-100: #fff0f1; --danger-200: #fecdd3;
    --info-600: #0284c7; --info-800: #075985; --info-100: #f0f9ff; --info-200: #bae6fd;
    --scrim: rgba(3, 2, 23, .4);

    --r-tiny: 4px; --r-small: 8px; --r-control: 12px; --r-default: 16px; --r-card: 20px; --r-pill: 999px; --r-mark: 10px;
    --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --track-heading: -0.025em;

    --e-0: 0 0 0 1px var(--border);
    --e-1: 0 1px 2px rgba(3, 2, 23, .05);
    --e-2: 0 1px 2px rgba(3, 2, 23, .04), 0 4px 12px -2px rgba(3, 2, 23, .06);
    --e-3: 0 2px 4px rgba(3, 2, 23, .04), 0 12px 32px -6px rgba(3, 2, 23, .12);
    --e-4: 0 4px 8px rgba(3, 2, 23, .04), 0 24px 64px -12px rgba(3, 2, 23, .22);
    --ring: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);

    --ease: cubic-bezier(.2, .8, .2, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms;

    --sidebar-w: 256px;
    --topbar-h: 56px;
    --pad: 40px;
    --max: 1200px;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 15px/22px var(--font);
    -webkit-font-smoothing: antialiased;
    overflow-wrap: anywhere;
}
h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
code { font: 500 .92em/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
[hidden] { display: none !important; }
.num, .table td.num, .table th.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-small); }
.skip { position: absolute; left: var(--s-4); top: -48px; z-index: 2000; padding: 10px 16px; border-radius: var(--r-pill); background: var(--n-1000); color: var(--n-0); font-weight: 600; text-decoration: none; }
.skip:focus { top: var(--s-4); }
.ic { width: 18px; height: 18px; flex-shrink: 0; }

/* =========================================================
   Shell
   ====================================================== */
.shell { min-height: 100vh; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1200;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--bg-subtle);
    border-right: 1px solid var(--border);
    transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease);
}
.sidebar__head { height: 64px; display: flex; align-items: center; padding: 0 var(--s-3); flex-shrink: 0; }
.brand {
    display: flex; align-items: center; gap: var(--s-3);
    width: 100%; min-width: 0;
    padding: 6px var(--s-2);
    border-radius: var(--r-control);
    color: inherit; text-decoration: none;
    transition: background-color var(--dur-1) var(--ease);
}
.brand:hover { background: var(--n-150); }
.brand__mark {
    display: inline-grid; place-items: center;
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: var(--r-mark);
    background: var(--accent); color: var(--accent-ink);
    font-size: 15px; font-weight: 700; letter-spacing: -0.02em;
    box-shadow: var(--e-1);
}
.brand__mark--lg { width: 48px; height: 48px; border-radius: 14px; font-size: 22px; }
.brand__text { display: grid; min-width: 0; line-height: 1.2; }
.brand__name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.brand__sub { font-size: 12px; color: var(--text-3); }

.sidebar__nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s-5); padding: var(--s-2) var(--s-3) var(--s-6); scrollbar-width: thin; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group__label { margin: 0 0 var(--s-1); padding: 0 var(--s-3); font-size: 11.5px; line-height: 20px; font-weight: 500; color: var(--text-3); }
.nav-link {
    display: flex; align-items: center; gap: 10px;
    min-height: 36px; padding: 0 var(--s-3);
    border-radius: var(--r-control);
    color: var(--text-2);
    font-size: 14px; font-weight: 500; letter-spacing: -0.005em;
    text-decoration: none;
    transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.nav-link .ic { color: var(--text-3); transition: color var(--dur-1) var(--ease); }
.nav-link:hover { background: var(--n-150); color: var(--text); }
.nav-link:hover .ic { color: var(--text-2); }
.nav-link[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--e-0), var(--e-1); }
.nav-link[aria-current="page"] .ic { color: var(--accent); }

.sidebar__foot { flex-shrink: 0; display: grid; gap: var(--s-2); padding: var(--s-3); border-top: 1px solid var(--border); }
.sidebar__who { padding: 0 var(--s-3); font-size: 12.5px; line-height: 18px; color: var(--text-3); }
.sidebar__who strong { display: block; color: var(--text-2); font-weight: 500; }

.topbar {
    position: fixed; top: 0; right: 0; left: var(--sidebar-w); z-index: 1100;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: var(--s-3);
    padding: 0 var(--pad);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: saturate(1.6) blur(14px);
    -webkit-backdrop-filter: saturate(1.6) blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar__crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s-2); font-size: 14px; }
.topbar__root { color: var(--text-3); text-decoration: none; }
.topbar__root:hover { color: var(--text); }
.topbar__sep { color: var(--n-300); }
.topbar__title { font-weight: 600; min-width: 0; }
.hamburger {
    display: none; width: 40px; height: 40px; margin-left: -8px;
    place-items: center; border-radius: var(--r-control);
    color: var(--text); cursor: pointer;
    transition: background-color var(--dur-1) var(--ease);
}
.hamburger:hover { background: var(--n-150); }
.hamburger .ic { width: 22px; height: 22px; }
.hamburger .ic--close { display: none; }
.scrim { display: none; }

.main { min-height: 100vh; margin-left: var(--sidebar-w); padding: calc(var(--topbar-h) + var(--s-8)) var(--pad) var(--s-16); }
.main__inner { max-width: var(--max); margin-inline: auto; display: grid; gap: var(--s-10); }

@media (max-width: 1023px) {
    :root { --pad: 24px; }
    .sidebar { transform: translateX(-100%); }
    .nav-toggle:checked ~ .sidebar { transform: none; box-shadow: var(--e-4); }
    .nav-toggle:checked ~ .topbar .ic--menu { display: none; }
    .nav-toggle:checked ~ .topbar .ic--close { display: block; }
    .nav-toggle:focus-visible ~ .topbar .hamburger { box-shadow: var(--ring); }
    .hamburger { display: grid; }
    .topbar { left: 0; }
    .main { margin-left: 0; }
    .scrim { display: block; position: fixed; inset: 0; z-index: 1150; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity var(--dur-3) var(--ease); }
    .nav-toggle:checked ~ .scrim { opacity: 1; pointer-events: auto; }
}
@media (max-width: 640px) {
    :root { --pad: 16px; }
    .main { padding-top: calc(var(--topbar-h) + var(--s-6)); padding-bottom: var(--s-12); }
    .main__inner { gap: var(--s-8); }
    .topbar__root, .topbar__sep { display: none; }
}

/* =========================================================
   Pagina-kop, secties, tekst
   ====================================================== */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-4) var(--s-6); }
.page-head__text { display: grid; gap: 6px; min-width: 0; max-width: 72ch; }
.page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.eyebrow { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
h1 { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: var(--track-heading); text-wrap: balance; }
h1 span { color: var(--text-3); font-weight: 500; }
.lead { max-width: 68ch; color: var(--text-2); font-size: 15px; line-height: 22px; }
.section { display: grid; gap: var(--s-4); }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2) var(--s-4); }
h2, .section__title { font-size: 16px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 15px; line-height: 22px; font-weight: 600; letter-spacing: -0.005em; }
.muted { color: var(--text-3); }
.small { font-size: 13px; line-height: 18px; }
.back { display: inline-flex; align-items: center; gap: 6px; width: fit-content; color: var(--text-3); font-size: 14px; font-weight: 500; text-decoration: none; border-radius: var(--r-tiny); }
.back .ic { width: 16px; height: 16px; transition: transform var(--dur-2) var(--ease); }
.back:hover { color: var(--text); }
.back:hover .ic { transform: translateX(-2px); }
@media (max-width: 640px) { h1 { font-size: 24px; line-height: 30px; } }

/* =========================================================
   Knoppen
   ====================================================== */
.btn {
    --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border-strong); --btn-sh: var(--e-1);
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 40px; padding: 0 16px;
    border: 1px solid var(--btn-bd); border-radius: var(--r-pill);
    background: var(--btn-bg); color: var(--btn-fg);
    font-size: 14px; font-weight: 500; line-height: 20px;
    text-decoration: none; text-align: center; cursor: pointer;
    box-shadow: var(--btn-sh);
    transition: background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.btn .ic { width: 16px; height: 16px; }
.btn:hover { --btn-bg: var(--n-100); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { box-shadow: var(--ring); border-radius: var(--r-pill); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn--primary {
    --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-bd: transparent;
    --btn-sh: inset 0 1px 0 rgba(255, 255, 255, .18), 0 4px 14px -4px color-mix(in srgb, var(--accent) 55%, transparent);
    font-weight: 600;
}
.btn--primary:hover { --btn-bg: var(--accent-hover); }
.btn--primary:active { --btn-bg: var(--accent-press); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--text-2); --btn-bd: transparent; --btn-sh: none; }
.btn--ghost:hover { --btn-bg: var(--n-150); --btn-fg: var(--text); }
.btn--danger { --btn-bg: var(--surface); --btn-fg: var(--danger-600); --btn-bd: var(--border-strong); }
.btn--danger:hover { --btn-bg: var(--danger-100); --btn-bd: var(--danger-200); }
.btn--danger-solid { --btn-bg: var(--danger-600); --btn-fg: #fff; --btn-bd: transparent; --btn-sh: none; font-weight: 600; }
.btn--danger-solid:hover { --btn-bg: var(--danger-800); }
.btn--small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn--full { width: 100%; min-height: 48px; font-size: 15px; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }

/* =========================================================
   Formulieren
   ====================================================== */
.form { display: grid; gap: var(--s-4); }
.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-size: 14px; line-height: 20px; font-weight: 500; }
.field__label small { font-weight: 400; color: var(--text-3); }
.field__hint { font-size: 13px; line-height: 18px; color: var(--text-3); }
.field__error { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--danger-600); }
.input, .select, .textarea {
    width: 100%; min-height: 42px; padding: 9px 14px;
    border: 1px solid var(--border-strong); border-radius: var(--r-control);
    background: var(--surface); color: var(--text);
    font-size: 16px; line-height: 22px;
    box-shadow: var(--e-1);
    transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.input::placeholder { color: var(--n-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input--error, .input[aria-invalid="true"] { border-color: var(--danger-600); }
.input--code { font-size: 22px; letter-spacing: .18em; text-align: center; font-variant-numeric: tabular-nums; }
.textarea { min-height: 96px; resize: vertical; }
.select {
    appearance: none; -webkit-appearance: none; padding-right: 40px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364698b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 18px;
}
.input-icon { position: relative; }
.input-icon > .ic { position: absolute; left: 14px; top: 50%; color: var(--text-3); transform: translateY(-50%); pointer-events: none; }
.input-icon .input { padding-left: 42px; }
.form-row { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.form-row--end { align-items: end; }
.filters { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.filters .field--grow { grid-column: 1 / -1; }
@media (min-width: 900px) { .filters .field--grow { grid-column: span 2; } }
.check { display: flex; align-items: center; gap: 10px; min-height: 42px; font-size: 14px; font-weight: 500; cursor: pointer; }
.check input {
    appearance: none; -webkit-appearance: none;
    width: 18px; height: 18px; margin: 0; flex-shrink: 0;
    border: 1.5px solid var(--n-400); border-radius: 6px;
    background: var(--surface) no-repeat center / 12px; cursor: pointer;
    transition: background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.check input:checked { border-color: var(--accent); background-color: var(--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.check input:focus-visible { box-shadow: var(--ring); }
.switch { display: flex; align-items: center; gap: var(--s-3); min-height: 32px; font-size: 14px; font-weight: 500; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; position: relative; width: 40px; height: 24px; margin: 0; flex-shrink: 0; border: 0; border-radius: var(--r-pill); background: var(--n-300); cursor: pointer; transition: background-color var(--dur-2) var(--ease); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: var(--e-2); transition: transform var(--dur-2) var(--ease-out); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { box-shadow: var(--ring); }
.switch__text { display: grid; gap: 2px; }
.switch__text small { font-size: 13px; font-weight: 400; color: var(--text-3); }

.form-card { overflow: clip; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.form-section { display: grid; gap: var(--s-5); padding: var(--s-6); }
.form-section + .form-section { border-top: 1px solid var(--border); }
.form-section__intro { display: grid; gap: 4px; }
.form-section__intro p { color: var(--text-2); font-size: 14px; line-height: 20px; max-width: 46ch; }
.form-section__fields { display: grid; gap: var(--s-4); min-width: 0; max-width: 600px; }
@media (min-width: 1000px) { .form-section { grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: var(--s-10); padding: var(--s-8); } }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--s-2); padding: var(--s-4) var(--s-6); border-top: 1px solid var(--border); background: var(--bg-subtle); }
.form-foot__note { margin-right: auto; color: var(--text-3); font-size: 13px; line-height: 18px; }
@media (max-width: 640px) { .form-foot > .btn { flex: 1; } .form-foot__note { width: 100%; } }

/* =========================================================
   Kaarten, KPI's, feiten, tags, meldingen
   ====================================================== */
.card { display: grid; gap: var(--s-4); align-content: start; padding: var(--s-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); min-width: 0; }
.card--raised { border-color: transparent; box-shadow: var(--e-0), var(--e-2); }
.card--flush { padding: 0; gap: 0; overflow: clip; }
.card__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.card__head > div { display: grid; gap: 2px; min-width: 0; }
.card__sub { font-size: 13px; line-height: 18px; color: var(--text-3); }
.card__figure { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.02em; }
.card__figure span { font-size: 13px; font-weight: 400; color: var(--text-3); letter-spacing: 0; }
.grid-2 { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

.kpis { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 176px), 1fr)); }
.kpi { display: grid; gap: 4px; padding: var(--s-4) var(--s-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-default); min-width: 0; }
.kpi__label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-3); }
.kpi__value { font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi__hint { font-size: 12px; line-height: 16px; color: var(--text-3); }
.kpi--accent .kpi__value { color: var(--accent-text); }

.facts { display: grid; gap: 0; }
.facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-4); padding: 10px 0; border-top: 1px solid var(--border); }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--text-3); font-size: 14px; }
.facts dd { margin: 0; font-weight: 500; text-align: right; min-width: 0; }

.tag { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--n-150); color: var(--n-700); font-size: 12.5px; line-height: 18px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--border); vertical-align: middle; }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.tag--success { background: var(--success-100); color: var(--success-800); box-shadow: inset 0 0 0 1px var(--success-200); }
.tag--warning { background: var(--warning-100); color: var(--warning-800); box-shadow: inset 0 0 0 1px var(--warning-200); }
.tag--danger { background: var(--danger-100); color: var(--danger-800); box-shadow: inset 0 0 0 1px var(--danger-200); }
.tag--info { background: var(--info-100); color: var(--info-800); box-shadow: inset 0 0 0 1px var(--info-200); }
.tag--accent { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-soft-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

.alert { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-control); background: var(--n-100); border: 1px solid var(--border); font-size: 14px; line-height: 20px; }
.alert .ic { margin-top: 1px; }
.alert > div { display: grid; gap: 2px; min-width: 0; }
.alert__title { font-weight: 600; }
.alert--success { background: var(--success-100); border-color: var(--success-200); color: var(--success-800); }
.alert--error { background: var(--danger-100); border-color: var(--danger-200); color: var(--danger-800); }
.alert--warning { background: var(--warning-100); border-color: var(--warning-200); color: var(--warning-800); }
.alert--info { background: var(--info-100); border-color: var(--info-200); color: var(--info-800); }

.empty { display: grid; gap: 4px; padding: var(--s-8) var(--s-6); text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--r-card); color: var(--text-3); }
.empty__title { font-weight: 600; color: var(--text-2); }

.meter { width: 100%; height: 8px; appearance: none; -webkit-appearance: none; border: 0; border-radius: var(--r-pill); background: var(--n-200); overflow: hidden; }
.meter::-webkit-progress-bar { background: var(--n-200); border-radius: var(--r-pill); }
.meter::-webkit-progress-value { background: var(--accent); border-radius: var(--r-pill); transition: width var(--dur-3) var(--ease); }
.meter::-moz-progress-bar { background: var(--accent); border-radius: var(--r-pill); }
.meter--warn::-webkit-progress-value { background: var(--warning-600); }
.meter--warn::-moz-progress-bar { background: var(--warning-600); }
.meter--over::-webkit-progress-value { background: var(--danger-600); }
.meter--over::-moz-progress-bar { background: var(--danger-600); }

/* =========================================================
   Tabellen (stapelen onder 760 px: geen horizontale scroll)
   ====================================================== */
.table-card { padding: 0; overflow: clip; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.table th, .table td { padding: 12px var(--s-4); text-align: left; vertical-align: top; border-top: 1px solid var(--border); min-width: 0; }
.table thead th { border-top: 0; padding-top: 12px; padding-bottom: 12px; background: var(--bg-subtle); color: var(--text-3); font-size: 12.5px; line-height: 16px; font-weight: 500; }
.table th.num, .table td.num { text-align: right; }
.table tbody tr:hover > td { background: var(--n-100); }
.table a { color: inherit; font-weight: 500; text-decoration: none; }
.table a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.table .cell-sub { display: block; font-size: 12.5px; line-height: 16px; color: var(--text-3); font-weight: 400; }
.table .row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.table details summary { cursor: pointer; font-weight: 500; color: var(--accent-text); list-style: none; }
.table details summary::-webkit-details-marker { display: none; }
.table details[open] summary { margin-bottom: var(--s-3); }
.table tfoot td { border-top: 2px solid var(--border); background: var(--bg-subtle); font-weight: 600; }
.sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; border-radius: var(--r-tiny); }
.sort:hover { color: var(--text); }
.sort[aria-sort] { color: var(--text); }
.sort .ic { width: 14px; height: 14px; }
.table-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); }
.pager { display: flex; align-items: center; gap: var(--s-2); }

@media (max-width: 759px) {
    .table, .table thead, .table tbody, .table tfoot, .table tr, .table th, .table td { display: block; }
    .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table tr { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--border); display: grid; gap: 6px; }
    .table tbody tr:first-child { border-top: 0; }
    .table tbody tr:hover > td { background: transparent; }
    .table td { padding: 0; border: 0; display: grid; grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); gap: var(--s-3); align-items: baseline; }
    .table td.num { text-align: left; }
    .table td::before { content: attr(data-label); color: var(--text-3); font-size: 12.5px; line-height: 18px; font-weight: 500; }
    .table td.cell-full { grid-template-columns: 1fr; }
    .table td.cell-full::before { display: none; }
    .table td.cell-title { grid-template-columns: 1fr; font-size: 15px; font-weight: 600; }
    .table td.cell-title::before { display: none; }
    .table td > .tag { justify-self: start; width: fit-content; }
    .table tfoot tr { background: var(--bg-subtle); }
}

/* =========================================================
   Grafieken (inline SVG, geen inline stijlen)
   ====================================================== */
.spark { display: grid; gap: var(--s-2); }
.spark__svg { width: 100%; height: 56px; overflow: visible; }
.spark__area { fill: var(--accent); fill-opacity: .10; }
.spark__line { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.spark__base { stroke: var(--border); stroke-width: 1; }
.spark__axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chart { display: grid; gap: var(--s-3); }
.chart__svg { width: 100%; height: 160px; }
.chart__bar { fill: var(--accent); }
.chart__bar--1 { fill: var(--n-700); }
.chart__bar--2 { fill: var(--n-400); }
.chart__bar--3 { fill: var(--info-600); }
.chart__base { stroke: var(--border); stroke-width: 1; }
.chart__axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.legend i.swatch-1 { background: var(--n-700); }
.legend i.swatch-2 { background: var(--n-400); }
.legend i.swatch-3 { background: var(--info-600); }

/* =========================================================
   Lijsten, activiteit, plan, kennis
   ====================================================== */
.feed { display: grid; }
.feed li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--s-3); align-items: baseline; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.feed li:first-child { border-top: 0; padding-top: 0; }
.feed time { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 13px; }
.feed a { color: inherit; text-decoration: none; font-weight: 500; }
.feed a:hover { color: var(--accent-text); }
.counts { display: grid; gap: var(--s-2); align-content: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 120px), 1fr)); }
.counts li { display: grid; gap: 2px; align-content: start; padding: var(--s-3); border-radius: var(--r-control); background: var(--bg-subtle); }
.counts strong { font-size: 20px; line-height: 24px; font-variant-numeric: tabular-nums; }
.counts span { font-size: 12.5px; color: var(--text-3); }

.plan { display: grid; gap: var(--s-4); }
.plan__block { display: grid; gap: var(--s-3); padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--r-default); }
.plan__block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2); }
.plan__session { display: grid; gap: var(--s-2); padding: var(--s-4); border-radius: var(--r-control); background: var(--bg-subtle); }
.plan__session-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2); font-weight: 600; }
.plan__exercises li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-3); padding: 6px 0; border-top: 1px solid var(--border); font-size: 14px; }
.plan__exercises li:first-child { border-top: 0; }
.plan__exercises .scheme { color: var(--text-3); font-variant-numeric: tabular-nums; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; }

.chunks { display: grid; gap: var(--s-3); }
.chunk { display: grid; gap: var(--s-2); padding: var(--s-4) var(--s-5); border: 1px solid var(--border); border-radius: var(--r-default); }
.chunk__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2); }
.chunk__text { white-space: pre-wrap; font-size: 14px; line-height: 21px; color: var(--text-2); }
.chunk details summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--accent-text); }
.score { font-variant-numeric: tabular-nums; font-weight: 600; }

pre.json { margin: 0; padding: var(--s-4); border-radius: var(--r-control); background: var(--n-900); color: var(--n-100); font: 12.5px/18px ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.danger-zone { border-color: var(--danger-200); }
.danger-zone summary { cursor: pointer; font-weight: 600; color: var(--danger-800); list-style: none; display: flex; align-items: center; gap: var(--s-2); }
.danger-zone summary::-webkit-details-marker { display: none; }
.danger-zone[open] summary { margin-bottom: var(--s-4); }
.danger-zone .form { padding-top: var(--s-2); }

.health { display: grid; gap: var(--s-2); }
.health li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-4); padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.health li:first-child { border-top: 0; padding-top: 0; }
.health .label { color: var(--text-3); }

/* =========================================================
   Auth (login, 2FA)
   ====================================================== */
.auth { min-height: 100vh; display: grid; align-content: center; justify-items: center; gap: var(--s-4); padding: var(--s-8) var(--s-4); background: var(--bg-subtle); }
.auth__card { width: 100%; max-width: 440px; display: grid; gap: var(--s-5); padding: var(--s-8); background: var(--surface); border-radius: var(--r-card); box-shadow: var(--e-0), var(--e-3); }
.auth__title { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -0.02em; }
.auth__lead { color: var(--text-2); font-size: 14px; line-height: 20px; }
.auth__foot { font-size: 13px; color: var(--text-3); text-align: center; max-width: 440px; }
.auth__alt { display: flex; justify-content: center; }
.brand--auth { padding: 0; }
.brand--auth:hover { background: transparent; }
.steps { display: grid; gap: var(--s-5); counter-reset: step; }
.steps__item { display: grid; gap: var(--s-2); padding-left: 40px; position: relative; }
.steps__item::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--n-1000); color: var(--n-0); font-size: 13px; font-weight: 600; }
.steps__title { font-size: 15px; font-weight: 600; }
.steps__text { font-size: 14px; line-height: 20px; color: var(--text-2); }
.secret { display: grid; gap: 6px; }
.secret code { display: block; padding: 10px 14px; border-radius: var(--r-control); background: var(--bg-subtle); border: 1px solid var(--border); font-size: 15px; letter-spacing: .08em; text-align: center; }
.secret a { font-size: 13px; color: var(--accent-text); overflow-wrap: anywhere; }
.codes { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.codes li code { display: block; padding: 8px 10px; text-align: center; border-radius: var(--r-small); background: var(--bg-subtle); border: 1px solid var(--border); font-size: 14px; letter-spacing: .06em; }
@media (max-width: 400px) { .auth__card { padding: var(--s-6); } .codes { grid-template-columns: 1fr; } }

/* =========================================================
   Foutpagina, credit
   ====================================================== */
.error-page { min-height: 100vh; display: grid; place-content: center; gap: var(--s-3); padding: var(--s-8) var(--s-4); text-align: center; background: var(--bg-subtle); }
.error-page .code { font-size: 64px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; color: var(--n-300); }
.credit { font-size: 12px; color: var(--n-400); text-align: center; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
