/* ==========================================================================
   Plantkaart Studio — Veldlof huisstijl
   Kleuren en typografie afgeleid van veldlof.nl (Baskervville + Mulish,
   diepgroen #004228, salie #5b6d49, oker #ad9741, crème #faf9f6).
   ========================================================================== */

@font-face {
    font-family: "Baskervville";
    src: url("/static/fonts/baskervville.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Baskervville";
    src: url("/static/fonts/baskervville-italic.woff2") format("woff2");
    font-weight: 400 700;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Mulish";
    src: url("/static/fonts/mulish.woff2") format("woff2");
    font-weight: 300 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Mulish";
    src: url("/static/fonts/mulish-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

:root {
    --forest: #004228;
    --forest-hover: #00341f;
    --forest-900: #0b2621;
    --forest-050: #eef3ef;
    --sage: #5b6d49;
    --sage-100: #e8ece2;
    --sage-200: #d5dccb;
    --ochre: #ad9741;
    --ochre-600: #8c7a32;
    --ochre-100: #f5f0de;
    --cream: #faf9f6;
    --sand: #f3f1ea;
    --paper: #ffffff;
    --ink: #1e2a23;
    --ink-2: #48524b;
    --muted: #747a72;
    --line: #e7e3d9;
    --line-strong: #d5d0c3;
    --danger: #a3402f;
    --danger-100: #f8e9e5;
    --info: #3c5f7a;
    --info-100: #e7eef3;
    --warn: #8a6516;
    --warn-100: #f7efd9;

    /* Oude namen blijven werken voor bestaande pagina-styles */
    --green: var(--forest);
    --gold: var(--ochre);
    --bg: var(--cream);
    --card: var(--paper);

    --font-serif: "Baskervville", "Iowan Old Style", Georgia, serif;
    --font-sans: "Mulish", "Segoe UI", system-ui, -apple-system, sans-serif;

    --radius-lg: 16px;
    --radius: 12px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(11, 38, 33, .05);
    --shadow: 0 1px 2px rgba(11, 38, 33, .04), 0 6px 20px rgba(11, 38, 33, .05);
    --shadow-lg: 0 12px 40px rgba(11, 38, 33, .16), 0 2px 6px rgba(11, 38, 33, .06);
    --ring: 0 0 0 3px rgba(0, 66, 40, .16);

    --sidebar-w: 252px;
    --topbar-h: 58px;
    --tabbar-h: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--forest-hover); }
img { max-width: 100%; }
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 500;
    color: var(--forest-900);
    letter-spacing: -.005em;
    line-height: 1.2;
}
h1 { font-size: 34px; margin: 0 0 6px; }
h2 { font-size: 24px; margin: 0 0 12px; }
h3 { font-size: 19px; margin: 0 0 10px; }
h4 { font-size: 16px; margin: 0 0 8px; }
code { font-size: .9em; background: var(--sand); border-radius: 5px; padding: 1px 5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
::selection { background: rgba(173, 151, 65, .28); }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }

.icon { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 24px; height: 24px; }

/* ---------- App-shell ---------- */
.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--forest-900);
    background-image: radial-gradient(120% 60% at 0% 0%, rgba(91, 109, 73, .35), transparent 60%);
    color: #e9ece4;
    display: flex;
    flex-direction: column;
    padding: 22px 14px 18px;
    z-index: 80;
}
.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 8px 22px;
    color: inherit;
}
.brand-block:hover { color: inherit; }
.brand-mark {
    display: block;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    background: currentColor;
    -webkit-mask: url("/static/logonew.png") center / contain no-repeat;
    mask: url("/static/logonew.png") center / contain no-repeat;
}
.sidebar .brand-mark { color: #f3efe2; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-serif); font-weight: 500; font-size: 20px; color: #fbfaf6; letter-spacing: .005em; }
.brand-text span { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: #b9c2b1; margin-top: 4px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav-label {
    font-size: 10.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #8f9c8b;
    padding: 16px 12px 6px;
}
.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    color: #d6dcd1;
    font-size: 14.5px;
    font-weight: 600;
    position: relative;
    transition: background .15s ease, color .15s ease;
}
.side-link .icon { opacity: .8; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.active { background: rgba(250, 249, 246, .1); color: #fff; }
.side-link.active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--ochre);
}
.side-link.active .icon { opacity: 1; color: #e3d39b; }
.sidebar-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 4px 4px 6px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--ochre);
    color: #1d2416;
    font-weight: 700;
    font-size: 14px;
    transition: background .15s ease, transform .15s ease;
}
.sidebar-cta:hover { background: #bba653; color: #1d2416; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }

.main { margin-left: var(--sidebar-w); min-width: 0; }
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 36px 72px;
}

