/* ==========================================================================
   isps.confirm — huisstijl CSS  (v1.0 · 20-11-2026)
   Eén bestand voor website, portalen, facility-dashboard, kiosk en webviews.
   Bron: brandbook v1.0 (kleur p.6, typografie p.7) + ontwerp "App-redesign".

   Gebruik:
     <link rel="stylesheet" href="/assets/isps-confirm.css">
     Licht is standaard. Donker: <html data-theme="dark"> (bv. kiosk, controlekamer).
     Kiosk/aanraakscherm: <html data-density="touch"> voor grotere raakvlakken.

   Regels uit het brandbook:
   - Oranje (#E8650F) is het signaal: hoofdknop, actieve status, focus, accenten.
     Nooit oranje voor lopende tekst. Label op oranje = inkt (#16181D), nooit wit
     (wit op oranje haalt geen 4,5:1).
   - Eén lettertype: Hanken Grotesk (400 tekst, 600 koppen, 700 nadruk/knoppen).
   - Groen/rood enkel functioneel: toegang verleend / geweigerd.
   ========================================================================== */

/* Lettertype zelf gehost (geen extern verzoek naar Google: offline/CSP/AVG).
   Variabel bestand 400-700, per subset. URL's relatief t.o.v. dit CSS-bestand,
   dus fonts/ moet altijd naast isps-confirm.css staan. Herkomst + SHA-256: fonts/LEESMIJ.txt */
@font-face { font-family:"Hanken Grotesk"; font-style:normal; font-weight:400 700; font-display:swap; src:url(fonts/HankenGrotesk-Variable-latin-ext.woff2) format("woff2"); unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family:"Hanken Grotesk"; font-style:normal; font-weight:400 700; font-display:swap; src:url(fonts/HankenGrotesk-Variable-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; }

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Merkkleuren (brandbook — niet wijzigen) */
  --ic-orange: #E8650F;   /* Signaal-oranje */
  --ic-dark:   #1E1E1E;   /* Donker */
  --ic-white:  #FFFFFF;   /* Wit */
  --ic-ink:    #16181D;   /* Inkt */
  --ic-grey:   #5D6066;   /* Grijs */

  /* Afgeleide tinten (licht thema) */
  --bg:           var(--ic-white);
  --surface:      #F4F5F6;
  --surface-2:    #ECEDEF;
  --line:         #E3E5E8;
  --line-soft:    #ECEDEF;
  --line-strong:  #D5D8DC;
  --text:         var(--ic-ink);
  --text-muted:   var(--ic-grey);
  --accent:       var(--ic-orange);
  --accent-hover: #F07A2C;
  --accent-tint:  #FDF0E7;
  --on-accent:    var(--ic-ink);
  --inverse-bg:   var(--ic-dark);
  --inverse-text: var(--ic-white);

  /* Functioneel */
  --ok:        #177A3B;  --ok-bg:   #E7F4EC;  --ok-dot: #1E9E4B;
  --err:       #B4232F;  --err-bg:  #FBE9EB;
  --warn:      #8A5A00;  --warn-bg: #FCF3DC;

  /* Type */
  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;  /* alleen via .code */
  --fs-xs: 0.8125rem;  /* 13 */
  --fs-sm: 0.875rem;   /* 14 */
  --fs-md: 1rem;       /* 16 */
  --fs-lg: 1.125rem;   /* 18 */
  --fs-xl: 1.375rem;   /* 22 */
  --fs-2xl: 1.875rem;  /* 30 */
  --fs-3xl: clamp(2rem, 4vw, 3rem);
  --fs-4xl: clamp(2.6rem, 6vw, 4.5rem);
  --lh: 1.6;

  /* Ruimte (4-raster) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 48px; --s9: 64px; --s10: 96px;

  /* Hoeken */
  --r-sm: 10px;      /* tegels, kleine knoppen */
  --r-md: 14px;      /* knoppen, velden */
  --r-lg: 16px;      /* kaarten, lijsten */
  --r-xl: 24px;      /* panelen, paskaart */
  --r-pill: 999px;

  /* Diepte: spaarzaam */
  --shadow-pop: 0 18px 40px -18px rgba(22, 24, 29, .35);

  /* Raakvlakken */
  --tap: 44px;
  --btn-h: 52px;

  --maxw: 1176px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg:           var(--ic-dark);
  --surface:      #26272A;
  --surface-2:    #2E3034;
  --line:         #3A3D43;
  --line-soft:    #2E3034;
  --line-strong:  #4A4D54;
  --text:         #F4F5F6;
  --text-muted:   #A5A9AE;
  --accent-tint:  #3A2414;
  --inverse-bg:   var(--ic-white);
  --inverse-text: var(--ic-ink);
  --ok:  #7FD39E;  --ok-bg:  #173524;
  --err: #F59AA2;  --err-bg: #3A1A1D;
  --warn:#F2C46B;  --warn-bg:#3A2E14;
  color-scheme: dark;
}

