/* ============================================================
   StagIQ 2.0 — Uniforme stylesheet
   Bestand: assets/css/stagiq.css
   Font: Roboto (Google Fonts)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');
/* Fallback: als Google Fonts niet bereikbaar is, gebruik Segoe UI */

/* ── Design tokens ──────────────────────────────────────────── */
:root {
    /* Kleuren */
    --kleur-primair:        #e94560;
    --kleur-primair-dim:    #c73652;
    --kleur-primair-licht:  #fef1f3;
    --kleur-achtergrond:    #f4f5f7;
    --kleur-wit:            #ffffff;
    --kleur-tekst:          #1a1a2e;
    --kleur-tekst-dim:      #667085;
    --kleur-tekst-licht:    #98a2b3;
    --kleur-rand:           #e4e7ec;
    --kleur-rand-sterk:     #d0d5dd;
    --kleur-succes:         #027a48;
    --kleur-succes-licht:   #ecfdf3;
    --kleur-waarschuwing:   #b54708;
    --kleur-waarschuwing-licht: #fffaeb;
    --kleur-fout:           #be123c;
    --kleur-fout-licht:     #fff1f3;
    --kleur-info:           #175cd3;
    --kleur-info-licht:     #eff8ff;

    /* Typografie */
    --font:                 'Roboto', 'Segoe UI', Arial, sans-serif;
    --font-mono:            'Roboto Mono', 'Courier New', monospace;

    /* Afmetingen */
    --radius-klein:         6px;
    --radius:               8px;
    --radius-kaart:         12px;
    --radius-groot:         16px;
    --schaduw-kaart:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --schaduw-popup:        0 8px 24px rgba(0,0,0,.12);

    /* Sidebar */
    --sidebar-breedte:      240px;
    --header-hoogte:        56px;
}

/* ── Reset & basis ──────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-weight: 400;
    color: var(--kleur-tekst);
    background: var(--kleur-achtergrond);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────────────────── */
.stagiq-layout {
    display: flex;
    min-height: 100vh;
}

.stagiq-sidebar {
    width: var(--sidebar-breedte);
    background: var(--kleur-wit);
    border-right: 1px solid var(--kleur-rand);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.stagiq-inhoud {
    margin-left: var(--sidebar-breedte);
    flex: 1;
    min-height: 100vh;
    padding: 32px;
}

/* ── Logo in sidebar ────────────────────────────────────────── */
.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--kleur-rand);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo-icoon {
    width: 32px;
    height: 32px;
    background: var(--kleur-tekst);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    color: #fff;
    position: relative;
    flex-shrink: 0;
}

.sidebar-logo-icoon::after {
    content: '';
    position: absolute;
    top: 2px;
    right: -3px;
    width: 8px;
    height: 8px;
    background: var(--kleur-primair);
    border-radius: 2px;
}

.sidebar-logo-tekst {
    font-weight: 700;
    font-size: 16px;
    color: var(--kleur-tekst);
}

.sidebar-logo-tekst span {
    color: var(--kleur-primair);
}

.sidebar-omgeving {
    font-size: 10px;
    color: var(--kleur-tekst-licht);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
}

/* ── Sidebar navigatie ──────────────────────────────────────── */
.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.sidebar-groep-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--kleur-tekst-licht);
    padding: 16px 20px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    color: var(--kleur-tekst-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    border-radius: 0;
    transition: background .1s, color .1s;
    position: relative;
}

.sidebar-link:hover {
    background: var(--kleur-achtergrond);
    color: var(--kleur-tekst);
}

.sidebar-link.actief {
    color: var(--kleur-primair);
    background: var(--kleur-primair-licht);
    font-weight: 500;
}

.sidebar-link.actief::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--kleur-primair);
    border-radius: 0 3px 3px 0;
}

.sidebar-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: .7;
}

.sidebar-link.actief svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--kleur-rand);
    font-size: 13px;
}

.sidebar-footer .gebruiker-naam {
    font-weight: 500;
    color: var(--kleur-tekst);
}

.sidebar-footer .gebruiker-rol {
    color: var(--kleur-tekst-licht);
    font-size: 12px;
}

.sidebar-footer a {
    color: var(--kleur-tekst-dim);
    text-decoration: none;
    font-size: 12px;
}

