/* ColdChain AI — Ultra-Modern Dark Logistics Command Center Theme */

:root {
  --bg-deep: #0b1120;
  --bg-sidebar: #070d19;
  --bg-surface: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --border-glass: rgba(56, 189, 248, 0.16);
  --border-glass-glow: rgba(6, 182, 212, 0.4);
  
  --cryo-cyan: #06b6d4;
  --cryo-cyan-glow: #22d3ee;
  --emerald-healthy: #10b981;
  --crimson-alert: #ef4444;
  --amber-warning: #f59e0b;
  --violet-opt: #8b5cf6;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body.dark-theme {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Typography Helpers */
.font-mono {
  font-family: var(--font-mono);
}

.text-white { color: #ffffff; }
.text-cyan { color: var(--cryo-cyan-glow); }
.text-emerald { color: var(--emerald-healthy); }
.text-crimson { color: var(--crimson-alert); }
.text-warning { color: var(--amber-warning); }
.text-violet { color: var(--violet-opt); }
.text-muted { color: var(--text-muted); }

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: rgba(56, 189, 248, 0.28);
}

/* ==========================================================================
   APP SHELL & SIDEBAR NAVIGATION
   ========================================================================== */

.app-shell {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-deep);
}

/* Fixed Left Sidebar (Width: 250px, Dark Navy #070d19) */
.app-sidebar {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(56, 189, 248, 0.15);
  display: flex;
  flex-direction: column;
  height: 100vh;
  z-index: 50;
  user-select: none;
}

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.1);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.brand-logo-glow {
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 10px;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.3);
}

.cryo-snowflake {
  width: 22px;
  height: 22px;
  color: var(--cryo-cyan-glow);
  animation: pulseRotate 12s linear infinite;
}

@keyframes pulseRotate {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(180deg) scale(1.05); }
  100% { transform: rotate(360deg); }
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.sidebar-badge-mission {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--cryo-cyan-glow);
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 5px;
  display: inline-block;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.sidebar-badge-engine {
  font-size: 0.6rem;
  color: var(--emerald-healthy);
  font-family: var(--font-mono);
  margin-top: 3px;
  letter-spacing: 0.2px;
}

/* Sidebar Navigation Items */
.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.2);
  border-radius: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  border-left: 3px solid transparent;
}

.nav-item svg {
  color: var(--text-dim);
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.6);
  border-left-color: rgba(6, 182, 212, 0.5);
}

.nav-item:hover svg {
  color: var(--cryo-cyan-glow);
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.2), rgba(15, 23, 42, 0.4));
  border-left-color: var(--cryo-cyan);
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.15);
}

.nav-item.active svg {
  color: var(--cryo-cyan-glow);
}

/* Sidebar Footer System Status */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(56, 189, 248, 0.1);
  background: rgba(7, 11, 20, 0.4);
}

.sidebar-stream-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--emerald-healthy);
  margin-bottom: 3px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--emerald-healthy);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald-healthy);
  animation: liveGlow 1.8s infinite;
}

@keyframes liveGlow {
  0% { transform: scale(0.95); box-shadow: 0 0 4px var(--emerald-healthy); }
  50% { transform: scale(1.25); box-shadow: 0 0 12px var(--emerald-healthy); }
  100% { transform: scale(0.95); box-shadow: 0 0 4px var(--emerald-healthy); }
}

.sidebar-network-meta {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ==========================================================================
   MAIN WRAPPER & TOP STATUS BAR
   ========================================================================== */

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-deep);
}

/* Top Status Bar (Height: 60px) */
.top-status-bar {
  height: 60px;
  min-height: 60px;
  background: rgba(7, 13, 25, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.12);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 40;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-status-engine {
  padding: 5px 12px;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cryo-cyan-glow);
  letter-spacing: 0.5px;
}

.badge-status-corridor {
  padding: 5px 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ist-clock-badge {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--cryo-cyan-glow);
  font-weight: 600;
  font-size: 0.8rem;
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0369a1, #0891b2);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-main);
  border-color: rgba(56, 189, 248, 0.2);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: var(--cryo-cyan);
  transform: translateY(-1px);
}

