/* Zendr v2 — licht: wit + neongroen accent; donker: zwart + donkerblauwe panelen. */

:root {
  --bg: #ffffff;
  --surface: #f5f7f6;
  --panel: #ffffff;
  --border: #e3e8e5;
  --text: #0c1512;
  --muted: #5f6b66;
  --accent: #5ffc71;
  --accent-soft: #e2fee6;
  --accent-ink: #063312;
  --danger: #e5484d;
  --danger-soft: #fdebec;
  --shadow: 0 1px 3px rgba(10, 25, 15, .08), 0 6px 24px rgba(10, 25, 15, .06);
  --radius: 10px;
  --font: 'Inter', system-ui, sans-serif;
  --font-display: 'Space Grotesk', var(--font);
  color-scheme: light;
}

html.dark {
  --bg: #000000;
  --surface: #060d18;
  --panel: #12294b;
  --border: #24406b;
  --text: #eef3f9;
  --muted: #93a5bd;
  --accent-soft: #123c1c;
  --accent-ink: #052b10;
  --danger-soft: #3d1518;
  --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 8px 28px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
h1, h2, h3 { font-family: var(--font-display); margin: 0 0 .5rem; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

/* ---- app-layout ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 208px; flex: none; padding: 20px 12px; border-right: 1px solid var(--border);
  background: var(--surface); display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.5px;
  padding: 4px 10px 18px; display: flex; align-items: center; gap: 8px;
}
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-weight: 500; border: none; background: none;
}
.nav-item:hover { color: var(--text); background: color-mix(in srgb, var(--panel) 70%, var(--border)); }
.nav-item.active { background: var(--accent); color: var(--accent-ink); }
.nav-item svg { width: 17px; height: 17px; flex: none; }
.sidebar .spacer { flex: 1; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 26px;
  border-bottom: 1px solid var(--border);
}
.topbar .station { font-family: var(--font-display); font-weight: 700; }
.topbar .grow { flex: 1; }
.content { padding: 24px 26px 60px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ---- basiscomponenten ---- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text); font-weight: 500;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { filter: brightness(.94); border-color: var(--accent); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: none; color: var(--muted); padding: 6px 8px; }
.btn-ghost:hover { color: var(--text); background: var(--surface); border-color: transparent; }
.btn-sm { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

label.field { display: block; margin-bottom: 12px; font-weight: 500; }
label.field > span { display: block; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input[type="color"] { padding: 2px; height: 38px; width: 60px; }
input[type="checkbox"] { width: auto; }
textarea { resize: vertical; min-height: 70px; }
.row { display: flex; gap: 12px; } .row > * { flex: 1; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.list td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list tr.clickable:hover td { background: var(--surface); cursor: pointer; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); }
.badge.live { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.color-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; }

.tabs { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.tabs button { border: none; background: none; padding: 6px 14px; border-radius: 7px; color: var(--muted); font-weight: 500; }
.tabs button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* ---- modal ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(4, 10, 6, .55); display: flex;
  align-items: flex-start; justify-content: center; padding: 7vh 16px; z-index: 50;
}
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); width: 520px; max-width: 100%; max-height: 84vh; overflow: auto; padding: 22px; }
.modal-head { display: flex; align-items: center; margin-bottom: 14px; }
.modal-head h2 { margin: 0; flex: 1; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.conflict-box { background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 13px; }

/* ---- toast ---- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px;
  box-shadow: var(--shadow); font-weight: 500; max-width: 80vw;
}
.toast.error { background: var(--danger); color: #fff; }

/* ---- dashboard ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat .num { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.onair { border-left: 5px solid var(--accent); }
.onair .title { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.progress { height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; background: var(--accent); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.bc-row { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-radius: 8px; text-decoration: none; }
.bc-row:hover { background: var(--surface); }
.bc-row .time { font-variant-numeric: tabular-nums; color: var(--muted); width: 92px; flex: none; font-size: 13px; }

/* ---- rooster ---- */
.cal-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); box-shadow: var(--shadow); }
.cal-days { display: grid; grid-template-columns: 52px repeat(7, 1fr); border-bottom: 1px solid var(--border); background: var(--surface); }
.cal-days .day { padding: 8px 6px; text-align: center; font-weight: 600; font-size: 13px; border-left: 1px solid var(--border); }
.cal-days .day.today { color: var(--accent-ink); background: var(--accent); }
html.dark .cal-days .day.today { color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.cal-scroll { height: 620px; overflow-y: auto; }
.cal-grid { display: grid; grid-template-columns: 52px repeat(7, 1fr); position: relative; height: 1440px; }
.cal-hours { position: relative; }
.cal-hours .hr { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--border); background: repeating-linear-gradient(to bottom, transparent 0 59px, var(--border) 59px 60px); cursor: copy; }
.cal-block {
  position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 4px 7px; overflow: hidden;
  font-size: 12px; line-height: 1.3; cursor: pointer; border: 1px solid rgba(0,0,0,.25);
  color: #08120b;
}
.cal-block b { display: block; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 5; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* ---- programma's ---- */
.prog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.prog-card { border-top: 4px solid var(--accent); display: flex; flex-direction: column; gap: 6px; }
.prog-card .actions { display: flex; gap: 6px; margin-top: auto; padding-top: 10px; }
.chip { display: inline-block; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; font-size: 12px; margin: 2px 3px 0 0; }

/* ---- draaiboek ---- */
.rundown-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.rundown-head .grow { flex: 1; min-width: 220px; }
.timing { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.timing .t-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--surface); border: 1px solid var(--border);
}
.timing .t-chip.ok { background: var(--accent-soft); border-color: var(--accent); }
.timing .t-chip.over { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

/* de lijst: items en blokkoppen in één stroom */
.rd-list { display: flex; flex-direction: column; gap: 10px; }
.block-letter {
  width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 14px; flex: none;
}
.sec-band {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); margin-top: 8px;
}
.rd-row:first-child .sec-band { margin-top: 0; }
.rd-row:has(.sec-band) .rd-gutter { padding-top: 14px; }
.sec-band .name { font-family: var(--font-display); font-weight: 700; font-size: 15px; min-width: 40px; }
.sec-band .b-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.sec-band .rd-actions { display: none; }
.sec-band:hover .rd-actions { display: inline-flex; }

