/* Kimi Café rooster. Matcha, melk en een vleugje koffie. */
:root {
  --bg: #F1F4EC;
  --surface: #FFFFFF;
  --ink: #1C2A1F;
  --muted: #5F6B5B;
  --line: #D8DFCE;
  --matcha: #567628;
  --matcha-ink: #3B5418;
  --matcha-soft: #E2EBCF;
  --latte: #95622F;
  --latte-soft: #F3E5D3;
  --red: #A6382E;
  --red-soft: #F6DDD8;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
  --r-sm: 8px;
  --r: 14px;
  --tab-h: 64px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  min-height: 100vh;
}
a { color: var(--matcha-ink); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-weight: 700; }
p { margin: 0 0 .5rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.warn { color: var(--red); font-weight: 600; }
code { font-size: 1.05em; background: var(--matcha-soft); padding: .1em .4em; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--matcha); outline-offset: 2px; }
.ic { width: 22px; height: 22px; flex: none; }
[hidden] { display: none !important; }

/* ---------- Knoppen en formulieren ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .55rem 1.1rem;
  border: 1.5px solid transparent; border-radius: 999px;
  font: 600 .95rem/1 var(--font); text-decoration: none; cursor: pointer;
  background: var(--surface); color: var(--ink);
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--matcha-ink); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2F4513; }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: var(--matcha); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-sm { min-height: 36px; padding: .4rem .85rem; font-size: .875rem; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
form.inline { display: inline; }

label { display: grid; gap: .3rem; font-weight: 600; font-size: .925rem; }
label .muted, label .small { font-weight: 400; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: .6rem .8rem;
  font: 16px var(--font); color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-sm);
}
input:focus, select:focus, textarea:focus { border-color: var(--matcha); outline: none; box-shadow: 0 0 0 3px var(--matcha-soft); }
input[type="checkbox"], input[type="radio"] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--matcha-ink); }
label.check { display: flex; align-items: center; gap: .6rem; font-weight: 500; }
.stack { display: grid; gap: 1rem; }
.stack-sm { display: grid; gap: .5rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.input-euro { position: relative; display: block; }
.input-euro::before { content: "€"; position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-euro input { padding-left: 1.9rem; }

/* ---------- Meldingen en labels ---------- */
.flash { padding: .8rem 1rem; border-radius: var(--r-sm); margin-bottom: 1rem; font-weight: 500; }
.flash-ok { background: var(--matcha-soft); color: var(--matcha-ink); }
.flash-err { background: var(--red-soft); color: var(--red); }
.flash-latte { background: var(--latte-soft); color: #5E3A15; }
.badge {
  display: inline-block; padding: .2rem .6rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600; white-space: nowrap;
}
.badge-ok { background: var(--matcha-soft); color: var(--matcha-ink); }
.badge-latte { background: var(--latte-soft); color: var(--latte); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-muted { background: #ECEFE7; color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.count-pill { font: 600 .8rem var(--font); background: var(--matcha-soft); color: var(--matcha-ink); padding: .15rem .55rem; border-radius: 999px; vertical-align: middle; }
.empty { color: var(--muted); padding: 1rem 0; }

/* ---------- Tijdbalk: de signatuur van de app ---------- */
.bar {
  position: relative; height: 10px; margin-top: .7rem;
  background: repeating-linear-gradient(90deg, var(--matcha-soft) 0 calc(12.5% - 2px), transparent calc(12.5% - 2px) 12.5%);
  border-radius: 999px; overflow: hidden;
}
.bar span { position: absolute; top: 0; bottom: 0; background: var(--matcha); border-radius: 999px; }
.bar-scale { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: .2rem; font-variant-numeric: tabular-nums; }

/* ---------- Personeel: mobiele schil ---------- */
.area-staff .main { padding: 1rem 1rem calc(var(--tab-h) + 1.5rem + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font: 700 1.05rem var(--display); }
.brand small { display: block; font: 500 .75rem var(--font); color: var(--muted); }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--matcha-ink); color: #fff; font: 700 1.1rem var(--display);
}
.avatar {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--latte-soft); color: var(--latte); font-weight: 700; text-decoration: none;
}
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabs a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .74rem; font-weight: 600;
}
.tabs a[aria-current="page"] { color: var(--matcha-ink); }
.tabs a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--matcha); }
.count {
  position: absolute; top: 8px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--latte); color: #fff; font-size: .7rem; line-height: 18px; text-align: center;
}

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin: .5rem 0 1rem; }
.page-head p { margin: .2rem 0 0; }
.seg { display: inline-flex; background: #E3E8DA; border-radius: 999px; padding: 3px; }
.seg a { padding: .45rem 1rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; }
.seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(28, 42, 31, .12); }
.pager { display: flex; align-items: center; gap: .4rem; margin-bottom: 1rem; }
.pager-total { margin-left: auto; font-size: .875rem; color: var(--muted); font-weight: 600; }
.pager-total.link { color: var(--matcha-ink); }