.btn-outline-cyan {
  background: transparent;
  color: var(--cryo-cyan);
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.btn-outline-cyan:hover {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--cryo-cyan-glow);
  color: #ffffff;
}

.btn-deliver {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald-healthy);
  padding: 4px 8px;
  font-size: 0.74rem;
  border-radius: 4px;
}

.btn-deliver:hover {
  background: rgba(16, 185, 129, 0.3);
  color: #ffffff;
}

.btn-boost {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: var(--cryo-cyan-glow);
  padding: 4px 8px;
  font-size: 0.74rem;
  border-radius: 4px;
}

.btn-boost:hover {
  background: rgba(6, 182, 212, 0.3);
  color: #ffffff;
}

.btn-danger-sm {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--crimson-alert);
  padding: 4px 8px;
  font-size: 0.74rem;
  border-radius: 4px;
}

.btn-danger-sm:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

/* ==========================================================================
   VIEWS CONTAINER & PANES
   ========================================================================== */

.views-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.views-container::-webkit-scrollbar {
  width: 6px;
}
.views-container::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.25);
  border-radius: 3px;
}

.view-pane {
  display: none;
}

.view-pane.active {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Pane Header Card */
.pane-header-card {
  padding: 16px 20px;
}

.pane-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.pane-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   VIEW 1: DASHBOARD
   ========================================================================== */

/* KPI Banner */
.kpi-banner {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.kpi-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.6), transparent);
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 4px 0 2px 0;
  letter-spacing: -0.5px;
}

.kpi-subtext {
  font-size: 0.72rem;
  font-weight: 500;
}

/* Dashboard Split Grid (Map + Right Side Feeds) */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: start;
}

.map-view-container {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.view-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(7, 11, 20, 0.6);
  border-bottom: 1px solid var(--border-glass);
}

.map-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}

.map-title-badge svg {
  color: var(--cryo-cyan-glow);
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-color {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.legend-cyan { background-color: var(--cryo-cyan); box-shadow: 0 0 6px var(--cryo-cyan); }
.legend-emerald { background-color: var(--emerald-healthy); box-shadow: 0 0 6px var(--emerald-healthy); }
.legend-amber { background-color: var(--amber-warning); box-shadow: 0 0 6px var(--amber-warning); }
.legend-crimson { background-color: var(--crimson-alert); box-shadow: 0 0 6px var(--crimson-alert); }

/* --- LEAFLET DARK MAP TILES & EXPLICIT HEIGHT (Clean Dark Mode, No Watermark) --- */
.leaflet-tile-pane {
  filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

.map-frame,
#leaflet-map,
#network-canvas-container {
  height: 450px !important;
  width: 100% !important;
  position: relative;
  background: #080d1a;
  overflow: hidden;
}

#leaflet-map {
  z-index: 10;
}

/* Dashboard Sidebar Column */
.dashboard-sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analytics-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title svg {
  color: var(--cryo-cyan-glow);
}

.alerts-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.alert-item {
  background: rgba(7, 11, 20, 0.7);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-left: 3px solid var(--crimson-alert);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: slideInRight 0.3s ease-out;
}

.alert-item.info {
  border-left-color: var(--cryo-cyan);
  border-color: rgba(6, 182, 212, 0.2);
}

.alert-item.warning {
  border-left-color: var(--amber-warning);
  border-color: rgba(245, 158, 11, 0.25);
}

.alert-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
}

.alert-badge {
  font-weight: 700;
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 3px;
}

.alert-item .alert-badge { background: rgba(239, 68, 68, 0.2); color: var(--crimson-alert); }
.alert-item.info .alert-badge { background: rgba(6, 182, 212, 0.2); color: var(--cryo-cyan); }
.alert-item.warning .alert-badge { background: rgba(245, 158, 11, 0.2); color: var(--amber-warning); }

.alert-msg {
  font-size: 0.75rem;
  color: var(--text-main);
  line-height: 1.3;
}

.corridors-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.corridor-item {
  background: rgba(7, 11, 20, 0.5);
  border: 1px solid rgba(56, 189, 248, 0.1);
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  transition: var(--transition-smooth);
}