.sidebar-footer a:hover {
    color: var(--kleur-primair);
}

/* ── Pagina header ──────────────────────────────────────────── */
.pagina-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.pagina-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--kleur-tekst);
    line-height: 1.3;
}

.breadcrumb {
    font-size: 13px;
    color: var(--kleur-tekst-licht);
    margin-bottom: 4px;
}

.breadcrumb a {
    color: var(--kleur-tekst-dim);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--kleur-primair);
}

.breadcrumb span {
    margin: 0 6px;
}

/* ── Kaarten ─────────────────────────────────────────────────── */
.kaart {
    background: var(--kleur-wit);
    border-radius: var(--radius-kaart);
    border: 1px solid var(--kleur-rand);
    padding: 24px;
    box-shadow: var(--schaduw-kaart);
}

.kaart-titel {
    font-size: 15px;
    font-weight: 600;
    color: var(--kleur-tekst);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.kaart-rij {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

/* ── Knoppen ─────────────────────────────────────────────────── */
.knop {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background .15s, box-shadow .15s;
    white-space: nowrap;
}

.knop-primair {
    background: var(--kleur-primair);
    color: #fff;
    border-color: var(--kleur-primair);
}

.knop-primair:hover {
    background: var(--kleur-primair-dim);
}

.knop-secundair {
    background: var(--kleur-wit);
    color: var(--kleur-tekst);
    border-color: var(--kleur-rand-sterk);
}

.knop-secundair:hover {
    background: var(--kleur-achtergrond);
}

.knop-gevaar {
    background: var(--kleur-fout-licht);
    color: var(--kleur-fout);
    border-color: #fecdd3;
}

.knop-gevaar:hover {
    background: #fecdd3;
}

.knop-succes {
    background: var(--kleur-succes-licht);
    color: var(--kleur-succes);
    border-color: #a7f3d0;
}

.knop-klein {
    padding: 5px 10px;
    font-size: 12px;
}

.knop-groot {
    padding: 12px 24px;
    font-size: 15px;
}

.knop svg {
    width: 15px;
    height: 15px;
}

/* ── Formulier elementen ─────────────────────────────────────── */
.formulier-groep {
    margin-bottom: 16px;
}

.formulier-rij {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--kleur-tekst);
    margin-bottom: 6px;
}

label .vereist {
    color: var(--kleur-primair);
    margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="url"],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--kleur-rand-sterk);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    color: var(--kleur-tekst);
    background: var(--kleur-wit);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--kleur-primair);
    box-shadow: 0 0 0 3px rgba(233,69,96,.1);
}

input:disabled,
select:disabled,
textarea:disabled {
    background: var(--kleur-achtergrond);
    color: var(--kleur-tekst-licht);
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.formulier-hint {
    font-size: 12px;
    color: var(--kleur-tekst-licht);
    margin-top: 4px;
}

/* ── Toggle ─────────────────────────────────────────────────── */
.toggle-rij {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid var(--kleur-rand);
}

.toggle-rij:last-child {
    border-bottom: none;
}

.toggle-info .toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--kleur-tekst);
}

.toggle-info .toggle-sub {
    font-size: 12px;
    color: var(--kleur-tekst-licht);
    margin-top: 2px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--kleur-rand-sterk);
    border-radius: 24px;
    transition: background .2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle input:checked + .toggle-slider {
    background: var(--kleur-primair);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* ── Tabellen ────────────────────────────────────────────────── */
.tabel-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-kaart);
    border: 1px solid var(--kleur-rand);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: var(--kleur-achtergrond);
}

th {
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--kleur-tekst-dim);
    letter-spacing: .3px;
    border-bottom: 1px solid var(--kleur-rand);
    white-space: nowrap;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--kleur-rand);
    color: var(--kleur-tekst);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--kleur-achtergrond);
}

