:root {
  color-scheme: light;
  --bg: #f3f5f7; --surface: #ffffff; --surface-2: #eef1f4; --border: #dde2e8;
  --text: #0d1318; --text-2: #4c5862; --text-3: #7a8691; --accent: #1f6fd1; --accent-ink: #ffffff;
  --good: #1e9e4a; --warning: #f0a81c; --critical: #d23c3c;
  --good-bg: #e6f5ec; --warning-bg: #fdf3dd; --critical-bg: #fbe7e7;
  --good-ink: #136b33; --warning-ink: #7d5400; --critical-ink: #a42626;
  --shadow: 0 10px 36px rgba(0,0,0,.18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1317; --surface: #171c21; --surface-2: #1f262c; --border: #2d363e;
    --text: #f2f5f7; --text-2: #b8c2cb; --text-3: #85919b; --accent: #4a90e8;
    --good-bg: #13301f; --warning-bg: #33280f; --critical-bg: #3a1a1a;
    --good-ink: #6ad38d; --warning-ink: #f5c45e; --critical-ink: #f29191;
    --shadow: 0 10px 36px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1317; --surface: #171c21; --surface-2: #1f262c; --border: #2d363e;
  --text: #f2f5f7; --text-2: #b8c2cb; --text-3: #85919b; --accent: #4a90e8;
  --good-bg: #13301f; --warning-bg: #33280f; --critical-bg: #3a1a1a;
  --good-ink: #6ad38d; --warning-ink: #f5c45e; --critical-ink: #f29191;
  --shadow: 0 10px 36px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 1320px; margin: 0 auto; padding: 16px 16px 48px; }
header.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
h1 { font-size: 21px; margin: 0; font-weight: 650; display: flex; align-items: center; gap: 8px; }
h1 .logo { width: 26px; height: 26px; }
h1 small { font-weight: 400; color: var(--text-3); font-size: 14px; }
h2 { font-size: 16px; margin: 0 0 10px; font-weight: 600; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 600; }
.meta { color: var(--text-2); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

.banner { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--warning); padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; color: var(--text-2); }
.banner.crit { border-left-color: var(--critical); }
.banner.info { border-left-color: var(--accent); }
.banner.good { border-left-color: var(--good); }
.banner ul { margin: 4px 0 0; padding-left: 18px; }

button, .btn {
  font: inherit; font-size: 13px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 12px; cursor: pointer; min-height: 34px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:hover, .btn:hover { background: var(--surface-2); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover, .btn.primary:hover { filter: brightness(1.08); }
button.danger { background: var(--critical); border-color: var(--critical); color: #fff; }
button.good { background: var(--good); border-color: var(--good); color: #fff; }
button.small, .btn.small { padding: 2px 8px; min-height: 28px; font-size: 12px; }
button.icon { padding: 2px 7px; min-height: 28px; min-width: 28px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 10px; min-height: 34px; max-width: 100%;
}
textarea { min-height: 70px; width: 100%; resize: vertical; }
select.small, input.small { min-height: 28px; padding: 2px 6px; font-size: 12px; }
input[type="checkbox"] { min-height: 0; width: 16px; height: 16px; accent-color: var(--accent); }
label { color: var(--text-2); }

nav.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; scrollbar-width: thin; }
nav.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 9px 14px; color: var(--text-2); white-space: nowrap; min-height: 40px; }
nav.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--surface-2); font-size: 11px; line-height: 18px; text-align: center; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.grid { display: grid; gap: 12px; }
.grid.cols-5 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack > * + * { margin-top: 8px; }

/* Niveaus */
.lv { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.lv::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lv.groen { background: var(--good-bg); color: var(--good-ink); }
.lv.oranje { background: var(--warning-bg); color: var(--warning-ink); }
.lv.rood { background: var(--critical-bg); color: var(--critical-ink); }
.lv.onbekend { background: var(--surface-2); color: var(--text-3); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); }
.dot.groen { background: var(--good); } .dot.oranje { background: var(--warning); } .dot.rood { background: var(--critical); }

.hero { border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; border: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.hero.groen { background: var(--good-bg); } .hero.oranje { background: var(--warning-bg); } .hero.rood { background: var(--critical-bg); } .hero.onbekend { background: var(--surface-2); }
.hero .big { font-size: 22px; font-weight: 700; }
.hero.groen .big { color: var(--good-ink); } .hero.oranje .big { color: var(--warning-ink); } .hero.rood .big { color: var(--critical-ink); }

.prov { border-top: 4px solid var(--border); }
.prov.groen { border-top-color: var(--good); } .prov.oranje { border-top-color: var(--warning); } .prov.rood { border-top-color: var(--critical); }
.prov header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 12px; font-size: 13px; margin-bottom: 8px; }
.stats b { font-weight: 600; }
.reasons { margin: 0; padding-left: 18px; font-size: 13px; }
.reasons li { margin: 2px 0; }
details summary { cursor: pointer; color: var(--text-2); font-size: 13px; margin-top: 6px; }

.nights { display: flex; gap: 6px; flex-wrap: wrap; }
.nights button { flex-direction: column; align-items: flex-start; gap: 0; min-width: 130px; }
.nights button .lbl { font-weight: 600; }

/* Tabellen */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; color: var(--text-2); background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
tr.off td { opacity: .5; }
tr.done td { color: var(--text-3); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
table.hours td, table.hours th { padding: 3px 6px; text-align: right; }
table.hours td:first-child, table.hours th:first-child { text-align: left; }
td.c-rood { background: var(--critical-bg); color: var(--critical-ink); }
td.c-oranje { background: var(--warning-bg); color: var(--warning-ink); }
.scrollbox { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }

/* Kaart */
.map { height: 460px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 14px; z-index: 0; }
.map.small { height: 280px; margin: 8px 0; }
.map.tall { height: min(65vh, 620px); }
.leaflet-container { font: inherit; }

/* Routes */
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; }
.rc0 { background: #1f6fd1; } .rc1 { background: #d23c3c; } .rc2 { background: #1e9e4a; } .rc3 { background: #c76a00; } .rc4 { background: #8a3ffc; }
.rc5 { background: #00838f; } .rc6 { background: #d12771; } .rc7 { background: #6b7a00; } .rc8 { background: #7a5230; } .rc9 { background: #34495e; }
.route header { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.route .title { font-weight: 650; font-size: 15px; display: flex; align-items: center; gap: 8px; }
progress { width: 140px; height: 10px; accent-color: var(--good); vertical-align: middle; }
progress.wide { width: 100%; }
.tag { display: inline-block; padding: 0 7px; border-radius: 9px; font-size: 11px; background: var(--surface-2); color: var(--text-2); line-height: 18px; white-space: nowrap; }
.tag.warn { background: var(--warning-bg); color: var(--warning-ink); }
.tag.crit { background: var(--critical-bg); color: var(--critical-ink); }
.tag.good { background: var(--good-bg); color: var(--good-ink); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.kpi .v { font-size: 22px; font-weight: 700; }
.kpi .l { color: var(--text-3); font-size: 12px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }

/* Dialoog */
dialog { border: 1px solid var(--border); border-radius: 12px; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow); width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog form { padding: 16px 18px; }
dialog .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; }
dialog .field { display: flex; flex-direction: column; gap: 3px; }
dialog .field.wide { grid-column: 1 / -1; }
dialog .field.check { flex-direction: row; align-items: center; gap: 8px; }
dialog .help { font-size: 12px; color: var(--text-3); }
dialog footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); z-index: 1000; max-width: calc(100vw - 32px); }
#toast.err { background: var(--critical); color: #fff; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.login { max-width: 360px; margin: 12vh auto; }
.login form { display: flex; flex-direction: column; gap: 10px; }

#toast { display: flex; align-items: center; gap: 12px; }
#toast.hidden { display: none; }
#toast button { background: transparent; color: inherit; border-color: currentColor; }

/* Studentenpagina: grote knoppen, één duidelijke volgende stop */
.student .sbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0 6px; }
.student .sbar b { font-size: 16px; }
.student progress.wide { height: 8px; margin-bottom: 10px; }
.btn-xl { width: 100%; min-height: 56px !important; font-size: 18px !important; font-weight: 600; border-radius: 12px !important; margin-top: 10px; }
.hero-stop { border: 2px solid var(--accent); border-radius: 14px; }
.hero-stop.done-all { border-color: var(--good); }
.hero-stop .eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); }
.hero-stop .name { font-size: 22px; font-weight: 700; line-height: 1.2; margin-top: 4px; }
.hero-stop .addr { font-size: 16px; color: var(--text-2); margin-top: 2px; }
.note { background: var(--warning-bg); color: var(--warning-ink); border-radius: 8px; padding: 8px 10px; margin-top: 8px; white-space: pre-wrap; }
.row.between { justify-content: space-between; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.row3.two { grid-template-columns: 1fr 1fr; margin-top: 14px; }
.row3 button { min-height: 46px; font-size: 15px; }
h3.sec, details.sec { margin: 16px 0 6px; }
details.sec summary { font-size: 15px; font-weight: 600; color: var(--text); padding: 6px 0; }
.list { display: flex; flex-direction: column; gap: 6px; }
.li { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; text-align: left; width: 100%; min-height: 48px; font: inherit; color: var(--text); }
.li .nr { font-weight: 700; min-width: 22px; color: var(--text-3); }
.li .grow { flex: 1; min-width: 0; }
.footer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 8px; }
.footer-actions button { min-height: 48px; }
.sheet { width: min(560px, 100vw); max-height: 92vh; margin: auto auto 0; border-radius: 16px 16px 0 0; }
.sheet form { padding: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { min-height: 42px; border-radius: 21px; padding: 6px 14px; font-size: 14px; }
.chip.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.fotobtn { margin-top: 8px; width: 100%; min-height: 46px; }
.preview { max-width: 100%; max-height: 220px; border-radius: 8px; margin-top: 8px; display: block; }
.preview.hidden { display: none; }

/* Studentenpagina (oud) */
.student .wrap { max-width: 640px; padding-top: 12px; }
.student .head { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; }
.stop { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.stop.next { border: 2px solid var(--accent); }
.stop.done { opacity: .6; }
.stop .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.stop .nr { font-weight: 700; font-size: 18px; }
.stop .name { font-weight: 650; font-size: 16px; }
.stop .addr { color: var(--text-2); }
.stop .note { background: var(--warning-bg); color: var(--warning-ink); border-radius: 8px; padding: 6px 10px; margin-top: 8px; white-space: pre-wrap; }
.stop .actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.stop .actions button, .stop .actions .btn { min-height: 46px; font-size: 15px; }
.bigbtn { min-height: 48px !important; font-size: 15px !important; width: 100%; }
.mapsbtns { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }

@media (max-width: 640px) {
  .wrap { padding: 10px 12px 40px; }
  .map { height: 340px; }
  .hide-sm { display: none; }
  th, td { padding: 5px 6px; }
}
.count.crit { background: var(--critical); color: #fff; }
img.thumb { max-width: 140px; max-height: 100px; border-radius: 6px; margin-top: 4px; border: 1px solid var(--border); }
/* Bezig met strooien */
.hero-stop.busy { border-color: var(--good); }
.hero-stop.busy .eyebrow { color: var(--good-ink); }
.timer { font-size: 44px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; margin: 12px 0 2px; }
.center { text-align: center; }
.linkbtn { background: none; border: 0; color: var(--text-3); text-decoration: underline; min-height: 40px; width: 100%; margin-top: 4px; font-size: 13px; }
dialog.wide { width: min(1000px, calc(100vw - 24px)); }
/* Logo */
h1 .logo.brand { width: auto; height: 44px; max-width: 260px; }
h1 .logo.brand + .brandtxt { display: none; }
.login h1 .logo.brand { height: 56px; max-width: 100%; }
img.logo-preview { max-height: 70px; max-width: 100%; background: #fff; padding: 6px; border-radius: 6px; border: 1px solid var(--border); }
/* Handtekening */
#sigNaam { width: 100%; margin: 6px 0 8px; min-height: 44px; font-size: 16px; }
.sigwrap { position: relative; border: 2px dashed var(--border); border-radius: 10px; background: #fff; }
#sigCanvas { display: block; width: 100%; height: 180px; touch-action: none; cursor: crosshair; }
.sighint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #9aa4ad; pointer-events: none; font-size: 15px; }
.sheet h3 { margin: 12px 0 0; }

/* Onderaannemer-label */
.tag.oa { background: #efe6ff; color: #5a2ca0; }
:root[data-theme="dark"] .tag.oa { background: #3a2a5c; color: #d9c6ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.oa { background: #3a2a5c; color: #d9c6ff; } }
.card.off { opacity: .6; }

/* Tweestapsverificatie: QR-code (altijd zwart op wit, ook in donker thema), sleutel en herstelcodes */
.login { max-width: 400px; }
.qr { background: #fff; padding: 8px; border-radius: 8px; width: 220px; max-width: 100%; margin: 8px auto; }
.qr svg { display: block; width: 100%; height: auto; }
code.secret { font-size: 14px; letter-spacing: .06em; word-break: break-all; user-select: all; }
pre.codes { background: var(--surface-2); padding: 10px 14px; border-radius: 8px; font-size: 15px; line-height: 1.7; user-select: all; }
.card.mfa { margin-top: 10px; }
.card.mfa input#mfaCode { max-width: 140px; font-size: 18px; letter-spacing: .15em; }

/* =====================================================================
   Inlog- en wachtwoordpagina
   ===================================================================== */
body.auth { min-height: 100vh; background: var(--bg); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }

/* Merkvlak: nachtblauw met sneeuw en een besneeuwd landschap onderaan */
.auth-hero {
  position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 56px 32px;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(120, 190, 255, .35), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(31, 111, 209, .45), transparent 60%),
    linear-gradient(165deg, #06182b 0%, #0b2a4a 45%, #14508d 100%);
}
.auth-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; pointer-events: none;
  background: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 300' preserveAspectRatio='none'%3E%3Cpath d='M0 170 C150 120 260 190 420 150 S700 90 860 140 1100 120 1200 100 V300 H0Z' fill='%23ffffff' fill-opacity='.07'/%3E%3Cpath d='M0 220 C180 180 330 240 520 205 S860 170 1000 200 1140 190 1200 180 V300 H0Z' fill='%23ffffff' fill-opacity='.11'/%3E%3Cpath d='M0 262 C200 238 380 276 600 254 S960 236 1200 250 V300 H0Z' fill='%23eaf4ff' fill-opacity='.9'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}
.hero-in { position: relative; z-index: 1; max-width: 520px; }
.hero-mark { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: .02em; margin-bottom: 15vh; }
.hero-mark img { width: 38px; height: 38px; border-radius: 10px; background: #fff; padding: 3px; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.hero-title { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; font-weight: 750; letter-spacing: -.02em; margin: 0 0 18px; display: block; }
.hero-sub { font-size: 16px; line-height: 1.55; color: rgba(255,255,255,.78); margin: 0 0 28px; max-width: 440px; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.hero-points li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: rgba(255,255,255,.9); }
.hero-points .dot { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); font-size: 14px; flex: none; }
.hero-foot { position: relative; z-index: 1; font-size: 12px; color: #0b2a4a; opacity: .7; font-weight: 600; }

/* Vallende sneeuw (decoratief, uit bij "minder beweging") */
.flakes { position: absolute; inset: 0; pointer-events: none; }
.flakes i { position: absolute; top: -40px; color: #fff; font-style: normal; opacity: .55; animation: sneeuw linear infinite; }
.flakes i::before { content: "\2744"; }
.flakes i:nth-child(1)  { left: 6%;  font-size: 14px; animation-duration: 15s; animation-delay: -2s; }
.flakes i:nth-child(2)  { left: 14%; font-size: 9px;  animation-duration: 11s; animation-delay: -7s; opacity: .35; }
.flakes i:nth-child(3)  { left: 23%; font-size: 18px; animation-duration: 19s; animation-delay: -12s; opacity: .4; }
.flakes i:nth-child(4)  { left: 31%; font-size: 10px; animation-duration: 13s; animation-delay: -4s; }
.flakes i:nth-child(5)  { left: 42%; font-size: 13px; animation-duration: 17s; animation-delay: -9s; opacity: .45; }
.flakes i:nth-child(6)  { left: 51%; font-size: 8px;  animation-duration: 10s; animation-delay: -1s; opacity: .3; }
.flakes i:nth-child(7)  { left: 60%; font-size: 16px; animation-duration: 21s; animation-delay: -15s; opacity: .35; }
.flakes i:nth-child(8)  { left: 68%; font-size: 11px; animation-duration: 14s; animation-delay: -6s; }
.flakes i:nth-child(9)  { left: 76%; font-size: 20px; animation-duration: 23s; animation-delay: -3s; opacity: .3; }
.flakes i:nth-child(10) { left: 84%; font-size: 9px;  animation-duration: 12s; animation-delay: -10s; opacity: .4; }
.flakes i:nth-child(11) { left: 91%; font-size: 14px; animation-duration: 16s; animation-delay: -13s; }
.flakes i:nth-child(12) { left: 97%; font-size: 10px; animation-duration: 18s; animation-delay: -5s; opacity: .35; }
@keyframes sneeuw {
  0%   { transform: translate3d(0, -5vh, 0) rotate(0deg); }
  50%  { transform: translate3d(22px, 52vh, 0) rotate(160deg); }
  100% { transform: translate3d(-10px, 110vh, 0) rotate(320deg); }
}
@media (prefers-reduced-motion: reduce) { .flakes { display: none; } }

/* Inlogkaart */
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px 24px; }
.auth-card {
  width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 32px 32px 26px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 18px 50px rgba(11, 42, 74, .12);
}
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; font-weight: 700; font-size: 18px; }
.auth-logo .logo { width: 34px; height: 34px; }
.auth-logo .logo.brand { width: auto; height: 60px; max-width: 100%; }
.auth-logo .logo.brand + .brandtxt { display: none; }
.auth-card h2 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 6px; }
.auth-lead { color: var(--text-2); margin: 0 0 20px; line-height: 1.5; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card form .auth-lead { margin-bottom: 6px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.auth-card input:not([type="checkbox"]) { width: 100%; min-height: 46px; font-size: 15px; padding: 10px 14px; border-radius: 10px; transition: border-color .15s, box-shadow .15s; }
.auth-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(31, 111, 209, .18); }
.pw-wrap { position: relative; display: block; }
.auth-card .pw-wrap input { padding-right: 82px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 32px; padding: 2px 10px; font-size: 12px; border-radius: 7px; background: var(--surface-2); border-color: transparent; color: var(--text-2); }
.hint { font-size: 12px; color: var(--warning-ink); background: var(--warning-bg); border-radius: 7px; padding: 6px 10px; }
button.big, .btn.big { min-height: 48px; font-size: 15px; font-weight: 600; border-radius: 10px; width: 100%; margin-top: 4px; }
.auth-help { font-size: 12.5px; color: var(--text-3); margin: 2px 0 0; line-height: 1.5; text-align: center; }
.linkbtn { background: none; border: none; color: var(--text-3); min-height: 0; padding: 4px; align-self: center; font-size: 13px; }
.linkbtn:hover { background: none; color: var(--text); }
.auth-card input.code-input { text-align: center; font-size: 26px; letter-spacing: .35em; font-variant-numeric: tabular-nums; min-height: 58px; }
.steps { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 13px; display: grid; gap: 4px; }
.auth-card .qr { width: 200px; margin: 4px auto 0; border: 1px solid var(--border); border-radius: 12px; }
.auth-card #codes { display: flex; flex-direction: column; gap: 12px; }
.auth-card #codes.hidden { display: none; }
.auth-card .banner { margin: 16px 0 0; }
.auth-foot { margin: 18px 0 0; font-size: 12px; color: var(--text-3); }
.auth-card #klaar { display: flex; flex-direction: column; gap: 8px; }
.auth-card #klaar.hidden { display: none; }
.auth-card #genBox { display: grid; gap: 6px; margin: 0; }
.auth-card #genBox.hidden { display: none; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: -4px; }
.meter span { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .2s, background .2s; }
.meter span.zwak { width: 25%; background: var(--critical); }
.meter span.matig { width: 50%; background: var(--warning); }
.meter span.goed { width: 75%; background: #6bbf3a; }
.meter span.sterk { width: 100%; background: var(--good); }

/* Donker thema: de onderste sneeuwlaag loopt over in de donkere achtergrond */
:root[data-theme="dark"] .auth-hero::after { filter: brightness(.12) saturate(2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-hero::after { filter: brightness(.12) saturate(2); } }

/* Gsm en smalle schermen: merkvlak wordt een band bovenaan */
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; align-content: start; }
  .auth-hero { padding: 22px 20px 70px; }
  .hero-mark { margin-bottom: 16px; }
  .hero-title { font-size: 26px; margin-bottom: 0; }
  .hero-sub, .hero-points, .hero-foot { display: none; }
  .auth-hero::after { height: 50%; }
  .auth-panel { justify-content: flex-start; padding: 0 16px 24px; margin-top: -44px; position: relative; z-index: 2; }
  .auth-card { padding: 24px 20px 20px; }
  /* Naam staat al in de band; enkel een echt logo tonen we nog in de kaart */
  .auth-logo:not(:has(.brand)) { display: none; }
}

/* Bedrijfslogo: op de studentenpagina bovenaan; in donker thema op een witte tegel (het logo heeft donkere letters) */
.st-brand { display: flex; justify-content: center; padding: 2px 0 10px; }
.st-brand img { height: 46px; max-width: 100%; }
:root[data-theme="dark"] :is(h1 .logo.brand, .auth-logo .logo.brand, .st-brand img) { background: #fff; padding: 5px 10px; border-radius: 10px; box-sizing: content-box; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(h1 .logo.brand, .auth-logo .logo.brand, .st-brand img) { background: #fff; padding: 5px 10px; border-radius: 10px; box-sizing: content-box; }
}

/* Gewerkte uren: tijdlijn van een nacht */
tr.warnrow td:first-child { box-shadow: inset 3px 0 0 var(--warning); }
.letop { min-width: 230px; }
.letop span { display: block; color: var(--warning-ink); }
ol.timeline { list-style: none; margin: 12px 0; padding: 0; position: relative; }
ol.timeline::before { content: ""; position: absolute; left: 66px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
ol.timeline li { display: grid; grid-template-columns: 50px 34px 1fr; align-items: start; gap: 0 8px; padding: 6px 0; position: relative; }
.tl-t { font-variant-numeric: tabular-nums; color: var(--text-2); text-align: right; padding-top: 3px; }
.tl-i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--border); font-size: 12px; z-index: 1; margin-left: 4px; }
.tl-vertrek .tl-i, .tl-einde .tl-i, .tl-terug .tl-i { border-color: var(--accent); color: var(--accent); }
.tl-strooien .tl-i { border-color: var(--good); color: var(--good); }
.tl-overgeslagen .tl-i { border-color: var(--warning); color: var(--warning-ink); }
.tl-rijden { opacity: .75; }
.tl-rijden .tl-i { border-style: dashed; }

/* Voorbeelden van de mails */
#dlg2:has(.mailprev) { width: min(1200px, calc(100vw - 24px)); }
.mp-grid { display: grid; grid-template-columns: 260px 1fr; gap: 14px; }
.mp-list { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow: auto; }
.mp-item { flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 8px 10px; min-height: 0; white-space: normal; }
.mp-item.sel { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.mp-meta { font-size: 12px; color: var(--text-2); margin-bottom: 8px; display: grid; gap: 2px; }
.mp-frame { width: 100%; height: min(66vh, 720px); border: 1px solid var(--border); border-radius: 8px; background: #e9edf1; }
@media (max-width: 760px) { .mp-grid { grid-template-columns: 1fr; } .mp-list { flex-direction: row; overflow-x: auto; max-height: none; } .mp-item { min-width: 170px; } }
