/* Hallmark · custom · genre modern-minimal · shape: app screen · tone: dossier, utilitarian · signature: zachte panelen met schaduw, ronde knoppen, Figtree */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V4 · weakest: S, een blauwe app-schil lijkt snel generiek; daarom een zachte, ronde vormtaal met één accentkleur en goed leesbare Figtree */

/* =========================================================
   BluePractice: ontwerpsysteem "Dossier"
   Licht/donker, kleurenblind-modus en tekstgrootte via attributen op <html>:
     data-theme="light|dark"   data-colorblind="on"   data-fontsize="normal|large|extra-large"
   Uitgangspunten:
   - Leesbaarheid eerst: tekst minstens 4,5:1 (meestal 12:1 of meer), velden en focusringen 3:1.
   - Eén letterfamilie (Figtree), goed leesbaar; koppen alleen zwaarder, niet breder.
   - Zacht: panelen met een lichte schaduw op een lichtblauwe achtergrond, ronde hoeken en knoppen.
   - Kobalt is de enige accentkleur; signaalgeel alleen voor tellers die aandacht vragen.
   ========================================================= */

@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/figtree-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/figtree-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: "Figtree";
    font-style: italic;
    font-weight: 300 900;
    font-display: swap;
    src: url("../fonts/figtree-latin-wght-italic.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
    /* ---- Kleur: licht ---- */
    --color-bg: #f0f4fb;              /* lichtblauwe achtergrond */
    --color-surface: #ffffff;         /* panelen */
    --color-surface-alt: #eef1f7;     /* hover, kopregels, zachte vlakken */
    --color-border: #dbe0ea;          /* scheidingslijnen */
    --color-input-border: #7d889e;    /* rand van velden: 3,5:1 op wit */
    --color-btn-border: #c2c9d7;
    --color-text: #14203b;            /* inkt: 15:1 op wit */
    --color-text-muted: #4d5a74;      /* 7:1 op wit */
    --color-primary: #2b5ce6;         /* blauw: 5,6:1 op wit */
    --color-primary-hover: #1f47b8;
    --color-primary-contrast: #ffffff;
    --color-primary-tint: #e9efff;    /* geselecteerd */
    --color-signal: #f2b705;          /* signaalgeel: alleen als vlak (tellers), nooit tekst op wit */
    --color-signal-ink: #14203b;      /* tekst op signaalgeel */
    --color-success: #17704a;
    --color-success-bg: #e2f3ea;
    --color-danger: #b42335;
    --color-danger-bg: #fbe7e9;
    --color-danger-contrast: #ffffff;
    --color-warning: #845400;
    --color-warning-bg: #fcf0d4;
    --color-focus-ring: #2b5ce6;
    --color-overlay: rgba(20, 32, 59, 0.48);
    --color-on-dark: #ffffff;
    --color-on-dark-muted: rgba(255, 255, 255, 0.72);
    --color-scrim: rgba(10, 14, 22, 0.86);
    --color-qr-paper: #ffffff;
    --color-media-bg: #0b1020;
    --shadow-lg: 0 10px 36px rgba(0, 0, 0, 0.5);
    /* Kleurenblind-vriendelijke varianten (blauw/oranje in plaats van groen/rood). */
    --cb-success: #00639b;
    --cb-success-bg: #e2f0fa;
    --cb-danger: #a34700;
    --cb-danger-bg: #fdeade;
    --cb-success-dark: #6cc3f2;
    --cb-success-bg-dark: #0d2e42;
    --cb-danger-dark: #f0a366;
    --cb-danger-bg-dark: #3a2410;

    /* Oude namen blijven bestaan, zodat alle schermen meteen de nieuwe stijl volgen. */
    --color-navy: var(--color-surface);
    --color-navy-text: var(--color-text);
    --color-navy-muted: var(--color-text-muted);
    --tile-blue: var(--color-primary);       --tile-blue-bg: var(--color-primary-tint);
    --tile-orange: var(--color-primary);     --tile-orange-bg: var(--color-primary-tint);
    --tile-teal: var(--color-primary);       --tile-teal-bg: var(--color-primary-tint);
    --tile-amber: var(--color-warning);      --tile-amber-bg: var(--color-warning-bg);
    --tile-pink: var(--color-primary);       --tile-pink-bg: var(--color-primary-tint);
    --tile-violet: var(--color-primary);     --tile-violet-bg: var(--color-primary-tint);
    --tile-slate: var(--color-text-muted);   --tile-slate-bg: var(--color-surface-alt);
    --color-ink-panel: var(--color-surface);
    --color-ink-panel-elevated: var(--color-surface-alt);
    --color-ink-panel-border: var(--color-border);
    --color-ink-panel-text: var(--color-text);
    --color-ink-panel-text-muted: var(--color-text-muted);

    /* Accentrand (voortgang, "Ga verder"): effen kobalt */
    --stripe: var(--color-primary);

    /* ---- Type ---- */
    --font-sans: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    --font-display: var(--font-sans);
    --stretch-display: 100%;
    --stretch-heading: 100%;
    --font-size-base: 16px;
    --line-height-base: 1.6;
    --text-xs: 0.78rem;
    --text-sm: 0.875rem;
    --text-md: 1rem;
    --text-lg: 1.15rem;
    --text-xl: 1.4rem;
    --text-2xl: 1.85rem;

    /* ---- Vorm en ruimte ---- */
    --radius-sm: 10px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(20, 32, 59, 0.06), 0 4px 14px -6px rgba(20, 32, 59, 0.12);
    --shadow-md: 0 14px 36px -14px rgba(20, 32, 59, 0.32), 0 2px 6px rgba(20, 32, 59, 0.08);
    --control-height: 2.5rem;
    --content-max: 1160px;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
}

/* ---- Kleur: donker. Geen zwart: diep inktblauw, tekst 13:1, gedempte tekst 7:1. ---- */
:root[data-theme="dark"] {
    --color-bg: #0e1527;
    --color-surface: #151e35;
    --color-surface-alt: #1c2742;
    --color-border: #2a3655;
    --color-input-border: #6b789a;
    --color-btn-border: #3a4769;
    --color-text: #e8edf6;
    --color-text-muted: #a8b3c9;
    --color-primary: #93a8ff;
    --color-primary-hover: #b4c2ff;
    --color-primary-contrast: #0e1527;
    --color-primary-tint: #222e55;
    --color-signal: #f5c542;
    --color-signal-ink: #0e1527;
    --color-success: #6fd5a1;
    --color-success-bg: #12301f;
    --color-danger: #ff929b;
    --color-danger-bg: #3a1820;
    --color-danger-contrast: #0e1527;
    --color-warning: #f0c262;
    --color-warning-bg: #36290b;
    --color-focus-ring: #b4c2ff;
    --color-overlay: rgba(4, 8, 18, 0.62);
    --shadow-md: 0 16px 40px -14px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px -8px rgba(0, 0, 0, 0.45);
}

/* Kleurenblind-vriendelijk: blauw/oranje in plaats van groen/rood. */
:root[data-colorblind="on"] {
    --color-success: var(--cb-success);
    --color-success-bg: var(--cb-success-bg);
    --color-danger: var(--cb-danger);
    --color-danger-bg: var(--cb-danger-bg);
}
:root[data-theme="dark"][data-colorblind="on"] {
    --color-success: var(--cb-success-dark);
    --color-success-bg: var(--cb-success-bg-dark);
    --color-danger: var(--cb-danger-dark);
    --color-danger-bg: var(--cb-danger-bg-dark);
}

/* Tekstgrootte-schaal */
:root[data-fontsize="large"] { --font-size-base: 18px; }
:root[data-fontsize="extra-large"] { --font-size-base: 21px; }

*, *::before, *::after { box-sizing: border-box; }

html { font-size: var(--font-size-base); overflow-x: clip; color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

body {
    margin: 0;
    overflow-x: clip;
    font-family: var(--font-sans);
    font-size: var(--text-md);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: var(--line-height-base);
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    font-stretch: var(--stretch-heading);
    letter-spacing: -0.005em;
    line-height: 1.25;
    color: var(--color-text);
    overflow-wrap: break-word;
    min-width: 0;
}
h1 { font-weight: 750; }
h1, h2 { text-wrap: balance; }
p { max-width: 75ch; }

a { color: var(--color-primary); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-primary-hover); }

/* Focus: altijd zichtbaar en direct, 3:1 of beter. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[contenteditable]:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: var(--space-2);
    top: var(--space-2);
    z-index: 1000;
    padding: var(--space-2) var(--space-4);
    background: var(--color-primary);
    color: var(--color-primary-contrast);
    border-radius: var(--radius-sm);
    transform: translateY(-200%);
}
.skip-link:focus { transform: none; color: var(--color-primary-contrast); }
/* Alleen voor schermlezers (bv. een kolomkop "Acties" die visueel niets toevoegt). */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Layout ---------- */
.impersonation-banner {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border-bottom: 1px solid var(--color-warning);
    padding: var(--space-2) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
}
.impersonation-banner form { margin: 0; }

.site-header {
    position: relative;
    z-index: 60;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--space-3) var(--space-6);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
}
.brand-block { display: flex; flex-direction: column; gap: 1px; }
.brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 750;
    font-stretch: var(--stretch-display);
    font-size: var(--text-lg);
    letter-spacing: -0.01em;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
}
.brand__badge {
    display: block;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
/* Team van de ingelogde gebruiker, klein onder de logo/naam-regel. */
.brand__team {
    padding-left: calc(1.75rem + var(--space-2));
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* Losse licht/donker-knop (maantje/zonnetje) voor ingelogde gebruikers, rechtsboven in de
   navigatiebalk — naast elkaar getoond, alleen het relevante icoon zichtbaar per thema. */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-surface-alt);
    color: var(--color-text);
    cursor: pointer;
    flex-shrink: 0;
}
.theme-toggle-btn:hover { background: var(--color-border); }
.theme-toggle-btn__icon { width: 18px; height: 18px; }
.theme-toggle-btn__icon--moon { display: none; }
:root[data-theme="dark"] .theme-toggle-btn__icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle-btn__icon--moon { display: block; }

/* Hamburgerknop: alleen zichtbaar op mobiel (zie media query onderin dit blok) — opent/sluit
   de volledige navigatiebalk, die daar verticaal onder de header verschijnt in plaats van de
   normale horizontale rij. */
.nav-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface-alt);
    color: var(--color-text);
    cursor: pointer;
    flex-shrink: 0;
}
.nav-toggle-btn:hover { background: var(--color-border); }
.nav-toggle-btn__icon { width: 20px; height: 20px; }
.nav-toggle-btn__icon--close { display: none; }
.nav-toggle-btn[aria-expanded="true"] .nav-toggle-btn__icon--open { display: none; }
.nav-toggle-btn[aria-expanded="true"] .nav-toggle-btn__icon--close { display: block; }

.nav { display: flex; align-items: center; gap: var(--space-1); flex-wrap: wrap; flex: 1; }
.nav > a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.45rem var(--space-3);
    border-radius: var(--radius-md);
}
.nav > a:hover { color: var(--color-text); background: var(--color-surface-alt); }
.nav > a.active { color: var(--color-primary); background: var(--tile-blue-bg); }
/* Duwt alles wat erna komt (meldingen, profielmenu) naar de rechterkant van de balk. */
.nav__spacer { flex: 1; }

.nav__divider { width: 1px; align-self: stretch; background: var(--color-border); margin: 0 var(--space-1); }

.nav-dropdown { position: relative; }
.nav-dropdown__trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.45rem var(--space-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
}
.nav-dropdown__trigger:hover { background: var(--color-surface-alt); color: var(--color-text); }
.nav-dropdown__trigger[aria-expanded="true"] { background: var(--color-surface-alt); color: var(--color-text); border-color: var(--color-border); }
.nav-dropdown__caret { font-size: 0.7rem; }
.nav-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    min-width: 240px;
    max-height: 80vh;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-2);
    z-index: 50;
}
.nav-dropdown__menu--open { display: block; }
.nav-dropdown__menu a {
    display: block;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
}
.nav-dropdown__menu a:hover { background: var(--color-surface-alt); color: var(--color-primary); }

/* Categorie-koppen die de "Beheer"-lijst in herkenbare groepjes opdelen
   (bv. "Groepen & teams", "Inhoud"), in plaats van één lange platte lijst. */
.nav-dropdown__group-label {
    padding: var(--space-2) var(--space-3) var(--space-1);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-text-muted);
}
.nav-dropdown__group + .nav-dropdown__group {
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-1);
    padding-top: var(--space-1);
}

.user-chip { display: flex; align-items: center; gap: var(--space-2); padding: 0.3rem 0.6rem 0.3rem 0.3rem; border-radius: var(--radius-pill); transition: background-color 0.12s ease; }
.user-chip:hover { background: var(--color-surface-alt); }
.avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--color-border);
    background: var(--color-surface-alt);
}
.avatar--lg { width: 5rem; height: 5rem; }

/* Thema-schakelaar — alleen zichtbaar voor niet-ingelogde bezoekers (login/registreren/...),
   zie includes/header.php en assets/js/theme-toggle.js. Toont "Licht" en "Donker" altijd
   naast elkaar (geen verborgen toestand achter één klein icoontje) — de actieve keuze
   krijgt een eigen achtergrond, puur via CSS op :root[data-theme] zodat er geen JS nodig
   is om de juiste stand meteen bij het laden te tonen. */
.theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 0.2rem;
    flex-shrink: 0;
}
.theme-switch__option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-pill);
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
}
.theme-switch__option svg { width: 0.95rem; height: 0.95rem; flex-shrink: 0; }
.theme-switch__option:hover { color: var(--color-text); }
:root:not([data-theme="dark"]) .theme-switch__option[data-theme-choice="light"],
:root[data-theme="dark"] .theme-switch__option[data-theme-choice="dark"] {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

main {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--space-6) var(--space-6) var(--space-10);
    box-sizing: border-box;
}
.container--narrow { max-width: 480px; }

.page-title { margin: 0 0 var(--space-2); font-size: var(--text-2xl); font-weight: 750; font-stretch: var(--stretch-display); letter-spacing: -0.01em; line-height: 1.15; }
.page-subtitle { margin: 0 0 var(--space-4); color: var(--color-text-muted); max-width: 70ch; }

/* ---------- Kaarten / panelen ---------- */
/* Bewust vlak: hairline-rand in plaats van schaduw. Een kaart "zweeft" pas
   (schaduw) als hij dat letterlijk doet — dropdowns, modals. */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card h2 { font-size: var(--text-lg); }
.card h3 { font-size: var(--text-md); }

/* ---------- Dashboardtegels ---------- */
/* Kopje boven een groep tegels op het dashboard (bv. "Casussen" / "Toetsen"),
   zodat meerdere tegel-rijen op één pagina duidelijk als aparte onderdelen
   herkenbaar zijn in plaats van als één ononderbroken blok tegels. */
