/* Root Variables - Ultra Premium Light Blue Logistics Palette */
:root {
  --bg-primary: #f1f5f9; /* Soft light blue-gray background */
  --bg-secondary: #ffffff; /* Pure white sidebar & headers */
  --bg-tertiary: #e2e8f0; /* Accent light gray-blue */
  --card-bg: rgba(255, 255, 255, 0.85); /* Premium light glassmorphism card */
  --border-color: rgba(37, 99, 235, 0.08); /* Clean light blue border */
  --border-focus: rgba(37, 99, 235, 0.4);
  
  --text-main: #0f172a; /* Deep charcoal blue-slate */
  --text-muted: #64748b; /* Steel blue-gray secondary text */
  --text-inverse: #ffffff;
  
  --color-cyan: #2563eb; /* Royal sapphire blue */
  --color-emerald: #059669; /* Rich forest emerald */
  --color-purple: #7c3aed; /* Soft indigo-purple */
  --color-orange: #d97706; /* Golden amber */
  --color-red: #dc2626; /* Crimson red */
  
  --font-header: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.06), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  
  /* Light Neon/Shadow Glow Effects */
  --glow-cyan: 0 0 25px rgba(37, 99, 235, 0.18);
  --glow-emerald: 0 0 25px rgba(5, 150, 105, 0.12);
  --glow-purple: 0 0 25px rgba(124, 58, 237, 0.12);
  --glow-orange: 0 0 25px rgba(217, 119, 6, 0.12);
  
  --sidebar-width: 280px;
  --header-height: 80px;
}

/* Reset & Basics */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
}

/* Ambient Glow Blobs - Light Pastel Mode */
.glow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.22;
  pointer-events: none;
  z-index: 1;
  animation: floatMotion 25s infinite alternate ease-in-out;
}
.blob-1 {
  width: 450px;
  height: 450px;
  background-color: #93c5fd; /* Soft pastel sky-blue */
  top: 5%;
  right: 10%;
}
.blob-2 {
  width: 500px;
  height: 500px;
  background-color: #c084fc; /* Soft pastel purple */
  bottom: 15%;
  left: 5%;
  animation-delay: -7s;
}
.blob-3 {
  width: 350px;
  height: 350px;
  background-color: #6ee7b7; /* Soft pastel emerald */
  top: 45%;
  left: 45%;
  animation-delay: -14s;
}

@keyframes floatMotion {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -80px) scale(1.15); }
  100% { transform: translate(-30px, 40px) scale(0.9); }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-header);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 10;
}

/* Sidebar Toggle Hamburger (Mobile only) */
.sidebar-toggle-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  margin-right: 16px;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
  background-color: var(--bg-tertiary);
  border-color: var(--color-cyan);
}

/* Sidebar Styling - Clean Light */
.sidebar {
  width: var(--sidebar-width);
  background-color: rgba(255, 255, 255, 0.85);
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 150;
  padding: 24px 16px;
  backdrop-filter: blur(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 8px 12px 24px 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--color-cyan);
  filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.3));
}

.logo-text {
  font-family: var(--font-header);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #0f172a 30%, var(--color-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-muted);
  margin-top: 4px;
  padding-left: 4px;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
  overflow-y: auto;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-header);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.menu-item:hover {
  color: var(--color-cyan);
  background-color: rgba(37, 99, 235, 0.03);
  border-color: rgba(37, 99, 235, 0.05);
}

.menu-item.active {
  color: var(--color-cyan);
  background-color: rgba(37, 99, 235, 0.06);
  border-color: rgba(37, 99, 235, 0.15);
  box-shadow: inset 0 0 8px rgba(37, 99, 235, 0.03);
}

.menu-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.menu-item:hover .menu-icon {
  transform: translateX(2px);
  color: var(--color-cyan);
}

.menu-item.active .menu-icon {
  color: var(--color-cyan);
  filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.25));
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(0,0,0,0.05);
  margin-top: 12px;
}

.status-indicator-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(37, 99, 235, 0.02);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(5, 150, 105, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(5, 150, 105, 0);
  }
}

