/* ==========================================================================
   Omgevingsloket design system — geleend van JoDa ("het huisboek")
   Pleistergrijze grond, witte kaarten met zachte schaduw, inkt en leisteen als tekst, één rustig blauw als
   accent. Display: Bricolage Grotesque · Body: Instrument Sans · Data: Spline Sans Mono — alle drie zelf
   gehost (wwwroot/fonts, OFL), zodat geen enkele bezoeker naar een fontdienst lekt.
   Geen componentbibliotheek: alles hieronder is gewone HTML met deze klassen.
   ========================================================================== */

@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 500 800; font-display: swap; src: url("fonts/bricolage-grotesque-latin.woff2") format("woff2"); 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: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/instrument-sans-latin.woff2") format("woff2"); 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: "Spline Sans Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("fonts/spline-sans-mono-latin.woff2") format("woff2"); 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 {
    --gevel: #EFF2EE;          /* grond — pleister */
    --kaart: #FFFFFF;          /* kaartvlak */
    --inkt: #22303A;           /* tekst */
    --lei: #56646D;            /* tweede tekst — leisteen (≥ 5.4:1 op de grond, ook als klein lettertype) */
    --lijn: rgba(34, 48, 58, .10);
    --rand: rgba(34, 48, 58, .22);

    --accent: #4C86E8;         /* het ene blauw: knoppen, focusring, vlakken (geen lopende tekst) */
    --accent-tekst: #2F63C4;   /* hetzelfde blauw, donker genoeg voor tekstlinks (5:1) */
    --groen: #2F9E68;
    --groen-tekst: #22784E;
    --oker: #E8A020;
    --rood: #D2544A;
    --rood-tekst: #B03F36;

    /* reeksen in de grafiek en op de kaart — vaste volgorde, gevalideerd op kleurenblindheid */
    --reeks-1: #2a78d6;
    --reeks-2: #eb6834;
    --reeks-3: #1baf7a;

    --r-card: 16px;
    --r-ctl: 10px;
    --shadow: 0 1px 2px rgba(34, 48, 58, .05), 0 8px 24px -12px rgba(34, 48, 58, .14);
    --shadow-lift: 0 2px 4px rgba(34, 48, 58, .06), 0 14px 32px -12px rgba(34, 48, 58, .20);

    --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
    --font-mono: "Spline Sans Mono", "Cascadia Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--gevel);
    color: var(--inkt);
    font-family: var(--font-body);
    font-size: 15.5px;
    line-height: 1.5;
}

::selection { background: color-mix(in srgb, var(--accent) 25%, white); }

a { color: var(--inkt); }
p a, li a, td a, .hint a { color: var(--accent-tekst); text-decoration-thickness: 1px; text-underline-offset: 2px; }
p a:hover, li a:hover, td a:hover { color: color-mix(in srgb, var(--accent-tekst) 70%, var(--inkt)); }

h1:focus { outline: none; }

/* --------------------------------------------------------------- topbar */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000; /* boven de Leaflet-panes */
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: .65rem 1.25rem;
    background: color-mix(in srgb, var(--kaart) 82%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--lijn);
}

.brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; text-decoration: none; min-width: 0; }

.brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -.01em;
}

.brand-sub {
    font-family: var(--font-mono);
    font-size: .68rem;
    color: var(--lei);
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* Omgevingsetiket (Omgeving:Label, bv. DEV op WerkBak; nooit in productie). Bewust oker en niet het blauwe accent:
   het is een waarschuwing, geen bedieningselement. Inkt op oker haalt ruim 7:1. */
.omgeving-label {
    flex: none;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: var(--oker);
    color: var(--inkt);
    font-family: var(--font-mono);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--inkt) 18%, transparent);
}

.topnav { display: flex; gap: .25rem; flex-wrap: wrap; margin-left: auto; }

.topnav a {
    display: inline-block;
    padding: .4rem .85rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 500;
    font-size: .92rem;
    color: var(--lei);
    transition: background .15s ease, color .15s ease;
}

.topnav a:hover { background: color-mix(in srgb, var(--inkt) 7%, transparent); color: var(--inkt); }
.topnav a.active { background: var(--inkt); color: var(--gevel); }

.topnav a:focus-visible, .pill:focus-visible, .btn:focus-visible, .x-btn:focus-visible, .chip:focus-visible, .switch input:focus-visible + .switch-track {
    outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
    outline-offset: 2px;
}