.topbar { display: none; }
.tabbar { display: none; }

.env-banner {
    background: #a3271b;
    color: #fff;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    padding: 6px 12px;
    letter-spacing: .04em;
    position: relative;
    z-index: 95;
}

@media (max-width: 720px) { .env-banner { padding: 4px 12px; font-size: 12px; } .env-banner-detail { display: none; } }
.env-badge {
    display: inline-block;
    font: 800 9.5px/1 var(--font-sans);
    font-style: normal;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
    background: #a3271b;
    border-radius: 5px;
    padding: 3px 5px;
    vertical-align: 3px;
    margin-left: 2px;
}

/* ---------- Paginakop ---------- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.page-head h1 { margin: 0; }
.page-head .eyebrow { margin-bottom: 6px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.eyebrow {
    display: block;
    font-family: var(--font-sans);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ochre-600);
}
.count-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    margin-left: 8px;
    border-radius: 999px;
    background: var(--sage-100);
    color: var(--sage);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    vertical-align: middle;
    letter-spacing: 0;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 10px;
}
.back-link:hover { color: var(--forest); }

/* ---------- Panelen & grids ---------- */
.panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 18px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.panel.soft { background: var(--sand); border-color: transparent; box-shadow: none; }
.section-title { display: flex; align-items: center; gap: 10px; }
.section-title .icon-badge { margin: 0; }
.icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: inline-grid;
    place-items: center;
    background: var(--sage-100);
    color: var(--forest);
    flex: 0 0 auto;
}
.icon-badge.ochre { background: var(--ochre-100); color: var(--ochre-600); }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }

