/* ============================================================
   THEMA — Ravi's opzetje (shadcn theme-editor, preset b5KcMrQNE):
   basis Mist, thema Blue, charts Sky, Inter, radius small, Lucide.
   Kleurwaarden letterlijk overgenomen; donker volgt het systeem.
   ============================================================ */
:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.148 0.004 228.8);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.148 0.004 228.8);
  --primary: oklch(0.488 0.243 264.376);
  --primary-foreground: oklch(0.97 0.014 254.604);
  --secondary: oklch(0.967 0.001 286.375);
  --secondary-foreground: oklch(0.21 0.006 285.885);
  --muted: oklch(0.963 0.002 197.1);
  --muted-foreground: oklch(0.56 0.021 213.5);
  --accent: oklch(0.963 0.002 197.1);
  --accent-foreground: oklch(0.218 0.008 223.9);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.925 0.005 214.3);
  --input: oklch(0.925 0.005 214.3);
  --ring: oklch(0.723 0.014 214.4);
  --chart-1: oklch(0.828 0.111 230.318);
  --chart-2: oklch(0.685 0.169 237.323);
  --chart-3: oklch(0.588 0.158 241.966);
  --chart-4: oklch(0.5 0.134 242.749);
  --chart-5: oklch(0.443 0.11 240.79);
  --radius: 0.45rem;
  --sidebar: oklch(0.987 0.002 197.1);
  --sidebar-foreground: oklch(0.148 0.004 228.8);
  --sidebar-primary: oklch(0.546 0.245 262.881);
  --sidebar-primary-foreground: oklch(0.97 0.014 254.604);
  --sidebar-accent: oklch(0.963 0.002 197.1);
  --sidebar-accent-foreground: oklch(0.218 0.008 223.9);
  --sidebar-border: oklch(0.925 0.005 214.3);

  /* afgeleiden voor planning-toestanden */
  --ok: oklch(0.627 0.17 149.2);
  --let-op: oklch(0.646 0.155 60.1);

  /* ontwerpsysteem: vaste schalen, overal dezelfde */
  --schaduw-1: 0 1px 2px 0 rgb(0 0 0 / .05);
  --schaduw-2: 0 1px 3px 0 rgb(0 0 0 / .07), 0 1px 2px -1px rgb(0 0 0 / .07);
  --schaduw-3: 0 10px 30px -10px rgb(0 0 0 / .15);
  --vlot: .15s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.148 0.004 228.8);
    --foreground: oklch(0.987 0.002 197.1);
    --card: oklch(0.218 0.008 223.9);
    --card-foreground: oklch(0.987 0.002 197.1);
    --primary: oklch(0.424 0.199 265.638);
    --primary-foreground: oklch(0.97 0.014 254.604);
    --secondary: oklch(0.274 0.006 286.033);
    --secondary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.275 0.011 216.9);
    --muted-foreground: oklch(0.723 0.014 214.4);
    --accent: oklch(0.275 0.011 216.9);
    --accent-foreground: oklch(0.987 0.002 197.1);
    --destructive: oklch(0.704 0.191 22.216);
    --border: oklch(1 0 0 / 10%);
    --input: oklch(1 0 0 / 15%);
    --ring: oklch(0.56 0.021 213.5);
    --sidebar: oklch(0.218 0.008 223.9);
    --sidebar-foreground: oklch(0.987 0.002 197.1);
    --sidebar-primary: oklch(0.623 0.214 259.815);
    --sidebar-primary-foreground: oklch(0.97 0.014 254.604);
    --sidebar-accent: oklch(0.275 0.011 216.9);
    --sidebar-accent-foreground: oklch(0.987 0.002 197.1);
    --sidebar-border: oklch(1 0 0 / 10%);
  }
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/inter.woff2') format('woff2');
}

/* ============================================================ */

