/* Stembus BGH — geen externe fonts of scripts (BV-05). */
:root {
  --paper: #F4F6F9; --surface: #FFFFFF; --sunk: #EDF0F5; --ink: #15203A; --muted: #58637A; --line: #D9DEE7;
  --red: #C21F17; --red-soft: #FBE8E6; --ok: #17704A; --ok-soft: #E3F3EB; --warn: #8F5200; --warn-soft: #FCF0DC;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--f-body); }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.mono { font-family: var(--f-mono); }
.stack { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* --- knoppen en formulieren --- */
.btn { display: inline-block; font: inherit; font-weight: 700; border-radius: 10px; padding: 12px 18px; border: 2px solid var(--ink);
  background: var(--surface); color: var(--ink); cursor: pointer; text-align: center; text-decoration: none; line-height: 1.2; }
.btn.primary { background: var(--ink); color: var(--surface); }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); padding-inline: 8px; }
.btn.sm { padding: 6px 12px; font-size: .88rem; border-radius: 8px; border-width: 1.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
label.field { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; }
label.field span.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=search], select, textarea {
  font: inherit; font-weight: 400; width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
textarea { min-height: 110px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--red); flex: none; }

.notice { border-radius: 10px; padding: 12px 14px; font-size: .95rem; background: var(--sunk); }
.notice.warn { background: var(--warn-soft); }
.notice.error { background: var(--red-soft); color: var(--ink); border-left: 4px solid var(--red); }
.notice.ok { background: var(--ok-soft); }
.testbanner { background: var(--warn-soft); color: var(--ink); text-align: center; font-weight: 700; padding: 8px 16px; font-size: .9rem; }

/* --- kiezer --- */
.voter { max-width: 560px; margin: 0 auto; padding: 18px 16px 48px; display: grid; gap: 18px; }
.voter header.org { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 10px; flex-wrap: wrap; }
.voter header.org b { font-size: 1rem; }
.voter header.org span { color: var(--muted); font-size: .88rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 14px; }

.progress { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.progress i { height: 5px; border-radius: 3px; background: var(--line); }
.progress i.on { background: var(--ink); }
.eyebrow { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--muted); }

fieldset.item { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; }

.opts { display: grid; gap: 8px; }
.opt { position: relative; display: flex; gap: 12px; align-items: center; padding: 13px 14px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--surface); cursor: pointer; }
.opt:hover { border-color: var(--muted); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt .mark { flex: none; width: 24px; height: 24px; background: var(--ink); border-radius: 3px; display: grid; place-items: center; }
.opt .mark::after { content: ""; width: 13px; height: 13px; border-radius: 50%; background: var(--surface); }
.opt input:checked + .mark::after { background: var(--red); }
.opt:has(input:checked) { border-color: var(--ink); }
.opt:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: 2px; }
.opt .l { display: grid; }
.opt .l b { font-weight: 700; }
.opt .l span { font-size: .85rem; color: var(--muted); }
.percand { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.percand .opts { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.percand .opt { padding: 10px; gap: 8px; }
.rule { font-size: .85rem; color: var(--muted); background: var(--sunk); border-radius: 8px; padding: 8px 10px; }
.counter { font-size: .88rem; color: var(--muted); }
.counter.over { color: var(--red); font-weight: 700; }
.attach { display: flex; gap: 8px; align-items: center; font-size: .92rem; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; text-decoration: none; }
.attach .ext { font-family: var(--f-mono); font-size: .7rem; font-weight: 700; background: var(--red); color: #fff; border-radius: 3px; padding: 2px 5px; }
.nav { display: grid; grid-template-columns: auto 1fr; gap: 10px; }

.review { border: 1px solid var(--line); border-radius: 12px; }
.review > div { padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; border-top: 1px solid var(--line); align-items: center; }
.review > div:first-child { border-top: 0; }
.review .k { font-size: .82rem; color: var(--muted); }
.review .v { font-weight: 700; }
.review .v.blank { color: var(--muted); font-weight: 400; font-style: italic; }
.review .btn { grid-row: 1 / 3; grid-column: 2; }

.receipt { border: 2px dashed var(--ink); border-radius: 12px; padding: 16px; text-align: center; display: grid; gap: 4px; }
.receipt .code { font-family: var(--f-mono); font-size: 1.5rem; font-weight: 700; letter-spacing: .06em; }
.okmark { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 30px; font-weight: 700; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: top; }
thead th { border-top: 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--sunk); white-space: nowrap; }
tr.me td { background: var(--red-soft); }
footer.site { color: var(--muted); font-size: .82rem; text-align: center; padding: 24px 16px; }

/* --- beheer --- */
.admin { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--sunk); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
.side .brand { font-weight: 800; padding: 0 10px 14px; font-size: 1.05rem; }
.side .group { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 14px 10px 4px; }
.side a { text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: .92rem; color: var(--muted); }
.side a:hover { color: var(--ink); background: var(--surface); }
.side a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.side .who { margin-top: auto; font-size: .8rem; color: var(--muted); padding: 12px 10px 0; display: grid; gap: 6px; }
.main { padding: 26px 30px 60px; display: grid; gap: 20px; align-content: start; min-width: 0; max-width: 1200px; }
.mhead { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.pill { display: inline-flex; gap: 6px; align-items: center; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: var(--sunk); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.Open, .pill.good { background: var(--ok-soft); color: var(--ok); }
.pill.Gesloten, .pill.Gepland, .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.Ingetrokken, .pill.bad { background: var(--red-soft); color: var(--red); }
.pill.test { background: var(--warn-soft); color: var(--warn); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.tile .k { font-size: .8rem; color: var(--muted); font-weight: 600; }
.tile .v { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .v small { font-size: .95rem; color: var(--muted); font-weight: 600; }
.tile .v.good { color: var(--ok); } .tile .v.bad { color: var(--red); }
.bar { height: 10px; background: var(--sunk); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 5px; }
.bar i.win { background: var(--red); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: grid; gap: 12px; align-content: start; }
.panel h3 { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(14px, 1fr); gap: 4px; align-items: end; height: 120px; }
.days div { display: grid; gap: 4px; align-content: end; height: 100%; justify-items: center; }
.days i { width: 100%; max-width: 28px; background: var(--ink); border-radius: 3px 3px 0 0; display: block; min-height: 2px; }
.days span { font-size: .68rem; color: var(--muted); }
.res { display: grid; gap: 8px; }
.res .line { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr 60px; gap: 10px; align-items: center; font-size: .92rem; }
.res .n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.res .bar { height: 14px; }
ul.plain { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
.item-edit { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.item-edit summary { cursor: pointer; padding: 14px 18px; display: flex; justify-content: space-between; gap: 10px; align-items: center; list-style: none; }
.item-edit summary::-webkit-details-marker { display: none; }
.item-edit .body { padding: 0 18px 18px; display: grid; gap: 14px; }
.tag { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; background: var(--sunk); color: var(--muted); }
.hash { font-family: var(--f-mono); font-size: .78rem; color: var(--muted); word-break: break-all; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs a { text-decoration: none; padding: 8px 14px; font-weight: 600; font-size: .92rem; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--red); }
.login { max-width: 420px; margin: 12vh auto; padding: 0 16px; }

@media (max-width: 760px) {
  .admin { grid-template-columns: 1fr; }
  .side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .side .brand, .side .group, .side .who { display: none; }
  .side a { white-space: nowrap; }
  .main { padding: 18px 16px 48px; }
  .percand .opts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