.kpi {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    background: var(--paper);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.kpi .label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.kpi .value { color: var(--forest-900); font-family: var(--font-serif); font-size: 36px; font-weight: 500; margin-top: 6px; line-height: 1; }
.kpi .hint { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

/* ---------- Knoppen ---------- */
.btn {
    --btn-h: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--btn-h);
    padding: 0 16px;
    border: 1px solid var(--forest);
    background: var(--forest);
    color: #fff;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .005em;
    line-height: 1.15;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .08s ease;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--forest-hover); border-color: var(--forest-hover); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.secondary {
    background: var(--paper);
    color: var(--forest);
    border-color: var(--line-strong);
}
.btn.secondary:hover { background: var(--forest-050); border-color: #bfc9bd; color: var(--forest); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sand); color: var(--forest); }
.btn.accent { background: var(--ochre); border-color: var(--ochre); color: #1d2416; }
.btn.accent:hover { background: #bba653; border-color: #bba653; color: #1d2416; }
.btn.danger, .btn.secondary.danger { background: var(--paper); color: var(--danger); border-color: #e3c2bb; }
.btn.danger:hover, .btn.secondary.danger:hover { background: var(--danger-100); border-color: #d9a79c; color: var(--danger); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { --btn-h: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; gap: 6px; }
.btn.small .icon { width: 16px; height: 16px; }
.btn.icon-only { padding: 0; width: var(--btn-h); }
.btn.block { width: 100%; }
.btn-group { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--paper); }
.btn-group > a, .btn-group > button {
    border: 0;
    background: transparent;
    padding: 0 10px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    font: 700 12.5px var(--font-sans);
    color: var(--ink-2);
    cursor: pointer;
}
.btn-group > * + * { border-left: 1px solid var(--line) !important; }
.btn-group > a:hover, .btn-group > button:hover { background: var(--forest-050); color: var(--forest); }

/* ---------- Formulieren ---------- */
label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 700; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field-hint, .field small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 500; margin-top: 6px; line-height: 1.4; }
input[type=text], input[type=url], input[type=number], input[type=date], input[type=email],
input[type=password], input[type=search], input[type=tel], input[type=month], input[type=time], textarea, select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line-strong);
    background-color: var(--paper);
    border-radius: 10px;
    padding: 9px 12px;
    font-family: var(--font-sans);
    font-size: 14.5px;
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
    -webkit-appearance: none;
    appearance: none;
}
input[type=search]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    cursor: pointer;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23747a72' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / 16px no-repeat;
}
input::placeholder, textarea::placeholder { color: #a3a89f; }
input:hover, textarea:hover, select:hover { border-color: #bdb7a8; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--forest); box-shadow: var(--ring); }
input[readonly], textarea[readonly] { background: var(--sand); color: var(--ink-2); }
input:disabled, select:disabled, textarea:disabled { background: var(--sand); color: var(--muted); cursor: not-allowed; }
select {
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6d49' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}
select[multiple] { background-image: none; padding-right: 12px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input[type=checkbox], input[type=radio] { accent-color: var(--forest); width: 17px; height: 17px; margin: 0; cursor: pointer; flex: 0 0 auto; }
input[type=range] { accent-color: var(--forest); }
input[type=file] { font-family: var(--font-sans); font-size: 14px; max-width: 100%; }
input[type=file]::file-selector-button {
    border: 1px solid var(--line-strong);
    background: var(--paper);
    color: var(--forest);
    font: 700 13px var(--font-sans);
    border-radius: 8px;
    padding: 7px 12px;
    margin-right: 10px;
    cursor: pointer;
}
input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); cursor: pointer; }
.check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    cursor: pointer;
}
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > input { padding-left: 40px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0; }
legend { padding: 0 6px; font-weight: 700; font-size: 13px; color: var(--ink-2); }

/* ---------- Tekst & meldingen ---------- */
.muted { color: var(--muted); font-size: 13.5px; }
.lead { font-size: 16px; color: var(--ink-2); }
.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--forest-050);
    border: 1px solid #c9d8cc;
    color: var(--forest-900);
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}
.message .icon { color: var(--forest); margin-top: 1px; }
.message-close { margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 6px; display: inline-flex; }
.message-close:hover { color: var(--ink); background: rgba(0, 0, 0, .04); }
.message.is-error { background: var(--danger-100); border-color: #ecc8c0; color: #6f2318; }
.message.is-error .icon { color: var(--danger); }
.notice {
    border-radius: var(--radius);
    padding: 12px 14px;
    background: var(--sand);
    color: var(--ink-2);
    font-size: 13.5px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.notice .icon { color: var(--ochre-600); margin-top: 1px; }

/* ---------- Pills & badges ---------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    background: var(--sand);
    color: var(--ink-2);
    white-space: nowrap;
    line-height: 1.5;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill.approved { background: var(--forest-050); color: var(--forest); }
.pill.reviewed { background: var(--ochre-100); color: var(--ochre-600); }
.pill.scraped { background: var(--info-100); color: var(--info); }
.pill.kaart { background: var(--sage-100); color: var(--sage); }
.pill.plain::before { display: none; }

.icon-list { display: flex; gap: 6px; flex-wrap: wrap; }
.icon-list img { width: 20px; height: 20px; opacity: .85; }

/* ---------- Tabellen ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -22px; padding: 0 22px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    background: transparent;
    white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s ease; }

/* ---------- Dropdowns (details/summary of bestaande .open-menu's) ---------- */
.dropdown { position: relative; display: inline-block; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu,
.ai-submenu,
.pdf-submenu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 210px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 60;
}
.dropdown:not([open]) > .dropdown-menu { display: none; }
.ai-submenu, .pdf-submenu { display: none; left: 0; right: auto; }
.ai-submenu.open, .pdf-submenu.open { display: block; }
.dropdown-menu .menu-title,
.ai-submenu .menu-title,
.pdf-submenu .menu-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 8px 10px 4px;
}
.dropdown-menu a, .dropdown-menu button,
.ai-submenu button, .pdf-submenu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--ink);
    border-radius: 8px;
    padding: 9px 10px;
    cursor: pointer;
    font: 600 14px var(--font-sans);
}
.dropdown-menu a:hover, .dropdown-menu button:hover,
.ai-submenu button:hover, .pdf-submenu button:hover { background: var(--forest-050); color: var(--forest); }
.dropdown-menu .icon, .ai-submenu .icon, .pdf-submenu .icon { width: 17px; height: 17px; color: var(--sage); }
.dropdown-menu .danger, .dropdown-menu .danger .icon { color: var(--danger); }
.dropdown-menu .danger:hover { background: var(--danger-100); color: var(--danger); }
.dropdown-menu hr { margin: 6px 4px; }
.dropdown-menu form { margin: 0; }

