:root {
    --bg: #f6f5f0; --card: #ffffff; --ink: #1d2420; --muted: #66706a; --line: #e2e0d8;
    --green: #1f7a4d; --green-ink: #ffffff; --green-soft: #e3f1e9; --red: #b3261e; --red-soft: #fbe9e7;
    --amber: #c27c0e; --code: #f0efe9; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121614; --card: #1a201d; --ink: #e8ece9; --muted: #98a39c; --line: #2c3430;
        --green: #3fae78; --green-ink: #0d1510; --green-soft: #1c3227; --red: #ef7b72; --red-soft: #3a1f1d;
        --amber: #e3a23b; --code: #232a26; --shadow: none;
    }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--green); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 28px; padding-bottom: 48px; min-height: 70vh; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .7em; }
h3 { font-size: 1rem; margin: 0 0 .4em; }
code, pre { font: 13.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { background: var(--code); padding: .1em .35em; border-radius: 4px; }
pre { background: var(--code); padding: 14px 16px; border-radius: 8px; overflow-x: auto; }
pre code { background: none; padding: 0; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; } .r { text-align: right; }
.danger { color: var(--red); }

/* kop */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.top nav { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; }
.top nav a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.top nav a.on { color: var(--green); font-weight: 600; }
.top nav a.btn { color: var(--green-ink); }
.inline { display: inline; }

/* knooppuntbordje */
.kp { display: inline-grid; place-items: center; min-width: 2em; height: 2em; padding: 0 .3em; border: 2.5px solid var(--green);
      border-radius: 50%; color: var(--green); background: #fff; font-weight: 800; font-size: .8rem; }
.kp.big { font-size: 1.6rem; width: 2.4em; height: 2.4em; }
.signs { display: flex; align-items: center; gap: 10px; justify-content: center; }
.signs .arrow { color: var(--muted); font-size: 1.4rem; }

/* knoppen */
.btn { display: inline-block; background: var(--green); color: var(--green-ink); border: 0; border-radius: 8px; padding: .6em 1.1em;
       font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.07); }
.btn.small { padding: .4em .8em; font-size: .9rem; }
.btn.ghost { background: transparent; color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }
.btn.danger { background: var(--red); color: #fff; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); cursor: pointer; font-size: .95rem; }
button.link.danger { color: var(--red); font-size: .9rem; }

/* blokken */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two > .card { margin-bottom: 0; } .two { margin-bottom: 20px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 32px 0; }
.grid4 .card { margin: 0; display: flex; flex-direction: column; }
.grid4 .count { font-size: 1.6rem; font-weight: 700; margin: auto 0 .3em; }
.grid4 code { word-break: break-all; }
.hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; padding: 24px 0 8px; }
.hero h1 { font-size: 2.4rem; }
.lead { font-size: 1.1rem; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.steps li { margin-bottom: .6em; }
.narrow { max-width: 460px; margin: 20px auto; }
.prose { max-width: 720px; }
.flash { background: var(--green-soft); border-radius: 8px; padding: 12px 16px; margin-bottom: 20px; }
.flash.error { background: var(--red-soft); color: var(--red); }
.todo ol { margin: .5em 0 0; } .todo li.done { text-decoration: line-through; color: var(--muted); }
.newtoken { border: 2px solid var(--green); }
.copy { display: flex; gap: 8px; } .copy input { flex: 1; font-family: ui-monospace, monospace; }
.purpose { margin: 0 0 20px; padding: 10px 16px; border-left: 3px solid var(--line); color: var(--muted); }
.danger-title { margin-top: 1.6em; color: var(--red); }

/* formulieren */
.form { display: grid; gap: 14px; }
.form > .btn { justify-self: start; }
.form label { display: grid; gap: 4px; font-weight: 600; font-size: .92rem; }
.form label.check, label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
label.inline { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .5em .7em; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; }
input:disabled { color: var(--muted); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; }
legend { font-weight: 600; font-size: .92rem; padding: 0 4px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.row input:not([type=hidden]) { flex: 1 1 180px; }

/* tabellen */
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.tbl th, .tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
table.card { padding: 0; display: table; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: .1em .5em; border-radius: 99px; background: var(--code); color: var(--muted); vertical-align: middle; }
.tag.green { background: var(--green-soft); color: var(--green); } .tag.red { background: var(--red-soft); color: var(--red); }
ul.plain { list-style: none; padding: 0; margin: 0 0 1em; } ul.plain li { padding: 3px 0; }
.subnav { display: flex; gap: 6px; margin: -4px 0 20px; flex-wrap: wrap; }
.subnav a { padding: .35em .9em; border-radius: 99px; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); font-size: .9rem; }
.subnav a.on { background: var(--green); color: var(--green-ink); border-color: var(--green); }
.pager { display: flex; justify-content: space-between; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { margin: 0; display: grid; gap: 2px; font-size: .85rem; color: var(--muted); }
.stat .n { font-size: 1.6rem; font-weight: 700; color: var(--ink); }

/* quotum en gebruik */
.quota-nums strong { font-size: 1.8rem; margin-right: 6px; }
.meter { height: 10px; border-radius: 99px; background: var(--code); overflow: hidden; margin: 8px 0; }
.meter span { display: block; height: 100%; background: var(--green); }
.meter span.warn { background: var(--amber); } .meter span.full { background: var(--red); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--line); }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column-reverse; }
.bar span { display: block; border-radius: 2px 2px 0 0; min-height: 0; }
.b-ok { background: var(--green); } .b-no { background: var(--red); opacity: .8; }
.bars-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: 4px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin: 0 2px 0 6px; }
.key.ok { background: var(--green); } .key.no { background: var(--red); }

