/* ==========================================================================
   iFleet GPS - Apple Design System & Modern UI
   ========================================================================== */

:root {
  --vehicle-sheet-width: 510px;

  /* Apple System Light Palette */
  --bg-app: #f5f5f7;
  --panel-bg: rgba(255, 255, 255, 0.76);
  --panel-bg-hover: rgba(255, 255, 255, 0.92);
  --panel-border: rgba(255, 255, 255, 0.65);
  --panel-inner-border: rgba(0, 0, 0, 0.06);
  --panel-shadow: 0 12px 32px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);

  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --text-tertiary: #a1a1a6;

  /* Apple System Accents */
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-blue-light: rgba(0, 113, 227, 0.12);
  
  --apple-green: #34c759;
  --apple-green-light: rgba(52, 199, 89, 0.15);
  
  --apple-amber: #ff9500;
  --apple-amber-light: rgba(255, 149, 0, 0.15);
  
  --apple-red: #ff3b30;
  --apple-red-light: rgba(255, 59, 48, 0.15);

  --apple-purple: #af52de;
  --apple-purple-light: rgba(175, 82, 222, 0.15);

  --segmented-bg: rgba(0, 0, 0, 0.05);
  --segmented-active: #ffffff;
  --segmented-active-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 0.5px 2px rgba(0, 0, 0, 0.08);

  --input-bg: rgba(0, 0, 0, 0.05);
  --input-focus-border: #0071e3;

  /* Typography & Layout */
  --font-family: -apple-system, BlinkMacSystemFont, "Plus Jakarta Sans", "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --blur-intensity: 24px;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  
  --sidebar-width: 410px;
  --top-nav-height: 60px;
}

/* Apple Dark Mode Palette */
body.dark-mode {
  --bg-app: #09090b;
  --panel-bg: rgba(24, 24, 28, 0.78);
  --panel-bg-hover: rgba(36, 36, 42, 0.88);
  --panel-border: rgba(255, 255, 255, 0.12);
  --panel-inner-border: rgba(255, 255, 255, 0.08);
  --panel-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.3);
  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);

  --text-primary: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;

  --apple-blue: #0a84ff;
  --apple-blue-hover: #409cff;
  --apple-blue-light: rgba(10, 132, 255, 0.2);

  --apple-green: #30d158;
  --apple-green-light: rgba(48, 209, 88, 0.2);

  --apple-amber: #ff9f0a;
  --apple-amber-light: rgba(255, 159, 10, 0.2);

  --apple-red: #ff453a;
  --apple-red-light: rgba(255, 69, 58, 0.2);

  --apple-purple: #bf5af2;
  --apple-purple-light: rgba(191, 90, 242, 0.2);

  --segmented-bg: rgba(255, 255, 255, 0.08);
  --segmented-active: rgba(255, 255, 255, 0.18);
  --segmented-active-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);

  --input-bg: rgba(255, 255, 255, 0.07);
  --input-focus-border: #0a84ff;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Universal Lucide Icon Normalization (Apple HIG Standard) */
svg.lucide,
i[data-lucide] {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke-width: 1.85px;
  width: 14px;
  height: 14px;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: var(--font-family);
  background-color: #f5f5f7;
  color: var(--text-primary);
  user-select: none;
}

body.dark-mode {
  background-color: #09090b;
}

/* --------------------------------------------------------------------------
   Layout: Unified 3-Column macOS Desktop Workspace (Contiguous & Rounded Apple Window)
   -------------------------------------------------------------------------- */
.app-layout {
  position: relative;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 12px !important;
  gap: 0 !important; /* Unified 0px gap between panes */
  border: none;
  background-color: #eef1f5 !important; /* Soft Schoolus/Apple background canvas */
  display: flex;
  flex-direction: row;
  overflow: hidden;
  box-sizing: border-box;
}

body.dark-mode .app-layout {
  background-color: #0b0d11 !important;
}

/* Main Map Stage: Column 3 - Fluid Canvas on the Right (Flush with Column 2) */
.main-map-stage {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: auto !important;
  height: 100% !important;
  border-radius: 0 22px 22px 0 !important; /* Rounded outer right corner */
  overflow: hidden !important;
  background: #e5e3df !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-left: none !important;
  box-shadow: 4px 4px 24px rgba(0, 0, 0, 0.04) !important;
  z-index: 10 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.dark-mode .main-map-stage {
  background: #12141a !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 4px 4px 24px rgba(0, 0, 0, 0.35) !important;
}

.map-box-frame {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 22px 22px 0 !important;
  overflow: hidden !important;
  border: none !important;
}

body.dark-mode .map-box-frame {
  border: none;
  box-shadow: none;
  background: #12141a;
}

.map-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-color: #e5e3df;
}

/* Glassmorphism Generic Utility */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(var(--blur-intensity)) saturate(185%);
  -webkit-backdrop-filter: blur(var(--blur-intensity)) saturate(185%);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  transition: background-color 0.3s cubic-bezier(0.25, 1, 0.5, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* --------------------------------------------------------------------------
   Top Navigation Island (Apple Dynamic Island style)
   -------------------------------------------------------------------------- */
.top-nav-island {
  position: absolute;
  top: 16px;
  left: calc(var(--sidebar-width) + 116px);
  right: auto;
  max-width: calc(100vw - var(--sidebar-width) - 340px);
  height: var(--top-nav-height);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px 0 14px;
  border-radius: var(--radius-full);
  background: var(--panel-bg);
  backdrop-filter: blur(var(--blur-intensity)) saturate(185%);
  -webkit-backdrop-filter: blur(var(--blur-intensity)) saturate(185%);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  pointer-events: auto;
  transition: all 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}

body.sidebar-closed .top-nav-island {
  left: 96px;
  max-width: calc(100vw - 340px);
}

.brand-pill {
  display: flex;
  align-items: center;
  gap: 12px;
}

.apple-logo-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--apple-blue), #004fb0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 113, 227, 0.35);
}

.apple-logo-badge .brand-icon {
  width: 18px;
  height: 18px;
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--apple-green-light);
  color: var(--apple-green);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--apple-green);
  box-shadow: 0 0 0 rgba(52, 199, 89, 0.5);
  animation: pulse-ring 2s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.6);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(52, 199, 89, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
  }
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-stat-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--input-bg);
  padding: 6px 14px;
  border-radius: var(--radius-full);
}

.quick-stat-chip strong {
  color: var(--text-primary);
  font-weight: 600;
}

.chip-icon {
  width: 14px;
  height: 14px;
}

.text-success { color: var(--apple-green); }
.text-accent { color: var(--apple-blue); }
.text-purple { color: var(--apple-purple); }
.text-warning { color: var(--apple-amber); }
.text-danger { color: var(--apple-red); }

/* Buttons */
.apple-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.apple-action-btn.primary {
  background: var(--apple-blue);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.28);
}

.apple-action-btn.primary:hover {
  background: var(--apple-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.35);
}

.apple-action-btn.primary:active {
  transform: translateY(0);
}

.apple-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--input-bg);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.apple-icon-btn:hover {
  background: var(--panel-bg-hover);
  color: var(--apple-blue);
}

.apple-icon-btn i,
.apple-icon-btn svg {
  width: 17px !important;
  height: 17px !important;
  stroke-width: 1.85px;
}

/* --------------------------------------------------------------------------
   Left Sidebar List Pane (Apple Find My Pane - Column 2, Flush with Column 1)
   -------------------------------------------------------------------------- */
.apple-sidebar {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  width: 390px !important;
  min-width: 390px !important;
  max-width: 390px !important;
  height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
  background: #ffffff !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  z-index: 30 !important;
  flex-shrink: 0 !important;
  transition: width 0.25s cubic-bezier(0.2, 0.9, 0.3, 1), min-width 0.25s ease, opacity 0.2s ease, margin 0.25s ease !important;
}

body.dark-mode .apple-sidebar {
  background: #181a20 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

.apple-sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  margin-right: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: none !important;
  padding: 0 !important;
}

/* Hide duplicate mode switcher since Left Apple Admin Menu is the master switcher */
.sidebar-mode-switcher {
  display: none !important;
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.apple-circle-btn.ghost {
  background: var(--input-bg);
  color: var(--text-secondary);
}

.apple-circle-btn.ghost:hover {
  background: var(--panel-bg-hover);
  color: var(--text-primary);
}

.sidebar-header {
  padding: 20px 20px 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-bottom: 1px solid var(--panel-inner-border);
}

.sidebar-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.sidebar-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 1px;
}

.apple-circle-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--apple-blue);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.apple-circle-btn:hover {
  background: var(--apple-blue-hover);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.4);
}

.apple-circle-btn i,
.apple-circle-btn svg {
  width: 15px !important;
  height: 15px !important;
  stroke-width: 1.85px;
}

/* --------------------------------------------------------------------------
   Sidebar Primary Mode Switcher (Araçlarım vs Müşteriler)
   -------------------------------------------------------------------------- */
.sidebar-mode-switcher {
  display: flex;
  background: var(--segmented-bg);
  padding: 2.5px;
  border-radius: 9px;
  gap: 2px;
  margin-bottom: 2px;
  height: 32px;
  box-sizing: border-box;
}

.mode-tab-btn {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 4px;
  height: 100%;
  font-size: 11.5px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mode-tab-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.45);
}

.mode-tab-btn.active {
  background: var(--segmented-active);
  color: var(--apple-blue);
  font-weight: 500; /* Identical 500 font-weight strictly prevents text width growth and layout shift */
  box-shadow: var(--segmented-active-shadow);
}

body.dark-mode .mode-tab-btn.active {
  color: #38a5ff;
}

.mode-tab-btn i,
.mode-tab-btn svg {
  width: 13px !important;
  height: 13px !important;
  min-width: 13px;
  min-height: 13px;
  flex-shrink: 0;
  opacity: 0.85;
}

.mode-tab-btn.active i,
.mode-tab-btn.active svg {
  opacity: 1;
}

.mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  line-height: 1;
  box-sizing: border-box;
  margin-left: 2px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.mode-tab-btn:hover:not(.active) .mode-badge {
  background: rgba(0, 0, 0, 0.09);
  color: var(--text-primary);
}

.mode-tab-btn.active .mode-badge {
  background: rgba(0, 113, 227, 0.12);
  color: var(--apple-blue);
}

body.dark-mode .mode-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #aeaeb2;
}

body.dark-mode .mode-tab-btn.active .mode-badge {
  background: rgba(56, 165, 255, 0.22);
  color: #38a5ff;
}

/* Apple Search Box */
.apple-search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border-radius: var(--radius-md);
  padding: 0 12px;
  height: 38px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.apple-search-box:focus-within {
  background: var(--panel-bg-hover);
  box-shadow: 0 0 0 2px var(--input-focus-border);
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  margin-right: 8px;
}

.apple-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
}

.apple-search-box input::placeholder {
  color: var(--text-tertiary);
}

.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  padding: 2px;
}

.search-clear-btn i {
  width: 14px;
  height: 14px;
}

.search-shortcut {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-tertiary);
  margin-left: 6px;
}

body.dark-mode .search-shortcut {
  background: rgba(255, 255, 255, 0.1);
}

/* Segmented Filter Control (Apple System Segmented Control) */
.segmented-filter {
  display: flex;
  background: rgba(118, 118, 128, 0.12);
  padding: 2px;
  border-radius: 9px;
  gap: 2px;
  width: 100%;
  box-sizing: border-box;
  height: 32px;
  align-items: stretch;
}

body.dark-mode .segmented-filter {
  background: rgba(118, 118, 128, 0.24);
}

.filter-tab {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  padding: 0 4px;
  font-size: 11.5px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: #636366;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.filter-tab:hover:not(.active) {
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.45);
}

body.dark-mode .filter-tab {
  color: #aeaeb2;
}

body.dark-mode .filter-tab:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.filter-tab.active {
  background: #ffffff;
  color: #1d1d1f;
  font-weight: 500; /* Identical weight - strictly prevents text width growth */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 0.5px 1px rgba(0, 0, 0, 0.06);
}

body.dark-mode .filter-tab.active {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* Authentic Apple Segmented Count Capsule Badges */
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  line-height: 1;
  box-sizing: border-box;
  margin-left: 4px;
  transition: all 0.18s ease;
}

.filter-tab:hover:not(.active) .tab-count {
  background: rgba(0, 0, 0, 0.09);
  color: var(--text-primary);
}

.filter-tab.active .tab-count {
  background: rgba(0, 113, 227, 0.12);
  color: var(--apple-blue);
}

body.dark-mode .tab-count {
  background: rgba(255, 255, 255, 0.1);
  color: #aeaeb2;
}

body.dark-mode .filter-tab.active .tab-count {
  background: rgba(56, 165, 255, 0.22);
  color: #38a5ff;
}

/* Alert badge: Distinct soft red pill when count > 0 */
.filter-tab[data-filter="alert"] .tab-count {
  background: rgba(255, 59, 48, 0.12);
  color: var(--apple-red);
  font-weight: 700;
}

.filter-tab[data-filter="alert"].active .tab-count {
  background: var(--apple-red);
  color: #ffffff;
}

body.dark-mode .filter-tab[data-filter="alert"] .tab-count {
  background: rgba(255, 69, 58, 0.2);
  color: #ff453a;
}

body.dark-mode .filter-tab[data-filter="alert"].active .tab-count {
  background: #ff453a;
  color: #ffffff;
}

/* Customer Filter Bar with horizontal scroll & non-wrapping chips */
.customer-filter-bar {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-wrap: nowrap;
}

#customer-filter-bar[style*="display: none"],
#fleet-filter-bar[style*="display: none"] {
  display: none !important;
}

.customer-filter-bar::-webkit-scrollbar {
  display: none;
}

.customer-filter-bar .filter-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 2px;
  font-size: 11px;
  white-space: nowrap;
  justify-content: center;
}

/* Apple Segmented Control for View Switchers (Bento Grid vs Table) */
.apple-segmented-control {
  display: inline-flex;
  align-items: center;
  background: rgba(118, 118, 128, 0.12);
  padding: 2.5px;
  border-radius: 9px;
  gap: 2px;
  height: 32px;
  box-sizing: border-box;
}

body.dark-mode .apple-segmented-control {
  background: rgba(118, 118, 128, 0.24);
}

.segmented-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.segmented-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.45);
}

body.dark-mode .segmented-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.segmented-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 0.5px 1px rgba(0, 0, 0, 0.06);
}

body.dark-mode .segmented-btn.active {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.segmented-btn i,
.segmented-btn svg {
  width: 13px !important;
  height: 13px !important;
  stroke-width: 1.85px;
}

/* --------------------------------------------------------------------------
   Vehicle List Items
   -------------------------------------------------------------------------- */
.sidebar-content {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 12px 32px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto !important;
  box-sizing: border-box;
}

/* Custom Minimalist Scrollbar */
.sidebar-content::-webkit-scrollbar {
  width: 5px;
}
.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}
body.dark-mode .sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

/* Vehicle Card */
.vehicle-card {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--panel-inner-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vehicle-card:hover {
  background: var(--panel-bg-hover);
  box-shadow: var(--card-shadow);
  border-color: rgba(0, 113, 227, 0.3);
}

.vehicle-card.active {
  border-color: var(--apple-blue);
  background: var(--panel-bg-hover);
  box-shadow: 0 0 0 2px var(--apple-blue-light), var(--card-shadow);
}

/* Horizontal vehicle layout with car on the LEFT - Grid aligned with right column */
.card-vehicle-layout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.card-van-column {
  width: 62px;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.025);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  margin-top: 1px;
}

body.dark-mode .card-van-column {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.card-van-thumb-side {
  width: 54px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.18));
  transition: filter 0.2s ease;
}

.vehicle-card:hover .card-van-thumb-side {
  filter: drop-shadow(0 5px 10px rgba(0, 113, 227, 0.25));
}

.vehicle-card.active .card-van-thumb-side {
  transform: none;
}

.card-info-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 60px;
  justify-content: space-between;
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 22px;
}

.card-location-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 3px 0 4px 0;
  min-width: 0;
}

.card-loc-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--apple-blue);
  flex-shrink: 0;
  margin-top: 1px;
}

.card-loc-indicator i,
.card-loc-indicator svg {
  width: 13px !important;
  height: 13px !important;
  stroke-width: 2px;
}

.card-loc-details {
  display: flex;
  flex-direction: column;
  gap: 1.5px;
  min-width: 0;
  flex: 1;
}

.card-loc-customer {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.card-address-text {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

body.dark-mode .card-landmark-tag {
  color: #f5f5f7;
}

body.dark-mode .card-address-text {
  color: #a1a1a6;
}

.plate-and-type {
  display: flex;
  align-items: center;
  gap: 8px;
}

.plate-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  background: #ffffff;
  color: #111;
  border-radius: 6px;
  border: 1px solid #c2c2c8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.plate-flag {
  font-size: 8px;
  background: #003399;
  color: white;
  padding: 2px 3px;
  border-radius: 2px;
  font-weight: 800;
}

body.dark-mode .plate-badge {
  background: #1e1e24;
  color: #f5f5f7;
  border-color: #3e3e46;
}

.vehicle-type-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.card-van-thumb {
  width: 58px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.22));
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.vehicle-card:hover .card-van-thumb {
  filter: drop-shadow(0 6px 12px rgba(0, 113, 227, 0.25));
}

.vehicle-card.active .card-van-thumb {
  transform: none;
}

.speed-badge {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-sans);
  padding: 2.5px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap !important;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: -0.01em;
}

.speed-badge i,
.speed-badge svg {
  width: 12px !important;
  height: 12px !important;
  stroke-width: 2.4px !important;
}

.speed-badge.moving {
  background: rgba(52, 199, 89, 0.12);
  color: #248a3d;
  border: 1px solid rgba(52, 199, 89, 0.25);
}

body.dark-mode .speed-badge.moving {
  background: rgba(52, 199, 89, 0.18);
  color: #34c759;
  border-color: rgba(52, 199, 89, 0.35);
}

.speed-badge.idle {
  background: rgba(255, 149, 0, 0.12);
  color: #c97500;
  border: 1px solid rgba(255, 149, 0, 0.25);
}

body.dark-mode .speed-badge.idle {
  background: rgba(255, 149, 0, 0.18);
  color: #ff9f0a;
  border-color: rgba(255, 149, 0, 0.35);
}

.speed-badge.alert {
  background: rgba(255, 59, 48, 0.12) !important;
  color: #d70015 !important;
  border: 1px solid rgba(255, 59, 48, 0.3) !important;
  box-shadow: none !important;
}

body.dark-mode .speed-badge.alert {
  background: rgba(255, 69, 58, 0.2) !important;
  color: #ff453a !important;
  border-color: rgba(255, 69, 58, 0.4) !important;
}

.speed-badge.offline {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-tertiary);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.card-mid-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.card-driver {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-driver i,
.card-driver svg {
  width: 12px !important;
  height: 12px !important;
  color: var(--apple-blue);
  flex-shrink: 0;
}

.card-address-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-address-row i,
.card-address-row svg {
  width: 13px !important;
  height: 13px !important;
  min-width: 13px !important;
  min-height: 13px !important;
  margin-top: 1px !important;
  flex-shrink: 0;
  color: var(--apple-blue);
}

.card-bottom-telemetry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px dashed var(--panel-inner-border);
  font-size: 11px;
  color: var(--text-tertiary);
}

.telemetry-mini-pill {
  display: flex;
  align-items: center;
  gap: 4px;
}

.telemetry-mini-pill i,
.telemetry-mini-pill svg {
  width: 11px !important;
  height: 11px !important;
  min-width: 11px;
  min-height: 11px;
  stroke-width: 2px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Customer Cards & City Categorization Styles
   -------------------------------------------------------------------------- */
.customer-card {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--panel-inner-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.customer-card:hover {
  background: var(--panel-bg-hover);
  box-shadow: var(--card-shadow);
  border-color: rgba(0, 113, 227, 0.3);
}

.customer-card.active {
  border-color: var(--apple-blue);
  background: var(--panel-bg-hover);
  box-shadow: 0 0 0 2px var(--apple-blue-light), var(--card-shadow);
}

/* Active Customer Visit (When a vehicle is currently at this customer) */
.customer-card.active-visit {
  border-color: rgba(52, 199, 89, 0.5) !important;
  background: rgba(52, 199, 89, 0.05);
  box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.2), var(--card-shadow) !important;
}

body.dark-mode .customer-card.active-visit {
  background: rgba(52, 199, 89, 0.1);
  border-color: rgba(52, 199, 89, 0.7) !important;
}

/* Card Customer Layout with Left Visual Anchor */
.card-customer-layout {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-customer-column {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

body.dark-mode .card-customer-column {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.06);
}

.card-customer-column.visiting-active {
  background: rgba(52, 199, 89, 0.12);
  border-color: rgba(52, 199, 89, 0.35);
  box-shadow: 0 0 10px rgba(52, 199, 89, 0.2);
}

.cust-icon-squircle {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cust-icon-squircle i,
.cust-icon-squircle svg {
  width: 17px !important;
  height: 17px !important;
}

.cust-icon-squircle.madrid {
  background: rgba(0, 113, 227, 0.1);
  color: var(--apple-blue);
  border: 1px solid rgba(0, 113, 227, 0.18);
}

.cust-icon-squircle.alicante {
  background: rgba(255, 149, 0, 0.12);
  color: var(--apple-amber);
  border: 1px solid rgba(255, 149, 0, 0.22);
}

.cust-icon-squircle.valencia {
  background: rgba(175, 82, 222, 0.12);
  color: var(--apple-purple);
  border: 1px solid rgba(175, 82, 222, 0.22);
}

.cust-visiting-van {
  width: 48px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.cust-live-beacon {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.customer-category-text {
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.customer-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  padding-top: 6px;
  border-top: 1px dashed var(--panel-inner-border);
}

.cust-contact {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.cust-contact i,
.cust-contact svg {
  width: 12px !important;
  height: 12px !important;
  color: var(--apple-blue);
  flex-shrink: 0;
}

.cust-nav-hint {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--apple-blue);
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}

.cust-nav-hint i,
.cust-nav-hint svg {
  width: 12px !important;
  height: 12px !important;
}

.city-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.city-pill.madrid {
  background: rgba(0, 113, 227, 0.12);
  color: var(--apple-blue);
}
.city-pill.alicante {
  background: rgba(255, 149, 0, 0.14);
  color: var(--apple-amber);
}
.city-pill.valencia {
  background: rgba(175, 82, 222, 0.14);
  color: var(--apple-purple);
}

.visit-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.visit-badge.active {
  background: var(--apple-green-light);
  color: var(--apple-green);
  animation: pulse-visit 2s infinite ease-in-out;
}

@keyframes pulse-visit {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.visit-badge.idle {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-tertiary);
}
body.dark-mode .visit-badge.idle {
  background: rgba(255, 255, 255, 0.08);
}

/* Active vehicle banner inside customer card */
.customer-active-vehicle-banner {
  margin-top: 4px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  background: rgba(52, 199, 89, 0.12);
  border: 1px solid rgba(52, 199, 89, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body.dark-mode .customer-active-vehicle-banner {
  background: rgba(52, 199, 89, 0.18);
  border-color: rgba(52, 199, 89, 0.4);
}

.banner-vehicle-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.banner-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apple-green);
  box-shadow: 0 0 6px var(--apple-green);
  animation: pulse-dot 1.4s infinite;
}

.banner-duration {
  font-size: 11px;
  color: var(--apple-green);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Sidebar Footer (Relocated Stats from Top Bar)
   -------------------------------------------------------------------------- */
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--panel-inner-border);
  background: rgba(255, 255, 255, 0.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.dark-mode .sidebar-footer {
  background: rgba(20, 20, 24, 0.55);
}

.sidebar-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.sidebar-stat-box {
  background: var(--input-bg);
  border-radius: var(--radius-md);
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid var(--panel-inner-border);
  transition: all 0.2s ease;
}

.sidebar-stat-box:hover {
  background: var(--panel-bg-hover);
}

.sidebar-stat-box.highlight-box {
  border-color: rgba(52, 199, 89, 0.3);
  background: rgba(52, 199, 89, 0.06);
}

.stat-number {
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
}

.fleet-health-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}

.health-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.health-dot.online {
  background-color: var(--apple-green);
  box-shadow: 0 0 6px var(--apple-green);
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-sim-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  border: none;
  background: var(--apple-blue);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.footer-sim-pill:hover {
  background: var(--apple-blue-hover);
  transform: translateY(-1px);
}

.footer-sim-pill i {
  width: 12px;
  height: 12px;
}

.footer-theme-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--input-bg);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.footer-theme-btn:hover {
  background: var(--panel-bg-hover);
  transform: scale(1.08);
}

.footer-theme-btn i {
  width: 14px;
  height: 14px;
}

/* --------------------------------------------------------------------------
   Floating Map Controls (Right Side - Map Layer & Vertical Zoom Pill)
   Must always stay on the far right (top-right of map stage)
   -------------------------------------------------------------------------- */
.floating-map-controls {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  z-index: 95 !important; /* Higher than vehicle sheet (z-index 60) so it cleanly overlays */
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 8px !important;
  pointer-events: auto !important;
  transition: opacity 0.2s ease, visibility 0.2s ease !important;
}

/* Hide floating map controls completely when Admin Panel is open so they never block tabs/buttons */
body.admin-drawer-open .floating-map-controls,
body:has(.admin-expanded-panel.open) .floating-map-controls {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.floating-map-controls button,
.floating-map-controls div {
  pointer-events: auto;
}

.segmented-layer-control {
  pointer-events: auto !important;
  border-radius: var(--radius-lg);
  padding: 3px;
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  box-sizing: border-box;
  height: 36px;
  background: var(--panel-bg);
  gap: 2px;
}

.segmented-layer-control {
  background: var(--panel-bg);
  gap: 2px;
}

.layer-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer !important;
  pointer-events: auto !important;
  transition: all 0.2s ease;
  height: 30px;
  box-sizing: border-box;
}

.layer-btn i,
.layer-btn svg {
  width: 14px !important;
  height: 14px !important;
  pointer-events: none;
}

.layer-btn span {
  pointer-events: none;
}

.layer-btn.active {
  background: var(--segmented-active);
  color: var(--text-primary);
  box-shadow: var(--segmented-active-shadow);
}

.map-action-group {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 3px !important;
  padding: 4px !important;
  background: var(--panel-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  height: auto !important;
}

.map-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer !important;
  pointer-events: auto !important;
  transition: all 0.18s ease;
}

.map-btn:hover {
  background: var(--input-bg);
  color: var(--apple-blue);
}

.map-btn:active {
  transform: scale(0.96);
}

.map-btn.active {
  background: var(--apple-blue);
  color: #fff;
}

.map-btn i,
.map-btn svg {
  width: 15px !important;
  height: 15px !important;
  pointer-events: none;
}

.map-action-group .divider {
  width: 18px !important;
  height: 1px !important;
  background: var(--panel-inner-border);
  margin: 3px 0 !important;
}

/* --------------------------------------------------------------------------
   Minimalist Apple Maps POI Store Pins
   -------------------------------------------------------------------------- */
.apple-store-pin {
  position: relative;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  z-index: 10;
}

.store-pin-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--apple-blue);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

body.dark-mode .store-pin-circle {
  background: #242426;
  border-color: rgba(255, 255, 255, 0.18);
  color: #5ac8fa;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}

.store-pin-circle i,
.store-pin-circle svg {
  width: 12px !important;
  height: 12px !important;
  pointer-events: none;
}

.apple-store-pin:hover .store-pin-circle {
  transform: scale(1.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  border-color: var(--apple-blue);
}

.apple-store-pin.is-active .store-pin-circle {
  background: #34c759;
  border-color: #28a745;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.35), 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.dark-mode .apple-store-pin.is-active .store-pin-circle {
  background: #30d158;
  border-color: #34c759;
  color: #000000;
  box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.45), 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* Redesigned Apple POI Store Callout Bubble */
.store-pin-tooltip.apple-poi-bubble,
.store-pin-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(6px) scale(0.96);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #1d1d1f;
  padding: 10px 14px;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
  min-width: 190px;
}

.store-pin-tooltip.apple-poi-bubble::after,
.store-pin-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
}

body.dark-mode .store-pin-tooltip.apple-poi-bubble,
body.dark-mode .store-pin-tooltip {
  background: rgba(28, 28, 30, 0.95);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f5f5f7;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
}

body.dark-mode .store-pin-tooltip.apple-poi-bubble::after,
body.dark-mode .store-pin-tooltip::after {
  border-color: rgba(28, 28, 30, 0.95) transparent transparent transparent;
}

.apple-store-pin:hover .store-pin-tooltip,
.apple-store-pin.is-active:hover .store-pin-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.poi-bubble-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.poi-icon-squircle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #34c759 0%, #28a745 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(52, 199, 89, 0.35);
}

.poi-icon-squircle i,
.poi-icon-squircle svg {
  width: 14px !important;
  height: 14px !important;
}

.poi-title-col {
  display: flex;
  flex-direction: column;
}

.poi-bubble-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #1d1d1f;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

body.dark-mode .poi-bubble-name {
  color: #f5f5f7;
}

.poi-bubble-cat {
  font-size: 10px;
  color: #86868b;
  margin-top: 2px;
}

body.dark-mode .poi-bubble-cat {
  color: #a1a1a6;
}

.poi-bubble-visit {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-mode .poi-bubble-visit {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.poi-live-badge {
  background: rgba(52, 199, 89, 0.12);
  color: #28a745;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

body.dark-mode .poi-live-badge {
  background: rgba(48, 209, 88, 0.2);
  color: #30d158;
}

.poi-visit-info {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #1d1d1f;
}

body.dark-mode .poi-visit-info {
  color: #f5f5f7;
}

/* --------------------------------------------------------------------------
   Apple Map Tiles Post-Processing Filters (Pastel Light & OLED Dark)
   -------------------------------------------------------------------------- */
.apple-tiles {
  filter: saturate(0.9) contrast(0.98) brightness(1.02);
  transition: filter 0.4s ease;
}

body.dark-mode .apple-tiles {
  filter: invert(100%) hue-rotate(180deg) brightness(88%) contrast(96%);
}

.dark-tiles {
  filter: brightness(0.85) contrast(1.15);
}

.satellite-tiles {
  filter: contrast(1.08) saturate(1.1);
}

/* --------------------------------------------------------------------------
   Custom Leaflet Map Markers & Animations
   -------------------------------------------------------------------------- */
.leaflet-popup-content-wrapper {
  background: var(--panel-bg) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--panel-shadow) !important;
  color: var(--text-primary) !important;
  padding: 4px;
}

.leaflet-popup-tip {
  background: var(--panel-bg) !important;
}

/* Apple MapKit JS Annotation container override */
.mk-annotation {
  overflow: visible !important;
}

.apple-car-marker {
  position: relative;
  width: 30px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s ease;
  z-index: 20;
}

.marker-vehicle-container {
  position: relative;
  width: 28px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s linear;
  transform-origin: center center;
  will-change: transform;
}

.marker-vehicle-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease, filter 0.2s ease;
  pointer-events: none;
}

.apple-car-marker:hover .marker-vehicle-img {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.apple-car-marker.is-active .marker-vehicle-img {
  filter: drop-shadow(0 0 6px rgba(0, 113, 227, 0.7)) drop-shadow(0 3px 8px rgba(0, 0, 0, 0.35));
}

/* --------------------------------------------------------------------------
   Vehicle Detail Modal / Sheet (<dialog>)
   Adhering to Modern Web Guidance: animate-to-from-top-layer
   -------------------------------------------------------------------------- */
dialog.apple-sheet,
dialog#vehicle-detail-dialog {
  position: absolute !important;
  inset: auto !important;
  top: auto !important;
  bottom: 14px !important;
  right: 14px !important;
  left: auto !important;
  margin: 0 !important;
  width: 410px !important;
  min-width: 410px !important;
  max-width: calc(100vw - 260px) !important;
  height: auto !important;
  max-height: calc(100% - 28px) !important;
  border-radius: 20px !important; /* Authentic Apple Sheet rounded corners */
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(32px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(190%) !important;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  padding: 0 !important;
  z-index: 60 !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, display 0.28s allow-discrete !important;
}

body.dark-mode dialog.apple-sheet,
body.dark-mode dialog#vehicle-detail-dialog {
  background: rgba(22, 24, 30, 0.97) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.45) !important;
}

dialog.apple-sheet:focus,
dialog.apple-sheet:focus-visible,
dialog.apple-sheet:focus-within {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

dialog.apple-sheet::backdrop {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: none !important;
}

@starting-style {
  dialog.apple-sheet[open],
  dialog#vehicle-detail-dialog[open] {
    opacity: 0;
    transform: translateX(36px) scale(0.98);
  }
}

dialog.apple-sheet[open],
dialog#vehicle-detail-dialog[open] {
  display: flex !important;
  flex-direction: column !important;
  pointer-events: auto !important;
  opacity: 1;
  transform: translateX(0) scale(1);
}

dialog.apple-sheet[data-closing],
dialog#vehicle-detail-dialog[data-closing] {
  opacity: 0 !important;
  transform: translateX(36px) scale(0.98) !important;
  transition: transform 0.22s cubic-bezier(0.4, 0, 1, 1), opacity 0.2s ease !important;
}

dialog.apple-sheet:not([open]),
dialog#vehicle-detail-dialog:not([open]) {
  display: none !important;
  pointer-events: none !important;
  opacity: 0;
  transform: translateX(36px) scale(0.98);
}

