/*
 * Tactyx CRM: alle CSS in dit ene bestand, volgens design-handoff/crm-portaal (login, app-shell, dashboard, inkomend).
 * Tokens staan bovenaan als CSS-variabelen. Componenten (zie src/views/componenten.ts) hebben elk hun eigen blok.
 */

/* ── Tokens ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
:root {
  --inkt: #14162B;
  --tekst: #3A3F5C;
  --tekst-2: #4C5170;
  --gedempt: #5F6480;
  --gedempt-2: #8A8FA8;
  --blauw: #2233E0;
  --blauw-hover: #1A1F8F;
  --lila: #8E97F5;
  --paars: #5B3DF5;
  --cyaan: #38C8F0;
  --donker: #0B0D1C;
  --donkerder: #060712;
  --vlak: #F4F5FA;
  --vlak-hover: #ECEEF7;
  --rij-hover: #F7F8FC;
  --lijn: #E3E5F0;
  --lijn-zacht: #EEEFF6;
  --lijn-sterk: #D3D6E6;
  --wit: #FFFFFF;
  --fout: #B4361D;
  --fout-rand: #E0826D;

  --f-kop: 'Bricolage Tactyx', ui-sans-serif, system-ui, sans-serif;
  --f-tekst: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
  --f-mono: 'Azeret Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-blok: 28px;
  --r-kaart: 20px;
  --r-taak: 18px;
  --r-veld: 14px;
  --r-nav: 12px;
  --r-knopje: 10px;
  --r-pill: 999px;

  --ring: inset 0 0 0 1px var(--lijn-sterk);
  --ring-focus: inset 0 0 0 2px var(--blauw);
  --zacht: cubic-bezier(.2, .8, .2, 1);
}

/* ── Fonts (zelf gehost) ────────────────────────────────────────────────────────────────────────────────────────── */
@font-face { font-family: 'Bricolage Tactyx'; src: url(/static/bricolage-tactyx.woff2) format('woff2'); font-weight: 400 600; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url(/static/instrument-sans-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url(/static/instrument-sans-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url(/static/instrument-sans-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Azeret Mono'; src: url(/static/azeret-mono-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }

/* ── Basis ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--wit); color: var(--inkt); font: 400 16px/1.55 var(--f-tekst); -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; }
h1, h2 { margin: 0; color: var(--inkt); font-family: var(--f-kop); font-weight: 600; }
p, dl, dd { margin: 0; }
a { color: var(--blauw); text-decoration: none; }
a:hover { color: var(--blauw-hover); }
::selection { background: #DADDFB; }
input::placeholder { color: var(--gedempt-2); }
:focus-visible { outline: 2px solid var(--blauw); outline-offset: 2px; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icoon { display: block; flex: none; width: 16px; height: 16px; }
.pijl { display: block; flex: none; width: 16px; height: 12px; }

/* ── Logo ───────────────────────────────────────────────────────────────────────────────────────────────────────── */
.logo { display: inline-flex; align-items: center; gap: 10px; color: inherit; }
.logo:hover { color: inherit; }
.logo-x { display: block; width: 22px; height: 19px; fill: currentColor; }
.logo-woord { font: 600 18px/1.2 var(--f-kop); letter-spacing: -.03em; }

/* ── Login-layout (login, setup, fouten zonder sessie) ──────────────────────────────────────────────────────────── */
.los { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 12px; min-height: 100vh; padding: 12px; }
.los-kolom { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; min-height: calc(100vh - 24px); padding: 24px 28px; color: var(--inkt); }
.los-inhoud { display: flex; flex-direction: column; gap: 28px; width: 100%; max-width: 380px; margin: 0 auto; }
.los-kop { display: flex; flex-direction: column; gap: 10px; }
.los-titel { font-size: 40px; line-height: 1; letter-spacing: -.04em; }
.los-sub { color: var(--tekst-2); font-size: 15.5px; line-height: 1.55; text-wrap: pretty; }
.los-verder { font-size: 15px; font-weight: 500; }
.los-voet { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; color: var(--gedempt); font-size: 13.5px; }
.los-voet-links { display: flex; gap: 18px; }
.los-voet-links a { color: var(--gedempt); }
.los-voet-links a:hover { color: var(--inkt); }

/* Het donkere blok rechts: stippenraster, twee gloeden en een inset-rand. */
.podium {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  min-height: calc(100vh - 24px); padding: 56px 48px 44px; border-radius: var(--r-blok); color: var(--wit);
  background:
    radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1.2px) 0 0 / 24px 24px,
    radial-gradient(70% 60% at 85% 90%, rgba(34, 51, 224, .5), rgba(34, 51, 224, 0) 70%),
    radial-gradient(40% 40% at 15% 10%, rgba(91, 61, 245, .22), rgba(91, 61, 245, 0) 70%),
    var(--donker);
  box-shadow: inset 0 0 0 1px rgba(142, 151, 245, .14);
}
.podium-tekst { display: flex; flex-direction: column; gap: 14px; max-width: 480px; }
.podium-titel { color: var(--wit); font-size: clamp(30px, 3vw, 42px); line-height: 1.04; letter-spacing: -.04em; text-wrap: balance; }
.podium-sub { color: rgba(255, 255, 255, .72); font-size: 16px; line-height: 1.6; text-wrap: pretty; }

/* Drie taakkaarten in een waaier; crm.js laat ze doorschuiven (niet bij prefers-reduced-motion). */
.taken { position: relative; align-self: center; width: 420px; max-width: 100%; height: 340px; margin: auto 0; }
.taak {
  --rot: 0deg; --y: 0px; --seg: var(--gedempt-2);
  position: absolute; display: flex; flex-direction: column; gap: 14px; width: 340px; max-width: calc(100% - 40px);
  padding: 18px 20px; border-radius: var(--r-taak); background: var(--wit); color: var(--inkt);
  box-shadow: 0 24px 60px rgba(5, 7, 20, .45); transform: rotate(var(--rot)) translateY(var(--y)); transition: transform .6s var(--zacht);
}
.taak:nth-child(1) { --rot: -3deg; left: 0; top: 0; }
.taak:nth-child(2) { --rot: 2deg; left: 80px; top: 112px; }
.taak:nth-child(3) { --rot: -1.2deg; left: 30px; top: 224px; }
.taak-kop { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.taak-nr { color: var(--gedempt-2); font: 400 11px/1 var(--f-mono); letter-spacing: .08em; }
.taak-status { display: flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500; white-space: nowrap; transition: background .4s, color .4s; }
.taak-stip { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.taak-titel { font: 600 17px/1.25 var(--f-kop); letter-spacing: -.02em; }
.taak-balk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.taak-balk span { height: 4px; border-radius: var(--r-pill); background: var(--lijn-zacht); transition: background .4s; }
.taak[data-fase="0"] { --seg: var(--gedempt-2); }
.taak[data-fase="0"] .taak-status { background: var(--lijn-zacht); color: var(--tekst-2); }
.taak[data-fase="1"] { --seg: var(--blauw); }
.taak[data-fase="1"] .taak-status { background: #E6E8FD; color: var(--blauw); }
.taak[data-fase="2"] { --seg: var(--paars); }
.taak[data-fase="2"] .taak-status { background: #EEE9FE; color: var(--paars); }
.taak[data-fase="3"] { --seg: var(--cyaan); --y: -6px; }
.taak[data-fase="3"] .taak-status { background: #DDF5FC; color: #0C7FA0; }
.taak[data-fase="0"] .taak-balk span:nth-child(-n+1),
.taak[data-fase="1"] .taak-balk span:nth-child(-n+2),
.taak[data-fase="2"] .taak-balk span:nth-child(-n+3),
.taak[data-fase="3"] .taak-balk span { background: var(--seg); }

/* ── Formulier en veld ──────────────────────────────────────────────────────────────────────────────────────────── */
.formulier { display: flex; flex-direction: column; gap: 28px; }
.formulier-velden { display: flex; flex-direction: column; gap: 16px; }
.formulier-acties { display: flex; flex-direction: column; gap: 14px; }
.kaart .formulier { gap: 24px; }
.kaart .formulier-acties { flex-direction: row; flex-wrap: wrap; }
.veld { display: flex; flex-direction: column; gap: 8px; }
.veld-kop { display: flex; justify-content: space-between; gap: 12px; }
.veld-label { color: var(--inkt); font-size: 13.5px; font-weight: 500; }
.veld-link { font-size: 13.5px; font-weight: 500; }
.veld-invoer {
  width: 100%; height: 50px; padding: 0 16px; border: 0; border-radius: var(--r-veld); background: var(--wit); color: var(--inkt);
  font: inherit; font-size: 15.5px; box-shadow: var(--ring); outline: none; transition: box-shadow .15s;
}
.veld-invoer[aria-invalid="true"] { box-shadow: inset 0 0 0 1px var(--fout-rand); }
.veld-invoer:focus, .veld-invoer:focus-visible { box-shadow: var(--ring-focus); outline: none; }
.veld-hint { color: var(--gedempt); font-size: 13.5px; line-height: 1.45; }
.veld-wachtwoord { position: relative; display: block; }
.veld-wachtwoord .veld-invoer { padding-right: 84px; }
.veld-toon { position: absolute; top: 7px; right: 7px; height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-knopje); background: none; color: var(--tekst-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.veld-toon:hover { background: var(--vlak); color: var(--inkt); }

/* ── Knoppen ────────────────────────────────────────────────────────────────────────────────────────────────────── */
.knop {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 18px; border: 0;
  border-radius: var(--r-pill); background: none; color: var(--inkt); font: 500 14px/1 var(--f-tekst); white-space: nowrap; cursor: pointer;
  transition: background .15s, box-shadow .15s, color .15s, opacity .15s;
}
.knop-primair { height: 48px; padding: 0 22px; background: var(--blauw); color: var(--wit); font: 600 15px/1 var(--f-kop); }
.knop-primair:hover { background: var(--inkt); color: var(--wit); }
.knop-breed { width: 100%; height: 52px; }
.knop-klein { height: 44px; padding: 0 20px; font-size: 14px; }
.knop-omlijnd { padding: 0 16px; box-shadow: var(--ring); }
.knop-omlijnd:hover { box-shadow: inset 0 0 0 1px var(--inkt); color: var(--inkt); }
.knop-tekst { padding: 0 14px; color: var(--tekst-2); }
.knop-tekst:hover { background: var(--vlak); color: var(--inkt); }
.knop[disabled], .knop.is-bezig { opacity: .7; cursor: default; }
.knop.is-bezig:hover { background: var(--blauw); }

/* ── Meldingen ──────────────────────────────────────────────────────────────────────────────────────────────────── */
.melding { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.45; }
.melding-icoon { display: block; flex: none; width: 16px; height: 16px; margin-top: 1px; }
.melding-fout { color: var(--fout); }
.melding-ok { padding: 12px 16px; border-radius: var(--r-veld); background: var(--vlak); color: var(--inkt); }
.melding-ok .melding-icoon { color: var(--blauw); }

/* ── App-shell ──────────────────────────────────────────────────────────────────────────────────────────────────── */
/* Zachte blauw-paarse gloed linksboven, achter de zijbalk, zodat het matglas iets laat zien. */
.is-ingelogd::before {
  content: ''; position: fixed; top: -220px; left: -180px; width: 560px; height: 560px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(34, 51, 224, .18), rgba(91, 61, 245, .08) 55%, rgba(34, 51, 224, 0));
}
.shell { position: relative; display: grid; grid-template-columns: 256px minmax(0, 1fr); align-items: start; align-content: start; min-height: 100vh; }
.hoofd { min-width: 0; padding: 44px 44px 56px; }

.zijbalk {
  position: sticky; top: 0; z-index: 5; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  height: 100vh; height: 100dvh; padding: 24px 16px 16px; color: var(--wit);
  background: rgba(6, 7, 18, .95); -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6);
  border-right: 1px solid rgba(142, 151, 245, .14);
}
.zijbalk::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1.2px), radial-gradient(120% 50% at 0% 100%, rgba(34, 51, 224, .22), rgba(34, 51, 224, 0) 70%);
  background-size: 24px 24px, 100% 100%;
}
.zijbalk :focus-visible { outline-color: var(--lila); }
.zijbalk-boven { display: flex; flex-direction: column; gap: 28px; }
.zijbalk .logo { padding: 0 10px; }
.zijbalk .logo-x { width: 20px; height: 17px; }
.zijbalk .logo-woord { font-size: 17px; }

.nav { display: flex; flex-direction: column; gap: 8px; }
/* Alleen background-color, color en box-shadow animeren; ook inactief dezelfde schaduwlagen, maar transparant. */
.nav-item {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: var(--r-nav);
  background-color: rgba(255, 255, 255, 0); color: rgba(255, 255, 255, .7); font-size: 14.5px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0), 0 2px 6px rgba(0, 0, 0, 0), inset 0 0 0 1px rgba(142, 151, 245, 0), inset 0 1px 0 rgba(255, 255, 255, 0);
  transition: background-color .22s ease, color .22s ease, box-shadow .3s var(--zacht);
}
.nav-item:hover { background-color: rgba(255, 255, 255, .05); color: var(--wit); }
.nav-item[aria-current="page"] {
  background-color: rgba(255, 255, 255, .1); color: var(--wit);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(142, 151, 245, .22), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.nav-item[aria-current="page"]:hover { background-color: rgba(255, 255, 255, .12); }
.nav-tekst { flex: 1; }
.nav-badge { display: flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--blauw); color: var(--wit); font: 400 11px/1 var(--f-mono); }

.zijbalk-gebruiker { display: flex; align-items: center; gap: 12px; padding: 14px 6px 0; border-top: 1px solid rgba(255, 255, 255, .1); }
.zijbalk-gebruiker form { margin: 0; }
.zijbalk-account { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; color: var(--wit); }
.zijbalk-account:hover { color: var(--wit); }
.zijbalk-account:hover .zijbalk-naam, .zijbalk-account[aria-current="page"] .zijbalk-naam { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .4); text-underline-offset: .2em; }
.zijbalk-wie { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.zijbalk-naam { font-size: 14px; font-weight: 500; line-height: 1.35; }
.zijbalk-email { overflow: hidden; color: rgba(255, 255, 255, .6); font-size: 12.5px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.zijbalk-uit { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: var(--r-knopje); background: none; color: rgba(255, 255, 255, .7); cursor: pointer; }
.zijbalk-uit:hover { background: rgba(255, 255, 255, .08); color: var(--wit); }

/* ── Avatars en pills ───────────────────────────────────────────────────────────────────────────────────────────── */
.avatar { display: flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; font: 600 13px/1 var(--f-kop); }
.avatar-groot { width: 44px; height: 44px; font-size: 15px; }
.avatar-eigen { width: 34px; height: 34px; background: var(--blauw); color: var(--wit); }
.av-0 { background: #E6E8FD; color: var(--blauw); }
.av-1 { background: #EEE9FE; color: var(--paars); }
.av-2 { background: #DDF5FC; color: #0C7FA0; }
.av-3 { background: var(--vlak); color: var(--inkt); }

.pill { display: inline-flex; align-items: center; max-width: 100%; height: 24px; padding: 0 10px; overflow: hidden; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.pill-blauw { background: #E6E8FD; color: var(--blauw); }
.pill-paars { background: #EEE9FE; color: var(--paars); }
.pill-cyaan { background: #DDF5FC; color: #0C7FA0; }
.pill-inkt { background: var(--lijn-zacht); color: var(--inkt); }
.pill-neutraal { background: var(--vlak); color: var(--tekst-2); }

/* ── Schermen en koppen ─────────────────────────────────────────────────────────────────────────────────────────── */
.scherm { display: flex; flex-direction: column; gap: 24px; max-width: 1120px; }
.scherm-smal { max-width: 720px; }
.eyebrow { color: var(--gedempt); font: 400 11px/1.4 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; }
.pagina-kop { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pagina-kop-tekst { display: flex; flex-direction: column; gap: 8px; }
.titel { font-size: clamp(30px, 3.2vw, 40px); line-height: 1.02; letter-spacing: -.04em; }
.titel-groot { font-size: clamp(32px, 3.6vw, 44px); }
.intro { color: var(--tekst-2); }
.tijd { color: var(--gedempt); font: 400 11.5px/1.3 var(--f-mono); white-space: nowrap; }
.stip { display: block; width: 8px; height: 8px; border-radius: 50%; }
.is-ongelezen .stip { background: var(--blauw); }

/* ── Dashboard ──────────────────────────────────────────────────────────────────────────────────────────────────── */
.dashboard { gap: 40px; max-width: 1040px; }
.dash-kop { display: flex; flex-direction: column; gap: 10px; }
.dash-regel { color: var(--tekst-2); font-size: 16.5px; line-height: 1.55; }
.tegels { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tegel { display: flex; flex-direction: column; gap: 18px; padding: 22px 24px; border-radius: var(--r-kaart); background: var(--vlak); color: var(--inkt); transition: background .15s; }
.tegel-link:hover { background: var(--vlak-hover); color: var(--inkt); }
.tegel-label { color: var(--gedempt); font: 400 10.5px/1.4 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; }
.tegel-onder { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.tegel-getal { font: 600 44px/.9 var(--f-kop); letter-spacing: -.04em; }
.tegel .pijl { width: 18px; height: 14px; color: var(--blauw); }
.dash-laatste { display: flex; flex-direction: column; gap: 12px; }
.sectie-kop { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.sectie-titel { font-size: 20px; letter-spacing: -.025em; }
.sectie-link { font-size: 14px; font-weight: 500; }
.kort-lijst { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--lijn); }
.kort-rij { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--lijn); color: var(--inkt); line-height: 1.3; transition: background .12s; }
.kort-rij:hover { background: #FAFAFD; color: var(--inkt); }
.kort-tekst { display: flex; align-items: baseline; gap: 10px; min-width: 0; overflow: hidden; font-size: 15px; white-space: nowrap; }
.kort-naam { flex: none; }
.is-ongelezen .kort-naam { font-weight: 600; }
.kort-onderwerp { overflow: hidden; color: var(--gedempt); text-overflow: ellipsis; }
.kort-leeg { padding: 20px 4px; border-bottom: 1px solid var(--lijn); color: var(--gedempt); font-size: 15px; }

/* ── Inkomend ───────────────────────────────────────────────────────────────────────────────────────────────────── */
.zoek { position: relative; width: 100%; max-width: 300px; margin: 0; }
.zoek-icoon { position: absolute; top: 14px; left: 14px; display: block; width: 15px; height: 15px; color: var(--gedempt-2); stroke-width: 1.5; pointer-events: none; }
.zoek-invoer {
  width: 100%; height: 44px; padding: 0 40px 0 38px; border: 0; border-radius: var(--r-pill); background: var(--wit); color: var(--inkt);
  font: inherit; font-size: 14.5px; box-shadow: var(--ring); outline: none; -webkit-appearance: none; appearance: none;
}
.zoek-invoer::-webkit-search-cancel-button { display: none; }
.zoek-invoer:focus, .zoek-invoer:focus-visible { box-shadow: var(--ring-focus); outline: none; }
.zoek-wis { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--r-pill); color: var(--gedempt); }
.zoek-wis:hover { background: var(--vlak); color: var(--inkt); }
.zoek-wis .icoon { width: 12px; height: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: var(--wit); color: var(--inkt); font-size: 14px; font-weight: 500; white-space: nowrap; box-shadow: var(--ring); transition: background .15s, color .15s, box-shadow .15s; }
.chip:hover { color: var(--inkt); box-shadow: inset 0 0 0 1px var(--inkt); }
.chip[aria-current="true"] { background: var(--inkt); color: var(--wit); box-shadow: none; }
.chip-aantal { font: 400 11px/1 var(--f-mono); opacity: .7; }

.rijen { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--lijn); }
.rij {
  display: grid; grid-template-columns: 10px 36px minmax(0, 1fr) 150px 72px; align-items: center; gap: 16px; padding: 14px 10px;
  border-bottom: 1px solid var(--lijn); color: var(--inkt); line-height: 1.3; scroll-margin-top: 30vh; transition: background .12s;
}
.rij:hover { background: var(--rij-hover); color: var(--inkt); }
.rij.is-geselecteerd { background: var(--vlak); }
.rij-midden { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rij-regel { display: flex; align-items: baseline; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; }
.rij-naam { flex: none; font-size: 15px; }
.rij-email { overflow: hidden; color: var(--gedempt); font-size: 13.5px; text-overflow: ellipsis; }
.rij-voorproef { display: block; color: var(--gedempt); font-size: 14.5px; text-overflow: ellipsis; }
.rij-voorproef.is-leeg { color: var(--gedempt-2); }
.is-ongelezen .rij-naam { font-weight: 600; }
.is-ongelezen .rij-voorproef:not(.is-leeg) { color: var(--inkt); font-weight: 500; }
.rij-bron { display: flex; min-width: 0; }
.rij-tijd { text-align: right; }

.leeg { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 0; border-top: 1px solid var(--lijn); text-align: center; }
.leeg-titel { font-size: 18px; letter-spacing: -.02em; }
.leeg-tekst { max-width: 44ch; color: var(--gedempt); font-size: 14.5px; }

.paginering { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.paginering-stand { color: var(--gedempt); font: 400 11px/1.4 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; }

/* ── Drawer (server-side geopend via ?bericht=<id>) ─────────────────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(11, 13, 28, .32); cursor: default; }
.drawer {
  position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 41; display: flex; flex-direction: column; overflow: hidden;
  width: min(560px, calc(100vw - 24px)); border-radius: var(--r-blok); background: var(--wit); color: var(--inkt);
  box-shadow: 0 24px 80px rgba(11, 13, 28, .22), 0 0 0 1px var(--lijn); outline: none;
}
.drawer-boven { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--lijn-zacht); }
.drawer-nav { display: flex; align-items: center; gap: 4px; }
.drawer-knop { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-knopje); color: var(--tekst-2); }
.drawer-knop:hover { background: var(--vlak); color: var(--inkt); }
.drawer-knop .icoon { width: 14px; height: 14px; stroke-width: 1.6; }
.drawer-knop.is-uit { opacity: .35; }
.drawer-knop.is-uit:hover { background: none; color: var(--tekst-2); }
.drawer-positie { margin-left: 6px; color: var(--gedempt-2); font: 400 11px/1 var(--f-mono); }
.drawer-inhoud { display: flex; flex: 1; flex-direction: column; gap: 28px; padding: 28px 32px 32px; overflow: auto; overscroll-behavior: contain; }
.drawer-kop { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.drawer-titel { font-size: 26px; line-height: 1.12; letter-spacing: -.03em; text-wrap: balance; }
.afzender { display: flex; align-items: center; gap: 14px; }
.afzender-wie { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.afzender-naam { font-size: 15.5px; font-weight: 600; }
.afzender-email { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.drawer-bericht { color: var(--tekst); font-size: 16px; line-height: 1.7; white-space: pre-line; text-wrap: pretty; }
.drawer-bericht.is-leeg { color: var(--gedempt); }
.formulier-blok { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; border-radius: var(--r-kaart); background: var(--vlak); }
.formulier-blok-titel { color: var(--gedempt); font: 400 10.5px/1.4 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; }
.kv { display: flex; flex-direction: column; gap: 12px; }
.kv-rij { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; font-size: 14.5px; line-height: 1.45; }
.kv-rij dt { color: var(--gedempt); }
.kv-rij dd { color: var(--inkt); }
.drawer-onder { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--lijn-zacht); }
.drawer-onder form { margin: 0; }
.drawer-rechts { margin-left: auto; }
.has-drawer { overflow: hidden; }

/* Inschuiven en vervagen via cross-document view transitions: geen JS nodig. Tussen twee berichten blijft de drawer staan. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(root) { animation-duration: .18s; }
  .drawer { view-transition-name: drawer; }
  .scrim { view-transition-name: scrim; }
  ::view-transition-new(drawer):only-child { animation: drawer-in .28s var(--zacht); }
  ::view-transition-old(drawer):only-child { animation: drawer-uit .24s var(--zacht) forwards; }
  ::view-transition-new(scrim):only-child { animation: vervaag-in .22s ease; }
  ::view-transition-old(scrim):only-child { animation: vervaag-in .22s ease reverse forwards; }
}
@keyframes drawer-in { from { transform: translateX(calc(100% + 24px)); } }
@keyframes drawer-uit { to { transform: translateX(calc(100% + 24px)); } }
@keyframes vervaag-in { from { opacity: 0; } }

/* ── Gebruikers en account ──────────────────────────────────────────────────────────────────────────────────────── */
.gebruikers { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--lijn); }
.gebruiker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 14px 4px; border-bottom: 1px solid var(--lijn); }
.gebruiker-wie { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.gebruiker-naam { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.gebruiker-naam .pill { height: 20px; font-size: 12px; }
.gebruiker-email { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.gebruiker-sinds { color: var(--gedempt); font: 400 11.5px/1.3 var(--f-mono); }
.kaart { display: flex; flex-direction: column; gap: 6px; padding: 24px 28px 28px; border-radius: var(--r-kaart); background: var(--vlak); }
.kaart-titel { margin-bottom: 10px; font-size: 20px; letter-spacing: -.025em; }
.kaart-tekst { margin-bottom: 14px; color: var(--tekst-2); font-size: 14.5px; }

/* ── Tweestapsverificatie (login-layout: instellen, code, herstelcode; herstelcodes ook in de app) ──────────────── */
.koppel { display: flex; flex-direction: column; gap: 14px; }
.koppel-stap { display: flex; align-items: flex-start; gap: 10px; color: var(--inkt); font-size: 14.5px; font-weight: 500; line-height: 1.45; }
.koppel-nr { display: flex; flex: none; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--inkt); color: var(--wit); font: 400 11px/1 var(--f-mono); }
.koppel-blok { display: grid; grid-template-columns: 168px minmax(0, 1fr); align-items: center; gap: 20px; padding: 14px 18px 14px 14px; border-radius: var(--r-kaart); background: var(--vlak); }
.koppel-qr { overflow: hidden; border-radius: var(--r-veld); background: var(--wit); box-shadow: var(--ring); }
.qr { display: block; width: 100%; height: auto; aspect-ratio: 1; fill: var(--donker); }
.koppel-handmatig { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.koppel-label { color: var(--gedempt); font: 400 10.5px/1.4 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; }
.koppel-sleutel { display: block; color: var(--inkt); font: 400 14px/1.75 var(--f-mono); letter-spacing: .04em; word-spacing: .15em; -webkit-user-select: all; user-select: all; }
.koppel-app { display: none; }
.veld-code, .veld-mono { font-family: var(--f-mono); }
.veld-code { font-size: 19px; letter-spacing: .28em; }
.veld-mono { letter-spacing: .06em; }
.veld-code::placeholder, .veld-mono::placeholder { color: var(--gedempt-2); opacity: .55; }
.kaart .veld-code, .kaart .veld-mono { max-width: 320px; }
.los-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; color: var(--gedempt); font-size: 14px; }
.los-links form { margin: 0; }
.los-links a { font-weight: 500; }
.link-knop { padding: 0; border: 0; background: none; color: var(--blauw); font: inherit; font-weight: 500; cursor: pointer; }
.link-knop:hover { color: var(--blauw-hover); }

.herstel { display: flex; flex-direction: column; gap: 12px; }
.scherm .herstel { max-width: 460px; }
.herstelcodes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin: 0; padding: 14px 22px; border-radius: var(--r-kaart); background: var(--vlak); list-style: none; counter-reset: code; }
.herstelcodes li { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; counter-increment: code; }
.herstelcodes li::before { content: counter(code, decimal-leading-zero); color: var(--gedempt-2); font: 400 10.5px/1 var(--f-mono); }
.herstelcodes code { color: var(--inkt); font: 400 15.5px/1.4 var(--f-mono); letter-spacing: .06em; }
.herstel-kopieer { align-self: flex-start; }
.kaart-tekst strong { color: var(--inkt); font-weight: 600; }

/* ── Mobiel ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 899px) {
  /* Login: het donkere blok valt weg, de content begint bovenaan en de links staan onderaan. */
  .los { grid-template-columns: minmax(0, 1fr); }
  .podium { display: none; }
  .los-kolom { justify-content: flex-start; gap: 48px; padding: 12px 8px 8px; }
  .los-inhoud { margin: 0 auto auto; }

  /* App: de zijbalk wordt een balk bovenaan; logo en account op de eerste regel, de navigatie eronder. */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .zijbalk {
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; height: auto; padding: 10px 12px;
    border-right: 0; border-bottom: 1px solid rgba(142, 151, 245, .14);
  }
  .zijbalk-boven { display: contents; }
  .zijbalk .logo { order: 1; padding: 0 4px; }
  .zijbalk-gebruiker { order: 2; margin-left: auto; padding: 0; border-top: 0; gap: 4px; }
  .zijbalk-account { flex: none; }
  .zijbalk-wie { display: none; }
  .nav { order: 3; flex-direction: row; flex-basis: 100%; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .nav-item { height: 40px; padding: 0 12px; gap: 10px; }
  .nav-tekst { flex: none; }
  .hoofd { padding: 24px 16px 40px; }

  .rij { grid-template-columns: 10px 36px minmax(0, 1fr) auto; gap: 12px; padding: 14px 6px; }
  .rij-bron { display: none; }
  .zoek { max-width: none; }
  .drawer { width: calc(100vw - 24px); }
  .drawer-inhoud { gap: 24px; padding: 24px 20px 28px; }
  .afzender { flex-wrap: wrap; }
  .afzender .tijd { flex-basis: 100%; padding-left: 58px; }
  .kv-rij { grid-template-columns: 96px minmax(0, 1fr); }
  .kaart { padding: 20px; }
  .gebruiker-sinds { flex-basis: 100%; padding-left: 50px; }

  /* 2FA: QR-code en sleutel onder elkaar; op de telefoon zelf is "Open in je authenticator-app" de snelste weg. */
  .koppel-blok { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 16px; padding: 18px; }
  .koppel-qr { width: 200px; }
  .koppel-handmatig { align-items: center; width: 100%; text-align: center; }
  .koppel-sleutel { text-wrap: balance; }
  .koppel-app { display: inline-flex; margin-top: 4px; }
}
@media (max-width: 479px) {
  .nav-item .icoon { display: none; }
  .los-titel { font-size: 36px; }
}

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