/* ----------------------------------------------------------------- page */

.page-wrap { max-width: 920px; margin: 0 auto; padding: 2rem 1.25rem 6rem; }
.page-wrap.wide { max-width: 1280px; }

.eyebrow {
    font-family: var(--font-mono);
    font-size: .68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--lei);
    margin: 0 0 .35rem;
}

.page-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    letter-spacing: -.015em;
    line-height: 1.15;
    margin: 0 0 .6rem;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -.01em;
    margin: 0 0 .6rem;
}

.sub-title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.02rem;
    margin: 1.4rem 0 .35rem;
}

.lead { font-size: 1.02rem; max-width: 62ch; margin: 0 0 1.4rem; }

section + section { margin-top: 2.4rem; }

.hint { color: var(--lei); font-size: .88rem; max-width: 62ch; }

.prose p { max-width: 68ch; margin: 0 0 .8rem; }
.prose ul { padding-left: 1.2rem; max-width: 68ch; }

.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.muted { color: var(--lei); }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- cards */

.card {
    background: var(--kaart);
    border: 1px solid var(--lijn);
    border-radius: var(--r-card);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.4rem;
}

/* Zonder padding, voor tabellen; een te brede tabel schuift binnen de kaart, niet de pagina. */
.card.tight { padding: 0; overflow: hidden; overflow-x: auto; }

@keyframes rise { from { opacity: 0; transform: translateY(9px); } }

.card { animation: rise .45s cubic-bezier(.2, .7, .3, 1) backwards; }
.card-grid > *:nth-child(2) { animation-delay: .05s; }
.card-grid > *:nth-child(3) { animation-delay: .1s; }

@media (prefers-reduced-motion: reduce) {
    .card { animation: none; }
    .topnav a, .btn, .pill, .chip, .switch-track, .switch-track::after { transition: none; }
    .progress::after { animation: none; width: 100%; opacity: .5; }
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: .9rem;
}

/* --------------------------------------------------------------- figures */

.label { font-size: .8rem; color: var(--lei); margin: 0; }

.hero {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 3.2rem;
    letter-spacing: -.03em;
    line-height: 1;
    margin: .15rem 0 .2rem;
    font-variant-numeric: tabular-nums;
}

.figure {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: -.02em;
    line-height: 1.1;
    margin: .15rem 0 .1rem;
    font-variant-numeric: tabular-nums;
}

.figure .unit { font-family: var(--font-body); font-weight: 400; font-size: .85rem; color: var(--lei); margin-left: .2rem; letter-spacing: 0; }

.sub { font-size: .8rem; color: var(--lei); margin: 0; }

.rule { border: 0; border-top: 1px solid var(--lijn); margin: .9rem 0; }

/* ---------------------------------------------------------------- donut */

.donut { display: flex; flex-direction: column; align-items: flex-start; gap: .7rem; margin-top: .6rem; }
.donut svg { flex: none; }
.donut .legend { width: 100%; }
.donut-total { font-family: var(--font-display); font-weight: 700; font-size: 20px; fill: var(--inkt); }

.legend { list-style: none; margin: 0; padding: 0; font-size: .82rem; flex: 1; min-width: 0; }
.legend li { display: flex; align-items: center; gap: .5rem; padding: .18rem 0; }
.legend li b { margin-left: auto; font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--dot, var(--lei)); }

/* ---------------------------------------------------------------- pills */