.dashboard-section {
    margin-bottom: var(--space-6);
}
.dashboard-section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 var(--space-3);
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--color-text);
}
.dashboard-section-title svg { width: 1rem; height: 1rem; }
.dashboard-section > .tile-grid { margin-bottom: 0; }

/* Inklapbare sectiekop (vooralsnog het beheerdersoverzicht, dashboard_superadmin.php): dezelfde
   look als de gewone (niet-inklapbare) .dashboard-section-title hierboven, maar dan als knop in
   de <h2> i.p.v. platte tekst — zie assets/js/dashboard-sections.js voor het aan/uit-klappen. */
.dashboard-section-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    background: none;
    border: none;
    padding: var(--space-1) 0;
    margin: 0;
    font: inherit;
    font-weight: 700;
    color: var(--color-text-muted);
    cursor: pointer;
    text-align: left;
}
.dashboard-section-toggle:hover { color: var(--color-text); }
.dashboard-section-toggle:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: 2px; border-radius: var(--radius-sm); }
.dashboard-section-toggle__chevron { margin-left: auto; display: inline-flex; transition: transform 0.15s ease; }
.dashboard-section-toggle[aria-expanded="false"] .dashboard-section-toggle__chevron { transform: rotate(-90deg); }

/* Vaste-kolommen grid ("een vast aantal vakken naast elkaar") in plaats van
   auto-fit/minmax: het aantal kolommen ligt per breedte vast, zodat tegels nooit
   willekeurig "los" op een regel eindigen. Standaard 1 kolom (mobiel) -> 2 -> 4;
   .tile-grid--3 stopt bij 3 kolommen voor rijen met een vast aantal van 3 items. */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}
/* Zonder deze regel wint "display: grid" hierboven het van de standaard [hidden]-stijl van de
   browser (auteur-CSS gaat altijd voor de user-agent-stijl, ongeacht specificiteit) — een
   ingeklapte sectie (zie .dashboard-section-toggle / assets/js/dashboard-sections.js) zou
   dan alsnog gewoon zichtbaar blijven staan. */
.tile-grid[hidden] { display: none; }
@media (min-width: 640px) {
    .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1080px) {
    .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tile-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 820px) and (max-width: 1079.98px) {
    .tile-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Een tegel is een .card met een kleuraccent: een dunne bovenbalk + een gekleurd
   icoonvlak. De kleur zelf draagt nooit de betekenis alleen — titel/label staan
   er altijd gewoon bij in de normale teksttint (nooit de tegelkleur zelf), zie
   assets/css design-systeemnoot bovenaan dit bestand. */
.tile {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    overflow: hidden;
    transition: border-color 0.12s ease, background-color 0.12s ease;
    display: flex;
    flex-direction: column;
}
a.tile { text-decoration: none; color: inherit; }
a.tile:hover { background: var(--color-surface-alt); border-color: var(--color-input-border); }
.tile__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-md);
    background: var(--tile-accent-bg, var(--color-surface-alt));
    color: var(--tile-accent, var(--color-primary));
    margin-bottom: var(--space-3);
    flex-shrink: 0;
}
.tile__icon svg { width: 1.2rem; height: 1.2rem; }
.tile__value { margin: 0 0 var(--space-1); font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; color: var(--color-text); line-height: 1.1; }
.tile__title { margin: 0 0 var(--space-1); font-size: 1rem; }
.tile__label { margin: 0; color: var(--color-text-muted); font-weight: 700; font-size: 0.76rem; }
.tile__desc { margin: 0 0 var(--space-2); color: var(--color-text-muted); font-size: 0.88rem; flex-grow: 1; }
.tile__row { margin: 0 0 var(--space-2); font-size: 0.92rem; }
.tile__actions { margin-top: auto; padding-top: var(--space-3); }

.tile--blue   { --tile-accent: var(--tile-blue);   --tile-accent-bg: var(--tile-blue-bg); }
.tile--orange { --tile-accent: var(--tile-orange); --tile-accent-bg: var(--tile-orange-bg); }
.tile--teal   { --tile-accent: var(--tile-teal);   --tile-accent-bg: var(--tile-teal-bg); }
.tile--amber  { --tile-accent: var(--tile-amber);  --tile-accent-bg: var(--tile-amber-bg); }
.tile--pink   { --tile-accent: var(--tile-pink);   --tile-accent-bg: var(--tile-pink-bg); }
.tile--violet { --tile-accent: var(--tile-violet); --tile-accent-bg: var(--tile-violet-bg); }
.tile--slate  { --tile-accent: var(--tile-slate);  --tile-accent-bg: var(--tile-slate-bg); }
.tile--success { --tile-accent: var(--color-success); --tile-accent-bg: var(--color-success-bg); }
.tile--warning { --tile-accent: var(--color-warning); --tile-accent-bg: var(--color-warning-bg); }
.tile--muted   { --tile-accent: var(--color-text-muted); --tile-accent-bg: var(--color-surface-alt); }

/* Compacte statistiek-tegel (alleen groot getal + label, bv. beheerdersoverzicht) */
.tile--stat .tile__value { font-size: 1.9rem; }

/* ---------- Formulieren ---------- */
.field { margin-bottom: var(--space-4); }
.field label {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-weight: 600;
    margin-bottom: var(--space-1);
    font-size: 0.88rem;
}
.field-hint { color: var(--color-text-muted); font-size: 0.85rem; margin-top: var(--space-1); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
input[type="number"],
input[type="datetime-local"],
input[type="search"],
select,
textarea {
    width: 100%;
    min-height: var(--control-height);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--text-md);
    font-family: inherit;
    line-height: 1.4;
    transition: border-color 0.12s ease;
}
textarea { resize: vertical; min-height: 6rem; }

/* Rand verdikt (in plaats van een losse outline) bij focus — subtiele,
   "gelikte" bevestiging die de bestaande :focus-visible-outline aanvult. */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 1px;
}
input:disabled, select:disabled, textarea:disabled { opacity: 0.6; cursor: not-allowed; background: var(--color-surface-alt); }

/* Getal- en datum/tijd-velden hebben standaard lelijke, inconsistente
   in-/uitklap-widgets van de browser (vooral de omhoog/omlaag-pijltjes van
   number-inputs). Hertekenen tot iets rustigers dat bij de rest past. */
input[type="number"] {
    -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
    height: 1.6rem;
    opacity: 0.55;
    cursor: pointer;
    transition: opacity 0.12s ease;
}
input[type="number"]:hover::-webkit-inner-spin-button,
input[type="number"]:focus::-webkit-inner-spin-button {
    opacity: 1;
}
/* Compacte number-inputs (punten toekennen, aantal pogingen e.d.) hoeven
   niet de volle breedte te vullen. */
input[type="number"].input--compact {
    width: 6.5rem;
}

input[type="datetime-local"] {
    color-scheme: light;
    cursor: pointer;
}
:root[data-theme="dark"] input[type="datetime-local"] { color-scheme: dark; }
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    opacity: 0.55;
    border-radius: var(--radius-sm);
    padding: 0.2rem;
    transition: opacity 0.12s ease, background-color 0.12s ease;
}
input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator,
input[type="datetime-local"]:focus::-webkit-calendar-picker-indicator {
    opacity: 1;
    background-color: var(--color-surface-alt);
}

/* .btn's eigen "display" wint anders van de browser-standaard [hidden]-regel (zelfde
   specificiteit, en auteurs-CSS wint van UA-CSS) — zonder deze regel blijft een verborgen
   knop (bv. .toets-oneq-stage se stap-voor-stap Volgende/Inleveren-wissel) gewoon zichtbaar. */
.btn[hidden] { display: none; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--control-height);
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--color-primary);
    color: var(--color-primary-contrast);
    font-family: inherit;
    font-weight: 650;
    font-size: var(--text-sm);
    line-height: 1.3;
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}
.btn svg { width: 1.05rem; height: 1.05rem; flex-shrink: 0; }
.btn:hover { background: var(--color-primary-hover); color: var(--color-primary-contrast); }
/* Klein, direct drukfeedback bij klikken/tikken — alleen transform (geen top/left),
   dus dit blijft soepel ook op oudere apparaten. */
.btn:active { transform: translateY(1px); }
.btn--secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-btn-border);
}
.btn--secondary:hover { background: var(--color-surface-alt); color: var(--color-text); border-color: var(--color-input-border); }
/* Tekstknop zonder vlak of rand — voor de minst belangrijke actie in een rij. */
.btn--ghost { background: transparent; color: var(--color-text-muted); border-color: transparent; }
.btn--ghost:hover { background: var(--color-surface-alt); color: var(--color-text); }
.btn--danger { background: var(--color-danger); color: var(--color-danger-contrast); }
.btn--danger:hover { filter: brightness(0.9); }
.btn--auto { width: auto; }
.btn--sm { min-height: 2rem; padding: var(--space-1) var(--space-3); font-size: var(--text-sm); border-radius: var(--radius-sm); white-space: nowrap; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* "Bezig"-status op een verzendknop (gezet door assets/js/form-busy.js): voorkomt dubbel
   klikken en geeft meteen zichtbare bevestiging dat de klik is geregistreerd, ook bij een
   gewone formulier-POST (geen AJAX) waarbij de pagina zelf pas even later herlaadt. */
.btn.is-busy {
    color: transparent;
    pointer-events: none;
    position: relative;
}
.btn.is-busy::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1.1rem;
    height: 1.1rem;
    margin: -0.55rem 0 0 -0.55rem;
    border-radius: 50%;
    border: 2px solid var(--color-primary-contrast);
    border-top-color: transparent;
    opacity: 0.85;
    animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* Tooltip (bv. bij het e-mailveld op het registratieformulier) */
.tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: help;
    border: 1px solid var(--color-border);
}
.tooltip .tooltip__bubble {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%);
    width: 15rem;
    max-width: 60vw;
    background: var(--color-text);
    color: var(--color-bg);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.4;
    transition: opacity 0.15s ease;
    z-index: 10;
    text-align: left;
}
.tooltip:hover .tooltip__bubble,
.tooltip:focus-visible .tooltip__bubble,
.tooltip:focus-within .tooltip__bubble {
    visibility: visible;
    opacity: 1;
}

/* ---------- Meldingen ---------- */
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    border: 1px solid transparent;
    font-size: 0.95rem;
    animation: fade-rise-in 0.25s ease;
}
.alert--error { background: var(--color-danger-bg); color: var(--color-danger); border-color: currentColor; }
.alert--success { background: var(--color-success-bg); color: var(--color-success); border-color: currentColor; }
.alert--warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: currentColor; }
/* "Nieuwe badge verdiend"-melding: eigen (feestelijke, amberkleurige) stijl, en verdwijnt
   vanzelf na 6 seconden (zie assets/js/nav.js) — andere meldingen blijven gewoon staan.
   Springt er ook echt uit met een kort "pop"-momentje en een confetti-uitbarsting (hieronder),
   in plaats van de gebruikelijke rustige fade-rise-in van .alert — dit IS het beloningsmoment,
   dus mag heel even net wat uitbundiger zijn dan de rest van de app. */
.alert--badge {
    position: relative;
    overflow: visible;
    background: var(--tile-amber-bg);
    color: var(--tile-amber);
    border-color: currentColor;
    transition: opacity 0.4s ease, transform 0.4s ease;
    animation: badge-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.js .alert--badge.alert--fading { opacity: 0; transform: translateY(-6px); }
@keyframes badge-pop-in {
    0% { opacity: 0; transform: scale(0.85) translateY(-4px); }
    55% { opacity: 1; transform: scale(1.03) translateY(0); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Confetti-uitbarsting bij de badge-melding: 6 kleine vierkantjes uit de categorale
   tegelkleurenreeks (dezelfde gevalideerde kleuren als de dashboardtegels, geen nieuwe kleuren
   erbij verzinnen), die één keer vanuit het medaille-emoji naar buiten schieten en vervagen.
   Puur decoratief (aria-hidden) en zuiver CSS — geen afbeeldingen. */
.badge-confetti { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.badge-confetti span {
    position: absolute;
    top: 50%;
    left: var(--space-4);
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 1px;
    opacity: 0;
    transform: rotate(var(--badge-confetti-angle, 0deg));
    animation: badge-confetti-piece 0.7s ease-out forwards;
    animation-delay: var(--badge-confetti-delay, 0s);
}
.badge-confetti span:nth-child(1) { --badge-confetti-angle: 200deg; --badge-confetti-delay: 0.05s; background: var(--tile-amber); }
.badge-confetti span:nth-child(2) { --badge-confetti-angle: 255deg; --badge-confetti-delay: 0.12s; background: var(--tile-blue); }
.badge-confetti span:nth-child(3) { --badge-confetti-angle: 310deg; --badge-confetti-delay: 0s;    background: var(--tile-teal); }
.badge-confetti span:nth-child(4) { --badge-confetti-angle: 20deg;  --badge-confetti-delay: 0.18s; background: var(--tile-pink); }
.badge-confetti span:nth-child(5) { --badge-confetti-angle: 80deg;  --badge-confetti-delay: 0.08s; background: var(--tile-violet); }
.badge-confetti span:nth-child(6) { --badge-confetti-angle: 140deg; --badge-confetti-delay: 0.15s; background: var(--tile-orange); }
@keyframes badge-confetti-piece {
    0%   { opacity: 1; transform: rotate(var(--badge-confetti-angle, 0deg)) translateX(0) scale(1); }
    100% { opacity: 0; transform: rotate(var(--badge-confetti-angle, 0deg)) translateX(28px) scale(0.4); }
}

/* Statuslabels — combineren altijd kleur mét tekst/icoon (niet alleen kleur) */
.status { display: inline-flex; align-items: center; gap: var(--space-1); padding: 1px var(--space-2); border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 650; white-space: nowrap; }
.status--success { background: var(--color-success-bg); color: var(--color-success); }
.status--danger { background: var(--color-danger-bg); color: var(--color-danger); }
.status--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.status--muted { background: var(--color-surface-alt); color: var(--color-text-muted); }

/* ---------- Tabellen (bv. gebruikersbeheer, logs) ---------- */
.table-wrap { position: relative; overflow-x: auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data-table th, table.data-table td { padding: 0.6rem var(--space-4); text-align: left; border-bottom: 1px solid var(--color-border); white-space: nowrap; }
table.data-table th { color: var(--color-text-muted); font-weight: 650; font-size: var(--text-sm); background: var(--color-surface-alt); }
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: var(--color-surface-alt); }
table.data-table td.wrap { white-space: normal; }
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: end; margin-bottom: var(--space-4); }
.filter-bar .field { margin-bottom: 0; min-width: 180px; }
.action-group { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
form.inline-form { display: inline; }

/* Subtiel "···"-actiemenu voor tabelrijen (bv. gebruikersbeheer) — houdt een lange rij met
   knoppen (blokkeren, resetten, 2FA uitschakelen, verwijderen, ...) compact en pas zichtbaar
   na een klik, in plaats van een wand aan losse knoppen per regel. Gebruikt position:fixed
   (zie assets/js/row-actions.js) zodat het menu nooit wordt afgesneden door de scrollbare
   .table-wrap eromheen. */
.row-actions { position: relative; display: inline-flex; }
.row-actions__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    cursor: pointer;
}
.row-actions__trigger:hover,
.row-actions__trigger[aria-expanded="true"] {
    background: var(--color-surface-alt);
    border-color: var(--color-border);
    color: var(--color-text);
}
.row-actions__menu {
    display: none;
    position: fixed;
    min-width: 210px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-2);
    z-index: 200;
}
.row-actions__menu--open { display: block; }
.row-actions__menu a,
.row-actions__menu button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    background: none;
    border: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}
.row-actions__menu a:hover,
.row-actions__menu button:hover { background: var(--color-surface-alt); color: var(--color-primary); }
.row-actions__menu button.row-actions__danger { color: var(--color-danger); }
.row-actions__menu button.row-actions__danger:hover { background: var(--color-danger-bg); }
.row-actions__menu form { margin: 0; }

/* ---------- Login/registreren: tekst op het papier, formulier op een paneel ---------- */
.auth-shell {
    max-width: 1000px;
    margin: var(--space-10) auto var(--space-8);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    gap: var(--space-12);
    align-items: center;
}
.auth-shell__brand { display: flex; flex-direction: column; gap: var(--space-4); }
.auth-shell__badge { width: 3rem; height: 3rem; border-radius: var(--radius-md); display: block; }
.auth-shell__brand h2 { margin: 0; font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-stretch: var(--stretch-display); font-weight: 800; line-height: 1.08; letter-spacing: -0.015em; max-width: 14ch; }
.auth-shell__brand p { margin: 0; color: var(--color-text-muted); line-height: 1.6; font-size: var(--text-md); max-width: 42ch; }
.auth-shell__points { list-style: none; padding: 0; margin: var(--space-2) 0 0; display: flex; flex-direction: column; gap: var(--space-2); }
.auth-shell__points li { display: flex; gap: var(--space-3); align-items: baseline; font-size: var(--text-sm); line-height: 1.5; color: var(--color-text); }
.auth-shell__points li::before { content: ""; flex-shrink: 0; width: 0.55rem; height: 0.55rem; background: var(--color-signal); transform: translateY(-0.05em); }
.auth-shell__form {
    position: relative;
    padding: var(--space-8) var(--space-8) var(--space-6);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.auth-shell__form h1 { margin: 0 0 var(--space-1); font-size: var(--text-xl); }
.auth-shell__form > .page-subtitle { margin-bottom: var(--space-6); }
.auth-shell__form .btn:not(.btn--auto) { width: 100%; }

/* Rolkeuze op het registratieformulier (student / praktijkbegeleider) */
.role-switch {
    display: flex;
    gap: var(--space-1);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: var(--space-1);
    margin-bottom: var(--space-6);
}
.role-switch input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.role-switch label {
    flex: 1;
    text-align: center;
    padding: 0.55rem var(--space-3);
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--color-text-muted);
    cursor: pointer;
}
.role-switch input[type="radio"]:checked + label {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}
.role-switch input[type="radio"]:focus-visible + label {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}

@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; gap: var(--space-5); margin: var(--space-4) auto; }
    .auth-shell__brand { gap: var(--space-2); }
    .auth-shell__brand .auth-shell__points, .auth-shell__brand p, .auth-shell__badge { display: none; }
    .auth-shell__brand h2 { font-size: var(--text-2xl); max-width: none; }
    .auth-shell__form { padding: var(--space-6) var(--space-5) var(--space-5); }
}

