:root {
    --ink: #14211c;
    --ink-soft: #3a4b44;
    --paper: #f6f4ee;
    --surface: #ffffff;
    --line: #e2ded4;
    --forest: #1f4d3f;
    --forest-soft: #ecf2ef;
    --amber: #c47e1a;
    --amber-soft: #fbf1df;
    --rood: #a83232;
    --muted: #8a8a80;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(20, 33, 28, .05), 0 8px 24px -16px rgba(20, 33, 28, .25);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    font-family: "IBM Plex Sans", sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-size: 15px;
    line-height: 1.5;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 232px;
    flex-shrink: 0;
    background: var(--ink);
    color: #d8e2dc;
    padding: 26px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--amber);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 20px;
    font-family: "IBM Plex Mono", monospace;
}

.brand-name {
    font-weight: 600;
    color: #fff;
    letter-spacing: -.01em;
}

.brand-sub {
    font-size: 12px;
    color: #8ba398;
    letter-spacing: .08em;
    text-transform: uppercase;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: block;
    padding: 9px 14px;
    border-radius: 8px;
    color: #b7c6bf;
    text-decoration: none;
    font-weight: 500;
    font-size: 14.5px;
    transition: background .12s, color .12s;
}

    .nav-item:hover {
        background: rgba(255,255,255,.06);
        color: #fff;
    }

    .nav-item.active {
        background: var(--forest);
        color: #fff;
    }

/* Gegroepeerd menu (hoofdonderwerp + sub-items, met Lucide-iconen) */
.nav-group {
    display: flex;
    flex-direction: column;
}

.nav-group-head {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: #cdd9d3;
    font: inherit;
    font-weight: 600;
    font-size: 13.5px;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s, color .12s;
}

    .nav-group-head:hover {
        background: rgba(255,255,255,.06);
        color: #fff;
    }

.nav-icon {
    display: inline-flex;
    flex: 0 0 auto;
}

    .nav-icon svg {
        width: 18px;
        height: 18px;
    }

.nav-label {
    flex: 1 1 auto;
}

.nav-chev {
    flex: 0 0 auto;
    color: #8ba398;
    transition: transform .15s ease;
}

.nav-group.open > .nav-group-head .nav-chev {
    transform: rotate(90deg);
}

.nav-group-body {
    display: none;
    flex-direction: column;
    gap: 1px;
    margin: 1px 0 4px;
}

.nav-group.open > .nav-group-body {
    display: flex;
}

    /* Sub-items uitlijnen onder het label van de groepskop. */
    .nav-group-body .nav-item {
        padding-left: 43px;
        font-size: 14px;
    }

/* Losse item met icoon (Help) en de scheidingslijn ervoor. */
.nav-solo {
    display: flex;
    align-items: center;
    gap: 11px;
}

.nav-sep {
    height: 1px;
    background: rgba(255,255,255,.12);
    margin: 8px 6px;
}

/* Content */
.content {
    flex: 1;
    padding: 40px 48px;
    max-width: 1180px;
}

h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 4px;
}

h2 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 14px;
}

.lead {
    color: var(--ink-soft);
    margin: 0 0 28px;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
}

/* Forms */
label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 5px;
}

input, select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    color: var(--ink);
}

    input:focus, select:focus {
        outline: none;
        border-color: var(--forest);
        box-shadow: 0 0 0 3px var(--forest-soft);
    }

