/* styles.css — Roosterapp
   Ontwerprichting: functioneel & direct leesbaar, geïnspireerd op tankstation-signage.
   Tijden in monospace (digitale pomp-cijfers), condensed bold koppen (prijzenbord).
*/

:root {
  /* Kleur — geïnspireerd op Route 106 (Barneveld): Amerikaans jaren 50/60 retro-tankstation,
     crème/zwart met mosterdgeel en dinerrood accenten (ronde "scherp geprijsd"-badge, chalkboard-menu). */
  --bg: #ece0c4;
  --surface: #fffdf6;
  --ink: #1b2523;
  --ink-muted: #5d6b68;
  --border: #d5c49a;
  --primary: #1c2b2c;
  --primary-2: #2d4142;
  --primary-contrast: #ffffff;
  --amber: #3d9aa1;
  --amber-ink: #0c3033;
  --red: #a32a2c;
  --red-bg: #f3dcdb;
  --green: #2f6b3a;
  --green-bg: #e6efdc;

  /* Type */
  --font-display: 'Bebas Neue', 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(23, 19, 15, 0.1), 0 2px 8px rgba(23, 19, 15, 0.1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 400;
  margin: 0;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

button {
  cursor: pointer;
}

a { color: inherit; }

::selection { background: var(--amber); color: var(--ink); }

/* Focus states — altijd zichtbaar, ook voor toetsenbordgebruik */
:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* ---------- Layout ---------- */
#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--primary);
  color: var(--primary-contrast);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.topbar__brand-mark {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar__brand-sub {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: #d8cdb0;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--primary-contrast);
  padding: 8px;
  border-radius: 8px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: rgba(255,255,255,0.12); }

.badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--primary);
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 22px;
  height: 18px;
}
.hamburger-icon span {
  display: block;
  height: 2.5px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 35, 32, 0.45);
  display: flex;
  justify-content: flex-end;
  z-index: 40;
}

.menu-panel {
  background: var(--surface);
  width: 100%;
  max-width: 300px;
  height: 100%;
  padding: 20px;
  box-shadow: -4px 0 24px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
}

.menu-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1.5px solid var(--border);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 14px 6px;
  font-size: 0.95rem;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--bg); }
.menu-item__icon { font-size: 1.1rem; width: 24px; text-align: center; }
.menu-item__label { flex: 1; }
.menu-item--danger { color: var(--red); }
.menu-item .badge-dot {
  position: static;
  border: none;
  margin-left: auto;
}

