:root {
  --bg: #f4f1ec;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --ink: #1f2a24;
  --ink-2: #56615a;
  --ink-3: #8a938d;
  --line: #e4dfd6;
  --brand: #1f2a24;
  --accent: #b8865b;
  --accent-soft: #f3e9dd;
  --ok: #3d7a57;
  --ok-soft: #e3f0e8;
  --warn: #b0533c;
  --warn-soft: #f7e4de;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 42, 36, .06), 0 4px 16px rgba(31, 42, 36, .05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(160deg, #1f2a24 0%, #33433a 100%); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 20px; padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--brand); color: #e8dcc8; display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: .02em; }
.brand-name { font-weight: 700; font-size: 17px; }
.brand-tag { font-size: 12px; color: var(--ink-3); }
.login-card h1 { font-size: 22px; margin: 28px 0 6px; }
.login-card form { display: grid; gap: 14px; margin-top: 22px; }

/* ---------- Formulieren ---------- */
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
input[type=text], input[type=email], input[type=password], select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 15px; color: var(--ink);
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; transition: opacity .15s; }
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--warn-soft); color: var(--warn); }
.btn.small { padding: 7px 11px; font-size: 13px; }
.form-error { color: var(--warn); font-size: 14px; min-height: 1em; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }

/* ---------- Layout ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--brand); color: #fff; }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 16px; }
.topbar .brand-mark { background: #e8dcc8; color: var(--brand); }
.topbar .brand-tag { color: #aab5ad; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; color: #cfd6d1; text-align: right; }
.topbar .btn { background: rgba(255,255,255,.1); color: #fff; }
.tabs { max-width: 1100px; margin: 0 auto; padding: 0 12px; display: flex; gap: 2px; overflow-x: auto; }
.tab { background: none; border: 0; color: #aab5ad; padding: 10px 12px 12px; cursor: pointer; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: #fff; border-bottom-color: var(--accent); }
main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.demo-banner { background: var(--accent-soft); color: #7a5634; border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 18px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; }

/* ---------- Pod-keuze ---------- */
.pod-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.pod-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 16px; cursor: pointer; font-weight: 600; font-size: 14px; }
.pod-chip .loc { font-weight: 400; color: var(--ink-3); margin-left: 6px; }
.pod-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.pod-chip.active .loc { color: #aab5ad; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--ink-2); }

/* ---------- Bedieningspaneel ---------- */
.pod-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.pod-title h2 { font-size: 26px; }
.pod-meta { color: var(--ink-3); font-size: 13px; margin-bottom: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: grid; gap: 18px; align-content: start; }
.card.off .card-body { opacity: .45; }
.card-head { display: flex; align-items: center; gap: 12px; }
.card-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; }
.card-icon svg { width: 22px; height: 22px; stroke: var(--ink); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card-head h3 { font-size: 16px; }
.card-head .status { font-size: 13px; color: var(--ink-3); }
.card-head .grow { flex: 1; }
.card-body { display: grid; gap: 18px; transition: opacity .2s; }
.row-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; font-weight: 550; }
.row-label .val { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Schakelaar */
.switch { position: relative; width: 52px; height: 30px; border-radius: 999px; background: #d9d4cb; border: 0; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(22px); }
.switch:disabled { opacity: .6; cursor: default; }

/* Schuifregelaar */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: #e7e2d9; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
input[type=range]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); cursor: pointer; }
input[type=range].temp { background: linear-gradient(90deg, #f5b56a, #fbe7c8 45%, #dce9f7 75%, #a9c9ef); }

/* Keuzeknoppen */
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { flex: 1 1 auto; min-width: 70px; border: 1px solid var(--line); background: var(--surface-2); padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600; }
.seg.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.seg:disabled { opacity: .6; cursor: default; }

/* Deur */
.door-btn { width: 100%; padding: 18px; border-radius: 12px; border: 0; cursor: pointer; font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .2s; }
.door-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.door-btn.locked { background: var(--warn-soft); color: var(--warn); }
.door-btn.open { background: var(--ok-soft); color: var(--ok); }
.door-btn.unknown { background: var(--surface-2); color: var(--ink-2); }
.door-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Temperatuurstapper */
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); font-size: 22px; cursor: pointer; line-height: 1; }
.stepper .big { font-size: 40px; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 110px; text-align: center; letter-spacing: -.02em; }
.stepper .big small { font-size: 18px; color: var(--ink-3); font-weight: 500; }

.note { font-size: 12px; color: var(--ink-3); margin-top: 18px; }