.sheet-container {
  width: 100% !important;
  height: auto !important;
  max-height: calc(100vh - 56px) !important;
  border-radius: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  box-sizing: border-box !important;
  outline: none !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

/* Completely Hide scrollbar for Chrome, Safari, Edge and WebKit */
.sheet-container::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.sheet-container:focus,
.sheet-container:focus-visible,
.sheet-container:focus-within {
  outline: none !important;
}

/* Header Top Badge & Close Row */
.sheet-badge-action-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  line-height: 1;
}

.sheet-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--panel-inner-border);
  background: var(--input-bg);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
  transition: all 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  flex-shrink: 0;
}

.sheet-close-btn:hover {
  background: rgba(255, 59, 48, 0.12);
  color: #ff3b30;
  border-color: rgba(255, 59, 48, 0.35);
  transform: scale(1.1);
}

.sheet-close-btn:active {
  transform: scale(0.94);
}

.sheet-close-btn i,
.sheet-close-btn svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.sheet-header {
  padding-right: 0;
  margin-bottom: 2px;
}

.sheet-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-right: 0;
}

/* --------------------------------------------------------------------------
   Vehicle Showcase Card (True 100% Full Width matching Telemetry Cards)
   -------------------------------------------------------------------------- */
.vehicle-studio-card {
  width: 100%;
  flex-shrink: 0 !important;
  box-sizing: border-box;
  margin-top: 2px;
  margin-bottom: 2px;
  border-radius: var(--radius-lg);
  padding: 10px 16px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(245, 245, 247, 0.85) 100%);
  border: 1px solid var(--panel-inner-border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 130px;
}

body.dark-mode .vehicle-studio-card {
  background: linear-gradient(180deg, rgba(35, 35, 42, 0.8) 0%, rgba(22, 22, 26, 0.95) 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.studio-stage {
  position: relative;
  width: 100%;
  height: 115px;
  flex-shrink: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.studio-spotlight {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 113, 227, 0.15) 0%, rgba(0, 113, 227, 0) 70%);
  transform: translate(-50%, -45%);
  pointer-events: none;
}

body.dark-mode .studio-spotlight {
  background: radial-gradient(ellipse at center, rgba(10, 132, 255, 0.25) 0%, rgba(10, 132, 255, 0) 70%);
}

.studio-pedestal-shadow {
  position: absolute;
  bottom: 6px;
  left: 50%;
  width: 160px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 75%);
  transform: translateX(-50%);
  pointer-events: none;
  animation: pedestal-pulse 3s infinite ease-in-out;
}

@keyframes pedestal-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.8; }
  50% { transform: translateX(-50%) scale(1.08); opacity: 0.55; }
}

.studio-van-model {
  max-width: 210px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.25));
  z-index: 2;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  animation: studio-float 3s infinite ease-in-out;
}

@keyframes studio-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.studio-angle-pills {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  overflow-x: auto;
}

.studio-angle-btn {
  padding: 4px 7px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.studio-angle-btn:hover {
  background: var(--input-bg);
  color: var(--text-primary);
}

.studio-angle-btn.active {
  background: var(--apple-blue);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.35);
}

.studio-spin-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  color: var(--apple-blue);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.studio-spin-btn:hover {
  background: var(--apple-blue);
  color: #fff;
  transform: translateY(-1px);
}

.studio-spin-btn.spinning {
  background: var(--apple-green);
  color: #fff;
  border-color: var(--apple-green);
}

.studio-spin-btn.spinning i {
  animation: spin-turntable 1.2s infinite linear;
}

@keyframes spin-turntable {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sheet-plate-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--apple-blue);
  color: white;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  margin: 0;
  box-shadow: 0 1px 3px rgba(0, 113, 227, 0.3);
}

.sheet-vehicle-name {
  font-size: 15px !important;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sheet-driver-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px !important;
  color: var(--text-secondary);
  margin-top: 3px;
}

.sheet-driver-name i {
  width: 14px;
  height: 14px;
  color: var(--apple-blue);
}

/* Telemetry Grid (Apple Inspector Refined) */
.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.telemetry-card {
  background: var(--input-bg);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--panel-inner-border);
}

.telemetry-card.full-width {
  grid-column: span 2;
}

.telemetry-card.speed-card {
  grid-column: span 1;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.08), rgba(0, 113, 227, 0.02));
  border: 1px solid rgba(0, 113, 227, 0.18);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 10px;
}

.speed-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.speed-card .gauge-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 2px;
}

.speed-card .gauge-value .big-number {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  color: var(--text-primary);
}

.speed-card .gauge-value .unit {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.gauge-sub,
.telemetry-card .gauge-sub,
.speed-card .gauge-sub,
.ignition-card .gauge-sub {
  font-size: 10.5px !important;
  font-weight: 500 !important;
  color: var(--text-tertiary) !important;
  margin-top: 2px !important;
  white-space: nowrap !important;
  letter-spacing: -0.01em !important;
}

.speed-card .speed-bar-wrap {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}

/* Ignition / Engine Card */
.telemetry-card.ignition-card {
  grid-column: span 1;
  background: var(--input-bg);
  border: 1px solid var(--panel-inner-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 10px;
}

.ignition-card .gauge-value {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  height: 20px;
}

.ignition-card .big-status-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1;
}

.ignition-bar-fill {
  height: 100%;
  background: var(--apple-green);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.metric-val-big {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-family: var(--font-sans);
  margin-top: 1px;
}

.card-sub-extra {
  font-size: 10.5px;
  color: var(--text-tertiary);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

body.dark-mode .speed-bar-wrap {
  background: rgba(255, 255, 255, 0.1);
}

.speed-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--apple-green), var(--apple-blue));
  border-radius: 99px;
  transition: width 0.4s ease;
}

.card-label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.telemetry-status-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-row .metric-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.metric-row .metric-val {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  white-space: nowrap;
}

.card-extra {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 1px;
  white-space: nowrap;
}

.progress-linear {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-fill.fuel-fill {
  height: 100%;
  background: var(--apple-blue);
  border-radius: 99px;
}

.telemetry-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  white-space: nowrap;
}

.telemetry-status-row .metric-row {
  margin-top: 0;
}

.telemetry-status-row .card-extra {
  margin-top: 0;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-tertiary);
}

.telemetry-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0;
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator-dot.on {
  background: var(--apple-green);
  box-shadow: 0 0 6px var(--apple-green);
}

.status-indicator-dot.off {
  background: var(--apple-red);
}

.address-text {
  font-size: 11.5px !important;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-top: 2px;
}

.coords-text {
  font-size: 9.5px !important;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Sheet Action Buttons */
.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 6px !important;
  margin-top: 6px !important;
}

.sheet-actions-triplet {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px !important;
  width: 100%;
}

.apple-button {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.apple-button i {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.apple-button.primary {
  background: var(--apple-blue);
  color: white;
}

.sheet-actions .apple-button.primary {
  grid-column: span 3;
  padding: 10px 14px;
  font-size: 13px;
}

.sheet-actions .apple-button.secondary {
  padding: 9px 6px;
  font-size: 11.5px;
  letter-spacing: -0.01em;
  min-width: 0;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sheet-actions .apple-button.secondary i,
.sheet-actions .apple-button.secondary svg {
  width: 12px !important;
  height: 12px !important;
  flex-shrink: 0;
}

.sheet-actions .apple-button.primary i,
.sheet-actions .apple-button.primary svg {
  width: 13px !important;
  height: 13px !important;
  flex-shrink: 0;
}

.sheet-driver-name i,
.sheet-driver-name svg {
  width: 12px !important;
  height: 12px !important;
  flex-shrink: 0;
}

.sheet-close-btn i,
.sheet-close-btn svg {
  width: 13px !important;
  height: 13px !important;
  flex-shrink: 0;
}

.fuel-card-actions button i,
.fuel-card-actions button svg {
  width: 11px !important;
  height: 11px !important;
  flex-shrink: 0;
}

.apple-button.primary:hover {
  background: var(--apple-blue-hover);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.apple-button.secondary {
  background: var(--input-bg);
  color: var(--text-primary);
}

.apple-button.secondary:hover {
  background: var(--panel-bg-hover);
}

.apple-button.danger {
  background: var(--apple-red-light);
  color: var(--apple-red);
}

.apple-button.danger:hover {
  background: var(--apple-red);
  color: white;
}

.apple-button.danger-tint {
  background: rgba(255, 59, 48, 0.12);
  color: var(--apple-red);
  border: 1px solid rgba(255, 59, 48, 0.25);
  grid-column: span 2;
}

.apple-button.danger-tint:hover {
  background: rgba(255, 59, 48, 0.2);
}

/* Route Playback Drawer */
.playback-drawer {
  background: var(--input-bg);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(0, 113, 227, 0.2);
}

.playback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.playback-header span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.playback-header i {
  width: 14px;
  height: 14px;
  color: var(--apple-blue);
}

.playback-time {
  font-family: var(--font-mono);
  color: var(--apple-blue);
  font-weight: 700;
}

.playback-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.playback-play-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--apple-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.playback-play-btn i {
  width: 14px;
  height: 14px;
}

.apple-slider {
  flex: 1;
  accent-color: var(--apple-blue);
  cursor: pointer;
}

.playback-speed-badge {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--panel-bg);
  cursor: pointer;
  border: 1px solid var(--panel-inner-border);
}

/* --------------------------------------------------------------------------
   Dynamic Island Toast Notifications
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  top: auto;
  left: auto;
  transform: none;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.apple-toast {
  pointer-events: auto;
  background: rgba(18, 18, 20, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: #fff;
  border-radius: var(--radius-full);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.apple-toast i {
  width: 16px;
  height: 16px;
}

.toast-tag {
  font-weight: 700;
  color: var(--apple-blue);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   Apple Admin Panel Menu (macOS Settings / Schoolus Reference Style - Column 1)
   -------------------------------------------------------------------------- */
.apple-admin-menu {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  width: 240px !important;
  min-width: 240px !important;
  max-width: 240px !important;
  height: 100% !important;
  border-radius: 22px 0 0 22px !important; /* Rounded outer left corner */
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
  background: #f6f6f8 !important;
  box-shadow: -4px 4px 24px rgba(0, 0, 0, 0.04) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  padding: 14px 12px 14px 12px !important;
  z-index: 50 !important;
  overflow: hidden !important;
  user-select: none !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
}

body.dark-mode .apple-admin-menu {
  background: #14171d !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

.admin-menu-header {
  padding: 2px 4px 14px 4px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 10px;
}

body.dark-mode .admin-menu-header {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.admin-menu-header {
  padding: 8px 6px 16px 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-menu-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.hebe-brand-logo {
  height: 52px;
  max-height: 56px;
  width: auto;
  max-width: 92%;
  margin: 0 auto;
  display: block;
  object-fit: contain;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), filter 0.22s ease;
}

.hebe-brand-logo:hover {
  transform: scale(1.04);
}

body.dark-mode .hebe-brand-logo {
  filter: brightness(1.3) contrast(1.1) drop-shadow(0 4px 16px rgba(0, 113, 227, 0.45));
}

.brand-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0071e3 0%, #0056b3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.35);
  flex-shrink: 0;
}

.brand-logo-icon i,
.brand-logo-icon svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2.2px !important;
  color: #ffffff !important;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.brand-app-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

body.dark-mode .brand-app-name {
  color: #f5f5f7;
}

.brand-app-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  line-height: 1.2;
}

.admin-menu-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 2px;
  scrollbar-width: none;
}

.admin-menu-scroll::-webkit-scrollbar {
  display: none;
}

.admin-menu-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #86868b;
  padding: 12px 8px 4px 8px;
  user-select: none;
}

.admin-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #48484a;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.1s ease !important;
  transform: none;
  text-align: left;
  box-sizing: border-box;
}

body.dark-mode .admin-nav-item {
  color: #a1a1a6;
}

.admin-nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #1d1d1f;
}

body.dark-mode .admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.admin-nav-item:active {
  transform: scale(0.985) !important;
}

/* Stable 24x24 icon container across ALL states (Zero layout shift / Zero growth) */
.admin-nav-item i,
.admin-nav-item svg {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  padding: 3.5px !important;
  border-radius: 7px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  color: #86868b !important;
  stroke: #86868b !important;
  stroke-width: 2px !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: background-color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              stroke 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.admin-nav-item:hover i,
.admin-nav-item:hover svg {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #1d1d1f !important;
  stroke: #1d1d1f !important;
}

body.dark-mode .admin-nav-item:hover i,
body.dark-mode .admin-nav-item:hover svg {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.nav-item-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
  font-weight: 500;
  transition: color 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item-badge {
  font-size: 11px;
  font-weight: 600;
  color: #86868b;
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 7px;
  border-radius: 99px;
  flex-shrink: 0;
  line-height: 1.2;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode .nav-item-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #a1a1a6;
}

.nav-item-badge.danger {
  background: #ff3b30;
  color: #ffffff;
  font-weight: 700;
}

/* Authentic Schoolus Active Nav Item (Crisp icon squircle, no layout shift or growth) */
.admin-nav-item:focus,
.admin-nav-item:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.admin-nav-item.active {
  background: rgba(0, 113, 227, 0.08) !important;
  color: #1d1d1f !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

body.dark-mode .admin-nav-item.active {
  background: rgba(255, 255, 255, 0.09) !important;
  color: #ffffff !important;
}

.admin-nav-item.active i,
.admin-nav-item.active svg {
  background: #0071e3 !important;
  color: #ffffff !important;
  stroke: #ffffff !important;
  border-radius: 7px !important;
  padding: 3.5px !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  box-sizing: border-box !important;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.32) !important;
}

body.dark-mode .admin-nav-item.active i,
body.dark-mode .admin-nav-item.active svg {
  background: #0a84ff !important;
  color: #ffffff !important;
  stroke: #ffffff !important;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.45) !important;
}

.admin-nav-item.active .nav-item-label {
  color: #1d1d1f !important;
  font-weight: 500 !important;
}

body.dark-mode .admin-nav-item.active .nav-item-label {
  color: #ffffff !important;
}

.admin-nav-item.active .nav-item-badge {
  background: rgba(0, 113, 227, 0.12) !important;
  color: #0071e3 !important;
  font-weight: 600 !important;
}

body.dark-mode .admin-nav-item.active .nav-item-badge {
  background: rgba(10, 132, 255, 0.25) !important;
  color: #409cff !important;
}

.admin-nav-item.active .nav-item-badge.danger {
  background: rgba(255, 59, 48, 0.15) !important;
  color: #ff3b30 !important;
}

.nav-item-active-bar {
  display: none !important;
}

.admin-menu-footer {
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

body.dark-mode .admin-menu-footer {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.admin-menu-theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

body.dark-mode .admin-menu-theme-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f5f5f7;
}

.admin-menu-theme-btn:hover {
  background: #f0f0f2;
}

body.dark-mode .admin-menu-theme-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.admin-menu-theme-btn i,
.admin-menu-theme-btn svg {
  width: 15px !important;
  height: 15px !important;
  stroke-width: 2px !important;
}

.admin-menu-user-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 6px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.admin-menu-user-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

body.dark-mode .admin-menu-user-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.user-avatar-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--apple-green), #248a3d);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(52, 199, 89, 0.3);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

body.dark-mode .user-name {
  color: #f5f5f7;
}

.user-role {
  font-size: 10.5px;
  color: var(--text-tertiary);
  line-height: 1.2;
}

/* --------------------------------------------------------------------------
   Integrated Apple Admin & Management Center (Schoolus Boxed Workspace)
   -------------------------------------------------------------------------- */
.admin-expanded-panel {
  position: absolute !important;
  left: calc(240px + 12px) !important;
  top: 12px !important;
  right: 12px !important;
  bottom: 12px !important;
  width: auto !important;
  height: calc(100vh - 24px) !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 0 22px 22px 0 !important;
  background: #ffffff !important;
  box-shadow: 4px 4px 24px rgba(0, 0, 0, 0.04) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-left: none !important;
  display: none !important;
  flex-direction: column !important;
  overflow: hidden !important;
  z-index: 95 !important;
  transform: none !important;
}

body.dark-mode .admin-expanded-panel {
  background: #14171d !important;
  border-left-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

.admin-expanded-panel.open {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.admin-window.admin-macos-split-view,
.admin-window {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  background: transparent !important;
}

/* In Schoolus layout, .apple-admin-menu on the far left is the master menu!
   The inner secondary nav is hidden, providing full width for data cards and tables */
.admin-sidebar-nav {
  display: none !important;
}

.admin-sidebar-header {
  padding: 16px 16px 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.dark-mode .admin-sidebar-header {
  border-color: rgba(255, 255, 255, 0.06);
}

.admin-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 10px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  align-self: flex-start;
}

.admin-back-btn:hover {
  background: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
}

.admin-back-btn i,
.admin-back-btn svg {
  width: 14px !important;
  height: 14px !important;
}

body.dark-mode .admin-back-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

body.dark-mode .admin-back-btn:hover {
  background: #0071e3;
}

.admin-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-brand-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--apple-blue), #004fb0);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
  flex-shrink: 0;
}

.admin-brand-icon-box i,
.admin-brand-icon-box svg {
  width: 17px !important;
  height: 17px !important;
}

.admin-brand-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.admin-brand-desc {
  font-size: 10.5px;
  color: var(--text-tertiary);
}

.admin-sidebar-menu-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  scrollbar-width: none;
}

.admin-sidebar-menu-scroll::-webkit-scrollbar {
  display: none;
}

.admin-menu-group-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  padding: 10px 10px 4px 10px;
  text-transform: uppercase;
}

.admin-sidebar-nav .admin-tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: 36px;
  width: 100%;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.admin-sidebar-nav .admin-tab-btn:hover:not(.active) {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

body.dark-mode .admin-sidebar-nav .admin-tab-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.admin-sidebar-nav .admin-tab-btn.active {
  background: var(--apple-blue);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.3);
}

.admin-sidebar-nav .admin-tab-btn i,
.admin-sidebar-nav .admin-tab-btn svg {
  width: 15px !important;
  height: 15px !important;
  opacity: 0.85;
  flex-shrink: 0;
}

.admin-sidebar-nav .admin-tab-btn.active i,
.admin-sidebar-nav .admin-tab-btn.active svg {
  opacity: 1;
  color: #ffffff;
}

.admin-sidebar-nav .admin-tab-btn span:first-of-type {
  flex: 1;
}

.admin-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.07);
  color: var(--text-secondary);
  line-height: 1;
}

.admin-tab-btn.active .admin-tab-badge {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.admin-tab-badge.red {
  background: rgba(255, 59, 48, 0.15);
  color: var(--apple-red);
}

.admin-tab-btn.active .admin-tab-badge.red {
  background: #ffffff;
  color: var(--apple-red);
}

.admin-sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

body.dark-mode .admin-sidebar-footer {
  border-color: rgba(255, 255, 255, 0.06);
}

.admin-live-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-secondary);
  background: var(--input-bg);
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.admin-user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(0, 0, 0, 0.035);
  padding: 6px 10px;
  border-radius: 9px;
}

body.dark-mode .admin-user-card {
  background: rgba(255, 255, 255, 0.06);
}

.admin-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--apple-blue);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.admin-user-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-user-role {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* Right Admin Content Area */
.admin-content-scroll {
  flex: 1 1 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 28px 36px 140px 36px !important;
  background: #fbfcfd !important;
  box-sizing: border-box !important;
  overscroll-behavior: contain !important;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}

body.dark-mode .admin-content-scroll {
  background: #14171d !important;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.admin-content-scroll::-webkit-scrollbar {
  width: 8px;
}

.admin-content-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.admin-content-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 99px;
}

.admin-content-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.35);
}

body.dark-mode .admin-content-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
}