.status-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.footer-credit {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
  z-index: 140;
}

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-width));
  transition: margin-left 0.3s ease, width 0.3s ease;
}

/* Header Styling */
.top-header {
  height: var(--header-height);
  background-color: rgba(241, 245, 249, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 10px 18px;
  border-radius: 30px;
  width: 320px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.header-search:focus-within {
  width: 400px;
  border-color: var(--border-focus);
  background-color: #ffffff;
  box-shadow: var(--glow-cyan);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.header-search input {
  background: none;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  width: 100%;
}

.header-search input::placeholder {
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.notifications-bell {
  position: relative;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.notifications-bell:hover {
  color: var(--text-main);
}

.bell-icon {
  width: 22px;
  height: 22px;
}

.bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--color-cyan);
  color: var(--text-inverse);
  font-size: 0.65rem;
  font-weight: 800;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 20px;
  border-left: 1px solid rgba(0,0,0,0.08);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  color: var(--text-inverse);
  font-family: var(--font-header);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Content Body */
.content-body {
  padding: 40px;
  flex-grow: 1;
  width: 100%;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.tab-panel.active {
  display: block;
}

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

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.panel-title {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  background: linear-gradient(to right, var(--text-main) 40%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.panel-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* Premium Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-cyan), var(--color-purple));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35), 0 0 10px rgba(124, 58, 237, 0.2);
}

.btn-secondary {
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--bg-primary);
  border-color: rgba(37, 99, 235, 0.2);
  transform: translateY(-2px);
}

.btn-danger {
  background-color: rgba(220, 38, 38, 0.05);
  border: 1px solid rgba(220, 38, 38, 0.15);
  color: var(--color-red);
}

.btn-danger:hover {
  background-color: var(--color-red);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-icon-only {
  padding: 9px;
  border-radius: 10px;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.btn-icon-only:hover {
  color: var(--text-main);
  background-color: var(--bg-primary);
  border-color: var(--text-muted);
}

.btn-icon-only.btn-delete:hover {
  color: var(--color-red);
  background-color: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.2);
}

.btn-icon-only.btn-edit:hover {
  color: var(--color-cyan);
  background-color: rgba(37, 99, 235, 0.05);
  border-color: rgba(37, 99, 235, 0.2);
}

/* Modern Glassmorphic Cards - Light Mode */
.dashboard-card, .kpi-card, .driver-card, .trip-bar-card, .grid-table-container, .filters-container {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.dashboard-card::after, .kpi-card::after, .driver-card::after, .trip-bar-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid transparent;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), transparent 60%) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask-composite: exclude;
  pointer-events: none;
}

/* KPI Dashboard Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.kpi-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: transparent;
}

.kpi-card.purple-glow:hover {
  border-color: rgba(124, 58, 237, 0.25);
  box-shadow: var(--glow-purple);
  transform: translateY(-4px);
}
.kpi-card.purple-glow::before {
  background: var(--color-purple);
}

.kpi-card.green-glow:hover {
  border-color: rgba(5, 150, 105, 0.25);
  box-shadow: var(--glow-emerald);
  transform: translateY(-4px);
}
.kpi-card.green-glow::before {
  background: var(--color-emerald);
}

.kpi-card.blue-glow:hover {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: var(--glow-cyan);
  transform: translateY(-4px);
}
.kpi-card.blue-glow::before {
  background: var(--color-cyan);
}

.kpi-card.orange-glow:hover {
  border-color: rgba(217, 119, 6, 0.25);
  box-shadow: var(--glow-orange);
  transform: translateY(-4px);
}
.kpi-card.orange-glow::before {
  background: var(--color-orange);
}

.kpi-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  border: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.kpi-card.purple-glow .kpi-icon-wrapper { color: var(--color-purple); }
.kpi-card.green-glow .kpi-icon-wrapper { color: var(--color-emerald); }
.kpi-card.blue-glow .kpi-icon-wrapper { color: var(--color-cyan); }
.kpi-card.orange-glow .kpi-icon-wrapper { color: var(--color-orange); }

.kpi-icon-wrapper svg {
  width: 24px;
  height: 24px;
}

.kpi-details {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.kpi-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value {
  font-family: var(--font-header);
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  font-weight: 800;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dashboard Body Grid */
.dashboard-body-grid {
  display: grid;
  grid-template-columns: 2fr 1.1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-card {
  padding: 24px;
  min-width: 0;
  background-color: #ffffff;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  font-family: var(--font-header);
  letter-spacing: 0.2px;
  color: var(--text-main);
}

/* Live Route Radar Tracker - Clean Light */
.map-card {
  position: relative;
}

.map-simulation-container {
  height: 380px;
  background-color: #f8fafc;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.03);
}

/* Light Radar Grid Lines */
.map-grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(37, 99, 235, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.03) 1px, transparent 1px);
  background-size: 30px 30px;
  z-index: 2;
}

