*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold: #FFC200;
  --bg: #0A0A0A;
  --card: #1C1C1E;
  --card2: #2C2C2E;
  --text: #FFFFFF;
  --sub: #8E8E93;
  --border: #38383A;
  --green: #30D158;
  --orange: #FF9500;
  --red: #FF3B30;
  --blue: #007AFF;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.hidden { display: none !important; }

/* ─── LOGIN SCREEN ─── */
#loginScreen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.c-login-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
}

.c-login-logo { font-size: 56px; text-align: center; }
.c-login-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 4px; }

.c-login-tabs {
  display: flex;
  background: var(--card2);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 4px;
}

.c-login-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  color: var(--sub);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s;
}

.c-login-tab.active {
  background: var(--gold);
  color: #000;
}

.c-login-input {
  width: 100%;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--text);
  font-size: 15px;
}

.c-login-btn {
  width: 100%;
  background: var(--gold);
  color: #000;
  font-weight: 700;
  font-size: 16px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 4px;
}

.c-login-btn:disabled { opacity: .5; }

.c-login-error {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  text-align: center;
}

/* ─── PIN SCREEN (legacy, hidden) ─── */
#pinScreen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.pin-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 24px;
  width: 100%;
  max-width: 340px;
}

.pin-logo { font-size: 64px; }
.pin-title { font-size: 24px; font-weight: 700; }
.pin-sub { font-size: 15px; color: var(--sub); }

.pin-dots {
  display: flex;
  gap: 20px;
  margin: 8px 0;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--sub);
  transition: all 0.15s;
}

.pin-dot.filled {
  background: var(--gold);
  border-color: var(--gold);
}

.pin-error {
  font-size: 14px;
  color: var(--red);
  text-align: center;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 12px;
  margin-top: 8px;
}

.pin-pad button {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: var(--card);
  color: var(--text);
  font-size: 24px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
}

.pin-pad button:active { background: var(--card2); transform: scale(0.95); }
.pin-empty { background: transparent !important; cursor: default !important; }
.pin-del { font-size: 20px !important; }

/* ─── APP ─── */
#chauffeurApp {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ─── HEADER ─── */
.c-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.c-header-left { display: flex; align-items: center; gap: 12px; }
.c-logo { font-size: 32px; }
.c-title { font-size: 18px; font-weight: 700; }
.c-sub { font-size: 12px; color: var(--sub); }