/* ---------- Profielfoto bijsnijden (cirkel) ---------- */
.avatar-crop-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--color-overlay);
    z-index: 1000;
    padding: var(--space-4);
    align-items: center;
    justify-content: center;
}
.avatar-crop-modal--open { display: flex; }
.avatar-crop-modal__box {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: var(--space-6);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}
.avatar-crop-modal__imgwrap {
    max-height: 55vh;
    overflow: hidden;
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
}
.avatar-crop-modal__imgwrap img { display: block; max-width: 100%; }

/* Ronde weergave van het crop-vlak, zodat duidelijk is dat het eindresultaat een cirkel wordt */
.avatar-crop-modal .cropper-view-box,
.avatar-crop-modal .cropper-face {
    border-radius: 50%;
}
.avatar-crop-modal .cropper-view-box { outline: 1px solid var(--color-on-dark); outline-color: var(--color-on-dark); }

.qr-box {
    display: inline-block;
    background: var(--color-qr-paper);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    line-height: 0;
}
.qr-box svg { display: block; width: 200px; height: 200px; }

.helper-links { text-align: center; margin-top: var(--space-4); font-size: 0.9rem; color: var(--color-text-muted); }

/* ---------- Stap-voor-stap wizard (bv. 2FA instellen) ---------- */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}
.wizard-steps__step {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-muted);
    font-size: 0.85rem;
}
.wizard-steps__dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    color: var(--color-text-muted);
    font-weight: 600;
    flex-shrink: 0;
}
.wizard-steps__step--done .wizard-steps__dot { border-color: var(--color-success); background: var(--color-success-bg); color: var(--color-success); }
.wizard-steps__step--current .wizard-steps__dot { border-color: var(--color-primary); background: var(--color-primary); color: var(--color-primary-contrast); }
.wizard-steps__step--current { color: var(--color-text); font-weight: 600; }
.wizard-steps__line { width: var(--space-8); height: 2px; background: var(--color-border); flex-shrink: 0; }
.wizard-steps__line--done { background: var(--color-success); }
.wizard-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-top: var(--space-6); }

/* ---------- Helppagina ---------- */
.help-toc {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}
.help-toc a {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
}
.help-toc a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.help-role-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 var(--space-6); }
.help-role-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}
.help-role-badge--student { background: var(--color-primary); color: var(--color-primary-contrast); }
.help-role-badge--admin { background: var(--color-success-bg); color: var(--color-success); }
.help-role-badge--superadmin { background: var(--color-warning-bg); color: var(--color-warning); }
.help-section { margin-bottom: var(--space-8); }
.help-section h2 {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--color-border);
}
.help-topic { margin-bottom: var(--space-6); }
.help-topic h3 { margin-bottom: var(--space-1); }
.help-figure {
    /* Bewust een duidelijk "fotolijstje"-uiterlijk (dikke rand + padding rondom + schaduw + een
       flinke max-breedte) zodat een screenshot nooit met de pagina zelf te verwarren is, ongeacht
       hoe breed de omliggende tekstkolom is. */
    display: inline-block;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    margin: var(--space-3) 0;
    padding: var(--space-2);
    background: var(--color-surface);
    max-width: 260px;
    box-shadow: var(--shadow-md);
    position: relative;
}
.help-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: calc(var(--radius-md) - 3px);
    cursor: zoom-in;
}
.help-figure figcaption {
    padding: var(--space-2) var(--space-1) 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}
/* Altijd zichtbare hint (niet pas bij hover) zodat "hier kun je op klikken" nooit gemist wordt. */
.help-figure figcaption::after {
    content: "\1F50D  Klik om te vergroten";
    display: block;
    margin-top: var(--space-1);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-primary);
}
.help-figure-row { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.help-figure-row .help-figure { flex: 0 1 220px; max-width: 220px; }

/* Klik-om-te-vergroten overlay voor help-/homepage-afbeeldingen — vervaagt + schaalt licht in
   i.p.v. abrupt te tonen/verbergen. Gestuurd door de bestaande hidden-attribuuttoggle in JS
   (help.php/index.php doen gewoon lightbox.hidden = false/true, geen scriptwijziging nodig):
   het element blijft display:flex zodat opacity/transform kunnen transitionen, maar is bij
   [hidden] ook onklikbaar (pointer-events:none) en blijft — dankzij het hidden-attribuut zelf,
   los van de CSS — buiten bereik van schermlezers. */
.help-lightbox {
    position: fixed;
    inset: 0;
    background: var(--color-scrim);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-6);
    z-index: 1000;
    cursor: zoom-out;
    opacity: 1;
    transition: opacity 0.18s ease;
}
.help-lightbox[hidden] {
    display: flex;
    opacity: 0;
    pointer-events: none;
}
.help-lightbox img {
    max-width: min(90vw, 900px);
    max-height: 82vh;
    width: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: scale(1);
    transition: transform 0.18s ease;
}
.help-lightbox[hidden] img { transform: scale(0.96); }
.help-lightbox__caption {
    color: var(--color-on-dark);
    font-size: 0.9rem;
    text-align: center;
    max-width: 640px;
}
.help-lightbox__hint {
    color: var(--color-on-dark-muted);
    font-size: 0.8rem;
}

/* Generieke pop-up voor een korte melding (zie assets/js/test-instant-feedback.js: directe
   feedback zodra een student een antwoordoptie kiest). Zelfde overlay-aanpak als .help-lightbox
   hierboven (fixed + fade), maar met een tekstkaart i.p.v. een afbeelding. */
.simple-modal {
    position: fixed;
    inset: 0;
    background: var(--color-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.18s ease;
}
.simple-modal[hidden] {
    display: flex;
    opacity: 0;
    pointer-events: none;
}
.simple-modal__box {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-5);
    max-width: min(480px, 92vw);
    transform: scale(1);
    transition: transform 0.18s ease;
}
.simple-modal[hidden] .simple-modal__box { transform: scale(0.96); }
.simple-modal__text {
    margin: 0 0 var(--space-4);
    white-space: pre-line;
}
.help-tip {
    background: var(--color-surface-alt);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
    margin: var(--space-3) 0;
    font-size: 0.92rem;
}
.help-back-to-top { text-align: right; font-size: 0.85rem; margin-top: var(--space-2); }

/* ---------- Berichten (chat) ---------- */
.messages-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: var(--space-4);
    align-items: start;
}
.messages-list {
    max-height: 65vh;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}
.messages-contact {
    display: block;
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text);
}
.messages-list .messages-contact:last-child { border-bottom: none; }
.messages-contact--active { background: var(--color-surface-alt); }
.messages-contact__row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.messages-contact__role,
.messages-contact__preview { margin: var(--space-1) 0 0; }

.messages-panel__title { margin-top: 0; }

.messages-thread {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: var(--space-4);
    padding-right: var(--space-2);
}
.msg {
    display: flex;
    flex-direction: column;
    max-width: 75%;
}
.msg--mine { align-self: flex-end; align-items: flex-end; }
.msg--theirs { align-self: flex-start; align-items: flex-start; }
.msg__bubble {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    line-height: 1.45;
    word-break: break-word;
}
.msg--theirs .msg__bubble {
    background: var(--color-surface-alt);
    color: var(--color-text);
    border-bottom-left-radius: var(--radius-sm);
}
.msg--mine .msg__bubble {
    background: var(--color-primary);
    color: var(--color-primary-contrast);
    border-bottom-right-radius: var(--radius-sm);
}
.msg__meta {
    margin: var(--space-1) 0 0;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

@media (max-width: 700px) {
    .messages-layout { grid-template-columns: 1fr; }
    .messages-list { max-height: 220px; }
}

.messages-list__section-label {
    padding: var(--space-3) var(--space-4) var(--space-1);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-text-muted);
}
.messages-contact__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--tile-violet-bg);
    color: var(--tile-violet);
    flex-shrink: 0;
}
.messages-contact__icon svg { width: 1rem; height: 1rem; }
.msg__sender { margin: 0 0 0.2rem; font-size: 0.78rem; font-weight: 700; color: var(--color-text-muted); }
.msg__read { color: var(--color-primary); font-weight: 600; }

/* ---------- "Nieuw bericht"-contactkiezer (modal) ---------- */
.new-message-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--color-overlay);
    z-index: 1000;
    padding: var(--space-4);
    align-items: center;
    justify-content: center;
}
.new-message-modal--open { display: flex; }
.new-message-modal__box {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: var(--space-6);
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.new-message-modal__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-4); }
.new-message-modal__header h2 { margin: 0; }
.new-message-modal__close {
    background: var(--color-surface-alt);
    border: none;
    color: var(--color-text-muted);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}
.new-message-modal__close:hover { color: var(--color-text); background: var(--color-border); }
.new-message-modal__list { overflow-y: auto; flex: 1; margin: 0 calc(var(--space-6) * -1); padding: 0 var(--space-2); }
.new-message-modal__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--color-text);
}
.new-message-modal__item:hover { background: var(--color-surface-alt); }
.new-message-modal__item .field-hint { margin: 0; }

/* ---------- Casusteksten met opmaak (Quill-editor + weergave) ---------- */
/* De echte <textarea data-richtext> blijft in de DOM (met dezelfde name, zie
   assets/js/richtext-editor.js) maar wordt na initialisatie verborgen; dit vlak neemt
   de invoer visueel over. Randstijl consistent met de rest van de formuliervelden. */
.richtext-editor {
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.richtext-editor .ql-toolbar.ql-snow {
    border: none;
    border-bottom: 1px solid var(--color-input-border);
    background: var(--color-surface-alt);
    font-family: inherit;
}
.richtext-editor .ql-container.ql-snow { border: none; font-family: inherit; }
.richtext-editor .ql-editor {
    min-height: 8rem;
    resize: vertical;
    overflow-y: auto;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 1rem;
}
.richtext-editor .ql-editor.ql-blank::before { color: var(--color-text-muted); font-style: normal; }
.richtext-editor .ql-editor img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
/* Grotere standaardhoogte voor de "tekst"-blokeditor (meestal de langste inhoud van een casus) —
   zie data-richtext-size="tall" in block_edit.php. Blijft, net als hierboven, met de muis
   verticaal vergrootbaar. */
.richtext-editor--tall .ql-editor { min-height: 20rem; }
.richtext-editor .ql-toolbar.ql-snow .ql-stroke { stroke: var(--color-text-muted); }
.richtext-editor .ql-toolbar.ql-snow .ql-fill { fill: var(--color-text-muted); }
.richtext-editor .ql-toolbar.ql-snow .ql-picker { color: var(--color-text-muted); }
.richtext-editor .ql-toolbar.ql-snow .ql-picker-options {
    background: var(--color-surface);
    border-color: var(--color-input-border) !important;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}
.richtext-editor .ql-toolbar.ql-snow button:hover .ql-stroke,
.richtext-editor .ql-toolbar.ql-snow button.ql-active .ql-stroke,
.richtext-editor .ql-toolbar.ql-snow .ql-picker-label:hover .ql-stroke,
.richtext-editor .ql-toolbar.ql-snow .ql-picker-item:hover .ql-stroke { stroke: var(--color-primary); }
.richtext-editor .ql-toolbar.ql-snow button:hover .ql-fill,
.richtext-editor .ql-toolbar.ql-snow button.ql-active .ql-fill,
.richtext-editor .ql-toolbar.ql-snow .ql-picker-label:hover,
.richtext-editor .ql-toolbar.ql-snow .ql-picker-item:hover { fill: var(--color-primary); color: var(--color-primary); }
.richtext-editor .ql-snow .ql-tooltip {
    background: var(--color-surface);
    border-color: var(--color-input-border);
    color: var(--color-text);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}
.richtext-editor .ql-snow .ql-tooltip input[type="text"] {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-input-border);
}