/* data-theme="auto": volgt het systeem (prefers-color-scheme). Zelfde donkere tokens
   als hierboven; wijzig ze op BEIDE plaatsen. Zonder data-theme blijft het licht.
   Kiosk-"auto" (licht 07-19 u) wordt in theme.js naar light/dark omgezet. */
[data-theme="auto"] { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg:           var(--ic-dark);
    --surface:      #26272A;
    --surface-2:    #2E3034;
    --line:         #3A3D43;
    --line-soft:    #2E3034;
    --line-strong:  #4A4D54;
    --text:         #F4F5F6;
    --text-muted:   #A5A9AE;
    --accent-tint:  #3A2414;
    --inverse-bg:   var(--ic-white);
    --inverse-text: var(--ic-ink);
    --ok:  #7FD39E;  --ok-bg:  #173524;
    --err: #F59AA2;  --err-bg: #3A1A1D;
    --warn:#F2C46B;  --warn-bg:#3A2E14;
    color-scheme: dark;
  }
}

[data-density="touch"] {
  --tap: 56px;
  --btn-h: 64px;
  --fs-md: 1.125rem;
}

/* --------------------------------------------------------------------------
   2. Basis
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-md)/var(--lh) var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }

:focus { outline: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* --------------------------------------------------------------------------
   3. Typografie
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 { margin: 0 0 var(--s3); font-weight: 600; line-height: 1.12; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); letter-spacing: -0.01em; }
h3 { font-size: var(--fs-lg); letter-spacing: 0; }
h4 { font-size: var(--fs-md); letter-spacing: 0; }
.display    { font-size: var(--fs-4xl); line-height: 1.04; letter-spacing: -0.025em; }
.headline   { font-size: var(--fs-3xl); line-height: 1.08; }
p { margin: 0 0 var(--s4); max-width: 68ch; }
.lead  { font-size: var(--fs-lg); color: var(--text-muted); }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.num   { font-variant-numeric: tabular-nums; }
.label { font-size: var(--fs-sm); color: var(--text-muted); }   /* klein label: geen hoofdletters, geen "//" */
/* Monospace enkel voor technische ID's (bezoek-/koppelcode, claim-URL, IMO, apparaat-ID,
   sleutel, trace-id). Tellers en tijden blijven var(--font) + .num. */
.code  { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

a { color: var(--text); text-underline-offset: 3px; }
a:hover { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
.container { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--s7); }
.section   { padding-block: var(--s10) 0; }
.stack > * + * { margin-top: var(--s4); }
.row  { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.grid { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.split { display: flex; flex-wrap: wrap; gap: var(--s6) var(--s9); align-items: end; justify-content: space-between; }
@media (max-width: 640px) { .container { padding-inline: var(--s5); } .section { padding-block: var(--s9) 0; } }

/* --------------------------------------------------------------------------
   5. Knoppen
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--btn-h); padding: 0 var(--s6);
  border: 1px solid transparent; border-radius: var(--r-md);
  font-size: var(--fs-md); font-weight: 600; line-height: 1; text-decoration: none;
  cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }

.btn-dark { background: var(--inverse-bg); color: var(--inverse-text); }
.btn-dark:hover { opacity: .9; color: var(--inverse-text); }

.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--text); color: var(--text); }

.btn-text { min-height: var(--tap); padding: 0 var(--s2); background: none; color: var(--text); font-weight: 600; }
.btn-text:hover { color: var(--accent); }
.btn-danger { background: none; color: var(--err); padding: 0; min-height: var(--tap); font-weight: 600; }

.btn-sm    { min-height: 40px; padding: 0 var(--s4); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-block { display: flex; width: 100%; }
.btn-icon  { width: var(--tap); min-height: var(--tap); padding: 0; border-radius: 50%; background: var(--surface); }

/* --------------------------------------------------------------------------
   6. Formulieren
   -------------------------------------------------------------------------- */
.field { display: grid; gap: var(--s1); margin-bottom: var(--s4); }
.field > label { font-size: var(--fs-sm); font-weight: 600; }
.field .hint  { font-size: var(--fs-sm); color: var(--text-muted); }
.field .error { font-size: var(--fs-sm); color: var(--err); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; min-height: var(--btn-h); padding: var(--s3) var(--s4);
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
}
.textarea { min-height: 120px; }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); opacity: .8; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-muted); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { border-color: var(--accent); outline-offset: 0; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--err); }

