/* HaulierSuite Driver Mobile PWA — Amber & White + High-Contrast Cab Mode */
:root {
  --brand-primary: #D97706;
  --brand-primary-hover: #B45309;
  --brand-soft: #FFFBEB;
  --brand-dark: #0F172A;
  --brand-contrast: #FFFFFF;
  --bg-canvas: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-well: #F1F5F9;
  --bg-amber-soft: var(--brand-soft, #FFFBEB);
  --border-color: #CBD5E1;
  --border-strong: #94A3B8;
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #475569;
  --amber: var(--brand-primary, #D97706);
  --amber-hover: var(--brand-primary-hover, #B45309);
  --amber-bright: var(--brand-primary, #F59E0B);
  --amber-text: var(--brand-dark, #78350F);
  --emerald: #047857;
  --emerald-bg: #ECFDF5;
  --emerald-border: #6EE7B7;
  --danger: #B91C1C;
  --danger-bright: #DC2626;
  --danger-bg: #FEF2F2;
  --danger-border: #FCA5A5;
  --plate-bg: #FACC15;
  --plate-fg: #0F172A;
  --shadow-card: 0 2px 10px rgba(15, 23, 42, 0.06);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --tap-min: 48px;
}

body.cab-mode {
  --bg-canvas: #050811;
  --bg-surface: #0F172A;
  --bg-well: #1E293B;
  --bg-amber-soft: #271A06;
  --border-color: #475569;
  --border-strong: #94A3B8;
  --text-primary: #FFFFFF;
  --text-secondary: #E2E8F0;
  --text-muted: #CBD5E1;
  --amber: #F59E0B;
  --amber-hover: #FBBF24;
  --amber-bright: #FBBF24;
  --amber-text: #FEF3C7;
  --emerald: #34D399;
  --emerald-bg: #052E22;
  --emerald-border: #10B981;
  --danger: #F87171;
  --danger-bright: #EF4444;
  --danger-bg: #3B0D0C;
  --danger-border: #F87171;
  --shadow-card: 0 0 0 1px #334155;
}

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

img,
svg {
  max-width: 100%;
  height: auto;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(217, 119, 6, 0.25);
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100dvh;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  overflow-x: clip;
  background: var(--bg-canvas);
}

/* ==================== LOGIN SCREEN ==================== */
.login-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.login-card {
  width: 100%;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.login-logo-full {
  width: auto;
  max-width: 240px;
  height: auto;
  max-height: 112px;
  object-fit: contain;
  display: block;
}

.login-brand-heading {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--brand-dark, #0F172A);
  letter-spacing: -0.02em;
}

body.cab-mode .login-brand-heading {
  color: #FFFFFF;
}

.brand-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--amber);
}

.login-brand h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.login-subtitle {
  margin: 0 0 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.login-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.text-link {
  color: var(--amber);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
}

.login-legal {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.legal-link {
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ==================== TOP BAR & DVSA HERO BUTTON ==================== */
.driver-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px));
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  max-width: 100%;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border-color);
  padding: calc(0.6rem + env(safe-area-inset-top, 0px)) 0.75rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.top-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
  min-width: 0;
}

.driver-identity {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1 1 150px;
  min-width: 0;
}

.top-logo {
  width: auto;
  min-width: 36px;
  max-width: 108px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

body.cab-mode .top-logo,
body.cab-mode .login-logo-full {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 4px;
}

.driver-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.driver-meta strong {
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-meta span {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  max-width: 100%;
}

.icon-toggle-btn {
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  background: var(--bg-well);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
  cursor: pointer;
}

.btn-svg {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.icon-btn-with-svg {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.hdr-svg {
  flex-shrink: 0;
  color: var(--brand-primary, #D97706);
}

body.cab-mode .hdr-svg {
  color: #F59E0B;
}

body.cab-mode .icon-toggle-btn[aria-pressed="true"] {
  background: var(--amber);
  color: #0F172A;
  border-color: var(--amber);
}

.btn-outline-danger {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--danger-bg);
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  border: 1.5px solid transparent;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.status-online {
  background: var(--emerald-bg);
  color: var(--emerald);
  border-color: var(--emerald-border);
}

.status-offline {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

.outbox-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-well);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.outbox-badge.has-pending {
  background: var(--bg-amber-soft);
  border-color: var(--amber);
  color: var(--amber-text);
}

body.cab-mode .outbox-badge.has-pending {
  color: var(--amber-bright);
}

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--text-primary);
  color: var(--bg-surface);
  font-size: 0.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.outbox-badge.has-pending .badge-count {
  background: var(--amber);
  color: #FFFFFF;
}

.refresh-pill-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.dvsa-hero-btn {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--brand-dark, #0F172A);
  background: var(--brand-dark, #0F172A);
  color: #FFFFFF;
  text-align: left;
  cursor: pointer;
}

body.cab-mode .dvsa-hero-btn {
  background: #F59E0B;
  color: #0F172A;
  border-color: #FBBF24;
}

.dvsa-shield {
  font-size: 1.4rem;
  line-height: 1;
}

.dvsa-btn-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.dvsa-btn-copy strong {
  font-size: 0.96rem;
  font-weight: 800;
}

.dvsa-btn-copy small {
  font-size: 0.75rem;
  opacity: 0.88;
}

.dvsa-mini-pill {
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: #F59E0B;
  color: #0F172A;
  letter-spacing: 0.03em;
}

.dvsa-mini-pill.is-pass {
  background: #10B981;
  color: #FFFFFF;
}

.dvsa-mini-pill.is-vor {
  background: #DC2626;
  color: #FFFFFF;
}

/* ==================== MAIN CONTENT & CARDS ==================== */
.main-content {
  width: 100%;
  max-width: 100%;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tab-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 0.85rem;
}

.card-amber {
  background: var(--bg-amber-soft);
  border-color: var(--amber);
}

.card-danger {
  background: var(--danger-bg);
  border-color: var(--danger-bright);
}

.card-emerald {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  min-width: 0;
}

.section-header > div {
  min-width: 0;
  flex: 1 1 160px;
}

.section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.muted {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.plate-badge {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: var(--plate-bg);
  color: var(--plate-fg);
  border: 2px solid #0F172A;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1.5px solid transparent;
}

.pill-pass { background: var(--emerald-bg); color: var(--emerald); border-color: var(--emerald-border); }
.pill-amber { background: var(--bg-amber-soft); color: var(--amber-text); border-color: var(--amber); }
body.cab-mode .pill-amber { color: var(--amber-bright); }
.pill-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.pill-neutral { background: var(--bg-well); color: var(--text-secondary); border-color: var(--border-color); }

/* ==================== FORMS & GLOVE-FRIENDLY CONTROLS ==================== */
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
}

@media (max-width: 460px) {
  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: var(--tap-min);
  padding: 0.65rem 0.85rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  text-overflow: ellipsis;
}

input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(217, 119, 6, 0.35);
  border-color: var(--amber);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: var(--tap-min);
  min-width: 0;
  max-width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, background-color 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-lg {
  min-height: 54px;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--brand-primary, #D97706);
  color: var(--brand-contrast, #FFFFFF);
  border-color: var(--brand-primary-hover, #B45309);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-primary-hover, #B45309);
}

body.cab-mode .btn-primary {
  background: #F59E0B;
  color: #0F172A;
  border-color: #D97706;
}

.btn-emerald {
  background: var(--emerald);
  color: #FFFFFF;
}

body.cab-mode .btn-emerald {
  color: #052E22;
}

.btn-danger {
  background: var(--danger-bright);
  color: #FFFFFF;
}

.btn-secondary {
  background: var(--bg-well);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-group-row {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}

.btn-group-row > .btn {
  flex: 1 1 130px;
  min-width: 0;
}

/* ==================== ALERTS ==================== */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.alert-danger {
  background: var(--danger-bg);
  border-color: var(--danger-bright);
  color: var(--danger);
}

.alert-amber {
  background: var(--bg-amber-soft);
  border-color: var(--amber);
  color: var(--amber-text);
}

body.cab-mode .alert-amber {
  color: var(--amber-bright);
}

.alert-emerald {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
  color: var(--emerald);
}

.alert ul {
  margin: 0.45rem 0 0;
  padding-left: 1.25rem;
}

/* ==================== WALKAROUND TIMER & CHECKLIST ==================== */
.timer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-well);
  border: 2px solid var(--border-color);
  margin-bottom: 0.9rem;
  min-width: 0;
}

.timer-bar > div:first-child {
  min-width: 0;
  flex: 1 1 150px;
}

.timer-bar.is-warning {
  background: var(--bg-amber-soft);
  border-color: var(--amber);
}

.timer-bar.is-ready {
  background: var(--emerald-bg);
  border-color: var(--emerald-border);
}

.timer-clock {
  font-size: 1.55rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, Consolas, monospace;
}

.checklist-category {
  margin: 1rem 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--amber);
}

.check-item-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 0.65rem;
}

.check-item-card.state-pass { border-color: var(--emerald-border); }
.check-item-card.state-advisory { border-color: var(--amber); background: var(--bg-amber-soft); }
.check-item-card.state-critical_vor { border-color: var(--danger-bright); background: var(--danger-bg); }

.check-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
  min-width: 0;
}

.check-code {
  flex-shrink: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  background: var(--bg-well);
  color: var(--text-secondary);
}

.check-label {
  font-weight: 700;
  font-size: 0.94rem;
  flex: 1 1 160px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.check-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  width: 100%;
}

.tri-btn {
  min-height: var(--tap-min);
  min-width: 0;
  width: 100%;
  padding: 0.4rem 0.2rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  background: var(--bg-well);
  color: var(--text-primary);
  font-weight: 800;
  font-size: 0.78rem;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  cursor: pointer;
}

.tri-btn.active-pass {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #FFFFFF;
}

body.cab-mode .tri-btn.active-pass { color: #052E22; }

.tri-btn.active-advisory {
  background: var(--amber);
  border-color: var(--amber-hover);
  color: #FFFFFF;
}

body.cab-mode .tri-btn.active-advisory { color: #0F172A; }

.tri-btn.active-vor {
  background: var(--danger-bright);
  border-color: var(--danger);
  color: #FFFFFF;
}

.defect-inline-box {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1.5px dashed var(--border-strong);
  font-size: 0.88rem;
}

/* ==================== PHOTO PREVIEW & SIGNATURE CANVAS ==================== */
.photo-capture-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.photo-thumb-grid {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.photo-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
}

.sig-wrap {
  width: 100%;
  max-width: 100%;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  overflow: hidden;
  position: relative;
}

.sig-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  height: 160px;
  touch-action: none;
  user-select: none;
  cursor: crosshair;
}

.sig-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.65rem;
  background: var(--bg-well);
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
}

.sig-preview {
  margin-top: 0.5rem;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.25rem;
  width: 100%;
  max-width: 260px;
  overflow: hidden;
}

.sig-preview svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ==================== RUN STOPS & DEMURRAGE ==================== */
.stop-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  background: var(--bg-surface);
  margin-bottom: 0.75rem;
}

.stop-card.is-arrived {
  border-color: var(--amber);
  background: var(--bg-amber-soft);
}

.stop-card.is-completed {
  border-color: var(--emerald-border);
}

.stop-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
  min-width: 0;
}

.stop-top > div:first-child {
  flex: 1 1 160px;
  min-width: 0;
}

.stop-seq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--amber);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.demurrage-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  background: var(--bg-well);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  margin: 0.45rem 0;
}

/* ==================== DVSA ROADSIDE PASS ==================== */
.pass-shield-banner {
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  border: 3px solid transparent;
  margin-bottom: 0.9rem;
}

.pass-shield-banner.status-pass {
  background: #065F46;
  border-color: #34D399;
  color: #FFFFFF;
}

.pass-shield-banner.status-vor {
  background: #991B1B;
  border-color: #FCA5A5;
  color: #FFFFFF;
}

.pass-shield-banner.status-none {
  background: #92400E;
  border-color: #FBBF24;
  color: #FFFFFF;
}

.pass-verification-code {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.pass-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.75rem 0;
}

@media (max-width: 350px) {
  .pass-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 380px) {
  .main-content {
    padding: 0.55rem;
  }
  .card {
    padding: 0.75rem;
  }
  .check-item-card {
    padding: 0.65rem;
  }
  .tri-btn {
    font-size: 0.72rem;
    padding: 0.35rem 0.15rem;
  }
  .icon-toggle-btn {
    min-height: 44px;
    padding: 0 0.55rem;
    font-size: 0.74rem;
  }
  .status-pill {
    font-size: 0.74rem;
    padding: 0.25rem 0.55rem;
  }
  .outbox-badge,
  .refresh-pill-btn {
    min-height: 44px;
    font-size: 0.74rem;
    padding: 0 0.58rem;
  }
}

.pass-kv {
  min-width: 0;
  background: var(--bg-well);
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.pass-kv small {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}

.pass-kv strong {
  display: block;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pass-hash-text {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.74rem;
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* ==================== BOTTOM NAVIGATION ==================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: min(680px, 100vw);
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--bg-surface);
  border-top: 2px solid var(--border-color);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-tab {
  min-height: 60px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0.35rem 0.15rem;
  border-top: 3px solid transparent;
  overflow: hidden;
}

.nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-tab.is-active {
  color: var(--brand-primary, #D97706);
  border-top-color: var(--brand-primary, #D97706);
  background: var(--brand-soft, #FFFBEB);
}

body.cab-mode .nav-tab.is-active {
  color: #F59E0B;
  border-top-color: #F59E0B;
  background: #271A06;
}

.pass-brand-strip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: 0.65rem;
  margin-bottom: 0.65rem;
  border-bottom: 2px solid var(--brand-primary, #D97706);
}

.pass-brand-logo {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  flex-shrink: 0;
}

body.cab-mode .pass-brand-logo {
  background: #FFFFFF;
  border-radius: 6px;
  padding: 3px 6px;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.nav-svg {
  display: block;
  width: 22px;
  height: 22px;
}

/* ==================== PROFILE, PASSWORD & SPECIALIST TRAILERS ==================== */
.pw-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-input-wrap input {
  padding-right: 4.2rem;
}

.pw-toggle-btn {
  position: absolute;
  right: 6px;
  min-height: 36px;
  padding: 0.25rem 0.55rem;
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-well);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 380px) {
  .profile-meta-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.trailer-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  background: var(--brand-soft, #FFFBEB);
  border: 1.5px solid var(--brand-primary, #D97706);
  color: var(--amber-text);
  font-size: 0.76rem;
  font-weight: 800;
  max-width: 100%;
}

body.cab-mode .trailer-type-badge {
  background: #271A06;
  color: #FBBF24;
  border-color: #F59E0B;
}

.checklist-category-specialist {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 1rem 0 0.5rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  background: var(--brand-soft, #FFFBEB);
  border-left: 4px solid var(--brand-primary, #D97706);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-dark, #0F172A);
}

body.cab-mode .checklist-category-specialist {
  background: #271A06;
  color: #FBBF24;
  border-left-color: #F59E0B;
}

.vor-key-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

/* ==================== MODAL & TOAST ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.5rem;
}

@media (min-width: 560px) {
  .modal-backdrop {
    align-items: center;
  }
}

.modal-sheet {
  width: 100%;
  max-width: 600px;
  max-height: 92dvh;
  background: var(--bg-surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1.5px solid var(--border-color);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.modal-close-btn {
  min-width: 44px;
  min-height: 44px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-well);
  color: var(--text-primary);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  padding: 1rem;
  overflow-y: auto;
}

.toast-container {
  position: fixed;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(92vw, 440px);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.88rem;
  border: 2px solid transparent;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}

.toast-info { background: #0F172A; color: #FFFFFF; border-color: #334155; }
.toast-success { background: #065F46; color: #FFFFFF; border-color: #34D399; }
.toast-warning { background: #92400E; color: #FFFFFF; border-color: #FBBF24; }
.toast-error { background: #991B1B; color: #FFFFFF; border-color: #FCA5A5; }

/* ==================== ACCOUNT BILLING HOLD GATE ==================== */
.billing-hold-card {
  background: var(--bg-surface);
  border: 2.5px solid var(--amber);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}

.billing-hold-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-amber-soft);
  border: 1.5px solid var(--amber);
  color: var(--amber-text);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
}

body.cab-mode .billing-hold-badge {
  color: var(--amber-bright);
}

.billing-hold-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.3rem;
  font-weight: 800;
}

.billing-hold-org {
  margin: 0 0 0.6rem;
  font-weight: 700;
  color: var(--amber);
}

.billing-hold-copy {
  margin: 0 0 0.85rem;
  color: var(--text-secondary);
}

.billing-hold-note {
  background: var(--emerald-bg);
  border: 1.5px solid var(--emerald-border);
  color: var(--emerald);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ==================== INSTALL APP BANNER ==================== */
.install-app-banner[hidden],
.install-ios-hint[hidden],
.install-prompt-btn[hidden] {
  display: none !important;
}

.install-app-banner {
  position: fixed;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 44;
  width: min(94vw, 440px);
  max-width: calc(100vw - 16px);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 2px solid var(--amber);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.22);
}

body.has-bottom-nav .install-app-banner {
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
}

body.cab-mode .install-app-banner {
  background: #111827;
  color: #F8FAFC;
  border-color: var(--amber-bright);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.install-banner-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
}

.install-banner-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.install-banner-title {
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  overflow-wrap: break-word;
}

.install-banner-sub {
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--text-secondary);
}

.install-ios-hint {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--amber-text);
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

body.cab-mode .install-ios-hint {
  color: var(--amber-bright);
}

.install-ios-share-svg {
  vertical-align: middle;
  flex-shrink: 0;
}

.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.install-prompt-btn {
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.install-dismiss-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.install-dismiss-btn:hover,
.install-dismiss-btn:focus-visible {
  color: var(--text-primary);
  border-color: var(--amber);
}

/* ==================== DEFECT PHOTO CAPTURE & AD-HOC REPORT ==================== */
.section-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.report-defect-btn {
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  font-size: 0.84rem;
  font-weight: 800;
  border-color: var(--amber);
  color: var(--amber-text);
  background: var(--bg-amber-soft);
}

.report-defect-btn .btn-svg {
  color: var(--amber);
}

body.cab-mode .report-defect-btn {
  color: var(--amber-bright);
  border-color: var(--amber-bright);
  background: rgba(245, 158, 11, 0.14);
}

.defect-photo-widget {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.defect-photo-btn {
  cursor: pointer;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 2px solid var(--amber);
  background: var(--bg-amber-soft);
  color: var(--text-primary);
  font-weight: 800;
}

.defect-photo-btn .camera-svg {
  color: var(--amber);
}

body.cab-mode .defect-photo-btn {
  background: rgba(245, 158, 11, 0.16);
  border-color: var(--amber-bright);
  color: #F8FAFC;
}

.defect-photo-hint {
  font-size: 0.78rem;
}

.defect-photo-preview-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-well);
  flex-wrap: wrap;
}

.defect-photo-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--amber);
  flex-shrink: 0;
}

.defect-photo-meta {
  flex: 1 1 160px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-start;
}

.defect-size-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  color: var(--emerald);
}

.defect-photo-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.defect-retake-btn,
.defect-remove-btn {
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}

.defect-inline-photo-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
}

/* ==================== MANDATORY PHOTO PROOF INDICATORS ==================== */
.photo-required-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  background: var(--bg-amber-soft);
  border: 1.5px solid var(--brand-primary, var(--amber));
  color: var(--amber-text);
  flex-shrink: 0;
}

.photo-required-pill .camera-svg {
  width: 14px;
  height: 14px;
  color: var(--brand-primary, var(--amber));
}

body.cab-mode .photo-required-pill {
  background: rgba(245, 158, 11, 0.16);
  border-color: var(--amber-bright);
  color: var(--amber-bright);
}

body.cab-mode .photo-required-pill .camera-svg {
  color: var(--amber-bright);
}

.pass-proof-wrap {
  margin-top: 0.65rem;
  padding: 0.65rem;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--brand-primary, var(--amber));
  background: var(--bg-surface);
}

.pass-proof-wrap.is-missing {
  border-color: var(--danger-bright);
  background: var(--danger-bg);
}

.check-item-card.is-photo-missing {
  border-color: var(--danger-bright);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.18);
}

