:root {
  --bg: #E9E9E6; --card: #FFFFFF; --ink: #16181D; --ink-2: #4A4D55; --muted: #8C8F96;
  --line: #EEEEEC; --line-2: #E2E2DF;
  --teal: #0E8DA0; --teal-ink: #0B6B7A; --teal-soft: #DDF4F7;
  --heat-1: #E6F7FA; --heat-2: #B5EAF2; --heat-3: #63D3E6; --heat-4: #1DB3CB; --heat-5: #0B7C8E;
  --pink: #E0248A; --violet: #7A2CF5; --green: #14A37F; --red: #E5484D; --red-soft: #FDE4E4; --gray: #A3A6AD;
  --pos-bar: #0E8DA0; --pos-keuken: #E0663A; --pos-bediening: #7A2CF5; --pos-strand: #D9A93A;
  --radius: 18px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
}
:root { color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; font: 15px/1.45 Inter, "SF Pro Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: -0.01em; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--teal-ink); }
button, input, select, textarea { font: inherit; }
h1, h2 { margin: 0; }
img { display: block; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.icon { flex: 0 0 auto; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }

/* Shell */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line-2); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 600; text-decoration: none; }
.brand--lg { font-size: 18px; padding-bottom: 4px; }
.brand--lg img { width: 44px; height: 44px; border-radius: 12px; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: #F2F2F0; }
.icon-btn .count { position: absolute; top: 0; right: 0; }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line-2); }
.nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 50px; border-radius: 12px; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; }
.nav a.is-active { color: var(--ink); }
.nav a.is-active .icon { color: var(--teal); }
.nav .count { position: absolute; top: 4px; left: calc(50% + 6px); }
.main { max-width: 1120px; margin: 0 auto; padding: 16px 16px 24px; min-width: 0; }
body:has(.week) .main { max-width: 1400px; }
.footer { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; padding: 24px 16px 32px; font-size: 13px; color: var(--muted); }
.footer a { color: inherit; }
.narrow { max-width: 440px; margin: 0 auto; padding: 32px 16px 24px; display: grid; gap: 16px; align-content: start; }