.pills { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid var(--lijn);
    background: var(--kaart);
    border-radius: 999px;
    padding: .38rem .85rem;
    font-family: var(--font-body);
    font-size: .88rem;
    font-weight: 500;
    color: var(--lei);
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.pill .pill-tel { font-family: var(--font-mono); font-size: .72rem; opacity: .75; }
.pill:hover { border-color: var(--lei); color: var(--inkt); }
.pill.active { background: var(--inkt); border-color: var(--inkt); color: var(--gevel); }
.pill:disabled { opacity: .5; cursor: default; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border: 1px solid var(--lijn);
    background: var(--gevel);
    border-radius: 999px;
    padding: .15rem .6rem;
    font-size: .78rem;
    font-weight: 500;
    color: var(--inkt);
    white-space: nowrap;
}

.chip.info { background: color-mix(in srgb, var(--accent) 10%, white); border-color: color-mix(in srgb, var(--accent) 35%, white); color: color-mix(in srgb, var(--accent) 65%, var(--inkt)); }
.chip.ok { background: color-mix(in srgb, var(--groen) 12%, white); border-color: color-mix(in srgb, var(--groen) 35%, white); color: var(--groen-tekst); }
.chip.warn { background: color-mix(in srgb, var(--oker) 14%, white); border-color: color-mix(in srgb, var(--oker) 40%, white); }
.chip.err { background: color-mix(in srgb, var(--rood) 10%, white); border-color: color-mix(in srgb, var(--rood) 35%, white); color: var(--rood-tekst); }

/* ---------------------------------------------------------------- forms */

.form-row { display: flex; flex-wrap: wrap; gap: .85rem 1.2rem; align-items: flex-end; margin-top: 1rem; }
.form-row .field { flex: 1 1 160px; }
.form-row .field.grow { flex: 2 1 260px; }
.form-row .field.auto { flex: 0 0 auto; }
.stack { display: grid; gap: .85rem; }

.field label, .field .field-label {
    display: block;
    font-family: var(--font-mono);
    font-size: .66rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--lei);
    margin-bottom: .3rem;
}

.input, .select {
    width: 100%;
    font-family: var(--font-body);
    font-size: .95rem;
    color: var(--inkt);
    background: var(--kaart);
    border: 1px solid var(--rand);
    border-radius: var(--r-ctl);
    padding: .55rem .75rem;
    min-width: 0;
}

.select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364737C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
    background-repeat: no-repeat;
    background-position: right .6rem center;
    padding-right: 2rem;
}

.input:focus, .select:focus { outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); }
.input::placeholder { color: color-mix(in srgb, var(--lei) 70%, white); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    font-family: var(--font-body);
    font-size: .95rem;
    font-weight: 600;
    color: var(--gevel);
    background: var(--inkt);
    border: none;
    border-radius: var(--r-ctl);
    padding: .62rem 1.15rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { background: color-mix(in srgb, var(--inkt) 35%, var(--gevel)); cursor: default; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--inkt); border: 1px solid var(--rand); }
.btn.ghost:hover:not(:disabled) { background: color-mix(in srgb, var(--inkt) 5%, transparent); box-shadow: none; }
.btn.ghost:disabled { color: var(--lei); border-color: var(--lijn); background: transparent; }
.btn.small { font-size: .85rem; padding: .42rem .85rem; }
.btn.block { width: 100%; }

.x-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border: none; border-radius: 50%;
    background: transparent; color: var(--lei); font-size: 1rem; line-height: 1; cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.x-btn:hover { background: color-mix(in srgb, var(--inkt) 8%, white); color: var(--inkt); }

/* schakelaar (checkbox) */
.switch { display: inline-flex; align-items: center; gap: .55rem; font-size: .88rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--rand); transition: background .15s ease; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }

/* zoekveld (autocomplete) */
.zoekveld { position: relative; }
.zoekveld .input { padding-right: 2.4rem; }
.zoekveld .zoek-ic { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); color: var(--lei); pointer-events: none; }
.zoekveld .x-btn { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); }
.zoek-lijst {
    position: absolute; z-index: 1200; left: 0; right: 0; top: calc(100% + 4px);
    margin: 0; padding: .3rem; list-style: none;
    background: var(--kaart); border: 1px solid var(--lijn); border-radius: var(--r-ctl); box-shadow: var(--shadow-lift);
    max-height: 18rem; overflow-y: auto;
}
.zoek-lijst li { padding: .5rem .7rem; border-radius: 7px; cursor: pointer; font-size: .92rem; }
.zoek-lijst li:hover, .zoek-lijst li.actief { background: color-mix(in srgb, var(--accent) 10%, white); }

/* -------------------------------------------------------------- notices */

.notice {
    display: flex; gap: .6rem; align-items: flex-start;
    border-radius: var(--r-ctl); padding: .65rem .9rem; font-size: .9rem;
    background: color-mix(in srgb, var(--accent) 8%, white);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, white);
}
.notice .ik { flex: none; margin-top: .15rem; }
.notice.warn { background: color-mix(in srgb, var(--oker) 12%, white); border-color: color-mix(in srgb, var(--oker) 40%, white); }
.notice.err { background: color-mix(in srgb, var(--rood) 10%, white); border-color: color-mix(in srgb, var(--rood) 35%, white); color: var(--rood-tekst); }
.notice.ok { background: color-mix(in srgb, var(--groen) 10%, white); border-color: color-mix(in srgb, var(--groen) 35%, white); }