/* ── Badges & Labels ─────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-groen   { background: var(--kleur-succes-licht); color: var(--kleur-succes); }
.badge-rood    { background: var(--kleur-fout-licht); color: var(--kleur-fout); }
.badge-oranje  { background: var(--kleur-waarschuwing-licht); color: var(--kleur-waarschuwing); }
.badge-blauw   { background: var(--kleur-info-licht); color: var(--kleur-info); }
.badge-grijs   { background: var(--kleur-achtergrond); color: var(--kleur-tekst-dim); }
.badge-primair { background: var(--kleur-primair-licht); color: var(--kleur-primair); }

/* ── Meldingen ───────────────────────────────────────────────── */
.melding {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

.melding-succes  { background: var(--kleur-succes-licht); border: 1px solid #a7f3d0; color: var(--kleur-succes); }
.melding-fout    { background: var(--kleur-fout-licht); border: 1px solid #fecdd3; color: var(--kleur-fout); }
.melding-info    { background: var(--kleur-info-licht); border: 1px solid #bfdbfe; color: var(--kleur-info); }
.melding-waarschuwing { background: var(--kleur-waarschuwing-licht); border: 1px solid #fedf89; color: var(--kleur-waarschuwing); }

/* ── Statistiek kaartjes (dashboard) ────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-kaart {
    background: var(--kleur-wit);
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius-kaart);
    padding: 20px;
    box-shadow: var(--schaduw-kaart);
}

.stat-kaart .stat-waarde {
    font-size: 28px;
    font-weight: 700;
    color: var(--kleur-tekst);
    line-height: 1.2;
}

.stat-kaart .stat-label {
    font-size: 13px;
    color: var(--kleur-tekst-licht);
    margin-top: 4px;
}

.stat-kaart .stat-accentlijn {
    height: 3px;
    background: var(--kleur-primair);
    border-radius: 3px;
    margin-bottom: 16px;
    width: 32px;
}

/* ── Online/offline indicator ───────────────────────────────── */
.online-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 500;
    position: fixed;
    bottom: 12px;
    right: 12px;
    background: var(--kleur-wit);
    border: 1px solid var(--kleur-rand);
    padding: 4px 10px;
    border-radius: 100px;
    box-shadow: var(--schaduw-kaart);
    z-index: 999;
}

.online-indicator .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.online-indicator.online  .dot { background: #10b981; }
.online-indicator.offline .dot { background: var(--kleur-primair); }
.online-indicator.online       { color: #027a48; }
.online-indicator.offline      { color: var(--kleur-fout); }

/* ── Help knop ───────────────────────────────────────────────── */
.help-knop {
    position: fixed;
    bottom: 12px;
    right: 96px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--kleur-wit);
    border: 1px solid var(--kleur-rand);
    box-shadow: var(--schaduw-kaart);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--kleur-tekst-dim);
    z-index: 999;
    text-decoration: none;
}

.help-knop:hover {
    background: var(--kleur-achtergrond);
    color: var(--kleur-primair);
    border-color: var(--kleur-primair);
}

/* Help zijpaneel */
.help-paneel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--kleur-wit);
    border-left: 1px solid var(--kleur-rand);
    box-shadow: var(--schaduw-popup);
    z-index: 1000;
    transition: right .25s ease;
    overflow-y: auto;
    padding: 24px;
}

.help-paneel.open {
    right: 0;
}

.help-paneel h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--kleur-rand);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.help-paneel p {
    font-size: 14px;
    color: var(--kleur-tekst-dim);
    line-height: 1.7;
    margin-bottom: 12px;
}

/* ── Kleur-indicator voor rollen/zones ──────────────────────── */
.kleur-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* ── Foto / avatar ───────────────────────────────────────────── */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--kleur-achtergrond);
    border: 2px solid var(--kleur-rand);
}

.avatar-groot {
    width: 80px;
    height: 80px;
}

/* ── Lege staat ──────────────────────────────────────────────── */
.lege-staat {
    text-align: center;
    padding: 48px 24px;
    color: var(--kleur-tekst-licht);
}

.lege-staat svg {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    opacity: .3;
}

.lege-staat p {
    font-size: 14px;
    margin-bottom: 16px;
}

/* ── Paginering ──────────────────────────────────────────────── */
.paginering {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding-top: 16px;
}

.paginering a,
.paginering span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    font-size: 13px;
    text-decoration: none;
    color: var(--kleur-tekst-dim);
    border: 1px solid transparent;
}

.paginering a:hover {
    background: var(--kleur-achtergrond);
    border-color: var(--kleur-rand);
}