/* Weergave van de opgeslagen, al gesaneerde opmaak (zie render_rich_text() in
   includes/richtext.php) — dit is dezelfde tekst zonder de editorschil eromheen. */
.rich-text { line-height: var(--line-height-base); }
.rich-text > *:last-child { margin-bottom: 0; }
.rich-text ul, .rich-text ol { padding-left: 1.5em; margin: 0 0 var(--space-3); }
/* Quill slaat elke lijst op als <ol> en zet het bolletje/cijfer-onderscheid in
   data-list op elk <li> (zie includes/richtext.php) — hier tekenen we dat verschil. */
.rich-text li[data-list="bullet"] { list-style-type: disc; }
.rich-text p { margin: 0 0 var(--space-3); }
.rich-text a { color: var(--color-primary); }
.rich-text .ql-size-small { font-size: 0.75em; }
.rich-text .ql-size-large { font-size: 1.5em; }
.rich-text .ql-size-huge { font-size: 2.5em; }
.rich-text img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-md); margin: var(--space-2) 0; }

/* Klik-om-te-vergroten op foto's in een casus (zie assets/js/content-lightbox.js) — subtiele
   hover-cue zodat duidelijk is dat de foto aanklikbaar is. */
.lightbox-zoomable { cursor: zoom-in; transition: transform 0.15s ease, opacity 0.15s ease; }
.lightbox-zoomable:hover { opacity: 0.92; }

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2) var(--space-6);
    width: 100%;
    max-width: calc(var(--content-max) + 2 * var(--space-8));
    margin: 0 auto;
    padding: var(--space-6) var(--space-8) var(--space-8);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}
.site-footer__changelog { color: inherit; }
.site-footer__changelog:hover { color: var(--color-text); }
.site-footer__version { color: var(--color-text-muted); }

/* ---------- Fout melden: klein venster midden in beeld, geopend vanuit het profielmenu of de
   voettekst (zie includes/footer.php en assets/js/bug-report.js) ---------- */
.bug-report {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: var(--color-overlay);
}
.bug-report[hidden] { display: none; }
.bug-report__panel {
    width: min(440px, 100%);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-5);
    animation: fade-rise-in 0.2s ease;
}
.bug-report__panel textarea { margin-bottom: var(--space-3); }
.bug-report__title { margin: 0 0 var(--space-1); font-weight: 700; font-size: 1.05rem; }
.bug-report__actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
.site-footer__link {
    min-height: 2rem;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}
.site-footer__link:hover { color: var(--color-text); }
.meta-sep { display: inline-block; width: 1px; height: 0.9em; margin: 0 var(--space-2); background: var(--color-btn-border); vertical-align: -0.1em; }

/* ---------------------------------------------------------
   Beeldmateriaal bij casusblokken (foto/audio/video)
   --------------------------------------------------------- */
.block-media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-4);
    margin: 0 0 var(--space-4);
}
.block-media-gallery__item {
    margin: 0;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-2);
}
.block-media-gallery__item img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
.block-media-gallery__item audio,
.block-media-gallery__item video { display: block; width: 100%; }
.block-media-gallery__item video { border-radius: var(--radius-sm); background: var(--color-media-bg); }
.block-media-gallery__item figcaption { margin-top: var(--space-2); font-size: 0.85rem; color: var(--color-text-muted); }

.block-media-manage { display: flex; flex-direction: column; gap: var(--space-4); }
.block-media-manage__item {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    padding: var(--space-3);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.block-media-manage__preview { flex: 0 0 200px; max-width: 200px; }
.block-media-manage__preview img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
.block-media-manage__preview audio,
.block-media-manage__preview video { display: block; width: 100%; }
.block-media-manage__controls { flex: 1; min-width: 220px; }

/* ---------------------------------------------------------
   Badges / prestaties
   --------------------------------------------------------- */
.badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: var(--space-4);
    margin: 0 0 var(--space-6);
}
.badge-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}
.badge-tile__icon {
    position: relative;
    font-size: 2.2rem;
    line-height: 1;
    width: 3.4rem;
    height: 3.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--color-surface-alt);
}
.badge-tile--earned { border-color: var(--color-success); background: var(--color-success-bg); }
.badge-tile--earned .badge-tile__icon { background: var(--color-surface); }
.badge-tile--locked { opacity: 0.6; }
.badge-tile--locked .badge-tile__icon { filter: grayscale(1); }
.badge-tile__name { margin: 0; font-weight: 700; }
.badge-tile__desc { margin: 0; font-size: 0.82rem; color: var(--color-text-muted); }
.badge-tile__earned-at { margin: 0; font-size: 0.75rem; color: var(--color-success); font-weight: 600; }
.badge-tile--secret .badge-tile__name { color: var(--color-text-muted); }

/* "×N" op een herhaalbare badge die al meer dan één keer verdiend is — een klein pilletje
   rechtsonder in de icoon-cirkel, zodat het opvalt zonder de tegel verder te verstoren.
   --sm is de kleinere variant voor de badge-rij op het studentendashboard (geen cirkel-icoon
   daar, dus geen absolute positionering nodig — gewoon inline naast het emoji). */
.badge-tile__count {
    position: absolute;
    bottom: -0.2rem;
    right: -0.35rem;
    background: var(--color-primary);
    color: var(--color-primary-contrast);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    padding: 0.22rem 0.4rem;
    border-radius: var(--radius-pill);
    border: 2px solid var(--color-surface);
}
.badge-tile__count--sm { position: static; display: inline-block; margin-left: 0.15rem; font-size: 0.6rem; padding: 0.15rem 0.32rem; border-width: 1px; vertical-align: top; }
.badge-tile__hint { margin: 0; font-size: 0.75rem; color: var(--color-text-muted); }
/* Voortgang van een lopende reeks (streak) bij een zichtbare badge die nog niet verdiend is. */
.badge-tile__progress { margin: 0; font-size: 0.78rem; color: var(--color-text-muted); font-weight: 600; width: 100%; }
.badge-tile__progress-bar {
    display: block;
    margin-top: 0.3rem;
    height: 0.4rem;
    border-radius: var(--radius-pill);
    background: var(--color-border);
    overflow: hidden;
}
.badge-tile__progress-bar span { display: block; height: 100%; background: var(--color-primary); border-radius: var(--radius-pill); }

/* ---------------------------------------------------------
   Eenvoudige server-gerenderde staafdiagrammen (superadmin_stats.php) — bewust geen JS-
   grafiekbibliotheek nodig voor een handvol staven. Verticaal (.bar-chart, per uur/weekdag/dag)
   en horizontaal (.hbar-chart, ranglijst van meest bezochte pagina's). Steeds één kleur
   (--color-primary) voor de balken zelf; identiteit/labels komen uit tekst, niet uit kleur.
   --------------------------------------------------------- */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: var(--space-1);
    height: 12rem;
    padding-top: var(--space-4);
}
.bar-chart__col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}
.bar-chart__value { font-size: 0.68rem; font-weight: 700; color: var(--color-text-muted); margin-bottom: 0.2rem; white-space: nowrap; }
.bar-chart__bar {
    width: 100%;
    min-height: 2px;
    background: var(--color-primary);
    border-radius: 4px 4px 0 0;
}
.bar-chart__label { margin-top: 0.4rem; font-size: 0.7rem; color: var(--color-text-muted); white-space: nowrap; }
.bar-chart--days .bar-chart__col { flex-basis: 0; }

.hbar-chart { display: flex; flex-direction: column; gap: var(--space-3); }
.hbar-chart__row { display: grid; grid-template-columns: minmax(120px, 13rem) 1fr auto; align-items: center; gap: var(--space-3); }
.hbar-chart__label { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-chart__track { background: var(--color-surface-alt); border-radius: var(--radius-pill); height: 0.65rem; overflow: hidden; }
.hbar-chart__bar { display: block; height: 100%; min-width: 4px; background: var(--color-primary); border-radius: var(--radius-pill); }
.hbar-chart__value { font-size: 0.8rem; font-weight: 700; color: var(--color-text-muted); min-width: 2rem; text-align: right; }
@media (max-width: 700px) {
    .hbar-chart__row { grid-template-columns: minmax(90px, 8rem) 1fr auto; }
    .hbar-chart__label { font-size: 0.78rem; }
}

/* ---------------------------------------------------------
   Multi-select met checkboxen die open blijft staan (bv. studenten aan een groep toevoegen)
   --------------------------------------------------------- */
.multi-select { position: relative; display: inline-block; width: 100%; max-width: 420px; }
.multi-select__trigger {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--color-text);
    cursor: pointer;
}
.multi-select__trigger:hover { border-color: var(--color-primary); }
.multi-select__caret { flex-shrink: 0; opacity: 0.6; }
.multi-select__panel {
    display: none;
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-2);
}
.multi-select--open .multi-select__panel { display: block; }
.multi-select__filter { width: 100%; margin-bottom: var(--space-2); }
.multi-select__option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.4rem var(--space-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.multi-select__option:hover { background: var(--color-surface-alt); }
.multi-select__option input { width: auto; margin: 0; }

/* ---------------------------------------------------------
   Live zoekbalk om een bestaande student uit het team aan een groep toe te voegen (group.php,
   vervangt de oudere multi-select-dropdown hierboven voor dat specifieke gebruik) — de resultaten
   staan al in de pagina, dus filteren is puur client-side en dus meteen "live" bij het typen.
   --------------------------------------------------------- */
.student-search { margin-bottom: var(--space-2); }
.student-search__input-wrap { position: relative; max-width: 480px; }
.student-search__icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    display: flex;
}
.student-search__icon svg { width: 1.05rem; height: 1.05rem; }
/* input.student-search__input (element+class) i.p.v. alleen de class: de generieke
   `input[type="text"]{padding:...}`-regel (element+attribuut) heeft dezelfde specificiteit-
   "zwaarte" als een kale class-selector zou missen, en zou de padding-left anders alsnog
   overschrijven — zelfde soort les als de eerdere CSS-specificiteitsbugs in dit bestand. */
input.student-search__input { padding-left: var(--space-10); }
/* De focus-variant van de generieke inputregel (verderop in dit bestand) zet ook een eigen
   padding-shorthand — zelfde specificiteitsval, dus ook hier expliciet overschrijven, anders
   springt het zoekicoon bij focus terug onder de getypte tekst. */

.student-search__results {
    margin-top: var(--space-3);
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.student-search__result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--color-border);
}
.student-search__result:last-child { border-bottom: none; }
.student-search__result:hover { background: var(--color-surface-alt); }
/* display:flex hierboven is een author-regel en wint anders altijd van de standaard
   [hidden]{display:none} van de browser, ongeacht specificiteit — zie eerdere .tile-grid[hidden]
   les. Zonder deze regel zou een gefilterd-weg resultaat toch zichtbaar blijven. */
.student-search__result[hidden] { display: none; }
.student-search__result-info { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.student-search__result-info strong { font-size: 0.92rem; }
.student-search__empty { margin-top: var(--space-3); }

/* Kleine tekstknop die eruitziet als een link — bv. de "nieuwe student uitnodigen"-suggestie
   in een leeg zoekresultaat, waar een volwaardige .btn te zwaar oogt tussen doorlopende tekst. */
.btn-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--color-primary);
    font-weight: 600;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
}
.btn-link:hover { text-decoration: none; }

/* ---------- Toetsen: weergavekeuze & "één vraag per keer" ---------- */
.toets-mode-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3);
}
.toets-mode-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 0.12s ease, background-color 0.12s ease;
    font-weight: 400;
    margin-bottom: 0 !important;
}
.toets-mode-option input[type="radio"] { margin-top: 0.2rem; flex-shrink: 0; }
.toets-mode-option span { display: flex; flex-direction: column; gap: 0.15rem; }
.toets-mode-option strong { font-size: 0.95rem; }
.toets-mode-option:hover { border-color: var(--color-primary); }
.toets-mode-option:has(input:checked) {
    border-color: var(--color-primary);
    background: var(--color-surface-alt);
    box-shadow: var(--shadow-sm);
}
.toets-mode-option:has(input:focus-visible) {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}

/* Voortgangsstippen boven de "één vraag per keer"-weergave. */
.toets-oneq-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    max-width: 640px;
    margin: 0 auto var(--space-6);
}
.toets-oneq-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--color-border);
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.toets-oneq-dot.is-answered { background: var(--color-success); }
.toets-oneq-dot.is-current {
    background: var(--color-primary);
    transform: scale(1.4);
}

/* De vraagkaart zelf, gecentreerd en met alle ruimte voor zich, zoals gevraagd:
   "een clean scherm met de vraag duidelijk leesbaar en gecentreerd". */
.toets-oneq-stage .toets-vraag {
    max-width: 640px;
    margin: 0 auto var(--space-6) !important;
    padding: var(--space-6);
    text-align: left;
}
.toets-oneq-stage .toets-vraag p { font-size: 1.15rem; }