main {
  flex: 1;
  padding: 16px;
  padding-bottom: 96px; /* ruimte voor FAB */
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.login-logo {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 12px;
}

.login-wordmark {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 2px;
}

/* Dubbele streep — knipoog naar roadside tankstation-signage (zwart/mosterdgeel) */
.login-wordmark::after {
  content: '';
  display: block;
  width: 64px;
  height: 6px;
  margin-top: 12px;
  border-radius: 3px;
  background: repeating-linear-gradient(
    -35deg,
    var(--primary) 0 8px,
    var(--amber) 8px 16px
  );
}

.login-sub {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin: 14px 0 22px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
}

.field input:focus {
  border-color: var(--primary);
  background: var(--surface);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
  width: 100%;
}
.btn-primary:hover { background: var(--primary-2); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-amber {
  background: var(--amber);
  color: var(--amber-ink);
}

.btn-danger-outline {
  background: transparent;
  color: var(--red);
  border: 1.5px solid var(--red);
}

.error-banner {
  background: var(--red-bg);
  color: var(--red);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.hint {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 14px;
  text-align: center;
}
.hint code {
  background: var(--bg);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* ---------- Week navigatie ---------- */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 8px;
}

.week-nav__label {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.week-nav__buttons { display: flex; gap: 6px; }

.chip-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--primary);
}
.chip-btn:hover { border-color: var(--primary); }

/* ---------- Dekking-samenvatting ---------- */
.coverage-strip {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  overflow-x: auto;
}
.coverage-pill {
  flex: 1;
  min-width: 74px;
  text-align: center;
  padding: 8px 4px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  border: 1.5px solid transparent;
}
.coverage-pill--ok { background: var(--green-bg); color: var(--green); }
.coverage-pill--warn { background: var(--red-bg); color: var(--red); }
.coverage-pill--closed { background: var(--surface); color: var(--ink-muted); border-color: var(--border); }
.coverage-pill__day { display: block; font-family: var(--font-mono); font-size: 0.85rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 2px; }

/* ---------- Roosterrooster: week-per-dag kolommen ---------- */
.week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

@media (max-width: 900px) {
  .week-grid {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 78%;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
  }
  .day-col { scroll-snap-align: start; }
}

.day-col {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 220px;
}

.day-col--today { border-color: var(--amber); box-shadow: 0 0 0 1.5px var(--amber); }

.day-col__header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.day-col__weekday {
  font-family: var(--font-display);
  font-size: 0.9rem;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-col__date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.day-col__body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.day-col__empty {
  color: var(--ink-muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 18px 6px;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
}

/* Shift-ticket: styled als een pomp-bonnetje */
.shift-ticket {
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--bg);
  cursor: pointer;
}
.shift-ticket:hover { border-color: var(--primary); }
.shift-ticket--open { border-left-color: var(--amber); background: #fff8ec; }

.shift-ticket__time {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.shift-ticket__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.shift-ticket__naam {
  font-size: 0.82rem;
  font-weight: 600;
}
.shift-ticket__naam--open { color: var(--amber-ink); }

.shift-ticket__functie {
  font-size: 0.72rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ---------- FAB ---------- */
.fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  background: var(--amber);
  color: var(--amber-ink);
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 700;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 15;
}
.fab:hover { filter: brightness(0.97); }

/* ---------- Modal / bottom sheet ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 35, 32, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 30;
}
@media (min-width: 640px) {
  .sheet-backdrop { align-items: center; }
}

.sheet {
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px;
}
@media (min-width: 640px) {
  .sheet { border-radius: 16px; }
}

.sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sheet__close {
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--ink-muted);
  padding: 4px 8px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
}

.sheet__actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.sheet__actions .btn { flex: 1; }

/* ---------- Notificatie-paneel ---------- */
.notif-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  z-index: 40;
  box-shadow: -8px 0 24px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
}
.notif-panel__header {
  padding: 16px;
  background: var(--primary);
  color: var(--primary-contrast);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-list {
  overflow-y: auto;
  flex: 1;
}
.notif-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.87rem;
}
.notif-item--ongelezen { background: #fff8ec; border-left: 3px solid var(--amber); }
.notif-item__meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--ink-muted);
  margin-top: 4px;
}
.notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

/* ---------- Medewerker: bottom tabs ---------- */
.bottom-tabs {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  z-index: 25;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-tab {
  flex: 1;
  text-align: center;
  padding: 10px 4px 8px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: none;
  border: none;
  position: relative;
}
.bottom-tab--active {
  color: var(--ink);
  box-shadow: inset 0 3px 0 var(--amber);
}
.bottom-tab__dot {
  position: absolute;
  top: 6px;
  right: 30%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

main.has-bottom-tabs {
  padding-bottom: 76px;
}

/* ---------- Medewerker: eigen-rooster lijst ---------- */
.emp-day-block {
  margin-bottom: 16px;
}
.emp-day-block__header {
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--ink-muted);
}
.emp-shift-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.emp-shift-card__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.emp-shift-card__time {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.98rem;
}
.emp-shift-card__functie {
  font-size: 0.75rem;
  color: var(--ink-muted);
  text-transform: uppercase;
}
.emp-shift-card__status {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}
.emp-shift-card__actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}
.btn-small {
  padding: 7px 12px;
  font-size: 0.78rem;
  border-radius: 6px;
}

/* ---------- Medewerker: beschikbaarheid ---------- */
.avail-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.avail-day-row__label {
  min-width: 92px;
}
.avail-day-row__weekday {
  font-family: var(--font-display);
  font-size: 0.9rem;
  text-transform: uppercase;
}
.avail-day-row__date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-muted);
}
.avail-toggle-group {
  display: flex;
  gap: 4px;
}
.avail-toggle {
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.avail-toggle--beschikbaar.avail-toggle--actief { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.avail-toggle--voorkeur.avail-toggle--actief { background: #fff8ec; border-color: var(--amber); color: var(--amber-ink); }
.avail-toggle--niet_beschikbaar.avail-toggle--actief { background: var(--red-bg); border-color: var(--red); color: var(--red); }

.week-divider {
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 18px 0 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.week-divider:first-child { border-top: none; margin-top: 0; padding-top: 0; }

/* ---------- Medewerker: ruilen ---------- */
.swap-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: uppercase;
  margin: 18px 0 8px;
  color: var(--ink-muted);
}
.swap-section-title:first-child { margin-top: 0; }
.swap-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.swap-card__meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 2px;
}
.swap-status {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-top: 6px;
}
.swap-status--open { background: var(--bg); color: var(--ink-muted); }
.swap-status--aangevraagd { background: #fff8ec; color: var(--amber-ink); }
.swap-status--goedgekeurd { background: var(--green-bg); color: var(--green); }
.swap-status--afgewezen, .swap-status--ingetrokken { background: var(--red-bg); color: var(--red); }

/* ---------- Utility ---------- */
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner--dark { border-color: rgba(15,61,62,0.2); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.center-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  z-index: 50;
  box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: currentColor; }
}