* { box-sizing: border-box; margin: 0; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, system-ui, sans-serif;
  font-size: .875rem;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.stil { color: var(--muted-foreground); font-size: .82rem; }
.rij { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.ruimte { margin-top: 1.25rem; }

svg.icoon { width: 16px; height: 16px; flex: none; }

button, .klik, .kalender .dag, .lijst .item, label:has(input[type="checkbox"]) { cursor: pointer; }

/* --- opbouw: zijbalk links, inhoud op een licht-grijze ondergrond --- */

.opbouw { display: flex; min-height: 100vh; background: var(--muted); }

.zijbalk {
  width: 236px; flex: none;
  background: var(--sidebar); color: var(--sidebar-foreground);
  border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column; gap: .25rem;
  padding: .9rem .75rem;
  position: sticky; top: 0; height: 100vh;
}
.zijbalk .logo {
  display: flex; align-items: center; gap: .6rem;
  padding: .3rem .45rem .95rem;
}
.zijbalk .logo .beeldmerk {
  width: 30px; height: 30px; border-radius: calc(var(--radius) + 2px); flex: none;
  display: grid; place-items: center;
  background: var(--sidebar-primary); color: var(--sidebar-primary-foreground);
}
.zijbalk .logo .beeldmerk svg { width: 16px; height: 16px; }
.zijbalk .logo .naam { font-weight: 600; font-size: .875rem; line-height: 1.2; }
.zijbalk .logo .sub { font-size: .72rem; color: var(--muted-foreground); }
.zijbalk .kopje {
  font-size: .7rem; font-weight: 500; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: .05em;
  padding: .4rem .55rem .3rem;
}
.zijbalk nav { display: flex; flex-direction: column; gap: 2px; }
.zijbalk nav a {
  display: flex; align-items: center; gap: .6rem; height: 34px;
  padding: 0 .55rem; border-radius: var(--radius);
  color: var(--sidebar-foreground); font-size: .84rem; font-weight: 450;
  transition: background var(--vlot), color var(--vlot);
}
.zijbalk nav a:hover { background: var(--sidebar-accent); text-decoration: none; }
.zijbalk nav a.actief { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); font-weight: 550; }
.zijbalk nav a.actief svg { color: var(--sidebar-primary); }
.zijbalk nav svg { color: var(--muted-foreground); transition: color var(--vlot); }
.zijbalk .onder {
  margin-top: auto; border-top: 1px solid var(--sidebar-border);
  padding: .7rem .3rem 0; display: flex; align-items: center; gap: .55rem;
}
.zijbalk .avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: .72rem; font-weight: 600;
  background: color-mix(in oklch, var(--sidebar-primary) 12%, transparent);
  color: var(--sidebar-primary); text-transform: uppercase;
}
.zijbalk .onder .naam { font-size: .82rem; font-weight: 500; flex: 1; text-transform: capitalize; }
.zijbalk .onder button { padding: .3rem; border: none; background: none; color: var(--muted-foreground); }
.zijbalk .onder button:hover { color: var(--foreground); background: var(--sidebar-accent); border-radius: var(--radius); }

.inhoud { flex: 1; min-width: 0; padding: 1.6rem 2rem 4rem; max-width: 1180px; }
.paginakop { margin-bottom: 1.3rem; }
.paginakop h1 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.015em; }
.paginakop .stil { margin-top: .1rem; }

h2 { font-size: .875rem; font-weight: 600; letter-spacing: -0.005em; }
.kaart > h2, .kaart .kaartkop { margin-bottom: .8rem; }
.kaartkop { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }

/* mobiel: zijbalk wordt een uitklapbaar paneel */
.menuknop { display: none; }
@media (max-width: 720px) {
  .menuknop {
    display: grid; place-items: center; position: fixed; left: .8rem; top: .8rem; z-index: 30;
    width: 38px; height: 38px; padding: 0; background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--schaduw-2);
  }
  .zijbalk {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 20; height: 100dvh;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: var(--schaduw-3);
  }
  .zijbalk.open { transform: none; }
  .inhoud { padding: 3.8rem 1rem 3rem; }
}

/* --- kaarten --- */

.kaart {
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--schaduw-1);
}
.blokken > * + * { margin-top: 1rem; }
.kaart.klik { transition: border-color var(--vlot), box-shadow var(--vlot); }
.kaart.klik:hover { border-color: var(--ring); box-shadow: var(--schaduw-2); }

