/* Zorg — stijl geïnspireerd op de Claude-app: warm papier, koraal accent, serif koppen. */
:root {
  --bg: #FAF9F5;
  --bg-sidebar: #F5F4ED;
  --surface: #FFFFFF;
  --surface-2: #F0EEE6;
  --hover: rgba(31, 30, 29, .06);
  --active: rgba(31, 30, 29, .09);
  --text: #141413;
  --text-2: #3D3D3A;
  --muted: #73726C;
  --border: rgba(31, 30, 29, .15);
  --border-soft: rgba(31, 30, 29, .08);
  --accent: #C96442;
  --accent-hover: #B5573A;
  --accent-soft: rgba(201, 100, 66, .12);
  --on-accent: #FFFFFF;
  --danger: #B3261E;
  --ok: #3F7D58;
  --shadow: 0 .25rem 1.25rem rgba(0, 0, 0, .035), 0 0 0 .5px var(--border);
  --shadow-pop: 0 8px 30px rgba(0, 0, 0, .12), 0 0 0 .5px var(--border);
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Tiempos Headline", "Tiempos Text", ui-serif, Georgia, Cambria, "Times New Roman", serif;
  --radius: 12px;
  --sidebar-w: 272px;
}
:root[data-theme="dark"] {
  --bg: #262624;
  --bg-sidebar: #1F1E1D;
  --surface: #30302E;
  --surface-2: #3A3936;
  --hover: rgba(250, 249, 245, .06);
  --active: rgba(250, 249, 245, .1);
  --text: #FAF9F5;
  --text-2: #D6D4CB;
  --muted: #9C9A92;
  --border: rgba(222, 220, 209, .16);
  --border-soft: rgba(222, 220, 209, .08);
  --accent: #D97757;
  --accent-hover: #E38868;
  --accent-soft: rgba(217, 119, 87, .16);
  --danger: #F28B82;
  --ok: #7FC79B;
  --shadow: 0 .25rem 1.25rem rgba(0, 0, 0, .25), 0 0 0 .5px var(--border);
  --shadow-pop: 0 8px 30px rgba(0, 0, 0, .5), 0 0 0 .5px var(--border);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #262624; --bg-sidebar: #1F1E1D; --surface: #30302E; --surface-2: #3A3936;
    --hover: rgba(250, 249, 245, .06); --active: rgba(250, 249, 245, .1);
    --text: #FAF9F5; --text-2: #D6D4CB; --muted: #9C9A92;
    --border: rgba(222, 220, 209, .16); --border-soft: rgba(222, 220, 209, .08);
    --accent: #D97757; --accent-hover: #E38868; --accent-soft: rgba(217, 119, 87, .16);
    --danger: #F28B82; --ok: #7FC79B;
    --shadow: 0 .25rem 1.25rem rgba(0, 0, 0, .25), 0 0 0 .5px var(--border);
    --shadow-pop: 0 8px 30px rgba(0, 0, 0, .5), 0 0 0 .5px var(--border);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -.01em; }
