/* Voorwerk Planbord — de app. Tokens uit DESIGN.md (app-*). */
@font-face { font-family: "Instrument Sans"; src: url("/fonts/instrument-sans-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --brand: #084c4f; --brand-ink: #063a3c; --on-brand: #fff;
  --ink: #13201f; --muted: #5a6a68; --line: #e8efed; --line-2: #d5dedb;
  --panel: #fff; --bg: #f5f7f7; --sunk: #eef4f2;
  --ok: #1f7a41; --ok-soft: #e6f4ea; --let-op: #b5620a; --let-op-soft: #fff3e0;
  --alarm: #c0261c; --alarm-soft: #ffe9e7; --info: #3f6f9e; --info-soft: #e2f2ff;
  --weekend: #f0f3f2; --vandaag: #c0261c;
  --dag: 34px; --links: 260px; --rij: 30px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #3aa39c; --brand-ink: #7fd1ca; --on-brand: #04201f;
    --ink: #e7eeec; --muted: #9db0ad; --line: #22302e; --line-2: #2f403d;
    --panel: #131c1b; --bg: #0d1413; --sunk: #172321;
    --ok-soft: #13301f; --let-op-soft: #33230e; --alarm-soft: #3a1512; --info-soft: #132a3d;
    --weekend: #111a19; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 13px/1.5 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
.laden, .leeg { padding: 40px; color: var(--muted); text-align: center; }

/* Knoppen en velden */
.knop { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 7px;
  border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--ink); }
.knop:hover { background: var(--sunk); }
.knop:focus-visible, .ico:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .blok:focus-visible, .regelnaam:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 1px; }
.knop.hoofd { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 600; }
.knop.hoofd:hover { background: var(--brand-ink); }
.knop.gevaar { color: var(--alarm); }
.knop[disabled] { opacity: .5; cursor: not-allowed; }
.ico { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; font-size: 18px; color: var(--muted); }
.ico:hover { background: var(--sunk); color: var(--ink); }
label.veld { display: grid; gap: 4px; margin-bottom: 12px; font-weight: 600; font-size: 12.5px; }
label.veld span.uitleg { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--panel); font-weight: 400; }
textarea { height: auto; min-height: 120px; padding: 8px 10px; font-family: var(--mono); font-size: 12px; }
input[type=color] { width: 40px; height: 32px; border: 1px solid var(--line-2); border-radius: 7px; padding: 2px; background: var(--panel); }
.rij2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fout { color: var(--alarm); background: var(--alarm-soft); padding: 8px 10px; border-radius: 7px; margin: 0 0 12px; }
.ok { color: var(--ok); background: var(--ok-soft); padding: 8px 10px; border-radius: 7px; margin: 0 0 12px; }