.check { display: flex; gap: var(--s3); align-items: flex-start; font-size: var(--fs-sm); }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 2px; }

/* Schakelaar: <button class="toggle" role="switch" aria-checked="true"></button> */
.toggle { position: relative; flex: none; width: 46px; height: 28px; padding: 0; border: 0; border-radius: var(--r-pill); background: var(--line-strong); cursor: pointer; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s var(--ease); }
.toggle[aria-checked="true"] { background: var(--accent); }
.toggle[aria-checked="true"]::after { transform: translateX(18px); }

/* Segmented control. Navigatie tussen panelen: <div class="segmented" role="tablist"><button role="tab" aria-selected="true">…</button></div>
   Instelling (bv. thema): <div class="segmented" role="radiogroup" aria-labelledby="…"><button role="radio" aria-checked="true">…</button></div> */
.segmented { display: inline-flex; gap: var(--s1); padding: var(--s1); border-radius: 12px; background: var(--surface); }
.segmented > * { min-height: 40px; padding: 0 var(--s4); border: 0; border-radius: 9px; background: transparent; color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500; cursor: pointer; }
.segmented > [aria-selected="true"], .segmented > [aria-checked="true"] { background: var(--bg); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(22,24,29,.12); }

/* --------------------------------------------------------------------------
   7. Vlakken
   -------------------------------------------------------------------------- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s6); }
.card-link { display: block; color: inherit; text-decoration: none; transition: border-color .15s var(--ease); }
.card-link:hover { border-color: var(--line-strong); color: inherit; }
.panel { background: var(--surface); border-radius: var(--r-xl); padding: var(--s9) var(--s8); }
.panel-dark { position: relative; overflow: hidden; background: var(--ic-dark); color: var(--ic-white); border-radius: var(--r-xl); padding: var(--s9) var(--s8); }
.panel-dark .muted { color: #C4C7CB; }
.panel-brand { position: relative; overflow: hidden; background: var(--accent); color: var(--on-accent); border-radius: var(--r-xl); }
@media (max-width: 640px) { .panel, .panel-dark { padding: var(--s7) var(--s5); } }

/* Paskaart (app, portaal, kiosk-bevestiging) */
.pass { position: relative; overflow: hidden; background: var(--ic-dark); color: var(--ic-white); border-radius: var(--r-xl); padding: var(--s5); }
.pass-qr { background: #fff; border-radius: var(--r-lg); padding: var(--s3); margin-inline: auto; }
.pass-progress { height: 4px; border-radius: 2px; background: #3A3D43; overflow: hidden; }
.pass-progress > span { display: block; height: 100%; background: var(--accent); }

/* Merkschild als watermerk: <svg class="watermark">…</svg> in een panel-brand/pass */
.watermark { position: absolute; pointer-events: none; opacity: .10; }

/* Icoontegel */
.tile { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-tint); color: var(--accent); }
.tile-sm { width: 34px; height: 34px; border-radius: var(--r-sm); }
.tile-brand { background: var(--accent); color: #fff; }
.tile-neutral { background: var(--surface); color: var(--text); }

/* --------------------------------------------------------------------------
   8. Lijsten (instellingen, ritten)
   -------------------------------------------------------------------------- */
.list-label { margin: var(--s6) var(--s2) var(--s2); font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.list { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--bg); }
.list-row { display: flex; align-items: center; gap: var(--s4); min-height: 56px; padding: var(--s3) var(--s4); color: var(--text); text-decoration: none; }
.list-row + .list-row { border-top: 1px solid var(--line-soft); }
a.list-row:hover, button.list-row:hover { background: var(--surface); color: var(--text); }
.list-row .title { font-weight: 600; }
.list-row .sub   { display: block; font-size: var(--fs-sm); color: var(--text-muted); }
.list-row .grow  { flex: 1 1 auto; min-width: 0; }

/* --------------------------------------------------------------------------
   9. Status
   -------------------------------------------------------------------------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; background: var(--surface); color: var(--text); }
.chip-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-ok     { background: var(--ok-bg);   color: var(--ok); }
.chip-err    { background: var(--err-bg);  color: var(--err); }
.chip-warn   { background: var(--warn-bg); color: var(--warn); }
.chip-accent { background: var(--accent-tint); color: var(--text); }

.notice { display: flex; gap: var(--s4); align-items: flex-start; padding: var(--s4) var(--s5); border-radius: var(--r-lg); background: var(--surface); }
.notice-ok   { background: var(--ok-bg); }
.notice-err  { background: var(--err-bg); }
.notice-warn { background: var(--warn-bg); }
.notice strong { display: block; }

/* Beslissing (kiosk / app na scan) */
.result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s3); }
.result-icon { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; }
.result-ok  .result-icon { background: var(--ok-bg);  color: var(--ok); }
.result-err .result-icon { background: var(--err-bg); color: var(--err); }