.serif { font-family: var(--font-serif); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 22px; height: 22px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.boot { height: 100%; display: grid; place-items: center; }
.boot img { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.96); } }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; font-weight: 500; font-size: 14px; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.dark { background: var(--text); border-color: transparent; color: var(--bg); }
.btn.dark:hover { opacity: .88; }
.btn.danger { color: var(--danger); }
.btn.lg { height: 44px; padding: 0 18px; border-radius: 10px; font-size: 15px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }
.input:hover { border-color: rgba(115, 114, 108, .5); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.code { letter-spacing: .4em; font-size: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.hint { font-size: 13px; color: var(--muted); }
.error { color: var(--danger); font-size: 13.5px; margin: 0 0 12px; min-height: 0; }

/* ---------- Auth ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 28px; text-align: center; }
.auth-logo img { width: 56px; height: 56px; border-radius: 14px; }
.auth-logo h1 { font: 400 32px/1.15 var(--font-serif); }
.auth-logo p { margin: 0; color: var(--muted); }
.auth-panel { background: var(--surface); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.qr { display: grid; place-items: center; gap: 10px; margin: 6px 0 16px; text-align: center; }
.qr img { width: 200px; height: 200px; border-radius: 10px; background: #fff; padding: 6px; border: 1px solid var(--border-soft); }
.secret { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 6px 10px; border-radius: 6px; word-break: break-all; user-select: all; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100dvh; transition: grid-template-columns .18s ease; }
.shell.collapsed { grid-template-columns: 0 1fr; }
.sidebar {
  background: var(--bg-sidebar); border-right: 1px solid var(--border-soft); display: flex; flex-direction: column;
  min-width: 0; overflow: hidden; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.sidebar-inner { width: var(--sidebar-w); display: flex; flex-direction: column; height: 100%; }
.sb-head { display: flex; align-items: center; gap: 8px; padding: 14px 12px 8px 16px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand span { font: 400 22px/1 var(--font-serif); letter-spacing: -.01em; }
.sb-new { margin: 8px 12px 10px; }
.sb-new .btn { width: 100%; justify-content: flex-start; height: 40px; border-radius: 10px; }
.sb-new .plus { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent); }
.sb-new .plus .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.sb-new .btn:hover { background: var(--hover); }
.nav { padding: 0 8px; display: grid; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px;
  text-decoration: none; color: var(--text-2); font-size: 14.5px;
}
.nav a:hover { background: var(--hover); }
.nav a[aria-current="page"] { background: var(--active); color: var(--text); font-weight: 500; }
.nav .badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 12px; line-height: 20px; text-align: center; background: var(--accent); color: var(--on-accent); }
.sb-section { padding: 18px 20px 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.sb-scroll { flex: 1; overflow-y: auto; padding-bottom: 8px; }
.recent a { height: 32px; font-size: 14px; color: var(--text-2); }
.recent a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-foot { border-top: 1px solid var(--border-soft); padding: 8px; position: relative; }
.user-chip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.user-chip:hover { background: var(--hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 600; flex: none; }
.user-chip .who { min-width: 0; flex: 1; line-height: 1.25; }
.user-chip .who b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who small { color: var(--muted); font-size: 12.5px; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100dvh; overflow: hidden; }
.topbar { display: flex; align-items: center; gap: 8px; height: 52px; padding: env(safe-area-inset-top) 12px 0; flex: none; }
.topbar .title { font-weight: 500; font-size: 14.5px; color: var(--text-2); }
.topbar .spacer { flex: 1; }
.content { flex: 1; overflow-y: auto; padding: 8px 28px 56px; }
.page { max-width: 880px; margin: 0 auto; }
.page.wide { max-width: 1120px; }
.page-head { margin: 28px 0 24px; }
.page-head h1 { font: 400 32px/1.2 var(--font-serif); }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.hello { display: flex; align-items: center; gap: 14px; margin: 40px 0 26px; }
.hello img { width: 36px; height: 36px; border-radius: 9px; }
.hello h1 { font: 400 clamp(28px, 4vw, 38px)/1.15 var(--font-serif); }

/* Prompt-achtig invoerblok (zoals het chatvak) */
.composer { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 14px 14px 10px 18px; transition: box-shadow .15s; }
.composer:focus-within { box-shadow: 0 .25rem 1.25rem rgba(0,0,0,.06), 0 0 0 1px var(--border); }
.composer textarea { width: 100%; border: 0; outline: 0; background: transparent; resize: none; min-height: 52px; font-size: 16px; }
.composer textarea::placeholder { color: var(--muted); }
.composer-bar { display: flex; align-items: center; gap: 6px; }
.composer-bar .spacer { flex: 1; }
.send { width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.send:hover { background: var(--accent-hover); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: transparent; font-size: 14px; color: var(--text-2); text-decoration: none; }
.chip:hover { background: var(--hover); }

.grid { display: grid; gap: 14px; }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card h2 { font: 400 18px/1.3 var(--font-serif); margin-bottom: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.stat .value { font: 400 36px/1.2 var(--font-serif); margin-top: 8px; }
.stat .sub { color: var(--muted); font-size: 13px; }
.section { margin-top: 28px; }
.list { display: grid; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border-soft); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .grow small { color: var(--muted); }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-2); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: rgba(63, 125, 88, .14); color: var(--ok); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.sample { margin-left: 8px; font: 500 11px var(--font-ui); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border: 1px dashed var(--border); border-radius: 6px; padding: 1px 6px; vertical-align: middle; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .ring { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 16px; color: var(--text-2); }
.empty .ring .icon { width: 26px; height: 26px; }
.empty h2 { font: 400 22px var(--font-serif); color: var(--text); margin-bottom: 6px; }
.empty p { margin: 0 auto; max-width: 420px; }

.setting { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border-soft); }
.setting:first-of-type { border-top: 0; }
.setting .grow { flex: 1; }
.setting .grow b { font-weight: 500; display: block; }
.setting .grow small { color: var(--muted); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 12px; background: var(--border); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; font-size: 13px; color: var(--muted); padding: 8px 10px; }
.tbl td { padding: 12px 10px; border-top: 1px solid var(--border-soft); }
.tbl .actions { text-align: right; white-space: nowrap; }

/* ---------- Pop-ups ---------- */
.menu {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% + 4px); background: var(--surface);
  border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 30;
}
.menu .email { padding: 8px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; text-decoration: none; font-size: 14px; }
.menu button:hover, .menu a:hover { background: var(--hover); }
.overlay { position: fixed; inset: 0; background: rgba(20, 20, 19, .45); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .12s; }
.modal { background: var(--bg); border-radius: 16px; box-shadow: var(--shadow-pop); width: 100%; max-width: 460px; max-height: 90dvh; overflow: auto; padding: 24px; }
.modal h2 { font: 400 24px var(--font-serif); margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-pop); animation: fade .15s; max-width: 340px; }
.scrim { display: none; }

/* ---------- Mobiel ---------- */
@media (max-width: 860px) {
  .shell, .shell.collapsed { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, var(--sidebar-w)); z-index: 40; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-pop); }
  .shell.open .sidebar { transform: none; }
  .shell.open .scrim { display: block; position: fixed; inset: 0; background: rgba(20,20,19,.4); z-index: 35; }
  .content { padding: 4px 16px calc(40px + env(safe-area-inset-bottom)); }
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .hello { margin-top: 20px; }
  .tbl .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.dot.read { background: var(--border); }
