:root {
  --bg: #f5f4f1; --panel: #fff; --ink: #1f2328; --muted: #6b7280; --line: #e3e0da;
  --accent: #1f4d3a; --accent-ink: #fff; --ok: #2f7d4f; --okbg: #e3f2e8;
  --warn: #b45309; --warnbg: #fdf0dc; --bad: #b42318; --badbg: #fde8e6; --draft: #eef0f3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a; --panel: #1d2125; --ink: #e8eaed; --muted: #9aa3ad; --line: #30363d;
    --accent: #5fb58a; --accent-ink: #0d1a13; --ok: #6fcf97; --okbg: #1c3327;
    --warn: #f0b35a; --warnbg: #3a2c14; --bad: #ff8a80; --badbg: #3d1f1c; --draft: #262b31;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); }
h1 { font-size: 1.4rem; margin: 0 0 .8rem; } h2 { font-size: 1.1rem; margin: 1.2rem 0 .5rem; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: .45rem .55rem; max-width: 100%; }
textarea { width: 100%; min-height: 4.5rem; }
button { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: .45rem .8rem; cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: var(--bad); }
button.small { padding: .2rem .5rem; font-size: .85rem; }
a { color: var(--accent); }
.muted { color: var(--muted); } .right { margin-left: auto; }

.topbar { background: var(--bar, #1c1f22); display: flex; justify-content: center; align-items: center; height: 46px; }
.topbar img { height: 20px; width: auto; display: block; }
.logo-text { font-family: Georgia, "Times New Roman", serif; letter-spacing: .3em; color: var(--bar-ink, #f5f5f5); font-size: 1rem; }
.shell { display: flex; min-height: calc(100vh - 46px); }
nav { width: 210px; background: var(--panel); border-right: 1px solid var(--line); padding: 1rem .6rem; display: flex; flex-direction: column; gap: .15rem; position: sticky; top: 0; height: calc(100vh - 46px); align-self: flex-start; }
nav .brand { font-weight: 700; padding: 0 .6rem .8rem; }
nav a { display: flex; justify-content: space-between; padding: .5rem .6rem; border-radius: 6px; text-decoration: none; color: var(--ink); }
nav a:hover { background: var(--bg); } nav a.on { background: var(--accent); color: var(--accent-ink); }
nav .spacer { flex: 1; } nav .who { padding: .4rem .6rem; font-size: .85rem; color: var(--muted); }
.badge { background: var(--bad); color: #fff; border-radius: 99px; padding: 0 .45rem; font-size: .75rem; line-height: 1.3rem; }
main { flex: 1; padding: 1.4rem; min-width: 0; max-width: 1400px; }
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  nav { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  nav .brand, nav .who { display: none; } nav .spacer { display: none; }
  main { padding: .9rem; }
}

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.pill { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .8rem; background: var(--draft); }
.pill.ok { background: var(--okbg); color: var(--ok); } .pill.warn { background: var(--warnbg); color: var(--warn); } .pill.bad { background: var(--badbg); color: var(--bad); }
.stat { display: flex; justify-content: space-between; padding: .25rem 0; border-bottom: 1px solid var(--line); }
.stat:last-child { border: 0; }

table { border-collapse: collapse; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
th, td { border-bottom: 1px solid var(--line); padding: .45rem .55rem; text-align: left; vertical-align: top; }
th { font-weight: 600; font-size: .85rem; color: var(--muted); background: var(--bg); }
tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }

table.plan { table-layout: fixed; min-width: 900px; }
table.plan td, table.plan th { border-right: 1px solid var(--line); }
table.plan th:first-child, table.plan td:first-child { width: 150px; }
.plan td { height: 78px; padding: .3rem; font-size: .82rem; cursor: pointer; }
.plan td.today, .plan th.today { box-shadow: inset 0 0 0 2px var(--accent); }
.av { font-size: .72rem; margin-bottom: .2rem; padding: 0 .3rem; border-radius: 4px; display: inline-block; }
.av.available { background: var(--okbg); color: var(--ok); } .av.unavailable { background: var(--badbg); color: var(--bad); } .av.none { color: var(--muted); }
.chip { display: block; background: var(--accent); color: var(--accent-ink); border-radius: 5px; padding: .1rem .35rem; margin-bottom: .2rem; cursor: pointer; }
.chip.draft { background: var(--draft); color: var(--ink); border: 1px dashed var(--muted); }
.total { font-size: .75rem; color: var(--muted); }

.task { display: flex; gap: .8rem; align-items: flex-start; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.task:last-child { border: 0; } .task .body { flex: 1; min-width: 0; } .task .title { font-weight: 600; }
.task.done .title { text-decoration: line-through; color: var(--muted); }

dialog { border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem; width: min(480px, 94vw); background: var(--panel); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.4); }
.field { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .7rem; } .field label { font-size: .85rem; color: var(--muted); }
.row { display: flex; gap: .6rem; } .row > * { flex: 1; }
.checks label { display: flex; gap: .4rem; align-items: center; color: var(--ink); font-size: .95rem; }
.actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.err { color: var(--bad); margin: .3rem 0; min-height: 1.2rem; }
.warnbox { background: var(--warnbg); color: var(--warn); border-radius: 8px; padding: .6rem .8rem; margin-bottom: 1rem; }

.login { max-width: 360px; margin: 10vh auto; } .login .card { padding: 1.5rem; }
#toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; }
#toast.show { opacity: 1; }

/* planning: week- en maandschema, slepen */
.seg { display: inline-flex; } .seg button { border-radius: 0; } .seg button:first-child { border-radius: 6px 0 0 6px; } .seg button:last-child { border-radius: 0 6px 6px 0; }
.palette { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; margin-bottom: 1rem; }
.person { display: inline-block; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: .25rem .8rem; margin: .15rem; cursor: grab; user-select: none; }
.person:active, .chip:active { cursor: grabbing; }
.person small { color: var(--muted); }
.week { display: grid; grid-template-columns: repeat(7, minmax(135px, 1fr)); gap: .5rem; min-width: 960px; }
.day, .mday { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .4rem; }
.day { min-height: 220px; } .day.today, .mday.today { box-shadow: inset 0 0 0 2px var(--accent); }
.day.over, .mday.over { outline: 2px dashed var(--accent); background: var(--okbg); }
.dh { display: flex; justify-content: space-between; align-items: center; margin-bottom: .3rem; font-size: .85rem; }
.dinfo { margin-top: .5rem; font-size: .75rem; color: var(--muted); } .dinfo div { margin-bottom: .15rem; }
.month { display: grid; grid-template-columns: repeat(7, minmax(100px, 1fr)); gap: 4px; min-width: 720px; }
.mhead { text-align: center; font-size: .8rem; color: var(--muted); } .mday { min-height: 100px; font-size: .78rem; } .mday.out { opacity: .45; }
.chip { cursor: grab; } .chip b { font-weight: 600; }
.avn { color: var(--ok); text-decoration: none; border-bottom: 1px dashed var(--ok); cursor: pointer; }
.avn:hover { background: var(--okbg); }
.avn.done { color: var(--muted); border-color: var(--muted); }
.mday .dinfo { font-size: .68rem; margin-top: .3rem; } .mday .av { padding: 0 .2rem; }

/* taken: bijlagen en verloop */
dialog.wide { width: min(700px, 96vw); max-height: 92vh; overflow: auto; }
.files { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; align-items: center; }
.thumb { height: 90px; width: auto; max-width: 160px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.filelink { border: 1px solid var(--line); border-radius: 6px; padding: .3rem .6rem; text-decoration: none; }
.resp { border-left: 3px solid var(--line); padding: .2rem 0 .2rem .7rem; margin: .6rem 0; }
.resp.review { border-color: var(--accent); }

/* opleiding & training */
.topic { margin-bottom: .8rem; } .topic summary { cursor: pointer; }
.titem { border-top: 1px solid var(--line); padding: .6rem 0; }
.titem video { width: 100%; max-height: 440px; background: #000; border-radius: 8px; display: block; margin-top: .4rem; }
.titem audio { width: 100%; margin-top: .4rem; }
iframe.embed { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; margin: .4rem 0; display: block; }

/* omzet: grafieken (reeksen 1-8 uit het gevalideerde standaardpalet; kleur volgt de winkel) */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948; --chart-grid: #e1e0d9; --chart-base: #c3c2b7; }
@media (prefers-color-scheme: dark) { :root { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767; --chart-grid: #2c2c2a; --chart-base: #383835; } }
.barchart { width: 100%; height: auto; display: block; }
.barchart .grid { stroke: var(--chart-grid); stroke-width: 1; } .barchart .baseline { stroke: var(--chart-base); stroke-width: 1; }
.barchart .axis { fill: var(--muted); font-size: 10px; } .barchart .valuelabel { fill: var(--ink); font-size: 11px; font-weight: 600; }
.chartcard { margin-bottom: 1rem; } .chartcard .dh { margin-bottom: .6rem; flex-wrap: wrap; gap: .4rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1rem; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.legends { display: flex; flex-wrap: wrap; gap: .3rem 1rem; } .legend { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hero { margin: .2rem 0 1rem; } .herofig { font-size: 3rem; font-weight: 700; line-height: 1.1; }
#chart-tip { position: fixed; display: none; z-index: 50; background: var(--ink); color: var(--bg); padding: .45rem .7rem; border-radius: 8px; font-size: .82rem; white-space: pre-line; pointer-events: none; box-shadow: 0 2px 10px rgba(0,0,0,.25); }

/* kleur per persoon */
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: .5rem; vertical-align: -1px; }
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.sw { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); }
.swatches input[type=color] { width: 36px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; }
.chip { font-weight: 500; }

/* taalkeuze */
.langs { display: inline-flex; gap: 2px; margin: .4rem .6rem; }
.langs button { padding: .15rem .5rem; font-size: .78rem; border-radius: 4px; }
.langs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.loginlang { text-align: right; margin-bottom: .5rem; } .loginlang .langs { margin: 0; }

/* gesloten dagen (zwart) en openingsuren */
.day.closed, .mday.closed { background: #111; border-color: #111; color: #f2f2f2; }
.day.closed .dh, .mday.closed .dh, .day.closed a, .mday.closed a { color: #f2f2f2; }
.day.closed .dh b { color: #fff; }
.closedtxt { font-size: .82rem; margin: .4rem 0; } .closedtxt small { opacity: .8; }
.hoursline { font-size: .75rem; color: var(--muted); margin-bottom: .3rem; }
table.avail tr.closedrow td { background: #111; color: #f2f2f2; border-color: #111; }

/* evaluaties */
.scorebar { display: inline-block; width: 110px; height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; vertical-align: middle; }
.scorebar i { display: block; height: 100%; border-radius: 5px; } .scorebar i.good { background: var(--ok); } .scorebar i.mid { background: #d9a400; } .scorebar i.low { background: var(--bad); }
.up { color: var(--ok); } .down { color: var(--bad); }
.evsum { position: sticky; top: -1rem; background: var(--panel); padding: .4rem 0; z-index: 2; font-weight: 600; }
fieldset.evq, .evq { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; margin: .6rem 0; }
.evopt { display: flex; gap: .5rem; align-items: baseline; padding: .2rem 0; cursor: pointer; }
.evans { padding: .1rem 0; color: var(--muted); } .evans.picked { color: var(--ink); font-weight: 600; }
fieldset.evq .row { margin-bottom: .3rem; }
@media print { body > *:not(dialog) { display: none !important; } dialog { position: static !important; width: auto !important; max-height: none !important; border: 0 !important; box-shadow: none !important; overflow: visible !important; } .noprint, [data-close] { display: none !important; } }