/* ---------- Modals ---------- */
.modal-backdrop,
.group-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 38, 33, .42);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 120;
    padding: 20px;
}
.modal,
.group-modal {
    width: min(520px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    padding: 24px;
    animation: modal-in .18s ease-out;
}
.modal h3, .group-modal h3 { font-size: 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }

.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.choice-cards label {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 11px 12px;
    margin: 0;
    cursor: pointer;
    font-weight: 700;
    color: var(--ink);
    transition: border-color .15s, background .15s;
}
.choice-cards label:has(input:checked) { border-color: var(--forest); background: var(--forest-050); }
.choice-cards label:has(input:disabled) { opacity: .5; cursor: not-allowed; }

/* ---------- Status / voortgang ---------- */
.spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--sage-200);
    border-top-color: var(--forest);
    animation: app-spin .8s linear infinite;
    flex: 0 0 auto;
    display: inline-block;
}
@keyframes app-spin { to { transform: rotate(360deg); } }
.progress { height: 8px; border-radius: 999px; background: var(--sand); overflow: hidden; }
.progress > span, .progress > div { display: block; height: 100%; background: linear-gradient(90deg, var(--sage), var(--forest)); border-radius: inherit; transition: width .3s ease; }

.empty-state {
    text-align: center;
    padding: 44px 20px;
    color: var(--muted);
}
.empty-state .icon-badge { width: 52px; height: 52px; border-radius: 16px; margin-bottom: 12px; }
.empty-state h3 { margin-bottom: 4px; }
.empty-state p { margin: 0 auto 16px; max-width: 380px; }

/* ---------- Mobiele "Meer"-sheet ---------- */
.sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(11, 38, 33, .4);
    z-index: 130;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 131;
    background: var(--paper);
    border-radius: 20px 20px 0 0;
    padding: 10px 16px calc(18px + var(--safe-bottom));
    transform: translateY(105%);
    visibility: hidden;
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .25s;
    box-shadow: var(--shadow-lg);
}
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 0 auto 12px; }
body.sheet-open .sheet { transform: none; visibility: visible; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
@media (min-width: 1024px) { .sheet, .sheet-backdrop { display: none; } }
body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sheet-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 6px 14px;
    border-radius: 14px;
    background: var(--cream);
    border: 1px solid var(--line);
    color: var(--ink);
    font-weight: 700;
    font-size: 13px;
    text-align: center;
}
.sheet-link .icon { color: var(--forest); width: 24px; height: 24px; }
.sheet-link.active { border-color: var(--forest); background: var(--forest-050); }
.sheet-link.accent { background: var(--ochre-100); border-color: #e7dcb5; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
    .container { padding: 28px 26px 64px; }
}