.admin-tab-content {
  display: none;
  flex-direction: column;
  gap: 22px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.admin-tab-content.active {
  display: flex !important;
  /* animation enabled for directional transitions */
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.admin-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.admin-section-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Apple Data Table */
.admin-table-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

body.dark-mode .admin-table-card {
  background: #242426;
  border-color: rgba(255, 255, 255, 0.08);
}

.apple-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.apple-table th {
  background: #fafafb;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

body.dark-mode .apple-table th {
  background: #1e1e20;
  border-color: rgba(255, 255, 255, 0.06);
}

.apple-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  vertical-align: middle;
}

body.dark-mode .apple-table td {
  border-color: rgba(255, 255, 255, 0.04);
}

.apple-table tr:hover td {
  background: rgba(0, 113, 227, 0.03);
}

/* iOS Switch */
.apple-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.apple-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.apple-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #e5e5ea;
  border-radius: 34px;
  transition: 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

body.dark-mode .apple-switch .slider {
  background-color: #39393d;
}

.apple-switch .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.apple-switch input:checked + .slider {
  background-color: var(--apple-green);
}

.apple-switch input:checked + .slider:before {
  transform: translateX(20px);
}

/* Rules Grid */
.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.rule-card {
  background: var(--input-bg);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.rule-meta {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.rule-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.rule-icon-box.bg-red { background: linear-gradient(135deg, #ff3b30, #d32f2f); }
.rule-icon-box.bg-amber { background: linear-gradient(135deg, #ff9500, #e08500); }
.rule-icon-box.bg-purple { background: linear-gradient(135deg, #af52de, #8e44ad); }
.rule-icon-box.bg-blue { background: linear-gradient(135deg, #0071e3, #0056b3); }

.rule-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.rule-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-top: 2px;
}

/* Gateway Cards */
.gateway-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gateway-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

body.dark-mode .gateway-card {
  background: #242426;
  border-color: rgba(255, 255, 255, 0.08);
}

.gateway-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gateway-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
}
.gateway-badge.online {
  background: var(--apple-green-light);
  color: var(--apple-green);
}

.gateway-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.gateway-meta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.gateway-meta-item strong {
  color: var(--text-primary);
}

/* Drivers Grid */
.drivers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.driver-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

body.dark-mode .driver-card {
  background: #242426;
  border-color: rgba(255, 255, 255, 0.08);
}

.driver-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.driver-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--apple-blue-light);
  color: var(--apple-blue);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.driver-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.driver-phone {
  font-size: 12px;
  color: var(--text-secondary);
}

.driver-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px dashed var(--panel-inner-border);
  padding-top: 8px;
}

/* --------------------------------------------------------------------------
   Vehicle Daily Reports & Speed Intelligence System
   -------------------------------------------------------------------------- */
.report-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

body.dark-mode .report-filter-bar {
  background: #242426;
  border-color: rgba(255, 255, 255, 0.08);
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-item label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.filter-item label i {
  width: 14px;
  height: 14px;
  color: var(--apple-blue);
}

.apple-select,
.apple-date {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--panel-inner-border);
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.apple-select:focus,
.apple-date:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

.filter-quick-dates {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
}

.quick-date-btn {
  padding: 7px 13px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 99px;
  border: 1px solid var(--panel-inner-border);
  background: var(--input-bg);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.quick-date-btn:hover {
  background: var(--panel-bg-hover);
  color: var(--text-primary);
}

.quick-date-btn.active {
  background: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.35);
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Vehicle Daily Overview Hero */
.report-vehicle-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
}

body.dark-mode .report-vehicle-hero {
  background: #242426;
  border-color: rgba(255, 255, 255, 0.08);
}

.report-hero-vehicle {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 280px;
}

.report-hero-thumb {
  width: 96px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.report-hero-title-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.report-hero-title-group .plate-badge {
  align-self: flex-start;
  width: fit-content;
  max-width: max-content;
}

.report-hero-model {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.report-hero-driver {
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Report KPI Cards Row */
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  flex: 1;
}

.report-kpi-card {
  background: var(--input-bg);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--panel-inner-border);
}

.report-kpi-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.report-kpi-val {
  font-size: 19px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.report-kpi-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* Hourly Speed & Activity Chart */
.report-speed-profile-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

body.dark-mode .report-speed-profile-card {
  background: #242426;
  border-color: rgba(255, 255, 255, 0.08);
}

.speed-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.speed-profile-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.speed-profile-title i {
  color: var(--apple-blue);
  width: 18px;
  height: 18px;
}

.speed-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-dot.normal { background: var(--apple-blue); }
.legend-dot.idle { background: #ff9500; }
.legend-dot.overspeed { background: #ff3b30; }

.report-hourly-chart {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 10px;
  align-items: flex-end;
  height: 170px;
  padding: 14px 10px 6px;
  background: var(--input-bg);
  border-radius: 12px;
  border: 1px solid var(--panel-inner-border);
}

.hourly-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
  position: relative;
  cursor: pointer;
}

.hourly-speed-val {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.hourly-col:hover .hourly-speed-val {
  color: var(--apple-blue);
  transform: translateY(-2px);
}

.hourly-bar-wrap {
  width: 100%;
  max-width: 28px;
  height: 110px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  position: relative;
}

body.dark-mode .hourly-bar-wrap {
  background: rgba(255, 255, 255, 0.05);
}

.hourly-bar-fill {
  width: 100%;
  border-radius: 6px 6px 0 0;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}

.hourly-bar-fill.normal {
  background: linear-gradient(180deg, #0071e3 0%, #409cff 100%);
}

.hourly-bar-fill.idle {
  background: linear-gradient(180deg, #ff9500 0%, #ffb340 100%);
}

.hourly-bar-fill.overspeed {
  background: linear-gradient(180deg, #ff3b30 0%, #ff6961 100%);
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.5);
}

.hourly-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* Tooltip for chart bar */
.hourly-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(20, 20, 24, 0.94);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 11.5px;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 100;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.hourly-col:hover .hourly-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Report Trips Table Styles */
.table-card-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.table-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.table-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.report-trips-table td {
  padding: 12px 16px;
  vertical-align: middle;
}

.trip-time-col {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.trip-time-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-weight: normal;
}

.trip-route-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.trip-arrow {
  color: var(--apple-blue);
  font-size: 12px;
  opacity: 0.8;
}

.trip-speed-stat {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}

.trip-speed-stat.overspeed {
  color: #ff3b30;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trip-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  white-space: nowrap;
}

.trip-badge.completed {
  background: var(--apple-green-light);
  color: var(--apple-green);
}

.trip-badge.warning {
  background: #ffebe9;
  color: #d70015;
}

body.dark-mode .trip-badge.warning {
  background: rgba(255, 59, 48, 0.2);
  color: #ff6961;
}

.btn-show-trip-map {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* --------------------------------------------------------------------------
   Responsive & Mobile Friendly (iOS Sheet view)
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   Store Visiting Pill & Dot Indicator (Clean Store Identity)
   -------------------------------------------------------------------------- */
.store-live-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--apple-green);
  border: 2px solid #ffffff;
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.7);
}

body.dark-mode .store-live-dot {
  border-color: #1c1c1e;
}

.store-visiting-pill {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(52, 199, 89, 0.08);
  border: 1px solid rgba(52, 199, 89, 0.22);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body.dark-mode .store-visiting-pill {
  background: rgba(52, 199, 89, 0.14);
  border-color: rgba(52, 199, 89, 0.32);
}

.visiting-pill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.visiting-pill-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.visiting-van-thumb {
  width: 26px;
  height: 16px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
  flex-shrink: 0;
}

.visiting-plate {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.visiting-driver-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  min-width: 0;
  flex: 1;
}

.visiting-driver-tag i {
  width: 12px;
  height: 12px;
  color: #34c759;
  flex-shrink: 0;
}

.visiting-driver-text {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visiting-time-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: #1b873f;
  background: rgba(52, 199, 89, 0.18);
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

body.dark-mode .visiting-time-badge {
  color: #4cd964;
  background: rgba(52, 199, 89, 0.28);
}

.visiting-driver-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #248a3d;
  font-weight: 500;
  padding-left: 2px;
  min-width: 0;
}

body.dark-mode .visiting-driver-row {
  color: #5ee679;
}

.visiting-dot-sep {
  opacity: 0.5;
  font-size: 10px;
}

.visiting-park-text {
  font-size: 10.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.visiting-park-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: #248a3d;
  font-weight: 500;
  padding-left: 2px;
}

body.dark-mode .visiting-park-row {
  color: #5ee679;
}

.visiting-park-row i {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Horizontal Apple Vehicle Chips Bar (Reports Tab)
   -------------------------------------------------------------------------- */
.report-vehicle-pills-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 4px 10px 4px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.report-vehicle-pills-bar.is-dragging {
  cursor: grabbing !important;
  scroll-behavior: auto !important;
}

.report-vehicle-pills-bar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.deck-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.deck-scroll-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.04);
  padding: 2px 4px;
  border-radius: 99px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

body.dark-mode .deck-scroll-actions {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.deck-scroll-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #ffffff;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

body.dark-mode .deck-scroll-btn {
  background: #2c2c2e;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.deck-scroll-btn:hover {
  background: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
  transform: scale(1.05);
}

.deck-scroll-btn:active {
  transform: scale(0.95);
}

.deck-scroll-btn.disabled,
.deck-scroll-btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
  transform: none !important;
}

.deck-scroll-btn i,
.deck-scroll-btn svg {
  width: 14px !important;
  height: 14px !important;
  stroke-width: 2.2px !important;
}

.vehicle-chip-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  height: 60px;
  min-width: 210px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1.5px solid var(--panel-inner-border, rgba(0, 0, 0, 0.08));
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode .vehicle-chip-pill {
  background: #252528;
  border-color: rgba(255, 255, 255, 0.1);
}

.vehicle-chip-pill:hover {
  background: var(--panel-bg-hover, #f2f2f7);
  border-color: rgba(0, 113, 227, 0.35);
  transform: translateY(-1px);
}

.vehicle-chip-pill.active {
  background: rgba(0, 113, 227, 0.08);
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 1px var(--apple-blue), 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.dark-mode .vehicle-chip-pill.active {
  background: rgba(0, 113, 227, 0.18);
  border-color: #38a5ff;
  box-shadow: 0 0 0 1px #38a5ff, 0 2px 8px rgba(0, 0, 0, 0.2);
}

.vehicle-chip-pill .vehicle-chip-thumb,
.vehicle-chip-pill .chip-thumb-img {
  width: 54px;
  height: 34px;
  max-width: 54px;
  max-height: 34px;
  object-fit: contain;
  flex-shrink: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.vehicle-chip-pill .vehicle-chip-info,
.vehicle-chip-pill .chip-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.vehicle-chip-pill .vehicle-chip-plate-row,
.vehicle-chip-pill .chip-top-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vehicle-chip-pill .plate-badge.micro {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
}

.vehicle-chip-pill .vehicle-chip-model,
.vehicle-chip-pill .chip-model {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vehicle-chip-pill.active .vehicle-chip-model,
.vehicle-chip-pill.active .chip-model {
  color: var(--apple-blue);
}

body.dark-mode .vehicle-chip-pill.active .vehicle-chip-model,
body.dark-mode .vehicle-chip-pill.active .chip-model {
  color: #38a5ff;
}

.vehicle-chip-pill .vehicle-chip-driver,
.vehicle-chip-pill .chip-driver {
  font-size: 11px;
  color: var(--text-secondary);
}

.vehicle-chip-pill.active .vehicle-chip-driver {
  color: var(--text-secondary);
}

.vehicle-chip-pill .vehicle-chip-status-dot,
.vehicle-chip-pill .chip-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.vehicle-chip-pill .vehicle-chip-status-dot.on,
.vehicle-chip-pill .chip-status-dot.moving {
  background: #34c759;
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.6);
}

.vehicle-chip-pill .vehicle-chip-status-dot.off,
.vehicle-chip-pill .chip-status-dot.idle {
  background: #ff9500;
}

.vehicle-chip-pill .chip-status-dot.alert {
  background: #ff3b30;
}

/* --------------------------------------------------------------------------
   Horizontal Apple Vehicle Chips Deck (Reports Tab)
   -------------------------------------------------------------------------- */
.report-vehicle-deck {
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vehicle-deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.deck-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deck-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.deck-title i {
  width: 16px;
  height: 16px;
  color: var(--apple-blue);
}

.deck-counter-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--apple-blue);
}

.deck-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   Custom Apple Glass Calendar Picker & Popover (Reports Tab)
   -------------------------------------------------------------------------- */
.apple-calendar-picker-wrapper {
  position: relative;
  min-width: 175px;
}

.apple-calendar-trigger-btn {
  width: 100%;
  min-height: 38px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--panel-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-primary);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

body.dark-mode .apple-calendar-trigger-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.apple-calendar-trigger-btn:hover {
  border-color: var(--apple-blue);
  background: #ffffff;
}

body.dark-mode .apple-calendar-trigger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.cal-icon {
  width: 14px;
  height: 14px;
  color: var(--apple-blue);
  flex-shrink: 0;
}

.cal-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.apple-calendar-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1200;
  width: 290px;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.dark-mode .apple-calendar-popover {
  background: #252528;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.cal-month-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.cal-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

body.dark-mode .cal-nav-btn {
  background: rgba(255, 255, 255, 0.1);
}

.cal-nav-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

body.dark-mode .cal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.cal-nav-btn i {
  width: 14px;
  height: 14px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 4px 0;
  border-bottom: 1px solid var(--panel-inner-border);
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}

.cal-day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.cal-day-cell:hover:not(.empty):not(.disabled) {
  background: rgba(0, 113, 227, 0.12);
  color: var(--apple-blue);
}

.cal-day-cell.selected {
  background: var(--apple-blue) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.4);
}

.cal-day-cell.today:not(.selected) {
  border: 1.5px solid var(--apple-blue);
  color: var(--apple-blue);
  font-weight: 700;
}

.cal-day-cell.empty {
  cursor: default;
}

.cal-day-cell.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cal-quick-footer {
  display: flex;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--panel-inner-border);
}

.cal-preset-btn {
  flex: 1;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

body.dark-mode .cal-preset-btn {
  background: rgba(255, 255, 255, 0.08);
}

.cal-preset-btn:hover {
  color: var(--text-primary);
}

.cal-preset-btn.active {
  background: rgba(0, 113, 227, 0.12);
  color: var(--apple-blue);
}

.picker-opt-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.picker-opt-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.picker-opt-model {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-opt-driver {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.picker-opt-check {
  width: 16px;
  height: 16px;
  color: var(--apple-blue);
  flex-shrink: 0;
}

/* Date Range Inputs */
.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-range-sep {
  color: var(--text-tertiary);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Apple Add Entity Modal (<dialog id="modal-add-entity">)
   -------------------------------------------------------------------------- */
dialog.apple-modal-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  border: none;
  background: transparent;
  padding: 0;
  overflow: visible;
  z-index: 2500;
  width: 90vw;
  max-width: 520px;
}

dialog.apple-modal-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

.apple-modal-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body.dark-mode .apple-modal-card {
  background: #202022;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
}

.apple-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--panel-inner-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-icon-circle.blue {
  background: rgba(0, 113, 227, 0.12);
  color: var(--apple-blue);
}

.modal-header-title h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin: 2px 0 0 0;
}

.apple-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-type-toggle {
  margin-bottom: 4px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-label,
.form-group label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.apple-input,
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="email"] {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-input:hover,
.form-group input:hover {
  background: rgba(0, 0, 0, 0.055);
  border-color: rgba(0, 0, 0, 0.18);
}

.apple-input:focus,
.form-group input:focus {
  background: #ffffff;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

body.dark-mode .apple-input,
body.dark-mode .form-group input[type="text"],
body.dark-mode .form-group input[type="number"],
body.dark-mode .form-group input[type="tel"] {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

body.dark-mode .apple-input:hover,
body.dark-mode .form-group input:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}

body.dark-mode .apple-input:focus,
body.dark-mode .form-group input:focus {
  background: #1c1c1e;
  border-color: #38a5ff;
  box-shadow: 0 0 0 3px rgba(56, 165, 255, 0.25);
}

.apple-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--panel-inner-border);
}

/* --------------------------------------------------------------------------
   Interactive Route & Telemetry Studio Player Modal (Apple macOS Floating Window)
   -------------------------------------------------------------------------- */
dialog.apple-route-player-modal {
  position: fixed !important;
  inset: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: rgba(15, 17, 23, 0.45) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  padding: 12px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  z-index: 3000 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1), display 0.26s allow-discrete !important;
}

@starting-style {
  dialog.apple-route-player-modal[open] {
    opacity: 0;
  }
  dialog.apple-route-player-modal[open] .player-window {
    opacity: 0;
    transform: scale(0.95) translateY(14px);
  }
}

dialog.apple-route-player-modal[open] {
  opacity: 1;
}

dialog.apple-route-player-modal[open] .player-window {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.26s ease !important;
}

dialog.apple-route-player-modal[data-closing] {
  opacity: 0 !important;
  transition: opacity 0.2s ease !important;
}

dialog.apple-route-player-modal[data-closing] .player-window {
  opacity: 0 !important;
  transform: scale(0.96) translateY(10px) !important;
  transition: transform 0.2s ease, opacity 0.18s ease !important;
}

dialog.apple-route-player-modal:not([open]) {
  display: none !important;
  opacity: 0;
}

dialog.apple-route-player-modal::backdrop {
  background: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

.player-window {
  width: 100% !important;
  height: 100% !important;
  max-width: calc(100vw - 24px) !important;
  max-height: calc(100vh - 24px) !important;
  border-radius: 22px !important;
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22), 0 2px 10px rgba(0, 0, 0, 0.08) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body.dark-mode .player-window {
  background: #1c1c1e !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55) !important;
}

.player-top-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 4px 2px;
}

.player-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--apple-blue);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.player-back-btn:hover {
  background: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
}

.player-back-btn i {
  width: 13px;
  height: 13px;
}

body.dark-mode .player-back-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #38a5ff;
}

body.dark-mode .player-back-btn:hover {
  background: #0071e3;
  color: #ffffff;
}

.player-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

.player-dot-active {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--apple-green);
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.6);
}

.player-sidebar-header {
  padding: 12px 14px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.dark-mode .player-sidebar-header {
  background: #222225;
  border-color: rgba(255, 255, 255, 0.08);
}

.player-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.player-date-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--apple-blue);
  font-size: 11px;
  font-weight: 700;
}

.player-date-pill i {
  width: 12px;
  height: 12px;
}

body.dark-mode .player-date-pill {
  background: rgba(0, 113, 227, 0.2);
  color: #38a5ff;
}

.player-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
}

.player-model {
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-driver {
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-layout {
  flex: 1 !important;
  min-height: 0 !important;
  display: flex !important;
  border-radius: 22px !important;
  overflow: hidden !important;
}

/* Left Dashboard Column */
.player-dashboard {
  width: 410px !important;
  flex-shrink: 0 !important;
  border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
  background: #fbfbfd !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 16px !important;
  gap: 12px !important;
  overflow-y: auto !important;
  border-radius: 22px 0 0 22px !important;
}

body.dark-mode .player-dashboard {
  background: #161618;
  border-color: rgba(255, 255, 255, 0.08);
}

/* Telemetry HUD Card */
.hud-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.dark-mode .hud-card {
  background: #222225;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.hud-speedometer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.speedo-dial {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.speedo-number {
  font-size: 48px;
  font-weight: 800;
  font-family: var(--font-primary);
  letter-spacing: -0.05em;
  color: var(--apple-blue);
  line-height: 1;
}

.speedo-unit {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

.speedo-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}

body.dark-mode .speedo-bar-track {
  background: rgba(255, 255, 255, 0.1);
}

.speedo-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0071e3 0%, #34c759 100%);
  border-radius: 99px;
  transition: width 0.15s ease;
  box-shadow: 0 0 10px rgba(0, 113, 227, 0.35);
}

.hud-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.hud-item {
  background: #f5f5f7;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 0.2s ease;
}

body.dark-mode .hud-item {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.06);
}

.hud-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hud-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.hud-location {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.06);
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 113, 227, 0.12);
}

.hud-location i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Stops Timeline */
.player-stops-section {
  flex: 1;
  min-height: 220px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.dark-mode .player-stops-section {
  background: #222225;
  border-color: rgba(255, 255, 255, 0.08);
}

.stops-section-header {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stops-section-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stops-section-title i,
.stops-section-title svg {
  width: 13px !important;
  height: 13px !important;
  color: var(--apple-blue);
  flex-shrink: 0;
}

.stops-count-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--apple-blue);
}

.player-stops-timeline {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.journey-stage-card {
  position: relative;
  background: #f5f5f7;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1.5px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

body.dark-mode .journey-stage-card {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.05);
}

.journey-stage-card:hover {
  background: rgba(0, 113, 227, 0.04);
  border-color: rgba(0, 113, 227, 0.2);
  transform: translateY(-1px);
}

.journey-stage-card.active-stage {
  background: rgba(0, 113, 227, 0.08);
  border-color: var(--apple-blue);
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.2);
}

body.dark-mode .journey-stage-card.active-stage {
  background: rgba(0, 113, 227, 0.18);
  border-color: #38a5ff;
}

.journey-stage-card.completed-stage {
  opacity: 0.85;
}

.stage-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stage-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.stage-num-badge {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--apple-blue);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 113, 227, 0.3);
}

.stage-num-badge i,
.stage-num-badge svg {
  width: 11px !important;
  height: 11px !important;
  flex-shrink: 0;
}

.stage-num-badge.depot {
  background: #6e6e73;
  box-shadow: none;
}

.stage-num-badge.completed {
  background: #34c759;
}

.stage-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-time-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.08);
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

.stage-narrative {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.stage-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.04);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
}

.stage-pill i,
.stage-pill svg {
  width: 10px !important;
  height: 10px !important;
  flex-shrink: 0;
}

body.dark-mode .stage-pill {
  background: rgba(255, 255, 255, 0.06);
}

.stage-pill.blue {
  background: rgba(0, 113, 227, 0.08);
  color: var(--apple-blue);
}

.stage-pill.green {
  background: rgba(52, 199, 89, 0.12);
  color: #248a3d;
}

body.dark-mode .stage-pill.green {
  background: rgba(52, 199, 89, 0.22);
  color: #30d158;
}

.stage-pill.amber {
  background: rgba(255, 149, 0, 0.12);
  color: #b45309;
}

body.dark-mode .stage-pill.amber {
  background: rgba(255, 149, 0, 0.22);
  color: #ff9f0a;
}

/* Controls Card */
.player-controls-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.dark-mode .player-controls-card {
  background: #222225;
  border-color: rgba(255, 255, 255, 0.08);
}

.scrubber-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scrubber-time {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.apple-scrubber {
  flex: 1;
  accent-color: var(--apple-blue);
  cursor: pointer;
  height: 6px;
  border-radius: 99px;
}

.controls-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.transport-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transport-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: #f2f2f7;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.transport-btn i,
.transport-btn svg {
  width: 14px !important;
  height: 14px !important;
  flex-shrink: 0;
}

.transport-btn.play-main i,
.transport-btn.play-main svg {
  width: 17px !important;
  height: 17px !important;
  flex-shrink: 0;
}

.transport-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: scale(1.05);
}

body.dark-mode .transport-btn {
  background: #2c2c2e;
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .transport-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.transport-btn.play-main {
  width: 42px;
  height: 42px;
  background: var(--apple-blue);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.4);
}

.transport-btn.play-main:hover {
  background: var(--apple-blue-hover);
  box-shadow: 0 4px 18px rgba(0, 113, 227, 0.5);
}

.speed-multiplier-group {
  display: flex;
  background: #f2f2f7;
  padding: 3px;
  border-radius: 99px;
  gap: 2px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

body.dark-mode .speed-multiplier-group {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.06);
}

.speed-mult-btn {
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.speed-mult-btn:hover {
  color: var(--text-primary);
}

.speed-mult-btn.active {
  background: #ffffff;
  color: var(--apple-blue);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

body.dark-mode .speed-mult-btn.active {
  background: #323236;
  color: #ffffff;
}

/* Right Map Viewport (Apple macOS Window Stage) */
.player-map-viewport {
  flex: 1 !important;
  position: relative !important;
  background: #e5e5ea !important;
  border-radius: 0 22px 22px 0 !important;
  overflow: hidden !important;
  height: 100% !important;
  min-height: 0 !important;
}

.route-player-map-canvas {
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 22px 22px 0 !important;
}

.player-map-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  z-index: 50;
  transition: all 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.player-map-close-btn:hover {
  background: #ffffff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}

.player-map-close-btn i {
  width: 18px;
  height: 18px;
}

body.dark-mode .player-map-close-btn {
  background: rgba(30, 30, 32, 0.88);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  color: #f5f5f7;
}

body.dark-mode .player-map-close-btn:hover {
  background: rgba(45, 45, 48, 0.95);
}

.route-player-map-canvas {
  width: 100%;
  height: 100%;
}

.map-hud-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 10;
  pointer-events: none;
}

body.dark-mode .map-hud-overlay {
  background: rgba(28, 28, 30, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.map-hud-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-live-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--apple-blue);
  color: #ffffff;
  letter-spacing: 0.04em;
}

.map-hud-dest {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
}


/* --------------------------------------------------------------------------
   Apple Clean Logistics Route Cell (Reports Trips Table)
   -------------------------------------------------------------------------- */
.trip-route-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  max-width: 440px;
}

.trip-point {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.trip-point.departure {
  flex: 1;
}

.trip-point.arrival {
  flex: 1.1;
}

.point-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  line-height: 1.2;
}

.point-badge.start {
  background: rgba(0, 113, 227, 0.1);
  color: #0071e3;
  border: 1px solid rgba(0, 113, 227, 0.2);
}

body.dark-mode .point-badge.start {
  background: rgba(10, 132, 255, 0.2);
  color: #409cff;
}

.point-badge.end {
  background: rgba(52, 199, 89, 0.12);
  color: #248a3d;
  border: 1px solid rgba(52, 199, 89, 0.22);
}

body.dark-mode .point-badge.end {
  background: rgba(52, 199, 89, 0.2);
  color: #5ee679;
}

.point-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-route-arrow-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.trip-route-arrow-connector i,
.trip-route-arrow-connector svg {
  width: 14px !important;
  height: 14px !important;
  stroke-width: 2.2px !important;
}

/* --------------------------------------------------------------------------
   Moving Car on Playback Map (Top-Down GPS Navigation Sprite & Halo)
   -------------------------------------------------------------------------- */
.playback-car-marker {
  position: relative;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.playback-car-halo {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.38) 0%, rgba(0, 113, 227, 0) 70%);
  animation: pulseCarHalo 1.8s infinite ease-in-out;
}

@keyframes pulseCarHalo {
  0% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 0.2; }
  100% { transform: scale(0.85); opacity: 0.6; }
}

.playback-car-rotator {
  position: relative;
  width: 24px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: none;
  will-change: transform;
  transform-origin: 50% 50%;
}

.playback-car-rotator img {
  width: 22px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.42));
}


.transport-btn svg,
.transport-btn i {
  pointer-events: none;
}

.mobile-only { display: none; }

@media (max-width: 900px) {
  .mobile-hide {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }

  /* iOS Bottom Tab Bar from Left Menu */
  .apple-admin-menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: 60px;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid var(--panel-inner-border);
    flex-direction: row;
    padding: 4px 8px;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    background: var(--panel-bg);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
  }

  .admin-menu-header,
  .admin-menu-footer,
  .admin-menu-section-label,
  .nav-item-active-bar,
  .nav-item-label,
  .nav-item-badge {
    display: none !important;
  }

  .admin-menu-scroll {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    gap: 4px;
    padding: 0;
    overflow: visible;
  }

  .admin-nav-item {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
  }

  .admin-nav-item i {
    width: 20px;
    height: 20px;
  }

  .rail-logo-btn, .rail-divider {
    display: none !important;
  }

  .rail-tooltip {
    display: none !important;
  }

  .top-nav-island {
    left: 12px;
    right: 12px;
    top: 12px;
    max-width: none;
    height: 48px;
    padding: 0 14px;
  }

  .live-traffic-hud {
    left: 12px !important;
    right: 12px !important;
    top: 66px !important;
    max-width: none !important;
  }

  /* Apple Maps style Bottom Sheet */
  .apple-sidebar {
    position: fixed;
    width: 100vw;
    height: 52vh;
    max-height: 72vh;
    top: auto;
    bottom: 60px;
    left: 0;
    border-radius: 22px 22px 0 0;
    transform: translateY(calc(100% - 68px));
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.22);
    z-index: 920;
    transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
  }

  .apple-sidebar.expanded {
    transform: translateY(0);
  }

  .sidebar-drag-handle {
    width: 100%;
    padding: 8px 0 4px 0;
    display: flex;
    justify-content: center;
    cursor: grab;
  }

  .handle-bar {
    width: 40px;
    height: 4.5px;
    background: var(--text-tertiary);
    border-radius: 99px;
  }

  .floating-map-controls {
    top: auto;
    bottom: 130px;
    right: 12px;
    z-index: 910;
  }

  /* Admin panel on mobile */
  .admin-expanded-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    top: 10px;
    bottom: 68px;
    max-width: none;
    height: auto;
    border-radius: 20px;
    z-index: 1050;
  }

  /* Interactive Route Player on mobile */
  dialog.apple-route-player-modal {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    inset: 0;
    margin: 0;
    border-radius: 0;
  }

  .player-window {
    border-radius: 0;
    height: 100%;
  }

  .player-layout {
    flex-direction: column;
  }

  .player-map-viewport {
    height: 40vh;
    min-height: 220px;
    flex: none;
    border-radius: 0;
  }

  .player-dashboard {
    width: 100%;
    flex: 1;
    border-right: none;
    border-top: 1px solid var(--panel-inner-border);
  }

  .report-vehicle-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .report-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
  }

  .report-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-quick-dates {
    overflow-x: auto;
    padding-bottom: 4px;
  }
}

/* --------------------------------------------------------------------------
   Live Traffic HUD (Apple Capsule Style)
   -------------------------------------------------------------------------- */
.live-traffic-hud {
  position: absolute !important;
  top: 14px !important;
  left: 16px !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 65 !important;
  display: none !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 14px !important;
  padding: 7px 12px 7px 16px !important;
  box-sizing: border-box !important;
  border-radius: 99px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.09) !important;
  transition: opacity 0.2s ease, transform 0.2s ease !important;
  max-width: calc(100% - 170px) !important;
  width: auto !important;
  white-space: nowrap !important;
}

body.sidebar-closed .live-traffic-hud {
  left: 16px !important;
}

body.dark-mode .live-traffic-hud {
  background: rgba(30, 30, 32, 0.94) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.5) !important;
}

body.admin-drawer-open .live-traffic-hud {
  display: none !important;
}

.live-traffic-hud.visible {
  display: inline-flex !important;
}

.traffic-hud-left {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
}