.beschikbaar-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card2);
  border-radius: 100px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.groen { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.rood  { background: var(--red); }

/* ─── TABS ─── */
.c-tabs {
  display: flex;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.c-tab {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: none;
  color: var(--sub);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}

.c-tab.active {
  color: var(--gold);
  border-bottom: 2px solid var(--gold);
}

.c-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
}

/* ─── CONTENT ─── */
.c-content {
  flex: 1;
  overflow: hidden;
}

.c-tab-content {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

/* ─── LEEG STATE ─── */
.c-leeg {
  text-align: center;
  padding: 64px 24px;
  color: var(--sub);
}
.c-leeg-icon { font-size: 52px; margin-bottom: 16px; }
.c-leeg-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }

/* ─── RIT KAART ─── */
.c-rit {
  background: var(--card);
  border-radius: 18px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.c-rit.nieuw { border-color: var(--gold); }
.c-rit.onderweg { border-color: var(--orange); }

.c-rit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

.c-rit-time { font-size: 13px; color: var(--sub); font-weight: 500; }

.c-status {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 100px;
  text-transform: uppercase;
}
.c-status.nieuw        { background: rgba(255,194,0,0.15);   color: var(--gold); }
.c-status.gewijzigd    { background: rgba(94,92,230,0.15);   color: #5E5CE6; }
.c-status.geaccepteerd { background: rgba(0,122,255,0.15);   color: var(--blue); }
.c-status.onderweg     { background: rgba(255,149,0,0.15);   color: var(--orange); }
.c-status.afgerond     { background: rgba(48,209,88,0.15);   color: var(--green); }
.c-status.geannuleerd  { background: rgba(255,59,48,0.15);   color: var(--red); }

/* ─── RIT TYPE BADGE ─── */
.c-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: .2px;
}
.c-type-badge.schiphol { background: rgba(255,194,0,0.12); color: var(--gold); border: 1px solid rgba(255,194,0,0.25); }
.c-type-badge.lokaal   { background: rgba(255,255,255,0.06); color: var(--sub); border: 1px solid rgba(255,255,255,0.1); }
.c-type-badge.anders   { background: rgba(48,209,88,0.12);  color: var(--green); border: 1px solid rgba(48,209,88,0.25); }

/* Logo in status badge */
.c-status-logo {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 4px;
  margin-top: -1px;
}

/* Linker accent rand per type */
.c-rit.type-schiphol { border-left: 3px solid var(--gold); }
.c-rit.type-lokaal   { border-left: 3px solid #007AFF; }
.c-rit.type-anders   { border-left: 3px solid var(--green); }

.c-rit-route {
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.c-adres {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}

.c-adres-icon { width: 18px; text-align: center; flex-shrink: 0; margin-top: 2px; }
.c-adres-lijn { width: 2px; height: 14px; background: var(--border); margin-left: 8px; }

.c-tussenstop {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--sub);
}

.c-rit-info {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--sub);
  flex-wrap: wrap;
}

.c-rit-info span { display: flex; align-items: center; gap: 5px; }

/* ─── ACTIE KNOPPEN ─── */
.c-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.c-btn {
  flex: 1;
  min-width: 80px;
  padding: 11px 8px;
  border: none;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.c-btn:hover { opacity: 0.85; }

.c-btn-accept   { background: var(--green);  color: #000; }

/* ─── Dispatch countdown ─────────────────────────────────────────────────── */
.c-dispatch-countdown {
  margin: 6px 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.c-dispatch-bar-wrap {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.c-dispatch-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 1s linear, background 0.3s;
}
.c-dispatch-secs {
  font-size: 12px;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}
.c-btn-start    { background: var(--orange); color: #000; }
.c-btn-done     { background: var(--blue);   color: #fff; }
.c-btn-cancel   { background: var(--card2);  color: var(--red); }
.c-btn-call     { background: var(--card2);  color: var(--text); }
.c-btn-maps     { background: var(--card2);  color: var(--text); }
.c-btn-detail   { background: var(--card2);  color: var(--text); }

/* ─── NIEUW RIT PULSE ─── */
@keyframes nieuwPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,194,0,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(255,194,0,0); }
}
.c-rit.nieuw { animation: nieuwPulse 2s infinite; }

/* ─── MODAL ─── */
.c-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: flex-end;
  z-index: 50;
  backdrop-filter: blur(4px);
}

.c-modal-box {
  background: var(--card);
  border-radius: 24px 24px 0 0;
  padding: 0 0 32px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.c-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
}

.c-modal-title { font-size: 18px; font-weight: 700; }
.c-modal-close { background: none; border: none; font-size: 20px; color: var(--sub); cursor: pointer; }

.c-modal-section { padding: 16px 20px 0; }
.c-modal-label { font-size: 12px; font-weight: 600; color: var(--sub); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }

.c-modal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.c-modal-row:last-child { border-bottom: none; }
.c-modal-row-label { color: var(--sub); }
.c-modal-row-value { font-weight: 600; text-align: right; max-width: 60%; }

.c-modal-actions {
  padding: 16px 20px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.c-modal-actions .c-btn { flex: none; }
.c-modal-actions .c-btn-full { grid-column: 1 / -1; }

/* ─── VANDAAG HEADER ─── */
.dag-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 0 10px;
}

/* ─── STATS BAR ─── */
.c-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.c-stat {
  flex: 1;
  background: var(--card);
  border-radius: 14px;
  padding: 14px 12px;
  text-align: center;
  border: 1px solid var(--border);
}

.c-stat-val { font-size: 22px; font-weight: 700; }
.c-stat-label { font-size: 11px; color: var(--sub); margin-top: 4px; }

/* ─── WIJZIGING BANNER ─── */
.c-wijziging-banner {
  margin: 0 16px 12px;
  background: rgba(94,92,230,0.12);
  border: 1px solid rgba(94,92,230,0.4);
  border-radius: 12px;
  padding: 10px 12px;
}
.c-wijziging-titel {
  font-size: 12px;
  font-weight: 700;
  color: #5E5CE6;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.c-wijziging-rij {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.c-wijziging-rij:last-child { margin-bottom: 0; }
.c-wijziging-label { color: var(--sub); min-width: 80px; font-weight: 600; }
.c-wijziging-oud   { color: var(--red); text-decoration: line-through; opacity: 0.8; }
.c-wijziging-pijl  { color: var(--sub); }
.c-wijziging-nieuw { color: #5E5CE6; font-weight: 600; }

/* ─── CHAT MODAL ─── */
.chat-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end;
  z-index: 200;
  backdrop-filter: blur(4px);
}
.chat-box {
  background: var(--card);
  border-radius: 24px 24px 0 0;
  width: 100%;
  height: 75vh;
  display: flex;
  flex-direction: column;
}
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-header-title { font-size: 17px; font-weight: 700; }
.chat-header-sub   { font-size: 12px; color: var(--sub); margin-top: 2px; }
.chat-close { background: none; border: none; font-size: 20px; color: var(--sub); cursor: pointer; }
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px; line-height: 1.4;
}
.chat-bubble.eigen { align-self: flex-end; background: var(--gold); color: #000; border-bottom-right-radius: 4px; }
.chat-bubble.ander { align-self: flex-start; background: var(--card2); color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble-naam { font-size: 11px; font-weight: 700; margin-bottom: 4px; opacity: 0.7; }
.chat-bubble-tijd { font-size: 11px; margin-top: 4px; opacity: 0.6; text-align: right; }
.chat-leeg { text-align: center; color: var(--sub); font-size: 14px; padding: 32px 0; }
.chat-input-bar {
  display: flex; gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input {
  flex: 1; background: var(--card2); border: none;
  border-radius: 22px; padding: 10px 16px;
  font-size: 15px; color: var(--text);
  outline: none; font-family: inherit;
}
.chat-send {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--gold); border: none;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chat-ongelezen {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold); color: #000;
  font-size: 10px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  margin-left: 4px; vertical-align: middle;
}

.setup-auto-btn.active { border-color: var(--gold) !important; color: var(--gold) !important; }