@media (max-width: 699px) {
  body:not(.bare) .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (min-width: 700px) {
  .topbar { padding: 12px 24px; }
  .nav { position: static; display: flex; gap: 4px; margin-left: 24px; padding: 0; background: none; border: 0; }
  .nav a { flex-direction: row; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; color: var(--ink-2); }
  .nav a.is-active { background: #F0F0EE; }
  .nav a.is-active .icon { color: var(--ink); }
  .nav .count { position: static; }
  .main { padding: 20px 24px 40px; }
  .narrow { padding-top: 48px; }
}

/* Cards */
.card { min-width: 0; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-bottom: 14px; }
.card__head h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.card__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (min-width: 700px) { .card { padding: 24px; } }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.page-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
@media (min-width: 1000px) {
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .span-5 { grid-column: span 5; }
  .span-7 { grid-column: span 7; }
  .span-12 { grid-column: span 12; }
}

/* KPI tiles */
.kpis { display: grid; grid-template-columns: 1fr 1fr; padding: 0; overflow: hidden; }
.kpi { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 20px; text-align: center; }
.kpi:nth-child(odd) { border-right: 1px solid var(--line); }
.kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
.kpi__label { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi__value { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; justify-content: center; font-size: 32px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1; background: var(--line); color: var(--ink-2); }
.badge--up { background: var(--teal-soft); color: var(--teal-ink); }
.badge--down { background: var(--red-soft); color: var(--red); }

/* List rows */
.list { list-style: none; margin: 0; padding: 0; }
.list__row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.list__row:first-child { border-top: 0; padding-top: 0; }
.list__row:last-child { padding-bottom: 0; }
.list__row.is-next .list__title { color: var(--teal-ink); }
.list__row.is-muted { opacity: .55; }
.list__main { flex: 1; min-width: 0; }
.list__title { font-weight: 600; letter-spacing: -0.015em; white-space: nowrap; }
.list__sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 3px; color: var(--muted); font-size: 13px; }
.list__right { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
@media (max-width: 699px) {
  .list__row:has(.pill) { flex-wrap: wrap; }
  .list__row:has(.pill) .list__right { flex: 1 0 100%; justify-content: flex-start; }
  .list__row:has(.pill) .list__right form { flex: 1; }
  .list__row:has(.pill) .list__right form .btn, .list__row:has(.pill) .list__right > .btn { width: 100%; }
}

.dateblock { display: flex; flex: 0 0 56px; flex-direction: column-reverse; width: 56px; overflow: hidden; text-align: center; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; }
.dateblock b { padding: 7px 0 9px; font-size: 22px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.dateblock small { padding: 5px 0; background: #F2F2F0; color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1; }
.dateblock.is-today b { color: var(--teal-ink); }
.dateblock.is-today small { background: var(--teal); color: #fff; }

/* Buttons and links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 999px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .15s; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 13px; }
.btn--block { display: flex; width: 100%; }
.btn--primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-ink); }
.btn--ghost { background: var(--card); border-color: var(--line-2); color: var(--teal-ink); }
.btn--ghost:hover { background: var(--teal-soft); }
.btn--danger { background: var(--card); border-color: var(--line-2); color: var(--red); }
.btn--danger:hover { background: var(--red-soft); }
.btn .count { background: rgba(255, 255, 255, .25); }
.link { display: inline-flex; align-items: center; gap: 2px; min-height: 40px; color: var(--teal-ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.link .icon { width: 16px; height: 16px; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); color: var(--ink-2); font-size: 12.5px; font-weight: 600; line-height: 1; white-space: nowrap; --c: var(--gray); }
.pill i { width: 8px; height: 8px; flex: 0 0 auto; border: 2px solid var(--c); border-radius: 50%; }
.pill--concept { --c: var(--gray); }
.pill--concept i { border-style: dashed; }
.pill--open { --c: var(--violet); }
.pill--nieuw { --c: var(--pink); }
.pill--bevestigd, .pill--goedgekeurd { --c: var(--green); }
.pill--kan_niet { --c: var(--red); }
.pill--afgewezen, .pill--geannuleerd { --c: var(--gray); }
.pill--conflict, .pill--mislukt { background: var(--red-soft); border-color: transparent; color: var(--red); }
.pill--conflict i, .pill--mislukt i { display: none; }

/* Positions */
.pos { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 500; --c: var(--pos-bar); }
.pos i, .dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--c); }
.pos--bar, .dot--bar { --c: var(--pos-bar); }
.pos--keuken, .dot--keuken { --c: var(--pos-keuken); }
.pos--bediening, .dot--bediening { --c: var(--pos-bediening); }
.pos--strand, .dot--strand { --c: var(--pos-strand); }
.badge-u18 { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); font-size: 11px; font-weight: 600; letter-spacing: 0; }

/* Avatars */
.avatar { display: inline-grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: hsl(var(--h) 70% 92%); color: hsl(var(--h) 55% 30%); font-size: 13px; font-weight: 600; }
.avatar--sm { width: 24px; height: 24px; font-size: 10px; }

.flash { margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--red-soft); color: var(--red); font-size: 14px; font-weight: 600; }
.flash--ok { background: var(--teal-soft); color: var(--teal-ink); }

/* Forms */
.form { display: grid; gap: 16px; }
@media (min-width: 700px) { .form { max-width: 560px; } }
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > span, .field legend { padding: 0; margin-bottom: 6px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.field input:not([type="radio"]):not([type="checkbox"]), .field select, .field textarea { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); }
.field.has-error input, .field.has-error select { border-color: var(--red); }
.field small.error { color: var(--red); font-size: 13px; font-weight: 500; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); font-size: 14px; font-weight: 600; cursor: pointer; }
.seg input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #F7F7F5; }
.seg input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--teal); }
.conflicts { display: grid; gap: 8px; }
.conflict { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--red-soft); border-radius: 12px; background: #FFF7F7; color: var(--ink-2); font-size: 14px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.form-actions .btn { flex: 1 1 140px; }