.traffic-live-indicator {
  position: relative;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.traffic-beacon-dot {
  display: block;
  width: 10px;
  height: 10px;
  background: #ff3b30;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.8);
  animation: pulse-beacon 1.8s infinite;
}

.traffic-beacon-dot.clear {
  background: #34c759;
  box-shadow: 0 0 8px rgba(52, 199, 89, 0.8);
}

@keyframes pulse-beacon {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.traffic-hud-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.traffic-hud-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.traffic-hud-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.traffic-live-pill {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  background: rgba(255, 59, 48, 0.12) !important;
  color: #ff3b30 !important;
  letter-spacing: -0.01em !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  line-height: 1.2 !important;
}

.traffic-live-pill.clear {
  background: rgba(52, 199, 89, 0.12) !important;
  color: #34c759 !important;
}

.traffic-hud-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 320px;
}

.traffic-hud-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  padding-left: 10px !important;
  border-left: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.dark-mode .traffic-hud-actions {
  border-left-color: rgba(255, 255, 255, 0.1) !important;
}

.traffic-hud-btn {
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
  height: 28px !important;
  white-space: nowrap !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  flex-shrink: 0 !important;
}

.traffic-hud-close {
  background: rgba(0, 0, 0, 0.04) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  cursor: pointer !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  color: var(--text-secondary) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  margin-left: 4px !important;
  flex-shrink: 0 !important;
  transition: all 0.15s ease !important;
}

.traffic-hud-close:hover {
  color: var(--text-primary) !important;
  background: rgba(0, 0, 0, 0.09) !important;
}

body.dark-mode .traffic-hud-close {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

body.dark-mode .traffic-hud-close:hover {
  background: rgba(255, 255, 255, 0.16) !important;
}

.traffic-hud-close i,
.traffic-hud-close svg {
  width: 13px !important;
  height: 13px !important;
}

/* --------------------------------------------------------------------------
   Apple Glass Traffic Incident & Road Closure Card
   -------------------------------------------------------------------------- */
.traffic-incident-card {
  position: absolute !important;
  top: 66px !important;
  left: 16px !important;
  z-index: 75 !important;
  width: 380px !important;
  max-width: calc(100% - 32px) !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(28px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 18px !important;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.15) !important;
  overflow: hidden !important;
  display: none !important;
  flex-direction: column !important;
  gap: 12px !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  animation: appleCardFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.dark-mode .traffic-incident-card {
  background: rgba(28, 28, 30, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55) !important;
}

.traffic-incident-card.visible {
  display: flex !important;
}

@keyframes appleCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.incident-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.incident-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.incident-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.incident-icon-box.danger {
  background: rgba(255, 59, 48, 0.12);
  color: #ff3b30;
}

.incident-icon-box.warning {
  background: rgba(255, 149, 0, 0.12);
  color: #ff9500;
}

.incident-icon-box.info {
  background: rgba(0, 113, 227, 0.12);
  color: #0071e3;
}

.incident-icon-box i,
.incident-icon-box svg {
  width: 20px !important;
  height: 20px !important;
}

.incident-header-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.incident-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.incident-card-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.incident-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  white-space: nowrap;
}

.incident-badge.danger {
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
}

.incident-badge.warning {
  background: rgba(255, 149, 0, 0.15);
  color: #ff9500;
}

.incident-card-location {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.incident-card-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.incident-card-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

body.dark-mode .incident-card-close {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.incident-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.incident-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.incident-metric-box {
  background: rgba(0, 0, 0, 0.03);
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid var(--panel-inner-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.dark-mode .incident-metric-box {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.incident-metric-label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.incident-metric-val {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.incident-metric-val.text-danger {
  color: #ff3b30;
}

.incident-desc-box {
  background: rgba(0, 0, 0, 0.02);
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--panel-inner-border);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

body.dark-mode .incident-desc-box {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.incident-info-icon {
  width: 14px !important;
  height: 14px !important;
  color: var(--apple-blue);
  flex-shrink: 0;
  margin-top: 2px;
}

.incident-desc-text {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.incident-fleet-box {
  font-size: 11px;
  font-weight: 600;
  color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.08);
  padding: 6px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.incident-fleet-box i,
.incident-fleet-box svg {
  width: 13px !important;
  height: 13px !important;
  flex-shrink: 0;
}

.incident-card-footer {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.incident-card-footer button {
  flex: 1;
}

/* Live Traffic Telemetry Card inside Vehicle Detail Modal */
.traffic-telemetry-card {
  background: linear-gradient(135deg, rgba(255, 59, 48, 0.05), rgba(255, 149, 0, 0.05));
  border: 1px solid rgba(255, 59, 48, 0.2) !important;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.25s ease;
}

body.dark-mode .traffic-telemetry-card {
  background: linear-gradient(135deg, rgba(255, 59, 48, 0.1), rgba(255, 149, 0, 0.08));
  border-color: rgba(255, 59, 48, 0.3) !important;
}

.traffic-telemetry-card.clear {
  background: linear-gradient(135deg, rgba(52, 199, 89, 0.05), rgba(0, 113, 227, 0.04));
  border-color: rgba(52, 199, 89, 0.25) !important;
}

body.dark-mode .traffic-telemetry-card.clear {
  background: linear-gradient(135deg, rgba(52, 199, 89, 0.1), rgba(0, 113, 227, 0.08));
  border-color: rgba(52, 199, 89, 0.3) !important;
}

.traffic-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.traffic-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.traffic-status-badge.jam {
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
}

.traffic-status-badge.heavy {
  background: rgba(255, 149, 0, 0.15);
  color: #ff9500;
}

.traffic-status-badge.clear {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
}

.traffic-status-badge.idle {
  background: rgba(142, 142, 147, 0.15);
  color: #8e8e93;
}

.traffic-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  display: inline-block;
  animation: pulse-beacon 1.5s infinite;
}

.traffic-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.traffic-main-metric {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.traffic-delay-val {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.traffic-corridor-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.traffic-desc-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

.traffic-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

body.dark-mode .traffic-card-actions {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.traffic-detour-hint {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.traffic-detour-hint i {
  width: 14px;
  height: 14px;
  color: #ff9500;
  flex-shrink: 0;
}

/* Sidebar Traffic Mini Pill */
.telemetry-mini-pill.traffic-pill {
  font-weight: 600;
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.telemetry-mini-pill.traffic-jam {
  background: rgba(255, 59, 48, 0.12) !important;
  color: #ff3b30 !important;
  border-color: rgba(255, 59, 48, 0.25) !important;
}

.telemetry-mini-pill.traffic-heavy {
  background: rgba(255, 149, 0, 0.12) !important;
  color: #ff9500 !important;
  border-color: rgba(255, 149, 0, 0.25) !important;
}

.telemetry-mini-pill.traffic-clear {
  background: rgba(52, 199, 89, 0.12) !important;
  color: #34c759 !important;
  border-color: rgba(52, 199, 89, 0.25) !important;
}

/* Ghost Car Marker for History Route Playback */
.playback-ghost-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0071e3;
  box-shadow: 0 0 16px rgba(0, 113, 227, 0.7), 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: 2px solid white;
  transition: transform 0.08s linear;
}

.playback-ghost-marker img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}



/* --------------------------------------------------------------------------
   Company Facilities & Factories (Tesislerimiz & Fabrika)
   -------------------------------------------------------------------------- */
.facility-filter-bar {
  display: flex;
}

.facility-card {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--panel-inner-border);
  border-radius: var(--radius-lg);
  padding: 13px 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.facility-card:hover {
  background: var(--panel-bg-hover);
  box-shadow: var(--card-shadow);
  border-color: rgba(217, 119, 6, 0.35);
}

.facility-card.active {
  border-color: #d97706;
  background: var(--panel-bg-hover);
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25), var(--card-shadow);
}

/* --------------------------------------------------------------------------
   Company Facilities & Factories (Compact Apple Design)
   -------------------------------------------------------------------------- */
.facility-filter-bar {
  display: flex;
}

.facility-card.compact {
  background: var(--panel-bg);
  border: 1px solid var(--panel-inner-border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.facility-card.compact:hover {
  background: var(--panel-bg-hover);
  box-shadow: var(--card-shadow);
  border-color: rgba(0, 113, 227, 0.35);
}

.facility-card.compact.active {
  border-color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.08);
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.25);
}

body.dark-mode .facility-card.compact.active {
  background: rgba(10, 132, 255, 0.18);
  border-color: var(--apple-blue);
}

.facility-compact-layout {
  display: flex;
  align-items: center;
  gap: 10px;
}

.facility-icon-mini {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.facility-icon-mini.factory {
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.15), rgba(255, 149, 0, 0.25));
  color: #ff9500;
}

body.dark-mode .facility-icon-mini.factory {
  background: rgba(255, 159, 10, 0.22);
  color: #ff9f0a;
}

.facility-icon-mini.warehouse {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.14), rgba(0, 113, 227, 0.24));
  color: var(--apple-blue);
}

body.dark-mode .facility-icon-mini.warehouse {
  background: rgba(10, 132, 255, 0.22);
  color: #60a5fa;
}

.facility-icon-mini.garage {
  background: linear-gradient(135deg, rgba(88, 86, 214, 0.14), rgba(88, 86, 214, 0.24));
  color: var(--apple-purple);
}

body.dark-mode .facility-icon-mini.garage {
  background: rgba(175, 82, 222, 0.22);
  color: #bf5af2;
}

.facility-icon-mini i,
.facility-icon-mini svg {
  width: 16px !important;
  height: 16px !important;
  stroke-width: 1.85px;
}

.facility-compact-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.facility-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.facility-compact-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.facility-code-pill.micro {
  font-size: 9.5px;
  font-weight: 800;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
}

body.dark-mode .facility-code-pill.micro {
  background: rgba(255, 255, 255, 0.08);
}

.facility-compact-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-secondary);
}

.facility-fleet-mini {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.facility-fleet-mini.has-fleet {
  color: #248a3d;
}

body.dark-mode .facility-fleet-mini.has-fleet {
  color: #30d158;
}

/* --------------------------------------------------------------------------
   Apple Map Facility Pin (Authentic 22px Apple Maps POI Glyph)
   -------------------------------------------------------------------------- */
.apple-facility-pin {
  width: 22px;
  height: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  user-select: none;
  z-index: 15;
}

.facility-pin-squircle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  border: 1.5px solid #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.facility-pin-squircle:hover,
.apple-facility-pin.is-active .facility-pin-squircle {
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.32);
}

.facility-pin-squircle i,
.facility-pin-squircle svg {
  width: 11px !important;
  height: 11px !important;
  min-width: 11px;
  min-height: 11px;
  stroke-width: 2px;
  color: #ffffff;
  pointer-events: none;
}

.facility-pulse-ring {
  display: block !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px dashed rgba(0, 113, 227, 0.65);
  pointer-events: none;
  animation: facilityPulse 2.8s infinite ease-out;
}

@keyframes facilityPulse {
  0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.85; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.25; }
  100% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.85; }
}

/* Subtle Apple Label Under Marker */
.facility-label-pill {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #1d1d1f;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
}

body.dark-mode .facility-label-pill {
  background: rgba(30, 30, 32, 0.9);
  color: #f5f5f7;
  border-color: rgba(255, 255, 255, 0.12);
}

/* Minimalist Apple Glass Facility Tooltip */
.facility-pin-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #1d1d1f;
  padding: 7px 11px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
  min-width: 140px;
}

.facility-pin-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.95) transparent transparent transparent;
}

body.dark-mode .facility-pin-tooltip {
  background: rgba(28, 28, 30, 0.95);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f5f5f7;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

body.dark-mode .facility-pin-tooltip::after {
  border-color: rgba(28, 28, 30, 0.95) transparent transparent transparent;
}

.apple-facility-pin:hover .facility-pin-tooltip,
.apple-facility-pin.is-active .facility-pin-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.facility-tooltip-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.facility-tooltip-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.facility-tooltip-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.facility-tooltip-sub {
  font-size: 10px;
  color: #6e6e73;
}

body.dark-mode .facility-tooltip-sub {
  color: #a1a1a6;
}

.facility-tooltip-meta {
  font-size: 9.5px;
  color: #86868b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.facility-tooltip-fleet-row {
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 9.5px;
}

body.dark-mode .facility-tooltip-fleet-row {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.facility-tooltip-fleet {
  color: #86868b;
  display: flex;
  align-items: center;
  gap: 4px;
}

.facility-tooltip-fleet.has-fleet {
  color: #34c759;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Fuel Telemetry & Intelligence Card (Inspector Sheet)
   -------------------------------------------------------------------------- */
.fuel-telemetry-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fuel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.fuel-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fuel-main-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  flex-wrap: nowrap !important;
  margin-top: 4px;
}

.fuel-pct-big {
  font-size: 15px !important;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.fuel-liters-text {
  font-size: 11px !important;
  font-weight: 600;
  color: var(--text-secondary);
}

.fuel-badge {
  font-size: 9.5px !important;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--apple-blue);
}

.fuel-progress-linear {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.fuel-intel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px !important;
  margin-top: 5px;
}

.fuel-intel-item {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--panel-inner-border);
  border-radius: 8px !important;
  padding: 6px 10px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

body.dark-mode .fuel-intel-item {
  background: rgba(255, 255, 255, 0.03);
}

.fuel-intel-label {
  font-size: 10px !important;
  color: var(--text-tertiary);
  font-weight: 600;
  white-space: nowrap;
}

.fuel-intel-val {
  font-size: 11.5px !important;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Fuel Entry Modal & Quick Chips
   -------------------------------------------------------------------------- */
.fuel-presets-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.fuel-chip-btn {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.fuel-chip-btn:hover {
  background: rgba(0, 113, 227, 0.1);
  color: var(--apple-blue);
  border-color: rgba(0, 113, 227, 0.25);
}

.fuel-chip-btn.primary-chip {
  flex: 1.3;
  background: rgba(0, 113, 227, 0.12);
  color: var(--apple-blue);
  border: 1px solid rgba(0, 113, 227, 0.28);
  margin-left: 0;
  box-shadow: none;
}

.fuel-chip-btn.primary-chip:hover {
  background: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
}

.fuel-chip-btn.primary-chip i,
.fuel-chip-btn.primary-chip svg {
  width: 13px !important;
  height: 13px !important;
}

body.dark-mode .fuel-chip-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

body.dark-mode .fuel-chip-btn:hover {
  background: rgba(56, 165, 255, 0.2);
  color: #38a5ff;
}

body.dark-mode .fuel-chip-btn.primary-chip {
  background: rgba(56, 165, 255, 0.18);
  border-color: rgba(56, 165, 255, 0.35);
  color: #38a5ff;
}

body.dark-mode .fuel-chip-btn.primary-chip:hover {
  background: #0071e3;
  color: #ffffff;
}

.fuel-calc-preview-card {
  background: rgba(0, 113, 227, 0.05);
  border: 1px solid rgba(0, 113, 227, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fuel-calc-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--apple-blue);
}

.fuel-calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  font-size: 11px;
}

.calc-label {
  display: block;
  font-size: 9.5px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

/* --------------------------------------------------------------------------
   Admin Tab 6: Fuel Management KPI Grid
   -------------------------------------------------------------------------- */
.fuel-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.fuel-kpi-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.fuel-kpi-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.fuel-kpi-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.fuel-kpi-sub {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-weight: 600;
}




/* ==========================================================================
   ENHANCED APPLE FUEL STUDIO & BENTO INTELLIGENCE STYLES
   ========================================================================== */

/* Vehicle Selector Carousel in Fuel Modal */
.fuel-vehicle-selector-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px 2px;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.fuel-vehicle-selector-scroll::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.fuel-veh-chip {
  background: #ffffff;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-width: 175px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode .fuel-veh-chip {
  background: #252528;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.fuel-veh-chip:hover {
  background: #fafafb;
  border-color: rgba(0, 113, 227, 0.35);
  transform: translateY(-1px);
}

.fuel-veh-chip.active {
  background: rgba(0, 113, 227, 0.08);
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 1px var(--apple-blue), 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.dark-mode .fuel-veh-chip.active {
  background: rgba(56, 165, 255, 0.18);
  border-color: #38a5ff;
  box-shadow: 0 0 0 1px #38a5ff;
}

.fuel-veh-chip-img {
  width: 38px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.fuel-veh-chip-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fuel-veh-chip-plate {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11.5px;
  color: var(--text-primary);
  white-space: nowrap;
}

.fuel-veh-chip-driver {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.fuel-veh-chip-level {
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 6px;
}

/* 3D Cylindrical Liquid Fuel Tank Widget */
.fuel-hero-tank-widget {
  display: flex;
  gap: 18px;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 14px;
}

body.dark-mode .fuel-hero-tank-widget {
  background: rgba(255, 255, 255, 0.03);
}

.fuel-tank-cylinder {
  width: 58px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.fuel-cylinder-glass {
  width: 50px;
  height: 140px;
  border-radius: 25px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column-reverse;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}

body.dark-mode .fuel-cylinder-glass {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.fuel-cylinder-tick {
  display: none; /* Removed confusing overlapping tick marks */
}

.fuel-fluid-existing {
  background: linear-gradient(180deg, #34c759, #28a745);
  width: 100%;
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  z-index: 2;
}

.fluid-existing-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.fuel-fluid-incoming {
  background: linear-gradient(180deg, #0071e3, #38a5ff);
  width: 100%;
  transition: height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  z-index: 3;
}

.fluid-incoming-label {
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.fuel-tank-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.tank-status-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 8px 14px;
}

.tank-stat-caption {
  display: block;
  font-size: 9.5px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 2px;
}

.tank-stat-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.tank-stat-pct {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.tank-stat-arrow {
  color: var(--text-tertiary);
  font-size: 14px;
}

/* Stepper Amount Box */
.fuel-amount-stepper-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.fuel-stepper-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--panel-border);
  background: var(--panel-bg);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.fuel-stepper-btn:hover {
  background: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
  transform: scale(1.06);
}

.fuel-stepper-input-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.fuel-stepper-number {
  font-size: 32px;
  font-weight: 800;
  width: 110px;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--apple-blue);
  outline: none;
  letter-spacing: -0.02em;
}

.fuel-stepper-unit {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.fuel-slider-wrap {
  padding: 0 6px;
}

.apple-range-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(0, 113, 227, 0.15);
  border-radius: 99px;
  outline: none;
}

.apple-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--apple-blue);
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.3);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.apple-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* Bento Inputs Grid in Modal */
.fuel-bento-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.fuel-bento-card {
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 10px;
}

.fuel-bento-card .form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 4px;
}

.fuel-bento-card .form-label {
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  display: block;
}

body.dark-mode .fuel-bento-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.bento-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.bento-card-title i,
.bento-card-title svg {
  width: 14px !important;
  height: 14px !important;
  color: var(--apple-blue);
}

.bento-stat-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.35;
}

.apple-readonly-val {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-blue);
  box-sizing: border-box;
}

body.dark-mode .apple-readonly-val {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #38a5ff;
}

/* ==========================================================================
   ADMIN TAB 6: FLEET FUEL BENTO CARDS
   ========================================================================== */
.fuel-bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

@media (min-width: 1200px) {
  .fuel-bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.fleet-fuel-bento-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fleet-fuel-bento-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 113, 227, 0.3);
}

.bento-quick-fuel-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.22);
  color: var(--apple-blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.bento-quick-fuel-btn i,
.bento-quick-fuel-btn svg {
  width: 14px !important;
  height: 14px !important;
}

.bento-quick-fuel-btn:hover {
  background: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
  transform: translateY(-1px);
}

body.dark-mode .bento-quick-fuel-btn {
  background: rgba(56, 165, 255, 0.12);
  border-color: rgba(56, 165, 255, 0.3);
  color: #38a5ff;
}

body.dark-mode .bento-quick-fuel-btn:hover {
  background: #0071e3;
  color: #ffffff;
}

.bento-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bento-veh-hero {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bento-van-thumb {
  width: 44px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.bento-veh-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.bento-veh-driver {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Bento Tank Level Bar */
.bento-fuel-meter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 10px 12px;
}

body.dark-mode .bento-fuel-meter {
  background: rgba(255, 255, 255, 0.03);
}

.bento-fuel-meter-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.bento-fuel-pct {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.bento-fuel-liters {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.bento-range-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(52, 199, 89, 0.12);
  color: var(--apple-green);
}

.bento-range-pill.low {
  background: rgba(255, 59, 48, 0.12);
  color: var(--apple-red);
}

.bento-fuel-progress {
  height: 9px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  position: relative;
}

body.dark-mode .bento-fuel-progress {
  background: rgba(255, 255, 255, 0.08);
}

.bento-fuel-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}

.bento-stats-matrix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.bento-matrix-col {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.dark-mode .bento-matrix-col {
  background: rgba(255, 255, 255, 0.02);
}

.bento-matrix-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.bento-matrix-val {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* ==========================================================================
   TRAFFIC HUD & INCIDENT CALLOUTS
   ========================================================================== */
.traffic-zone-shortcuts {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-right: 10px;
}

.traffic-city-btn {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.15s ease;
  white-space: nowrap;
}

body.dark-mode .traffic-city-btn {
  background: rgba(255, 255, 255, 0.08);
}

.traffic-city-btn:hover {
  background: var(--apple-blue);
  color: #ffffff;
  border-color: var(--apple-blue);
}

.traffic-delay-stat {
  font-size: 11.5px;
  color: #ff3b30;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Incident Marker Styling on Map (Subtle Apple Road Hazard) */
.traffic-incident-pin-wrapper {
  position: relative;
  cursor: pointer;
}

.traffic-incident-pin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  border: 1.5px solid #ffffff;
  transition: transform 0.15s ease;
  position: relative;
}

.traffic-incident-pin i,
.traffic-incident-pin svg {
  width: 10px !important;
  height: 10px !important;
}

.traffic-incident-pin:hover {
  transform: scale(1.15);
}

.traffic-incident-pin.accident {
  background: #ff3b30;
}

.traffic-incident-pin.construction {
  background: #ff9500;
}

.traffic-incident-pin.congestion {
  background: #af52de;
}

.traffic-incident-pin.inspection {
  background: #0071e3;
}

/* Traffic Incident Popup Bubble */
.traffic-incident-callout {
  min-width: 260px;
  max-width: 320px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.dark-mode .traffic-incident-callout {
  background: rgba(28, 28, 30, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
}

.traffic-callout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.traffic-callout-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.traffic-callout-delay {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 59, 48, 0.12);
  color: #ff3b30;
  white-space: nowrap;
}

.traffic-callout-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.35;
}

.traffic-callout-lanes {
  font-size: 10.5px;
  font-weight: 600;
  color: #ff9500;
}

/* --------------------------------------------------------------------------
   TomTom Live Traffic API Modal & Gateway Styling
   -------------------------------------------------------------------------- */
.tomtom-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--panel-inner-border);
}

body.dark-mode .tomtom-status-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.tomtom-status-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tomtom-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff9500;
  box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.2);
  flex-shrink: 0;
}

.tomtom-status-dot.on {
  background: #34c759;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.2);
}

.tomtom-status-dot.off {
  background: #8e8e93;
  box-shadow: none;
}

.tomtom-status-left strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.tomtom-status-left p {
  margin: 2px 0 0 0;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.tomtom-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--apple-blue);
  white-space: nowrap;
}

.tomtom-badge.active {
  background: rgba(52, 199, 89, 0.12);
  color: #28a745;
}

.tomtom-help-link {
  font-size: 11px;
  color: var(--apple-blue);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tomtom-help-link:hover {
  text-decoration: underline;
}

.tomtom-help-link i,
.tomtom-help-link svg {
  width: 11px !important;
  height: 11px !important;
}

.apple-input-with-action {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.apple-input-with-action input {
  padding-right: 40px !important;
}

.input-inline-btn {
  position: absolute;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.input-inline-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

body.dark-mode .input-inline-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.input-inline-btn i,
.input-inline-btn svg {
  width: 15px !important;
  height: 15px !important;
}

.tomtom-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--panel-inner-border);
}

body.dark-mode .tomtom-toggle-group {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.tomtom-toggle-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.tomtom-toggle-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--apple-blue);
  margin-top: 2px;
  cursor: pointer;
}

.tomtom-toggle-item .toggle-text strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.tomtom-toggle-item .toggle-text span {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
}

.tomtom-test-banner {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tomtom-test-banner.success {
  background: rgba(52, 199, 89, 0.12);
  color: #1f8a3d;
  border: 1px solid rgba(52, 199, 89, 0.25);
}

body.dark-mode .tomtom-test-banner.success {
  background: rgba(52, 199, 89, 0.2);
  color: #4cd964;
}

.tomtom-test-banner.error {
  background: rgba(255, 59, 48, 0.12);
  color: #d70015;
  border: 1px solid rgba(255, 59, 48, 0.25);
}

body.dark-mode .tomtom-test-banner.error {
  background: rgba(255, 59, 48, 0.2);
  color: #ff453a;
}


/* --------------------------------------------------------------------------
   SECURITY GATEWAY: AUTHENTICATION LOCKING
   -------------------------------------------------------------------------- */
html.auth-required body > #app.app-layout,
html:not(.auth-authenticated) body > #app.app-layout {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html.auth-authenticated body > #app.app-layout {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  display: flex !important;
}

html.auth-required #apple-auth-screen,
html:not(.auth-authenticated) #apple-auth-screen {
  display: flex !important;
}

html.auth-authenticated #apple-auth-screen {
  display: none !important;
}

/* --------------------------------------------------------------------------
   ENTERPRISE AUTHENTICATION SCREEN (Split 50/50 - Left Pure White, Right 3D Map)
   -------------------------------------------------------------------------- */
.apple-auth-screen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999 !important;
  flex-direction: row !important;
  overflow: hidden !important;
  background: #ffffff !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* --- SOL PANEL (50%): Saf Beyaz Arkaplan & Orijinal Logo --- */
.auth-split-left {
  flex: 0 0 50% !important;
  width: 50% !important;
  height: 100vh !important;
  background: #ffffff !important;
  color: #1d1d1f !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 40px 60px !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  position: relative !important;
  z-index: 10 !important;
}

.auth-form-container {
  width: 100% !important;
  max-width: 440px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 22px !important;
}

.auth-brand-box {
  margin-bottom: 4px !important;
  display: flex !important;
  justify-content: flex-start !important;
}

.auth-brand-logo {
  height: 74px !important;
  width: auto !important;
  display: block !important;
  object-fit: contain !important;
}

.auth-heading-box {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.auth-main-title {
  font-size: 30px !important;
  font-weight: 800 !important;
  color: #1d1d1f !important;
  letter-spacing: -0.03em !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif !important;
}

.auth-main-subtitle {
  font-size: 13.5px !important;
  line-height: 1.6 !important;
  color: #6e6e73 !important;
  margin: 0 !important;
  font-weight: 400 !important;
}

.auth-form {
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  margin-top: 4px !important;
}

/* Hata Bildirimi */
.auth-error-banner {
  display: none;
  background: rgba(255, 59, 48, 0.1) !important;
  border: 1px solid rgba(255, 59, 48, 0.25) !important;
  color: #ff3b30 !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  align-items: center !important;
  gap: 10px !important;
}

.auth-error-banner.show {
  display: flex !important;
}

.auth-field-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.auth-input-box {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}

.auth-box-icon {
  position: absolute !important;
  left: 16px !important;
  width: 18px !important;
  height: 18px !important;
  color: #86868b !important;
  pointer-events: none !important;
  z-index: 3 !important;
}

.auth-text-input {
  width: 100% !important;
  height: 50px !important;
  padding: 0 46px 0 46px !important;
  border-radius: 12px !important;
  font-size: 14.5px !important;
  background: #f5f5f7 !important;
  border: 1.5px solid #e5e5ea !important;
  color: #1d1d1f !important;
  outline: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif !important;
}

.auth-text-input::placeholder {
  color: #aeaeb2 !important;
}

.auth-text-input:focus {
  background: #ffffff !important;
  border-color: #0071e3 !important;
  box-shadow: 0 0 0 3.5px rgba(0, 113, 227, 0.2) !important;
}

.auth-eye-toggle-btn {
  position: absolute !important;
  right: 14px !important;
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 6px !important;
  color: #86868b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 6px !important;
  z-index: 3 !important;
  transition: color 0.15s ease !important;
}

.auth-eye-toggle-btn svg {
  width: 18px !important;
  height: 18px !important;
  display: block !important;
}

.auth-eye-toggle-btn:hover {
  color: #1d1d1f !important;
}

/* Giriş Butonu: Apple Vibrant Mavi Buton */
.auth-submit-btn-connect {
  width: 100% !important;
  height: 50px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  background: #0071e3 !important;
  color: #ffffff !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  margin-top: 6px !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 4px 16px rgba(0, 113, 227, 0.35) !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif !important;
}

.auth-submit-btn-connect:hover {
  background: #0077ed !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.45) !important;
}

.auth-submit-btn-connect:active {
  transform: translateY(0) !important;
}

.auth-footer-note {
  font-size: 11.5px !important;
  color: #86868b !important;
  margin-top: 10px !important;
}

/* --- SAĞ PANEL (50%): Tam Ekran 3D Görsel --- */
.auth-split-right {
  flex: 0 0 50% !important;
  width: 50% !important;
  height: 100vh !important;
  position: relative !important;
  overflow: hidden !important;
  background: #000000 !important;
  border-left: 1px solid #e5e5ea !important;
}

.auth-hero-bg-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
}

/* Mobil / Tablet */
@media (max-width: 900px) {
  .apple-auth-screen {
    flex-direction: column !important;
    overflow-y: auto !important;
  }
  .auth-split-left {
    flex: 1 1 100% !important;
    width: 100% !important;
    min-height: 100vh !important;
    padding: 30px 24px !important;
  }
  .auth-split-right {
    display: none !important;
  }
}

.admin-logout-btn {
  background: rgba(255, 59, 48, 0.1) !important;
  color: #ff3b30 !important;
  border: 1px solid rgba(255, 59, 48, 0.2) !important;
  border-radius: 8px !important;
  width: 30px !important;
  height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  margin-left: auto !important;
}

.admin-logout-btn:hover {
  background: #ff3b30 !important;
  color: #ffffff !important;
}

/* --------------------------------------------------------------------------
   DRIVER CARD HOVER & PROFILE DIALOG STYLES
   -------------------------------------------------------------------------- */
.driver-card {
  cursor: pointer !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
  position: relative !important;
}

.driver-card:hover {
  transform: translateY(-3px) scale(1.01) !important;
  box-shadow: 0 10px 28px rgba(0, 113, 227, 0.14) !important;
  border-color: rgba(0, 113, 227, 0.35) !important;
}

.driver-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.driver-status-pill.on-duty {
  background: rgba(52, 199, 89, 0.12);
  color: #34c759;
}

.driver-status-pill.resting {
  background: rgba(255, 149, 0, 0.12);
  color: #ff9500;
}

.driver-profile-avatar-big {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0071e3 0%, #0056b3 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
  flex-shrink: 0;
}

.driver-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.driver-metric-card {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.dark-mode .driver-metric-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.metric-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.metric-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.metric-sub {
  font-size: 10px;
  color: var(--text-secondary);
}

.driver-activity-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.activity-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.04);
}

body.dark-mode .activity-timeline-item {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.activity-time-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

.activity-desc-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.activity-desc-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 1px;
}

.activity-status-tag {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  flex-shrink: 0;
}

.activity-status-tag.success {
  background: rgba(52, 199, 89, 0.12);
  color: #34c759;
}

.activity-status-tag.warning {
  background: rgba(255, 149, 0, 0.12);
  color: #ff9500;
}


/* ==========================================================================
   iOS 18 APPLE MAPS & FIND MY — 100% MOBILE EXPERIENCE (<= 900px)
   ========================================================================== */
@media (max-width: 900px) {
  html,
  body {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
    -webkit-text-size-adjust: 100% !important;
  }

  .mobile-only {
    display: flex !important;
  }

  .mobile-hide {
    display: none !important;
  }

  /* ------------------------------------------------------------------------
     1. MOBILE LOGIN SCREEN (Apple iOS Card over 3D Night GPS Hero Banner)
     ------------------------------------------------------------------------ */
  .apple-auth-screen {
    height: 100dvh !important;
    width: 100% !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
  }

  .apple-auth-split {
    flex-direction: column !important;
    width: 100% !important;
    min-height: 100dvh !important;
    height: auto !important;
  }

  .auth-split-right {
    display: block !important;
    order: 1 !important;
    width: 100% !important;
    height: 27dvh !important;
    min-height: 175px !important;
    max-height: 240px !important;
    flex: 0 0 auto !important;
    position: relative !important;
  }

  .auth-split-left {
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 75dvh !important;
    height: auto !important;
    margin-top: -24px !important;
    border-radius: 28px 28px 0 0 !important;
    padding: 26px 20px calc(28px + env(safe-area-inset-bottom, 0px)) 20px !important;
    box-shadow: 0 -12px 38px rgba(0, 0, 0, 0.22) !important;
    z-index: 5 !important;
    justify-content: flex-start !important;
  }

  .auth-brand-top {
    margin-bottom: 16px !important;
  }

  .auth-main-logo {
    height: 58px !important;
    max-width: 210px !important;
  }

  .auth-welcome-block {
    margin-bottom: 18px !important;
  }

  .auth-welcome-title {
    font-size: 22px !important;
  }

  .auth-welcome-desc {
    font-size: 13.5px !important;
  }

  .auth-text-input {
    font-size: 16px !important;
    height: 48px !important;
  }

  .auth-primary-btn {
    height: 50px !important;
    font-size: 15.5px !important;
    border-radius: 14px !important;
  }

  .auth-left-footer {
    margin-top: 20px !important;
    padding-top: 14px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    justify-content: center !important;
    text-align: center !important;
  }

  /* ------------------------------------------------------------------------
     2. FULL-BLEED APPLE MAPS STAGE
     ------------------------------------------------------------------------ */
  .app-layout {
    width: 100% !important;
    height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    position: relative !important;
    overflow: hidden !important;
    display: block !important;
  }

  .main-map-stage {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 1 !important;
  }

  .map-box-frame {
    width: 100% !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    position: relative !important;
    overflow: hidden !important;
  }

  #map,
  .map-viewport {
    width: 100% !important;
    height: 100dvh !important;
    border-radius: 0 !important;
  }

  /* ------------------------------------------------------------------------
     3. FLOATING TOP iOS GLASS BAR (.mobile-map-top-bar)
     ------------------------------------------------------------------------ */
  .mobile-map-top-bar {
    position: fixed !important;
    top: calc(10px + env(safe-area-inset-top, 0px)) !important;
    left: 10px !important;
    right: 10px !important;
    height: 48px !important;
    padding: 0 8px 0 14px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(28px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14), 0 1px 0 rgba(255, 255, 255, 0.65) inset !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    z-index: 980 !important;
    box-sizing: border-box !important;
  }

  body.dark-mode .mobile-map-top-bar {
    background: rgba(28, 28, 30, 0.88) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5) !important;
  }

  body.admin-drawer-open .mobile-map-top-bar {
    display: none !important;
  }

  .mobile-top-brand {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 1 1 auto !important;
    gap: 10px !important;
    min-width: 0 !important;
  }

  .mobile-top-logo {
    height: 24px !important;
    width: auto !important;
    max-width: 112px !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
  }

  body.dark-mode .mobile-top-logo {
    filter: brightness(0) invert(1) !important;
  }

  .mobile-live-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 3px 9px !important;
    border-radius: 999px !important;
    background: rgba(52, 199, 89, 0.14) !important;
    color: #248a3d !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  body.dark-mode .mobile-live-pill {
    background: rgba(48, 209, 88, 0.18) !important;
    color: #30d158 !important;
  }

  .mobile-top-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .mobile-top-icon-btn {
    width: 34px !important;
    height: 34px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    background: rgba(0, 0, 0, 0.04) !important;
    color: var(--text-primary) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
  }

  body.dark-mode .mobile-top-icon-btn {
    background: rgba(255, 255, 255, 0.09) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
  }

  .mobile-top-icon-btn.active {
    background: var(--apple-blue) !important;
    color: #ffffff !important;
    border-color: var(--apple-blue) !important;
  }

  .mobile-top-icon-btn.danger {
    color: #ff3b30 !important;
    background: rgba(255, 59, 48, 0.1) !important;
    border-color: rgba(255, 59, 48, 0.16) !important;
  }

  .mobile-top-icon-btn i,
  .mobile-top-icon-btn svg {
    width: 16px !important;
    height: 16px !important;
  }

  /* ------------------------------------------------------------------------
     4. FLOATING MAP CONTROLS (Apple Maps Right-Side Pill Stack)
     ------------------------------------------------------------------------ */
  .floating-map-controls {
    position: fixed !important;
    top: calc(66px + env(safe-area-inset-top, 0px)) !important;
    right: 10px !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 940 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 8px !important;
  }

  body.admin-drawer-open .floating-map-controls {
    display: none !important;
  }

  .segmented-layer-control {
    padding: 3px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(24px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12) !important;
  }

  body.dark-mode .segmented-layer-control {
    background: rgba(28, 28, 30, 0.88) !important;
  }

  .segmented-layer-control .layer-btn {
    padding: 5px 9px !important;
    font-size: 11px !important;
    border-radius: 9px !important;
    gap: 4px !important;
  }

  .segmented-layer-control .layer-btn i,
  .segmented-layer-control .layer-btn svg {
    width: 13px !important;
    height: 13px !important;
  }

  .map-action-group {
    padding: 4px !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(24px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(190%) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14) !important;
    gap: 3px !important;
  }

  body.dark-mode .map-action-group {
    background: rgba(28, 28, 30, 0.88) !important;
  }

  /* Native pinch-to-zoom on touch screens replaces +/- buttons like Apple Maps */
  #btn-zoom-in,
  #btn-zoom-out,
  .map-action-group .divider {
    display: none !important;
  }

  .map-action-group .map-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 10px !important;
  }

  /* Traffic HUD & Incident Card on Mobile */
  .live-traffic-hud {
    position: fixed !important;
    top: calc(66px + env(safe-area-inset-top, 0px)) !important;
    left: 10px !important;
    right: 60px !important;
    max-width: none !important;
    padding: 6px 10px 6px 12px !important;
    border-radius: 16px !important;
    z-index: 945 !important;
  }

  .traffic-hud-actions .traffic-hud-btn {
    display: none !important;
  }

  .traffic-incident-card {
    position: fixed !important;
    top: calc(116px + env(safe-area-inset-top, 0px)) !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: none !important;
    z-index: 1180 !important;
  }

  /* ------------------------------------------------------------------------
     5. APPLE MAPS / FIND MY 3-STATE DRAGGABLE BOTTOM SHEET (.apple-sidebar)
     ------------------------------------------------------------------------ */
  .apple-sidebar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 78dvh !important;
    max-height: 78dvh !important;
    margin: 0 !important;
    border-radius: 26px 26px 0 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.55) !important;
    background: rgba(248, 248, 250, 0.94) !important;
    backdrop-filter: blur(36px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(36px) saturate(200%) !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2) !important;
    z-index: 1020 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    transform: translateY(40%) !important;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1) !important;
    will-change: transform;
  }

  body.dark-mode .apple-sidebar {
    background: rgba(24, 24, 26, 0.95) !important;
    border-top-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 -12px 44px rgba(0, 0, 0, 0.65) !important;
  }

  /* 3 Snap Positions: Peek (collapsed), Half (default 50/50), Full (expanded) */
  .apple-sidebar.sheet-peek {
    transform: translateY(calc(100% - 134px)) !important;
  }

  .apple-sidebar.sheet-half {
    transform: translateY(40%) !important;
  }

  .apple-sidebar.sheet-full,
  .apple-sidebar.expanded {
    transform: translateY(0%) !important;
  }

  .apple-sidebar.is-dragging {
    transition: none !important;
  }

  body.admin-drawer-open .apple-sidebar {
    display: none !important;
  }

  .sidebar-drag-handle {
    width: 100% !important;
    padding: 10px 0 4px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: grab !important;
    flex-shrink: 0 !important;
    touch-action: none !important;
    user-select: none !important;
  }

  .handle-bar {
    width: 38px !important;
    height: 5px !important;
    border-radius: 999px !important;
    background: rgba(120, 120, 128, 0.38) !important;
  }

  body.dark-mode .handle-bar {
    background: rgba(235, 235, 245, 0.32) !important;
  }

  .sidebar-header {
    padding: 4px 16px 10px 16px !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }

  .sidebar-headline {
    margin-bottom: 0 !important;
  }

  .sidebar-title {
    font-size: 20px !important;
    letter-spacing: -0.02em !important;
  }

  .sidebar-subtitle {
    font-size: 11.5px !important;
  }

  #btn-collapse-sidebar,
  .search-shortcut {
    display: none !important;
  }

  /* Mode Switcher inside Mobile Bottom Sheet (Araçlar | Tesislerimiz | Müşteriler) */
  .sidebar-mode-switcher {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
    padding: 3px !important;
    border-radius: 11px !important;
    background: rgba(118, 118, 128, 0.12) !important;
  }

  .sidebar-mode-switcher .mode-tab-btn {
    padding: 6px 4px !important;
    font-size: 11.5px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
  }

  .sidebar-mode-switcher .mode-tab-btn i,
  .sidebar-mode-switcher .mode-tab-btn svg {
    width: 13px !important;
    height: 13px !important;
  }

  .apple-search-box {
    height: 38px !important;
    border-radius: 11px !important;
    padding: 0 10px !important;
  }

  #sidebar-search-input {
    font-size: 16px !important;
  }

  .segmented-filter {
    padding: 2.5px !important;
    border-radius: 10px !important;
  }

  .segmented-filter .filter-tab {
    padding: 5px 6px !important;
    font-size: 11.5px !important;
  }

  .sidebar-content {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 8px 14px 20px 14px !important;
  }

  /* When in sheet-Half mode, adjust bottom padding so user can scroll cards above the fold */
  .apple-sidebar.sheet-half .sidebar-content {
    padding-bottom: calc(32dvh + 24px) !important;
  }

  .sidebar-footer {
    display: none !important;
  }

  /* ------------------------------------------------------------------------
     6. VEHICLE DETAIL INSPECTOR SHEET (dialog#vehicle-detail-dialog)
     ------------------------------------------------------------------------ */
  dialog.apple-sheet,
  dialog#vehicle-detail-dialog {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 76dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 26px 26px 0 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    z-index: 1120 !important;
    box-shadow: 0 -12px 44px rgba(0, 0, 0, 0.28) !important;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1) !important;
  }

  dialog#vehicle-detail-dialog.sheet-minimized {
    transform: translateY(calc(100% - 118px)) !important;
  }

  dialog.apple-sheet .sheet-container,
  dialog#vehicle-detail-dialog .sheet-container {
    max-height: 76dvh !important;
    padding: 6px 16px 22px 16px !important;
    border-radius: 26px 26px 0 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .sheet-mobile-grabber {
    width: 100% !important;
    padding: 6px 0 8px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: grab !important;
    touch-action: none !important;
    flex-shrink: 0 !important;
  }

  dialog#vehicle-detail-dialog .vehicle-studio-card {
    height: 115px !important;
    min-height: 115px !important;
  }

  dialog#vehicle-detail-dialog .studio-van-model {
    max-height: 92px !important;
  }

  /* ------------------------------------------------------------------------
     7. iOS 18 BOTTOM TAB BAR (.apple-admin-menu)
     ------------------------------------------------------------------------ */
  .apple-admin-menu {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px)) 6px !important;
    border-radius: 0 !important;
    border-right: none !important;
    border-left: none !important;
    border-bottom: none !important;
    border-top: 1px solid rgba(0, 0, 0, 0.09) !important;
    background: rgba(250, 250, 252, 0.94) !important;
    backdrop-filter: blur(32px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(32px) saturate(200%) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
    flex-direction: row !important;
    align-items: center !important;
    z-index: 1300 !important;
    box-sizing: border-box !important;
  }

  body.dark-mode .apple-admin-menu {
    background: rgba(22, 22, 24, 0.95) !important;
    border-top-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5) !important;
  }

  .admin-menu-header,
  .admin-menu-footer,
  .admin-menu-section-label,
  .nav-item-active-bar,
  .nav-item-badge {
    display: none !important;
  }

  .admin-menu-scroll {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 2px !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 2px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  .admin-menu-scroll::-webkit-scrollbar {
    display: none !important;
  }

  .admin-nav-item {
    flex: 1 0 60px !important;
    min-width: 60px !important;
    height: 50px !important;
    padding: 4px 4px !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    background: transparent !important;
    color: var(--text-secondary) !important;
  }

  .admin-nav-item i,
  .admin-nav-item svg {
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
  }

  .admin-nav-item .nav-item-label {
    display: block !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    line-height: 1.05 !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 68px !important;
  }

  .admin-nav-item.active {
    color: var(--apple-blue) !important;
    background: rgba(0, 113, 227, 0.1) !important;
  }

  body.dark-mode .admin-nav-item.active {
    color: #0a84ff !important;
    background: rgba(10, 132, 255, 0.16) !important;
  }

  /* ------------------------------------------------------------------------
     8. ADMIN EXPANDED PANEL & STICKY MOBILE HEADER (.admin-expanded-panel)
     ------------------------------------------------------------------------ */
  .admin-expanded-panel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
    z-index: 1200 !important;
  }

  .admin-window.admin-macos-split-view {
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    border: none !important;
  }

  .admin-sidebar-nav {
    display: none !important;
  }

  .mobile-admin-topbar {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px 14px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    flex-shrink: 0 !important;
    z-index: 10 !important;
  }

  body.dark-mode .mobile-admin-topbar {
    background: rgba(28, 28, 30, 0.94) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
  }

  .mobile-admin-topbar-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .mobile-admin-back-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 6px 10px 6px 6px !important;
    border-radius: 999px !important;
    border: none !important;
    background: rgba(0, 113, 227, 0.1) !important;
    color: var(--apple-blue) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
  }

  .mobile-admin-back-btn i,
  .mobile-admin-back-btn svg {
    width: 16px !important;
    height: 16px !important;
  }

  .mobile-admin-topbar-title {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    letter-spacing: -0.02em !important;
  }

  .mobile-admin-add-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: none !important;
    background: var(--apple-blue) !important;
    color: #ffffff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    cursor: pointer !important;
  }

  .mobile-admin-add-btn i,
  .mobile-admin-add-btn svg {
    width: 16px !important;
    height: 16px !important;
  }

  .mobile-admin-tabs-scroll {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 2px !important;
  }

  .mobile-admin-tabs-scroll::-webkit-scrollbar {
    display: none !important;
  }

  .mobile-admin-tab-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 6px 12px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(0, 0, 0, 0.07) !important;
    background: rgba(0, 0, 0, 0.04) !important;
    color: var(--text-secondary) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
  }

  body.dark-mode .mobile-admin-tab-pill {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
  }

  .mobile-admin-tab-pill.active {
    background: var(--apple-blue) !important;
    border-color: var(--apple-blue) !important;
    color: #ffffff !important;
  }

  .mobile-admin-tab-pill i,
  .mobile-admin-tab-pill svg {
    width: 13px !important;
    height: 13px !important;
  }

  .admin-content-scroll {
    flex: 1 1 auto !important;
    padding: 16px 14px 28px 14px !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .admin-section-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .admin-header-actions {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .admin-header-actions .apple-button {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }

  .admin-table-card {
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 14px !important;
  }

  .apple-table {
    min-width: 640px !important;
  }

  .gateway-grid,
  .drivers-grid,
  .fuel-kpi-strip {
    grid-template-columns: 1fr !important;
  }

  .driver-metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ------------------------------------------------------------------------
     9. ALL DIALOG MODALS AS iOS BOTTOM SHEETS ON MOBILE
     ------------------------------------------------------------------------ */
  dialog.apple-modal-dialog {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh !important;
    margin: auto 0 0 0 !important;
    padding: 0 !important;
    border-radius: 26px 26px 0 0 !important;
  }

  dialog.apple-modal-dialog .apple-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh !important;
    border-radius: 26px 26px 0 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    padding-bottom: env(safe-area-inset-bottom, 16px) !important;
  }

  dialog.apple-modal-dialog .form-row {
    flex-direction: column !important;
    gap: 12px !important;
  }

  dialog.apple-modal-dialog .apple-input,
  dialog.apple-modal-dialog .apple-select {
    font-size: 16px !important;
  }

  dialog.apple-modal-dialog .apple-modal-footer {
    flex-direction: column-reverse !important;
    gap: 8px !important;
  }

  dialog.apple-modal-dialog .apple-modal-footer .apple-button {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Interactive Route Player on Mobile */
  dialog.apple-route-player-modal {
    width: 100% !important;
    height: 100dvh !important;
    max-width: 100% !important;
    max-height: 100dvh !important;
    inset: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
}


/* ==========================================================================
   APPLE MAPS POI CUSTOMER PINS & TRAFFIC INCIDENT PINS (CRISP VIVID STYLE)
   ========================================================================== */
.apple-store-pin {
  position: relative !important;
  width: 28px !important;
  height: 28px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 14 !important;
}

.store-pin-circle {
  width: 26px !important;
  height: 26px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #0071e3 0%, #005bb5 100%) !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 3px 10px rgba(0, 113, 227, 0.38), 0 1px 3px rgba(0, 0, 0, 0.22) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #ffffff !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}

.store-pin-circle svg {
  width: 13px !important;
  height: 13px !important;
  stroke: #ffffff !important;
  color: #ffffff !important;
}

.apple-store-pin:hover .store-pin-circle {
  transform: scale(1.14) !important;
  box-shadow: 0 5px 14px rgba(0, 113, 227, 0.5) !important;
}

.apple-store-pin.is-active .store-pin-circle {
  background: linear-gradient(135deg, #34c759 0%, #248a3d 100%) !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.32), 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

.store-label-pill {
  position: absolute !important;
  top: calc(100% + 3px) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  font-size: 9.5px !important;
  font-weight: 700 !important;
  color: #1d1d1f !important;
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  padding: 1.5px 6px !important;
  border-radius: 5px !important;
  white-space: nowrap !important;
  pointer-events: none !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.14) !important;
  border: 0.5px solid rgba(0, 0, 0, 0.08) !important;
}

body.dark-mode .store-label-pill {
  background: rgba(28, 28, 30, 0.92) !important;
  color: #f5f5f7 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

.traffic-incident-pin {
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  background: #ff9500 !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.traffic-incident-pin.danger,
.traffic-incident-pin.accident {
  background: #ff3b30 !important;
}

.traffic-incident-pin.warning,
.traffic-incident-pin.construction {
  background: #ff9500 !important;
}

.traffic-incident-pin svg {
  width: 12px !important;
  height: 12px !important;
  stroke: #ffffff !important;
}


/* ==========================================================================
   APPLE SONOMA / iOS NOTIFICATION BANNER (EMOJI-FREE FROSTED GLASS TOASTS)
   ========================================================================== */
.toast-container {
  position: fixed !important;
  bottom: 22px !important;
  right: 22px !important;
  z-index: 4500 !important;
  display: flex !important;
  flex-direction: column-reverse !important;
  align-items: flex-end !important;
  gap: 10px !important;
  pointer-events: none !important;
  max-width: min(410px, calc(100% - 28px)) !important;
}

@media (max-width: 900px) {
  .toast-container {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px !important;
    left: 12px !important;
    align-items: stretch !important;
    max-width: none !important;
  }
}

.apple-toast {
  pointer-events: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 11px 14px 11px 12px !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(28px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(200%) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  color: #1d1d1f !important;
  min-width: 290px !important;
  max-width: 410px !important;
  max-height: 110px;
  overflow: hidden;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  will-change: transform, opacity;
  animation: appleToastEnter 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-toast.is-exiting {
  pointer-events: none !important;
  animation: appleToastExit 0.34s cubic-bezier(0.32, 0, 0.67, 0) forwards !important;
}

body.dark-mode .apple-toast {
  background: rgba(28, 28, 30, 0.94) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.55) !important;
  color: #f5f5f7 !important;
}

.apple-toast-icon-box {
  width: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  background: rgba(0, 113, 227, 0.12) !important;
  color: #0071e3 !important;
}

.apple-toast.toast-success .apple-toast-icon-box {
  background: rgba(52, 199, 89, 0.14) !important;
  color: #28a745 !important;
}

.apple-toast.toast-warning .apple-toast-icon-box {
  background: rgba(255, 149, 0, 0.15) !important;
  color: #e68600 !important;
}

.apple-toast.toast-danger .apple-toast-icon-box {
  background: rgba(255, 59, 48, 0.14) !important;
  color: #ff3b30 !important;
}

.apple-toast-icon-box svg {
  width: 17px !important;
  height: 17px !important;
  stroke-width: 2.1px !important;
}

.apple-toast-texts {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1.5px !important;
}

.apple-toast-kicker {
  font-size: 9.5px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: #86868b !important;
  line-height: 1.1 !important;
}

.apple-toast.toast-danger .apple-toast-kicker {
  color: #ff3b30 !important;
}

.apple-toast.toast-success .apple-toast-kicker {
  color: #28a745 !important;
}

.apple-toast-msg {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: inherit !important;
  line-height: 1.32 !important;
  letter-spacing: -0.01em !important;
}

.apple-toast-close {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  border: none !important;
  background: rgba(120, 120, 128, 0.12) !important;
  color: #86868b !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: background-color 0.15s ease, color 0.15s ease !important;
}

.apple-toast-close:hover {
  background: rgba(120, 120, 128, 0.24) !important;
  color: var(--text-primary) !important;
}

.apple-toast-close svg {
  width: 12px !important;
  height: 12px !important;
}

@keyframes appleToastEnter {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.94);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

@keyframes appleToastExit {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
    max-height: 96px;
    margin-top: 0;
    padding-top: 11px;
    padding-bottom: 11px;
  }
  62% {
    opacity: 0;
    transform: translate3d(34px, 0, 0) scale(0.95);
    filter: blur(3px);
    max-height: 96px;
    padding-top: 11px;
    padding-bottom: 11px;
  }
  100% {
    opacity: 0;
    transform: translate3d(34px, 0, 0) scale(0.95);
    filter: blur(3px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
  }
}

/* ==========================================================================
   TOP-LAYER DIALOG ANIMATIONS & SCROLL CONTAINMENT (MWG COMPLIANT)
   ========================================================================== */
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}

/* Deterministic 60fps Route Player Modal Enter/Exit Spring Transitions */
dialog.apple-route-player-modal {
  position: fixed !important;
  inset: 0 !important;
  margin: 0 !important;
  border: none !important;
  padding: 14px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  z-index: 3000 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: rgba(10, 12, 18, 0) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1 !important;
  transform: none !important;
  transition: background-color 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

dialog.apple-route-player-modal:not([open]) {
  display: none !important;
}

dialog.apple-route-player-modal::backdrop {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

dialog.apple-route-player-modal[open] .player-window {
  opacity: 0 !important;
  transform: scale(0.93) translate3d(0, 22px, 0) !important;
  will-change: transform, opacity;
  transition: transform 0.36s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

dialog.apple-route-player-modal[open].is-open {
  background-color: rgba(10, 12, 18, 0.64) !important;
}

dialog.apple-route-player-modal[open].is-open .player-window {
  opacity: 1 !important;
  transform: scale(1) translate3d(0, 0, 0) !important;
}

dialog.apple-route-player-modal[open].is-closing {
  background-color: rgba(10, 12, 18, 0) !important;
  transition: background-color 0.24s cubic-bezier(0.32, 0, 0.67, 0) !important;
}

dialog.apple-route-player-modal[open].is-closing .player-window {
  opacity: 0 !important;
  transform: scale(0.95) translate3d(0, 16px, 0) !important;
  transition: transform 0.24s cubic-bezier(0.32, 0, 0.67, 0), opacity 0.2s ease !important;
}

.route-player-map-canvas {
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 22px 22px 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  transition: opacity 0.28s ease;
}

.route-player-map-canvas.map-ready {
  opacity: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
  dialog.apple-route-player-modal,
  dialog.apple-route-player-modal[open] .player-window,
  dialog.apple-modal-dialog {
    transition-duration: 0.1s !important;
    transform: none !important;
  }
}

/* ==========================================================================
   FUEL MODAL VEHICLE CAROUSEL NAVIGATION & SCROLLING
   ========================================================================== */
.fuel-selector-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}

.fuel-selector-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fuel-carousel-nav-btns {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.fuel-carousel-arrow {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.16s ease;
}

body.dark-mode .fuel-carousel-arrow {
  background: #2c2c2e;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
}

.fuel-carousel-arrow:hover {
  background: var(--apple-blue);
  border-color: var(--apple-blue);
  color: #ffffff;
  transform: scale(1.06);
}

.fuel-carousel-arrow svg {
  width: 14px !important;
  height: 14px !important;
}

.fuel-vehicle-selector-scroll {
  scrollbar-width: thin !important;
  scrollbar-color: rgba(0, 113, 227, 0.28) transparent !important;
  cursor: grab;
  user-select: none;
  padding-bottom: 8px !important;
}

.fuel-vehicle-selector-scroll.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto !important;
}

.fuel-vehicle-selector-scroll::-webkit-scrollbar {
  display: block !important;
  height: 5px !important;
}

.fuel-vehicle-selector-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 113, 227, 0.25) !important;
  border-radius: 99px !important;
}

/* ==========================================================================
   DRIVER PROFILE & ADD DRIVER MODAL (APPLE BENTO REDESIGN)
   ========================================================================== */
.driver-profile-header {
  padding: 20px 24px 16px 24px !important;
  border-bottom: 1px solid var(--panel-inner-border) !important;
}

.driver-hero-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.driver-hero-texts {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.driver-hero-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.driver-hero-name-row h3 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.driver-profile-body {
  padding: 18px 24px !important;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.driver-metric-card {
  background: rgba(0, 0, 0, 0.025) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  border-radius: 14px !important;
  padding: 12px 14px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}

body.dark-mode .driver-metric-card {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
}

.driver-metric-card.highlight-green {
  background: rgba(52, 199, 89, 0.06) !important;
  border-color: rgba(52, 199, 89, 0.22) !important;
}

.driver-metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.metric-mini-icon {
  width: 14px !important;
  height: 14px !important;
}

.metric-mini-icon.green { color: #34c759; }
.metric-mini-icon.blue { color: #0071e3; }
.metric-mini-icon.amber { color: #ff9500; }

.driver-assigned-vehicle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.06) 0%, rgba(0, 113, 227, 0.02) 100%);
  border: 1px solid rgba(0, 113, 227, 0.18);
  flex-wrap: wrap;
}

.driver-veh-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.driver-veh-thumb-box {
  width: 58px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.dark-mode .driver-veh-thumb-box {
  background: #252528;
  border-color: rgba(255, 255, 255, 0.1);
}

.driver-veh-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.driver-veh-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.driver-veh-caption {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--apple-blue);
}

.driver-veh-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-veh-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.driver-veh-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.driver-activities-card {
  background: rgba(0, 0, 0, 0.018);
  border: 1px solid var(--panel-inner-border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.dark-mode .driver-activities-card {
  background: rgba(255, 255, 255, 0.025);
}

.driver-activities-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.driver-activities-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.driver-activities-title svg {
  color: var(--apple-blue);
  width: 15px !important;
  height: 15px !important;
}

.driver-activity-timeline {
  max-height: 210px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(120, 120, 128, 0.3) transparent !important;
}

.driver-profile-footer {
  padding: 14px 24px !important;
  border-top: 1px solid var(--panel-inner-border) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.driver-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.driver-onboard-info-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 113, 227, 0.07);
  border: 1px solid rgba(0, 113, 227, 0.16);
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.driver-onboard-info-banner svg {
  color: var(--apple-blue);
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0;
}

/* ==========================================================================
   SHARE LOCATION MODAL (APPLE SHARE SHEET)
   ========================================================================== */
.share-vehicle-summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid var(--panel-inner-border);
}

body.dark-mode .share-vehicle-summary-card {
  background: rgba(255, 255, 255, 0.04);
}

.share-veh-thumb {
  width: 68px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
}

.share-veh-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.share-veh-info strong {
  font-size: 13.5px;
  color: var(--text-primary);
}

.share-veh-info span {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.share-url-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-url-copy-row .apple-input {
  flex: 1;
  font-size: 12px;
}

.share-channels-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.share-channel-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--panel-inner-border);
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-primary);
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

body.dark-mode .share-channel-btn {
  background: rgba(255, 255, 255, 0.04);
}

.share-channel-btn:hover {
  transform: translateY(-2px);
  border-color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.08);
}

.share-channel-btn.whatsapp svg { color: #25D366; }
.share-channel-btn.telegram svg { color: #0088cc; }
.share-channel-btn.gmaps svg { color: #ea4335; }
.share-channel-btn.email svg { color: #0071e3; }

/* ==========================================================================
   GEOFENCE (İZİNLİ ALAN), VEHICLE ALERTS & FUEL LOGS IN SHEET & ADMIN PAGE
   ========================================================================== */
.geofence-sheet-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.geofence-status-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2.5px 9px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.geofence-status-pill.inside {
  background: rgba(52, 199, 89, 0.14);
  color: #248a3d;
}

body.dark-mode .geofence-status-pill.inside {
  color: #30d158;
}

.geofence-status-pill.outside {
  background: rgba(255, 59, 48, 0.15);
  color: #ff3b30;
  animation: pulse-beacon 1.6s infinite;
}

.geofence-zone-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.geofence-zone-meta strong {
  font-size: 13px;
  color: var(--text-primary);
}

.geofence-zone-meta span {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.geofence-radius-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(0, 0, 0, 0.025);
  padding: 7px 10px;
  border-radius: 10px;
}

body.dark-mode .geofence-radius-control-row {
  background: rgba(255, 255, 255, 0.04);
}

.geofence-radius-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.geofence-sheet-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.geofence-sheet-actions .apple-button {
  flex: 1;
  justify-content: center;
}

.apple-button.danger-text {
  color: #ff3b30 !important;
  border-color: rgba(255, 59, 48, 0.22) !important;
  background: rgba(255, 59, 48, 0.06) !important;
}

.apple-button.danger-text:hover {
  background: rgba(255, 59, 48, 0.14) !important;
}

.sheet-records-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-count-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}

.sheet-count-pill.red {
  background: rgba(255, 59, 48, 0.12);
  color: #ff3b30;
}

.sheet-count-pill.blue {
  background: rgba(0, 113, 227, 0.12);
  color: #0071e3;
}

.sheet-records-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 185px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.sheet-record-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.024);
  border: 1px solid rgba(0, 0, 0, 0.045);
}

body.dark-mode .sheet-record-item {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.07);
}

.sheet-record-item.alert-danger {
  background: rgba(255, 59, 48, 0.06);
  border-color: rgba(255, 59, 48, 0.18);
}

.sheet-record-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sheet-record-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.sheet-record-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.sheet-record-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 900px) {
  dialog.apple-route-player-modal {
    padding: 0 !important;
  }
}

/* ==========================================================================
   VEHICLE DETAIL SHEET iOS SEGMENTED TABS (#vehicle-detail-dialog)
   ========================================================================== */
.sheet-segmented-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.12);
  margin: 2px 0 8px 0;
  flex-shrink: 0;
}

body.dark-mode .sheet-segmented-tabs {
  background: rgba(118, 118, 128, 0.24);
}

.sheet-seg-btn {
  position: relative;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 6px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.sheet-seg-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 0.5px 1px rgba(0, 0, 0, 0.06);
}

body.dark-mode .sheet-seg-btn.active {
  background: #3a3a3c;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.sheet-seg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 6px rgba(255, 59, 48, 0.7);
  flex-shrink: 0;
}

.sheet-tab-pane:not(.active) {
  display: none !important;
}

.sheet-pane-stack.active {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   APPLE BENTO VEHICLE COMMAND CENTER (#admin-vehicle-detail-view / .vmp-shell)
   ========================================================================== */
.vmp-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: appleCardFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.vmp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.035);
}

body.dark-mode .vmp-topbar {
  background: #242426;
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.vmp-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.vmp-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px 6px 8px;
  border-radius: 99px;
  border: 1px solid rgba(0, 113, 227, 0.18);
  background: rgba(0, 113, 227, 0.08);
  color: var(--apple-blue);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.vmp-back-btn:hover {
  background: var(--apple-blue);
  color: #ffffff;
}

.vmp-back-btn svg {
  width: 15px;
  height: 15px;
}

.vmp-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vmp-model-heading {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.vmp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* HERO BENTO: 3D Dark Studio Showcase + 2x2 KPI Matrix */
.vmp-hero-bento {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 16px;
}

@media (max-width: 980px) {
  .vmp-hero-bento {
    grid-template-columns: 1fr;
  }
}

.vmp-studio-card {
  position: relative;
  border-radius: 22px;
  background: linear-gradient(155deg, #16161a 0%, #242429 55%, #191c24 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  color: #ffffff;
}

.vmp-studio-card::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 180px;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.28) 0%, rgba(52, 199, 89, 0.08) 45%, transparent 72%);
  pointer-events: none;
}

.vmp-studio-top-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vmp-city-chip {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.vmp-studio-stage {
  position: relative;
  z-index: 1;
  height: 155px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vmp-studio-stage::after {
  content: "";
  position: absolute;
  bottom: 8px;
  width: 170px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.65) 0%, transparent 72%);
}

#vmp-studio-img {
  position: relative;
  z-index: 2;
  max-width: 225px;
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.55));
  transition: opacity 0.16s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.vmp-angle-pills {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.vmp-angle-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 4px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.vmp-angle-btn.active {
  background: #ffffff;
  color: #1d1d1f;
}

.vmp-driver-pill {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.vmp-driver-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.vmp-driver-name {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
}

.vmp-driver-phone {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.68);
}

.vmp-focus-btn {
  padding: 6px 10px;
  border-radius: 9px;
  border: none;
  background: #0a84ff;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background-color 0.16s ease;
}

.vmp-focus-btn:hover {
  background: #409cff;
}

/* Right Column: 2x2 Elevated KPI Matrix */
.vmp-kpi-matrix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 640px) {
  .vmp-kpi-matrix {
    grid-template-columns: 1fr;
  }
}

.vmp-kpi-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.035);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

body.dark-mode .vmp-kpi-card {
  background: #242426;
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.32);
}

