:root {
  color-scheme: light;
  --bg: #f3f5fa;
  --surface: #ffffff;
  --border: #dfe5f2;
  --grid: #eef1f8;
  --text: #0d1839;
  --text-2: #4b5675;
  --muted: #4b5675;
  --accent: #1f3a93;
  --navy: #0d1839;
  --gemist: #e2736b;
  --gemist-tekst: #b3362f;
  --licht: #c9d3ee;
  --mail: #0f766e;
  --notitie: #7cc4bb;
  --werk: #8a6d1f;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --s4: #eda100;
  --bar: #1f3a93;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Red Hat Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 1240px; margin: 0 auto; padding: 0 20px 56px; }

.top { background: var(--navy); color: #fff; margin-bottom: 28px; }
.top-in {
  max-width: 1240px; margin: 0 auto; padding: 16px 20px;
  display: flex; align-items: center; gap: 14px 36px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font: 800 26px/1 "Red Hat Display", sans-serif; letter-spacing: -0.5px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 auto; }
.nav button {
  font: inherit; font-weight: 600; color: #fff; background: transparent; border: 0; cursor: pointer;
  padding: 10px 18px; border-radius: 999px; min-height: 44px;
}
.nav button:hover { background: rgba(255,255,255,.12); }
.nav button.on { background: #fff; color: var(--navy); }
.nav button:focus-visible, .btn-top:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.top-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.top-muted { color: #c9d3ee; font-size: 14px; }
.btn-top { font: inherit; color: #fff; background: transparent; border: 1px solid #6f7ba3; border-radius: 999px; padding: 8px 16px; cursor: pointer; min-height: 40px; }
.badge {
  font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px;
  background: var(--grid); color: var(--text-2); border: 1px solid var(--border);
}

h1 { font: 800 28px/1.2 "Red Hat Display", sans-serif; margin: 0 0 6px; }
h2 { font: 700 19px/1.3 "Red Hat Display", sans-serif; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.btn, .btn-ghost {
  font: inherit; cursor: pointer; border-radius: 8px; padding: 8px 14px;
}
.btn { background: var(--accent); color: #fff; border: 0; font-weight: 500; }
.btn-ghost { background: transparent; color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost.small { padding: 4px 10px; font-size: 12px; }
.btn-ghost:hover { color: var(--text); }

.login {
  max-width: 380px; margin: 10vh auto 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
}
.login form { display: grid; gap: 10px; margin-top: 16px; }
.login label { font-weight: 500; }
.login input {
  font: inherit; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.msg { min-height: 1.5em; margin: 12px 0 0; color: var(--text-2); }

.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button {
  font: inherit; font-size: 13px; padding: 6px 12px; border: 0; background: transparent;
  color: var(--text-2); cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--grid); color: var(--text); font-weight: 500; }
.field { display: inline-flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.field input, .field select {
  font: inherit; font-size: 14px; padding: 7px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); min-width: 180px;
}
.select select {
  font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.tile .label { color: var(--text-2); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.tile .value { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-bottom: 20px; min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.card p { margin: 0 0 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 .card { margin-bottom: 16px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; gap: 0; } }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--text-2); font-weight: 600; font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
table.klikbaar tbody tr { cursor: pointer; }
table.klikbaar tbody tr:hover td { background: var(--grid); }
table.klikbaar tbody tr.actief td { background: var(--grid); font-weight: 500; }
table.klikbaar tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
th { white-space: normal; vertical-align: bottom; }
tfoot td { font-weight: 600; border-top: 1px solid var(--border); border-bottom: 0; }
th.t, td.t { text-align: left; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button {
  font: inherit; font-size: 14px; padding: 8px 14px; border: 0; background: transparent; color: var(--text-2);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.inline-form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field input { min-width: 260px; }
.koppel { display: inline-flex; gap: 6px; align-items: center; }
.koppel select { font: inherit; font-size: 13px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); max-width: 220px; }
.login form + form { margin-top: 16px; }
.login .btn-ghost { margin-top: 2px; }

/* ---------- dashboard Klanten ---------- */
.kop { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.veld-label, .groot-veld > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.groot-veld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.groot-veld select {
  font: 700 24px/1.2 "Red Hat Display", sans-serif; color: var(--text); background: var(--surface);
  border: 2px solid var(--licht); border-radius: 14px; padding: 10px 16px; min-height: 56px; max-width: 100%;
}
.periode { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.periode p { margin: 0; font-size: 14px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.presets button {
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; min-height: 42px; padding: 0 16px;
  border-radius: 999px; border: 2px solid var(--licht); background: var(--surface); color: var(--text);
}
.presets button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.presets button:focus-visible, .uur:focus-visible, .link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.eigen { display: flex; gap: 12px; flex-wrap: wrap; }
.tiles.groot { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.tiles.groot .tile { border: 0; padding: 20px; }
.tiles.groot .tile .label { font-size: 13px; font-weight: 600; }
.tiles.groot .tile .value { font: 800 38px/1.15 "Red Hat Display", sans-serif; letter-spacing: -0.5px; }
.tiles.groot .tile .value.rood { color: var(--gemist-tekst); }
.tiles.groot .tile .sub { font-size: 13px; color: var(--text-2); }
.delta { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--grid); color: var(--text); }
.card { border: 0; }
.twee { display: flex; flex-wrap: wrap; gap: 20px; }
.twee .breed { flex: 999 1 540px; }
.twee .smal { flex: 1 1 300px; }
.legenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-2); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.uren { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: end; margin-top: 4px; }
.uur {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; min-width: 0;
  font: inherit; color: var(--text); background: transparent; border: 2px solid transparent; border-radius: 10px; padding: 4px 3px; cursor: pointer;
}
.uur:hover { background: var(--grid); }
.uur.on { border-color: var(--accent); background: var(--grid); }
.uur .tot { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-2); }
.uur .lab { text-align: center; font-size: 12px; color: var(--text-2); padding-top: 5px; }
.uur .b { display: block; }
.uur .b.o { background: var(--licht); border-radius: 5px 5px 0 0; }
.uur .b.g { background: var(--gemist); }
.uur .b.a { background: var(--accent); border-radius: 0 0 5px 5px; }
.balk { margin: 12px 0; }
.balk .rij { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.balk .rij b { font-weight: 600; }
.balk .spoor { height: 12px; border-radius: 999px; background: var(--grid); margin-top: 5px; }
.balk .vul { height: 12px; border-radius: 999px; }
.kader { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--grid); font-size: 14px; line-height: 1.5; }
.link { font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-align: left; min-height: 32px; }
.mini { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.mini .spoor { flex: 1; height: 9px; border-radius: 999px; background: #f6d9d6; }
.mini .vul { height: 9px; border-radius: 999px; background: var(--accent); }
tr.actief td { background: var(--grid); }
.btn.small { padding: 6px 14px; font-size: 13px; }
.leeg { padding: 28px 0; text-align: center; color: var(--text-2); }
[hidden] { display: none !important; }
.tiles.groot { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.card-head { flex-wrap: wrap; }
#kl-factuur-tabel td.t, #kl-factuur-tabel td.t .muted { white-space: normal; }

/* ---------- kiezer voor meer klanten ---------- */
.kiezer { position: relative; }
.kiezer > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  font: 700 24px/1.2 "Red Hat Display", sans-serif; color: var(--text); background: var(--surface);
  border: 2px solid var(--licht); border-radius: 14px; padding: 10px 16px; min-height: 56px; min-width: 260px; max-width: 100%;
}
.kiezer > summary::-webkit-details-marker { display: none; }
.kiezer > summary::after { content: ""; width: 10px; height: 10px; border-right: 3px solid var(--text-2); border-bottom: 3px solid var(--text-2); transform: rotate(45deg); margin: -4px 4px 0 0; flex: none; }
.kiezer[open] > summary { border-color: var(--accent); }
.kiezer > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kiezer .paneel {
  position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: min(560px, calc(100vw - 40px));
  background: var(--surface); border: 2px solid var(--licht); border-radius: 16px; padding: 18px;
  box-shadow: 0 18px 40px rgba(13, 24, 57, .18); display: flex; flex-direction: column; gap: 12px;
}
.kiezer .field input { min-width: 0; width: 100%; }
.kiezer .lijst { max-height: 320px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 14px; }
.vink { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; cursor: pointer; padding: 2px 4px; border-radius: 8px; }
.vink:hover { background: var(--grid); }
.vink input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.vink span { flex: 1; min-width: 0; }
.vink small { color: var(--text-2); font-variant-numeric: tabular-nums; }
.lijst-kop { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 10px 4px 2px; }

/* ---------- planning ---------- */
.raster { min-width: 820px; display: flex; flex-direction: column; gap: 6px; }
.raster .rij { display: grid; grid-template-columns: 120px repeat(10, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.raster .kopje { font-size: 12px; color: var(--text-2); text-align: center; }
.raster .dag { display: flex; flex-direction: column; justify-content: center; font-weight: 600; font-size: 14px; }
.raster .dag small { font-weight: 400; color: var(--text-2); font-size: 12px; }
.raster .cel { border-radius: 10px; padding: 8px 2px; text-align: center; display: flex; flex-direction: column; }
.raster .cel b { font: 700 19px/1.1 "Red Hat Display", sans-serif; }
.raster .cel small { font-size: 11px; }
.pil { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--grid); color: var(--text); white-space: nowrap; }
.pil.rood { background: #f8d9d6; color: #8a221c; }
.pil.geel { background: #fbe8c8; color: #5c3800; }
.pil.groen { background: #d7efe9; color: #0b5a4f; }
.pil.blauw { background: #dbe2f6; color: #0d1839; }
.tiles.groot .tile .value.klein { font-size: 26px; line-height: 1.25; }

/* ---------- team ---------- */
.schaal { position: relative; height: 26px; margin-top: 8px; }
.schaal .spoor { position: absolute; left: 0; right: 0; top: 10px; height: 6px; border-radius: 999px; background: var(--grid); }
.schaal .band { position: absolute; top: 10px; height: 6px; border-radius: 999px; background: #aab8e6; }
.schaal .midden { position: absolute; top: 3px; width: 4px; height: 20px; border-radius: 2px; background: var(--text-2); }
.schaal .punt { position: absolute; top: 3px; width: 20px; height: 20px; margin-left: -10px; border-radius: 999px; background: var(--accent); border: 3px solid #fff; }
.card.donker { background: var(--navy); color: #fff; }
.card.donker p { color: #dfe5f6; margin-top: 10px; line-height: 1.55; }

.rijkop { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; align-items: baseline; margin-top: 18px; font-size: 14px; }
.uur.vast { cursor: default; }
.uur.vast:hover { background: transparent; }
.uur .b.m { background: var(--mail); border-radius: 0 0 5px 5px; }
.uur .b.n { background: var(--notitie); border-radius: 5px 5px 0 0; }
.uur .b.w { background: var(--werk); border-radius: 5px; }
