/* Fleet Command System — shared theme, header, nav, map shell, content pages */
:root {
  color-scheme: light;
  --accent: #dc2626;
  --accent-dark: #b91c1c;
  --accent-teal: #b91c1c;
  --accent-violet: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --panel-bg: rgba(255, 255, 255, 0.82);
  --panel-bg-soft: rgba(255, 255, 255, 0.72);
  --panel-border: rgba(255, 255, 255, 0.92);
  --panel-shadow: 0 6px 20px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(148, 163, 184, 0.1);
  --panel-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
  --glass-blur: blur(16px) saturate(1.2);
  --text: #0f172a;
  --muted: #64748b;
  --ok: #059669;
  --warn: #d97706;
  --line: rgba(15, 23, 42, 0.08);
  --card: var(--panel-bg);
  --stroke: rgba(148, 163, 184, 0.22);
  --glow: var(--panel-shadow);
  --fc-sidebar-w: 220px;
  --fc-topbar-h: 64px;
}

body {
  margin: 0;
  font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #e8eef4;
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— App shell (sidebar + topbar) —— */
.fc-app {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  pointer-events: none;
}
.fc-sidebar {
  width: var(--fc-sidebar-w);
  flex-shrink: 0;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 10px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.97);
  border-right: 1px solid var(--stroke);
  box-shadow: 2px 0 16px rgba(15, 23, 42, 0.06);
}
.fc-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 12px;
  border-bottom: 1px solid var(--line);
}
.fc-sidebar-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.fc-sidebar-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}
.fc-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fc-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.fc-nav-item:hover {
  background: rgba(220, 38, 38, 0.06);
  color: var(--accent);
}
.fc-nav-item.is-active {
  background: rgba(220, 38, 38, 0.1);
  color: var(--accent);
  border-color: rgba(220, 38, 38, 0.25);
}
.fc-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.fc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.fc-topbar {
  pointer-events: auto;
  flex-shrink: 0;
  height: var(--fc-topbar-h);
  min-height: var(--fc-topbar-h);
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-top: 0;
  border-right: 0;
  box-sizing: border-box;
}
body.fc-has-shell .fc-topbar.app-header {
  margin-bottom: 0;
  border-radius: 0;
  box-shadow: none;
  border: 0;
  border-bottom: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.97);
}
.fc-topbar .logo-primary,
.fc-topbar .logo-rnd {
  width: 48px;
  height: 48px;
}
body.fc-dash-page .fc-main {
  flex: 1;
  min-width: 0;
  height: var(--fc-topbar-h);
  max-height: var(--fc-topbar-h);
  overflow: visible;
}
.fc-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  box-shadow: var(--panel-shadow-lg);
}

body.fc-has-shell .dashboard-shell {
  top: var(--fc-topbar-h);
  left: var(--fc-sidebar-w);
  right: 0;
  bottom: 0;
  grid-template-rows: 1fr;
  padding: 10px 14px 14px;
}
body.fc-has-shell .stats-rail,
body.fc-has-shell .vehicles-panel,
body.fc-has-shell .fuel-workspace {
  grid-row: 1;
}
body.fc-has-shell .dashboard-shell #fc-header-root,
body.fc-has-shell .dashboard-shell > .app-header {
  display: none !important;
}
body.fc-has-shell .map-background .leaflet-bottom.leaflet-left {
  left: max(calc(var(--fc-sidebar-w) + 12px), calc(env(safe-area-inset-left, 0px) + var(--fc-sidebar-w) + 12px)) !important;
}

