/* Overdracht – design tokens en basiscomponenten (zie design handoff) */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url(../fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-style: normal; font-display: swap; src: url(../fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); }

:root {
  --bg: #F3F1EC; --side: #EEEBE4; --surface: #FFFFFF; --subtle: #FAF8F4; --track: #E6E2DA;
  --text: #15181C; --text2: #3D4247; --muted: #5D636A; --ph: #9A9FA5;
  --line: #E2DED6; --row: #EFECE6; --input: #8A8378; /* contrast ≥ 3:1 op wit (WCAG 1.4.11) */
  --accent: #0E5A55; --accent-hover: #0A4743; --accent-soft: #E3EEEC; --gold: #C9A55A;
  --err: #A3352A; --ok: #2E6A3A;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: 'IBM Plex Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; }
a { color: var(--accent); } a:hover { color: var(--text); }
input, textarea, button, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
::placeholder { color: var(--ph); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.err { font-size: 13px; color: var(--err); }
.hint { font-size: 13px; color: var(--muted); }

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 26px; height: 26px; background: var(--accent); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 14px; flex: none; }
.logo-word { font-weight: 600; font-size: 16px; }
.logo.lg .logo-mark { width: 28px; height: 28px; font-size: 15px; }
.logo.lg .logo-word { font-size: 17px; }
.logo-img { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; flex: none; display: block; }
.logo.lg .logo-img { width: 32px; height: 32px; }

/* Knoppen */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 6px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.btn-secondary { border: 1px solid var(--input); background: #fff; }
.btn-secondary:hover:not(:disabled) { border-color: var(--text); }
.btn-primary { border: 0; background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .6; }
.btn-danger { border: 1px solid #E5C3BD; background: #fff; color: var(--err); }
.btn-danger:hover:not(:disabled) { border-color: var(--err); }
.btn-lg { height: 44px; font-size: 15px; padding: 0 22px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.link { border: 0; background: none; padding: 0; font-size: 13px; color: var(--accent); text-decoration: underline; }
.link.muted { color: var(--muted); }
.ms-logo { display: grid; grid-template-columns: 8px 8px; gap: 2px; }
.ms-logo span { width: 8px; height: 8px; }
.ms-logo.lg { grid-template-columns: 9px 9px; } .ms-logo.lg span { width: 9px; height: 9px; }

/* Formulieren */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; font-weight: 500; }
.label .opt { color: var(--muted); font-weight: 400; }
.input { border: 1px solid var(--input); border-radius: 6px; padding: 10px 12px; font-size: 15px; outline: none; background: #fff; width: 100%; }
.input:focus, .inputgroup:focus-within { border-color: var(--accent); }
.input.bad, .inputgroup.bad { border-color: var(--err); }
textarea.input { line-height: 1.5; resize: vertical; }
.inputgroup { display: flex; align-items: stretch; border: 1px solid var(--input); border-radius: 6px; overflow: hidden; background: #fff; }
.inputgroup input { flex: 1; min-width: 0; border: 0; padding: 10px 12px; font-size: 15px; outline: none; background: transparent; }
.inputgroup .suffix { display: flex; align-items: center; padding: 0 12px; background: var(--bg); border-left: 1px solid var(--line); font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.inputgroup .addon { border: 0; border-left: 1px solid var(--line); background: var(--subtle); padding: 0 12px; font-size: 13px; color: var(--muted); }

/* Kaarten / secties */
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.section { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.section-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.page { display: flex; flex-direction: column; gap: 24px; max-width: 1160px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.015em; }
.page-sub { margin: 0; color: var(--muted); font-size: 15px; }

/* Pills / chips */
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.chip { border: 1px solid var(--input); background: #fff; color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.chip.on { background: var(--text); color: #fff; border-color: var(--text); }

/* Toggle */
.toggle { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; text-align: left; font-size: 14px; color: var(--text); }
.toggle .track { width: 36px; height: 20px; border-radius: 10px; background: var(--input); display: flex; align-items: center; justify-content: flex-start; padding: 2px; flex: none; transition: background .15s; }
.toggle .knob { width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.toggle.on .track { background: var(--accent); justify-content: flex-end; }
.toggle .t-text { display: flex; flex-direction: column; gap: 2px; }
.toggle .t-sub { font-size: 13px; color: var(--muted); }
/* Radiogroep (zelfde opbouw als de schakelaar) */
.radio { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; color: var(--text); cursor: pointer; }
.radio input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.radio .dot { width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--input); background: #fff; flex: none; display: flex; align-items: center; justify-content: center; transition: border-color .15s; }
.radio.on .dot { border-color: var(--accent); }
.radio.on .dot::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.radio input:focus-visible + .dot { outline: 2px solid var(--accent); outline-offset: 2px; }
.radio.disabled { opacity: .55; cursor: default; }
.radio .t-text { display: flex; flex-direction: column; gap: 2px; }
.radio .t-sub { font-size: 13px; color: var(--muted); }

/* Segment */
.segment { display: flex; padding: 3px; background: var(--track); border-radius: 8px; gap: 2px; }
.segment button { border: 0; padding: 7px 14px; border-radius: 6px; font-size: 14px; font-weight: 500; background: transparent; color: var(--muted); }
.segment button.on { background: #fff; color: var(--text); }

/* Checkbox */
.check { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--ph); background: #fff; color: #fff; font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center; flex: none; }
.check.on { background: var(--accent); border-color: var(--accent); }
.check.sm { width: 16px; height: 16px; border-radius: 3px; font-size: 11px; }

/* App-shell */
.shell { min-height: 100vh; display: flex; align-items: flex-start; }
/* Zijbalk blijft altijd in beeld (ook bij lange pagina's); de gebruiker staat zo altijd linksonder. */
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; align-self: flex-start; width: 236px; flex: none; border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 24px; background: var(--side); }
.sidebar .logo { padding: 0 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; text-decoration: none; padding: 9px 10px; border-radius: 6px; font-size: 14px; color: var(--text2); }
.nav a:hover { background: rgba(255,255,255,.5); color: var(--text); }
.nav a.on { background: #fff; color: var(--text); font-weight: 600; }
.me { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--text); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none; }
.main { flex: 1; min-width: 0; padding: 32px 40px 64px; }

/* Tabellen (grid) */
.table { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.thead { display: grid; gap: 8px 16px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--subtle); }
.trow { display: grid; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--row); font-size: 14px; align-items: center; }
.trow:last-child { border-bottom: 0; }
.trow.click { cursor: pointer; }
.trow.click:hover { background: var(--subtle); }
.th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.sortbtn { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; border: 0; background: none; padding: 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sortbtn:hover, .sortbtn.on { color: var(--text); }
.sortbtn .arrow { font-size: 11px; width: 10px; flex: none; text-align: center; }
.fctl { width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; font-size: 13px; outline: none; background: #fff; }
select.fctl { padding: 5px 6px; }
.fctl.active { border-color: var(--accent); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.empty { padding: 28px 20px; color: var(--muted); font-size: 14px; }

/* Dropdown */
.dropdown { position: fixed; width: 300px; max-height: 360px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--input); border-radius: 8px; box-shadow: 0 12px 32px rgba(21,24,28,.16); z-index: 50; overflow: hidden; }
.dropdown .opt { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 12px; font-size: 14px; text-align: left; }
.dropdown .opt:hover { background: var(--subtle); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 14px; max-width: min(560px, 90vw); box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 100; }
.toast.bad { background: var(--err); }

/* Dropzone en voortgang */
.dropzone { border: 1.5px dashed var(--input); border-radius: 8px; padding: 28px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; background: var(--subtle); text-align: center; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); }
.dropzone.bad { border-color: var(--err); }
.dropzone.disabled { cursor: default; opacity: .6; }
.progress { height: 4px; background: var(--row); border-radius: 2px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.filerow { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--row); font-size: 14px; }
.filerow .top { display: flex; align-items: center; gap: 12px; }

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }

@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { position: static; height: auto; overflow: visible; width: 100%; gap: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .me { margin-top: 0; flex-direction: row; align-items: center; justify-content: space-between; }
  .main { padding: 24px 16px 48px; }
}

/* Beheerder-aanduiding en paginering */
.role-badge { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.pager { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager button { min-width: 34px; height: 32px; border: 1px solid var(--line); background: #fff; border-radius: 6px; color: var(--text); font-size: 14px; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager select { height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 0 6px; font-size: 13px; color: var(--text); }

/* Toegankelijkheid (WCAG 2.1 AA, 2.4.7): altijd een zichtbare focus bij toetsenbordbediening. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.input:focus-visible, .inputgroup input:focus-visible, .fctl:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
::placeholder { color: #6B7178; opacity: 1; }