.vmp-kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vmp-kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.vmp-icon-squircle {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vmp-icon-squircle.blue { background: rgba(0, 113, 227, 0.12); color: #0071e3; }
.vmp-icon-squircle.green { background: rgba(52, 199, 89, 0.14); color: #248a3d; }
.vmp-icon-squircle.amber { background: rgba(255, 149, 0, 0.14); color: #e68600; }
.vmp-icon-squircle.red { background: rgba(255, 59, 48, 0.14); color: #ff3b30; }
.vmp-icon-squircle.purple { background: rgba(175, 82, 222, 0.14); color: #af52de; }

.vmp-icon-squircle svg {
  width: 15px;
  height: 15px;
}

.vmp-kpi-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.15;
}

.vmp-kpi-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.vmp-bar-track {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: rgba(120, 120, 128, 0.14);
  overflow: hidden;
}

.vmp-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* Sub-navigation Segmented Pill Bar */
.vmp-nav-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(118, 118, 128, 0.12);
  overflow-x: auto;
  scrollbar-width: none;
}

.vmp-nav-pills::-webkit-scrollbar {
  display: none;
}

body.dark-mode .vmp-nav-pills {
  background: rgba(118, 118, 128, 0.22);
}

.vmp-nav-pill-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.vmp-nav-pill-btn:hover {
  color: var(--text-primary);
}

.vmp-nav-pill-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.dark-mode .vmp-nav-pill-btn.active {
  background: #3a3a3c;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.vmp-pill-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(0, 113, 227, 0.12);
  color: var(--apple-blue);
}

.vmp-pill-badge.red {
  background: rgba(255, 59, 48, 0.14);
  color: #ff3b30;
}

/* Bento Section Cards */
.vmp-bento-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 22px;
  padding: 20px 22px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.035);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

body.dark-mode .vmp-bento-card {
  background: #242426;
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.vmp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.vmp-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 9px;
}

.vmp-card-sub {
  margin: 2px 0 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Geofence Live Radar Layout */
.vmp-geofence-layout {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 20px;
  align-items: center;
}

@media (max-width: 720px) {
  .vmp-geofence-layout {
    grid-template-columns: 1fr;
  }
}

.vmp-radar-visual {
  position: relative;
  width: 176px;
  height: 176px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.09) 0%, rgba(0, 113, 227, 0.02) 68%, rgba(255, 59, 48, 0.05) 100%);
  border: 2px dashed rgba(0, 113, 227, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vmp-radar-visual.is-outside {
  background: radial-gradient(circle, rgba(255, 59, 48, 0.12) 0%, rgba(255, 59, 48, 0.03) 72%, rgba(255, 59, 48, 0.14) 100%);
  border-color: rgba(255, 59, 48, 0.65);
}

.vmp-radar-inner-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px dashed rgba(0, 113, 227, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vmp-radar-center-pin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--apple-blue);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.5);
}

.vmp-radar-vehicle-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #34c759;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 0 5px rgba(52, 199, 89, 0.25), 0 3px 10px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
  transition: left 0.35s ease, top 0.35s ease, background-color 0.25s ease;
}

.vmp-radar-vehicle-dot.outside {
  background: #ff3b30;
  box-shadow: 0 0 0 6px rgba(255, 59, 48, 0.3), 0 3px 10px rgba(0, 0, 0, 0.3);
  animation: pulse-beacon 1.5s infinite;
}

.vmp-radius-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.vmp-preset-chip {
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

body.dark-mode .vmp-preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.vmp-preset-chip.active,
.vmp-preset-chip:hover {
  background: var(--apple-blue);
  border-color: var(--apple-blue);
  color: #ffffff;
}

/* Fuel Summary Strip */
.vmp-fuel-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 720px) {
  .vmp-fuel-summary-row {
    grid-template-columns: 1fr;
  }
}

.vmp-fuel-stat-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body.dark-mode .vmp-fuel-stat-box {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Alert Timeline Cards */
.vmp-alert-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vmp-alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.055);
  border-left: 4px solid #0071e3;
}