/* —— Dashboard home (Commit 2) —— */
body.fc-dash-page {
  background: #e8eef4;
  --fc-map-card-h: 560px;
}
body.fc-dash-page .map-background {
  display: none !important;
}
body.fc-dash-page.fc-has-shell .dashboard-shell.fc-dash-shell {
  position: fixed;
  top: var(--fc-topbar-h);
  left: var(--fc-sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 10;
  pointer-events: auto;
  display: block;
  grid-template-columns: unset;
  grid-template-rows: unset;
  padding: 12px 14px 14px;
  overflow: auto;
  box-sizing: border-box;
}
.fc-dash-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: min(100%, calc(100vh - var(--fc-topbar-h) - 26px));
}
.fc-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.fc-kpi-row .stat-card {
  min-width: 0;
}
.fc-dash-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, 4.5fr) minmax(160px, 1fr);
  gap: 12px;
  align-items: stretch;
}
.fc-side-panel {
  display: flex;
  flex-direction: column;
  min-height: var(--fc-map-card-h);
  max-height: var(--fc-map-card-h);
  overflow: hidden;
}
.fc-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--line);
}
.fc-panel-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.fc-panel-sub {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.fc-panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 10px 12px;
}
.fc-map-card {
  display: flex;
  flex-direction: column;
  min-height: var(--fc-map-card-h);
  height: var(--fc-map-card-h);
  overflow: hidden;
  position: relative;
  grid-column: 2;
}
.fc-map-card .fc-panel-head {
  flex-shrink: 0;
}
.fc-map-card-inner {
  position: relative;
  flex: 1;
  min-height: 0;
  height: 100%;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
  background: #0b1220;
}
.fc-map-card .fleet-map,
.fc-map-card .fleet-map-leaflet.leaflet-container {
  width: 100% !important;
  height: 100% !important;
  min-height: 560px;
  border-radius: 0;
}
.fc-map-card .map-layer-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  bottom: auto;
  width: auto;
  height: auto;
  z-index: 500;
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.98);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
}
.fc-map-card .map-live-stats {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 500;
  display: flex;
  gap: 6px;
}
.fc-fuel-today {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.fc-fuel-today .fc-panel-body {
  overflow: auto;
  max-height: 280px;
}
.fc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.fc-table th,
.fc-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.fc-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.fc-table-empty,
.fc-list-empty {
  text-align: center;
  color: var(--muted);
  padding: 20px 12px;
  font-size: 13px;
  list-style: none;
}
.fc-live-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fc-live-item {
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}
.fc-live-item--ok { border-left-color: var(--ok); }
.fc-live-item--warn { border-left-color: var(--warn); }
.fc-live-item--danger { border-left-color: var(--accent); }
.fc-live-item--muted { border-left-color: var(--muted); }
.fc-live-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.fc-live-badge {
  font-weight: 700;
  font-size: 12px;
}
.fc-live-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--text);
}
.fc-live-meta--sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.fc-live-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.fc-status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: capitalize;
}
.fc-status-pill--ok { background: #dcfce7; color: #166534; }
.fc-status-pill--warn { background: #fef3c7; color: #92400e; }
.fc-status-pill--danger { background: #fee2e2; color: #991b1b; }
.fc-status-pill--muted { background: #e2e8f0; color: #475569; }
.fc-din1-count-wrap {
  text-align: center;
  padding: 16px 8px 8px;
}
.fc-din1-count {
  display: block;
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.fc-din1-label {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.fc-din1-note {
  margin: 0;
  padding: 0 12px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}
.fc-din1-session-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.fc-din1-session {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}
.fc-din1-session--danger { border-color: #fecaca; background: #fff7f7; }
.fc-din1-session--warn { border-color: #fde68a; background: #fffbeb; }
.fc-din1-session--ok { border-color: #bbf7d0; background: #f0fdf4; }
.fc-din1-session--muted { border-color: #e2e8f0; background: #f8fafc; }
.fc-din1-session-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.fc-din1-session-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}
.fc-din1-session-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.fc-din1-session-meta--sub { margin-top: 4px; }
.fc-din1-session-actions { margin-top: 8px; }
.notif-fuel-suspicious .notif-led { background: #dc2626; }
.notif-fuel-unmatched .notif-led { background: #94a3b8; }
.fc-btn--sm {
  font-size: 11px;
  padding: 4px 10px;
  min-height: 28px;
}
.fc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.fc-btn:hover { border-color: rgba(220, 38, 38, 0.35); color: var(--accent); }
.fc-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.fc-btn--ghost { background: transparent; }
body.fc-dash-page .stats-rail,
body.fc-dash-page .vehicles-panel {
  display: none !important;
}

@media (max-width: 1100px) {
  .fc-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fc-dash-grid {
    grid-template-columns: 1fr;
  }
  .fc-map-card {
    grid-column: auto;
    height: auto;
    min-height: var(--fc-map-card-h);
  }
  .fc-side-panel {
    max-height: none;
    min-height: 240px;
  }
}

@media (max-width: 700px) {
  .fc-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.fc-dash-page.fc-has-shell .dashboard-shell {
    padding: 8px;
  }
}

@media (max-width: 900px) {
  :root {
    --fc-sidebar-w: 72px;
    --fc-topbar-h: 56px;
  }
  .fc-sidebar-title,
  .fc-nav-item span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .fc-nav-item {
    justify-content: center;
    padding: 10px;
  }
  body.fc-has-shell .dashboard-shell {
    left: var(--fc-sidebar-w);
    padding: 8px;
  }
}

/* —— Full-screen map —— */
.map-background {
  position: fixed;
  inset: 0;
  z-index: 0;
}
.map-background::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0%, transparent 10%, transparent 90%, rgba(255, 255, 255, 0.18) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, transparent 8%, transparent 92%, transparent 100%);
}
.map-background .fleet-map,
.map-background .fleet-map-leaflet.leaflet-container {
  width: 100%;
  height: 100% !important;
  min-height: 100%;
  border-radius: 0;
  background: #0b1220;
  position: relative;
  z-index: 0;
}
.map-background .leaflet-control {
  background: var(--panel-bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--stroke) !important;
  box-shadow: var(--panel-shadow) !important;
  border-radius: 12px !important;
  overflow: hidden;
}
.map-background .leaflet-control a {
  color: var(--text) !important;
  background: transparent !important;
}
.map-background .leaflet-bar a:hover {
  background: rgba(220, 38, 38, 0.1) !important;
  color: var(--accent) !important;
}
.map-background .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.82) !important;
  color: var(--muted) !important;
  font-size: 10px;
  border-radius: 8px !important;
}
.map-background .leaflet-control-attribution a {
  color: var(--accent) !important;
}
.map-background .leaflet-bottom.leaflet-left {
  bottom: max(68px, calc(env(safe-area-inset-bottom, 0px) + 68px)) !important;
  left: max(268px, calc(env(safe-area-inset-left, 0px) + 268px)) !important;
}

/* Map layer controls (Map / Satellite) — full-bleed background map pages only */
.map-background .map-layer-controls {
  position: fixed;
  z-index: 5;
  left: max(268px, calc(env(safe-area-inset-left, 0px) + 268px));
  bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  top: auto;
  right: auto;
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.98);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: auto;
}
.map-layer-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.95);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.map-layer-btn .map-layer-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}
.map-layer-btn:hover {
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--accent);
}
.map-layer-btn.is-active {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: #b91c1c;
  color: #fff;
}
.map-layer-btn.is-active:hover {
  color: #fff;
}

/* —— Live camera modal —— */
.fc-camera-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
  box-sizing: border-box;
  contain: strict;
  isolation: isolate;
}
body.camera-live-open .map-background,
body.camera-live-open .dashboard-shell,
body.camera-live-open .fc-camera-console {
  pointer-events: none;
}
body.camera-live-open .fc-camera-modal {
  pointer-events: auto;
}
.fc-camera-modal.open {
  display: flex;
}
.fc-camera-modal .modal-card {
  width: min(960px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(148, 163, 184, 0.12);
  overflow: hidden;
}
.fc-camera-modal .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.88) 100%);
  flex-shrink: 0;
}
.fc-camera-modal .modal-head-start {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.fc-camera-modal .modal-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-violation-smoking {
  border-left: 3px solid #e11d48;
  background: rgba(225, 29, 72, 0.06);
}
.notif-violation-helmet {
  border-left: 3px solid #d97706;
  background: rgba(217, 119, 6, 0.08);
}

.fc-camera-modal .live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.22);
  flex-shrink: 0;
}
.fc-camera-modal .stream-mode-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.fc-camera-modal .stream-mode-badge--direct {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
}
.fc-camera-modal .stream-mode-badge--proxy {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.15);
}
.fc-camera-modal .stream-mode-badge--frames {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}
.fc-camera-modal .live-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5);
  animation: fc-live-pulse 1.8s ease-out infinite;
}
@keyframes fc-live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
.fc-camera-modal .fc-camera-type-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #64748b;
  margin-right: 4px;
}
.fc-camera-modal .fc-camera-type-select {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #0f172a;
  max-width: 140px;
}

