/* Stichting Westerstraat: huisstijl licht- en donkerblauw met wit.
   Layout: bovenbalk; publiek deel als leespagina, beveiligd deel met zijmenu dat op de telefoon een tabbalk wordt. */
:root {
  --navy: #0e2a47; --blue: #2f6fae; --sky: #dbeaf7; --sky-2: #eef5fb;
  --bg: #f5f8fb; --surface: #ffffff; --fg: #14243a; --muted: #5a6b80; --line: #d6e1ec;
  --ok: #1f7a4d; --warn: #a86a00; --crit: #b3261e; --on-navy: #ffffff;
  --display: "Lexend", system-ui, sans-serif; --body: "Nunito Sans", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --navy: #0a1d33; --blue: #7fb3e6; --sky: #1d3552; --sky-2: #152a42;
    --bg: #0d1826; --surface: #13233a; --fg: #e6eef7; --muted: #9db0c6; --line: #24405f;
    --ok: #5cc28f; --warn: #e3a945; --crit: #f0857e;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 16px/1.55 var(--body); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; text-wrap: balance; line-height: 1.2; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--blue); }
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: progress; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Kopbalk */
header.top { background: var(--navy); color: var(--on-navy); }
header.top .wrap { display: flex; align-items: center; gap: 16px; padding-block: 14px; flex-wrap: wrap; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: #fff; text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 6px; background: #2f6fae; display: grid; place-items: center; font-size: .8rem; color: #fff; }
.topnav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.topnav a, .topnav button { background: none; border: 0; color: #cfe0f2; padding: 6px 10px; border-radius: 6px; text-decoration: none; }
.topnav a[aria-current="page"], .topnav a:hover, .topnav button:hover { color: #fff; background: rgba(255,255,255,.1); }
.topnav .cta { background: #fff; color: #0e2a47; font-weight: 700; }
.topnav .cta:hover { background: #dbeaf7; color: #0e2a47; }

main { padding-block: 28px 64px; }
footer.voet { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
footer.voet .wrap { padding-block: 20px; display: flex; gap: 8px 24px; flex-wrap: wrap; }

.stack { display: flex; flex-direction: column; gap: 20px; }
.muted { color: var(--muted); }
.lees { max-width: 62ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.eyebrow { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.btn { display: inline-block; border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 700; background: var(--navy); color: var(--on-navy); text-decoration: none; }
.btn.light { background: var(--sky); color: var(--fg); }
.btn.small { padding: 6px 12px; font-size: .88rem; }
.btn.gevaar { background: var(--crit); color: #fff; }
.link { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .92rem; }
input, select, textarea { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--surface); color: var(--fg); font-weight: 400; min-width: 0; }
textarea { min-height: 96px; resize: vertical; }
.form { display: grid; gap: 14px; max-width: 560px; }
.row2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.hint { font-size: .85rem; color: var(--muted); font-weight: 400; }
.melding-box { border-radius: 8px; padding: 10px 12px; font-size: .92rem; background: var(--sky-2); border: 1px solid var(--line); }
.melding-box.fout { border-color: var(--crit); color: var(--crit); }
.leeg { color: var(--muted); padding: 16px; text-align: center; }
.verborgen-veld { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Publiek */
.hero { background: var(--navy); color: var(--on-navy); border-radius: 14px; padding: 32px 28px; display: grid; gap: 14px; }
.hero p { color: #cfe0f2; max-width: 58ch; }
.hero .eyebrow { color: #9fc2e6; }
.hero .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .btn { background: #fff; color: #0e2a47; }
.hero .btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); }
.houses { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.house { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.house .num { font-family: var(--display); font-size: 1.6rem; color: var(--blue); }

/* Portaal */
.portal { display: grid; gap: 24px; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
.side { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); }
.side .who { padding: 4px 12px 12px; font-size: .88rem; }
.side .who b { display: block; font-size: 1rem; }
.side .groep { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 12px 4px; }
.side a { color: var(--fg); padding: 9px 12px; border-radius: 8px; text-decoration: none; }
.side a:hover { background: var(--sky-2); }
.side a[aria-current="page"] { background: var(--sky); font-weight: 700; }
@media (max-width: 760px) {
  .portal { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; flex-direction: row; overflow-x: auto; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .side .who, .side .groep { display: none; }
  .side a { white-space: nowrap; }
}
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat .v { font-family: var(--display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stat .v.crit { color: var(--crit); }
.stat .l { font-size: .85rem; color: var(--muted); }

.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 700; white-space: nowrap; border: 1px solid currentColor; }
.s-nieuw, .d-ingediend, .c-concept { color: var(--blue); }
.s-in_behandeling, .d-goedgekeurd, .c-opgezegd { color: var(--warn); }
.s-wacht_op_derden, .u-normaal, .u-laag, .c-beeindigd { color: var(--muted); }
.s-afgerond, .d-uitbetaald, .c-actief { color: var(--ok); }
.u-spoed, .d-afgewezen, .c-leeg { color: var(--crit); }
.u-hoog { color: var(--warn); }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--sky-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--sky-2); }
tr.sel td { background: var(--sky); }

.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: grid; gap: 8px; }
.item.klik { cursor: pointer; }
.item.sel { border-color: var(--blue); }
.item .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.item .head h3 { margin-right: auto; }
.meta { font-size: .85rem; color: var(--muted); }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 16px; display: flex; flex-direction: column; gap: 12px; }
.timeline > div { position: relative; }
.timeline > div::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.toolbar label { font-size: .82rem; }
.kv { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.mail { user-select: all; color: var(--blue); overflow-wrap: anywhere; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--navy); color: var(--on-navy); padding: 10px 16px; border-radius: 8px; font-weight: 600; max-width: calc(100% - 32px); z-index: 10; }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in .2s ease-out; }
  @keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
}