.photo-missing-banner[hidden] {
  display: none !important;
}

.photo-missing-banner {
  margin: 0 0 0.55rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 800;
}

body.cab-mode .photo-missing-banner {
  color: #FCA5A5;
  border-color: var(--danger-bright);
}

/* ==================== ITEMISED ROADSIDE PASS TABLE & A4 PRINT ==================== */
.pass-check-card {
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.pass-legacy-notice {
  margin: 0.75rem 0 0;
  font-size: 0.84rem;
}

.pass-section-block {
  margin-top: 0.85rem;
}

.pass-section-title {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--amber);
  margin-bottom: 0.35rem;
}

body.cab-mode .pass-section-title {
  color: var(--amber-bright);
}

.pass-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.pass-audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.pass-audit-table thead {
  display: table-header-group;
  background: var(--bg-well);
}

.pass-audit-table th {
  text-align: left;
  padding: 0.45rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border-color);
}

.pass-audit-table th.col-outcome,
.pass-audit-table td.col-outcome {
  text-align: right;
  white-space: nowrap;
  vertical-align: top;
  width: 1%;
}

.pass-audit-table td {
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.pass-audit-table tbody tr:last-child td {
  border-bottom: none;
}

.pass-audit-row.is-defect-row {
  background: var(--bg-amber-soft);
}

.pass-item-line {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pass-item-label {
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.pass-item-meta {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.pass-item-note {
  margin-top: 0.3rem;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pass-item-rectified {
  margin-top: 0.3rem;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  background: var(--emerald-bg);
  border: 1px solid var(--emerald-border);
  font-size: 0.78rem;
  color: var(--emerald);
}

.pass-item-thumb-btn {
  margin-top: 0.4rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.pass-item-thumb {
  width: 52px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.pass-lightbox-img {
  display: block;
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #0F172A;
}

@page {
  size: A4 portrait;
  margin: 12mm;
}

@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body,
  body.cab-mode {
    background: #FFFFFF !important;
    color: #0F172A !important;
    padding: 0 !important;
  }

  .top-bar,
  .bottom-nav,
  .install-app-banner,
  #loginView,
  #modalBackdrop,
  #toastContainer,
  #panel-run,
  #panel-walkaround,
  #panel-swap,
  #passPdfLink,
  #passPrintBtn,
  #passRefreshBtn,
  #passStartWalkaroundBtn,
  [data-check-pdf-link] {
    display: none !important;
  }

  #driverShell,
  .main-content,
  #panel-pass {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .card,
  .pass-check-card,
  .pass-kv {
    box-shadow: none !important;
    background: #FFFFFF !important;
    color: #0F172A !important;
    border-color: #CBD5E1 !important;
    break-inside: avoid-column;
  }

  .pass-audit-table thead {
    display: table-header-group !important;
    background: #F1F5F9 !important;
  }

  .pass-audit-table tr,
  .pass-audit-row {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .pass-item-thumb-btn span {
    display: none !important;
  }

  .pass-item-thumb-btn {
    border: none !important;
    padding: 0 !important;
    min-height: 0 !important;
  }
}

/* ==================== RUN MODE SWITCHER & MOBILE SHIFT CALENDAR ==================== */
.run-mode-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.35rem;
  background: var(--bg-well);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
}

.run-mode-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
}

.run-mode-btn.is-active {
  background: var(--bg-surface);
  color: var(--amber-text);
  border-color: var(--brand-primary, var(--amber));
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.run-mode-btn.is-active .btn-svg {
  color: var(--brand-primary, var(--amber));
}

body.cab-mode .run-mode-btn.is-active {
  background: #1E293B;
  color: var(--amber-bright);
  border-color: var(--amber-bright);
}

.cal-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.cal-nav-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cal-today-btn {
  min-height: 44px;
  padding: 0 0.7rem;
  font-size: 0.8rem;
  font-weight: 800;
  flex-shrink: 0;
}

.cal-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

.cal-month-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-primary);
}

.cal-offline-pill {
  margin-top: 0.25rem;
  font-size: 0.7rem;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.25rem;
}

.cal-cell {
  min-height: 46px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.2rem 0.1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
}

.cal-cell.is-outside {
  opacity: 0.42;
  background: var(--bg-well);
}

.cal-cell.is-today {
  border-color: var(--brand-primary, var(--amber));
  box-shadow: inset 0 0 0 1.5px var(--brand-primary, var(--amber));
  background: var(--bg-amber-soft);
}

.cal-cell.is-selected {
  background: var(--brand-primary, var(--amber));
  border-color: var(--brand-primary, var(--amber));
  color: var(--brand-contrast, #FFFFFF);
}

body.cab-mode .cal-cell.is-selected {
  color: #0F172A;
}

.cal-day-num {
  font-size: 0.85rem;
  line-height: 1;
}

.cal-dots-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 7px;
}

.cal-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.cal-cell.is-selected .cal-dot {
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.9);
}

.dot-scheduled { background: var(--brand-primary, #D97706); }
.dot-in-progress { background: #2563EB; }
.dot-completed { background: #10B981; }
.dot-vor-locked { background: #DC2626; }

.cal-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.7rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.cal-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.pill-info {
  background: #DBEAFE;
  color: #1E40AF;
  border: 1px solid #93C5FD;
}

body.cab-mode .pill-info {
  background: rgba(37, 99, 235, 0.25);
  color: #BFDBFE;
  border-color: #60A5FA;
}

.cal-shift-item {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  background: var(--bg-well);
  margin-bottom: 0.65rem;
}

.cal-shift-item:last-child {
  margin-bottom: 0;
}

.cal-shift-item.is-vor {
  border-color: var(--danger-bright);
  background: var(--danger-bg);
}

.cal-shift-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.cal-shift-title {
  display: block;
  font-size: 0.98rem;
  line-height: 1.25;
}

.cal-shift-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.cal-shift-route {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.cal-future-note {
  margin-top: 0.5rem;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cal-empty-state {
  padding: 1rem 0.75rem;
  text-align: center;
  border-radius: var(--radius-md);
  background: var(--bg-well);
  border: 1.5px dashed var(--border-color);
  font-weight: 700;
  color: var(--text-muted);
}