.fc-camera-modal .modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.fc-camera-modal .capture-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fc-camera-modal .capture-status.ok { color: var(--ok); }
.fc-camera-modal .capture-status.error { color: #e11d48; }
.fc-camera-modal .fc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--stroke);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  background: #fff;
  color: #334155;
  line-height: 1.2;
  white-space: nowrap;
}
.fc-camera-modal .fc-btn:hover {
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--accent);
  background: rgba(220, 38, 38, 0.04);
}
.fc-camera-modal .fc-btn--primary {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.22);
}
.fc-camera-modal .fc-btn--primary:hover {
  filter: brightness(1.06);
  color: #fff;
  border-color: transparent;
}
.fc-camera-modal .fc-btn--ghost {
  background: transparent;
  border-color: var(--stroke);
  color: var(--muted);
}
.fc-camera-modal .fc-btn--ghost:hover {
  color: #0f172a;
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.35);
}
.fc-camera-modal .camera-wrap {
  contain: strict;
  isolation: isolate;
  transform: translateZ(0);
  position: relative;
  flex: 1;
  min-height: min(380px, 52vh);
  background:
    radial-gradient(ellipse at center, rgba(30, 41, 59, 0.35) 0%, rgba(15, 23, 42, 0.95) 70%),
    #0b1220;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.fc-camera-modal .camera-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.35);
}
.fc-camera-modal .camera-wrap img,
.fc-camera-modal .camera-wrap .camera-stream-frame {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 100%;
  height: min(70vh, 640px);
  max-height: min(70vh, 640px);
  object-fit: contain;
  border: 0;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  background: #0b1220;
}
.fc-camera-modal .camera-msg {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  max-width: 280px;
}
.fc-camera-modal .camera-msg::before {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.25);
  border-top-color: #dc2626;
  animation: fc-camera-spin 0.9s linear infinite;
  display: none;
}
.fc-camera-modal .camera-msg.is-loading::before {
  display: block;
}
.fc-camera-modal .camera-msg.is-error {
  color: #fca5a5;
}
.fc-camera-modal .camera-msg.is-success {
  color: #6ee7b7;
}
@keyframes fc-camera-spin {
  to { transform: rotate(360deg); }
}

/* —— Map dashboard overlay shell —— */
.dashboard-shell {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: minmax(200px, 248px) 1fr minmax(280px, 320px);
  gap: 0;
  padding: 10px 14px 14px;
  box-sizing: border-box;
}
.dashboard-shell > * {
  pointer-events: auto;
}
.dashboard-shell #fc-header-root {
  display: contents;
}

/* —— Header —— */
.app-header,
.fc-header {
  grid-column: 1 / -1;
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.98);
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.fc-page .app-header,
.fc-page .fc-header {
  margin: 8px 10px 0;
  grid-column: unset;
}
.header-start {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  min-width: 0;
}
.app-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  text-align: center;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #000000;
  -webkit-text-fill-color: #000000;
  white-space: nowrap;
  max-width: min(42vw, calc(100% - 300px));
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 1;
}
.brand-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-logos {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-primary,
.logo-rnd {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
}
.topbar-actions,
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  position: relative;
  z-index: 2;
}
.nav-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.back-link {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  box-sizing: border-box;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--muted);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
  font: inherit;
}
.back-link:hover,
.back-link.is-active {
  color: var(--accent);
  border-color: rgba(220, 38, 38, 0.45);
  background: #ffffff;
}
.back-link .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}
.profile-box {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 8px 3px 3px;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.95);
}
.profile-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.profile-content {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.user-meta {
  font-size: 12px;
  color: var(--muted);
}
#userInfo {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}
.header-logout-btn,
#logoutBtn {
  margin-left: 2px;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border: none;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.header-logout-btn {
  padding: 4px 8px;
  font-size: 10px;
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--muted);
}
.header-logout-btn:hover {
  color: var(--text);
  background: #f8fafc;
}
.app-header .back-link,
.fc-header .back-link {
  padding: 0;
}