/* Heatmap */
.heat { display: grid; grid-template-columns: 36px repeat(7, minmax(0, 1fr)); gap: 6px; align-items: center; }
.heat__label { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.heat__day { color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
.heat__cell { display: grid; place-items: center; aspect-ratio: 1.6 / 1; border-radius: 10px; color: var(--ink-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; background: #F4F4F2; }
.heat--0 { background: #F4F4F2; color: var(--muted); }
.heat--1 { background: var(--heat-1); }
.heat--2 { background: var(--heat-2); }
.heat--3 { background: var(--heat-3); }
.heat--4 { background: var(--heat-4); color: #fff; }
.heat--5 { background: var(--heat-5); color: #fff; }
.heat-key { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 14px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.heat-key i { width: 88px; height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--heat-1), var(--heat-5)); }

/* Workload bars */
.load { display: grid; gap: 14px; list-style: none; margin: 0; padding: 0; }
.load__row { display: flex; align-items: center; gap: 12px; }
.load__main { flex: 1; min-width: 0; }
.load__top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 14px; }
.load__top b { min-width: 0; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.load__num { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.load__bar { height: 8px; overflow: hidden; border-radius: 999px; background: #EFEFED; }
.load__bar i { display: block; height: 100%; border-radius: 999px; background: #22252B; }
.load__row.is-over .load__bar i { background: var(--red); }
.load__row.is-over .load__num { color: var(--red); font-weight: 600; }

/* Owner week view */
.weekbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.weekbar h1 { margin: 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.daytabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.daytabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; padding: 8px 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--muted); text-decoration: none; }
.daytabs small { font-size: 11px; font-weight: 600; }
.daytabs b { color: var(--ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.daytabs a.is-today b { color: var(--teal-ink); }
.daytabs a.is-active { background: var(--ink); border-color: var(--ink); }
.daytabs a.is-active small, .daytabs a.is-active b { color: #fff; }
@media (min-width: 700px) { .daytabs { display: none; } }

.week { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.day { display: none; flex-direction: column; gap: 10px; min-width: 150px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.day.is-active { display: flex; }
.day__head { display: flex; align-items: baseline; gap: 6px; }
.day__name { color: var(--muted); font-size: 12px; font-weight: 600; }
.day__num { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.day.is-today .day__num { color: var(--teal-ink); }
.day__add { margin-left: auto; }
.btn.day__cancel { align-self: center; width: auto; min-height: 40px; margin-top: 8px; padding: 0 12px; border: 0; background: none; box-shadow: none; color: var(--muted); font-size: 13px; text-align: center; }
.btn.day__cancel:hover, .btn.day__cancel:focus-visible { background: none; color: var(--red); text-decoration: underline; }
@media (min-width: 700px) {
  .week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 4px; }
  .day { display: flex; }
  .day.is-active { display: flex; }
}
@media (min-width: 1000px) {
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); overflow: visible; }
}

.shift { display: block; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 14px; background: #F7F7F5; color: var(--ink); text-decoration: none; }
.shift:hover { border-color: var(--line-2); background: #F1F1EE; }
.shift--concept { background: var(--card); border-style: dashed; border-color: var(--gray); }
.shift--kan_niet { border-left-color: var(--red); }
.shift--open { border-left-color: var(--violet); }
.shift__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.shift__time { font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.shift__who { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.shift__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shift__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.leavechip { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: #EFEFED; color: var(--ink-2); font-size: 12px; font-weight: 600; }

.confirm { display: grid; justify-items: center; gap: 4px; max-width: 420px; margin: 0 auto; padding: 28px 20px; text-align: center; }
.confirm__num { font-size: 48px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.confirm__label { color: var(--muted); font-size: 15px; }
.confirm .btn { width: 100%; max-width: 360px; margin-top: 14px; }

/* Notifications and mail */
.notifs { overflow: hidden; margin: 0; padding: 0; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.notif { border-top: 1px solid var(--line); }
.notif:first-child { border-top: 0; }
.notif a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; color: var(--ink); text-decoration: none; }
.notif b { font-weight: 600; }
.notif.is-unread b::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--pink); vertical-align: 1px; }
.notif time { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
details.mail { padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); }
details.mail summary { color: var(--teal-ink); font-weight: 600; cursor: pointer; }
.mail__body { margin-top: 12px; color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
