/* Goldfizh-huisstijl (gf-stijl): minimaal, zelfverzekerd, ruim. Titels nooit bold. */
@font-face {
  font-family: "Epilogue";
  src: url("/fonts/epilogue-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* tokens uit gf-stijl */
  --purple: #6331F4;
  --purple-light: #A38DFB;
  --purple-lightest: #E2DBFF;
  --near-black: #22222D;
  --dark-navy: #0F1020;
  --dark-grey: #555E63;
  --mid-grey: #8C99AA;
  --light-grey: #DCE0E6;
  --off-white: #F4F4F6;

  /* licht (standaard) */
  --bg: var(--off-white);
  --card: #ffffff;
  --field: #ffffff;
  --ink: var(--near-black);
  --muted: var(--dark-grey);
  --faint: var(--mid-grey);
  --line: var(--light-grey);
  --accent: var(--purple);       /* links, focus, accenttekst */
  --btn: var(--purple);          /* knopvulling */
  --selected: var(--purple-lightest);

  --warn-bg: #fff2cf; --warn-ink: #6b4a00;
  --bad-bg: #fde3e3;  --bad-ink: #8c1d1d;

  --radius: 12px;
  --nav-h: 64px;
  --mono: "Courier New", Courier, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--near-black);
    --card: #2E2A45;
    --field: var(--near-black);
    --ink: #ffffff;
    --muted: var(--light-grey);
    --faint: var(--mid-grey);
    --line: #453F63;
    --accent: var(--purple-light);
    --selected: #3A3550;
    --warn-bg: #3b3011; --warn-ink: #ffd98a;
    --bad-bg: #401c1c;  --bad-ink: #ffb8b8;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.55 "Epilogue", Calibri, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a { color: var(--accent); }

/* ---------- Kader: telefoon ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 20px 12px;
  background: var(--dark-navy); color: #fff;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; letter-spacing: -0.2px; }
.logo { width: 26px; height: 26px; flex: none; }
.who { font: 12px var(--mono); color: var(--mid-grey); }
.side { display: contents; }
.brandbox { display: none; }

#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
#nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 52px; padding: 6px 2px; border-radius: 10px;
  color: var(--faint); text-decoration: none; font-size: 12px; font-weight: 500;
}
#nav a svg { width: 22px; height: 22px; }
#nav a.on { color: var(--accent); background: var(--selected); }
/* Nieuw: de belangrijkste knop. Groot, paars, boven de balk uitstekend. */
#nav a.cta { color: var(--accent); font-weight: 700; background: transparent; }
#nav a.cta .ic {
  display: grid; place-items: center; width: 62px; height: 62px; margin-top: -30px;
  border-radius: 20px; background: var(--btn); color: #fff; border: 5px solid var(--card);
}
#nav a.cta .ic svg { width: 30px; height: 30px; stroke-width: 2.4; }
#nav a.cta.on { background: transparent; }
.lbl-l { display: none; }

main {
  max-width: 820px; margin: 0 auto;
  padding: 24px 20px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom));
}

/* ---------- Kader: tablet en groter ---------- */
@media (min-width: 768px) {
  .top { display: none; }
  .side {
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; width: 216px; z-index: 30;
    background: var(--dark-navy); color: #fff; padding: 28px 16px;
  }
  .brandbox { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 28px; }
  .brandbox .brand { font-size: 16px; white-space: nowrap; }
  #nav { position: static; display: flex; flex-direction: column; gap: 2px; background: transparent; border: 0; padding: 0; }
  #nav a {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    min-height: 48px; padding: 10px 12px; font-size: 16px; color: var(--light-grey); border-radius: 10px;
  }
  #nav a.on { background: rgba(255, 255, 255, .08); color: #fff; }
  #nav a.on svg { color: var(--purple-light); }
  #nav a.cta {
    order: -1; margin-bottom: 16px; min-height: 58px; justify-content: center;
    background: var(--purple); color: #fff; font-size: 17px; font-weight: 600;
  }
  #nav a.cta.on { background: var(--purple); }
  #nav a.cta .ic { display: contents; }
  #nav a.cta .ic svg { width: 22px; height: 22px; stroke-width: 2.4; }
  .lbl-s { display: none; }
  .lbl-l { display: inline; }
  main { margin-left: 216px; max-width: none; padding: 40px 32px 64px; }
  main > * { max-width: 760px; }
}