.num {
    font-family: "IBM Plex Mono", monospace;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.field-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

    .field-row > div {
        flex: 1;
        min-width: 150px;
    }

/* Buttons */
button {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    padding: 9px 16px;
    border: 1px solid transparent;
    transition: filter .12s, background .12s;
}

/* Anchors die als knop dienen (bv. <a class="btn-primary" href=…>) krijgen dezelfde basis als <button>. */
a.btn-primary,
a.btn-ghost,
a.btn-amber,
a.btn-danger {
    display: inline-block;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: normal;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    padding: 9px 16px;
    border: 1px solid transparent;
    transition: filter .12s, background .12s;
}

.btn-primary {
    background: var(--forest);
    color: #fff;
}

    .btn-primary:hover {
        filter: brightness(1.08);
    }

    .btn-primary:disabled {
        opacity: .5;
        cursor: not-allowed;
    }

.btn-ghost {
    background: transparent;
    color: var(--forest);
    border-color: var(--line);
}

    .btn-ghost:hover {
        background: var(--forest-soft);
    }

.btn-danger {
    background: transparent;
    color: var(--rood);
    border-color: transparent;
    padding: 6px 8px;
}

    .btn-danger:hover {
        background: #f6e7e7;
    }

.btn-amber {
    background: var(--amber);
    color: #fff;
}

    .btn-amber:hover {
        filter: brightness(1.06);
    }

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 6px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

th, td {
    text-align: left;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

th {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    font-weight: 600;
}

    td.num, th.num {
        text-align: right;
        font-family: "IBM Plex Mono", monospace;
        font-variant-numeric: tabular-nums;
    }

tr.totaal td {
    font-weight: 700;
    border-top: 2px solid var(--ink);
    border-bottom: none;
}

/* Twee gelijke kolommen naast elkaar (balans & W&V), responsive. */
.split2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .split2 {
        grid-template-columns: 1fr;
    }
}

/* Gebruikersblok onderaan de zijbalk (ingelogde gebruiker + uitloggen). */
.sidebar-user {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .15);
}

/* --- Taalkiezer (vriendelijke dropdown met vlaggetjes, onderin de sidebar) --- */
.taalkiezer {
    position: relative;
    padding: 8px 0 4px;
}

.taal-huidig {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 9px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    color: inherit;
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.taal-huidig:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .28);
}

.taal-huidig .taal-naam {
    flex: 1;
    text-align: left;
    white-space: nowrap;
}

.taal-chev {
    opacity: .7;
    font-size: .7rem;
}

/* Vlaggetje: vaste 3:2-verhouding, afgeronde hoekjes met een subtiel randje */
.taal-vlag {
    flex: 0 0 auto;
    display: block;
    width: 22px;
    height: 15px;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .2);
    line-height: 0;
}

.taal-vlag svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Onzichtbare laag die buiten-klikken opvangt om het menu te sluiten */
.taal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
}

/* Uitklapmenu: opent naar boven (de kiezer staat onderin de sidebar) */
.taal-menu {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    min-width: 190px;
    margin: 0;
    padding: 5px;
    list-style: none;
    background: #ffffff;
    color: #1f2937;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .18);
    z-index: 41;
}

.taal-menu li {
    list-style: none;
}

.taal-optie {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    text-decoration: none;
    color: inherit;
    font-size: .88rem;
}

.taal-optie:hover {
    background: #f1f5f9;
}

.taal-optie.actief {
    font-weight: 600;
}

.taal-optie .taal-naam {
    flex: 1;
}

.taal-check {
    color: #2563eb;
    font-weight: 700;
}

/* Ingeklapte sidebar: alleen het vlaggetje, knop gecentreerd; menu klapt naar rechts open */
.app-shell.ingeklapt .taal-huidig {
    justify-content: center;
    padding: 7px;
}

.app-shell.ingeklapt .taal-menu {
    left: 0;
    right: auto;
}