.empty { border: 1.5px dashed var(--rand); border-radius: var(--r-card); padding: 2rem; text-align: center; color: var(--lei); }

/* voortgang (onbepaald) */
.progress { height: 3px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 18%, white); overflow: hidden; }
.progress::after { content: ""; display: block; height: 100%; width: 40%; background: var(--accent); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ------------------------------------------------------------ lists/tables */

.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; align-items: flex-start; gap: .6rem; padding: .3rem 0; }
.checks .ik { flex: none; margin-top: .2rem; }

.tabel { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabel th {
    text-align: left; font-family: var(--font-mono); font-weight: 500; font-size: .66rem;
    text-transform: uppercase; letter-spacing: .12em; color: var(--lei);
    padding: .7rem .9rem; border-bottom: 1px solid var(--lijn);
}
.tabel td { padding: .5rem .9rem; border-bottom: 1px solid var(--lijn); vertical-align: middle; }
.tabel tr:last-child td { border-bottom: 0; }
.tabel tbody tr:hover td { background: color-mix(in srgb, var(--inkt) 3%, transparent); }
.tabel .num { font-family: var(--font-mono); }
.tabel .chip + .sub { margin-left: .45rem; }
.tabel .chip + .chip { margin-left: .25rem; }

/* dossierrijen: compacte rijen in een .card.tight, als knop (zoekpagina) of als link (pagina "nieuw") */
.dossiers { list-style: none; margin: 0; padding: 0; }
.dossiers li + li { border-top: 1px solid var(--lijn); }
.dossier {
    display: grid; gap: .18rem; width: 100%; padding: .7rem .95rem;
    border: 0; background: transparent; font: inherit; color: inherit; text-align: left; text-decoration: none;
    cursor: pointer; transition: background .15s ease;
}
.dossier:hover { background: color-mix(in srgb, var(--inkt) 4%, transparent); }
div.dossier { cursor: default; }
.dossier-link { display: grid; gap: .18rem; color: inherit; text-decoration: none; }
.dossier-link:hover .dossier-handeling { text-decoration: underline; text-underline-offset: 2px; }
.dossier-voet a { color: var(--accent-tekst); }
.dossier-voet .ik { width: 14px; height: 14px; margin-left: .2rem; }
.dossier:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: -3px; }
.dossier-kop { display: flex; align-items: baseline; gap: .6rem; }
.dossier-kop .nr { font-size: .76rem; color: var(--lei); letter-spacing: .01em; overflow-wrap: anywhere; }
.dossier-kop .afstand, .dossier-kop .rechts { margin-left: auto; font-family: var(--font-mono); font-size: .76rem; color: var(--lei); white-space: nowrap; }
.dossier-handeling { font-size: .93rem; line-height: 1.35; }
.dossier-merken { display: flex; flex-wrap: wrap; gap: .3rem; margin: .15rem 0 .05rem; }
.dossier-voet { font-size: .8rem; color: var(--lei); }

/* een hele kaart als link */
a.card, .card-link { display: block; color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
a.card:hover, .card-link:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
a.card:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

details > summary { cursor: pointer; color: var(--lei); font-size: .88rem; }
details[open] > summary { margin-bottom: .4rem; }

/* iconen */
.ik { width: 18px; height: 18px; vertical-align: -3px; }
.ik.ok { color: var(--groen); }
.ik.warn { color: var(--oker); }
.ik.err { color: var(--rood); }
.ik.muted { color: var(--lei); }

/* ------------------------------------------------------------------ kaart */

.omgevings-kaart {
    height: 70vh;
    min-height: 420px;
    width: 100%;
    border-radius: var(--r-card);
    z-index: 0;
}

/* Leaflet legt panes op hoge z-indexen; eigen lagen erboven, de topbar nog hoger. */
.leaflet-pane, .leaflet-top, .leaflet-bottom { z-index: 400; }

@media (max-width: 560px) {
    .page-wrap { padding-top: 1.25rem; }
    .hero { font-size: 2.6rem; }
    .brand-sub { display: none; }
    .brand-name { font-size: 1.15rem; }
}

/* ------------------------------------------------------ blazor plumbing */

#blazor-error-ui {
    color-scheme: light only;
    background: color-mix(in srgb, var(--oker) 18%, white);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