/* Inloggen */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-kaart { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; }
.auth-kaart h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.01em; }
.auth-kaart p.sub { color: var(--muted); margin: 0 0 20px; }
.merk { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 20px; color: var(--brand); text-decoration: none; }
.merk img { width: 26px; height: 26px; }
.tabs { display: flex; gap: 4px; background: var(--sunk); padding: 3px; border-radius: 8px; margin-bottom: 18px; }
.tabs button { flex: 1; height: 30px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected=true] { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.auth-kaart .knop.hoofd { width: 100%; justify-content: center; height: 38px; }
.linkknop { border: 0; background: none; color: var(--brand); cursor: pointer; padding: 0; text-decoration: underline; }

/* Bovenbalk */
.balk { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.balk .merk { margin: 0 8px 0 0; }
.balk .naam { font-weight: 600; font-size: 14px; margin-right: auto; display: flex; align-items: center; gap: 6px; }
.balk select.ws { width: auto; height: 30px; font-weight: 600; }
.groep { display: inline-flex; gap: 4px; align-items: center; }
.week-label { min-width: 150px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.band { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.band.proef { background: var(--info-soft); }
.band.op { background: var(--let-op-soft); }
.band.alarm { background: var(--alarm-soft); }
.band .knop { height: 28px; }

/* Soortenpalet */
.palet { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.palet .label { color: var(--muted); margin-right: 4px; }
.soort { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line-2);
  background: var(--panel); cursor: pointer; }
.soort i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.soort[aria-pressed=true] { border-color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--ink); }

/* Het bord */
.bord-wrap { overflow: auto; height: calc(100vh - 150px); background: var(--panel); position: relative; }
.bord { position: relative; min-width: max-content; }
.kop { position: sticky; top: 0; z-index: 6; display: flex; background: var(--panel); border-bottom: 1px solid var(--line-2); }
.kop .hoek { position: sticky; left: 0; z-index: 7; width: var(--links); min-width: var(--links); background: var(--panel);
  border-right: 1px solid var(--line-2); display: flex; align-items: flex-end; padding: 6px 10px; color: var(--muted); font-weight: 600; }
.kop .weken { display: flex; flex-direction: column; }
.kop .wk-rij, .kop .dag-rij { display: flex; }
.kop .wk { border-left: 1px solid var(--line-2); padding: 4px 6px; font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; }
.kop .dg { width: var(--dag); text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0 4px; border-left: 1px solid var(--line); line-height: 1.25; }
.kop .dg.we { background: var(--weekend); }
.kop .dg.nu { color: var(--vandaag); font-weight: 700; }
.kop .dg b { display: block; font-family: var(--mono); font-weight: 500; color: var(--ink); font-size: 11.5px; }
.kop .dg.nu b { color: var(--vandaag); }

.groepkop { position: sticky; left: 0; display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--sunk); border-bottom: 1px solid var(--line); width: 100%; }
.rij { display: flex; border-bottom: 1px solid var(--line); }
.rij:hover .regelnaam { background: var(--sunk); }
.regelnaam { position: sticky; left: 0; z-index: 4; width: var(--links); min-width: var(--links); background: var(--panel); border: 0;
  border-right: 1px solid var(--line-2); text-align: left; padding: 4px 10px; cursor: pointer; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.regelnaam .code { font-family: var(--mono); font-size: 11.5px; font-weight: 600; }
.regelnaam .wat { display: block; color: var(--muted); font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.regelnaam .code { display: block; line-height: 1.3; }
.baan { position: relative; flex: none; }
.baan .raster { position: absolute; inset: 0; display: flex; pointer-events: none; }
.baan .raster span { width: var(--dag); border-left: 1px solid var(--line); flex: none; }
.baan .raster span.we { background: var(--weekend); }
.nu-lijn { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--vandaag); opacity: .55; z-index: 3; pointer-events: none; }

.blok { position: absolute; height: 22px; border-radius: 5px; color: #fff; font-size: 11.5px; font-weight: 600; line-height: 22px; padding: 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; z-index: 2; border: 0; text-align: left; touch-action: none;
  box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.blok:active { cursor: grabbing; }
.blok .greep { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.blok.sleept { opacity: .85; z-index: 5; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.alleen-lezen .blok { cursor: pointer; }
.alleen-lezen .blok .greep { display: none; }
.leegbord { padding: 40px 20px; text-align: center; color: var(--muted); }

/* Dialoog */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--panel); color: var(--ink);
  box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10,20,20,.35); }
.dlg-kop { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 6px; }
.dlg-kop h2 { margin: 0; font-size: 16px; }
#dlg-inhoud { padding: 8px 18px; max-height: 65vh; overflow: auto; }
.dlg-voet { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.dlg-voet .links { margin-right: auto; }
.lijst { list-style: none; padding: 0; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 8px; }
.lijst li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.lijst li:last-child { border-bottom: 0; }
.lijst .grow { flex: 1; min-width: 0; }
.lijst .klein { color: var(--muted); font-size: 12px; }
.pakketten { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.pakket { border: 1px solid var(--line-2); border-radius: 10px; padding: 14px; }
.pakket h3 { margin: 0; font-size: 15px; }
.pakket .prijs { font-size: 22px; font-weight: 700; margin: 4px 0; }
.pakket .knop { width: 100%; justify-content: center; margin-top: 8px; }
code.link { display: block; padding: 8px; background: var(--sunk); border-radius: 6px; font-size: 11.5px; word-break: break-all; margin: 6px 0; }
small.uitleg, p.uitleg { color: var(--muted); }

#melding { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 50; background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }

@media (max-width: 720px) {
  :root { --links: 150px; --dag: 30px; }
  .balk .merk span { display: none; }
  .week-label { min-width: 0; }
  .pakketten, .rij2 { grid-template-columns: 1fr; }
  .bord-wrap { height: calc(100vh - 190px); }
}
.knop.hoofd.gevaar-vol { background: var(--alarm); border-color: var(--alarm); }
#bevestig { width: min(420px, calc(100vw - 32px)); }
