/* View-specific styles. */

/* ---------- Login ---------- */
.auth { display: grid; grid-template-columns: 1fr minmax(320px, 460px); min-height: 100vh; }
.auth-panel {
  background: var(--petrol-deep); color: #DCE6E8;
  padding: clamp(2rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-panel h1 { color: #fff; font-size: clamp(1.75rem, 3.2vw, 2.5rem); max-width: 18ch; }
.auth-panel p { color: #9DB3BA; max-width: 40ch; margin-top: 0.75rem; }
/* The route line: a dashed amber road with stops - the brand motif */
.route-line { position: relative; height: 120px; margin: 2rem 0; }
.route-line::before { content: ""; position: absolute; inset-inline: 0; top: 50%; border-top: 3px dashed rgba(232, 163, 23, 0.7); }
.route-stop { position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--petrol-deep); border: 3px solid var(--amber); }
.route-stop:nth-child(1) { inset-inline-start: 0; }
.route-stop:nth-child(2) { inset-inline-start: 38%; }
.route-stop:nth-child(3) { inset-inline-start: 72%; }
.route-stop:nth-child(4) { inset-inline-end: 0; background: var(--amber); }
.auth-foot { font-size: var(--fs-xs); color: #7F98A0; }
.auth-form-wrap { background: var(--paper); display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-form { width: 100%; max-width: 360px; display: grid; gap: 1.5rem; }
.auth-form header p { color: var(--muted); font-size: var(--fs-sm); margin-top: 0.35rem; }
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-panel { padding: 1.5rem; }
  .route-line { height: 40px; margin: 1rem 0 0; }
  .auth-foot { display: none; }
}

/* ---------- Departure board (the signature element) ---------- */
.board { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.board-head { display: flex; justify-content: space-between; align-items: center; padding: 0.875rem 1.125rem; background: var(--board); color: #fff; }
.board-head h2 { font-size: var(--fs-md); }
.board-date { color: var(--amber); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.ride { display: grid; grid-template-columns: auto 1fr auto auto; gap: 1.125rem; align-items: center; padding: 0.875rem 1.125rem; border-bottom: 1px solid var(--line-soft); }
.ride:last-child { border-bottom: 0; }
.ride-time {
  background: var(--board); color: var(--amber); border-radius: var(--r-sm);
  font-size: var(--fs-board); font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 0.2rem 0.75rem; letter-spacing: 0.04em; min-width: 5.2ch; text-align: center; direction: ltr;
}
.ride-main { min-width: 0; }
.ride-route { font-weight: 600; font-size: var(--fs-md); }
.ride-meta { color: var(--muted); font-size: var(--fs-sm); display: flex; gap: 0.875rem; flex-wrap: wrap; margin-top: 0.15rem; }
.ride-dir { display: inline-flex; align-items: center; gap: 0.3rem; font-size: var(--fs-xs); font-weight: 600; color: var(--petrol); }
.ride-dir svg { width: 14px; height: 14px; }
.ride-actions { display: flex; gap: 0.25rem; }
.day-label { padding: 0.5rem 1.125rem; background: var(--fog); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); border-bottom: 1px solid var(--line-soft); }
@media (max-width: 640px) {
  .ride { grid-template-columns: auto 1fr; }
  .ride .meter, .ride-actions { grid-column: 2; }
}

/* ---------- Dashboard ---------- */
.stat-line { display: flex; flex-wrap: wrap; gap: 0; margin-top: 1.25rem; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--paper); }
.stat { flex: 1 1 160px; padding: 0.875rem 1.125rem; border-inline-start: 1px solid var(--line-soft); }
.stat:first-child { border-inline-start: 0; }
.stat-value { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { font-size: var(--fs-xs); color: var(--muted); }
.stat.is-alert .stat-value { color: var(--danger); }

/* ---------- Rides filter ---------- */
.week-nav { display: flex; align-items: center; gap: 0.5rem; }
.week-nav .range { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 13ch; text-align: center; }

/* ---------- Import result ---------- */
.import-summary { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: var(--fs-sm); }
.import-summary strong { font-size: var(--fs-lg); display: block; }
.import-errors { margin: 0; padding-inline-start: 1.1rem; font-size: var(--fs-xs); color: var(--danger); max-height: 160px; overflow-y: auto; }

/* ---------- Audit ---------- */
.audit-details { font-size: var(--fs-xs); color: var(--muted); direction: ltr; text-align: left; word-break: break-word; }

/* ---------- Live tracking (employee) ---------- */
.live-panel { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 1rem; padding: 1rem 1.125rem; border-bottom: 1px solid var(--line-soft); background: var(--fog); }
.live-side { display: grid; gap: 0.6rem; align-content: start; }
.live-eta { font-size: var(--fs-lg); font-weight: 700; }
.live-info { display: grid; gap: 0.5rem; justify-items: start; font-size: var(--fs-sm); }
@media (max-width: 720px) { .live-panel { grid-template-columns: 1fr; } }

/* ---------- Admin live view ---------- */
.alerts-panel, .live-map { margin-bottom: 1.25rem; }
.live-map { padding: 0.5rem; }
.live-map .map, .live-map .schematic { height: 340px; }
.alert-row { display: flex; gap: 0.875rem; align-items: center; padding: 0.75rem 1.125rem; border-bottom: 1px solid var(--line-soft); }
.alert-row:last-child { border-bottom: 0; }
.alert-msg { flex: 1; font-size: var(--fs-sm); }

/* ---------- Driver (mobile first, big touch targets) ---------- */
.driver-list { display: grid; gap: 1rem; }
.driver-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1rem; display: grid; gap: 0.875rem; }
.driver-card-head { display: grid; grid-template-columns: auto 1fr auto; gap: 0.875rem; align-items: center; }
.driver-actions { display: grid; gap: 0.5rem; }
.btn-big { min-height: 56px; font-size: var(--fs-md); width: 100%; }
.share-state { font-size: var(--fs-sm); color: var(--ok); }
.share-state.is-error { color: var(--danger); }
.pax-title { font-size: var(--fs-sm); color: var(--muted); }
.pax-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pax { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.5rem; border-radius: var(--r-sm); }
.pax.is-on { background: var(--ok-wash); }
.pax-check { display: flex; align-items: center; gap: 0.75rem; flex: 1; cursor: pointer; }
.pax-check input { width: 24px; height: 24px; accent-color: var(--ok); }
.pax-check > span { display: grid; font-size: var(--fs-sm); }

/* ---------- Shifts ---------- */
.shift-list { display: grid; gap: 1rem; }
.shift-empty { padding: 1rem 1.125rem; }

/* ---------- Shifts: quick edits ---------- */
.select-inline { min-height: 34px; padding: 0.2rem 0.5rem; width: auto; font-size: var(--fs-sm); }
.inline-label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--fs-sm); color: var(--muted); }
.shift-rides { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; padding: 0.6rem 1.125rem; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); }
.quick-add { display: flex; gap: 0.5rem; padding: 0.75rem 1.125rem; border-top: 1px solid var(--line-soft); }
.quick-add .input { max-width: 340px; min-height: 36px; }
.preview-table { max-height: 320px; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: var(--r-sm); }
.types-table .input { min-height: 36px; }
.types-table td { padding: 0.4rem; }
dialog.modal:has(.preview-table), dialog.modal:has(.types-table) { width: min(860px, calc(100vw - 2rem)); }

.preview-staff { font-size: var(--fs-xs); line-height: 1.5; min-width: 220px; }

/* ---------- Pilot ---------- */
.pilot-details { margin: 1.25rem 0; }
.pilot-details p { margin: 0 0 0.5rem; font-size: var(--fs-sm); }
.feedback-msg { max-width: 38ch; white-space: normal; }
tr.is-done td { opacity: 0.55; }
.sidebar-foot .btn-link { display: block; }