.foot { border-top: 1px solid var(--line); padding: 20px 0; font-size: .85rem; color: var(--muted); }

@media (max-width: 860px) {
    .two, .hero { grid-template-columns: 1fr; }
    .grid4 { grid-template-columns: 1fr 1fr; }
    .stats { grid-template-columns: 1fr 1fr; }
    .signs { display: none; }
    .hero h1 { font-size: 1.8rem; }
    .tbl { display: block; overflow-x: auto; }
}
@media (max-width: 480px) { .grid4 { grid-template-columns: 1fr; } }

/* uitbreiden en 2FA */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 20px; }
.grid3 > .card { margin: 0; display: flex; flex-direction: column; }
.option .price { font-size: 1.3rem; font-weight: 700; margin: .2em 0; }
.option form { margin-top: auto; }
.qr { width: 220px; margin: 12px auto; background: #fff; border-radius: 12px; }
.qr svg { display: block; width: 100%; height: auto; }
.codes { columns: 2; font-family: ui-monospace, monospace; font-size: 1.05rem; padding-left: 1.2em; }
.status-banner { border-left: 4px solid var(--amber); }
.status-banner.red { border-left-color: var(--red); }
@media (max-width: 860px) { .grid3 { grid-template-columns: 1fr; } }

/* Beheer → Data */
.stip { display: inline-block; width: .7em; height: .7em; border-radius: 50%; vertical-align: middle; margin: 0 .2em 0 .6em; }
.stip.knp { background: var(--green); } .stip.poi { background: var(--amber); }
.balk { display: block; height: .6em; min-width: 2px; border-radius: 99px; background: var(--green); }

/* Kaart op /beheer/data (Leaflet) */
.datakaart { height: 560px; border-radius: 10px; background: var(--code); margin: 12px 0 8px; z-index: 0; }
.lagen { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.lagen label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: normal; margin: 0; }
.lagen .stip { width: 10px; height: 10px; margin: 0; }
.leaflet-popup-content { font: inherit; }
.leaflet-popup-content .kp { margin-right: 4px; }
@media (max-width: 720px) { .datakaart { height: 420px; } }
