:root {
  --accent: #0B6B5D;
  --accent-soft: #E3F1EE;
  --bg: #F5F6F4;
  --card: #FFFFFF;
  --text: #1C2421;
  --muted: #66716C;
  --line: #E2E5E2;
  --ok: #1E7A3E;   --ok-bg: #E4F4E8;
  --warn: #8A5A00; --warn-bg: #FFF2D6;
  --full: #A3312B; --full-bg: #FBE6E4;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #3FB8A2; --accent-soft: #163631;
    --bg: #111513; --card: #1B211E; --text: #E8EDEA; --muted: #98A39E; --line: #2A322E;
    --ok: #6FD08F; --ok-bg: #173322; --warn: #F2C063; --warn-bg: #3A2D10; --full: #F08A82; --full-bg: #3B1C19;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
h1 { font-size: 28px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
button, input, select { font: inherit; color: inherit; }
button {
  border: 1px solid var(--line); background: var(--card); border-radius: 10px;
  padding: 10px 14px; min-height: 44px; cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button:disabled { opacity: .5; }

.screen { max-width: 640px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 16px) 16px 16px; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.icon-btn { width: 44px; padding: 0; font-size: 20px; border-radius: 50%; }

.toolbar { position: sticky; top: 0; background: var(--bg); padding: 4px 0 8px; z-index: 2; }
input[type=search], input[type=text], input[type=password] {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-top: 10px; scrollbar-width: none; }
.chip { flex: none; border-radius: 999px; min-height: 36px; padding: 6px 14px; font-size: 14px; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.meta { color: var(--muted); font-size: 13px; margin: 6px 2px 10px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card.highlight { outline: 2px solid var(--accent); }
.card-head { display: flex; gap: 10px; align-items: flex-start; }
.card-title { font-weight: 650; flex: 1; }
.card-desc { color: var(--muted); font-size: 14px; margin: 6px 0 10px; white-space: pre-line; }
.card-foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-foot a { color: var(--accent); font-weight: 600; text-decoration: none; margin-left: auto; padding: 8px 0; }

.status { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status.open { color: var(--ok); background: var(--ok-bg); }
.status.nietopen { color: var(--warn); background: var(--warn-bg); }
.status.vol { color: var(--full); background: var(--full-bg); }
.status.onbekend { color: var(--muted); background: var(--line); }

.follow { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 999px; }
.follow.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.row:last-of-type { border-bottom: 0; }
.row select { max-width: 55%; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.row input[type=checkbox] { width: 24px; height: 24px; accent-color: var(--accent); }
.stack { display: grid; gap: 6px; padding-top: 10px; font-size: 14px; color: var(--muted); }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

.events { list-style: none; margin: 0; padding: 0; }
.events li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.events li:last-child { border-bottom: 0; }
.events time { display: block; color: var(--muted); font-size: 12px; }
.events a { color: inherit; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5;
}
.tabs a { flex: 1; text-align: center; padding: 8px 0 10px; color: var(--muted); text-decoration: none; font-size: 12px; }
.tabs a span { display: block; font-size: 22px; }
.tabs a.active { color: var(--accent); font-weight: 600; }

.login-box { max-width: 340px; margin: 12vh auto 0; text-align: center; display: grid; gap: 12px; justify-items: center; }
.login-box form { display: grid; gap: 12px; width: 100%; text-align: left; }
.login-box label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
.error { color: var(--full); margin: 0; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom));
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 10;
  max-width: 90vw;
}
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* Banenscherm */
.back { color: var(--accent); text-decoration: none; font-weight: 600; padding: 10px 0; }
.banen-title { font-size: 20px; line-height: 1.3; }
#dagen { margin: 6px 0 12px; }
.grid-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table.grid { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: 12px; }
table.grid th { font-weight: 600; color: var(--muted); padding: 4px 2px; text-align: center; }
table.grid th.serie, table.grid td.serie { text-align: left; white-space: nowrap; padding-left: 6px; }
table.grid td.serie b { display: block; font-size: 13px; color: var(--text); }
table.grid td.serie span { color: var(--muted); }
.cell {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-width: 38px; height: 44px; border-radius: 8px; padding: 2px; overflow: hidden;
  font-size: 10px; line-height: 1.1; word-break: break-word; text-decoration: none;
}
.cell.vrij { background: var(--ok-bg); color: var(--ok); font-weight: 700; font-size: 18px; border: 1px solid var(--ok); }
.cell.bezet { background: var(--line); color: var(--muted); }
.cell.pauze, .cell.leeg { background: repeating-linear-gradient(45deg, transparent 0 4px, var(--line) 4px 6px); color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin: 10px 2px; }
.legend .c { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -2px; }
.legend .c.vrij { background: var(--ok-bg); border: 1px solid var(--ok); }
.legend .c.bezet { background: var(--line); }
.legend .c.pauze { background: repeating-linear-gradient(45deg, transparent 0 3px, var(--muted) 3px 4px); }
.opm { color: var(--muted); font-size: 13px; padding-left: 18px; }
#banen-extern { color: var(--accent); font-weight: 600; text-decoration: none; }