a.btn { text-decoration: none; }
.row .pill.accent { min-width: 52px; justify-content: center; }

/* ---------- Extra tokens (statuskleuren, regio's) — o.a. gebruikt door de module Aanmeldingen ---------- */
:root {
  --fg: var(--text); --line: var(--border-soft); --line-strong: var(--border); --sunk: var(--surface-2);
  --accent-ink: var(--on-accent); --bad: var(--danger);
  --ok-soft: #E4EFE5; --warn: #8F6310; --warn-soft: #F8ECCB; --bad-soft: #F7E0DC; --info: #3B628D; --info-soft: #E2ECF6;
  --r-nk: #7456A8; --r-adw: #B0382F; --r-bwf: #D9A800;
}
:root[data-theme="dark"] {
  --ok-soft: #2F3F33; --warn: #E0B65C; --warn-soft: #44391F; --bad-soft: #4B2F2C; --info: #8FB1DC; --info-soft: #2D3A4B;
  --r-nk: #A58BD6; --r-adw: #E7857C; --r-bwf: #E8BD2E;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ok-soft: #2F3F33; --warn: #E0B65C; --warn-soft: #44391F; --bad-soft: #4B2F2C; --info: #8FB1DC; --info-soft: #2D3A4B;
    --r-nk: #A58BD6; --r-adw: #E7857C; --r-bwf: #E8BD2E;
  }
}
.stat { text-decoration: none; color: inherit; display: block; } a.stat:hover { background: var(--surface); }