body.dark-mode .vmp-alert-item {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
}

.vmp-alert-item.danger {
  background: rgba(255, 59, 48, 0.055);
  border-left-color: #ff3b30;
}

.vmp-alert-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.vmp-trip-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.055);
  flex-wrap: wrap;
}

body.dark-mode .vmp-trip-card-row {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
}

#admin-vehicles-tbody tr.clickable-veh-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

#admin-vehicles-tbody tr.clickable-veh-row:hover {
  background-color: rgba(0, 113, 227, 0.05);
}

/* ==========================================================================
   DESKTOP ZERO-OVERLAP SHEET, TOP HORIZONTAL MENU & 840px DRIVER PROFILE
   ========================================================================== */
@media (min-width: 901px) {
  dialog.apple-sheet,
  dialog#vehicle-detail-dialog {
    width: 436px !important;
    min-width: 436px !important;
    top: auto !important;
    bottom: 14px !important;
    right: 14px !important;
    max-height: calc(100dvh - 284px) !important;
    z-index: 105 !important;
  }

  dialog.apple-sheet .sheet-container,
  dialog#vehicle-detail-dialog .sheet-container {
    max-height: calc(100dvh - 286px) !important;
  }

  .floating-map-controls,
  body.vehicle-sheet-open .floating-map-controls,
  body:has(dialog#vehicle-detail-dialog[open]) .floating-map-controls {
    top: 14px !important;
    right: 14px !important;
    transition: opacity 0.2s ease !important;
  }

  /* Uncap wider Apple modal dialogs from 520px desktop bottleneck */
  dialog#modal-driver-profile {
    width: min(840px, 94vw) !important;
    max-width: 840px !important;
  }

  dialog#modal-driver-profile .driver-profile-modal-card {
    width: 100% !important;
    max-width: 840px !important;
  }

  dialog#modal-fuel-entry {
    width: min(720px, 94vw) !important;
    max-width: 720px !important;
  }

  dialog#modal-fuel-entry .apple-modal-card {
    max-width: 720px !important;
  }

  dialog#modal-add-driver,
  dialog#modal-vehicle-settings {
    width: min(620px, 94vw) !important;
    max-width: 620px !important;
  }

  dialog#modal-add-driver .apple-modal-card,
  dialog#modal-vehicle-settings .apple-modal-card {
    max-width: 620px !important;
  }

  dialog#modal-add-entity {
    width: min(640px, 94vw) !important;
    max-width: 640px !important;
  }

  dialog#modal-add-entity .apple-modal-card {
    max-width: 640px !important;
    max-height: min(90dvh, 840px);
  }

  .driver-assigned-vehicle-card {
    flex-wrap: nowrap !important;
  }
}

/* Sheet Header Actions & Top 4-Tab Horizontal Menu */
.sheet-badge-action-row {
  display: flex !important;
  width: 100% !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 6px !important;
}

.sheet-header-right-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sheet-top-horizontal-menu {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 3px !important;
  padding: 3.5px !important;
  border-radius: 12px !important;
  background: rgba(118, 118, 128, 0.12) !important;
  margin: 2px 0 6px 0 !important;
  flex-shrink: 0 !important;
}

body.dark-mode .sheet-top-horizontal-menu {
  background: rgba(118, 118, 128, 0.24) !important;
}

.sheet-top-horizontal-menu .sheet-seg-btn {
  padding: 6px 4px !important;
  font-size: 11.5px !important;
  gap: 4px !important;
  border-radius: 8.5px !important;
}

.sheet-top-horizontal-menu .sheet-seg-btn svg {
  width: 13px !important;
  height: 13px !important;
  flex-shrink: 0;
}

#sheet-pane-overview .vehicle-studio-card {
  height: 122px !important;
  min-height: 122px !important;
  margin-bottom: 2px !important;
}

#sheet-pane-overview .studio-van-model {
  max-height: 100px !important;
}

.overview-fuel-jump {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.overview-fuel-jump:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 113, 227, 0.35) !important;
  background: rgba(0, 113, 227, 0.04) !important;
}

.sheet-sat-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.sheet-coords-voltage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.sheet-actions-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.sheet-actions-duo .apple-button {
  justify-content: center;
}

/* ==========================================================================
   WIDESCREEN APPLE SONOMA DRIVER PROFILE REFINEMENTS (#modal-driver-profile)
   ========================================================================== */
.driver-meta-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.driver-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(118, 118, 128, 0.1);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

body.dark-mode .driver-meta-pill {
  background: rgba(255, 255, 255, 0.09);
  color: #d1d1d6;
}

.driver-meta-pill svg {
  width: 11px !important;
  height: 11px !important;
  color: var(--apple-blue);
}

.driver-profile-body {
  background: #f5f5f7 !important;
  padding: 20px 24px !important;
  gap: 16px !important;
}

body.dark-mode .driver-profile-body {
  background: #18181a !important;
}

.driver-metrics-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

@media (max-width: 720px) {
  .driver-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.driver-profile-body .driver-metric-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.035) !important;
  padding: 14px 16px !important;
  border-radius: 16px !important;
}

body.dark-mode .driver-profile-body .driver-metric-card {
  background: #242426 !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
}

.driver-profile-body .driver-metric-card.highlight-green {
  background: linear-gradient(155deg, #ffffff 0%, rgba(52, 199, 89, 0.08) 100%) !important;
  border-color: rgba(52, 199, 89, 0.25) !important;
}

body.dark-mode .driver-profile-body .driver-metric-card.highlight-green {
  background: linear-gradient(155deg, #242426 0%, rgba(48, 209, 88, 0.14) 100%) !important;
}

.driver-profile-body .metric-label {
  font-size: 10.5px !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-profile-body .metric-value {
  font-size: 21px !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
  white-space: nowrap !important;
  line-height: 1.2;
  margin-top: 2px;
}

.driver-profile-body .driver-assigned-vehicle-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 113, 227, 0.18) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.035) !important;
  padding: 14px 18px !important;
  border-radius: 18px !important;
}

body.dark-mode .driver-profile-body .driver-assigned-vehicle-card {
  background: #242426 !important;
  border-color: rgba(10, 132, 255, 0.28) !important;
}

.driver-profile-body .driver-veh-thumb-box {
  width: 74px !important;
  height: 52px !important;
  background: #f5f5f7 !important;
}

body.dark-mode .driver-profile-body .driver-veh-thumb-box {
  background: #1c1c1e !important;
}

.driver-profile-body .driver-activities-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.035) !important;
  padding: 16px 18px !important;
  border-radius: 18px !important;
}

body.dark-mode .driver-profile-body .driver-activities-card {
  background: #242426 !important;
  border-color: rgba(255, 255, 255, 0.09) !important;
}

.driver-profile-body .driver-activity-timeline {
  max-height: 270px !important;
  padding-right: 4px !important;
}

.driver-profile-body .driver-activity-timeline::-webkit-scrollbar {
  width: 4px !important;
}

.driver-profile-body .driver-activity-timeline::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 128, 0.28) !important;
  border-radius: 99px !important;
}

/* ==========================================================================
   VEHICLE SHEET ACTION DOCK & ROUTE PLAYER MAP VISIBILITY FIXES
   ========================================================================== */
.sheet-actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
  margin-top: 6px !important;
}

.sheet-actions-duo {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 7px !important;
  width: 100% !important;
}

.sheet-actions .sheet-actions-duo > .apple-button,
.sheet-actions .sheet-actions-duo > .apple-button.primary,
.sheet-actions .sheet-actions-duo > .apple-button.secondary,
.sheet-actions .sheet-actions-duo > .apple-button.danger-tint {
  grid-column: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 38px !important;
  padding: 0 10px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  justify-content: center !important;
  align-items: center !important;
}

#btn-live-player-launch {
  background: rgba(0, 113, 227, 0.1) !important;
  color: #0071e3 !important;
  border: 1px solid rgba(0, 113, 227, 0.2) !important;
}

#btn-live-player-launch:hover {
  background: rgba(0, 113, 227, 0.16) !important;
  border-color: rgba(0, 113, 227, 0.34) !important;
}

body.dark-mode #btn-live-player-launch {
  background: rgba(10, 132, 255, 0.18) !important;
  color: #409cff !important;
  border-color: rgba(10, 132, 255, 0.32) !important;
}

body.dark-mode #btn-live-player-launch:hover {
  background: rgba(10, 132, 255, 0.28) !important;
}

.sheet-actions-triplet {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
}

.sheet-actions .sheet-actions-triplet > .apple-button,
.sheet-actions .sheet-actions-triplet > .apple-button.secondary,
.sheet-actions .sheet-actions-triplet > .apple-button.primary {
  grid-column: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 34px !important;
  padding: 0 6px !important;
  font-size: 11.5px !important;
  margin: 0 !important;
  justify-content: center !important;
  align-items: center !important;
}

/* Route Player MapKit Canvas Sizing & Guaranteed Render */
.player-layout {
  min-width: 0 !important;
  min-height: 0 !important;
}

.player-map-viewport {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  position: relative !important;
}

#route-player-map,
#route-player-map .mk-map-view {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 240px !important;
  opacity: 1 !important;
  visibility: visible !important;
}

@media (max-width: 900px) {
  .player-layout {
    flex-direction: column !important;
  }

  .player-map-viewport {
    height: 40vh !important;
    min-height: 240px !important;
    width: 100% !important;
    flex: none !important;
    border-radius: 0 !important;
  }

  #route-player-map {
    border-radius: 0 !important;
  }

  .player-dashboard {
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    border-right: none !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 0 !important;
  }

  body.dark-mode .player-dashboard {
    border-top-color: rgba(255, 255, 255, 0.1) !important;
  }
}

/* ==========================================================================
   COLOR SCHEME SYNC, LIGHT-MODE VEHICLE STUDIO & FUEL RECEIPT DETAIL MODAL
   ========================================================================== */
:root {
  color-scheme: light dark;
}

body.light-mode,
body:not(.dark-mode) {
  color-scheme: light;
}

body.dark-mode {
  color-scheme: dark;
}

/* 1. Light-Mode Showroom Vehicle Studio Card (.vmp-studio-card) */
body:not(.dark-mode) .vmp-studio-card {
  background: linear-gradient(165deg, #ffffff 0%, #f5f7fb 60%, #edf1f7 100%) !important;
  border: 1px solid rgba(0, 0, 0, 0.07) !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.045) !important;
  color: #1d1d1f !important;
}

body:not(.dark-mode) .vmp-studio-card::before {
  background: radial-gradient(circle, rgba(0, 113, 227, 0.09) 0%, rgba(52, 199, 89, 0.04) 48%, transparent 72%) !important;
}

body:not(.dark-mode) .vmp-city-chip {
  background: rgba(0, 113, 227, 0.08) !important;
  color: #0071e3 !important;
  border: 1px solid rgba(0, 113, 227, 0.14) !important;
}

.vmp-ignition-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.vmp-ignition-chip.on {
  background: rgba(52, 199, 89, 0.14);
  color: #248a3d;
}

.vmp-ignition-chip.off {
  background: rgba(142, 142, 147, 0.14);
  color: #6e6e73;
}

body.dark-mode .vmp-ignition-chip.on {
  background: rgba(48, 209, 88, 0.18);
  color: #30d158;
}

body.dark-mode .vmp-ignition-chip.off {
  background: rgba(255, 255, 255, 0.1);
  color: #a1a1a6;
}

body:not(.dark-mode) .vmp-studio-stage::after {
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.16) 0%, transparent 72%) !important;
}

body:not(.dark-mode) #vmp-studio-img {
  filter: drop-shadow(0 10px 18px rgba(15, 23, 42, 0.18)) !important;
}

body:not(.dark-mode) .vmp-angle-pills {
  background: rgba(118, 118, 128, 0.12) !important;
}

body:not(.dark-mode) .vmp-angle-btn {
  color: #6e6e73 !important;
}

body:not(.dark-mode) .vmp-angle-btn:hover {
  color: #1d1d1f !important;
}

body:not(.dark-mode) .vmp-angle-btn.active {
  background: #ffffff !important;
  color: #1d1d1f !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08) !important;
}

body:not(.dark-mode) .vmp-driver-pill {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

body:not(.dark-mode) .vmp-driver-name {
  color: #1d1d1f !important;
}

body:not(.dark-mode) .vmp-driver-phone {
  color: #6e6e73 !important;
}

.vmp-kpi-card.clickable-kpi {
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.vmp-kpi-card.clickable-kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 113, 227, 0.28) !important;
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.08) !important;
}

/* 2. Route Player Interactive Date & Range Picker (#player-date-picker-wrap) */
.player-sidebar-header {
  position: relative;
  z-index: 40;
  overflow: visible !important;
}

.player-date-picker-wrap {
  position: relative;
  flex-shrink: 0;
  max-width: 100%;
}

.player-date-pill.interactive {
  border: 1px solid rgba(0, 113, 227, 0.2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
  max-width: 240px;
}

.player-date-pill.interactive:hover {
  background: rgba(0, 113, 227, 0.15);
  border-color: rgba(0, 113, 227, 0.4);
  transform: translateY(-0.5px);
}

.player-date-pill.interactive #player-date-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-date-chevron {
  width: 12px !important;
  height: 12px !important;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.player-date-pill.interactive[aria-expanded="true"] .player-date-chevron {
  transform: rotate(180deg);
}

.player-date-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 306px;
  max-width: calc(100vw - 40px);
  z-index: 200;
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: appleCardFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode .player-date-popover {
  background: #252528;
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}

.pdp-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(118, 118, 128, 0.12);
}

body.dark-mode .pdp-mode-tabs {
  background: rgba(255, 255, 255, 0.08);
}

.pdp-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.pdp-mode-btn.active {
  background: #ffffff;
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

body.dark-mode .pdp-mode-btn.active {
  background: #3a3a3c;
  color: #ffffff;
}

.pdp-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pdp-preset-chip {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.15s ease;
}

body.dark-mode .pdp-preset-chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #d1d1d6;
}

.pdp-preset-chip:hover,
.pdp-preset-chip.active {
  background: var(--apple-blue);
  border-color: var(--apple-blue);
  color: #ffffff;
}

.pdp-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 0;
}

.pdp-days-grid button.cal-day-cell {
  border: none;
  background: transparent;
  padding: 0;
  font-family: inherit;
  width: 100%;
}

.pdp-days-grid .cal-day-cell.in-range {
  background: rgba(0, 113, 227, 0.14);
  color: #0071e3;
  border-radius: 8px;
  font-weight: 600;
}

body.dark-mode .pdp-days-grid .cal-day-cell.in-range {
  background: rgba(10, 132, 255, 0.24);
  color: #64b5ff;
}

.pdp-days-grid .cal-day-cell.range-start,
.pdp-days-grid .cal-day-cell.range-end {
  background: var(--apple-blue) !important;
  color: #ffffff !important;
  border-radius: 50%;
}

.pdp-inputs-box {
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

body.dark-mode .pdp-inputs-box {
  border-top-color: rgba(255, 255, 255, 0.09);
}

.pdp-range-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pdp-field-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.pdp-date-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 11.5px !important;
  padding: 6px 8px !important;
}

@media (max-width: 900px) {
  .player-date-popover {
    right: 0;
    left: auto;
    width: min(306px, calc(100vw - 32px));
  }
}

/* 3. Clickable Fuel Refill Records & Receipt Detail Modal (#modal-fuel-log-detail) */
tr.clickable-fuel-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

tr.clickable-fuel-row:hover {
  background-color: rgba(0, 113, 227, 0.06) !important;
}

body.dark-mode tr.clickable-fuel-row:hover {
  background-color: rgba(10, 132, 255, 0.12) !important;
}

.sheet-record-item.clickable-fuel-record {
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.15s ease;
}

.sheet-record-item.clickable-fuel-record:hover {
  background: rgba(0, 113, 227, 0.07) !important;
  border-color: rgba(0, 113, 227, 0.28) !important;
  transform: translateY(-1px);
}

.fld-row-receipt-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(0, 113, 227, 0.1);
  color: #0071e3;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

body.dark-mode .fld-row-receipt-pill {
  background: rgba(10, 132, 255, 0.18);
  color: #409cff;
}

.fld-modal-card {
  max-width: 580px !important;
}

.fld-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.fld-veh-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 14px;
}

body.dark-mode .fld-veh-strip {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.09);
}

.fld-veh-thumb-wrap {
  width: 78px;
  height: 54px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.dark-mode .fld-veh-thumb-wrap {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.08);
}

.fld-veh-thumb {
  max-width: 68px;
  max-height: 44px;
  object-fit: contain;
}

.fld-veh-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.fld-veh-model {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.fld-veh-driver {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.fld-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 560px) {
  .fld-hero-grid {
    grid-template-columns: 1fr;
  }
}

.fld-hero-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

body.dark-mode .fld-hero-box {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.09);
}

.fld-hero-box.green {
  background: rgba(52, 199, 89, 0.09);
  border-color: rgba(52, 199, 89, 0.22);
}

.fld-hero-box.blue {
  background: rgba(0, 113, 227, 0.08);
  border-color: rgba(0, 113, 227, 0.2);
}

.fld-hero-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.fld-hero-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.fld-hero-box.green .fld-hero-val {
  color: #248a3d;
}

body.dark-mode .fld-hero-box.green .fld-hero-val {
  color: #30d158;
}

.fld-hero-box.blue .fld-hero-val {
  color: var(--apple-blue);
}

.fld-hero-sub {
  font-size: 10.5px;
  color: var(--text-tertiary);
}

.fld-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 560px) {
  .fld-detail-grid {
    grid-template-columns: 1fr;
  }
}

.fld-detail-card {
  padding: 11px 13px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

body.dark-mode .fld-detail-card {
  background: #242426;
  border-color: rgba(255, 255, 255, 0.08);
}

.fld-detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.fld-detail-val {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.fld-detail-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fld-efficiency-pill {
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
}

.fld-efficiency-pill.good {
  background: rgba(52, 199, 89, 0.14);
  color: #248a3d;
}

.fld-efficiency-pill.high {
  background: rgba(255, 149, 0, 0.16);
  color: #c96c00;
}

.fld-tank-bar-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.dark-mode .fld-tank-bar-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.fld-tank-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.fld-tank-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 99px;
  background: rgba(120, 120, 128, 0.16);
  overflow: hidden;
  display: flex;
}

.fld-tank-fill-existing {
  height: 100%;
  background: #34c759;
  transition: width 0.25s ease;
}

.fld-tank-fill-added {
  height: 100%;
  background: #0071e3;
  transition: width 0.25s ease;
}

.fld-tank-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}


/* ============================================================================
   29. UNIFIED MOBILE iOS 18 APPLE MAPS / FIND MY OVERHAUL (<= 900px)
   Desktop (> 900px) remains 100% untouched.
   ============================================================================ */
@media (max-width: 900px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-hide-text {
    display: none !important;
  }

  /* Dynamic viewport heights + safe-area scroll padding for bars */
  .app-shell,
  .main-workspace,
  .map-stage,
  #apple-map {
    height: 100dvh;
    min-height: 100dvh;
  }

  #sidebar,
  #vehicle-detail-dialog .sheet-container,
  .admin-content-area,
  .admin-panel-body,
  .vmp-shell {
    scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior-y: contain;
  }

  .admin-content-area,
  .admin-panel-body {
    scroll-padding-top: 112px;
  }

  h1,
  h2,
  h3,
  .vmp-card-title,
  .mobile-admin-topbar-title,
  .auth-main-title,
  .sheet-model-name {
    text-wrap: balance;
  }

  /* WCAG 2.5.5 touch targets on mobile interactive controls */
  .apple-admin-menu .rail-item[data-mobile-label],
  .mobile-admin-back-btn,
  .mobile-admin-add-btn,
  .mobile-admin-tab-pill,
  .sheet-close-btn,
  .auth-submit-btn-connect,
  .transport-btn,
  .apple-circle-btn,
  .floating-map-controls .map-btn,
  .floating-map-controls .layer-btn,
  .apple-button:not(.tiny) {
    min-height: 44px;
  }

  /* --------------------------------------------------------------------------
     1. FIXED MOBILE LOGIN SCREEN (#apple-auth-screen)
     -------------------------------------------------------------------------- */
  #apple-auth-screen.apple-auth-screen {
    min-height: 100dvh !important;
    height: auto !important;
    flex-direction: column !important;
    overflow-y: auto !important;
  }

  .auth-split-left {
    width: 100% !important;
    min-height: 100dvh !important;
    padding: calc(28px + env(safe-area-inset-top, 0px)) 20px calc(32px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .auth-form-container {
    width: 100% !important;
    max-width: 420px !important;
    padding: 28px 22px !important;
    border-radius: 26px !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14) !important;
  }

  body.dark-mode .auth-form-container {
    background: rgba(28, 28, 30, 0.92) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
  }

  .auth-brand-box {
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 18px !important;
  }

  .auth-brand-logo {
    height: 40px !important;
    width: auto !important;
  }

  .auth-heading-box {
    text-align: center !important;
    margin-bottom: 22px !important;
  }

  .auth-main-title {
    font-size: clamp(21px, 5.4vw, 26px) !important;
    line-height: 1.24 !important;
    margin-bottom: 8px !important;
  }

  .auth-main-subtitle {
    font-size: 13.5px !important;
    line-height: 1.5 !important;
  }

  .auth-input-box {
    min-height: 50px !important;
    border-radius: 14px !important;
  }

  .auth-text-input {
    font-size: 16px !important;
  }

  .auth-submit-btn-connect {
    width: 100% !important;
    min-height: 52px !important;
    border-radius: 15px !important;
    font-size: 16px !important;
  }

  /* --------------------------------------------------------------------------
     2. CLEAN 5-TAB iOS BOTTOM NAVIGATION BAR (.apple-admin-menu)
     -------------------------------------------------------------------------- */
  .apple-admin-menu {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-around !important;
    gap: 4px !important;
    z-index: 1300 !important;
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: saturate(180%) blur(24px) !important;
    -webkit-backdrop-filter: saturate(180%) blur(24px) !important;
    border-top: 1px solid rgba(15, 23, 42, 0.1) !important;
    box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.08) !important;
  }

  body.dark-mode .apple-admin-menu {
    background: rgba(22, 22, 24, 0.9) !important;
    border-top-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45) !important;
  }

  .apple-admin-menu .rail-item:not([data-mobile-label]) {
    display: none !important;
  }

  .apple-admin-menu .rail-item[data-mobile-label] {
    position: relative !important;
    flex: 1 1 0 !important;
    max-width: 80px !important;
    min-width: 0 !important;
    min-height: 50px !important;
    padding: 6px 4px !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    border-radius: 14px !important;
    color: var(--text-secondary) !important;
    background: transparent !important;
  }

  .apple-admin-menu .rail-item[data-mobile-label] svg,
  .apple-admin-menu .rail-item[data-mobile-label] i {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
  }

  .apple-admin-menu .rail-item[data-mobile-label]::after {
    content: attr(data-mobile-label);
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    white-space: nowrap;
  }

  .apple-admin-menu .rail-item .nav-item-label,
  .apple-admin-menu .rail-item .nav-item-active-bar {
    display: none !important;
  }

  .apple-admin-menu .rail-item[data-mobile-label] .nav-item-badge {
    position: absolute !important;
    top: 3px !important;
    right: calc(50% - 21px) !important;
    min-width: 16px !important;
    height: 16px !important;
    padding: 0 4px !important;
    font-size: 9.5px !important;
    font-weight: 700 !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .apple-admin-menu .rail-item[data-mobile-label].active {
    color: #007aff !important;
    background: rgba(0, 122, 255, 0.11) !important;
  }

  body.dark-mode .apple-admin-menu .rail-item[data-mobile-label].active {
    color: #0a84ff !important;
    background: rgba(10, 132, 255, 0.18) !important;
  }

  /* --------------------------------------------------------------------------
     3. DYNAMIC ISLAND TOP TOAST NOTIFICATIONS (.toast-container)
     -------------------------------------------------------------------------- */
  .toast-container {
    top: calc(env(safe-area-inset-top, 0px) + 64px) !important;
    bottom: auto !important;
    left: 14px !important;
    right: 14px !important;
    width: auto !important;
    max-width: 420px !important;
    margin: 0 auto !important;
    align-items: center !important;
    z-index: 12000 !important;
    pointer-events: none !important;
  }

  .apple-toast {
    max-width: 100% !important;
    border-radius: 999px !important;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22) !important;
    backdrop-filter: saturate(180%) blur(20px) !important;
  }

  /* --------------------------------------------------------------------------
     4. DECLUTTERED MAP CONTROLS & MUTUAL SHEET EXCLUSION
     -------------------------------------------------------------------------- */
  .floating-map-controls {
    top: calc(env(safe-area-inset-top, 0px) + 74px) !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 8px !important;
    z-index: 950 !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
  }

  .floating-map-controls #btn-zoom-in,
  .floating-map-controls #btn-zoom-out,
  .floating-map-controls .map-action-group .divider {
    display: none !important;
  }

  .floating-map-controls .segmented-layer-control {
    padding: 3px !important;
    gap: 2px !important;
    border-radius: 14px !important;
  }

  .floating-map-controls .segmented-layer-control .layer-btn {
    padding: 6px 10px !important;
    font-size: 11.5px !important;
    border-radius: 11px !important;
  }

  .floating-map-controls .map-action-group {
    padding: 4px !important;
    gap: 4px !important;
    border-radius: 16px !important;
  }

  .floating-map-controls .map-action-group .map-btn {
    min-width: 44px !important;
    min-height: 44px !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
  }

  body.vehicle-sheet-open .floating-map-controls,
  body.admin-drawer-open .floating-map-controls {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-6px) !important;
  }

  /* Hide fleet sidebar sheet while inspector sheet is open to prevent overlap */
  body.vehicle-sheet-open #sidebar {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(110%) !important;
  }

  /* --------------------------------------------------------------------------
     5. REFINED MOBILE FLEET SIDEBAR & VEHICLE INSPECTOR SHEET + STICKY ACTIONS
     -------------------------------------------------------------------------- */
  #sidebar {
    max-height: calc(100dvh - 84px) !important;
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1020 !important;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease !important;
  }

  .segmented-filter,
  #fleet-filter-bar,
  #facility-filter-bar,
  #customer-filter-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 6px !important;
    padding-bottom: 4px !important;
  }

  .segmented-filter::-webkit-scrollbar,
  #fleet-filter-bar::-webkit-scrollbar,
  #facility-filter-bar::-webkit-scrollbar,
  #customer-filter-bar::-webkit-scrollbar,
  .mobile-admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .segmented-filter .filter-tab {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    min-height: 38px !important;
    padding: 6px 12px !important;
  }

  dialog#vehicle-detail-dialog {
    width: 100dvw !important;
    max-width: 100dvw !important;
    margin: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(84dvh - 64px - env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 26px 26px 0 0 !important;
    z-index: 1120 !important;
  }

  dialog#vehicle-detail-dialog .sheet-container {
    display: flex !important;
    flex-direction: column !important;
    max-height: calc(84dvh - 64px - env(safe-area-inset-bottom, 0px)) !important;
    overflow-y: auto !important;
    padding-bottom: 0 !important;
    border-radius: 26px 26px 0 0 !important;
  }

  dialog#vehicle-detail-dialog .sheet-actions {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 15 !important;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: saturate(180%) blur(20px) !important;
    -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
    border-top: 1px solid rgba(120, 120, 128, 0.16) !important;
    padding: 12px 16px 14px !important;
    margin: 12px -16px 0 !important;
  }

  body.dark-mode dialog#vehicle-detail-dialog .sheet-actions {
    background: rgba(28, 28, 30, 0.94) !important;
    border-top-color: rgba(255, 255, 255, 0.12) !important;
  }

  dialog#vehicle-detail-dialog .sheet-actions-duo {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  dialog#vehicle-detail-dialog .sheet-actions-triplet {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  /* --------------------------------------------------------------------------
     6. MOBILE ADMIN TOPBAR, SCROLLABLE SUB-TABS & VMP SHELL RESPONSIVENESS
     -------------------------------------------------------------------------- */
  #admin-expanded-panel {
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 1200 !important;
  }

  .admin-content-area {
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .mobile-admin-topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 10px !important;
  }

  .mobile-admin-topbar-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .mobile-admin-topbar-title {
    flex: 1 !important;
    min-width: 0 !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .mobile-admin-right-actions {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }

  .mobile-admin-back-btn,
  .mobile-admin-add-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .mobile-admin-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    gap: 8px !important;
    padding-top: 8px !important;
  }

  .mobile-admin-tab-pill {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    min-height: 44px !important;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    border-radius: 999px !important;
  }

  /* Actual grid class names + VMP vehicle detail shell */
  .gateway-cards-grid,
  .fuel-kpi-grid,
  .rules-grid,
  .driver-metrics-grid,
  .report-kpi-grid,
  .vmp-kpi-matrix {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .vmp-hero-bento {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .vmp-topbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .vmp-topbar-left,
  .vmp-topbar-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .vmp-topbar-actions .apple-button {
    flex: 1 1 calc(50% - 4px) !important;
    justify-content: center !important;
  }

  .report-vehicle-hero,
  .report-hero-vehicle,
  .report-filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  #btn-hero-open-player {
    width: 100% !important;
    justify-content: center !important;
    margin-top: 12px !important;
  }

  #report-vehicle-pills {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 8px !important;
    padding-bottom: 4px !important;
  }

  #report-vehicle-pills > * {
    flex: 0 0 auto !important;
  }

  /* --------------------------------------------------------------------------
     7. INVERTED-ORDER MOBILE SPLIT-SCREEN ROUTE PLAYER (#modal-route-player)
     -------------------------------------------------------------------------- */
  dialog.apple-route-player-modal {
    width: 100dvw !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    inset: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }

  .player-window {
    height: 100dvh !important;
    border-radius: 0 !important;
  }

  .player-layout {
    display: flex !important;
    flex-direction: column !important;
    height: 100dvh !important;
    overflow: hidden !important;
  }

  .player-map-viewport {
    order: 1 !important;
    height: 35dvh !important;
    min-height: 220px !important;
    width: 100% !important;
    flex: 0 0 auto !important;
    border-radius: 0 !important;
  }

  .player-dashboard {
    order: 2 !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    border-right: none !important;
    border-top: 1px solid var(--panel-inner-border) !important;
    padding-bottom: 0 !important;
  }

  .player-controls-card {
    position: sticky !important;
    bottom: 0 !important;
    z-index: 20 !important;
    margin-top: auto !important;
    background: rgba(255, 255, 255, 0.94) !important;
    backdrop-filter: saturate(180%) blur(20px) !important;
    -webkit-backdrop-filter: saturate(180%) blur(20px) !important;
    border-top: 1px solid rgba(120, 120, 128, 0.16) !important;
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.dark-mode .player-controls-card {
    background: rgba(24, 24, 26, 0.94) !important;
    border-top-color: rgba(255, 255, 255, 0.12) !important;
  }

  .player-date-popover {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: calc(100dvw - 24px) !important;
  }
}