/* statustegels */
.tegels { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.tegel { position: relative; padding: 1rem 1.15rem; }
.tegel .naam {
  font-size: .78rem; font-weight: 500; color: var(--muted-foreground);
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.tegel .naam svg { color: var(--muted-foreground); opacity: .8; }
.tegel .waarde { font-size: 1.45rem; font-weight: 650; letter-spacing: -0.02em; margin-top: .35rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tegel .sub { font-size: .78rem; color: var(--muted-foreground); margin-top: .15rem; }
.tegel .sub.haast { color: var(--let-op); font-weight: 500; }

.kolommen { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
@media (max-width: 980px) { .kolommen { grid-template-columns: 1fr; } }

/* lijsten bínnen een kaart: rijen met scheidingslijnen, geen geneste kaarten */
.lijst { margin: 0 -1.25rem -1.1rem; }
.lijst .item {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem 1.25rem; border-top: 1px solid var(--border);
  transition: background var(--vlot);
}
.lijst .item:hover { background: color-mix(in oklch, var(--muted) 55%, transparent); }
.lijst .item:last-child { border-radius: 0 0 calc(var(--radius) + 3px) calc(var(--radius) + 3px); }
.lijst .item .stapicoon {
  width: 30px; height: 30px; border-radius: var(--radius); flex: none;
  display: grid; place-items: center;
  background: var(--muted); color: var(--muted-foreground);
}
.lijst .item .stapicoon svg { width: 15px; height: 15px; }
.lijst .item .tekst { flex: 1; min-width: 0; }
.lijst .item .tekst .kop { font-weight: 550; font-size: .84rem; }
.lijst .item .tekst .toelichting { font-size: .8rem; color: var(--muted-foreground); }
.lijst .item .pijl { color: var(--muted-foreground); opacity: 0; transition: opacity var(--vlot); }
.lijst .item:hover .pijl { opacity: 1; }

/* --- knoppen & invoer --- */

button, .knop {
  font: inherit; font-size: .84rem; font-weight: 500;
  color: var(--foreground); background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  height: 34px; padding: 0 .9rem;
  display: inline-flex; align-items: center; gap: .45rem;
  transition: background var(--vlot), border-color var(--vlot), box-shadow var(--vlot);
  box-shadow: var(--schaduw-1);
}
button:hover { background: var(--accent); }
button.primair { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
button.primair:hover { background: color-mix(in oklch, var(--primary) 88%, black); }
button:disabled { opacity: .5; cursor: default; box-shadow: none; }
button:disabled:hover { background: var(--primary); }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 2px;
}

input, select {
  font: inherit; font-size: .84rem; color: var(--foreground); background: var(--card);
  border: 1px solid var(--input); border-radius: var(--radius);
  height: 34px; padding: 0 .65rem;
  transition: border-color var(--vlot), box-shadow var(--vlot);
}
input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 25%, transparent); }
input::placeholder { color: var(--muted-foreground); }
input[type="range"] { padding: 0; height: auto; border: none; accent-color: var(--primary); }
input[type="checkbox"] { height: auto; accent-color: var(--primary); width: 15px; }
input[type="file"] { height: auto; padding: .35rem .5rem; }
label { font-size: .84rem; color: var(--muted-foreground); }

/* --- badges --- */

.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .72rem; font-weight: 500;
  padding: .12rem .55rem; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted-foreground); white-space: nowrap;
  background: var(--card); font-variant-numeric: tabular-nums;
}
.badge.ok      { color: var(--ok); border-color: color-mix(in oklch, var(--ok) 30%, transparent); background: color-mix(in oklch, var(--ok) 7%, transparent); }
.badge.dringend{ color: color-mix(in oklch, var(--let-op) 85%, black); border-color: color-mix(in oklch, var(--let-op) 35%, transparent); background: color-mix(in oklch, var(--let-op) 9%, transparent); }
.badge.te-laat { color: var(--destructive); border-color: color-mix(in oklch, var(--destructive) 35%, transparent); background: color-mix(in oklch, var(--destructive) 7%, transparent); }
.badge.accent  { color: var(--primary); border-color: color-mix(in oklch, var(--primary) 30%, transparent); background: color-mix(in oklch, var(--primary) 6%, transparent); }

.fouttekst { color: var(--destructive); font-size: .82rem; }

/* --- statusbalk --- */