/* ---------- Tekst ---------- */
h1 { font-size: 34px; line-height: 1.15; font-weight: 400; letter-spacing: -0.6px; margin: 4px 0 8px; }
@media (min-width: 768px) { h1 { font-size: 42px; } }
h2 { font-size: 16px; font-weight: 400; margin: 0 0 12px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.muted { color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.back { display: inline-block; margin-bottom: 12px; text-decoration: none; font-size: 14px; }

/* ---------- Kaarten en sectielabel ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
/* sectielabel: klein paars vierkant + vette kleine kop */
.card > h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; margin-bottom: 16px;
}
.card > h2::before { content: ""; width: 9px; height: 9px; background: var(--purple); flex: none; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }

/* ---------- Formulieren ---------- */
.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; min-width: 0; }
.f > span { color: var(--muted); }
.f.wide { grid-column: 1 / -1; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; min-height: 52px; width: 100%;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.static { padding: 12px 14px; border-radius: 10px; background: var(--bg); min-height: 52px; display: flex; align-items: center; }

button, .btn {
  font: inherit; font-weight: 500; min-height: 52px; padding: 12px 22px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button svg, .btn svg { width: 18px; height: 18px; }
button.primary, .btn.primary { background: var(--btn); border-color: var(--btn); color: #fff; }
button.soft, .btn.soft { background: transparent; border-color: var(--accent); color: var(--accent); }
button.block { width: 100%; }
button:disabled { opacity: .55; cursor: wait; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.card.actions > * { flex: 1 1 140px; }

.switch { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); min-height: 60px; cursor: pointer; }
.switch:first-of-type { border-top: 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.switch .box {
  flex: none; width: 28px; height: 28px; border-radius: 6px; border: 1.5px solid var(--faint); background: var(--field);
  display: grid; place-items: center; color: transparent;
}
.switch .box svg { width: 18px; height: 18px; }
.switch input:checked + .box { background: var(--btn); border-color: var(--btn); color: #fff; }
.switch input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch .tx { flex: 1; }
.switch .hint { display: block; margin-top: 2px; }

.formbar {
  position: sticky; z-index: 15; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: var(--bg); padding: 12px 0; margin-top: 8px;
  display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line);
}
.formbar > * { flex: 1 1 160px; }
@media (min-width: 768px) { .formbar { bottom: 0; } }

/* ---------- Locatie en weer ---------- */
.locstatus { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--muted); margin-top: 12px; }
.locstatus.ok { color: var(--accent); }
.locstatus.err { color: var(--bad-ink); }
.locstatus svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-top: 16px; }
.tile { border-left: 2px solid var(--purple); padding: 2px 0 2px 12px; }
.tile b { display: block; font-size: 24px; font-weight: 400; line-height: 1.2; letter-spacing: -0.4px; }
.tile span { font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .4px; }
.tile.alert-t { border-color: var(--bad-ink); }
.tile.alert-t b { color: var(--bad-ink); }

/* ---------- Meldingen en chips ---------- */
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 10px; font-size: 15px; }
.alert.warn { background: var(--warn-bg); color: var(--warn-ink); }
.alert.bad { background: var(--bad-bg); color: var(--bad-ink); }
.alert.ok { background: var(--selected); color: var(--accent); }
.chip { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 99px; background: var(--selected); color: var(--accent); }
.chip.closed { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.chip.inc { background: var(--bad-bg); color: var(--bad-ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 16px; }

/* ---------- Lijst ---------- */
.seg { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.seg button { flex: 1; min-height: 46px; padding: 8px 10px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); }
.seg button.on { color: var(--ink); border-bottom-color: var(--purple); }
.search { margin-bottom: 16px; }
.list { list-style: none; margin: 0; padding: 0; }
.item {
  display: flex; gap: 16px; align-items: center; color: inherit; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 10px;
}
a.item:hover, a.item:active { border-color: var(--purple); }
.date { flex: none; width: 48px; text-align: center; line-height: 1.1; }
.date b { display: block; font-size: 26px; font-weight: 400; letter-spacing: -0.5px; }
.date span { font: 11px var(--mono); color: var(--faint); text-transform: uppercase; }
.item .body { min-width: 0; flex: 1; }
.item .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .s { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .chips { margin: 8px 0 0; }
.item .go { color: var(--faint); }
.item .go svg { width: 18px; height: 18px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); list-style: none; }
.empty .btn { margin-top: 16px; }

/* ---------- Detail ---------- */
dl.kv { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 10px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  dl.kv { grid-template-columns: 1fr; gap: 0; }
  dl.kv dt { margin-top: 12px; font-size: 13px; }
}
.ck-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ck-summary:first-of-type { border-top: 0; }
details summary { cursor: pointer; padding: 4px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; color: var(--muted); }
td:first-child { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.tablewrap { overflow-x: auto; }

/* ---------- Checklist ---------- */
.progress { height: 4px; background: var(--line); margin: 8px 0 16px; }
.progress i { display: block; height: 100%; background: var(--purple); width: 0; }
.progress i[data-p="10"] { width: 10%; } .progress i[data-p="20"] { width: 20%; } .progress i[data-p="30"] { width: 30%; }
.progress i[data-p="40"] { width: 40%; } .progress i[data-p="50"] { width: 50%; } .progress i[data-p="60"] { width: 60%; }
.progress i[data-p="70"] { width: 70%; } .progress i[data-p="80"] { width: 80%; } .progress i[data-p="90"] { width: 90%; }
.progress i[data-p="100"] { width: 100%; }

/* ---------- Aanvullingen ---------- */
.row2 { margin-top: 16px; }
.alert.info { background: var(--selected); color: var(--accent); }
.hint.err { color: var(--bad-ink); }
.f.invalid > span { color: var(--bad-ink); }
.f.invalid input, .f.invalid select, .f.invalid textarea { border-color: var(--bad-ink); border-width: 2px; }
.ck-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ck-head b { font-weight: 500; font-size: 20px; }
.ck-reset { min-height: 44px; padding: 8px 16px; }
[hidden] { display: none !important; }
.whobox { display: flex; align-items: center; gap: 12px; }
.linkbtn { background: none; border: 0; min-height: 44px; padding: 8px 4px; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.top .linkbtn, .side .linkbtn { color: var(--purple-light); }
.brandbox .whobox { justify-content: space-between; }
/* inlogscherm: geen menu */
body.auth .top, body.auth .side, body.auth #nav { display: none !important; }
body.auth main { margin: 0 auto; padding: 48px 20px; max-width: 420px; }
.auth-card { text-align: center; }
.auth-card .logo.big { width: 64px; height: 64px; margin: 24px auto 8px; display: block; }
.auth-card .f { text-align: left; }
.auth-card .alert { text-align: left; margin-top: 12px; }
.auth-card form button.block { margin-top: 16px; }
.auth-card .list { text-align: left; margin: 8px 0 16px; }
.code { font-size: 32px; text-align: center; letter-spacing: .5em; padding-left: .5em; }
button.item.pick { width: 100%; font: inherit; font-size: 18px; text-align: left; cursor: pointer; }
.credit { font: 11px var(--mono); color: var(--faint); margin: 12px 0 0; }
.rules details summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 500; padding: 4px 0; }
.rules details[open] summary { margin-bottom: 8px; }
.rules ul, .card ul { margin: 0; padding-left: 20px; }
.rules li, .card li { margin: 8px 0; }
.rules .chip { flex: none; }

/* ---------- Toast, tabs ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  top: calc(env(safe-area-inset-top) + 68px); /* bovenin: valt nooit over knoppen onderin */
  background: var(--dark-navy); color: #fff; padding: 12px 20px; border-radius: 10px; max-width: 92vw;
}
.toast.err { background: #8c1d1d; }
@media (min-width: 768px) { .toast { top: auto; bottom: 28px; left: calc(50% + 108px); } }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { min-height: 44px; padding: 8px 16px; }
.tabs button.on { background: var(--btn); color: #fff; border-color: var(--btn); }

@media print {
  .top, .side, #nav, .actions, .noprint, .toast, .formbar { display: none !important; }
  body { background: #fff; color: #000; }
  main { margin: 0; padding: 0; max-width: none; }
  .card, .item { border: 1px solid #999; break-inside: avoid; }
}