.paginering .actief {
    background: var(--kleur-primair);
    color: #fff;
    font-weight: 600;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .stagiq-sidebar {
        transform: translateX(-100%);
        transition: transform .25s;
    }

    .stagiq-sidebar.open {
        transform: translateX(0);
    }

    .stagiq-inhoud {
        margin-left: 0;
        padding: 16px;
    }

    .formulier-rij {
        grid-template-columns: 1fr;
    }

    .pagina-header {
        flex-direction: column;
    }
}

/* ── Hulpklassen ─────────────────────────────────────────────── */
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.tekst-dim   { color: var(--kleur-tekst-dim); }
.tekst-licht { color: var(--kleur-tekst-licht); }
.tekst-klein { font-size: 12px; }
.tekst-midden { text-align: center; }
.vet         { font-weight: 700; }

.flex        { display: flex; }
.flex-midden { display: flex; align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.gap-16      { gap: 16px; }

.scheidingslijn {
    border: none;
    border-top: 1px solid var(--kleur-rand);
    margin: 20px 0;
}

/* ── Sidebar inklapbaar ─────────────────────────────────────── */
.stagiq-sidebar {
    transition: width .25s ease;
}

.stagiq-sidebar.ingeklapt {
    width: 56px;
}

.stagiq-sidebar.ingeklapt .sidebar-logo-tekst,
.stagiq-sidebar.ingeklapt .sidebar-omgeving,
.stagiq-sidebar.ingeklapt .sidebar-groep-label,
.stagiq-sidebar.ingeklapt .sidebar-link span,
.stagiq-sidebar.ingeklapt .sidebar-footer .gebruiker-naam,
.stagiq-sidebar.ingeklapt .sidebar-footer .gebruiker-rol,
.stagiq-sidebar.ingeklapt .sidebar-footer a {
    display: none;
}

.stagiq-sidebar.ingeklapt .sidebar-link {
    padding: 10px;
    justify-content: center;
}

.stagiq-sidebar.ingeklapt .sidebar-link svg {
    width: 18px;
    height: 18px;
    opacity: 1;
}

.stagiq-sidebar.ingeklapt .sidebar-logo {
    justify-content: center;
    padding: 16px 12px;
}

.stagiq-inhoud {
    transition: margin-left .25s ease;
}

.stagiq-inhoud.breed {
    margin-left: 56px;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--kleur-tekst-dim);
    display: flex;
    align-items: center;
    border-radius: var(--radius-klein);
    margin-left: auto;
}

.stagiq-sidebar.ingeklapt .sidebar-toggle {
    margin-left: 0;
}

.sidebar-toggle:hover {
    background: var(--kleur-achtergrond);
    color: var(--kleur-tekst);
}

/* ── Vergrendel scherm ──────────────────────────────────────── */
.vergrendel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(244,245,247,.96);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.vergrendel-kaart {
    background: var(--kleur-wit);
    border-radius: var(--radius-groot);
    border: 1px solid var(--kleur-rand);
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: var(--schaduw-popup);
}