@media (max-width: 1023px) {
    .sidebar { display: none; }
    .main { margin-left: 0; }
    .topbar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 90;
        height: var(--topbar-h);
        padding: 0 16px;
        background: rgba(250, 249, 246, .92);
        -webkit-backdrop-filter: saturate(160%) blur(12px);
        backdrop-filter: saturate(160%) blur(12px);
        border-bottom: 1px solid var(--line);
    }
    .topbar .brand-mark { width: 34px; height: 34px; color: var(--forest); }
    .topbar-title { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
    .topbar-title span { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ochre-600); font-weight: 700; }
    .topbar-title strong { font-family: var(--font-serif); font-weight: 500; font-size: 19px; color: var(--forest-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .topbar-action { margin-left: auto; }
    .tabbar {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        height: calc(var(--tabbar-h) + var(--safe-bottom));
        padding: 6px 6px calc(6px + var(--safe-bottom));
        background: rgba(255, 255, 255, .96);
        -webkit-backdrop-filter: saturate(160%) blur(12px);
        backdrop-filter: saturate(160%) blur(12px);
        border-top: 1px solid var(--line);
    }
    .tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        border: 0;
        background: transparent;
        color: var(--muted);
        font: 700 11px var(--font-sans);
        letter-spacing: .01em;
        border-radius: 12px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .tab .icon { width: 23px; height: 23px; transition: transform .15s ease; }
    .tab.active { color: var(--forest); }
    .tab.active .tab-ico { background: var(--sage-100); }
    .tab-ico { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background .15s ease; }
    .container { padding: 20px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 28px); }
    body.has-selection-bar .container { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 140px); }
    html { scroll-padding-top: calc(var(--topbar-h) + 16px); }
}

@media (max-width: 900px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    body { font-size: 15px; }
    h1 { font-size: 28px; }
    h2 { font-size: 22px; }
    .page-head { margin-bottom: 18px; align-items: stretch; }
    .page-head > div:first-child { min-width: 0; }
    .page-actions { width: 100%; }
    .page-actions > .btn, .page-actions > .dropdown, .page-actions > form { flex: 1 1 auto; }
    .page-actions > .dropdown > summary { width: 100%; }
    .panel { padding: 18px 16px; border-radius: 14px; }
    .table-scroll { margin: 0 -16px; padding: 0 16px; }
    .kpi { padding: 14px 16px; }
    .kpi .value { font-size: 30px; }
    /* iOS zoomt in op velden < 16px */
    input[type=text], input[type=url], input[type=number], input[type=date], input[type=email],
    input[type=password], input[type=search], input[type=tel], input[type=month], input[type=time], textarea, select { font-size: 16px; min-height: 46px; }
    .btn { --btn-h: 46px; }
    .btn.small { --btn-h: 38px; }

    .modal-backdrop, .group-modal-backdrop { align-items: flex-end; padding: 0; }
    .modal, .group-modal {
        width: 100%;
        max-height: 88vh;
        border-radius: 20px 20px 0 0;
        border: 0;
        padding: 10px 18px calc(20px + var(--safe-bottom));
        animation: sheet-in .25s cubic-bezier(.2, .8, .2, 1);
    }
    .modal::before, .group-modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 0 auto 14px; }
    .modal-actions > .btn, .group-modal .row[style*="flex-end"] > .btn { flex: 1; }

    .dropdown[open] > .dropdown-menu,
    .ai-submenu.open,
    .pdf-submenu.open {
        position: fixed;
        top: auto;
        left: 10px;
        right: 10px;
        bottom: calc(10px + var(--safe-bottom));
        min-width: 0;
        z-index: 140;
        padding: 8px;
        border-radius: 18px;
        box-shadow: 0 0 0 100vmax rgba(11, 38, 33, .38), var(--shadow-lg);
        animation: sheet-in .22s cubic-bezier(.2, .8, .2, 1);
        max-height: 75vh;
        overflow-y: auto;
    }
    .dropdown-menu a, .dropdown-menu button, .ai-submenu button, .pdf-submenu button { padding: 13px 12px; font-size: 15px; }
}

@media (max-width: 420px) {
    .grid-4 { gap: 10px; }
}

.mobile-only { display: none !important; }
@media (max-width: 720px) {
    .mobile-only { display: revert !important; }
    .desktop-only { display: none !important; }
}

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

/* Gastweergave (login): geen zijbalk */
.is-guest .main { margin-left: 0; }