/* —— Stats rail & vehicles panel (mockup layout) —— */
.stats-rail {
  grid-row: 2;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: start;
  width: 100%;
  max-width: none;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.98);
  border-left: 4px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.stat-card--vehicles { border-left-color: #3b82f6; }
.stat-card--sites { border-left-color: #22c55e; }
.stat-card--events { border-left-color: #94a3b8; }
.stat-card--violations { border-left-color: #ef4444; }
.stat-card--camera { border-left-color: #8b5cf6; }
.stat-card--users { border-left-color: #6366f1; }
.stat-card--drivers { border-left-color: #f59e0b; }
.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.stat-card-icon svg { width: 20px; height: 20px; display: block; }
.stat-card--vehicles .stat-card-icon { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.stat-card--sites .stat-card-icon { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.stat-card--events .stat-card-icon { background: rgba(148, 163, 184, 0.15); color: #64748b; }
.stat-card--violations .stat-card-icon { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.stat-card--camera .stat-card-icon { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.stat-card--users .stat-card-icon { background: rgba(99, 102, 241, 0.12); color: #6366f1; }
.stat-card--drivers .stat-card-icon { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.stat-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.stat-card .label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0;
  line-height: 1.2;
}
.stat-card .value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
  color: #0f172a;
  margin: 0;
  letter-spacing: -0.03em;
}
.stat-card .value.warn { color: #e11d48; }
.vehicles-panel {
  grid-row: 2;
  grid-column: 3;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-self: end;
  width: 100%;
  max-width: 320px;
  max-height: min(480px, 62vh);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  z-index: 20;
}
.vehicles-panel-search-wrap {
  position: relative;
  padding: 12px 12px 6px;
  flex-shrink: 0;
}
.vehicles-search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #94a3b8;
  pointer-events: none;
}
.vehicles-panel-search {
  width: 100%;
  max-width: none;
  height: 36px;
  font-size: 12px;
  padding: 0 12px 0 34px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  box-sizing: border-box;
  background: #fff;
}
.vehicles-panel-search:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.vehicles-panel-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0;
  padding: 2px 14px 8px;
}
.vehicles-panel-head {
  display: none;
}
.vehicles-panel-meta {
  display: none;
}
.vehicles-panel .map-code-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vehicle-list-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  box-sizing: border-box;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.vehicle-list-card:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  border-color: rgba(148, 163, 184, 0.35);
}
.vehicle-list-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.vehicle-list-icon svg { width: 18px; height: 18px; display: block; }
.vehicle-list-card.is-online .vehicle-list-icon {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
}
.vehicle-list-card.is-offline .vehicle-list-icon {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
.vehicle-list-text {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vehicle-list-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.vehicle-list-card.is-online .vehicle-list-status {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.22);
}
.vehicle-list-card.is-offline .vehicle-list-status {
  background: #94a3b8;
}
.vehicles-panel .map-code-btn {
  padding: 0;
  border: none;
  background: transparent;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.85);
  color: var(--muted);
}
.live-pill.on strong { color: #059669; }
.live-pill.off strong { color: #e11d48; }
.map-code-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 8px;
}

/* —— Content pages (users management) —— */
.fc-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.fc-page #fc-header-root {
  flex-shrink: 0;
}
.fc-content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px 24px;
  box-sizing: border-box;
}
.fc-content .card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--panel-shadow);
  margin-bottom: 14px;
}

/* —— Vehicles Live / Admin: map + floating console —— */
.fc-camera-console,
.fc-mgmt-console {
  position: fixed;
  z-index: 15;
  left: max(268px, calc(env(safe-area-inset-left, 0px) + 268px));
  right: max(340px, calc(env(safe-area-inset-right, 0px) + 340px));
  top: max(72px, calc(env(safe-area-inset-top, 0px) + 72px));
  bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  box-shadow: var(--panel-shadow-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}
.fc-camera-console-head,
.fc-mgmt-console-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.fc-mgmt-console-head {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(248, 250, 252, 0.4) 100%);
}
.fc-camera-console-title,
.fc-mgmt-console-title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}
.fc-camera-console-sub,
.fc-mgmt-console-sub {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}
.fc-camera-console-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.fc-camera-console-toolbar input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  box-sizing: border-box;
}
.fc-camera-console-toolbar button {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.fc-camera-console-toolbar button:hover {
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--accent);
}
.fc-camera-console-body,
.fc-mgmt-console-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px 14px;
}
.fc-mgmt-console-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fc-camera-console-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.fc-camera-console-body th,
.fc-camera-console-body td {
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  text-align: left;
}
.fc-camera-console-body th {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  z-index: 1;
}
.fc-camera-console-body .eye-btn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: #fff;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}
.fc-camera-console-body .status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--stroke);
}
.fc-camera-console-body .status.active { color: #059669; }
.fc-camera-console-body .status.offline { color: #e11d48; }
.fc-mgmt-console-body .card {
  background: rgba(248, 250, 252, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 14px 16px 16px;
  margin: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.fc-mgmt-console-body .card + .card {
  border-top: none;
  padding-top: 14px;
  margin-top: 0;
}
.fc-mgmt-console-body .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.fc-mgmt-console-body .section-head .title {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
  margin: 0;
}
.fc-mgmt-console-body .msg {
  min-height: 18px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}
.fc-mgmt-console-body .msg.ok { color: var(--ok); }
.fc-mgmt-console-body .msg.danger,
.fc-mgmt-console-body .msg.error { color: #e11d48; }
.fc-mgmt-console-body .fc-table-wrap {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.fc-mgmt-console-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fc-mgmt-console-body th,
.fc-mgmt-console-body td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}
.fc-mgmt-console-body th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  z-index: 1;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  white-space: nowrap;
}
.fc-mgmt-console-body td {
  border-bottom: 1px solid var(--line);
  color: #334155;
}
.fc-mgmt-console-body tbody tr {
  transition: background 0.15s ease;
}
.fc-mgmt-console-body tbody tr:hover {
  background: rgba(220, 38, 38, 0.035);
}
.fc-mgmt-console-body tbody tr:last-child td {
  border-bottom: none;
}
.fc-mgmt-console-body td.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #475569;
}
.fc-mgmt-console-body .fc-id {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}
.fc-mgmt-console-body .fc-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  line-height: 1.2;
}
.fc-mgmt-console-body .fc-pill--active {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
  border: 1px solid rgba(5, 150, 105, 0.22);
}
.fc-mgmt-console-body .fc-pill--inactive {
  background: rgba(100, 116, 139, 0.1);
  color: #64748b;
  border: 1px solid rgba(100, 116, 139, 0.18);
}
.fc-mgmt-console-body .fc-role {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}
.fc-mgmt-console-body .fc-role--admin {
  background: rgba(220, 38, 38, 0.1);
  color: #b91c1c;
}
.fc-mgmt-console-body .fc-role--viewer {
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
}
.fc-mgmt-console-body .fc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--stroke);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  background: #fff;
  color: #334155;
  line-height: 1.2;
  white-space: nowrap;
}
.fc-mgmt-console-body .fc-btn:hover {
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--accent);
  background: rgba(220, 38, 38, 0.04);
}
.fc-mgmt-console-body .fc-btn--primary {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.22);
}
.fc-mgmt-console-body .fc-btn--primary:hover {
  filter: brightness(1.06);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.28);
}
.fc-mgmt-console-body .fc-btn--danger {
  color: #e11d48;
  border-color: rgba(225, 29, 72, 0.25);
}
.fc-mgmt-console-body .fc-btn--danger:hover {
  background: rgba(225, 29, 72, 0.08);
  border-color: rgba(225, 29, 72, 0.4);
  color: #be123c;
}
.fc-mgmt-console-body .fc-actions {
  white-space: nowrap;
}
.fc-mgmt-console-body .fc-actions .fc-btn + .fc-btn {
  margin-left: 6px;
}
.fc-mgmt-console-body input,
.fc-mgmt-console-body select {
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  padding: 8px 10px;
  background: #fff;
}