.toets-oneq-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    max-width: 640px;
    margin: 0 auto var(--space-4);
}
.toets-oneq-nav .btn { width: auto; }
.toets-oneq-progress {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

@media (max-width: 600px) {
    .toets-oneq-nav { flex-wrap: wrap; justify-content: center; }
    .toets-oneq-progress { order: -1; width: 100%; text-align: center; }
}

/* ---------- Toets-editor: in-/uitklapbare vraagkaarten (test_edit.php) ----------
   Elke vraag staat standaard dichtgeklapt (alleen de koptekst) zodat een toets met veel vragen
   overzichtelijk blijft; opslaan/toevoegen/verwijderen/verplaatsen gaat via assets/js/
   test-questions.js zonder de pagina te herladen — de kaart blijft dus precies zo staan
   (open/dicht, scrollpositie) als vóór het opslaan. */
.qcard-toolbar {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}
.qcard {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-3);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.js .qcard--removing { opacity: 0; transform: translateY(-4px); }
.qcard__header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
}
.qcard__toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
}
.qcard__toggle:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}
.qcard__chevron {
    flex-shrink: 0;
    display: inline-block;
    color: var(--color-text-muted);
    transition: transform 0.15s ease;
}
.qcard__toggle[aria-expanded="true"] .qcard__chevron { transform: rotate(180deg); }
.qcard__summary {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.qcard__index { font-size: 0.78rem; font-weight: 700; color: var(--color-text-muted); letter-spacing: 0.03em; }
.qcard__prompt-preview {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.qcard__meta { font-size: 0.82rem; color: var(--color-text-muted); }
.qcard__quick-actions { display: flex; gap: var(--space-2); flex-shrink: 0; }
.qcard__body {
    padding: 0 var(--space-4) var(--space-4);
    border-top: 1px solid var(--color-border);
    margin-top: 0;
    padding-top: var(--space-4);
}
.qcard__body:not([hidden]) { animation: fade-rise-in 0.15s ease; }
.qcard__option-row { transition: opacity 0.2s ease, transform 0.2s ease; }
.js .qcard__option-row--removing { opacity: 0; transform: translateX(-6px); }

/* Klein, stil "opgeslagen"-bevestigingsteksje naast een opslaanknop — vervaagt vanzelf weer,
   geen aparte melding nodig voor elke kleine wijziging. */
.save-indicator {
    color: var(--color-success);
    font-size: 0.85rem;
    font-weight: 600;
}

/* Met JS aan (assets/js/test-questions.js) slaat een vraag/antwoordoptie zichzelf op zodra je
   een veld verlaat of een vinkje aanpast — de aparte "Opslaan"-knop per vraag/optie is dan
   overbodig en dus verborgen. De knop blijft wel gewoon in de HTML staan als vangnet voor zonder
   JavaScript (.js-autosave wordt alleen toegevoegd als het script daadwerkelijk draait). */
#questions-list.js-autosave .qcard__manual-save { display: none; }

/* ---------- Instellingenpagina: linker zijbalk i.p.v. 4 kaarten naast elkaar ---------- */
.settings-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    align-items: start;
    gap: var(--space-6);
}
.settings-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    position: sticky;
    top: var(--space-4);
}
.settings-sidebar__link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.settings-sidebar__link svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.settings-sidebar__link:hover { background: var(--color-surface-alt); color: var(--color-text); }
.settings-sidebar__link.is-active {
    background: var(--color-primary-tint);
    color: var(--color-primary);
}
.settings-sidebar__link:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 2px;
}
.settings-content { min-width: 0; }
.settings-content .settings-section:not([hidden]) {
    animation: fade-rise-in 0.15s ease;
}
/* Generieke "vervaagd + licht omhoog" intro-animatie — ook gebruikt door .alert, .auth-shell
   en .contact-form__success (zie daar), zodat elke plek waar iets verschijnt na een handeling
   (opslaan, inloggen, formulier versturen) dezelfde subtiele, herkenbare beweging deelt. */
@keyframes fade-rise-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
    .settings-layout { grid-template-columns: 1fr; }
    .settings-sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-2);
        margin-bottom: var(--space-2);
    }
    .settings-sidebar {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 calc(-1 * var(--space-4)) var(--space-2);
        padding: 0 var(--space-4) var(--space-1);
        scrollbar-width: none;
    }
    .settings-sidebar__link { flex: 0 0 auto; white-space: nowrap; }
}

/* ---------- Navigatiebalk op mobiel: hamburgermenu i.p.v. de horizontale rij ----------
   Onder deze breedte (zelfde grens als de instellingenpagina hierboven) verschijnt de
   hamburgerknop en klapt de navigatie dicht tot die aangeklikt wordt (assets/js/nav.js regelt
   het aan/uit-klappen). De navigatie-items komen dan onder elkaar te staan i.p.v. in een rij die
   op een smal scherm anders al snel over meerdere regels afbreekt.
   Submenu's (het "Beheer"-menu en het meldingenbelletje) krijgen hier bewust position:static in
   plaats van position:absolute: die zweefden voorheen los boven de pagina uitgelijnd op de rand
   van hun eigen (vaak smalle) knop, waardoor ze op een smal scherm voor een deel buiten beeld
   konden vallen als die knop niet toevallig helemaal rechts stond. Statisch, volle breedte en
   gewoon in de doorloop van de pagina kán per definitie niet meer buiten het scherm vallen. */
@media (max-width: 760px) {
    .nav-toggle-btn { display: inline-flex; }
    .nav {
        display: none;
        width: 100%;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-1);
        margin-top: var(--space-3);
        padding-top: var(--space-3);
        border-top: 1px solid var(--color-border);
    }
    .nav.nav--open { display: flex; }
    .nav__divider, .nav__spacer { display: none; }
    .nav-dropdown__trigger { width: 100%; justify-content: flex-start; }
    .nav-dropdown__trigger .nav-dropdown__caret { margin-left: auto; }
    .nav-dropdown__label { display: inline; }
    .nav-dropdown--profile { border-top: 1px solid var(--color-border); margin-top: var(--space-1); padding-top: var(--space-2); }
    .nav-dropdown__menu {
        position: static;
        width: 100%;
        max-width: none;
        margin-top: var(--space-1);
        box-shadow: none;
    }
    .nav-dropdown__menu--notifs, .nav-dropdown__menu--profile { max-width: none; width: 100%; }
    .site-header__inner { padding: var(--space-3) var(--space-4); }
    main { padding: var(--space-4) var(--space-4) var(--space-8); }
}

/* ---------------------------------------------------------
   Homepage (index.php): uitleg en het aanvragen van een account links, direct inloggen rechts.
   De meeste bezoekers hebben al een account, dus het inlogvak staat meteen in beeld.
   --------------------------------------------------------- */
.landing { max-width: var(--content-max); margin: 0 auto; padding-bottom: var(--space-8); }

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
    grid-template-areas: "intro login" "account login";
    gap: 0 var(--space-16);
    align-items: start;
    padding: var(--space-12) 0 var(--space-16);
}
.home-hero__intro { grid-area: intro; }
.home-hero__account { grid-area: account; }
.home-login { grid-area: login; }
.home-hero__title { margin: 0; font-size: clamp(2.1rem, 4.4vw, 3.1rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.01em; max-width: 15ch; }
.home-hero__lead { margin: var(--space-5) 0 var(--space-10); font-size: var(--text-lg); line-height: 1.55; color: var(--color-text-muted); max-width: 46ch; }
.home-steps__title { margin: 0 0 var(--space-4); font-size: var(--text-lg); }
.home-steps { list-style: none; counter-reset: home-step; margin: 0 0 var(--space-6); padding: 0; display: grid; gap: var(--space-4); max-width: 52ch; }
.home-steps li { counter-increment: home-step; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: var(--space-3); align-items: start; color: var(--color-text-muted); }
.home-steps li::before {
    content: counter(home-step);
    display: grid; place-items: center;
    width: 2rem; height: 2rem; border-radius: var(--radius-sm);
    background: var(--color-primary-tint); color: var(--color-primary);
    font-weight: 750; font-size: var(--text-sm);
}
.home-hero__account > .btn { min-height: 2.75rem; }

.home-login { padding: var(--space-8); }
.home-login__title { margin: 0 0 var(--space-5); font-size: var(--text-xl); }
.home-login form .btn, .home-login .passkey-login .btn { width: 100%; min-height: 2.75rem; }
.home-login input { min-height: 2.75rem; }
.home-login__links { margin: var(--space-5) 0 0; font-size: var(--text-sm); text-align: center; }

.home-contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: var(--space-10);
    align-items: start;
    padding: var(--space-12) 0 var(--space-8);
    border-top: 1px solid var(--color-border);
}
.home-contact__title { margin: 0 0 var(--space-2); font-size: var(--text-lg); }
.home-contact__intro p { margin: 0; color: var(--color-text-muted); }
.home-contact__form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-4); }
.home-contact__form .alert, .home-contact__message { grid-column: 1 / -1; }
.home-contact__form > .btn { justify-self: start; min-height: 2.75rem; }
.home-contact__form input, .home-contact__form textarea { min-height: 2.75rem; }

@media (max-width: 860px) {
    .home-hero { grid-template-columns: 1fr; grid-template-areas: "intro" "login" "account"; padding: var(--space-6) 0 var(--space-12); }
    .home-hero__lead { margin-bottom: var(--space-6); }
    .home-login { margin-bottom: var(--space-10); }
    .home-login { padding: var(--space-6); }
    .home-contact { grid-template-columns: 1fr; gap: var(--space-5); }
}
@media (max-width: 560px) {
    .home-contact__form { grid-template-columns: 1fr; }
}

.contact-card { width: 100%; }
.contact-form__success { margin: 0; padding: var(--space-3) 0; font-weight: 600; color: var(--color-success); animation: fade-rise-in 0.3s ease; }
/* Honeypot-veld: onzichtbaar voor mensen, maar wel aanwezig in de DOM voor bots die formulieren
   blind invullen. display:none zou door sommige bots genegeerd worden, dus off-screen plaatsen. */
.contact-form__hp {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Dashboard: overzichtelijke lijst-items (Bezig/Nog te doen/Afgerond) ---------- */
.dash-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-3);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.dash-item:last-child { margin-bottom: 0; }
.dash-item__main { min-width: 0; }
.dash-item__title { margin: 0; font-weight: 600; }
.dash-item__badges { margin: var(--space-1) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.dash-item__extra { margin: var(--space-2) 0 0; }
.dash-item__action { flex-shrink: 0; }

/* Raster-/lijstweergave-schakelaar boven de Casussen-/Toetsen-secties op het studentendashboard:
   "grid" is de bestaande tegel-naast-elkaar-indeling, "list" zet dezelfde secties in één kolom
   vol-breed onder elkaar — puur een CSS-omschakeling, de content zelf verandert niet. */
.dash-view-toggle { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.dash-view-toggle__btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-pill);
    color: var(--color-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
}
.dash-view-toggle__btn svg { width: 1rem; height: 1rem; }
.dash-view-toggle__btn[aria-pressed="true"] { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-contrast); }
#dashboard-view-root[data-view="list"] .tile-grid--3 { grid-template-columns: minmax(0, 1fr); }

/* Compacte lijstweergave voor "navigatietegel"-dashboards (vooralsnog het
   beheerdersoverzicht): i.p.v. de grote tegels naast elkaar (raster) staat elke tegel hier als
   een smalle rij onder elkaar — icoon, titel + omschrijving en eventuele actie(s) op één regel,
   zodat veel tegels tegelijk in beeld passen zonder te scrollen. */
#dashboard-view-root[data-view="list"] .tile-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
}
#dashboard-view-root[data-view="list"] .tile {
    flex-direction: row;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
}
#dashboard-view-root[data-view="list"] .tile::before {
    top: 0; bottom: 0; left: 0; right: auto;
    width: 4px; height: auto;
}
#dashboard-view-root[data-view="list"] .tile__icon { margin: 0; width: 2.25rem; height: 2.25rem; flex-shrink: 0; }
#dashboard-view-root[data-view="list"] .tile__icon svg { width: 1.1rem; height: 1.1rem; }
#dashboard-view-root[data-view="list"] .tile__title { margin: 0; font-size: 0.95rem; flex-shrink: 0; }
#dashboard-view-root[data-view="list"] .tile__desc { margin: 0; font-size: 0.85rem; }
#dashboard-view-root[data-view="list"] .tile__actions { margin: 0; padding: 0; flex-shrink: 0; }
#dashboard-view-root[data-view="list"] .tile--stat {
    flex-direction: row;
    align-items: baseline;
    padding: var(--space-3) var(--space-4);
}
#dashboard-view-root[data-view="list"] .tile--stat .tile__value { margin: 0; font-size: 1.4rem; }
@media (max-width: 640px) {
    #dashboard-view-root[data-view="list"] .tile { flex-wrap: wrap; }
}

/* ---------- Meldingencentrum (belletje in de navigatiebalk, zie includes/notifications.php) ---------- */
.nav-dropdown__trigger svg { width: 1.1rem; height: 1.1rem; }
.nav-dropdown__trigger .status { padding: 0 0.4rem; font-size: 0.68rem; margin-left: 2px; }
.nav-dropdown__menu--notifs { width: 320px; max-width: 90vw; max-height: 70vh; overflow-y: auto; overflow-x: hidden; }
/* De "Alles als gelezen markeren"-knop staat bovenaan het meldingenmenu (i.p.v. onderaan) — een
   dunne scheidingslijn eronder houdt hem visueel los van de meldingenlijst die erop volgt. */
.nav-dropdown__menu--notifs .nav-dropdown__group {
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-2);
}
/* Specifieker dan de algemene ".nav-dropdown__menu a"-regel hierboven (die white-space:nowrap en
   display:block zet voor de korte "Beheer"-menu-items) — anders wint die regel op specificiteit
   en blijft een melding op één regel staan (afgekapt, met een horizontale scrollbalk als gevolg)
   in plaats van netjes af te breken. */
.nav-dropdown__menu .notif-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    white-space: normal;
}
.notif-item--unread { background: var(--color-surface-alt); }
.notif-item__icon { flex-shrink: 0; margin-top: 2px; color: var(--color-text-muted); }
.notif-item__icon svg { width: 1.05rem; height: 1.05rem; }
.notif-item__body { display: block; min-width: 0; }
.notif-item__content { display: block; font-size: 0.88rem; line-height: 1.35; color: var(--color-text); }
.notif-item__meta { display: block; font-size: 0.74rem; color: var(--color-text-muted); margin-top: 2px; }

/* ---------- Voortgangsoverzicht student (progress.php): tijdlijn van afgeronde casussen/toetsen
   en verdiende badges, nieuwste bovenaan. Zelfde kaartlook als .dash-item, maar met een gekleurde
   linkerrand + icoon per type i.p.v. een actieknop. ---------- */
.timeline { display: flex; flex-direction: column; gap: var(--space-3); }
.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-md);
}
.timeline-item--badge { border-left-color: var(--tile-amber); }
.timeline-item--test { border-left-color: var(--tile-teal); }
.timeline-item__icon { flex-shrink: 0; margin-top: 2px; color: var(--color-text-muted); }
.timeline-item__icon svg { width: 1.15rem; height: 1.15rem; }
.timeline-item__body { min-width: 0; }
.timeline-item__title { margin: 0; font-weight: 600; }
.timeline-item__date { margin: 2px 0 0; font-size: 0.8rem; color: var(--color-text-muted); }

/* =========================================================
   v1.19 — opgeschoonde navigatie, toasts, lege staten, actie-eerst-dashboards,
   zoek-/filterbalken, sorteerbare tabellen en de focusmodus voor casus/toets.
   ========================================================= */