.corridor-item:hover {
  border-color: rgba(6, 182, 212, 0.3);
}

/* ==========================================================================
   VIEW 2: SHIPMENT MANAGER
   ========================================================================== */

.shipment-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-pill {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.15);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-pill:hover {
  border-color: var(--cryo-cyan);
  color: var(--text-main);
}

.filter-pill.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--cryo-cyan);
  color: var(--cryo-cyan-glow);
}

.shipment-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(7, 11, 20, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  flex: 1;
  max-width: 380px;
}

.shipment-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.82rem;
  width: 100%;
}

.shipments-table-card {
  padding: 0;
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.custom-table th {
  background: rgba(7, 11, 20, 0.8);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-glass);
}

.custom-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.08);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: rgba(6, 182, 212, 0.04);
}

/* Status Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-optimal {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-healthy);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-critical {
  background: rgba(239, 68, 68, 0.15);
  color: var(--crimson-alert);
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: blinkAlert 1.2s infinite;
}

.status-boost {
  background: rgba(6, 182, 212, 0.2);
  color: var(--cryo-cyan-glow);
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.status-delivered {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Priority Badges */
.priority-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
}

.priority-lifesaving { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.4); }
.priority-expedited { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.priority-standard { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }

/* Table Progress Bar */
.progress-bar-wrap {
  width: 90px;
  height: 6px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 3px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #10b981);
  border-radius: 3px;
}

.sparkline-canvas {
  width: 100px;
  height: 28px;
  display: block;
}

/* ==========================================================================
   VIEW 3: AI ROUTE OPTIMIZER
   ========================================================================== */

.route-planner-bar {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.planner-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}

.planner-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 180px;
}

.planner-field label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-select {
  background: rgba(7, 11, 20, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.82rem;
  transition: var(--transition-smooth);
}

.form-select:focus {
  border-color: var(--cryo-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.swap-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-smooth);
  margin-bottom: 2px;
}

.swap-icon:hover {
  color: var(--cryo-cyan-glow);
  border-color: var(--cryo-cyan);
  background: rgba(6, 182, 212, 0.1);
}

.btn-compute-route {
  background: linear-gradient(135deg, #06b6d4, #10b981);
  color: #070b14;
  font-weight: 700;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.3);
  margin-bottom: 2px;
}

.btn-compute-route:hover {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.algorithm-runtime-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 14px;
  background: rgba(7, 11, 20, 0.6);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.1);
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
}

.meta-item .label {
  color: var(--text-muted);
}

.meta-item .value {
  font-weight: 700;
}

/* Playback Card */
.algorithm-playback-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.algorithm-playback-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(7, 11, 20, 0.85);
  gap: 16px;
  flex-wrap: wrap;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.78rem;
  transition: var(--transition-smooth);
}

.ctrl-btn:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--cryo-cyan);
}

.btn-play-pause {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--cryo-cyan);
  color: var(--cryo-cyan-glow);
  font-weight: bold;
}

.playback-timeline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.step-counter {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--cryo-cyan-glow);
  white-space: nowrap;
}

.step-slider {
  flex: 1;
  accent-color: var(--cryo-cyan);
  cursor: pointer;
}

.playback-speed {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.form-select-sm {
  background: rgba(7, 11, 20, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.74rem;
}

.step-explanation-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(12, 19, 34, 0.95);
  border-top: 1px solid rgba(56, 189, 248, 0.1);
}

.step-action-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--cryo-cyan-glow);
  border: 1px solid rgba(6, 182, 212, 0.3);
  white-space: nowrap;
}

.step-desc-text {
  font-size: 0.78rem;
  color: var(--text-main);
}

/* Inspector Panel */
.algorithm-inspector-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(7, 11, 20, 0.7);
  border-bottom: 1px solid var(--border-glass);
}

.inspector-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.optimal-path-indicator {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--emerald-healthy);
  font-weight: 700;
}

.inspector-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.inspector-table th {
  background: rgba(7, 11, 20, 0.6);
  color: var(--text-muted);
  padding: 9px 14px;
  font-size: 0.7rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-glass);
}

.inspector-table td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.06);
}