/* Radar Conic Sweep Light */
.radar-sweep-line {
  position: absolute;
  width: 250%;
  height: 250%;
  top: -75%;
  left: -75%;
  background: conic-gradient(from 0deg at 50% 50%, rgba(37, 99, 235, 0.05) 0deg, transparent 80deg);
  animation: radarSweep 9s linear infinite;
  pointer-events: none;
  z-index: 3;
}

@keyframes radarSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.map-city-node {
  position: absolute;
  transform: translate(-50%, -50%);
  background-color: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
  z-index: 10;
  white-space: nowrap;
}

.map-city-node::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-cyan);
  z-index: -1;
  background-color: #ffffff;
  animation: cityPulse 2s infinite alternate;
}

@keyframes cityPulse {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
}

.live-truck-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 20;
  color: var(--color-cyan);
  transition: top 3s linear, left 3s linear;
}

.truck-marker-svg {
  filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.4));
  animation: markerPulse 1.2s infinite alternate ease-in-out;
}

@keyframes markerPulse {
  0% { transform: scale(0.95); }
  100% { transform: scale(1.15); }
}

.truck-label {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--color-cyan);
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

/* Alerts Log */
.alerts-log-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-log-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  transition: all 0.2s ease;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.alert-log-item:hover {
  transform: translateX(4px);
  background-color: var(--bg-primary);
}

.alert-log-item.warning {
  border-color: rgba(217, 119, 6, 0.15);
  background-color: rgba(217, 119, 6, 0.02);
}

.alert-log-item.danger {
  border-color: rgba(220, 38, 38, 0.15);
  background-color: rgba(220, 38, 38, 0.02);
}

.alert-log-item.info {
  border-color: rgba(37, 99, 235, 0.15);
  background-color: rgba(37, 99, 235, 0.02);
}

.alert-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  flex-shrink: 0;
}

.alert-log-item.warning .alert-icon-wrap { color: var(--color-orange); }
.alert-log-item.danger .alert-icon-wrap { color: var(--color-red); }
.alert-log-item.info .alert-icon-wrap { color: var(--color-cyan); }

.alert-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

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

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

/* Timeline Dispatches */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 380px;
  overflow-y: auto;
}

.timeline-item {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 8px;
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 24px;
  left: 12px;
  bottom: -8px;
  width: 2px;
  background-color: var(--bg-tertiary);
}

.timeline-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  border: 2px solid var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  color: var(--color-cyan);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.timeline-badge.status-delivered {
  color: var(--color-emerald);
}

.timeline-badge svg {
  width: 12px;
  height: 12px;
}

.timeline-info {
  flex-grow: 1;
  min-width: 0;
}

.timeline-title-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
  flex-wrap: wrap;
  gap: 4px;
}

.timeline-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-all;
}

.timeline-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.timeline-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Stats Grids */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

/* Progress Chart */
.stats-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.chart-bar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chart-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 500;
}

.chart-bar-label {
  color: var(--text-muted);
}

.chart-bar-val {
  color: var(--text-main);
  font-weight: 600;
}