/* ---------- Navigatie: pijltjes, actieve "Beheer"-knop en het profielmenu ---------- */
.nav-dropdown__caret { display: inline-flex; }
.nav-dropdown__trigger .nav-dropdown__caret svg { width: 0.85rem; height: 0.85rem; }
.nav-dropdown__trigger--active { color: var(--color-primary); background: var(--tile-blue-bg); }
.nav-dropdown__trigger.user-chip {
    padding: 0.2rem var(--space-2) 0.2rem 0.2rem;
    border-radius: var(--radius-pill);
    color: var(--color-text);
    gap: var(--space-2);
}
.nav-dropdown__menu--profile { min-width: 230px; }
/* Het Beheer-menu staat links in de balk: laat het uitklappen vanaf de linkerrand van de knop. */
.nav-dropdown--left .nav-dropdown__menu { left: 0; right: auto; }
.profile-menu__head {
    display: flex;
    flex-direction: column;
    padding: var(--space-2) var(--space-3) var(--space-3);
    margin-bottom: var(--space-1);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
}
.profile-menu__head span { font-size: 0.78rem; color: var(--color-text-muted); }
.profile-menu__sep { height: 1px; background: var(--color-border); margin: var(--space-1) 0; }
/* Specifieker dan ".nav-dropdown__menu a" (display:block), zodat icoon en tekst naast elkaar staan. */
.nav-dropdown__menu .nav-dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.nav-dropdown__menu .nav-dropdown__item:hover { background: var(--color-surface-alt); color: var(--color-primary); }
.nav-dropdown__menu .nav-dropdown__item svg { width: 1.05rem; height: 1.05rem; flex-shrink: 0; color: var(--color-text-muted); }
.theme-toggle-btn__icon--moon-wrap,
.theme-toggle-btn__icon--sun-wrap { display: inline-flex; align-items: center; gap: var(--space-2); }
.theme-toggle-btn__icon--sun-wrap { display: none; }
:root[data-theme="dark"] .theme-toggle-btn__icon--moon-wrap { display: none; }
:root[data-theme="dark"] .theme-toggle-btn__icon--sun-wrap { display: inline-flex; }

/* ---------- Toasts (flash-meldingen rechtsonder, zie assets/js/toast.js) ---------- */
.flash-region { margin-bottom: var(--space-4); }
.flash-region .alert:last-child { margin-bottom: 0; }
.flash-region--toasts {
    position: fixed;
    right: var(--space-4);
    bottom: var(--space-4);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    width: min(400px, calc(100% - 2 * var(--space-4)));
    margin: 0;
    pointer-events: none;
}
.flash-region--toasts .alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin: 0;
    padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
    pointer-events: auto;
    box-shadow: var(--shadow-md);
    font-size: 0.9rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
    animation: toast-in 0.25s ease;
}
/* Gewone meldingen: neutraal vlak met een gekleurde streep links (de kleur draagt de betekenis
   nooit alleen — de tekst zegt zelf al wat er gebeurd is). De badge-melding houdt haar eigen
   feestelijke amberkleurige stijl (.alert--badge hierboven). */
.flash-region--toasts .alert--success,
.flash-region--toasts .alert--error,
.flash-region--toasts .alert--warning {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
    border-left: 4px solid var(--toast-accent, var(--color-primary));
}
.flash-region--toasts .alert--success { --toast-accent: var(--color-success); }
.flash-region--toasts .alert--error { --toast-accent: var(--color-danger); }
.flash-region--toasts .alert--warning { --toast-accent: var(--color-warning); }
.js .flash-region--toasts .alert.alert--fading { opacity: 0; transform: translateY(6px); }
.alert__text { flex: 1; min-width: 0; }
.alert__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin: -2px 0 0;
    padding: 0;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    cursor: pointer;
}
.alert__close:hover { background: var(--color-surface-alt); color: var(--color-text); }
.alert__close svg { width: 0.9rem; height: 0.9rem; }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 760px) {
    .flash-region--toasts { left: var(--space-4); right: var(--space-4); width: auto; }
}

/* ---------- Lege staat: icoon + korte uitleg + (optioneel) een actieknop ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-8) var(--space-4);
    text-align: center;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px dashed var(--color-btn-border);
    border-radius: var(--radius-lg);
}
.empty-state[hidden] { display: none; }
/* Binnen een kaart/lijst die zelf al een rand heeft. */
.empty-state--plain { border: none; background: none; padding: var(--space-6) var(--space-4); }
.empty-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
}
.empty-state__icon svg { width: 1.3rem; height: 1.3rem; }
.empty-state__title { margin: 0; font-weight: 600; font-size: 1rem; color: var(--color-text); }
.empty-state__text { margin: 0; font-size: 0.9rem; max-width: 46ch; }
.empty-state .btn { margin-top: var(--space-2); }

/* ---------- Paginakop met actie rechts, en een in-/uitklapbaar "nieuw ..."-formulier ---------- */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}
.page-head .page-title { margin-bottom: var(--space-1); }
.page-head .page-subtitle { margin-bottom: 0; }
.page-head__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
[data-toggle-target][hidden] { display: none; }

/* ---------- Voortgangsbalk ---------- */
.progress-bar {
    height: 0.6rem;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    overflow: hidden;
}
.progress-bar__fill {
    display: block;
    height: 100%;
    background: var(--stripe);
    border-radius: var(--radius-pill);
}

/* ---------- Zoek-/filterbalk boven lijsten en tabellen (assets/js/ui.js) ---------- */
.list-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.list-toolbar__search { position: relative; flex: 1 1 240px; max-width: 360px; }
.list-toolbar__search svg {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}
/* Element + class: anders wint de algemene input[type="text"]-regel (en diens :focus-variant)
   op specificiteit en valt de tekst over het vergrootglas heen. */
input.list-toolbar__input { padding-left: 2.2rem; }
input.list-toolbar__input:focus { padding-left: calc(2.2rem - 1px); }
/* Zoekveld en keuzelijsten in de werkbalk even hoog, zodat de rij strak oogt. */
.list-toolbar select,
input.list-toolbar__input { height: 2.4rem; padding-top: 0; padding-bottom: 0; }
input.list-toolbar__input:focus { padding-top: 0; padding-bottom: 0; }
.list-toolbar select { width: auto; min-width: 150px; }
.list-toolbar__count { margin-left: auto; font-size: 0.84rem; color: var(--color-text-muted); white-space: nowrap; }
[data-list-item][hidden] { display: none; }

.segmented {
    display: inline-flex;
    padding: 2px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}
.segmented__btn {
    padding: 0.3rem var(--space-3);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.segmented__btn:hover { color: var(--color-text); }
.segmented__btn[aria-pressed="true"] { background: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow-sm); }

/* Sorteerbare kolomkop: de hele kop is een knop (toetsenbord-bedienbaar), met een pijltje dat de
   huidige sorteerrichting toont. */
.th-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0;
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}
.th-sort:hover { color: var(--color-text); }
.th-sort__arrow { width: 0.7rem; height: 0.7rem; opacity: 0.35; transition: transform 0.15s ease; }
th[aria-sort="ascending"] .th-sort, th[aria-sort="descending"] .th-sort { color: var(--color-primary); }
th[aria-sort="ascending"] .th-sort__arrow { opacity: 1; transform: rotate(180deg); }
th[aria-sort="descending"] .th-sort__arrow { opacity: 1; }

/* Lijst van kaart-rijen (casussen, toetsen, groepen): titel + labels links, acties rechts. */
.row-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    padding: var(--space-4) var(--space-5);
    margin: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}
.row-card:first-of-type { border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); }
.row-card:last-of-type { border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); margin-bottom: var(--space-4); }
.row-card + .row-card { border-top: 0; }
.row-card:hover { background: var(--color-surface-alt); }
.row-card__main { min-width: 0; flex: 1 1 280px; }
.row-card__title { margin: 0; font-size: 1.02rem; font-weight: 600; display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.row-card__title a { color: inherit; text-decoration: none; }
.row-card__title a:hover { color: var(--color-primary); }
.row-card__meta { margin: var(--space-1) 0 0; font-size: 0.84rem; color: var(--color-text-muted); }

/* ---------- Studentendashboard: kop met voortgang, "Ga verder"-blok en takenlijst ---------- */
.dash-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}
.dash-head .page-title { margin: 0; }
.dash-progress { flex: 0 1 300px; min-width: 220px; }
.dash-progress__label { display: flex; justify-content: space-between; gap: var(--space-3); margin: 0 0 var(--space-1); font-size: 0.82rem; color: var(--color-text-muted); }
.dash-progress__label strong { color: var(--color-text); }

.continue-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    padding: var(--space-5) var(--space-6);
    margin-bottom: var(--space-6);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}
.continue-card__main { min-width: 0; flex: 1 1 260px; }
.continue-card__eyebrow { margin: 0 0 var(--space-1); font-size: 0.74rem; font-weight: 700; opacity: 0.85; }
.continue-card__title { margin: 0; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; color: inherit; line-height: 1.25; }
.continue-card__meta { margin: var(--space-2) 0 0; font-size: 0.88rem; opacity: 0.9; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; }
.continue-card__meta svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.dash-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); align-items: start; }
@media (min-width: 980px) {
    .dash-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
.dash-side { display: flex; flex-direction: column; gap: var(--space-4); }
/* .card .side-card__title: specifieker dan ".card h2" (anders wint die de lettergrootte). */
.card .side-card__title, .side-card__title { margin: 0 0 var(--space-3); font-size: var(--text-md); font-weight: 700; color: var(--color-text); display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.side-card__title a { font-family: var(--font-sans); font-weight: 600; font-size: var(--text-sm); }

.task-tabs {
    display: flex;
    gap: var(--space-1);
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
    flex: 1 1 auto;
}
.task-tabs[hidden] { display: none; }
.task-tabs__tab {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    margin-bottom: -1px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-muted);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.task-tabs__tab:hover { color: var(--color-text); }
a.task-tabs__tab { text-decoration: none; }
.task-tabs__tab[aria-pressed="true"] { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.task-tabs__count {
    min-width: 1.35rem;
    padding: 0 0.4rem;
    border-radius: var(--radius-pill);
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    font-size: 0.72rem;
    line-height: 1.35rem;
    text-align: center;
}
.task-tabs__tab[aria-pressed="true"] .task-tabs__count { background: var(--tile-blue-bg); color: var(--color-primary); }
.task-toolbar { display: flex; align-items: flex-end; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }

.task-list {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.task-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.12s ease;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--color-surface-alt); }
.task-row__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    color: var(--color-text-muted);
}
.task-row__icon svg { width: 1.15rem; height: 1.15rem; }
.task-row__main { flex: 1; min-width: 0; }
.task-row__title { margin: 0; font-weight: 600; }
.task-row__meta { margin: 2px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); font-size: 0.82rem; color: var(--color-text-muted); }
.task-row__desc { margin: var(--space-1) 0 0; font-size: 0.85rem; color: var(--color-text-muted); }
.task-row__desc p { margin: 0; }
.task-row__action { flex-shrink: 0; }
.task-row__actions { display: flex; gap: var(--space-2); flex-shrink: 0; }
/* Tekstlabel naast het belletje: alleen in het uitgeklapte mobiele menu, op desktop is het icoon genoeg. */
.nav-dropdown__label { display: none; }
@media (max-width: 560px) {
    .task-tabs__tab { padding: var(--space-2); font-size: 0.86rem; }
    .task-row { flex-wrap: wrap; }
    .task-row__action { width: 100%; }
    .task-row__action.btn { width: 100%; }
    .task-row__main { flex-basis: calc(100% - 3rem); }
    .task-row__actions { width: 100%; justify-content: flex-end; }
}

/* ---------- PB-/beheerdersdashboard: "Wacht op jou"-tellers ---------- */
.attention-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-bottom: var(--space-8); background: var(--color-border); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 900px) {
    .attention-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.attention-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--space-4) var(--space-5) var(--space-5);
    background: var(--color-surface);
    color: inherit;
    text-decoration: none;
    transition: background-color 0.12s ease;
}
.attention-card:hover { background: var(--color-surface-alt); color: inherit; }
.attention-card:focus-visible { outline-offset: -3px; }
.attention-card__value { font-size: var(--text-2xl); font-weight: 750; font-stretch: var(--stretch-display); line-height: 1.1; color: var(--color-text-muted); }
.attention-card__label { font-size: var(--text-sm); font-weight: 650; color: var(--color-text); }
.attention-card__hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.attention-card__go { position: absolute; top: var(--space-4); right: var(--space-4); color: var(--color-text-muted); }
.attention-card__go svg { width: 1rem; height: 1rem; }
/* Er wacht iets: blauwe rand + getal in de accentkleur. Het getal zelf (en de tekst eronder)
   vertelt hetzelfde, dus de kleur is alleen een extra hint. */
.attention-card--active { box-shadow: inset 0 3px 0 var(--color-signal); }
.attention-card--active .attention-card__value { color: var(--color-primary); }

/* ---------- Snelkoppelingen (PB-/beheerdersdashboard): compacte lijst van icoon + titel + toelichting ---------- */
.quick-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
@media (min-width: 820px) {
    .quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.quick-links { display: flex; flex-direction: column; gap: 2px; margin: 0 calc(-1 * var(--space-2)); }
.quick-links a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.3;
}
.quick-links a:hover { background: var(--color-surface-alt); color: var(--color-text); }
.quick-links small { display: block; font-weight: 400; font-size: 0.8rem; color: var(--color-text-muted); }
.quick-links__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    flex-shrink: 0;
    color: var(--color-text-muted);
}
.quick-links__icon svg { width: 1.05rem; height: 1.05rem; }

/* ---------- Tabbladen binnen een pagina (assets/js/ui.js, [data-tabs]) ---------- */
.task-tabs__tab svg { width: 1rem; height: 1rem; }
.tab-panel__title { margin: 0 0 var(--space-3); }
/* Met JavaScript laat het tabblad zelf al zien waar je bent: de kop in het paneel blijft alleen
   voor schermlezers bestaan. Zonder JavaScript staan alle panelen met hun kop onder elkaar. */
.tab-panel--js .tab-panel__title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}
.tab-panel--js .card > .tab-panel__title + * { margin-top: 0; }
[data-tab-panel][hidden] { display: none; }

/* ---------- Groep delen: QR-code naast code + link ---------- */
.share-grid { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: flex-start; }
.share-grid__info { flex: 1 1 280px; min-width: 0; }
.share-code { margin: 0; font-size: var(--text-2xl); font-weight: 750; font-stretch: var(--stretch-display); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.copy-field { display: flex; gap: var(--space-2); }
.copy-field input { flex: 1; min-width: 0; }

/* ---------- Beoordelen één voor één ---------- */
.review-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.review-head__count { font-size: 0.86rem; color: var(--color-text-muted); }
.review-head__count strong { color: var(--color-text); }
.review-queue { display: flex; flex-direction: column; }
.review-queue a { display: flex; flex-direction: column; gap: 1px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); color: var(--color-text); text-decoration: none; font-size: 0.88rem; font-weight: 600; line-height: 1.3; }
.review-queue a small { font-weight: 400; font-size: 0.78rem; color: var(--color-text-muted); }
.review-queue a:hover { background: var(--color-surface-alt); color: var(--color-text); }
.review-queue a[aria-current="true"] { background: var(--tile-blue-bg); color: var(--color-primary); }