.inspector-table tr.current-node td {
  background: rgba(6, 182, 212, 0.1);
  color: #ffffff;
  font-weight: 700;
}

/* ==========================================================================
   VIEW 4: NETWORK GRAPH
   ========================================================================== */

.network-graph-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.network-header {
  padding: 14px 18px;
  background: rgba(7, 11, 20, 0.6);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.network-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.network-instructions {
  font-size: 0.74rem;
  color: var(--text-dim);
}

#network-canvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* ==========================================================================
   VIEW 5: COLD STORAGES
   ========================================================================== */

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

.storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.storage-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.storage-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.storage-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.storage-region {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.storage-type-badge {
  font-size: 0.66rem;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(6, 182, 212, 0.12);
  color: var(--cryo-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
  font-weight: 600;
}

.storage-capacity-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.storage-cap-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
}

.storage-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 4px;
  overflow: hidden;
}

.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #10b981);
  border-radius: 4px;
}

.storage-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  padding-top: 6px;
  border-top: 1px solid rgba(56, 189, 248, 0.08);
}

/* ==========================================================================
   VIEW 6: TEMP MONITORING
   ========================================================================== */

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

.badge-tag-nominal {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-healthy);
  border: 1px solid rgba(16, 185, 129, 0.35);
  letter-spacing: 0.5px;
}

.temp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.temp-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.temp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.temp-vehicle-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.temp-cargo-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.temp-readout-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  background: rgba(7, 11, 20, 0.6);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.1);
}

.temp-big-val {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.temp-envelope-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
}

.temp-sparkline-box {
  height: 50px;
  width: 100%;
}

.temp-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(56, 189, 248, 0.08);
}

/* ==========================================================================
   VIEW 7: AI ANALYTICS
   ========================================================================== */

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chart-container-doughnut {
  height: 260px;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.chart-container-line {
  height: 260px;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.chart-container-doughnut canvas,
.chart-container-line canvas {
  max-width: 100% !important;
  max-height: 100% !important;
  display: block;
}

/* ==========================================================================
   VIEW 8: REPORTS & EXPORT
   ========================================================================== */

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

.reports-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ==========================================================================
   VIEW 9: SETTINGS & API
   ========================================================================== */

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.settings-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(56, 189, 248, 0.08);
  font-size: 0.82rem;
}

.setting-name {
  color: var(--text-muted);
}

.api-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.api-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  padding: 8px 10px;
  background: rgba(7, 11, 20, 0.5);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.08);
}

.api-row a {
  color: var(--cryo-cyan);
  text-decoration: none;
}
.api-row a:hover {
  text-decoration: underline;
}

.badge-get {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-healthy);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
}

.badge-post {
  background: rgba(6, 182, 212, 0.2);
  color: var(--cryo-cyan-glow);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
}

.api-desc {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.72rem;
}

/* ==========================================================================
   MODALS & TOASTS
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  width: 90%;
  max-width: 580px;
  background: #0d1527;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(6, 182, 212, 0.15);
  overflow: hidden;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 14px 18px;
  background: rgba(7, 11, 20, 0.8);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: var(--crimson-alert);
}

.modal-form {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  background: rgba(7, 11, 20, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.82rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  border-color: var(--cryo-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(56, 189, 248, 0.1);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.3);
  backdrop-filter: blur(12px);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  min-width: 280px;
  max-width: 400px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: slideToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-success { border-left: 4px solid var(--emerald-healthy); }
.toast.toast-error { border-left: 4px solid var(--crimson-alert); }
.toast.toast-warning { border-left: 4px solid var(--amber-warning); }
.toast.toast-info { border-left: 4px solid var(--cryo-cyan); }

.toast-msg {
  font-size: 0.78rem;
  color: var(--text-main);
  line-height: 1.35;
}

/* Leaflet Marker Styling */
.hub-marker-div {
  position: relative;
}

.hub-core-dot {
  width: 12px;
  height: 12px;
  background: var(--cryo-cyan);
  border: 2px solid #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 6px;
  left: 6px;
  box-shadow: 0 0 10px var(--cryo-cyan);
}

.hub-pulse-ring {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.3);
  animation: hubPulse 2s infinite;
}

@keyframes hubPulse {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}