/* ============================================================================
   8. iOS BENTO STACKED CARD-TABLES & BOTTOM-SHEET MODALS (<= 768px)
   ============================================================================ */
@media (max-width: 768px) {
  .admin-table-card,
  .vmp-table-wrap {
    overflow-x: visible !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  #admin-expanded-panel table.apple-table {
    width: 100% !important;
    min-width: 0 !important;
    display: block !important;
    border-collapse: separate !important;
  }

  /* Visually hidden column headers while preserving clean card semantics */
  #admin-expanded-panel table.apple-table thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  #admin-expanded-panel table.apple-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  #admin-expanded-panel table.apple-table tbody tr {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px 12px !important;
    padding: 14px !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
  }

  body.dark-mode #admin-expanded-panel table.apple-table tbody tr {
    background: rgba(28, 28, 30, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32) !important;
  }

  #admin-expanded-panel table.apple-table tbody td {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    padding: 0 !important;
    border: none !important;
    min-width: 0 !important;
    text-align: left !important;
    white-space: normal !important;
  }

  #admin-expanded-panel table.apple-table tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    line-height: 1.2;
  }

  #admin-expanded-panel table.apple-table tbody td.mcard-header-cell {
    grid-column: 1 / -1 !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid rgba(120, 120, 128, 0.14) !important;
  }

  #admin-expanded-panel table.apple-table tbody td.mcard-full-cell {
    grid-column: 1 / -1 !important;
  }

  #admin-expanded-panel table.apple-table tbody td.mcard-actions-cell {
    grid-column: 1 / -1 !important;
    padding-top: 10px !important;
    border-top: 1px solid rgba(120, 120, 128, 0.14) !important;
  }

  #admin-expanded-panel table.apple-table tbody td.mcard-actions-cell > div {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  #admin-expanded-panel table.apple-table tbody td.mcard-actions-cell .apple-button {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }

  #admin-expanded-panel table.apple-table tbody td[colspan] {
    grid-column: 1 / -1 !important;
  }

  #admin-expanded-panel table.apple-table tbody td[colspan]::before {
    display: none !important;
  }

  /* Bottom-sheet presentation for Apple Modals */
  dialog.apple-modal-dialog {
    width: 100dvw !important;
    max-width: 100dvw !important;
    max-height: 90dvh !important;
    inset: auto 0 0 0 !important;
    margin: 0 !important;
    border-radius: 24px 24px 0 0 !important;
  }

  dialog.apple-modal-dialog .apple-modal-card {
    max-height: 90dvh !important;
    border-radius: 24px 24px 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  dialog.apple-modal-dialog .apple-modal-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    scroll-padding-bottom: 24px !important;
  }

  dialog.apple-modal-dialog .apple-modal-footer {
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  }

  dialog.apple-modal-dialog .apple-modal-footer .apple-button {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }

  /* Modal specific fixes: #modal-fuel-entry, #modal-driver-profile, #modal-share-location */
  #modal-fuel-entry .fuel-bento-inputs-grid {
    grid-template-columns: 1fr !important;
  }

  #modal-fuel-entry .fuel-hero-tank-widget {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }

  #modal-driver-profile .driver-profile-header {
    align-items: flex-start !important;
    gap: 12px !important;
  }

  #modal-driver-profile .driver-hero-identity {
    flex-wrap: wrap !important;
  }

  #modal-driver-profile .driver-assigned-vehicle-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }

  #modal-driver-profile .driver-veh-actions {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  #modal-share-location .share-link-box,
  #modal-share-location .form-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
}

@media (max-width: 560px) {
  .auth-form-container {
    padding: 24px 18px !important;
    border-radius: 22px !important;
  }

  .player-controls-card .controls-action-row {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .player-controls-card .speed-multiplier-group {
    width: 100% !important;
    justify-content: space-between !important;
  }
}

@media (max-width: 480px) {
  .gateway-cards-grid,
  .rules-grid {
    grid-template-columns: 1fr !important;
  }

  .floating-map-controls .map-action-group {
    flex-direction: column !important;
  }

  dialog#vehicle-detail-dialog .sheet-actions-triplet .apple-button {
    padding: 8px 6px !important;
    font-size: 12px !important;
  }
}

/* ============================================================================
   SPAIN LIVE DEVICE & CLOUD DATABASE HUB (#tab-gateway)
   ============================================================================ */
.spain-live-hub-card {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 113, 227, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.spain-live-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.spain-live-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.spain-live-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 113, 227, 0.12);
  color: #0071e3;
  flex-shrink: 0;
}

.spain-live-icon-wrap svg {
  width: 19px;
  height: 19px;
}

.spain-live-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.spain-live-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.ingest-url-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(118, 118, 128, 0.08);
  border: 1px solid var(--panel-inner-border);
}

.ingest-url-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.ingest-url-code {
  flex: 1;
  min-width: 210px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: #0071e3;
  word-break: break-all;
}

.spain-live-steps-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.spain-step-box {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid var(--panel-inner-border);
}

.spain-step-box h5 {
  margin: 8px 0 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.spain-step-box p {
  margin: 0;
  font-size: 12.2px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.spain-step-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(52, 199, 89, 0.14);
  color: #16a34a;
}

.spain-step-badge.blue {
  background: rgba(0, 113, 227, 0.12);
  color: #0071e3;
}

.spain-live-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

body.dark-mode .spain-live-hub-card {
  background: rgba(28, 28, 30, 0.92);
  border-color: rgba(10, 132, 255, 0.28);
}

body.dark-mode .ingest-url-bar {
  background: rgba(44, 44, 46, 0.72);
}

body.dark-mode .ingest-url-code {
  color: #409cff;
}

body.dark-mode .spain-step-box {
  background: rgba(36, 36, 38, 0.85);
}

@media (max-width: 720px) {
  .spain-live-steps-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   SIDEBAR LIVE/DEMO SWITCH BAR, ORIGIN BADGES & VEHICLE ONBOARDING WIZARD
   ============================================================================ */
.sidebar-live-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  margin-top: 8px;
  border-radius: 11px;
  background: rgba(118, 118, 128, 0.08);
  border: 1px solid var(--panel-inner-border);
  font-size: 11.5px;
}

.sidebar-live-mode-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-secondary);
}

.sidebar-live-mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff9500;
  flex-shrink: 0;
}

.sidebar-live-mode-dot.live {
  background: #34c759;
  box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.2);
}

.sidebar-live-mode-btn {
  border: none;
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(0, 113, 227, 0.12);
  color: #0071e3;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.sidebar-live-mode-btn:hover {
  background: rgba(0, 113, 227, 0.2);
}

.sidebar-live-mode-btn.danger {
  background: rgba(255, 59, 48, 0.12);
  color: #ff3b30;
}

.sidebar-live-mode-btn.danger:hover {
  background: rgba(255, 59, 48, 0.2);
}

.veh-origin-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.veh-origin-pill.live {
  background: rgba(52, 199, 89, 0.15);
  color: #16a34a;
}

.veh-origin-pill.waiting {
  background: rgba(0, 113, 227, 0.14);
  color: #0071e3;
}

.veh-origin-pill.demo {
  background: rgba(255, 149, 0, 0.14);
  color: #c26a00;
}

.veh-setup-guide-box {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 4px 0 12px;
  background: rgba(0, 113, 227, 0.06);
  border: 1px solid rgba(0, 113, 227, 0.18);
}

.veh-setup-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.veh-setup-steps {
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: 11.8px;
  line-height: 1.48;
  color: var(--text-secondary);
}

.veh-setup-steps li + li {
  margin-top: 3px;
}

.veh-inline-copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--panel-inner-border);
}

.veh-inline-copy-row code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #0071e3;
  word-break: break-all;
}

.empty-fleet-onboarding {
  margin: 10px 4px;
  padding: 20px 16px;
  border-radius: 16px;
  text-align: center;
  background: rgba(0, 113, 227, 0.06);
  border: 1px dashed rgba(0, 113, 227, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-fleet-onboarding h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-fleet-onboarding p {
  margin: 0;
  font-size: 12.2px;
  line-height: 1.45;
  color: var(--text-secondary);
}

body.dark-mode .sidebar-live-mode-bar,
body.dark-mode .veh-inline-copy-row {
  background: rgba(44, 44, 46, 0.78);
}

body.dark-mode .veh-setup-guide-box,
body.dark-mode .empty-fleet-onboarding {
  background: rgba(10, 132, 255, 0.12);
  border-color: rgba(10, 132, 255, 0.28);
}

body.dark-mode .veh-inline-copy-row code {
  color: #409cff;
}

body.dark-mode .veh-origin-pill.demo {
  color: #ffb340;
}

body.dark-mode .veh-origin-pill.waiting {
  color: #409cff;
}

body.dark-mode .veh-origin-pill.live {
  color: #30d158;
}

/* ============================================================================
   VEHICLE DETAIL SHEET: ANTI-JITTER LOCK & ONE-SCREEN DESKTOP FIT
   ============================================================================ */
#vehicle-detail-dialog #detail-address {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1.3 !important;
}

#vehicle-detail-dialog .sheet-coords-voltage-row {
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  gap: 6px !important;
}

#vehicle-detail-dialog #detail-coords,
#vehicle-detail-dialog #detail-voltage {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 10.5px !important;
}

@media (min-width: 901px) {
  dialog.apple-sheet,
  dialog#vehicle-detail-dialog {
    max-height: calc(100dvh - 242px) !important;
  }

  dialog.apple-sheet .sheet-container,
  dialog#vehicle-detail-dialog .sheet-container {
    max-height: calc(100dvh - 244px) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

  dialog#vehicle-detail-dialog .sheet-header,
  dialog#vehicle-detail-dialog #vehicle-sheet-tabs,
  dialog#vehicle-detail-dialog .sheet-actions {
    flex-shrink: 0 !important;
  }

  dialog#vehicle-detail-dialog .sheet-tab-pane.active {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
  }

  dialog#vehicle-detail-dialog .sheet-tab-pane.active::-webkit-scrollbar {
    display: none !important;
  }

  dialog#vehicle-detail-dialog #sheet-pane-overview .vehicle-studio-card {
    height: 126px !important;
    min-height: 126px !important;
    padding: 8px 16px !important;
  }

  dialog#vehicle-detail-dialog #sheet-pane-overview .studio-stage {
    height: 112px !important;
  }

  dialog#vehicle-detail-dialog #sheet-pane-overview .studio-van-model {
    max-height: 108px !important;
    max-width: 230px !important;
  }
}

/* ============================================================================
   APPLE BENTO ADD ENTITY & LIVE GPS PAIRING STUDIO (<dialog id="modal-add-entity">)
   ============================================================================ */
.visually-hidden {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}

.modal-icon-circle.green {
  background: rgba(52, 199, 89, 0.14);
  color: #248a3d;
}

body.dark-mode .modal-icon-circle.green {
  background: rgba(48, 209, 88, 0.2);
  color: #30d158;
}

dialog#modal-add-entity .apple-modal-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

dialog#modal-add-entity .apple-modal-header,
dialog#modal-add-entity .apple-modal-footer {
  flex-shrink: 0;
}

dialog#modal-add-entity .apple-modal-header {
  padding: 16px 22px;
}

dialog#modal-add-entity .apple-modal-body {
  flex: 1 1 auto;
  min-block-size: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 18px 22px 20px;
  gap: 14px;
}

dialog#modal-add-entity .apple-modal-footer {
  padding-top: 14px;
  margin-top: 2px;
}

dialog#modal-add-entity .entity-fields-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

dialog#modal-add-entity .form-row {
  gap: 12px;
  align-items: flex-end;
}

dialog#modal-add-entity .form-group {
  min-inline-size: 0;
  gap: 5px;
}

dialog#modal-add-entity .form-group label {
  margin-bottom: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

dialog#modal-add-entity .apple-input,
dialog#modal-add-entity .apple-select {
  height: 42px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: rgba(0, 0, 0, 0.032);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

dialog#modal-add-entity .apple-select {
  cursor: pointer;
}

dialog#modal-add-entity .apple-input:hover,
dialog#modal-add-entity .apple-select:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.24);
}

dialog#modal-add-entity .apple-input:focus,
dialog#modal-add-entity .apple-select:focus {
  background: #ffffff;
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.16);
}

dialog#modal-add-entity .apple-input[aria-invalid="true"],
dialog#modal-add-entity .apple-select[aria-invalid="true"] {
  border-color: #ff3b30;
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.16);
}

body.dark-mode dialog#modal-add-entity .apple-input,
body.dark-mode dialog#modal-add-entity .apple-select {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

body.dark-mode dialog#modal-add-entity .apple-input:hover,
body.dark-mode dialog#modal-add-entity .apple-select:hover {
  background: rgba(255, 255, 255, 0.095);
  border-color: rgba(255, 255, 255, 0.28);
}

body.dark-mode dialog#modal-add-entity .apple-input:focus,
body.dark-mode dialog#modal-add-entity .apple-select:focus {
  background: #1c1c1e;
  border-color: #38a5ff;
  box-shadow: 0 0 0 3px rgba(56, 165, 255, 0.24);
}

/* Block A: Live Vehicle & Color Preview Bar */
.veh-studio-preview-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 15px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.055) 0%, rgba(52, 199, 89, 0.075) 100%);
  border: 1px solid rgba(0, 113, 227, 0.14);
}

body.dark-mode .veh-studio-preview-bar {
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.14) 0%, rgba(48, 209, 88, 0.12) 100%);
  border-color: rgba(255, 255, 255, 0.12);
}

.veh-preview-van-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
}

#veh-preview-img {
  display: block;
  width: 112px;
  height: auto;
  aspect-ratio: 116 / 72;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.16));
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.veh-preview-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-inline-size: 0;
}

.veh-live-plate-badge {
  display: inline-flex;
  align-items: stretch;
  border-radius: 7px;
  overflow: clip;
  background: #ffffff;
  border: 1.5px solid rgba(15, 23, 42, 0.22);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: #111827;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.veh-plate-eu {
  background: #003399;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#veh-preview-plate {
  padding: 3px 9px;
  white-space: nowrap;
}

.veh-preview-meta {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.veh-color-swatch-group {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.veh-color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: var(--dot-color);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  padding: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.veh-color-dot.is-light {
  border-color: rgba(15, 23, 42, 0.28);
}

.veh-color-dot:hover {
  transform: scale(1.1);
}

.veh-color-dot.active {
  transform: scale(1.14);
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--apple-blue);
}

body.dark-mode .veh-color-dot.active {
  box-shadow: 0 0 0 2px #202022, 0 0 0 4px #38a5ff;
}

.veh-color-dot:focus-visible {
  outline: 2px solid var(--apple-blue);
  outline-offset: 2px;
}

/* Block B: Native Accessible Hardware / Phone Source Cards */
.veh-source-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.veh-source-option {
  min-inline-size: 0;
}

.veh-source-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.02);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
  user-select: none;
}

.veh-source-card:hover {
  border-color: rgba(0, 113, 227, 0.32);
  background: rgba(0, 113, 227, 0.03);
}

.veh-source-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.055);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.veh-source-icon svg {
  width: 17px;
  height: 17px;
}

.veh-source-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-inline-size: 0;
  flex: 1 1 auto;
}

.veh-source-copy strong {
  font-size: 12.8px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.veh-source-copy small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.veh-source-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--apple-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.veh-source-check svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.8;
}

.veh-source-option input:checked + .veh-source-card {
  border-color: var(--apple-blue);
  background: rgba(0, 113, 227, 0.065);
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.11);
}

.veh-source-option input:checked + .veh-source-card .veh-source-icon {
  background: rgba(0, 113, 227, 0.14);
  color: var(--apple-blue);
}

.veh-source-option input:checked + .veh-source-card .veh-source-check {
  opacity: 1;
  transform: scale(1);
}

.veh-source-option input:focus-visible + .veh-source-card {
  outline: 2px solid var(--apple-blue);
  outline-offset: 2px;
}

body.dark-mode .veh-source-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

body.dark-mode .veh-source-icon {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .veh-source-option input:checked + .veh-source-card {
  border-color: #38a5ff;
  background: rgba(10, 132, 255, 0.16);
}

body.dark-mode .veh-source-option input:checked + .veh-source-card .veh-source-icon {
  background: rgba(56, 165, 255, 0.22);
  color: #409cff;
}

/* Block C: IMEI Input + Copy Pill Row */
.veh-imei-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.veh-imei-input-row #veh-imei-input {
  flex: 1 1 auto;
  min-inline-size: 0;
}

.veh-copy-inline-btn {
  height: 42px;
  padding: 0 14px;
  border-radius: 11px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Block D: Compact Server URL Dock + Collapsible Setup Accordion */
.veh-server-dock {
  border-radius: 13px;
  background: rgba(0, 113, 227, 0.045);
  border: 1px solid rgba(0, 113, 227, 0.16);
  overflow: clip;
}

body.dark-mode .veh-server-dock {
  background: rgba(10, 132, 255, 0.11);
  border-color: rgba(10, 132, 255, 0.28);
}

.veh-server-url-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
}

.veh-dock-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #0071e3;
  background: rgba(0, 113, 227, 0.12);
  padding: 3px 7px;
  border-radius: 6px;
  flex-shrink: 0;
}

body.dark-mode .veh-dock-tag {
  color: #66b3ff;
  background: rgba(56, 165, 255, 0.2);
}

#modal-ingest-url-shared {
  flex: 1 1 auto;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #0071e3;
}

body.dark-mode #modal-ingest-url-shared {
  color: #409cff;
}

.veh-setup-details {
  border-top: 1px solid rgba(0, 113, 227, 0.12);
}

.veh-setup-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  font-size: 11.8px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.veh-setup-summary::-webkit-details-marker {
  display: none;
}

.veh-setup-summary:hover {
  background: rgba(0, 113, 227, 0.05);
  color: var(--text-primary);
}

.veh-summary-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-inline-size: 0;
}

.veh-summary-left svg,
.veh-details-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.veh-details-chevron {
  transition: transform 0.2s ease;
}

.veh-setup-details[open] .veh-details-chevron {
  transform: rotate(180deg);
}

.veh-setup-details-body {
  padding: 2px 12px 11px;
}

.veh-setup-details-body .veh-setup-steps {
  margin: 0;
  padding-left: 18px;
  font-size: 11.5px;
  line-height: 1.48;
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .veh-studio-preview-bar {
    flex-wrap: wrap;
    gap: 10px 12px;
  }

  .veh-color-swatch-group {
    width: 100%;
    margin-inline-start: 0;
    justify-content: flex-start;
  }

  .veh-server-url-bar {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .veh-source-fieldset {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   APPLE BENTO EMPTY STATES (Container-Aware Card System Across App)
   ============================================================================ */
.sidebar-content,
#admin-drivers-grid,
#admin-fuel-bento-grid,
.admin-empty-host {
  container: empty-host / inline-size;
  width: 100%;
}

.apple-empty-card,
.empty-state {
  margin: 8px 2px;
  padding: 26px 20px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 9px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 250, 252, 0.94) 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  box-sizing: border-box;
  width: calc(100% - 4px);
}

.empty-card-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(0, 113, 227, 0.11);
  color: #0071e3;
  border: 1px solid rgba(0, 113, 227, 0.2);
}

.apple-empty-card.amber .empty-card-badge {
  background: rgba(255, 149, 0, 0.13);
  color: #c96a00;
  border-color: rgba(255, 149, 0, 0.22);
}

.apple-empty-card.blue .empty-card-badge {
  background: rgba(0, 113, 227, 0.11);
  color: #0071e3;
  border-color: rgba(0, 113, 227, 0.2);
}

.apple-empty-card.green .empty-card-badge {
  background: rgba(52, 199, 89, 0.13);
  color: #248a3d;
  border-color: rgba(52, 199, 89, 0.22);
}

.apple-empty-card.subtle .empty-card-badge {
  background: rgba(118, 118, 128, 0.11);
  color: var(--text-secondary);
  border-color: rgba(118, 118, 128, 0.16);
}

.empty-card-badge svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.9;
}

.apple-empty-card > h3,
.empty-state > h3 {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  line-height: 1.25;
}

.apple-empty-card > p,
.empty-state > p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  max-inline-size: 32ch;
}

.apple-empty-card > footer {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  flex-wrap: balance;
  justify-content: center;
  gap: 8px;
}