.status { display: flex; align-items: center; gap: .7rem; margin: .5rem 0 .1rem; }
.status .balk { flex: 1; max-width: 220px; height: 5px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.status .balk > div { height: 100%; border-radius: 999px; background: var(--primary); }
.status .balk.wacht > div { background: var(--let-op); }
.status .label { font-size: .78rem; font-weight: 500; color: var(--muted-foreground); white-space: nowrap; }

/* --- kalenderrijen (komende publicaties) --- */

.kalender .datumblok {
  width: 44px; height: 44px; border-radius: var(--radius); flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--muted); line-height: 1.15;
}
.kalender .datumblok .dagnr { font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; }
.kalender .datumblok .maand { font-size: .64rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-foreground); }
.kalender .item .stip { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.kalender .item .stip.groen { background: var(--ok); }
.kalender .item .stip.oranje { background: var(--let-op); }

/* --- beeldkeuze-grid --- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .65rem; }
.grid .beeld {
  position: relative; border-radius: var(--radius); overflow: hidden;
  padding: 0; height: auto; background: var(--muted);
  border: 1px solid var(--border); box-shadow: none;
  transition: box-shadow var(--vlot), transform var(--vlot);
}
.grid .beeld:hover { transform: translateY(-1px); box-shadow: var(--schaduw-2); background: var(--muted); }
.grid .beeld img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.grid .beeld .nr {
  position: absolute; left: .4rem; top: .35rem; font-size: .7rem; font-weight: 500; color: #fff;
  background: rgb(0 0 0 / .5); padding: .04rem .42rem; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.grid .beeld.gekozen { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
.grid .beeld.gekozen::after {
  content: "✓"; position: absolute; right: .4rem; top: .3rem; color: var(--primary-foreground);
  background: var(--primary); border-radius: 50%; width: 1.25rem; height: 1.25rem;
  display: grid; place-items: center; font-weight: 700; font-size: .72rem;
}

/* --- tabellen --- */

table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th { text-align: left; color: var(--muted-foreground); font-weight: 500; font-size: .76rem; }
th, td { padding: .55rem .65rem; border-bottom: 1px solid var(--border); }
tbody tr { transition: background var(--vlot); }
tbody tr:hover { background: color-mix(in oklch, var(--muted) 55%, transparent); }
td.cijfer, th.cijfer { text-align: right; font-variant-numeric: tabular-nums; }
tr.totaal td { border-bottom: none; font-weight: 600; }
tr.totaal:hover { background: none; }
td .badge { font-size: .7rem; }

/* --- opslagmeter --- */

.meter { height: 8px; border-radius: 999px; background: var(--muted); overflow: hidden; display: flex; }
.meter > div { height: 100%; background: var(--chart-3); border-radius: 999px; }
.meter.vol > div { background: var(--destructive); }

/* --- login --- */

.login { min-height: 100vh; display: grid; place-items: center; background: var(--muted); padding: 1rem; }
.login .kaart { width: 350px; text-align: center; padding: 2.2rem 2rem; box-shadow: var(--schaduw-3); }
.login .beeldmerk {
  width: 42px; height: 42px; border-radius: calc(var(--radius) + 3px);
  display: grid; place-items: center; margin: 0 auto .8rem;
  background: var(--primary); color: var(--primary-foreground);
}
.login .beeldmerk svg { width: 20px; height: 20px; }
.login h1 { font-size: 1.05rem; font-weight: 600; margin-bottom: .2rem; }
.login .stil { margin-bottom: 1.4rem; }
.login form { display: grid; gap: .7rem; text-align: left; }
.login input { height: 38px; }
.login button { height: 38px; justify-content: center; }

/* --- script-leesweergave --- */

.leestekst {
  font-size: .9rem; line-height: 1.8;
  white-space: pre-wrap; background: var(--muted); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem 1.3rem; max-height: 60vh; overflow-y: auto;
  margin-top: .9rem; max-width: 75ch;
}

/* --- logboek --- */

.logboek { font-size: .8rem; margin: 0 -1.25rem -1.1rem; }
.logboek .regel { display: flex; gap: .9rem; padding: .45rem 1.25rem; border-top: 1px solid var(--border); }
.logboek .tijd { color: var(--muted-foreground); white-space: nowrap; font-variant-numeric: tabular-nums; }
.logboek .type { color: var(--muted-foreground); min-width: 74px; }

/* --- lege staat --- */

.leeg {
  display: grid; place-items: center; gap: .3rem; text-align: center;
  color: var(--muted-foreground); font-size: .84rem; padding: 1.6rem 1rem;
}
.leeg svg { width: 22px; height: 22px; opacity: .6; }

/* --- meldingen (toast) --- */

.melding {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: var(--card); color: var(--card-foreground);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .6rem 1.1rem; box-shadow: var(--schaduw-3); z-index: 40; max-width: 90vw;
  font-size: .84rem;
}
.melding.fout { border-color: var(--destructive); color: var(--destructive); }

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