/* ---------- Focusmodus (casus/toets maken): kale balk met titel + voortgang ---------- */
.focus-bar__inner { flex-wrap: nowrap; gap: var(--space-3); max-width: 900px; }
.focus-bar__main { flex: 1; min-width: 0; }
.focus-bar__title { margin: 0; font-size: 0.95rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus-bar__kind { margin-right: var(--space-1); font-size: 0.7rem; font-weight: 700; color: var(--color-text-muted); }
.focus-bar__progress { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-1); }
.focus-bar__progress .progress-bar { flex: 1; max-width: 420px; height: 0.4rem; }
.focus-bar__count { font-size: 0.78rem; color: var(--color-text-muted); white-space: nowrap; }
.focus-bar__close { flex-shrink: 0; }
.focus-bar__timer {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    flex-shrink: 0;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-pill);
    background: var(--color-warning-bg);
    color: var(--color-warning);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
}
.focus-bar__timer svg { width: 1rem; height: 1rem; }
.focus-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; margin-top: var(--space-4); }
body.is-focus-mode main { max-width: 900px; }
body.is-focus-mode .site-footer { padding-top: var(--space-4); padding-bottom: var(--space-6); }
/* Op mobiel blijft de knoppenrij (Vorige/Volgende/Inleveren) onderaan in beeld staan. */
@media (max-width: 760px) {
    body.is-focus-mode .focus-actions {
        position: sticky;
        bottom: 0;
        z-index: 40;
        margin: var(--space-4) calc(-1 * var(--space-4)) 0;
        padding: var(--space-3) var(--space-4);
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
    }
    body.is-focus-mode .focus-actions .btn { flex: 1 1 auto; }
    /* Bij "alles op één pagina" blijft Inleveren gewoon onderaan de toets staan — anders staat de
       inleverknop de hele tijd in beeld en lever je per ongeluk te vroeg in. */
    body.is-focus-mode #test-form[data-display-mode="all"] > .focus-actions {
        position: static;
        margin: var(--space-4) 0 0;
        padding: 0;
        background: none;
        border: none;
    }
    .focus-bar__progress .progress-bar { min-width: 3rem; }
    .focus-bar__title { font-size: 0.88rem; }
}

/* =========================================================
   App-schil "Dossier": lichte zijbalk met het menu, een rustige bovenregel met zoeken,
   meldingen en account, en de inhoud in een begrensde kolom. Op de telefoon: kop met de
   streep, onderbalk met snelmenu en de zijbalk als uitschuifpaneel.
   Zie includes/app_shell.php en assets/js/nav.js.
   ========================================================= */
.shell { min-height: 100vh; padding-left: 248px; }
.shell__main { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.has-shell main { width: 100%; max-width: calc(var(--content-max) + 2 * var(--space-8)); margin: 0 auto; padding: var(--space-4) var(--space-8) var(--space-12); }
.has-shell .site-footer { margin-top: auto; }
body.is-public .site-footer { justify-content: center; }

/* ---------- Zijbalk ---------- */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    width: 248px;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: var(--space-5) var(--space-3) var(--space-3);
    overflow: hidden;
}
.sidebar__brand { position: relative; padding: var(--space-2) var(--space-2) var(--space-5); }
.sidebar__logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 750;
    font-stretch: var(--stretch-display);
    font-size: var(--text-lg);
    letter-spacing: -0.01em;
    border-radius: var(--radius-sm);
}
.sidebar__logo:hover { color: var(--color-text); }
.sidebar__logo img { border-radius: var(--radius-sm); }
.sidebar__team { margin: var(--space-1) 0 0 calc(30px + var(--space-3)); font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.35; }
.sidebar__close {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.sidebar__close svg { width: 1.1rem; height: 1.1rem; }
.sidebar__nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0 calc(-1 * var(--space-1));
    padding: 0 var(--space-1) var(--space-3);
    scrollbar-width: thin;
}
.sb-group { margin: var(--space-5) 0 var(--space-1); padding: 0 var(--space-3); font-size: var(--text-xs); font-weight: 650; color: var(--color-text-muted); }
.sb-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    min-height: 2.5rem;
    padding: var(--space-2) var(--space-3);
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--color-text);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 550;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}
.sb-link:hover { background: var(--color-surface-alt); color: var(--color-text); }
.sb-link.is-active { background: var(--color-primary-tint); color: var(--color-primary); font-weight: 700; }
.sb-link.is-active::before { content: ""; position: absolute; left: 0; top: var(--space-2); bottom: var(--space-2); width: 3px; border-radius: 0 3px 3px 0; background: var(--color-primary); }
.sb-link:focus-visible { outline: 3px solid var(--color-focus-ring); outline-offset: -3px; }
.sb-icon { display: inline-flex; flex-shrink: 0; color: var(--color-text-muted); }
.sb-link.is-active .sb-icon { color: var(--color-primary); }
.sb-icon svg { width: 1.1rem; height: 1.1rem; }
.sb-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    padding: 0 var(--space-2);
    border-radius: var(--radius-pill);
    background: var(--color-signal);
    color: var(--color-signal-ink);
    font-size: var(--text-xs);
    font-weight: 750;
    line-height: 1.4rem;
}
.sidebar__user {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: var(--space-2) calc(-1 * var(--space-1)) 0;
    padding: var(--space-3);
    border-top: 1px solid var(--color-border);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--text-sm);
    line-height: 1.3;
    flex-shrink: 0;
}
.sidebar__user:hover { background: var(--color-surface-alt); color: var(--color-text); }
.sidebar__user:focus-visible { outline-offset: -3px; }
.sidebar__user .avatar { width: 2.1rem; height: 2.1rem; }
.sidebar__user strong { display: block; font-weight: 650; }
.sidebar__user small { display: block; color: var(--color-text-muted); font-size: var(--text-xs); }

/* ---------- Bovenregel ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    width: 100%;
    max-width: calc(var(--content-max) + 2 * var(--space-8));
    margin: 0 auto;
    min-height: 4rem;
    padding: var(--space-3) var(--space-8) 0;
}
.topbar__brand { display: none; align-items: center; gap: var(--space-2); color: var(--color-text); text-decoration: none; font-weight: 750; font-stretch: var(--stretch-display); font-size: var(--text-md); border-radius: var(--radius-sm); }
.topbar__brand:hover { color: var(--color-text); }
.topbar__brand img { border-radius: var(--radius-sm); }
.topbar__search { position: relative; flex: 0 1 420px; display: flex; align-items: center; }
.topbar__search > svg { position: absolute; left: var(--space-3); width: 1rem; height: 1rem; color: var(--color-text-muted); pointer-events: none; }
input.topbar__search-input {
    width: 100%;
    height: var(--control-height);
    padding: 0 var(--space-10) 0 var(--space-10);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    font-size: var(--text-sm);
}
input.topbar__search-input:focus { padding: 0 var(--space-10); }
input.topbar__search-input::-webkit-search-cancel-button { display: none; }
.topbar__kbd { position: absolute; right: var(--space-3); font: inherit; font-size: var(--text-xs); color: var(--color-text-muted); border: 1px solid var(--color-btn-border); border-radius: var(--radius-sm); padding: 0 var(--space-1); pointer-events: none; }
.topbar__results {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    right: 0;
    padding: var(--space-1);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    z-index: 80;
}
.topbar__results[hidden] { display: none; }
.topbar__result { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--color-text); text-decoration: none; font-weight: 600; font-size: var(--text-sm); }
.topbar__result small { color: var(--color-text-muted); font-weight: 500; font-size: var(--text-xs); }
.topbar__result:hover, .topbar__result.is-active { background: var(--color-primary-tint); color: var(--color-primary); }
.topbar__noresult { margin: 0; padding: var(--space-2) var(--space-3); color: var(--color-text-muted); font-size: var(--text-sm); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.topbar .nav-dropdown__trigger { height: var(--control-height); color: var(--color-text); border: 1px solid var(--color-btn-border); border-radius: var(--radius-md); background: var(--color-surface); }
.topbar .nav-dropdown__trigger:hover { color: var(--color-text); background: var(--color-surface-alt); }
.topbar .nav-dropdown__menu { position: absolute; top: calc(100% + var(--space-2)); right: 0; left: auto; }
.topbar .user-chip { padding: 0 var(--space-3) 0 var(--space-1); gap: var(--space-2); color: var(--color-text); font-weight: 600; }
.user-chip__initials {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--color-primary-tint);
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: 750;
}

/* ---------- Onderbalk (alleen telefoon) ---------- */
.tabbar { display: none; }
.drawer-backdrop[hidden] { display: none; }

/* ---------- Dossierregels: opdrachten op het studentenoverzicht ---------- */
.task-row { position: relative; }
.task-kind { flex-shrink: 0; width: 3.5rem; font-size: var(--text-xs); font-weight: 650; color: var(--color-text-muted); }
.task-state { flex-shrink: 0; font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); }
.task-state--doing { color: var(--color-warning); }
.task-state--done { color: var(--color-success); }
.task-link { flex-shrink: 0; min-width: 6.5rem; text-align: right; font-weight: 650; font-size: var(--text-sm); }

/* "Ga verder": het dossier dat openligt, met een kobalt rand links. */
.next-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-5) var(--space-6) var(--space-5) calc(var(--space-6) + var(--space-2));
    margin-bottom: var(--space-8);
    overflow: hidden;
}
.next-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--stripe); }
.next-card__main { flex: 1; min-width: 0; }
.next-card__title { margin: 0 0 var(--space-1); font-size: var(--text-xl); font-stretch: var(--stretch-display); line-height: 1.2; }
.next-card__meta { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.next-card__meta strong { color: var(--color-text); font-weight: 650; }
.next-card__meta .is-soon { color: var(--color-danger); font-weight: 650; }
.next-card__progress { flex: 0 1 200px; }
.next-card__progress p { display: flex; justify-content: space-between; margin: 0 0 var(--space-1); font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); }
.next-card .btn { flex-shrink: 0; }

.medals { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.medal {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    font-size: 1.3rem;
    line-height: 1;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
}
.kv-list { margin: 0; }
.kv-list div { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) 0; font-size: var(--text-sm); border-top: 1px solid var(--color-border); }
.kv-list div:first-child { border-top: 0; padding-top: 0; }
.kv-list dt { color: var(--color-text-muted); }
.kv-list dd { margin: 0; font-weight: 700; }
.coach { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); font-size: var(--text-sm); line-height: 1.35; }
.coach small { display: block; color: var(--color-text-muted); font-size: var(--text-xs); }

/* ---------- Telefoon en smal scherm ---------- */
@media (max-width: 900px) {
    .shell { padding-left: 0; }
    .sidebar {
        z-index: 320;
        width: min(300px, 86%);
        transform: translateX(-102%);
        transition: transform 0.22s ease;
    }
    .sidebar.is-open { transform: none; box-shadow: var(--shadow-md); }
    .sidebar__close { display: inline-flex; }
    .drawer-backdrop { position: fixed; inset: 0; z-index: 310; background: var(--color-overlay); }
    body.drawer-open { overflow: hidden; }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 60;
        min-height: 3.5rem;
        padding: var(--space-2) var(--space-4);
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
    }
    .topbar__brand { display: flex; }
    .topbar__search { display: none; }
    .topbar .nav-dropdown__trigger { width: auto; justify-content: center; }
    .topbar .nav-dropdown--profile { border-top: 0; margin-top: 0; padding-top: 0; }
    .topbar .user-chip { padding: 0 var(--space-1); }
    .topbar .user-chip__name, .topbar .user-chip .nav-dropdown__caret { display: none; }
    .topbar .nav-dropdown__menu,
    .topbar .nav-dropdown__menu--notifs,
    .topbar .nav-dropdown__menu--profile {
        position: fixed;
        top: 3.75rem;
        left: var(--space-3);
        right: var(--space-3);
        width: auto;
        max-width: none;
        margin: 0;
    }

    .has-shell main { padding: var(--space-5) var(--space-4) calc(var(--space-16) + var(--space-8)); }
    .has-shell .site-footer { padding: var(--space-4) var(--space-4) calc(var(--space-16) + var(--space-6)); }

    .tabbar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        justify-content: space-around;
        padding: var(--space-1) var(--space-1) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
    }
    .tabbar__item {
        display: flex;
        flex: 1;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        min-height: 3rem;
        padding: var(--space-1) 0;
        border: 0;
        border-radius: var(--radius-sm);
        background: none;
        color: var(--color-text-muted);
        font: inherit;
        font-size: var(--text-xs);
        font-weight: 650;
        text-decoration: none;
        cursor: pointer;
    }
    .tabbar__item.is-active { color: var(--color-primary); }
    .tabbar__icon { position: relative; display: inline-flex; }
    .tabbar__icon svg { width: 1.35rem; height: 1.35rem; }
    .tabbar__icon i { position: absolute; top: -4px; right: -10px; min-width: 1.1rem; padding: 0 var(--space-1); border-radius: var(--radius-pill); background: var(--color-signal); color: var(--color-signal-ink); font-style: normal; font-size: 0.68rem; font-weight: 750; line-height: 1.1rem; text-align: center; }

    .next-card { flex-wrap: wrap; gap: var(--space-3) var(--space-4); padding: var(--space-4) var(--space-4) var(--space-4) calc(var(--space-4) + var(--space-2)); }
    .next-card__progress { display: none; }
    .next-card .btn { width: 100%; }
    /* Hele regel klikbaar op de telefoon; alleen een pijltje blijft zichtbaar. */
    .task-row--link { flex-wrap: nowrap; }
    .task-row--link .task-row__main { flex: 1 1 auto; min-width: 0; }
    .task-row--link .task-link { min-width: 0; font-size: 0; color: var(--color-text-muted); text-decoration: none; }
    .task-row--link .task-link::before { content: "\203A"; font-size: 1.5rem; line-height: 1; }
    .task-row--link .task-link::after { content: ""; position: absolute; inset: 0; }
    .task-row--link .task-row__desc a { position: relative; z-index: 1; }
}
@media (max-width: 560px) {
    .task-state, .task-kind { display: none; }
}

/* =====================================================================================
   v1.22 — Passkeys, wizards en installeerbare app
   ===================================================================================== */

/* ---------- Algemene formulierhulpjes ---------- */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
.field-optional { font-weight: 400; color: var(--color-text-muted); font-size: 0.82rem; }
.field-label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: var(--space-2); }
.field-error { color: var(--color-danger); font-size: 0.84rem; font-weight: 600; margin: var(--space-1) 0 0; }
.field--error input, .field--error select, .field--error textarea { border-color: var(--color-danger); }
.page-eyebrow { margin: 0 0 var(--space-1); font-size: 0.82rem; font-weight: 600; }
.page-eyebrow a { color: var(--color-text-muted); text-decoration: none; }
.page-eyebrow a::before, .page-back::before { content: ""; display: inline-block; width: 0.45em; height: 0.45em; margin-right: 0.45em; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); vertical-align: 0.08em; }
.page-back { display: inline-flex; align-items: center; min-height: 2rem; font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); text-decoration: none; }
.page-back:hover { color: var(--color-primary); }
.page-eyebrow a:hover { color: var(--color-primary); }
.btn--ghost-danger { background: transparent; color: var(--color-text-muted); border-color: transparent; }
.btn--ghost-danger:hover { background: var(--color-danger-bg); color: var(--color-danger); }
.check-row { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1) 0; font-size: 0.94rem; cursor: pointer; flex-wrap: wrap; }
.check-row input[type="checkbox"], .check-row input[type="radio"] { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--color-primary); flex-shrink: 0; }
.check-row__sub { margin-left: calc(1.05rem + var(--space-2)); }
.check-row .input--compact { margin: 0 var(--space-1); }