.vergrendel-icoon {
    width: 56px;
    height: 56px;
    background: var(--kleur-achtergrond);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.vergrendel-icoon svg {
    width: 24px;
    height: 24px;
    stroke: var(--kleur-tekst-dim);
}

/* ── Knop ghost ─────────────────────────────────────────────── */
.knop-ghost {
    background: transparent;
    color: var(--kleur-tekst-dim);
    border: 1px solid var(--kleur-rand);
}
.knop-ghost:hover {
    background: var(--kleur-achtergrond);
    color: var(--kleur-tekst);
    border-color: var(--kleur-rand-sterk);
}

/* ── Filter balk ────────────────────────────────────────────── */
.filter-balk {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Tab navigatie ──────────────────────────────────────────── */
.tab-balk {
    display: flex;
    background: var(--kleur-achtergrond);
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    padding: 3px;
    gap: 2px;
    flex-shrink: 0;
}
.tab {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: calc(var(--radius) - 2px);
    font-size: 13px;
    font-weight: 500;
    color: var(--kleur-tekst-dim);
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.tab:hover {
    color: var(--kleur-tekst);
    background: rgba(0,0,0,.04);
}
.tab.actief {
    background: var(--kleur-wit);
    color: var(--kleur-tekst);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ── Tabel acties kolom ─────────────────────────────────────── */
.tabel-acties {
    text-align: right;
    white-space: nowrap;
}
.tabel-acties .knop + .knop {
    margin-left: 6px;
}

/* ── Avatar initiaal ────────────────────────────────────────── */
.avatar-initiaal {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--kleur-primair-licht);
    color: var(--kleur-primair);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Formulier kolommen (2-koloms layout) ───────────────────── */
.formulier-kolommen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .formulier-kolommen {
        grid-template-columns: 1fr;
    }
}

/* ── Formulier acties (knoppenrij onderaan) ─────────────────── */
.formulier-acties {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

/* ── Formulier hulptekst & fout ─────────────────────────────── */
.formulier-hulp {
    font-size: 12px;
    color: var(--kleur-tekst-dim);
    margin-top: 4px;
}
.formulier-groep.heeft-fout .invoer {
    border-color: var(--kleur-fout);
}
.fout-tekst {
    font-size: 12px;
    color: var(--kleur-fout);
    margin-top: 4px;
}
.verplicht {
    color: var(--kleur-fout);
}

/* ── Cel helpers tabel ──────────────────────────────────────── */
.cel-dim {
    color: var(--kleur-tekst-dim);
    font-size: 13px;
}
.cel-subtitel {
    font-size: 12px;
    color: var(--kleur-tekst-dim);
    margin-top: 1px;
}

/* ── Organisatie cel (logo + naam) ─────────────────────────── */
.org-cel {
    display: flex;
    align-items: center;
    gap: 10px;
}
.org-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid var(--kleur-rand);
    flex-shrink: 0;
}

/* ── Stat-grid spacing ──────────────────────────────────────── */
.stat-grid-mb {
    margin-bottom: 24px;
}

/* ── Kaart spacing helper ────────────────────────────────────── */
.kaart-mb {
    margin-bottom: 20px;
}

/* ── Invoer flex (vult beschikbare breedte in filter-balk) ──── */
.invoer-flex {
    flex: 1;
    min-width: 200px;
}

/* ── Toggle schakelaar ──────────────────────────────────────── */
.toggle-rij {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--kleur-rand);
}
.toggle-rij:last-child { border-bottom: none; }

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    flex: 1;
}
.toggle-label.toggle-disabled { cursor: default; opacity: .6; }
.toggle-label input[type="checkbox"] { display: none; }

.toggle-schakelaar {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--kleur-rand-sterk);
    border-radius: 10px;
    flex-shrink: 0;
    transition: background .2s;
}
.toggle-schakelaar::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s;
}
.toggle-label input:checked + .toggle-schakelaar { background: var(--kleur-primair); }
.toggle-label input:checked + .toggle-schakelaar::after { transform: translateX(16px); }
.toggle-tekst { font-size: 14px; color: var(--kleur-tekst); }

/* ── Pagina-brede tab balk ──────────────────────────────────── */
.tab-balk-pagina {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--kleur-rand);
    border-radius: 0;
    padding: 0;
    gap: 0;
}
.tab-balk-pagina .tab {
    padding: 10px 18px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
}
.tab-balk-pagina .tab:hover { background: var(--kleur-achtergrond); color: var(--kleur-tekst); }
.tab-balk-pagina .tab.actief {
    color: var(--kleur-primair);
    border-bottom-color: var(--kleur-primair);
    background: transparent;
    box-shadow: none;
}
.tab-teller {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--kleur-primair-licht);
    color: var(--kleur-primair);
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 5px;
}

/* ── Bibliotheek selectie rijen (rollen / zones) ────────────── */
.bibliotheek-rijen {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bibliotheek-rij {
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    padding: 12px 14px;
    transition: border-color .15s, background .15s;
}
.bibliotheek-rij.geselecteerd {
    border-color: var(--kleur-primair);
    background: var(--kleur-primair-licht);
}
.bibliotheek-rij-hoofd {
    display: flex;
    align-items: center;
    gap: 12px;
}
/* .toggle-label heeft elders flex:1 (voor gebruik in .toggle-rij), maar mag hier
   niet uitrekken — anders schuift de rolnaam/badges ver naar rechts weg van de schakelaar. */
.bibliotheek-rij-hoofd .toggle-label {
    flex: 0 0 auto;
}
.bibliotheek-rij-naam {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.bibliotheek-rij-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.bibliotheek-rij-details {
    padding-top: 4px;
}

/* ── Kleur stip ─────────────────────────────────────────────── */
.kleur-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,.1);
}