.apple-empty-card.compact {
  margin: 4px 0;
  padding: 16px 14px;
  border-radius: 14px;
  gap: 6px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.apple-empty-card.compact .empty-card-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.apple-empty-card.compact .empty-card-badge svg {
  width: 18px;
  height: 18px;
}

.apple-empty-card.compact > h3 {
  font-size: 13.5px;
}

.apple-empty-card.compact > p {
  font-size: 11.8px;
  line-height: 1.45;
  max-inline-size: 36ch;
}

.apple-empty-card.compact > footer {
  margin-top: 4px;
}

/* Adapt into horizontal Bento banner in wide Admin / report hosts */
@container empty-host (inline-size > 520px) {
  .apple-empty-card:not(.compact) {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 16px;
    row-gap: 3px;
    text-align: start;
    align-items: center;
    padding: 20px 24px;
    margin: 4px 0;
    width: 100%;
  }

  .apple-empty-card:not(.compact) > .empty-card-badge {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .apple-empty-card:not(.compact) > h3 {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    align-self: end;
  }

  .apple-empty-card:not(.compact) > p {
    grid-column: 2;
    grid-row: 2;
    max-inline-size: 60ch;
    align-self: start;
  }

  .apple-empty-card:not(.compact):not(:has(> footer)) > h3,
  .apple-empty-card:not(.compact):not(:has(> footer)) > p {
    grid-column: 2 / -1;
  }

  .apple-empty-card:not(.compact) > footer {
    grid-column: 3;
    grid-row: 1 / span 2;
    margin-top: 0;
    justify-content: flex-end;
  }
}

body.dark-mode .apple-empty-card,
body.dark-mode .empty-state {
  background: linear-gradient(180deg, rgba(44, 44, 46, 0.72) 0%, rgba(36, 36, 38, 0.86) 100%);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

body.dark-mode .apple-empty-card.amber .empty-card-badge {
  background: rgba(255, 159, 10, 0.18);
  color: #ffb340;
  border-color: rgba(255, 159, 10, 0.3);
}

body.dark-mode .apple-empty-card.blue .empty-card-badge {
  background: rgba(10, 132, 255, 0.18);
  color: #409cff;
  border-color: rgba(10, 132, 255, 0.3);
}

body.dark-mode .apple-empty-card.green .empty-card-badge {
  background: rgba(48, 209, 88, 0.18);
  color: #30d158;
  border-color: rgba(48, 209, 88, 0.3);
}

body.dark-mode .apple-empty-card.subtle .empty-card-badge {
  background: rgba(142, 142, 147, 0.18);
  color: #aeaeb2;
  border-color: rgba(142, 142, 147, 0.24);
}

/* Mobile table cleanup so admin empty cards don't double-border inside tr */
@media (max-width: 900px) {
  #admin-expanded-panel table.apple-table tbody tr:has(.admin-empty-host) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    grid-template-columns: 1fr !important;
  }

  #admin-expanded-panel table.apple-table tbody td.admin-empty-host {
    padding: 4px 0 !important;
    width: 100% !important;
  }
}

/* ============================================================================
   COMPREHENSIVE MOBILE UI & APPLE MAPS VIEWPORT OVERHAUL (<= 900px)
   ============================================================================ */
@media (max-width: 900px) {
  /* 1. Full-bleed stable map canvas (prevents collapse under auth-authenticated flex) */
  html.auth-authenticated body > #app.app-layout,
  #app.app-layout {
    display: block !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  .main-map-stage {
    position: relative !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .map-box-frame {
    position: relative !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
  }

  #map,
  #map.map-viewport,
  .map-viewport {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    display: block !important;
    border-radius: 0 !important;
  }

  /* 2. Prominent Apple Liquid Glass top bar: fold layer & traffic into .mobile-map-top-bar */
  .floating-map-controls {
    display: none !important;
  }

  .mobile-map-top-bar {
    top: calc(12px + env(safe-area-inset-top, 0px)) !important;
    left: 12px !important;
    right: 12px !important;
    height: 60px !important;
    min-height: 60px !important;
    padding: 0 10px 0 16px !important;
    border-radius: 999px !important;
    gap: 10px !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.72) 0%, rgba(245, 248, 255, 0.58) 100%) !important;
    backdrop-filter: blur(30px) saturate(210%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(210%) !important;
    border: 1px solid rgba(255, 255, 255, 0.84) !important;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06), inset 0 1.5px 1px rgba(255, 255, 255, 0.95), inset 0 -1px 1px rgba(15, 23, 42, 0.05) !important;
  }

  body.dark-mode .mobile-map-top-bar {
    background: linear-gradient(135deg, rgba(40, 40, 46, 0.74) 0%, rgba(22, 22, 26, 0.64) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.58), inset 0 1px 1px rgba(255, 255, 255, 0.25), inset 0 -1px 1px rgba(0, 0, 0, 0.35) !important;
  }

  .mobile-top-brand {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  .mobile-top-logo {
    height: 31px !important;
    width: auto !important;
    max-width: 130px !important;
    margin: 0 auto !important;
  }

  .mobile-live-pill {
    display: none !important;
  }

  body.dark-mode .mobile-live-pill {
    background: rgba(48, 209, 88, 0.22) !important;
    border-color: rgba(48, 209, 88, 0.34) !important;
  }

  .mobile-top-actions {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    flex-shrink: 0 !important;
  }

  .mobile-top-icon-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    background: rgba(255, 255, 255, 0.66) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  }

  body.dark-mode .mobile-top-icon-btn {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
  }

  .mobile-top-icon-btn.active,
  body.dark-mode .mobile-top-icon-btn.active {
    background: #007aff !important;
    color: #ffffff !important;
    border-color: rgba(0, 122, 255, 0.65) !important;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35) !important;
  }

  .mobile-top-icon-btn.danger,
  body.dark-mode .mobile-top-icon-btn.danger {
    color: #ff3b30 !important;
    background: rgba(255, 59, 48, 0.12) !important;
    border-color: rgba(255, 59, 48, 0.2) !important;
  }

  .mobile-top-icon-btn i,
  .mobile-top-icon-btn svg {
    width: 18.5px !important;
    height: 18.5px !important;
  }

  .live-traffic-hud {
    top: calc(78px + env(safe-area-inset-top, 0px)) !important;
    left: 10px !important;
    right: 10px !important;
  }

  /* 3. Bottom sheet header circle buttons, collapsible filters, single active filter grid & translucent sheet */
  .sidebar-header {
    padding: 4px 16px 8px !important;
    gap: 8px !important;
    align-items: stretch !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .sidebar-headline {
    width: 100% !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
  }

  .sidebar-headline > div:first-child {
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .sidebar-mode-switcher {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .sidebar-header-actions {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .apple-circle-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
  }

  #btn-mobile-search-toggle.mobile-only {
    display: inline-flex !important;
  }

  #btn-mobile-search-toggle.active {
    background: #007aff !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 3px 10px rgba(0, 122, 255, 0.28) !important;
  }

  #btn-collapse-sidebar {
    display: inline-flex !important;
  }

  #sidebar:not(.sheet-peek) #btn-collapse-sidebar svg {
    transform: rotate(-90deg);
    transition: transform 0.22s ease;
  }

  #sidebar.sheet-peek #btn-collapse-sidebar svg {
    transform: rotate(90deg);
    transition: transform 0.22s ease;
  }

  .sidebar-mode-switcher {
    padding: 3px !important;
    gap: 3px !important;
    margin-bottom: 6px !important;
  }

  .sidebar-mode-switcher .mode-tab-btn {
    min-width: 0 !important;
    padding: 6px 4px !important;
    font-size: 11.5px !important;
    gap: 4px !important;
  }

  /* Hide search + filter bars by default in half/peek so map gets ~60% viewport */
  #sidebar.apple-sidebar:not(.mobile-filters-open):not(.sheet-full):not(.expanded) .apple-search-box,
  #sidebar.apple-sidebar:not(.mobile-filters-open):not(.sheet-full):not(.expanded) #fleet-filter-bar,
  #sidebar.apple-sidebar:not(.mobile-filters-open):not(.sheet-full):not(.expanded) #facility-filter-bar,
  #sidebar.apple-sidebar:not(.mobile-filters-open):not(.sheet-full):not(.expanded) #customer-filter-bar {
    display: none !important;
  }

  /* Fix double filter bar bug: never override inline display: none when hidden */
  #fleet-filter-bar[style*="display: none"],
  #fleet-filter-bar[style*="display:none"],
  #facility-filter-bar[style*="display: none"],
  #facility-filter-bar[style*="display:none"],
  #customer-filter-bar[style*="display: none"],
  #customer-filter-bar[style*="display:none"],
  #modal-type-tabs[style*="display: none"],
  #modal-type-tabs[style*="display:none"] {
    display: none !important;
  }

  #sidebar.mobile-filters-open .apple-search-box,
  #sidebar.sheet-full .apple-search-box,
  #sidebar.expanded .apple-search-box {
    display: flex !important;
    margin-bottom: 6px !important;
  }

  #sidebar.mobile-filters-open #fleet-filter-bar:not([style*="display: none"]):not([style*="display:none"]),
  #sidebar.mobile-filters-open #facility-filter-bar:not([style*="display: none"]):not([style*="display:none"]),
  #sidebar.sheet-full #fleet-filter-bar:not([style*="display: none"]):not([style*="display:none"]),
  #sidebar.sheet-full #facility-filter-bar:not([style*="display: none"]):not([style*="display:none"]),
  #sidebar.expanded #fleet-filter-bar:not([style*="display: none"]):not([style*="display:none"]),
  #sidebar.expanded #facility-filter-bar:not([style*="display: none"]):not([style*="display:none"]) {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 4px !important;
    padding: 3px !important;
    margin-bottom: 6px !important;
    overflow: visible !important;
  }

  #sidebar.mobile-filters-open #customer-filter-bar:not([style*="display: none"]):not([style*="display:none"]),
  #sidebar.sheet-full #customer-filter-bar:not([style*="display: none"]):not([style*="display:none"]),
  #sidebar.expanded #customer-filter-bar:not([style*="display: none"]):not([style*="display:none"]) {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-auto-columns: minmax(0, 1fr) !important;
    gap: 4px !important;
    padding: 3px !important;
    margin-bottom: 6px !important;
    overflow: visible !important;
  }

  #modal-type-tabs:not([style*="display: none"]):not([style*="display:none"]) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    padding: 3px !important;
    overflow: visible !important;
  }

  #fleet-filter-bar .filter-tab,
  #facility-filter-bar .filter-tab,
  #customer-filter-bar .filter-tab,
  #modal-type-tabs .filter-tab {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 32px !important;
    padding: 4px 3px !important;
    font-size: 11px !important;
    justify-content: center !important;
  }

  #sidebar-live-mode-bar.is-pure-live {
    display: none !important;
  }

  #sidebar.apple-sidebar {
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 78dvh !important;
    max-height: 78dvh !important;
    padding-bottom: 0 !important;
    border-radius: 26px 26px 0 0 !important;
    overflow: hidden !important;
    border: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.85) !important;
    background: rgba(250, 251, 255, 0.88) !important;
    backdrop-filter: blur(30px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(200%) !important;
    box-shadow: 0 -10px 36px rgba(15, 23, 42, 0.14) !important;
    transform: translateY(42%) !important;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.2s ease !important;
  }

  body.dark-mode #sidebar.apple-sidebar {
    background: rgba(24, 24, 28, 0.88) !important;
    border-top-color: rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 -12px 44px rgba(0, 0, 0, 0.65) !important;
  }

  #sidebar.apple-sidebar.sheet-half {
    height: 78dvh !important;
    max-height: 78dvh !important;
    transform: translateY(42%) !important;
  }

  #sidebar.apple-sidebar.sheet-peek {
    height: 78dvh !important;
    max-height: 78dvh !important;
    transform: translateY(calc(100% - 156px - env(safe-area-inset-bottom, 0px))) !important;
  }

  #sidebar.apple-sidebar.sheet-peek .sidebar-header {
    border-bottom: none !important;
  }

  #sidebar.apple-sidebar.sheet-peek .sidebar-mode-switcher,
  #sidebar.apple-sidebar.sheet-peek .apple-search-box,
  #sidebar.apple-sidebar.sheet-peek #fleet-filter-bar,
  #sidebar.apple-sidebar.sheet-peek #facility-filter-bar,
  #sidebar.apple-sidebar.sheet-peek #customer-filter-bar,
  #sidebar.apple-sidebar.sheet-peek .sidebar-content {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  #sidebar.apple-sidebar.sheet-full,
  #sidebar.apple-sidebar.expanded {
    height: 78dvh !important;
    max-height: 78dvh !important;
    transform: translateY(0%) !important;
  }

  #sidebar.apple-sidebar .sidebar-content {
    padding: 4px 14px calc(92px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #sidebar.apple-sidebar.sheet-half .sidebar-content {
    padding-bottom: calc(34dvh + 92px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #sidebar.apple-sidebar .vehicle-card {
    padding: 10px 12px !important;
    gap: 6px !important;
    border-radius: 16px !important;
  }

  #sidebar.apple-sidebar .card-van-column {
    width: 54px !important;
    height: 50px !important;
  }

  #sidebar.apple-sidebar .card-plate-badge {
    font-size: 11.5px !important;
    padding: 2px 7px !important;
  }

  #sidebar.apple-sidebar .card-vehicle-title {
    font-size: 13.5px !important;
  }

  #sidebar.apple-sidebar .card-footer-stats {
    padding-top: 6px !important;
    font-size: 11px !important;
  }

  /* 4. Bottom tab bar: WhatsApp / iOS Liquid Glass floating frosted mirror capsule */
  .apple-admin-menu {
    left: 12px !important;
    right: 12px !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    height: 66px !important;
    min-height: 66px !important;
    padding: 5px 6px !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.68) 0%, rgba(240, 244, 252, 0.56) 100%) !important;
    backdrop-filter: blur(32px) saturate(220%) !important;
    -webkit-backdrop-filter: blur(32px) saturate(220%) !important;
    border: 1px solid rgba(255, 255, 255, 0.86) !important;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08), inset 0 1.5px 1px rgba(255, 255, 255, 0.96), inset 0 -1px 1px rgba(15, 23, 42, 0.06) !important;
  }

  body.dark-mode .apple-admin-menu {
    background: linear-gradient(180deg, rgba(42, 42, 48, 0.72) 0%, rgba(20, 20, 24, 0.64) 100%) !important;
    backdrop-filter: blur(34px) saturate(220%) !important;
    -webkit-backdrop-filter: blur(34px) saturate(220%) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 4px 14px rgba(0, 0, 0, 0.42), inset 0 1px 1px rgba(255, 255, 255, 0.28), inset 0 -1px 1px rgba(0, 0, 0, 0.45) !important;
  }

  .apple-admin-menu .admin-menu-scroll {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .apple-admin-menu .rail-item[data-mobile-label] {
    flex: 1 1 0 !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 54px !important;
    min-height: 54px !important;
    padding: 5px 4px !important;
    border-radius: 999px !important;
    gap: 3px !important;
    color: rgba(28, 28, 30, 0.76) !important;
    background: transparent !important;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease !important;
  }

  body.dark-mode .apple-admin-menu .rail-item[data-mobile-label] {
    color: rgba(235, 235, 245, 0.76) !important;
  }

  .apple-admin-menu .rail-item[data-mobile-label] svg,
  .apple-admin-menu .rail-item[data-mobile-label] i,
  .apple-admin-menu .rail-item[data-mobile-label]:hover svg,
  .apple-admin-menu .rail-item[data-mobile-label]:hover i,
  .apple-admin-menu .rail-item[data-mobile-label].active svg,
  .apple-admin-menu .rail-item[data-mobile-label].active i {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    color: currentColor !important;
    stroke: currentColor !important;
  }

  .apple-admin-menu .rail-item[data-mobile-label].active {
    background: rgba(0, 122, 255, 0.15) !important;
    color: #007aff !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(0, 122, 255, 0.14) !important;
  }

  body.dark-mode .apple-admin-menu .rail-item[data-mobile-label].active {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 2px 10px rgba(0, 0, 0, 0.32) !important;
  }

  .apple-admin-menu .rail-item .nav-item-badge,
  .apple-admin-menu .rail-item[data-mobile-label] .nav-item-badge {
    display: none !important;
  }

  /* 5. Mobile vehicle detail inspector: hide floating tab bar, full-bottom compact 56dvh sheet */
  body.vehicle-sheet-open .apple-admin-menu {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(120%) !important;
    transition: opacity 0.2s ease, transform 0.25s ease !important;
  }

  dialog#vehicle-detail-dialog {
    bottom: 0 !important;
    max-height: 56dvh !important;
    border-radius: 24px 24px 0 0 !important;
    overflow: hidden !important;
  }

  dialog#vehicle-detail-dialog .sheet-container {
    max-height: 56dvh !important;
    height: auto !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 4px 14px calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    gap: 6px !important;
    border-radius: 24px 24px 0 0 !important;
  }

  dialog#vehicle-detail-dialog .sheet-header-right-btns {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  dialog#vehicle-detail-dialog .sheet-close-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    aspect-ratio: 1 / 1 !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  dialog#vehicle-detail-dialog .sheet-mobile-grabber,
  dialog#vehicle-detail-dialog .sheet-header,
  dialog#vehicle-detail-dialog #vehicle-sheet-tabs,
  dialog#vehicle-detail-dialog .sheet-actions {
    flex-shrink: 0 !important;
  }

  dialog#vehicle-detail-dialog .sheet-tab-pane.active {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    -webkit-overflow-scrolling: touch !important;
  }

  dialog#vehicle-detail-dialog .vehicle-studio-card {
    display: none !important;
  }

  dialog#vehicle-detail-dialog .telemetry-grid {
    gap: 7px !important;
  }

  dialog#vehicle-detail-dialog .telemetry-card {
    padding: 9px 11px !important;
  }

  dialog#vehicle-detail-dialog .sheet-actions {
    position: static !important;
    margin: 4px 0 0 !important;
    padding: 8px 0 0 !important;
  }

  /* 6. Modal Form Stack: fix right-aligned half-width inputs inside modal sheets */
  dialog.apple-modal-dialog .form-row,
  dialog#modal-add-entity .form-row,
  dialog#modal-add-entity .veh-driver-city-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 10px !important;
  }

  dialog.apple-modal-dialog .form-group,
  dialog#modal-add-entity .form-group {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 auto !important;
  }

  dialog.apple-modal-dialog .apple-input,
  dialog.apple-modal-dialog .apple-select,
  dialog#modal-add-entity .apple-input,
  dialog#modal-add-entity .apple-select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 7. Admin Panel Drawer & Mobile Admin Topbar behind floating bottom glass capsule */
  #admin-expanded-panel {
    top: 0 !important;
    bottom: 0 !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  .admin-content-scroll {
    padding: 18px 16px calc(104px + env(safe-area-inset-bottom, 0px)) 16px !important;
    overflow-x: hidden !important;
  }

  .mobile-admin-topbar-row {
    display: grid !important;
    grid-template-columns: minmax(70px, 1fr) auto minmax(70px, 1fr) !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .mobile-admin-back-btn {
    justify-self: start !important;
    min-height: 36px !important;
    height: 36px !important;
    min-width: 0 !important;
    padding: 0 12px 0 8px !important;
    border-radius: 999px !important;
  }

  .mobile-admin-topbar-title {
    grid-column: 2 !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .mobile-admin-right-actions {
    justify-self: end !important;
  }

  .mobile-admin-add-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border-radius: 50% !important;
  }

  #btn-mobile-admin-theme {
    background: rgba(118, 118, 128, 0.14) !important;
    color: var(--text-primary) !important;
  }

  body.dark-mode #btn-mobile-admin-theme {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #ffffff !important;
  }

  .mobile-admin-tabs-scroll {
    margin: 0 !important;
    padding: 2px 0 0 !important;
  }

  #btn-mobile-open-add-modal {
    display: none !important;
  }

  .mobile-admin-tab-pill[data-mobile-admin-tab="reports"],
  .mobile-admin-tab-pill[data-mobile-admin-tab="fuel"],
  .mobile-admin-tab-pill[data-mobile-admin-tab="drivers"] {
    display: none !important;
  }

  .mobile-admin-topbar:not(.is-management-tab) .mobile-admin-tabs-scroll {
    display: none !important;
  }

  .mobile-admin-topbar.is-management-tab .mobile-admin-tabs-scroll {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 3px !important;
    margin: 0 !important;
    padding: 3px !important;
    border-radius: 11px !important;
    background: rgba(118, 118, 128, 0.12) !important;
    overflow: visible !important;
  }

  body.dark-mode .mobile-admin-topbar.is-management-tab .mobile-admin-tabs-scroll {
    background: rgba(255, 255, 255, 0.08) !important;
  }

  .mobile-admin-tab-pill {
    min-height: 32px !important;
    padding: 5px 11px !important;
    font-size: 12px !important;
  }

  .mobile-admin-topbar.is-management-tab .mobile-admin-tab-pill {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 32px !important;
    justify-content: center !important;
    padding: 5px 6px !important;
    font-size: 12px !important;
    border-radius: 8.5px !important;
    border: none !important;
    background: transparent !important;
    color: var(--text-secondary) !important;
    box-shadow: none !important;
  }

  .mobile-admin-topbar.is-management-tab .mobile-admin-tab-pill.active {
    background: #ffffff !important;
    color: var(--text-primary) !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  }

  body.dark-mode .mobile-admin-topbar.is-management-tab .mobile-admin-tab-pill.active {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
  }

  #admin-expanded-panel .admin-section-header > div:first-child {
    display: none !important;
  }

  #tab-alerts .admin-section-header {
    display: none !important;
  }

  #admin-expanded-panel .admin-header-actions {
    margin: 0 !important;
  }

  #admin-fleet-list-view:not([style*="display: none"]):not([style*="display:none"]),
  #admin-expanded-panel .admin-tab-content.active {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  #admin-expanded-panel table.apple-table tbody {
    gap: 16px !important;
  }

  #admin-expanded-panel table.apple-table tbody tr {
    padding: 16px !important;
    gap: 12px 14px !important;
    border-radius: 20px !important;
  }

  /* Clean mobile section table headers (remove colliding right span & floating divider) */
  #admin-expanded-panel .table-card-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    padding: 4px 2px 10px !important;
    border-bottom: none !important;
  }

  #admin-expanded-panel .table-card-header > h4,
  #admin-expanded-panel .table-card-header .table-title {
    width: 100% !important;
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
  }

  #admin-expanded-panel .table-card-header > span,
  #admin-expanded-panel .table-card-header .table-sub {
    display: none !important;
  }

  /* 8. Trip Report (#tab-reports) responsive filters, chart bars & trip cards */
  .admin-section-header .filter-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .admin-section-header .filter-actions .apple-calendar-picker-wrapper {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .admin-section-header .filter-actions .apple-button {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: center !important;
    padding: 10px 8px !important;
    font-size: 12.5px !important;
  }

  .report-vehicle-deck {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  .vehicle-deck-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
  }

  .deck-title-group {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }

  .deck-counter-badge {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .deck-header-right,
  .deck-scroll-actions {
    display: none !important;
  }

  .report-vehicle-hero {
    padding: 12px !important;
    gap: 10px !important;
  }

  .report-hero-thumb {
    display: none !important;
  }

  #btn-hero-open-player {
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.3 !important;
    height: auto !important;
    padding: 10px 12px !important;
    font-size: 12.5px !important;
  }

  .report-kpi-grid > .report-kpi-card:last-child:nth-child(odd) {
    grid-column: 1 / -1 !important;
  }

  .report-speed-profile-card {
    padding: 14px !important;
    gap: 12px !important;
    overflow: hidden !important;
  }

  .speed-profile-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .speed-legend {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px 12px !important;
    width: 100% !important;
    font-size: 11.5px !important;
  }

  .legend-item {
    white-space: nowrap !important;
  }

  .report-hourly-chart {
    grid-template-columns: repeat(11, minmax(0, 1fr)) !important;
    gap: 3px !important;
    padding: 12px 6px 6px !important;
    height: 148px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .hourly-col {
    min-width: 0 !important;
    gap: 4px !important;
  }

  .hourly-speed-val {
    font-size: 9.5px !important;
  }

  .hourly-label {
    font-size: 8.5px !important;
    letter-spacing: -0.04em !important;
    white-space: nowrap !important;
  }

  .trip-route-cell {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
  }

  .trip-point {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .trip-point .point-badge {
    flex-shrink: 0 !important;
    min-width: 48px !important;
    text-align: center !important;
  }

  .trip-point .point-name {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .trip-route-arrow-connector {
    display: none !important;
  }

  /* 9. Single-column cards & responsive switchers on Alarms, Devices & Fuel tabs */
  .rules-grid,
  .gateway-cards-grid,
  .fuel-bento-grid {
    grid-template-columns: 1fr !important;
  }

  #tab-fuel > div:has(#fuel-view-switcher) {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  #fuel-view-switcher {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #fuel-view-switcher .segmented-btn {
    justify-content: center !important;
  }

  /* 10. Gateway page (#tab-gateway) hierarchy & VMP topbar stack on mobile */
  #tab-gateway.active {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
  }

  #tab-gateway .admin-section-header {
    order: 1 !important;
    margin-bottom: 0 !important;
  }

  #tab-gateway .admin-table-card {
    order: 2 !important;
    margin-top: 0 !important;
  }

  #tab-gateway .spain-live-hub-card {
    order: 3 !important;
    margin-top: 4px !important;
    padding: 14px !important;
  }

  #tab-gateway .gateway-cards-grid {
    order: 4 !important;
  }

  .spain-live-hub-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .spain-live-subtitle {
    display: none !important;
  }

  .ingest-url-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .ingest-url-code {
    min-width: 0 !important;
    font-size: 11.5px !important;
  }

  .vmp-topbar-left {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .vmp-title-group {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .vmp-topbar-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .vmp-topbar-actions .apple-button {
    width: 100% !important;
    justify-content: center !important;
  }
}

@media (max-width: 374px) {
  .mobile-map-top-bar {
    left: 8px !important;
    right: 8px !important;
    height: 54px !important;
    min-height: 54px !important;
    padding: 0 8px 0 12px !important;
  }

  .mobile-top-icon-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
  }

  .mobile-top-icon-btn i,
  .mobile-top-icon-btn svg {
    width: 16px !important;
    height: 16px !important;
  }

  .mobile-top-actions {
    gap: 4px !important;
  }

  .mobile-top-logo {
    height: 24px !important;
    width: auto !important;
    max-width: 96px !important;
  }

  .mobile-live-pill {
    font-size: 10px !important;
    padding: 3px 7px !important;
  }

  .sidebar-mode-switcher .mode-tab-btn {
    font-size: 10.5px !important;
    padding: 5px 2px !important;
    gap: 2px !important;
  }

  .apple-admin-menu {
    left: 8px !important;
    right: 8px !important;
    padding: 4px !important;
    height: 62px !important;
    min-height: 62px !important;
  }

  .apple-admin-menu .rail-item[data-mobile-label] {
    height: 50px !important;
    min-height: 50px !important;
    padding: 4px 2px !important;
  }

  .apple-admin-menu .rail-item[data-mobile-label]::after {
    font-size: 9.5px !important;
  }
}

/* ============================================================================
   BLUE -> WHITE CIRCLE WIPE & LOGO REVEAL BOOT SPLASH + CARD ENTRANCE
   ============================================================================ */
.apple-boot-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #ffffff;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0.42s;
}

.apple-boot-splash.is-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150vmax;
  height: 150vmax;
  margin-top: -75vmax;
  margin-left: -75vmax;
  border-radius: 50%;
  pointer-events: none;
  transform: scale(0);
  will-change: transform;
}

.boot-circle-blue {
  z-index: 1;
  background:
    radial-gradient(circle at 34% 30%, rgba(56, 156, 255, 0.5) 0%, transparent 48%),
    linear-gradient(135deg, #162f48 0%, #1d3c5c 22%, #25486c 38%, #005dc0 58%, #1e82f7 78%, #005dc0 100%);
  box-shadow: inset 0 0 110px rgba(22, 47, 72, 0.5);
  animation: bootCircleExpand 0.56s cubic-bezier(0.22, 1, 0.36, 1) 0.02s forwards;
}

.boot-circle-white {
  z-index: 2;
  background: #ffffff;
  animation: bootCircleExpand 0.56s cubic-bezier(0.22, 1, 0.36, 1) 0.26s forwards;
}

.boot-logo-wrap {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.76) translateY(6px);
  animation: bootLogoReveal 0.52s cubic-bezier(0.22, 1, 0.36, 1) 0.48s forwards;
}

.boot-brand-logo {
  height: 62px;
  width: auto;
  max-width: 72vw;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 81, 181, 0.12));
}

/* Staggered card & control reveal once bootstrap completes */
body.boot-ready #vehicle-list-container .vehicle-card {
  animation: bootCardEntrance 0.48s cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.boot-ready #vehicle-list-container .vehicle-card:nth-child(2) {
  animation-delay: 0.06s;
}

body.boot-ready #vehicle-list-container .vehicle-card:nth-child(3) {
  animation-delay: 0.12s;
}

body.boot-ready #vehicle-list-container .vehicle-card:nth-child(4) {
  animation-delay: 0.18s;
}

@keyframes bootCircleExpand {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes bootLogoReveal {
  0% {
    opacity: 0;
    transform: scale(0.76) translateY(6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes bootCardEntrance {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .apple-boot-splash,
  .boot-circle,
  .boot-logo-wrap,
  body.boot-ready #vehicle-list-container .vehicle-card {
    animation: none !important;
    transition: none !important;
  }

  .boot-logo-wrap {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================================================
   iOS DIRECTIONAL PAGE, TAB & PANEL TRANSITIONS
   ============================================================================ */
.admin-expanded-panel {
  opacity: 0;
  translate: 0 18px;
  scale: 0.986;
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    translate 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    scale 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    display 0.28s;
  transition-behavior: allow-discrete;
}

.admin-expanded-panel.open {
  opacity: 1;
  translate: 0 0;
  scale: 1;
}

@starting-style {
  .admin-expanded-panel.open {
    opacity: 0;
    translate: 0 18px;
    scale: 0.986;
  }
}

.admin-expanded-panel.open.is-closing {
  opacity: 0 !important;
  translate: 0 18px !important;
  scale: 0.986 !important;
  pointer-events: none !important;
}

@keyframes iosNavSlideFromRight {
  from {
    opacity: 0;
    transform: translate3d(26px, 0, 0) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes iosNavSlideFromLeft {
  from {
    opacity: 0;
    transform: translate3d(-26px, 0, 0) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

#admin-expanded-panel[data-nav-dir="forward"] .admin-tab-content.active,
#admin-expanded-panel[data-nav-dir="forward"] #admin-vehicle-detail-view,
.sidebar-content[data-nav-dir="forward"] > .vehicle-list,
dialog#vehicle-detail-dialog[data-nav-dir="forward"] .sheet-tab-pane.active {
  animation: iosNavSlideFromRight 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#admin-expanded-panel[data-nav-dir="backward"] .admin-tab-content.active,
#admin-expanded-panel[data-nav-dir="backward"] #admin-fleet-list-view,
.sidebar-content[data-nav-dir="backward"] > .vehicle-list,
dialog#vehicle-detail-dialog[data-nav-dir="backward"] .sheet-tab-pane.active {
  animation: iosNavSlideFromLeft 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Tactile iOS tab & segmented pill transitions */
.apple-admin-menu .rail-item,
.mobile-admin-tab-pill,
.sidebar-mode-switcher .mode-tab-btn,
#vehicle-sheet-tabs .sheet-seg-btn {
  transition: background-color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.apple-admin-menu .rail-item:active,
.mobile-admin-tab-pill:active,
.sidebar-mode-switcher .mode-tab-btn:active,
#vehicle-sheet-tabs .sheet-seg-btn:active {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  .admin-expanded-panel,
  .admin-expanded-panel.open,
  .admin-expanded-panel.open.is-closing {
    translate: none !important;
    scale: none !important;
    transition-property: opacity, display;
    transition-duration: 0.12s;
  }

  @starting-style {
    .admin-expanded-panel.open {
      translate: none;
      scale: none;
    }
  }

  #admin-expanded-panel[data-nav-dir="forward"] .admin-tab-content.active,
  #admin-expanded-panel[data-nav-dir="backward"] .admin-tab-content.active,
  #admin-expanded-panel[data-nav-dir="forward"] #admin-vehicle-detail-view,
  #admin-expanded-panel[data-nav-dir="backward"] #admin-fleet-list-view,
  .sidebar-content[data-nav-dir="forward"] > .vehicle-list,
  .sidebar-content[data-nav-dir="backward"] > .vehicle-list,
  dialog#vehicle-detail-dialog[data-nav-dir="forward"] .sheet-tab-pane.active,
  dialog#vehicle-detail-dialog[data-nav-dir="backward"] .sheet-tab-pane.active {
    animation: none !important;
  }

  .apple-admin-menu .rail-item:active,
  .mobile-admin-tab-pill:active,
  .sidebar-mode-switcher .mode-tab-btn:active,
  #vehicle-sheet-tabs .sheet-seg-btn:active {
    transform: none !important;
  }
}

/* ============================================================================
   18. PWA & WEB PUSH NOTIFICATION CONTROL CENTER
   ============================================================================ */
.push-notification-hub-card {
  background: linear-gradient(135deg, rgba(0, 93, 192, 0.055) 0%, #ffffff 60%);
  border: 1px solid rgba(0, 93, 192, 0.16);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.push-hub-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.push-hub-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  flex: 1 1 280px;
  min-width: 0;
}

.push-hub-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #162f48 0%, #005dc0 100%);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(0, 93, 192, 0.24);
}

.push-hub-icon-box svg {
  width: 20px;
  height: 20px;
}

.push-hub-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.push-hub-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary, #1d1d1f);
}

.push-hub-subtitle {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary, #6e6e73);
}

.push-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(142, 142, 147, 0.14);
  color: #636366;
}

.push-status-pill.is-active {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.push-status-pill.is-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.push-status-pill.is-error {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
}

.push-subscriber-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(0, 93, 192, 0.08);
  color: #005dc0;
  white-space: nowrap;
}

.ios-install-hint-box {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 13px;
  background: #eff6ff;
  border: 1px solid rgba(0, 93, 192, 0.18);
  color: #162f48;
}

.ios-install-hint-box[hidden],
.push-devices-bar[hidden],
#btn-install-pwa-app[hidden] {
  display: none !important;
}

.ios-install-hint-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(0, 93, 192, 0.12);
  color: #005dc0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ios-install-hint-icon svg {
  width: 17px;
  height: 17px;
}

.ios-install-hint-copy strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 3px;
}

.ios-install-hint-copy p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #334155;
}

.push-actions-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.push-actions-row .apple-button {
  min-height: 40px;
  padding: 0 15px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
}

.push-actions-row .apple-button svg {
  width: 15px;
  height: 15px;
}

.push-btn-main.is-subscribed {
  background: #0f766e;
  border-color: #0f766e;
}

.push-devices-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 4px;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
}

.push-device-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-secondary, #475569);
  font-size: 11px;
  font-weight: 600;
}

body.dark-mode .push-notification-hub-card {
  background: linear-gradient(135deg, rgba(0, 93, 192, 0.16) 0%, #1c1c1e 65%);
  border-color: rgba(56, 189, 248, 0.2);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}

body.dark-mode .push-hub-title {
  color: #f5f5f7;
}

body.dark-mode .push-hub-subtitle {
  color: #a1a1a6;
}

body.dark-mode .push-subscriber-chip {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

body.dark-mode .ios-install-hint-box {
  background: rgba(30, 58, 138, 0.28);
  border-color: rgba(96, 165, 250, 0.25);
  color: #e2e8f0;
}

body.dark-mode .ios-install-hint-copy p {
  color: #cbd5e1;
}

body.dark-mode .push-device-pill {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

@media (max-width: 900px) {
  .push-notification-hub-card {
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 14px;
  }

  .push-actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .push-actions-row .apple-button {
    width: 100%;
    min-height: 44px;
  }
}
