:root {
  /* Kleuren overgenomen van de stijl van www.stalopdendries.be: zwart met
     een warme goudaccent, op een crème werkoppervlak voor de leesbaarheid
     van de dagelijkse boekingslijsten/formulieren. */
  --black: #14130f;
  --black-deep: #0a0a08;
  --gold: #c9a227;
  --gold-light: #ecdfb0;
  --gold-dark: #8a6d1b;
  --cream: #f6f4ee;
  --white: #ffffff;
  --text: #201f1a;
  --muted: #6f6a5c;
  --danger: #b3261e;
  --warning: #8a6d00;
  --warning-bg: #fff6d6;
  --border: #e2dcc7;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background: var(--cream);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85em; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
}
.btn-primary { background: var(--black); color: var(--gold-light); }
.btn-primary:active { background: var(--black-deep); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-small { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 8px 14px; background: var(--white); border: 1px solid var(--border); }
.btn-google {
  background: var(--black);
  color: var(--gold-light);
  border: 1px solid var(--gold);
  width: 100%;
  padding: 14px;
  margin-top: 20px;
  letter-spacing: 0.02em;
}
.btn-google:active { background: var(--black-deep); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Login / not-member screens ---------- */
.screen { min-height: 100vh; }
#login-screen, #not-member-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--black-deep);
  background-image: radial-gradient(circle at 50% -10%, #2a2717 0%, var(--black-deep) 60%);
}
.login-card {
  background: var(--black);
  border: 1px solid #2c2a20;
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  padding: 28px 24px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  color: var(--white);
}
.login-logo {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--gold);
  margin-bottom: 12px;
  background: var(--black-deep);
}
.login-card h1 {
  margin: 0 0 4px;
  font-size: 20px;
  letter-spacing: 0.03em;
  color: var(--white);
}
.login-card p { color: #cfcabb; }
.login-card .login-subtitle { margin-top: 0; margin-bottom: 4px; }
.login-card .muted { color: #a9a38c; }
#not-member-screen .login-card { border-top-color: var(--danger); }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid var(--gold);
}
.topbar-title { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; letter-spacing: 0.01em; }
.logo-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: middle; border: 1px solid var(--gold); }
.topbar-user { display: flex; align-items: center; gap: 8px; }
.user-name { font-size: 13px; opacity: 0.9; display: none; }
@media (min-width: 480px) { .user-name { display: inline; } }
.topbar .btn-small, .topbar .btn-ghost { background: rgba(255,255,255,0.1); color: var(--gold-light); }

/* ---------- Tabs ---------- */
.tabbar {
  display: flex;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 52px;
  z-index: 9;
}
.tabbar-small { position: static; margin-bottom: 12px; }
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}
.tab-btn.active { color: var(--gold-dark); border-bottom-color: var(--gold); }
.tab-panel { padding: 12px 14px 80px; }