/* ---------- Wizard ---------- */
.wizard { padding: var(--space-6); }
.wizard__title { font-size: 1.15rem; margin: 0 0 var(--space-4); outline: none; }
.wizard .wizard-steps { justify-content: flex-start; flex-wrap: wrap; row-gap: var(--space-2); padding-bottom: var(--space-5); margin-bottom: var(--space-6); border-bottom: 1px solid var(--color-border); }
button.wizard-steps__step { min-height: 2rem; background: none; border: 0; padding: 0; font: inherit; font-size: 0.85rem; color: var(--color-text-muted); cursor: pointer; }
button.wizard-steps__step:hover .wizard-steps__label-text { color: var(--color-text); }
.wizard .wizard-steps__line { width: var(--space-6); }
.wizard-fieldset { border: 0; padding: 0; margin: 0 0 var(--space-5); min-width: 0; }
.wizard-fieldset > legend { font-weight: 700; font-size: 0.9rem; margin-bottom: var(--space-2); padding: 0; }
.wizard-actions { flex-wrap: wrap; }
.wizard--enhanced .wizard-actions { border-top: 1px solid var(--color-border); padding-top: var(--space-5); }
.wizard-actions__left, .wizard-actions__right { display: flex; align-items: center; gap: var(--space-3); }
.wizard-actions__right { margin-left: auto; }
.wizard-actions__counter { color: var(--color-text-muted); font-size: 0.82rem; white-space: nowrap; }
.wizard [hidden] { display: none !important; }
/* zonder JS: alle stappen onder elkaar met een lijn ertussen */
.wizard:not(.wizard--enhanced) [data-wizard-step] + [data-wizard-step] { border-top: 1px dashed var(--color-border); margin-top: var(--space-5); padding-top: var(--space-5); }
.wizard--inline { padding: 0; box-shadow: none; border: 0; background: transparent; }
.wizard--inline .wizard-steps { margin-bottom: var(--space-4); padding-bottom: var(--space-4); }
.wizard--compact { padding: 0; }
.wizard--compact .wizard-steps__label-text { display: none; }
.wizard--compact .wizard-steps__step--current .wizard-steps__label-text { display: inline; }
.wizard--compact .wizard-steps__line { width: var(--space-4); }
.wizard .wizard-steps { min-width: 0; }
.wizard--compact .wizard-steps { flex-wrap: nowrap; gap: var(--space-2); }
.wizard--compact .wizard-steps__step { min-width: 0; }
.wizard--compact .wizard-steps__label-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.summary-list { display: grid; gap: 0; margin: 0 0 var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.summary-list > div { display: grid; grid-template-columns: minmax(8rem, 32%) 1fr; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.summary-list > div + div { border-top: 1px solid var(--color-border); }
.summary-list > div[hidden] { display: none; }
.summary-list dt { color: var(--color-text-muted); font-size: 0.86rem; }
.summary-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.summary-list dd.is-empty, .summary-list .is-empty { color: var(--color-text-muted); font-weight: 400; }
.wizard-next { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border-radius: var(--radius-md); background: var(--tile-blue-bg); color: var(--color-text); }
.wizard-next p { margin: 0; font-size: 0.92rem; }
.wizard-next__icon { color: var(--color-primary); flex-shrink: 0; margin-top: 2px; }
.wizard-next__icon svg { width: 1.2rem; height: 1.2rem; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.check-card { position: relative; display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); cursor: pointer; transition: border-color .12s, background-color .12s; }
.check-card:hover { border-color: var(--color-input-border); }
.check-card input { width: 1.05rem; height: 1.05rem; margin: 3px 0 0; accent-color: var(--color-primary); flex-shrink: 0; }
.check-card:has(input:checked) { border-color: var(--color-primary); background: var(--tile-blue-bg); }
.check-card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check-card__title { font-weight: 600; }
.check-card__meta { color: var(--color-text-muted); font-size: 0.82rem; }
.check-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.check-list__item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); cursor: pointer; font-size: 0.92rem; }
.check-list__item + .check-list__item { border-top: 1px solid var(--color-border); }
.check-list__item:hover { background: var(--color-surface-alt); }
.check-list__item input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--color-primary); flex-shrink: 0; }
.check-list__meta { margin-left: auto; color: var(--color-text-muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-list > .field-hint { padding: var(--space-3) var(--space-4); margin: 0; }

/* ---------- Keuzekaarten (2FA-methode, thema) ---------- */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.choice-grid--small { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); max-width: 420px; }
.choice-card { position: relative; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); color: var(--color-text); text-decoration: none; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.choice-card:hover { border-color: var(--color-primary); color: var(--color-text); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.choice-card[hidden] { display: none; }
.choice-card--recommended { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
.choice-card__badge { position: absolute; top: var(--space-3); right: var(--space-3); padding: 2px var(--space-2); border-radius: var(--radius-pill); background: var(--color-primary); color: var(--color-primary-contrast); font-size: 0.72rem; font-weight: 700; }
.choice-card__icon { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: var(--radius-md); background: var(--tile-blue-bg); color: var(--color-primary); }
.choice-card__icon svg { width: 1.35rem; height: 1.35rem; }
.choice-card__title { font-weight: 700; font-size: 1rem; }
.choice-card__text { color: var(--color-text-muted); font-size: 0.88rem; line-height: 1.5; }
.choice-card--radio { flex-direction: row; align-items: center; padding: var(--space-3) var(--space-4); }
.choice-card--radio input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card--radio .choice-card__icon { width: 2rem; height: 2rem; }
.choice-card--radio:has(input:checked) { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); background: var(--tile-blue-bg); }
.choice-card--radio:has(input:focus-visible) { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.segmented--wide { display: flex; max-width: 420px; }
.segmented__option { flex: 1; position: relative; cursor: pointer; }
.segmented__option input { position: absolute; opacity: 0; pointer-events: none; }
.segmented__option span { display: block; text-align: center; padding: 0.4rem var(--space-3); border-radius: var(--radius-sm); color: var(--color-text-muted); font-weight: 600; font-size: 0.88rem; }
.segmented__option input:checked + span { background: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow-sm); }
.segmented__option input:focus-visible + span { outline: 2px solid var(--color-primary); }

/* ---------- Passkeys ---------- */
.auth-divider { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-5) 0; color: var(--color-text-muted); font-size: 0.82rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.passkey-login[hidden] { display: none; }
.passkey-status { min-height: 1.2em; margin: var(--space-2) 0 0; font-size: 0.86rem; color: var(--color-text-muted); text-align: center; }
.passkey-status:empty { min-height: 0; margin: 0; }
.passkey-status--error { color: var(--color-danger); font-weight: 600; }
.passkey-explainer { display: flex; gap: var(--space-4); align-items: flex-start; padding: var(--space-4); margin-bottom: var(--space-5); border-radius: var(--radius-md); background: var(--color-surface-alt); }
.passkey-explainer p { margin: 0 0 var(--space-2); font-size: 0.92rem; }
.passkey-explainer__icon { display: inline-flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--tile-blue-bg); color: var(--color-primary); flex-shrink: 0; }
.passkey-explainer__icon svg { width: 1.4rem; height: 1.4rem; }
[data-passkey] .passkey-status { text-align: left; }
.passkey-login .passkey-status { text-align: center; }
.settings-subtitle { display: flex; align-items: center; gap: var(--space-2); font-size: 1rem; margin: var(--space-6) 0 var(--space-3); padding-top: var(--space-5); border-top: 1px solid var(--color-border); }
.settings-subtitle svg { width: 1.1rem; height: 1.1rem; color: var(--color-primary); }
.passkey-list { list-style: none; margin: 0 0 var(--space-4); padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.passkey-list__item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.passkey-list__item + .passkey-list__item { border-top: 1px solid var(--color-border); }
.passkey-list__icon { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: var(--radius-md); background: var(--tile-blue-bg); color: var(--color-primary); flex-shrink: 0; }
.passkey-list__icon svg { width: 1.1rem; height: 1.1rem; }
.passkey-list__main { flex: 1; min-width: 0; }
.passkey-list__rename { display: flex; gap: var(--space-2); align-items: center; }
input[type="text"].passkey-list__rename-input, .passkey-list__rename input[type="text"] { padding: 0.3rem var(--space-2); font-weight: 600; border-color: transparent; background: transparent; }
.passkey-list__rename input[type="text"]:hover { border-color: var(--color-border); }
.passkey-list__rename input[type="text"]:focus { border-color: var(--color-primary); background: var(--color-surface); outline: 3px solid var(--color-focus-ring); outline-offset: 1px; }
.passkey-list__rename .btn { display: none; }
.passkey-list__rename:focus-within .btn { display: inline-flex; }
.passkey-list__meta { display: block; color: var(--color-text-muted); font-size: 0.8rem; padding-left: var(--space-2); }
.passkey-add__row { display: flex; gap: var(--space-3); align-items: flex-end; flex-wrap: wrap; }
.passkey-add__row[hidden] { display: none; }

/* ---------- Welkomstwizard ---------- */
.welcome { max-width: 760px; margin: 0 auto; }
.welcome__hero { display: flex; gap: var(--space-4); align-items: center; margin-bottom: var(--space-6); }
.welcome__avatar { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4); border: 1px dashed var(--color-border); border-radius: var(--radius-md); }
.welcome__skip { text-align: center; margin-top: var(--space-4); }
.tour-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-5); }
.tour-card { padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); }
.tour-card__icon { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; border-radius: var(--radius-md); background: var(--tile-blue-bg); color: var(--color-primary); margin-bottom: var(--space-2); }
.tour-card__icon svg { width: 1.1rem; height: 1.1rem; }
.tour-card__title { font-weight: 700; margin: 0 0 var(--space-1); }
.tour-card__text { margin: 0; color: var(--color-text-muted); font-size: 0.86rem; line-height: 1.5; }
kbd { display: inline-block; padding: 0 0.35em; border: 1px solid var(--color-border); border-bottom-width: 2px; border-radius: 4px; font-family: inherit; font-size: 0.8em; background: var(--color-surface-alt); }

/* ---------- Installeerbare app (PWA) ---------- */
.install-tip { position: relative; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-4) var(--space-4) calc(var(--space-4) + var(--space-2)); border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); overflow: hidden; }
.install-tip::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--stripe); }
.install-tip[hidden] { display: none; }
.install-tip__icon { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: var(--radius-md); background: var(--color-primary-tint); color: var(--color-primary); flex-shrink: 0; }
.install-tip__icon svg { width: 1.2rem; height: 1.2rem; }
.install-tip__body { flex: 1; min-width: 0; }
.install-tip__title { margin: 0; font-weight: 700; }
.install-tip__text { margin: 2px 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.sb-install { margin: 0 var(--space-3) var(--space-2); }
.sb-install[hidden] { display: none; }
.offline-page { max-width: 460px; margin: 10vh auto; text-align: center; }

@media (max-width: 640px) {
    .wizard { padding: var(--space-4); }
    .field-row { grid-template-columns: 1fr; }
    .summary-list > div { grid-template-columns: 1fr; gap: 2px; }
    .wizard .wizard-steps__label-text { display: none; }
    .wizard .wizard-steps__step--current .wizard-steps__label-text { display: inline; }
    .wizard .wizard-steps__line { width: var(--space-3); }
    .wizard-actions__counter { display: none; }
    .wizard-actions__left .btn, .wizard-actions__right .btn { padding-left: 0.9rem; padding-right: 0.9rem; }
    .welcome__hero { align-items: flex-start; }
    .passkey-list__meta { padding-left: 0; }
    .check-list__meta { display: none; }
    .tour-grid { grid-template-columns: 1fr; }
}

/* ---------- Changelog: nieuwste versie open, eerdere als regels om uit te klappen ---------- */
.changelog-entry__title { margin: 0; font-size: var(--text-lg); }
.changelog-entry__date { margin: var(--space-1) 0 var(--space-3); }
.changelog-entry__items { margin: 0; padding-left: 1.2em; }
.changelog-entry__items li { margin-bottom: var(--space-1); }
.changelog-older { margin: var(--space-10) 0 var(--space-3); font-size: var(--text-lg); }
details.changelog-entry { border-top: 1px solid var(--color-border); }
details.changelog-entry:last-of-type { border-bottom: 1px solid var(--color-border); }
details.changelog-entry > summary {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3);
    min-height: 2.75rem; padding: var(--space-3) 0; cursor: pointer; list-style: none;
}
details.changelog-entry > summary::-webkit-details-marker { display: none; }
details.changelog-entry > summary::before {
    content: ""; width: 0.5rem; height: 0.5rem; margin-right: var(--space-1);
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(-45deg); align-self: center; flex-shrink: 0;
}
details.changelog-entry[open] > summary::before { transform: rotate(45deg); }
details.changelog-entry > summary .changelog-entry__title { font-size: var(--text-md); font-weight: 650; }
details.changelog-entry > summary .changelog-entry__date { margin: 0; }
details.changelog-entry > .changelog-entry__items { padding-bottom: var(--space-4); }

/* ---------- Stijl "zacht": panelen met schaduw in plaats van lijnen, ronde knoppen ---------- */
.card, .next-card, .task-list, .side-card, .attention-grid, .table-wrap, .home-login {
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}
.btn { border-radius: var(--radius-pill); }
.sidebar { background: transparent; border-color: transparent; }


@media (prefers-reduced-motion: reduce) {
    .btn:active { transform: none; }
    .btn.is-busy::after { animation-duration: 1.2s; }
    .alert,
    .auth-shell,
    .contact-form__success,
    .tile,
    .settings-content .settings-section:not([hidden]),
    .qcard__body:not([hidden]) { animation: none; }
    .user-chip,
    .help-lightbox,
    .help-lightbox img,
    .simple-modal,
    .simple-modal__box,
    .lightbox-zoomable,
    .qcard,
    .qcard__chevron,
    .qcard__option-row { transition: none; }
    .badge-confetti { display: none; }
    .flash-region--toasts .alert,
    .bug-report__panel,
    .empty-state { animation: none; }
    .sidebar,
    .progress-bar__fill,
    .attention-card,
    .task-row { transition: none; }
}
