:root {
  --bg: #F6F7F9; --surface: #FFFFFF; --line: #E3E6EB; --line-soft: #EEF0F3;
  --text: #111827; --muted: #5B6472; --soft: #374151;
  --S: #2563EB; --N: #D97706; --samen: #16A34A;
  --S-tint: #F4F8FF; --N-tint: #FFF8F1; --samen-tint: #F1FAF4;
  --o: #D97706; --o-tint: #FFFBEB; --m: #0284C7; --m-tint: #F0F9FF; --a: #4F46E5; --a-tint: #EEF2FF;
  --food: #E5484D; --food-tint: #FFF5F4;
  --ok: #166534; --ok-bg: #DCFCE7; --warn: #92400E; --warn-bg: #FEF3C7; --bad: #991B1B; --bad-bg: #FEE2E2;
  --info: #3730A3; --info-bg: #EEF2FF;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--S); }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.boot { padding: 40px; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Shell */
.shell { max-width: 1440px; margin: 0 auto; padding: 20px 24px 40px; display: flex; flex-direction: column; gap: 16px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.brand img { width: 32px; height: 32px; }
.nav { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; overflow-x: auto; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px; padding: 9px 14px; border-radius: 8px; white-space: nowrap; }
.nav a.on { background: var(--text); color: #fff; }
.who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.av { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; flex: none; }
.av.sq { border-radius: 5px; }

.btn { border: 0; border-radius: 8px; min-height: 38px; padding: 0 14px; font-weight: 600; font-size: 13px; background: var(--text); color: #fff; display: inline-flex; align-items: center; gap: 6px; }
.btn.light { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn.blue { background: var(--S); }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 16px; height: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.h3 { margin: 0; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
label.f input, label.f select, label.f textarea, .inp { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-height: 38px; background: #fff; color: var(--text); font-size: 14px; font-weight: 500; }
textarea { resize: vertical; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 0 12px; min-height: 32px; font-size: 12.5px; font-weight: 600; color: var(--soft); }
.chip.on { background: var(--text); color: #fff; border-color: var(--text); }
.ico { width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; flex: none; position: relative; }
.ico svg { width: 14px; height: 14px; stroke: #fff; }
.ico.lg { width: 40px; height: 40px; border-radius: 10px; }
.ico.lg svg { width: 22px; height: 22px; }

/* Weekraster */
.weekhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.grid { display: grid; grid-template-columns: 128px repeat(7, minmax(140px, 1fr)); gap: 1px; min-width: 1120px; }
.grid > div { background: var(--surface); min-width: 0; }
.lc { padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.lc .t { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; }
.lc .s { font-size: 11.5px; color: var(--muted); }
.dh { padding: 9px 10px; display: flex; flex-direction: column; gap: 3px; }
.dh .d { display: flex; align-items: baseline; gap: 6px; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.dh .d b { font-size: 17px; color: var(--text); }
.dh.today { background: var(--text) !important; color: #fff; }
.dh.today .d, .dh.today .d b { color: #fff; }
.hol { font-size: 11px; font-weight: 600; color: #713F12; background: #FEF08A; border-radius: 4px; padding: 1px 6px; align-self: flex-start; }
.home { padding: 6px 10px; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; min-height: 34px; }
.hb { display: flex; width: 42px; height: 8px; border-radius: 4px; overflow: hidden; gap: 1px; flex: none; }
.hb span { flex: 1; }
.cell { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 64px; position: relative; }
.cell.drop { outline: 2px dashed var(--S); outline-offset: -3px; }
.cell .add { position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 6px; border: 1px dashed #C3CBDD; background: transparent; color: var(--muted); opacity: 0; display: flex; align-items: center; justify-content: center; }
.cell:hover .add, .cell .add:focus { opacity: 1; }
@media (hover: none) { .cell .add { opacity: .7; } }
.it { display: flex; align-items: center; gap: 7px; min-width: 0; border-radius: 6px; padding: 2px; }
.it[draggable="true"] { cursor: grab; }
.it[draggable="true"]:hover { background: rgba(17,24,39,.04); }
.it .kd { position: absolute; right: -5px; bottom: -5px; width: 14px; height: 14px; border-radius: 4px; color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 1.5px solid #fff; }
.it .tx { display: flex; flex-direction: column; font-size: 12.5px; font-weight: 600; line-height: 1.2; min-width: 0; text-align: left; }
.it .tm { font-size: 11px; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.note { font-size: 11.5px; font-weight: 600; color: var(--soft); display: flex; gap: 5px; align-items: center; }
.meal { border: 0; margin: 0; background: transparent; text-align: left; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; width: 100%; height: 100%; min-height: 64px; }
.meal:hover { background: var(--food-tint); }
.meal .mt { font-weight: 700; font-size: 13px; }
.meal .ms { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.ag { padding: 7px 10px; display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--soft); }
.ag span { display: flex; gap: 5px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag i { width: 6px; height: 6px; border-radius: 2px; background: var(--a); flex: none; }
.hand { border: 0; background: transparent; padding: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--info); }
.pend { font-size: 11px; font-weight: 600; color: var(--warn); }

/* Verdeling */
.vgrid { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)); gap: 6px; }
.vgrid .gh { font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; }
.vgrid .wl { display: flex; align-items: center; font-weight: 700; font-size: 12px; }
.vcell { border: 1px solid var(--line); border-radius: 9px; min-height: 66px; padding: 6px; display: flex; flex-direction: column; gap: 4px; text-align: left; overflow: hidden; background: #fff; }
.vcell .sb { display: flex; height: 6px; border-radius: 3px; overflow: hidden; }
.vcell .sb span { flex: 1; }
.vcell b { font-size: 12px; }
.vcell small { font-size: 10.5px; color: var(--muted); }
.vcell input { width: 100%; border: 1px solid var(--line); border-radius: 5px; font-size: 11px; padding: 2px 4px; }
.ver { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 4px; width: 100%; }
.ver.on { border-color: var(--S); background: var(--S-tint); }
.pv { display: grid; grid-template-columns: 96px repeat(7, minmax(0, 1fr)); gap: 3px; align-items: center; }
.sq { height: 18px; border-radius: 4px; }

/* Modal */
#modal { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; }
#modal[hidden] { display: none; }
.scrim { position: absolute; inset: 0; background: rgba(17,24,39,.35); border: 0; }
.drawer { position: relative; width: min(480px, 100%); height: 100%; background: #fff; box-shadow: -12px 0 32px rgba(17,24,39,.18); padding: 24px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.drawer .x { position: absolute; top: 16px; right: 16px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.5; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: #fff; border-radius: 10px; padding: 10px 16px; font-weight: 600; font-size: 13px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 60; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.err { background: var(--bad); }

/* Login */
.login { max-width: 420px; margin: 10vh auto; }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pick button { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 18px; font-weight: 700; font-size: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pick button.on { border-color: var(--text); }

/* Balans */
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar { display: grid; grid-template-columns: 44px 1fr 120px; gap: 10px; align-items: center; font-size: 12px; }
.bar .track { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--line-soft); }

/* Tablet / kiosk */
body.kiosk { background: #FFF4E6; }
.k { min-height: 100vh; padding: 28px; display: flex; flex-direction: column; gap: 20px; font-size: 16px; }
.k-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.k-day { font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.k-date { font-size: 22px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.k-clock { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
.k-home { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.k-card { background: #fff; border-radius: 24px; padding: 20px; box-shadow: 0 2px 4px rgba(60,40,10,.06), 0 8px 20px rgba(60,40,10,.05); display: flex; flex-direction: column; gap: 12px; }
.k-who { display: flex; align-items: center; gap: 16px; }
.k-av { width: 84px; height: 84px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 700; border: 4px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.k-big { font-size: 32px; font-weight: 700; }
.k-kids { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.k-kid h3 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 26px; }
.k-part { border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.k-part .pl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.k-item { display: flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; }
.k-item .ico { width: 40px; height: 40px; border-radius: 12px; }
.k-item .ico svg { width: 24px; height: 24px; }
.k-item small { display: block; font-size: 14px; font-weight: 600; color: var(--muted); }
.k-count { background: #312E81; color: #fff; }
.moons { display: flex; gap: 6px; flex-wrap: wrap; }
.moons span { width: 40px; height: 40px; border-radius: 12px; background: #4F46E5; display: flex; align-items: center; justify-content: center; }
.moons svg { width: 24px; height: 24px; stroke: #FDE68A; }
body.night { background: #070B16; }
.night-view { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; color: #8B93A7; text-align: center; }
.night-view .k-clock { color: #C7CCD8; font-size: 96px; }
.night-view svg { width: 64px; height: 64px; stroke: #FDE68A; opacity: .8; }

@media (max-width: 720px) {
  .shell { padding: 14px 12px 32px; }
  .k { padding: 16px; }
  .k-day { font-size: 38px; }
}