.chart-bar-bg {
  height: 8px;
  background-color: #f1f5f9;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 4px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-purple));
  border-radius: 4px;
  width: 0;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 30px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-success {
  background-color: rgba(5, 150, 105, 0.08);
  color: var(--color-emerald);
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.badge-info {
  background-color: rgba(37, 99, 235, 0.08);
  color: var(--color-cyan);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.badge-warning {
  background-color: rgba(217, 119, 6, 0.08);
  color: var(--color-orange);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.badge-danger {
  background-color: rgba(220, 38, 38, 0.08);
  color: var(--color-red);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

/* Filters container */
.filters-container {
  padding: 16px 24px;
  margin-bottom: 24px;
  background-color: #ffffff;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-group label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.filter-select {
  background-color: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.filter-select:focus {
  border-color: var(--color-cyan);
  box-shadow: var(--glow-cyan);
}

/* Custom Table Layout */
.grid-table-container {
  overflow-x: auto;
  margin-bottom: 24px;
  background-color: #ffffff;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 800px;
}

.data-table th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-family: var(--font-header);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.data-table td {
  padding: 16px 24px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  color: var(--text-main);
}

.data-table tbody tr {
  transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
  background-color: var(--bg-primary);
}

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

.table-row-actions {
  display: flex;
  gap: 8px;
}

/* Driver directory cards */
.driver-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.driver-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  background-color: #ffffff;
}

.driver-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: var(--glow-cyan);
}

.driver-avatar-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.03);
  border: 1px solid rgba(37, 99, 235, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-cyan);
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}

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

.driver-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-id {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.driver-details-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.driver-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.driver-detail-row span:last-child {
  color: var(--text-main);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

.driver-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid rgba(0,0,0,0.05);
  padding-top: 12px;
}

/* Trips List Containers */
.trips-list-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.trip-bar-card {
  padding: 24px;
  display: grid;
  grid-template-columns: 1.2fr 2fr 1fr 1fr;
  align-items: center;
  gap: 24px;
  min-width: 0;
  background-color: #ffffff;
}

.trip-bar-card:hover {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

.trip-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.trip-id {
  font-family: var(--font-header);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-cyan);
}

.trip-cargo-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-route-visual {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-grow: 1;
  min-width: 0;
}

.route-node {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
}

.route-node.destination {
  text-align: right;
}

.route-city {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-progress-bar-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 60px;
}

.route-line-bg {
  height: 6px;
  background-color: #f1f5f9;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.route-line-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-cyan), var(--color-purple));
  border-radius: 3px;
}

.route-progress-percent {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-cyan);
  text-align: center;
}

.trip-assignments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 0;
}

.trip-assignment-row {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.trip-assignment-row span:last-child {
  color: var(--text-main);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-action-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  min-width: 0;
}

.trip-action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Modals Overlay */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 16px;
}

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

.modal-card {
  background-color: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.15);
  width: 100%;
  max-width: 600px;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
  padding: 32px;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.modal-backdrop.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding-bottom: 16px;
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.2px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--text-main);
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

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

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  background-color: #f8fafc;
  border: 1px solid rgba(0,0,0,0.08);
  color: var(--text-main);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s ease;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-cyan);
  box-shadow: var(--glow-cyan);
  background-color: #ffffff;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 20px;
}

/* Responsive Framework */
@media (max-width: 1200px) {
  .trip-bar-card {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .trip-action-panel {
    align-items: flex-start;
  }
  .trip-action-buttons {
    justify-content: flex-start;
  }
}

@media (max-width: 1024px) {
  .dashboard-body-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    box-shadow: 10px 0 35px rgba(0,0,0,0.15);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .sidebar-toggle-btn {
    display: block;
  }

  .top-header {
    padding: 0 20px;
    background-color: rgba(241, 245, 249, 0.85);
  }

  .content-body {
    padding: 24px 20px;
  }

  .dashboard-stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .header-search {
    max-width: 160px;
  }
  
  .user-info {
    display: none;
  }
  
  .trip-bar-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group.full-width {
    grid-column: span 1;
  }

  .modal-card {
    padding: 24px 16px;
  }
}