/* ── Invoer readonly weergave ───────────────────────────────── */
.invoer-readonly {
    padding: 9px 12px;
    background: var(--kleur-achtergrond);
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--kleur-tekst-dim);
}

/* ── Datum + tijd velden ────────────────────────────────────── */
input[type="datetime-local"] {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--kleur-rand-sterk);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 14px;
    color: var(--kleur-tekst);
    background: var(--kleur-wit);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    cursor: pointer;
}
input[type="datetime-local"]:focus {
    border-color: var(--kleur-primair);
    box-shadow: 0 0 0 3px rgba(233,69,96,.1);
}
input[type="date"],
input[type="time"] {
    cursor: pointer;
}

.datum-tijd-groep {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
}
.datum-tijd-groep input[type="time"] {
    width: 110px;
}

/* ── Custom file upload ─────────────────────────────────────── */
.bestand-upload {
    position: relative;
}
.bestand-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    z-index: 2;
}
.bestand-upload-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px dashed var(--kleur-rand-sterk);
    border-radius: var(--radius);
    background: var(--kleur-achtergrond);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    font-size: 14px;
    color: var(--kleur-tekst-dim);
    user-select: none;
}
.bestand-upload:hover .bestand-upload-label {
    border-color: var(--kleur-primair);
    background: var(--kleur-primair-licht);
    color: var(--kleur-primair);
}
.bestand-upload-icoon {
    width: 32px;
    height: 32px;
    background: var(--kleur-wit);
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.bestand-upload-icoon svg {
    width: 16px;
    height: 16px;
    stroke: var(--kleur-tekst-dim);
}
.bestand-upload-tekst { flex: 1; }
.bestand-upload-naam {
    font-weight: 500;
    color: var(--kleur-tekst);
}
.bestand-upload-huidig {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.bestand-upload-huidig img {
    max-height: 52px;
    max-width: 160px;
    object-fit: contain;
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    padding: 6px;
    background: var(--kleur-wit);
}

/* ── Contactmomenten / inline subtabel ──────────────────────── */
.subtabel-kader {
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius-kaart);
    overflow: hidden;
}
.subtabel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--kleur-wit);
    border-bottom: 1px solid var(--kleur-rand);
}
.subtabel-header-titel {
    font-size: 14px;
    font-weight: 600;
    color: var(--kleur-tekst);
}
.subtabel table {
    border: none;
    box-shadow: none;
}
.subtabel table thead th {
    background: var(--kleur-achtergrond);
    color: var(--kleur-tekst-dim);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 8px 18px;
    border-bottom: 1px solid var(--kleur-rand);
}
.subtabel table tbody td {
    padding: 11px 18px;
    font-size: 13px;
    border-bottom: 1px solid var(--kleur-rand);
    vertical-align: middle;
}
.subtabel table tbody tr:last-child td {
    border-bottom: none;
}
.subtabel table tbody tr:hover td {
    background: var(--kleur-achtergrond);
}
.subtabel-leeg {
    padding: 24px 18px;
    text-align: center;
    color: var(--kleur-tekst-dim);
    font-size: 13px;
    background: var(--kleur-wit);
}

/* Inline toevoegen-rij */
.subtabel-toevoegen {
    padding: 14px 18px;
    background: var(--kleur-achtergrond);
    border-top: 1px solid var(--kleur-rand);
    display: none;
}
.subtabel-toevoegen.open { display: block; }
.subtabel-toevoegen .formulier-rij { margin-bottom: 10px; }

/* ── Icoon verwijder knop (× in subtabel) ───────────────────── */
.knop-icoon-verwijder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    background: var(--kleur-wit);
    color: var(--kleur-tekst-dim);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    padding: 0;
}
.knop-icoon-verwijder:hover {
    background: var(--kleur-fout-licht);
    border-color: var(--kleur-fout);
    color: var(--kleur-fout);
}

/* ── Online status stip ─────────────────────────────────────── */
.online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--kleur-succes);
    display: inline-block;
    animation: pulse-dot 2s infinite;
    flex-shrink: 0;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: .4; }
}
