:root {
  --red: #b42318;
  --red-dark: #8f1c13;
  --bg: #f4f5f7;
  --card: #fff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --green: #16a34a;
  --radius: 1rem;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }
.auth-gate, .app-shell { min-height: 100vh; }
.auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.card {
  background: var(--card);
  border-radius: 1.25rem;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--red);
  padding: 1.5rem;
  width: min(26rem, 100%);
}
.card h1 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.hint { color: var(--muted); font-size: 0.8rem; margin: 0 0 1rem; }
.stack { display: flex; flex-direction: column; gap: 0.7rem; }
label { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
input, select, textarea {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  font: inherit;
  background: #fff;
}
textarea { min-height: 4.5rem; }
.btn-text {
  margin-top: 0.4rem;
  padding: 0.75rem 1rem;
  border: 0;
  border-radius: 0.75rem;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.error { color: var(--red); font-size: 0.85rem; }
.navbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 800; }
.brand img { width: 2.25rem; height: 2.25rem; border-radius: 0.65rem; }
.nav-actions, .icon-row { display: flex; gap: 0.35rem; align-items: center; }
.icon-btn {
  width: 2.5rem; height: 2.5rem;
  border: 0; border-radius: 0.75rem;
  background: #f3f4f6; color: #374151;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn svg { width: 1.2rem; height: 1.2rem; stroke: currentColor; fill: none; stroke-width: 2; }
.icon-btn.is-active { background: var(--red); color: #fff; }
.icon-btn.danger { color: var(--red); }
.wrap { max-width: 42rem; margin: 0 auto; padding: 1rem 1rem 5rem; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.cal-title { font-weight: 800; }
.home-switch { margin-bottom: 0.75rem; }
.home-prog { margin-bottom: 1.1rem; }
.home-prog-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem; margin: 0 0 0.55rem;
}
.home-prog-head h2 { margin: 0; font-size: 1rem; }
.home-card { cursor: pointer; width: 100%; text-align: left; font: inherit; color: inherit; border: 0; display: block; }
.home-card.is-mine { box-shadow: var(--shadow), inset 3px 0 0 var(--red); }
.weekdays, .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.25rem; }
.weekdays span { text-align: center; font-size: 0.65rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.day {
  aspect-ratio: 1; border: 0; border-radius: 0.7rem; background: #fff;
  position: relative; cursor: pointer; font-size: 0.8rem; color: var(--ink);
}
.day.out { color: #d1d5db; }
.day.has::after {
  content: ""; position: absolute; bottom: 0.28rem; left: 50%; transform: translateX(-50%);
  width: 0.38rem; height: 0.38rem; border-radius: 50%; background: var(--red);
}
.day.today { outline: 2px solid var(--red); }
.filters label { display: flex; flex-direction: column; gap: 0.2rem; }
.filters select { width: auto; min-width: 8rem; }
.icon-btn-mini { width: 2rem; height: 2rem; border-radius: 0.55rem; }
.icon-btn-mini svg { width: 1rem; height: 1rem; }
.pick-row { display: flex; align-items: center; gap: 0.3rem; }
.pick-row .indeling-pick { flex: 1; }
.pick-actions { display: flex; gap: 0.15rem; }
a.icon-btn { text-decoration: none; }
.qr-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: 0.6rem; margin-top: 0.7rem; }
.qr-panel.hidden { display: none; }
.qr-item { background: #f9fafb; border-radius: 0.75rem; padding: 0.5rem; text-align: center; }
.qr-item p { margin: 0 0 0.35rem; font-size: 0.7rem; font-weight: 700; color: var(--muted); }
.qr-item svg { width: 100%; height: auto; }
.moment-edit { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.view-title { margin: 0 0 0.75rem; font-size: 1.15rem; }
#leergangPosten {
  max-height: min(22rem, 50vh);
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.2rem 0.55rem;
  background: #f9fafb;
}
#leergangPosten.has-posts { display: grid; grid-template-columns: 1fr; }
.leergang-post { border-bottom: 1px solid var(--line); padding: 0.4rem 0; min-width: 0; }
.leergang-post-head {
  display: flex; align-items: flex-start; gap: 0.45rem;
  margin: 0; cursor: pointer;
  text-transform: none; letter-spacing: 0;
  font-size: 0.85rem; font-weight: 600; color: var(--ink);
}
.leergang-post-head input[type="checkbox"] {
  width: 1.15rem; height: 1.15rem; margin: 0.15rem 0 0;
  flex: 0 0 auto; accent-color: var(--red);
}
.leergang-post-name { min-width: 0; line-height: 1.25; }
.leergang-post-meta {
  display: block; font-size: 0.7rem; font-weight: 500;
  color: var(--muted); text-transform: none; letter-spacing: 0;
}
.leergang-post:not(.is-on) .bezoeken { display: none; }
.bezoeken { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.35rem 0 0 1.6rem; }
.bezoek-row { display: flex; align-items: center; gap: 0.3rem; }
.bezoek-row input { width: auto; margin-top: 0; padding: 0.4rem 0.5rem; }
.bezoek-row input[type="date"] { flex: 1; min-width: 0; }
.bezoek-row input[data-tijd] { width: 5.5rem; flex: 0 0 5.5rem; }
.contact-slot { margin-bottom: 0.45rem; }
.contact-label { margin: 0 0 0.3rem; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.contact-row { display: grid; grid-template-columns: 1fr; gap: 0.35rem; }
@media (min-width: 800px) {
  #leergangPosten.has-posts { grid-template-columns: 1fr 1fr; column-gap: 0.85rem; max-height: min(28rem, 55vh); }
  .contact-row { grid-template-columns: 1fr 1fr; }
}
.import-details summary { cursor: pointer; font-weight: 700; }
.import-details .hint { margin-top: 0.6rem; }
.inline-add .icon-row { margin-top: 0.25rem; }
.inline-add input { flex: 1; margin-top: 0; }
.date-tabs { display: flex; gap: 0.4rem; overflow-x: auto; padding: 0.25rem 0 0.75rem; }
.date-tab {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff;
  border-radius: 0.7rem; padding: 0.45rem 0.7rem; font-size: 0.75rem; font-weight: 700; cursor: pointer;
}
.date-tab.is-active { background: #111827; color: #fff; border-color: #111827; }
.moment-card {
  background: #fff; border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); margin-bottom: 0.75rem;
}
.moment-card h2 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.meta { color: var(--muted); font-size: 0.8rem; margin: 0 0 0.7rem; }
.people { font-size: 0.85rem; margin: 0.4rem 0; }
.indeling-editor { margin-top: 0.7rem; display: flex; flex-direction: column; gap: 0.65rem; }
.indeling-label {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.75rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin: 0 0 0.35rem;
}
.indeling-picks { display: flex; flex-direction: column; gap: 0.3rem; }
.indeling-empty { margin: 0; font-size: 0.8rem; color: var(--muted); }
.indeling-pick {
  display: flex; align-items: center; gap: 0.45rem;
  width: 100%; text-align: left;
  border: 1px solid var(--line); border-radius: 0.75rem;
  background: #fff; padding: 0.4rem 0.55rem;
  cursor: pointer; font: inherit; color: inherit;
}
.indeling-pick.is-selected {
  border-color: var(--red);
  background: #fef2f2;
  box-shadow: inset 3px 0 0 var(--red);
}
.pick-name { font-size: 0.9rem; }
.mini-thumb {
  width: 1.45rem; height: 1.45rem; flex: 0 0 auto;
  border-radius: 0.4rem;
  border: 1.5px solid #d1d5db;
  background: #f9fafb;
  color: #6b7280;
  display: inline-flex; align-items: center; justify-content: center;
}
.mini-thumb svg {
  width: 0.85rem; height: 0.85rem;
  fill: none; stroke: currentColor; stroke-width: 2.4;
  stroke-linejoin: round; stroke-linecap: round;
}
.mini-thumb.is-yes { background: #dcfce7; border-color: #16a34a; color: #15803d; }
.mini-thumb.is-no { background: #fee2e2; border-color: #dc2626; color: #b91c1c; }
.mini-thumb.is-yes svg, .mini-thumb.is-no svg { fill: currentColor; }
.mini-thumb.is-open::after {
  content: "";
  width: 0.35rem; height: 0.35rem;
  border-radius: 50%;
  background: #9ca3af;
}
.beheer-block { background: #fff; border-radius: var(--radius); padding: 1rem; margin-bottom: 0.8rem; box-shadow: var(--shadow); }
.beheer-block h2, .beheer-title { margin: 0; font-size: 0.95rem; font-weight: 700; }
.beheer-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  cursor: pointer; list-style: none;
}
.beheer-summary::-webkit-details-marker { display: none; }
.beheer-chevron { flex: 0 0 auto; pointer-events: none; transition: transform 0.15s ease; }
.beheer-block[open] > .beheer-summary .beheer-chevron { transform: rotate(90deg); }
.beheer-body { margin-top: 0.65rem; }
.list-row {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem;
}
.list-row.user-row {
  border-bottom: 1px solid var(--line);
}
.list-row.user-row:hover, .list-row.user-row.is-editing { background: #f3f4f6; }
.user-pick {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  padding: 0.15rem 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.moment-card.is-focus { outline: 2px solid var(--red); }
.check-grid { display: flex; flex-wrap: wrap; gap: 0.35rem 0.7rem; font-size: 0.8rem; }
.toast {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 0.55rem 0.9rem; border-radius: 999px;
  font-size: 0.8rem; z-index: 50;
}
.install-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1rem; }
.install-card { max-width: 26rem; }
.text-link { color: var(--red); font-weight: 700; }
@media (min-width: 800px) {
  .wrap { max-width: 64rem; }
  .planner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
}