/* —— Notifications (header) —— */
.notif-anchor {
  position: relative;
  flex-shrink: 0;
}
.notif-anchor.open { z-index: 5000; }
.notif-card {
  overflow: visible;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border: none;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}
.notif-card.open { overflow: visible; }
.notif-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  border: 2px solid #fff;
  box-sizing: border-box;
}
.notif-badge[hidden] { display: none !important; }
.header-notif .notif-icon { color: #fff; }
.notif-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
}
.notif-icon { width: 14px; height: 14px; color: #475569; }
.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  flex-direction: column;
  gap: 6px;
  position: fixed;
  width: min(360px, calc(100vw - 20px));
  max-height: min(220px, 40vh);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--panel-shadow-lg);
  z-index: 5001;
  box-sizing: border-box;
}
.notif-card.open .notif-list { display: flex; }

/* —— Viewer bottom drawer —— */
.fc-drawer {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 15;
  max-height: min(280px, 36vh);
  overflow: auto;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: var(--panel-shadow-lg);
  padding: 12px;
  box-sizing: border-box;
}
.fc-drawer .controls { margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.fc-drawer table { width: 100%; font-size: 13px; border-collapse: collapse; }
.fc-drawer th, .fc-drawer td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; }
.fc-drawer-split {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) {
  .fc-drawer-split { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    padding: max(8px, env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  }
  .stats-rail {
    grid-column: 1;
    grid-row: 2;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: none;
  }
  .stat-card { flex: 0 0 auto; min-width: 200px; }
  .vehicles-panel {
    position: fixed;
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    width: min(280px, calc(100vw - 20px));
    max-width: none;
    max-height: min(300px, 42vh);
    z-index: 30;
  }
  .map-background .leaflet-bottom.leaflet-left {
    left: max(12px, env(safe-area-inset-left, 0px)) !important;
    bottom: max(64px, calc(env(safe-area-inset-bottom, 0px) + 64px)) !important;
  }
  .map-background .map-layer-controls {
    left: max(12px, env(safe-area-inset-left, 0px));
    bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  }
  .fc-drawer {
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    max-height: min(220px, 32vh);
  }
  .fc-camera-console,
  .fc-mgmt-console {
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    top: max(120px, calc(env(safe-area-inset-top, 0px) + 120px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 1100px) {
  .header-profile .profile-content { display: none; }
  .logo-primary, .logo-rnd { width: 52px; height: 52px; }
  .app-title { max-width: min(36vw, calc(100% - 240px)); }
}
@media (max-width: 600px) {
  .app-header, .fc-header {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .header-start { order: 1; }
  .topbar-actions {
    order: 2;
    flex-wrap: wrap;
    max-width: calc(100% - 120px);
  }
  .logo-primary, .logo-rnd { width: 48px; height: 48px; }
  .app-title {
    position: static;
    transform: none;
    order: 3;
    flex: 1 1 100%;
    max-width: 100%;
    font-size: 0.85rem;
    pointer-events: auto;
  }
  .header-profile .profile-content { display: none; }
  .vehicles-panel {
    left: max(10px, env(safe-area-inset-left, 0px));
    width: min(100%, calc(100vw - 20px));
  }
}

/* Vehicle profile page + global profile links */
.vp-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #dc2626);
  text-decoration: none;
  white-space: nowrap;
}
.vp-link:hover { text-decoration: underline; }

body.fc-vp-page { background: #e8eef4; }
body.fc-vp-page .fc-main {
  flex: 1;
  min-width: 0;
  height: var(--fc-topbar-h);
  max-height: var(--fc-topbar-h);
  overflow: visible;
}
.fc-vp-main {
  position: fixed;
  top: var(--fc-topbar-h);
  left: var(--fc-sidebar-w);
  right: 0;
  bottom: 0;
  overflow: auto;
  padding: 14px 16px 24px;
  z-index: 10;
  box-sizing: border-box;
}
.fc-vp-inner { max-width: 1200px; margin: 0 auto; }
.vp-loading { color: var(--muted); padding: 40px 0; text-align: center; }
.vp-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: var(--panel-shadow);
}
.vp-page-header-main { min-width: 0; flex: 1; }
.vp-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.vp-page-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.vp-edit-btn { flex-shrink: 0; white-space: nowrap; align-self: center; }
.vp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.vp-tab {
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.9);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.vp-tab.is-active {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
}
.vp-tab-panel { display: none; }
.vp-tab-panel.is-active { display: block; }
.vp-panels {
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--panel-shadow);
}
.vp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.vp-kpi-card {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vp-kpi-label { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.vp-kpi-value { font-size: 1rem; font-weight: 700; }
.vp-kpi-value--sm { font-size: 12px; font-weight: 600; }
.vp-kpi-sub { font-size: 12px; color: var(--muted); }
.vp-overview-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.vp-map-preview {
  width: 100%;
  height: 650px;
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.vp-map-preview.leaflet-container,
.vp-map-preview .leaflet-pane.leaflet-popup-pane {
  z-index: 400;
}
.vp-section-title { margin: 16px 0 8px; font-size: 14px; }
.vp-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.vp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.vp-table th, .vp-table td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }
.vp-table th { background: #f8fafc; font-size: 11px; text-transform: uppercase; color: var(--muted); }
.vp-muted { color: var(--muted); font-size: 12px; }
.vp-fuel-qr { margin-bottom: 12px; }
.vp-qr-preview { min-height: 80px; margin-bottom: 8px; }
.vp-qr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.vp-gps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  font-size: 13px;
  margin-bottom: 10px;
}
.vp-raw-json pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 10px;
  border-radius: 8px;
  font-size: 11px;
  overflow: auto;
  max-height: 240px;
}
.vp-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.vp-timeline-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}
.vp-timeline-item--fuel { border-left: 3px solid #059669; }
.vp-timeline-item--door { border-left: 3px solid #d97706; }
.vp-timeline-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.vp-timeline-at { color: var(--muted); font-size: 11px; white-space: nowrap; }
.vp-timeline-body { margin-top: 4px; font-size: 12px; color: var(--muted); }
.vp-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.vp-pill--ok { background: rgba(5,150,105,0.12); color: #047857; }
.vp-pill--muted { background: rgba(100,116,139,0.15); color: #475569; }
.vp-pill--status { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.vp-pill--fuel { background: rgba(220, 38, 38, 0.1); color: #b91c1c; }
.vp-page-msg { min-height: 18px; font-size: 13px; margin-bottom: 8px; }
.vp-page-msg--ok { color: var(--ok); }
.vp-page-msg--error { color: #e11d48; }
.fleet-popup-actions { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.vehicle-list-card { position: relative; }
.vehicle-list-card .vp-link {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 10px;
}
@media (max-width: 900px) {
  .fc-vp-main { left: 0; }
  .vp-map-preview { height: 420px; }
}

/* —— Vehicles management page —— */
body.fc-vehicles-page { background: #e8eef4; }
body.fc-vehicles-page .fc-main {
  flex: 1;
  min-width: 0;
  height: var(--fc-topbar-h);
  max-height: var(--fc-topbar-h);
  overflow: visible;
}
body.fc-vehicles-page .fc-vehicles-main .app-header,
body.fc-vehicles-page .fc-vehicles-main #fc-header-root,
body.fc-vehicles-page .fc-vehicles-main .page-header,
body.fc-vehicles-page .fc-vehicles-main .vehicles-header {
  display: none !important;
}
.fc-vehicles-main {
  position: fixed;
  top: var(--fc-topbar-h);
  left: var(--fc-sidebar-w);
  right: 0;
  bottom: 0;
  overflow: auto;
  padding: 18px 18px 24px;
  z-index: 10;
  box-sizing: border-box;
}
.fc-vehicles-inner {
  width: 100%;
  max-width: none;
  margin: 0;
}
.fc-vehicles-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.fc-vehicles-toolbar input[type="search"],
.fc-vehicles-toolbar select,
.fc-vehicles-toolbar .fc-btn {
  height: 38px;
  box-sizing: border-box;
}
.fc-vehicles-toolbar input[type="search"],
.fc-vehicles-toolbar select {
  min-width: 160px;
  padding: 0 10px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  font-size: 13px;
  background: rgba(255,255,255,0.95);
}
.fc-vehicles-toolbar input[type="search"] {
  flex: 1 1 220px;
  min-width: 200px;
  max-width: none;
}
.fc-vehicles-toolbar #openCreateVehicleBtn {
  margin-left: auto;
  flex-shrink: 0;
}
.fc-vehicles-msg { min-height: 18px; font-size: 13px; margin-bottom: 8px; }
.fc-vehicles-msg--ok { color: var(--ok); }
.fc-vehicles-msg--err { color: #e11d48; }
.fc-vehicles-card {
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: var(--panel-shadow);
  overflow: hidden;
}
.fc-vehicles-table-wrap { overflow: auto; }
.fc-vehicles-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fc-vehicles-table th,
.fc-vehicles-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.fc-vehicles-table th {
  background: #f8fafc;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.fc-vehicles-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fc-status-pill--active { background: rgba(5, 150, 105, 0.12); color: #047857; }
.fc-status-pill--inactive { background: rgba(100, 116, 139, 0.15); color: #475569; }
.fc-vehicles-page .fc-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.fc-vehicles-page .fc-btn--primary:hover {
  filter: brightness(1.05);
  color: #fff;
}
.fc-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 9000;
  padding: 16px;
}
.fc-modal.open { display: flex; }
.fc-modal-card {
  width: min(480px, 100%);
  max-height: min(92vh, 900px);
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--panel-shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.fc-modal-card--wide { width: min(560px, 100%); }
.fc-modal-card--edit { width: min(640px, 100%); }
.fc-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.fc-modal-head h3 { margin: 0; font-size: 15px; }
.fc-modal-body {
  padding: 14px;
  display: grid;
  gap: 10px;
  overflow: auto;
}
.fc-modal-body--scroll { max-height: calc(92vh - 56px); }
.fc-modal-body input,
.fc-modal-body select,
.fc-modal-body textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  box-sizing: border-box;
  font-size: 13px;
}
.fc-modal-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; }
.fc-vehicles-form,
.fc-vehicles-edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.fc-vehicles-form .full,
.fc-vehicles-edit-form .full { grid-column: 1 / -1; }
.fc-form-section {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.fc-check-label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.fc-form-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fc-form-field.full { grid-column: 1 / -1; }
.fc-form-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.fc-form-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}
.fc-form-hint-inline { margin: 0 0 6px; font-size: 12px; }
.fc-form-field-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}
.fc-form-block {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
}
.fc-form-block--fuel {
  margin-top: 4px;
  padding: 12px 14px 10px;
  border: 1px solid rgba(5, 150, 105, 0.25);
  background: rgba(5, 150, 105, 0.04);
}
.fc-form-block--fuel .fc-form-section { margin-top: 0; color: #047857; }
.fc-form-block--secondary {
  margin-top: 8px;
  padding-top: 14px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #f8fafc;
  opacity: 0.95;
}
.fc-form-section--secondary {
  margin-top: 0;
  font-size: 11px;
  color: #94a3b8;
}
.fc-readonly { background: #f1f5f9 !important; color: #475569 !important; cursor: default; }
.fuel-qr-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  grid-template-columns: 200px 1fr;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: #f8fafc;
}
.fuel-qr-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: #fff;
  border: 1px dashed var(--stroke);
  border-radius: 10px;
  padding: 8px;
}
.fuel-qr-fields { display: grid; gap: 10px; align-content: start; }
.fuel-qr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.fuel-qr-actions .fc-btn { width: auto; min-width: 120px; }
.qr-preview-empty,
.qr-preview-loading { font-size: 12px; color: var(--muted); text-align: center; padding: 8px; }
@media (max-width: 760px) {
  .fuel-qr-panel { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .fc-vehicles-main { left: 0; }
  .fc-vehicles-form,
  .fc-vehicles-edit-form { grid-template-columns: 1fr; }
}

/* —— Fuel Operations page —— */
body.fc-fuel-ops-page { background: #e8eef4; }
body.fc-fuel-ops-page .fc-main {
  flex: 1;
  min-width: 0;
  height: var(--fc-topbar-h);
  max-height: var(--fc-topbar-h);
  overflow: visible;
}
.fc-fuel-ops-main {
  position: fixed;
  top: var(--fc-topbar-h);
  left: var(--fc-sidebar-w);
  right: 0;
  bottom: 0;
  overflow: auto;
  padding: 18px 18px 24px;
  z-index: 10;
  box-sizing: border-box;
}
.fc-fuel-ops-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fc-fuel-kpi-row { margin-bottom: 2px; }
.fc-fuel-ops-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.fc-fuel-ops-toolbar input,
.fc-fuel-ops-toolbar select,
.fc-fuel-ops-toolbar .fc-btn {
  height: 38px;
  box-sizing: border-box;
}
.fc-fuel-ops-toolbar input,
.fc-fuel-ops-toolbar select {
  min-width: 140px;
  padding: 0 10px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
}
.fc-fuel-ops-toolbar input[type="date"] { min-width: 150px; }
.fc-fuel-ops-card {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.fc-fuel-ops-table-wrap { overflow: auto; }
.fc-fuel-ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.fc-fuel-ops-table th,
.fc-fuel-ops-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  text-align: left;
  vertical-align: top;
}
.fc-fuel-ops-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
}
.fc-fuel-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fc-btn--sm {
  padding: 4px 10px;
  font-size: 12px;
  min-height: 28px;
  height: auto;
}
.fc-fuel-type--refill { color: #0369a1; font-weight: 600; }
.fc-fuel-type--request { color: #7c3aed; font-weight: 600; }
.fc-fuel-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.fc-fuel-status--submitted { background: #dcfce7; color: #166534; }
.fc-din1-match { font-size: 0.8125rem; font-weight: 600; }
.fc-din1-match--matched { color: #166534; }
.fc-din1-match--pending { color: #92400e; }
.fc-din1-match--none { color: #6b7280; font-weight: 500; }
.fc-din1-match--na { color: #64748b; font-weight: 500; }
.fc-geofence { font-size: 0.8125rem; font-weight: 600; }
.fc-geofence--inside { color: #166534; }
.fc-geofence--outside { color: #b45309; }
.fc-geofence--unknown { color: #6b7280; font-weight: 500; }
.fc-geofence--muted { color: #94a3b8; font-weight: 500; }
.fc-fuel-status--needs_review { background: #fef3c7; color: #92400e; }
.fc-fuel-status--suspicious { background: #fee2e2; color: #991b1b; }
.fc-fuel-status--closed { background: #e2e8f0; color: #475569; }
.fc-fuel-empty { text-align: center; color: #64748b; padding: 24px; }
.fc-fuel-detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  font-size: 13px;
}
.fc-fuel-photo-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.fc-fuel-photo-grid img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.fc-fuel-map-modal {
  height: 320px;
  border-radius: 10px;
  overflow: hidden;
}
@media (max-width: 900px) {
  .fc-fuel-ops-main { left: 0; }
  .fc-fuel-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .fc-fuel-kpi-row { grid-template-columns: 1fr; }
}

/* Admin site map picker (Users & Drivers → Sites) */
.fc-site-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.fc-site-map-block {
  display: grid;
  gap: 8px;
}
.fc-site-map-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}
.fc-site-map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.fc-site-polygon-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fc-site-radius-wrap--muted {
  opacity: 0.55;
}
.fc-site-radius-wrap--muted input {
  pointer-events: none;
}
.fc-site-shape-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}
.fc-site-shape-pill--polygon {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}
.fc-site-map-picker {
  width: 100%;
  height: 240px;
  min-height: 180px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  z-index: 0;
}
.fc-site-map-picker.leaflet-container {
  font: inherit;
}

.fc-fuel-sync-banner,
.fc-fuel-filter-banner {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: rgba(254, 243, 199, 0.95);
  color: #92400e;
  font-size: 13px;
}
.fc-qr-clarity-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
}
.fc-qr-clarity-banner p { margin: 0; }
.fc-qr-clarity-banner--legacy {
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: rgba(254, 243, 199, 0.95);
  color: #92400e;
}
.fc-legacy-deprecated-banner .fc-legacy-readonly-note {
  margin: 6px 0 0;
  font-size: 12px;
  opacity: 0.92;
}
.fc-legacy-ops-page .fc-fuel-ops-card {
  border-color: rgba(148, 163, 184, 0.45);
}
.fc-dashboard-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.fc-stat-card-link {
  text-decoration: none;
  color: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.fc-stat-card-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--panel-shadow);
}
.fc-din1-suspicious-note {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #b91c1c;
  font-weight: 600;
}
.fc-legacy-dashboard-section {
  margin-top: 12px;
  padding: 0;
  overflow: hidden;
}
.fc-legacy-dashboard-summary {
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  color: #64748b;
  list-style: none;
}
.fc-legacy-dashboard-section .fc-panel-body {
  padding: 0 14px 14px;
}
.fc-panel-sub--legacy {
  font-size: 11px;
  opacity: 0.85;
}
.fc-qr-clarity-banner--info {
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(239, 246, 255, 0.98);
  color: #1e40af;
}
.fc-qr-clarity-note { margin-top: 8px; }
.vp-transfer-qr {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.fc-fuel-sync-warn {
  color: #b45309;
  font-size: 10px;
  font-weight: 700;
}
.fc-fuel-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 4px 0;
}
@media (max-width: 600px) {
  .fc-site-map-picker {
    height: 200px;
  }
}

/* Fuel asset map markers (shared dashboard + admin) */
.fa-asset-marker { background: transparent; border: none; }
.fa-asset-marker-shell {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.fa-asset-marker-inner {
  display: block;
  position: relative;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.22);
}
.fa-asset-marker-inner--main_tank { width: 20px; height: 24px; margin: 0 auto; }
.fa-tank-cap {
  display: block;
  width: 12px;
  height: 5px;
  margin: 0 auto;
  background: #c2410c;
  border: 1.5px solid #fff;
  border-radius: 2px 2px 0 0;
}
.fa-tank-body {
  display: block;
  width: 20px;
  height: 17px;
  background: #ea580c;
  border: 1.5px solid #fff;
  border-radius: 4px;
}
.fa-asset-marker-inner--pump {
  width: 18px;
  height: 18px;
  margin: 0 auto 1px;
  background: #d97706;
  border: 2px solid #fff;
  border-radius: 4px;
  transform: rotate(45deg);
}
.fa-asset-marker-inner--site_tank {
  width: 16px;
  height: 16px;
  margin: 0 auto 1px;
  background: #2563eb;
  border: 2px solid #fff;
  border-radius: 3px;
}
.fa-asset-marker-inner--diesel_tanker { width: 22px; height: 16px; margin: 0 auto; }
.fa-tanker-body {
  display: block;
  width: 18px;
  height: 12px;
  margin: 0 auto;
  background: #dc2626;
  border: 1.5px solid #fff;
  border-radius: 3px 6px 3px 3px;
}
.fa-tanker-wheel {
  display: block;
  width: 7px;
  height: 7px;
  margin: 1px 3px 0 auto;
  background: #1e293b;
  border: 1.5px solid #fff;
  border-radius: 50%;
}
.fa-asset-popup { min-width: 180px; font-size: 12px; }
.fa-asset-popup-title { font-weight: 600; margin-bottom: 6px; }
.fa-asset-popup-meta { display: grid; gap: 2px; margin-bottom: 8px; color: #475569; }
.fa-asset-popup-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.fleet-site-overview-pin { background: transparent; border: none; }
.fleet-site-overview-pin__wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 140px;
  padding: 2px 8px 2px 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.fleet-site-overview-pin__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--site-pin-color, #2563eb);
  border: 2px solid #fff;
  flex-shrink: 0;
}
.fleet-site-overview-pin__label {
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-asset-location-warn {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  font-size: 10px;
  font-weight: 700;
}
.fc-fuel-map-warning {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
}
.fc-map-role-subtitle {
  font-weight: 600;
  color: #334155;
}