.week { display: grid; gap: .25rem; }
.day { padding: .75rem 0; border-top: 1px solid var(--line); }
.day:first-child { border-top: 0; }
.day-label { font: 600 .95rem var(--font); margin-bottom: .5rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.day.is-past { opacity: .6; }
.today-pill { background: var(--matcha-ink); color: #fff; font-size: .72rem; padding: .1rem .5rem; border-radius: 999px; }
.day-free { color: var(--muted); margin: 0; font-size: .925rem; }
.shift {
  display: block; padding: .9rem 1rem; margin-bottom: .5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  text-decoration: none; color: var(--ink);
}
.shift:active { transform: scale(.99); }
.day.is-today .shift { border-color: var(--matcha); box-shadow: inset 4px 0 0 var(--matcha); }
.shift-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.shift-time { font: 700 1.35rem var(--display); font-variant-numeric: tabular-nums; }
.shift-hours { color: var(--muted); font-weight: 600; font-size: .9rem; }
.shift-note { margin: .6rem 0 0; font-size: .9rem; color: var(--muted); }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 1.5rem; }
.cal-head { text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); padding: .25rem 0; }
.cal-cell { min-height: 64px; padding: 4px; background: var(--surface); border-radius: var(--r-sm); font-size: .72rem; }
.cal-cell.is-blank { background: transparent; }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--matcha); }
.cal-cell.is-leave { background: repeating-linear-gradient(135deg, #fff 0 6px, #EEF1E8 6px 12px); }
.cal-num { display: block; font-weight: 600; color: var(--muted); }
.cal-cell.has-shift .cal-num { color: var(--ink); }
.cal-shift {
  display: block; margin-top: 3px; padding: 3px 4px; border-radius: 6px;
  background: var(--matcha); color: #fff; text-decoration: none; font-weight: 600; line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.cal-shift.is-pending { background: var(--latte); }
.section-title { font: 700 1.1rem var(--display); margin: 1.5rem 0 .75rem; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list-row { display: grid; grid-template-columns: 1fr auto auto; gap: .75rem; align-items: center; padding: .75rem 1rem; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.list-row:first-child { border-top: 0; }
.list-row-wrap { display: flex; flex-wrap: wrap; }

.team { display: grid; gap: .5rem; }
.team-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .85rem 1rem; }
.team-day.is-today { border-color: var(--matcha); }
.team-day .day-label { justify-content: space-between; }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.team-list li { display: grid; grid-template-columns: 1fr auto; column-gap: .75rem; align-items: baseline; }
.team-list .bar { grid-column: 1 / -1; margin-top: .3rem; height: 6px; }
.team-list li.is-mine .team-name { color: var(--matcha-ink); font-weight: 700; }
.team-name { font-weight: 600; }
.team-time { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }

.back { display: inline-flex; align-items: center; gap: .25rem; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: .75rem; }
.detail { padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.detail-time { font: 700 2.4rem var(--display); font-variant-numeric: tabular-nums; margin: .1rem 0 .25rem; }
.small-time { font-size: 1.25rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .75rem; margin: 1rem 0 0; }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem; margin-top: 1rem; }
.panel .section-title { margin-top: 0; }
.pending { background: var(--latte-soft); border-radius: var(--r-sm); padding: .9rem 1rem; display: grid; gap: .4rem; justify-items: start; }
.pending p { margin: 0; }
.history { margin-top: 1rem; font-size: .9rem; }
.history summary { cursor: pointer; font-weight: 600; color: var(--matcha-ink); }
.history ul { padding-left: 1.1rem; }
.history li { margin: .4rem 0; }
.copy { display: flex; gap: .5rem; margin-bottom: .75rem; }
.copy input { font-size: .8rem; }

.avail { display: grid; gap: .5rem; margin-bottom: 1rem; }
.avail-row { border: 0; padding: .6rem 0; margin: 0; border-bottom: 1px solid var(--line); display: grid; gap: .5rem; }
.avail-row legend { font-weight: 700; padding: 0; margin-bottom: .4rem; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { display: block; font-weight: 600; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: .5rem .95rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .9rem; }
.chip input:checked + span { background: var(--matcha-ink); border-color: var(--matcha-ink); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--matcha); outline-offset: 2px; }

/* ---------- Inloggen ---------- */
.area-public .main { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login { width: 100%; max-width: 380px; }
.login-title { font-size: 2.6rem; margin-bottom: .25rem; }
.login .stack { margin: 1.5rem 0 1rem; }
.login-mark { position: relative; height: 54px; margin-bottom: 1.25rem; }
.login-mark span { position: absolute; height: 12px; border-radius: 999px; background: var(--matcha); }
.login-mark span:nth-child(1) { top: 0; opacity: .45; }
.login-mark span:nth-child(2) { top: 20px; }
.login-mark span:nth-child(3) { top: 40px; background: var(--latte); }

/* ---------- Beheer ---------- */
.area-admin .main { padding: 1.25rem; }
.side { background: var(--matcha-ink); color: #E8EFDC; padding: 1rem; }
.side .brand { color: #fff; margin-bottom: 1rem; }
.side .brand small { color: #BFD0A3; }
.side .brand-mark { background: #fff; color: var(--matcha-ink); }
.side nav, .side-foot { display: flex; gap: .25rem; overflow-x: auto; }
.side a:not(.brand) {
  position: relative; display: flex; align-items: center; gap: .65rem; white-space: nowrap;
  padding: .6rem .8rem; border-radius: 10px; color: #DCE6CC; text-decoration: none; font-weight: 600; font-size: .925rem;
}
.side a:not(.brand):hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side a[aria-current="page"] { background: rgba(255, 255, 255, .14); color: #fff; }
.side .count { position: static; margin-left: auto; background: var(--latte-soft); color: var(--latte); }
.side-foot { margin-top: .5rem; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.block > .section-title:first-child { margin-top: 0; }
.cols { display: grid; gap: 1rem; }
.cols .block { margin-bottom: 0; }
.cols + .cols, .cols + .block, .block + .cols { margin-top: 1rem; }
.item { padding: .8rem 0; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; padding-top: 0; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.log li { font-size: .9rem; }

.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.block .tbl-wrap { border: 0; border-radius: 0; margin: 0 -1.25rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .925rem; }
.tbl th, .tbl td { padding: .7rem .9rem; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
.tbl thead th { border-top: 0; font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; background: #F7F9F3; }
.tbl tfoot th { background: #F7F9F3; }
.tbl-num td, .tbl-num th { font-variant-numeric: tabular-nums; }
.tbl tr.is-inactive td { opacity: .5; }
.tbl tr.is-selected td { background: var(--matcha-soft); }
.tbl tr.is-future td { color: var(--muted); }
.tbl .actions { white-space: nowrap; }
.tbl .actions .btn { margin: 2px 0; }
.is-changed { background: var(--latte-soft); }
.diff { font-weight: 700; color: var(--latte); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.up { color: var(--latte); }
.down { color: var(--matcha-ink); }
.decide { display: grid; gap: .4rem; min-width: 250px; }
.decide-times { display: grid; grid-template-columns: 1fr 1fr 70px; gap: .3rem; }
.decide input { min-height: 36px; padding: .35rem .5rem; font-size: .875rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; }
.stat-num { display: block; font: 700 1.6rem var(--display); font-variant-numeric: tabular-nums; }
.stat-lab { color: var(--muted); font-size: .875rem; }

.form-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: end; }
.span-all { grid-column: 1 / -1; }
.secret { background: var(--latte-soft); border: 1.5px dashed var(--latte); border-radius: var(--r); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.secret code { background: #fff; font-size: 1.15rem; }
.wage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.settings { display: grid; gap: 0; max-width: 900px; }
.settings > .btn { justify-self: start; }
.hours { display: grid; gap: .5rem; }
.hours-row { display: grid; grid-template-columns: 110px 1fr 1fr auto; gap: .5rem; align-items: center; }

/* Planner */
.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .825rem; color: var(--muted); margin-bottom: .75rem; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.lg-pub { background: var(--matcha); }
.lg-con { border: 2px dashed var(--matcha); }
.lg-chg { background: var(--latte); }
.lg-off { background: repeating-linear-gradient(135deg, #fff 0 3px, #DDE3D3 3px 6px); border: 1px solid var(--line); }
.planner-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.planner { border-collapse: collapse; width: 100%; min-width: 1050px; table-layout: fixed; }
.planner th, .planner td { border-left: 1px solid var(--line); border-top: 1px solid var(--line); vertical-align: top; }
.planner thead th { border-top: 0; padding: .6rem .5rem; text-align: left; background: #F7F9F3; }
.planner thead th.is-today { background: var(--matcha-soft); }
.planner .p-name { position: sticky; left: 0; z-index: 2; width: 170px; padding: .6rem .75rem; text-align: left; background: #F7F9F3; border-left: 0; }
.p-name span { display: block; }
.p-name > span:first-child { font-weight: 700; }
.p-hours { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.p-hours.over { color: var(--latte); font-weight: 700; }
.p-note { font-size: .74rem; color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-day { display: block; font-weight: 700; }
.p-open { display: block; font-size: .75rem; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.p-cell { padding: .35rem; height: 76px; }
.p-cell.is-off { background: repeating-linear-gradient(135deg, #fff 0 6px, #F0F3EA 6px 12px); }
.p-tag { display: block; font-size: .72rem; color: var(--muted); margin-bottom: .25rem; }
.p-shift {
  display: block; width: 100%; text-align: left; margin-bottom: .3rem; padding: .4rem .5rem;
  border: 2px solid var(--matcha); border-radius: var(--r-sm); background: var(--matcha); color: #fff;
  font: 500 .8rem/1.3 var(--font); cursor: pointer; font-variant-numeric: tabular-nums;
}
.p-shift strong { display: block; font-size: .88rem; }
.p-shift span { display: block; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-shift.is-concept { background: #fff; color: var(--matcha-ink); border-style: dashed; }
.p-shift.has-change { background: var(--latte); border-color: var(--latte); color: #fff; }
.p-shift.was-changed strong::after { content: " ✓"; }
.p-add {
  display: block; width: 100%; min-height: 28px; border: 1.5px dashed transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--muted); font-size: 1.1rem; cursor: pointer;
}
.p-cell:hover .p-add, .p-add:focus-visible { border-color: var(--line); background: rgba(255, 255, 255, .7); }
.p-cover { padding: .5rem; font-size: .78rem; color: var(--muted); background: #F7F9F3; }
.p-cover span { display: block; }
.p-cover .gap { color: var(--red); font-weight: 600; margin-top: .2rem; }

.dialog { border: 0; border-radius: var(--r); padding: 1.5rem; width: min(440px, calc(100vw - 2rem)); box-shadow: 0 20px 60px rgba(28, 42, 31, .25); }
.dialog::backdrop { background: rgba(28, 42, 31, .4); }
.dialog-title { font-size: 1.3rem; }
.dialog-actions .btn-danger { margin-left: auto; }
.worked-note { background: var(--latte-soft); color: #5E3A15; padding: .6rem .8rem; border-radius: var(--r-sm); font-size: .875rem; margin: 0; }

@media (min-width: 900px) {
  .area-admin { display: grid; grid-template-columns: 230px 1fr; }
  .side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 1.25rem 1rem; }
  .side nav, .side-foot { flex-direction: column; overflow: visible; }
  .side-foot { margin-top: auto; }
  .area-admin .main { padding: 2rem 2.25rem; min-width: 0; }
  .cols { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