/* ---------- Resource tabs ---------- */
.resource-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; }
.resource-tab {
  white-space: nowrap;
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.resource-tab.active { background: var(--black); color: var(--gold-light); border-color: var(--black); }

/* ---------- Weergave-tabs (Dag / Week / Maand) ---------- */
.view-panel { }

/* ---------- Dagstrip (snelle navigatie binnen de week) ---------- */
.day-strip { display: flex; gap: 5px; overflow-x: auto; padding: 2px 0 8px; justify-content: center; }
.day-pill {
  flex: 0 0 auto; width: 40px; text-align: center; border-radius: 10px;
  padding: 5px 0 4px; border: 1px solid var(--border); background: white; font-size: 12px;
}
.day-pill .dow { font-size: 9px; font-weight: 700; color: var(--muted); text-transform: uppercase; display: block; }
.day-pill .num { font-size: 15px; font-weight: 800; }
.day-pill.active { background: var(--black); border-color: var(--black); }
.day-pill.active .dow { color: var(--gold-light); }
.day-pill.active .num { color: var(--white); }
.day-pill.is-today:not(.active) { border-color: var(--gold); }
.day-pill.is-today:not(.active) .num { color: var(--gold-dark); }
.day-pill:disabled { opacity: 0.35; cursor: default; }

.ghost-link {
  display: block; width: 100%; text-align: center; background: none;
  border: 1px dashed var(--border); color: var(--muted); font-size: 12.5px; font-weight: 600;
  padding: 8px; border-radius: 8px; margin-top: 6px;
}

/* ---------- Week- en maandnavigatie ---------- */
.week-nav { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.week-range-label { flex: 1; text-align: center; font-weight: 700; font-size: 14px; }

/* ---------- Weekraster ---------- */
.week-grid-wrap { overflow-x: auto; }
.week-grid { display: grid; grid-template-columns: 34px repeat(7, minmax(38px, 1fr)); gap: 3px; }
.week-grid .whead {
  font-size: 10px; font-weight: 700; text-align: center; color: var(--muted); padding-bottom: 4px;
}
.week-grid .whead.today { color: var(--gold-dark); }
.week-grid .hour-label {
  font: 700 10px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted);
  display: flex; align-items: center; justify-content: flex-end; padding-right: 3px;
}
.week-grid .cell {
  border-radius: 5px; background: white; border: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  cursor: pointer; position: relative; padding: 3px 4px 2px; min-height: 46px;
}
.week-grid .cell:active { filter: brightness(0.94); }
.week-grid .cell.some { background: var(--gold-light); }
.week-grid .cell.full { background: var(--gold); }
.week-grid .cell.springen { background: #ffd8a8; }
.week-grid .cell.verhuur { background: #f1a3a3; }
.week-grid .cell.today-col { box-shadow: inset 0 0 0 1.5px var(--gold-dark); }
.week-grid .cell.past { opacity: 0.5; cursor: default; }
.week-grid .cell-badge {
  position: absolute; top: 2px; right: 3px;
  font: 800 7px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted);
}
.week-grid .cell-line {
  display: flex; align-items: center; gap: 3px;
  font-size: 8.5px; line-height: 11px; font-weight: 600; color: var(--text);
}
.week-grid .cell-line:not(.filled) { opacity: 0; } /* houdt de lijnhoogte aan zonder streepjes te tonen */
.week-grid .cell-line-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-grid .cell-line .member-dot { width: 6px; height: 6px; }

.legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: white; border: 1px solid var(--border); }
.legend-swatch.legend-some { background: var(--gold-light); border-color: var(--gold-light); }
.legend-swatch.legend-full { background: var(--gold); border-color: var(--gold); }
.legend-swatch.legend-springen { background: #ffd8a8; border-color: #ffd8a8; }
.legend-swatch.legend-verhuur { background: #f1a3a3; border-color: #f1a3a3; }

/* ---------- Maandraster ---------- */
/* Bewust minimaal gehouden - net als een gewone kalender: enkel het cijfer,
   vandaag als gevulde cirkel, een klein stipje voor dagen met boekingen. */
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.month-grid .mhead { font-size: 11px; font-weight: 700; text-align: center; color: var(--muted); padding-bottom: 6px; }
.day-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 0; border-radius: 10px; cursor: pointer;
}
.day-cell:active { background: var(--cream); }
.day-cell.other-month { opacity: 0.3; cursor: default; }
.day-cell.disabled { opacity: 0.35; cursor: default; }
.day-cell.past { opacity: 0.5; }
.day-num {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.day-cell.today .day-num { background: var(--gold-dark); color: var(--white); font-weight: 800; }
.day-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--gold-dark); visibility: hidden; }
.day-cell.has-booking .day-dot { visibility: visible; }
.month-tap-hint { text-align: center; margin-top: 10px; }

/* ---------- Blok-detail modal ---------- */
.slot-modal-chips { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.slot-modal-chips .chip { align-self: flex-start; font-size: 13px; padding: 6px 12px; }

/* ---------- Date nav ---------- */
.date-nav { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.date-nav input[type="date"] {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 15px;
}
.capacity-hint { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

/* ---------- Schedule list ---------- */
.schedule-list { display: flex; flex-direction: column; gap: 6px; }
.slot-row {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.slot-row.slot-past { opacity: 0.5; }
.slot-time { font-weight: 700; width: 52px; flex-shrink: 0; }
.slot-chips { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 14px;
  background: var(--gold-light);
  color: var(--gold-dark);
  font-weight: 600;
}
.chip.chip-springen { background: #ffd8a8; color: #7a4a00; }
.chip.chip-verhuur { background: #f1a3a3; color: #6b0f0f; }
.chip.chip-empty { background: transparent; color: var(--muted); font-weight: 400; }
.chip.chip-clickable { cursor: pointer; border: 1px solid transparent; }
.chip.chip-clickable:hover { filter: brightness(0.94); border-color: rgba(0,0,0,0.15); }
.chip.chip-clickable:active { filter: brightness(0.88); }
.slot-action { flex-shrink: 0; }

/* ---------- My bookings ---------- */
.mybookings-list { display: flex; flex-direction: column; gap: 8px; }
.mybooking-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mybooking-info { line-height: 1.5; }
.mybooking-info .mb-title { font-weight: 700; }
.mybooking-info .mb-sub { font-size: 13px; color: var(--muted); }
.badge-recurring { font-size: 11px; background: var(--gold-light); color: var(--gold-dark); padding: 2px 7px; border-radius: 10px; margin-left: 6px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}
@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
}
.modal {
  background: white;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  border-top: 3px solid var(--gold);
}
@media (min-width: 600px) {
  .modal { border-radius: 16px; }
}
.modal-wide { max-width: 560px; }
.modal h2 { margin-top: 0; }
.modal label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
}
.modal input[type="text"], .modal input[type="email"], .modal input[type="number"],
.modal input[type="date"], .modal select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: white;
}
.form-row { display: flex; gap: 10px; }
.form-row > label { flex: 1; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.checkbox-row input { width: auto; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* ---------- Admin ---------- */
.inline-form, .inline-form-col { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.inline-form-col { flex-direction: column; }
.inline-form input, .inline-form select { padding: 8px; border-radius: 8px; border: 1px solid var(--border); }
.admin-list { display: flex; flex-direction: column; gap: 6px; }
.admin-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--cream); border-radius: 8px; padding: 8px 12px; font-size: 14px;
}
.admin-row .admin-row-actions { display: flex; align-items: center; gap: 6px; }
.role-admin { color: var(--gold-dark); font-weight: 700; }
.protected-note { font-size: 12px; color: var(--muted); font-style: italic; }

/* ---------- Kleuren per lid ---------- */
.my-color-dot {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.15); padding: 0; flex-shrink: 0;
}
.admin-color-dot { border: 2px solid rgba(0,0,0,0.15); }
.color-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px;
  margin: 14px 0;
}
.color-swatch {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; border: 3px solid transparent;
  padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
}
.color-swatch:hover:not(:disabled) { border-color: rgba(0,0,0,0.2); }
.color-swatch.selected { border-color: var(--black); }
.color-swatch:disabled { opacity: 0.2; cursor: not-allowed; }
.member-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 4px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
}
.chip { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Misc ---------- */
.error-text { color: var(--danger); font-size: 13px; }
.warning-text { color: var(--warning); background: var(--warning-bg); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.loading-text { text-align: center; padding: 24px 0; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--black);
  color: var(--gold-light);
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 200;
  box-shadow: var(--shadow);
  border: 1px solid var(--gold);
  max-width: 90vw;
  text-align: center;
}