/* Spinner (AIGIS-check bezig) */
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--accent-tint); border-top-color: var(--accent); animation: ic-spin .8s linear infinite; }
@keyframes ic-spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   10. Tabellen (dashboard, logboek)
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 500; color: var(--text-muted); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--bg); }
.table td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface); }
.table .right { text-align: right; }

/* --------------------------------------------------------------------------
   11. Navigatie
   -------------------------------------------------------------------------- */
.topbar { display: flex; align-items: center; gap: var(--s7); flex-wrap: wrap; padding: var(--s4) var(--s7); border-bottom: 1px solid var(--line-soft); background: var(--bg); }
.topbar .logo { height: 30px; width: auto; }
.topbar nav { display: flex; gap: var(--s6); flex: 1 1 auto; flex-wrap: wrap; }
.topbar nav a { color: var(--text-muted); text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--text); }

.announce { display: flex; justify-content: center; align-items: center; gap: var(--s3); flex-wrap: wrap; padding: 10px var(--s6); background: var(--ic-ink); color: #fff; font-size: var(--fs-sm); text-align: center; }
.announce::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.announce a { color: #fff; font-weight: 600; }

/* Zijmenu (portaal / dashboard) */
.sidenav { display: flex; flex-direction: column; gap: 2px; padding: var(--s4); }
.sidenav a { display: flex; align-items: center; gap: var(--s3); min-height: var(--tap); padding: 0 var(--s3); border-radius: var(--r-sm); color: var(--text-muted); text-decoration: none; font-weight: 500; }
.sidenav a:hover { background: var(--surface); color: var(--text); }
.sidenav a[aria-current="page"] { background: var(--accent-tint); color: var(--text); font-weight: 600; }
.sidenav a[aria-current="page"] svg { color: var(--accent); }

/* Tabbalk (app / mobiele webview) */
.tabbar { display: grid; grid-template-columns: repeat(var(--tabs, 3), minmax(0, 1fr)); padding: var(--s2) var(--s2) calc(var(--s2) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); background: var(--bg); }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; padding-top: var(--s2); color: var(--text-muted); text-decoration: none; font-size: var(--fs-xs); font-weight: 500; }
.tabbar a[aria-current="page"] { color: var(--text); font-weight: 700; }
.tabbar a[aria-current="page"] svg { color: var(--accent); }
.tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 18px; height: 3px; border-radius: 2px; background: var(--accent); }

/* --------------------------------------------------------------------------
   12. Iconen & hulpklassen
   -------------------------------------------------------------------------- */
.ic { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.accent { color: var(--accent); }
.mark { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); } /* het punt-vierkantje uit het woordmerk */
.divider { height: 1px; background: var(--line-soft); border: 0; margin: var(--s6) 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media print {
  body { background: #fff; color: #000; }
  .topbar, .sidenav, .tabbar, .announce, .btn { display: none !important; }
  .card, .list, .table-wrap { border-color: #999; }
}