/* itemkaarten */
.rd-row { display: grid; grid-template-columns: 58px 1fr 34px; gap: 8px; align-items: stretch; }
.rd-gutter { text-align: right; padding-top: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rd-gutter .num { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--text); display: block; }
.rd-gutter .at { font-size: 11.5px; }
.rd-card {
  position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px 12px; min-width: 0;
}
.rd-card.done { opacity: .62; }
.rd-card.done .rd-title { text-decoration: line-through; }
.rd-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
/* type-tag is een <select>: klikken = direct wijzigen */
.type-tag {
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  padding: 3px 9px; border-radius: 5px; flex: none;
  border: none; appearance: none; -webkit-appearance: none; cursor: pointer; width: auto;
  font-family: var(--font);
}
.type-tag.ITEM { background: #2f80ed; }
.type-tag.TRACK { background: #7c4dff; }
.type-tag.JINGLE { background: #00a89d; }
.type-tag.NEWS { background: #f2994a; }
.type-tag.COMMERCIALS { background: #eb5757; }
.type-tag option { background: var(--panel); color: var(--text); font-weight: 500; }
.rd-dur { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); font-weight: 600; }
.rd-card .rd-actions, .rd-actions { display: none; gap: 2px; }
.rd-card:hover .rd-actions { display: inline-flex; }
.rd-title { font-weight: 600; font-size: 14.5px; }
.rd-notes { color: var(--muted); font-size: 13px; white-space: pre-wrap; margin-top: 4px; max-width: 75ch; }

/* gast-koppeling is ook een <select>, gestyled als chip */
.guest-select {
  display: inline-block; margin-top: 8px; padding: 2px 9px; border-radius: 5px; font-size: 12.5px;
  border: 1px dashed var(--border); background: none; color: var(--muted); font-weight: 500;
  appearance: none; -webkit-appearance: none; cursor: pointer; width: auto; font-family: var(--font);
}
.guest-select.has {
  background: #ffe3c2; color: #7a4d00; font-weight: 600; border: 1px solid transparent;
}
html.dark .guest-select.has { background: #5b3d13; color: #ffd9a0; }
.guest-select option { background: var(--panel); color: var(--text); font-weight: 500; }

/* direct bewerkbare teksten */
.ed { border-radius: 5px; padding: 1px 4px; margin: -1px -4px; cursor: text; min-width: 24px; }
.ed:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ed:focus { outline: 2px solid var(--accent); background: var(--bg); }
.rd-notes.ed:empty::before { content: attr(data-ph); color: var(--muted); opacity: .55; }

.rd-add { display: flex; gap: 10px; margin-top: 2px; }

/* afvink-status in de rechterkantlijn (zoals het groene vinkje in de referentie) */
.status-toggle {
  align-self: flex-start; margin-top: 8px; width: 26px; height: 26px; border-radius: 7px;
  border: 1.5px solid var(--border); background: var(--panel); color: transparent;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.status-toggle:hover { border-color: var(--muted); color: var(--muted); }
.status-toggle.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.add-item-btn {
  border: 1.5px dashed var(--border); background: none; color: var(--muted); border-radius: 10px;
  padding: 7px; width: 100%; font-weight: 500;
}
.add-item-btn:hover { color: var(--text); border-color: var(--muted); }
.add-block-btn { width: 100%; justify-content: center; border-style: dashed; border-width: 1.5px; }

/* ---- live-modus ---- */
.live {
  position: fixed; inset: 0; z-index: 60; background: #04070c; color: #eef3f9;
  display: flex; flex-direction: column; padding: 4vh 6vw;
}
.live .top { display: flex; align-items: center; gap: 14px; color: #93a5bd; }
.live .clock { font-family: var(--font-display); font-size: 26px; font-variant-numeric: tabular-nums; margin-left: auto; }
.live .current { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1.5vh; }
.live .block-label { color: var(--accent); font-weight: 600; font-size: clamp(14px, 1.6vw, 18px); letter-spacing: .04em; }
.live .item-title { font-family: var(--font-display); font-size: clamp(30px, 5.4vw, 64px); font-weight: 700; line-height: 1.1; }
.live .countdown { font-family: var(--font-display); font-size: clamp(56px, 11vw, 140px); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); line-height: 1; }
.live .countdown.over { color: var(--danger); }
.live .notes { font-size: clamp(15px, 1.6vw, 20px); color: #b7c4d6; max-width: 70ch; white-space: pre-wrap; }
.live .next { border-top: 1px solid #1d2a3d; padding-top: 2vh; display: flex; align-items: baseline; gap: 12px; color: #93a5bd; }
.live .next b { color: #eef3f9; font-size: 18px; }
.live .keys { position: absolute; bottom: 12px; right: 18px; font-size: 12px; color: #5c6b80; }

/* ---- login ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--surface); padding: 20px; }
.auth-card { width: 400px; max-width: 100%; }
.auth-card .brand { justify-content: center; font-size: 30px; padding-bottom: 8px; }
.auth-switch { text-align: center; margin-top: 14px; font-size: 13px; }
.auth-switch button { background: none; border: none; color: inherit; text-decoration: underline; padding: 0; }
.form-error { color: var(--danger); font-size: 13px; margin: 6px 0; min-height: 18px; }