/* ---------- Tabellen ---------- */
.table-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .btn { margin-left: 6px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--warn-soft); color: var(--warn); }
.badge.admin { background: var(--accent-soft); color: #7a5634; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* ---------- Dialoog ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(31, 42, 36, .45); }
.dialog-inner { padding: 24px; display: grid; gap: 14px; }
.dialog-inner h3 { font-size: 19px; margin-bottom: 4px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; }
.pod-checks { max-height: 200px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; }

/* ---------- Meldingen ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: rise .2s ease-out; }
.toast.error { background: var(--warn); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.settings-card { max-width: 440px; }

@media (max-width: 600px) {
  main { padding: 18px 14px 60px; }
  .grid { grid-template-columns: 1fr; }
  .topbar .who { display: none; }
  .pod-title h2 { font-size: 22px; }
}

/* ---------- Agenda ---------- */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.week-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.week-label { font-weight: 650; margin-right: auto; order: -1; flex-basis: 100%; }
@media (min-width: 700px) { .week-label { flex-basis: auto; order: 0; margin: 0 auto 0 4px; } .week-nav > .btn:first-child { order: -2; } }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day-col { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 10px; min-height: 160px; display: flex; flex-direction: column; gap: 6px; }
.day-col.today { outline: 2px solid var(--accent); }
.day-col.past { opacity: .55; }
.day-head { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 2px; }
.day-empty { font-size: 12px; color: var(--ink-3); }
.booking-chip { text-align: left; border: 0; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.bk-time { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bk-name { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-add { margin-top: auto; border: 1px dashed var(--line); background: none; border-radius: 8px; padding: 4px; color: var(--ink-3); cursor: pointer; font-size: 16px; }
.day-add:hover { border-color: var(--ink-3); color: var(--ink); }
@media (max-width: 900px) {
  .week-grid { grid-template-columns: 1fr; }
  .day-col { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .day-head { width: 100%; }
  .day-add { margin-top: 0; margin-left: auto; padding: 4px 12px; }
}

.dialog-form { display: grid; gap: 14px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type=date], textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 15px; }
.day-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.link-box { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 8px 12px; }
.link-box .mono { flex: 1; overflow-wrap: anywhere; font-size: 12px; }
.qr-wrap { display: grid; place-items: center; padding: 6px 0; }
.qr { width: 220px; height: 220px; border-radius: 12px; border: 1px solid var(--line); }
.dialog-actions.spread { justify-content: space-between; align-items: center; flex-wrap: wrap; }
a.btn { text-decoration: none; display: inline-block; }
.steps { margin: 0; padding-left: 20px; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }
.link-btn { background: none; border: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: 14px; padding: 8px; }

/* ---------- Openbare pagina's ---------- */
.public-wrap { min-height: 100vh; background: var(--bg); padding: 24px 16px 48px; }
.public-inner { max-width: 520px; margin: 0 auto; display: grid; gap: 18px; }
.public-card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 24px; display: grid; gap: 14px; }
.public-card h1 { font-size: 24px; }
.center { text-align: center; }
.day-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.day-pill { flex: 0 0 auto; width: 58px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 8px 0; cursor: pointer; display: grid; gap: 1px; justify-items: center; }
.day-pill.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.dp-wd, .dp-m { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; opacity: .75; }
.dp-d { font-size: 19px; font-weight: 700; }
.section-title { font-weight: 650; }
.day-bar { position: relative; height: 28px; border-radius: 8px; background: var(--ok-soft); overflow: hidden; }
.bar-block { position: absolute; top: 0; bottom: 0; }
.bar-block.busy { background: var(--warn); opacity: .75; }
.bar-block.past { background: #d9d4cb; }
.bar-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-3); margin-top: -8px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: -6px; }
.lg::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg.free::before { background: var(--ok-soft); border: 1px solid var(--ok); }
.lg.busy::before { background: var(--warn); opacity: .75; }
.btn.big { padding: 15px; font-size: 16px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 28px; font-weight: 700; }
.big-when { font-size: 18px; font-weight: 600; }
.public-card p { margin: 0; }
.public-card .two-col { grid-template-columns: 1fr; }
@media (min-width: 460px) { .public-card .two-col { grid-template-columns: 1fr 1.4fr; } }
.cancel-box { display: grid; gap: 8px; background: var(--surface-2); border-radius: 12px; padding: 12px; }

/* ---------- NFC ---------- */
.nfc-card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 28px 24px; display: grid; gap: 14px; text-align: center; }
.nfc-card h1 { font-size: 26px; }
.nfc-open { border: 0; border-radius: 18px; background: var(--ok); color: #fff; font-size: 20px; font-weight: 700; padding: 28px; display: flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer; margin-top: 8px; }
.nfc-open svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nfc-open:disabled { opacity: .6; }
.nfc-status { min-height: 1.4em; font-weight: 600; }
.nfc-status.ok { color: var(--ok); }
.nfc-status.bad { color: var(--warn); }

/* ---------- Taalkeuze ---------- */
.lang-switch { display: inline-flex; border-radius: 999px; padding: 2px; gap: 2px; flex-shrink: 0; }
.lang-switch button { border: 0; background: none; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 700; letter-spacing: .04em; cursor: pointer; }
.lang-switch.dark { background: rgba(255,255,255,.1); }
.lang-switch.dark button { color: #aab5ad; }
.lang-switch.dark button.active { background: #e8dcc8; color: var(--brand); }
.lang-switch.light { background: var(--surface-2); border: 1px solid var(--line); }
.lang-switch.light button { color: var(--ink-3); }
.lang-switch.light button.active { background: var(--brand); color: #fff; }
.card-top, .public-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (max-width: 600px) {
  .topbar-inner { gap: 10px; padding: 10px 14px; }
  .topbar .brand-tag { display: none; }
  .topbar .brand-name, .topbar .btn { white-space: nowrap; }
}