/* Grootboekoverzicht: categorie-koppen (resultaat/balans) en hun subtotalen. */
tr.subkop td {
    background: var(--surface-2, #f3f4f6);
    text-transform: uppercase;
    font-size: .78rem;
    letter-spacing: .03em;
    padding-top: .6rem;
}

tr.subtotaal td {
    font-weight: 600;
    border-top: 1px dashed var(--border, #d1d5db);
}

.table-cell-input input, .table-cell-input select {
    padding: 6px 8px;
    font-size: 13px;
}

/* Misc */
.tag {
    display: inline-block;
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    background: var(--amber-soft);
    color: var(--amber);
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.melding {
    padding: 11px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 14px;
}

    .melding.ok {
        background: var(--forest-soft);
        color: var(--forest);
    }

    .melding.fout {
        background: #f6e7e7;
        color: var(--rood);
    }

.muted {
    color: var(--muted);
}

.dropzone {
    border: 2px dashed var(--line);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    background: #fbfaf6;
}

.spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: -2px;
    margin-right: 7px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

a {
    color: var(--forest);
}

/* Twee kolommen: preview naast formulier/regels */
.split {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.split-preview {
    flex: 0 0 360px;
    position: sticky;
    top: 24px;
}

.split-main {
    flex: 1;
    min-width: 0;
}

.preview-frame {
    width: 100%;
    height: 70vh;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.preview-img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.table-scroll {
    overflow-x: auto;
}

@media (max-width: 1024px) {
    .split {
        flex-wrap: wrap;
    }

    .split-preview {
        flex-basis: 100%;
        position: static;
    }

    .content {
        padding: 28px 20px;
    }

    .sidebar {
        width: 200px;
    }
}

/* Bredere invoervelden voor bedragen in de regeltabellen */
.table-cell-input input.num {
    min-width: 104px;
}

.table-cell-input td.num, .table-cell-input th.num {
    min-width: 104px;
}

/* Omschrijving-cel met vergrootknop */
.cel-omschrijving {
    display: flex;
    gap: 6px;
    align-items: center;
}

    .cel-omschrijving input {
        flex: 1;
        min-width: 0;
    }

.btn-icon {
    padding: 6px 9px;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-soft);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

    .btn-icon:hover {
        background: var(--forest-soft);
        border-color: var(--forest);
        color: var(--forest);
    }

.rij-acties {
    display: flex;
    gap: 4px;
    white-space: nowrap;
}

/* Pop-up (modal) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20,33,28,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px;
    width: min(560px, 94vw);
    box-shadow: var(--shadow);
}

    .modal h3 {
        margin: 0 0 12px;
        font-size: 16px;
    }

    .modal textarea {
        width: 100%;
        min-height: 150px;
        font-family: inherit;
        font-size: 14px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 8px;
        resize: vertical;
    }

        .modal textarea:focus {
            outline: none;
            border-color: var(--forest);
            box-shadow: 0 0 0 3px var(--forest-soft);
        }

    .modal .actions {
        justify-content: flex-end;
        margin-top: 16px;
    }

/* Inklapbaar menu → icoon-rail (alleen groeps-iconen; klik klapt weer uit). */
.sidebar {
    transition: width .2s ease, padding .2s ease;
}

.app-shell.ingeklapt .sidebar {
    width: 66px;
    padding-left: 10px;
    padding-right: 10px;
    overflow: hidden;
}

    /* In de rail: labels, chevrons en sub-items verbergen; alleen iconen tonen. */
    .app-shell.ingeklapt .brand-text,
    .app-shell.ingeklapt .nav-label,
    .app-shell.ingeklapt .nav-chev,
    .app-shell.ingeklapt .nav-sep,
    .app-shell.ingeklapt .sidebar-user {
        display: none;
    }

    .app-shell.ingeklapt .nav-group-body {
        display: none !important;
    }

    .app-shell.ingeklapt .nav-group-head,
    .app-shell.ingeklapt .nav-solo {
        justify-content: center;
        gap: 0;
        padding-left: 0;
        padding-right: 0;
    }

    .app-shell.ingeklapt .brand {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 22px;
    }

        .app-shell.ingeklapt .menu-toggle {
            margin-left: 0;
            align-self: center;
        }

.menu-toggle {
    margin-left: auto;
    align-self: flex-start;
    background: transparent;
    border: none;
    color: #8ba398;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

    .menu-toggle:hover {
        background: rgba(255,255,255,.08);
        color: #fff;
    }

.menu-open {
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
}

    .menu-open:hover {
        filter: brightness(1.25);
    }

@media (max-width: 1024px) {
    /* Rail blijft ook op smalle schermen een rail (geen volledige verberging meer). */
    .app-shell.ingeklapt .sidebar {
        width: 66px;
    }
}

/* Help: contextlinkje (?) naast schermtitels + de Help-pagina zelf */
.help-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--forest-soft);
    color: var(--forest);
    border: 1px solid var(--forest);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
    cursor: help;
}

    .help-badge:hover {
        background: var(--forest);
        color: #fff;
    }

h1 .help-badge {
    width: 24px;
    height: 24px;
    font-size: 14px;
}

.help-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: center;
}

    .help-toc a {
        color: var(--forest);
        text-decoration: none;
        font-size: 14px;
    }

        .help-toc a:hover {
            text-decoration: underline;
        }

.help-sectie {
    scroll-margin-top: 16px;
}

    .help-sectie h2 {
        margin-top: 0;
    }

    .help-sectie ul {
        margin: 8px 0 0;
        padding-left: 20px;
        line-height: 1.55;
    }

    .help-sectie li {
        margin-bottom: 6px;
    }

/* Grootboekkaart: regels die bij een gestorneerd (vervallen) stuk horen — grijs gearceerd. */
tr.rij-vervallen > td {
    background: #f1f0ec;
    color: var(--ink-soft);
}

.tag-vervallen {
    background: #e5e7eb;
    color: #6b7280;
    margin-left: 6px;
}

/* Selectievakje in regelacties + alleen-lezen berekend veld */
.rij-check {
    width: auto;
    margin: 0 4px 0 0;
    cursor: pointer;
}

.readonly-veld {
    background: #f3f1ea;
    color: var(--ink-soft);
    cursor: default;
}

/* Ingeklapt menu: volle breedte voor de boekingsregels */
.app-shell.ingeklapt .content {
    max-width: none;
}

/* Preview van bon/factuur met de muis groter te slepen (naast openen in nieuw venster) */
.split-preview {
    flex: 0 0 auto;
    width: 360px;
    min-width: 260px;
    max-width: 80vw;
    resize: horizontal;
    overflow: auto;
}

.preview-frame, .preview-img {
    resize: vertical;
    overflow: auto;
    min-height: 320px;
    max-height: none;
}

@media (max-width: 1024px) {
    .split-preview {
        width: auto;
        max-width: none;
        flex-basis: 100%;
        resize: none;
    }
}

/* Link-als-knop + terug-navigatie op detailpagina's */
a.btn-icon {
    display: inline-block;
    text-decoration: none;
}

.kop-rij {
    margin-bottom: 6px;
}

.terug {
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 14px;
}

    .terug:hover {
        color: var(--forest);
    }

/* Sorteerbare tabelkoppen */
th.sorteerbaar {
    cursor: pointer;
    user-select: none;
}

    th.sorteerbaar:hover {
        color: var(--forest);
    }

th.sorteer-actief {
    color: var(--forest);
}

.sorteer-pijl {
    font-size: 11px;
}

/* Taalopties zijn POST-formulieren (antiforgery): de submit-knop oogt als de oude link. */
button.taal-optie {
    width: 100%;
    background: none;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

/* ===== Dashboard: KPI-tegels + SVG-grafieken =====
   Grafiekkleuren zijn gevalideerd (CVD/contrast) op de witte kaart-surface:
   omzet #2a78d6 / kosten #eb6834 (categoriaal paar), pos #2a78d6 / neg #e34948 (diverging). */
:root {
    --viz-omzet: #2a78d6;
    --viz-kosten: #eb6834;
    --viz-pos: #2a78d6;
    --viz-neg: #e34948;
    --viz-grid: #e1e0d9;
    --viz-as: #898781;
    --viz-baseline: #c3c2b7;
}

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

.kpi-tegel {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
}

    .kpi-tegel:hover {
        border-color: var(--forest);
    }

.kpi-label {
    font-size: .8rem;
    color: var(--muted);
}

.kpi-waarde {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.15;
}

.kpi-sub {
    font-size: .78rem;
    color: var(--muted);
}

.viz {
    width: 100%;
    height: auto;
    display: block;
}

.viz-grid {
    stroke: var(--viz-grid);
    stroke-width: 1;
}

.viz-baseline {
    stroke: var(--viz-baseline);
    stroke-width: 1.5;
}

.viz-as {
    fill: var(--viz-as);
    font-size: 11px;
}

.viz-staaf-omzet { fill: var(--viz-omzet); }
.viz-staaf-kosten { fill: var(--viz-kosten); }
.viz-staaf-pos { fill: var(--viz-pos); }
.viz-staaf-neg { fill: var(--viz-neg); }

/* Hover: de maand onder de cursor licht op, de rest dimt licht (tooltip via <title>). */
.viz:hover .viz-groep:not(:hover) path {
    opacity: .55;
}

.viz-legenda {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 6px;
}

.viz-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 5px;
    vertical-align: baseline;
}

/* ===== Mobiel casco (≤ 900px): topbalk + uitschuifbaar menu, kaarten scrollen horizontaal ===== */
.mobiel-topbar {
    display: none;
}

@media (max-width: 900px) {
    .mobiel-topbar {
        position: sticky;
        top: 0;
        z-index: 40;
        display: flex;
        align-items: center;
        gap: 12px;
        background: var(--ink);
        color: #d8e2dc;
        padding: 10px 14px;
    }

        .mobiel-topbar .brand-mark {
            width: 30px;
            height: 30px;
            font-size: .9rem;
        }

        .mobiel-topbar .topbar-titel {
            font-weight: 600;
        }

        .mobiel-topbar .topbar-sub {
            font-size: .78rem;
            color: var(--amber);
        }

    .menu-knop {
        margin-left: auto;
        background: none;
        border: 1px solid rgba(255,255,255,.25);
        border-radius: 8px;
        color: inherit;
        font-size: 1.15rem;
        line-height: 1;
        padding: 6px 10px;
        cursor: pointer;
    }

    .app-shell {
        display: block;
    }

        /* Sidebar wordt een off-canvas lade; .menu-open schuift 'm in beeld. */
        .app-shell .sidebar {
            position: fixed;
            inset: 0 auto 0 0;
            width: min(300px, 85vw);
            height: 100dvh;
            z-index: 60;
            transform: translateX(-105%);
            transition: transform .2s ease;
            overflow-y: auto;
        }

        .app-shell.menu-open .sidebar {
            transform: none;
        }

    .menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 50;
        background: rgba(20, 33, 28, .45);
    }

    .content {
        padding: 14px;
    }

    /* Brede inhoud (tabellen) scrolt binnen de kaart i.p.v. de pagina te verbreden. */
    .card {
        overflow-x: auto;
    }

    /* Formulieren stapelen verticaal: elk veld volle breedte (wint bewust van inline flex:0-hints,
       die zijn voor de desktop-rij-indeling). */
    .field-row {
        flex-wrap: wrap;
    }

        .field-row > div {
            flex: 1 1 100% !important;
            min-width: 0 !important;
        }

    /* Touch-targets + 16px voorkomt dat iOS inzoomt bij focus op een veld. */
    input, select, textarea {
        font-size: 16px;
        min-height: 42px;
    }

    textarea {
        min-height: 0;
    }

    input[type="checkbox"] {
        min-height: 0;
        width: 20px;
        height: 20px;
    }

    button, .btn-primary, .btn-ghost, .btn-danger, .btn-icon {
        min-height: 42px;
    }

    h1 {
        font-size: 1.35rem;
    }

    /* Compactere tabellen; secundaire kolommen met .m-verberg verdwijnen (de kern past dan
       zonder horizontaal scrollen; het volledige beeld blijft op desktop). */
    table {
        font-size: 13px;
    }

    th, td {
        padding: 8px 10px;
    }

    .m-verberg {
        display: none;
    }

    .kpi-waarde {
        font-size: 1.25rem;
    }
}

/* Administratie-keuzescherm (/administraties): opties zijn POST-formulieren (antiforgery);
   de submit-knop oogt als een keuzekaart met initialen-blokje, naam + rol en een huidige-badge. */
button.adm-optie {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

    button.adm-optie:hover {
        border-color: var(--forest);
        background: var(--forest-soft);
    }

    button.adm-optie.actief {
        border-color: var(--forest);
    }

.adm-mark {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--forest);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: .9rem;
}

.adm-tekst {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

    .adm-tekst .muted {
        font-size: .82rem;
    }

.adm-badge {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: .78rem;
    color: var(--forest);
    background: var(--forest-soft);
    border-radius: 999px;
    padding: 3px 10px;
}

/* Platformconsole (/platform): warm-donkere sidebar met amber-accent, zodat platformbeheer zich
   direct visueel onderscheidt van de boekhouding (die de groene huisstijl houdt). */
.app-shell.platform .sidebar {
    background: #2a2018;
    color: #e8ddcf;
}

.app-shell.platform .brand-mark {
    background: var(--amber);
    color: #fff;
}

.app-shell.platform .brand-sub {
    color: var(--amber);
}
