/* ============================================ */
/* DESIGN SYSTEM - UNIFIED TOKENS */
/* ============================================ */
:root {
  /* Core Colors */
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-300: #86efac;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --green-900: #14532d;

  /* Accent Colors */
  --blue-500: #3b82f6;
  --blue-100: rgba(59, 130, 246, 0.12);
  --yellow-500: #f59e0b;
  --yellow-100: rgba(245, 158, 11, 0.12);
  --orange-500: #f97316;
  --orange-100: rgba(249, 115, 22, 0.12);
  --red-500: #ef4444;
  --red-100: rgba(239, 68, 68, 0.12);
  --purple-500: #a855f7;
  --purple-100: rgba(168, 85, 247, 0.12);

  /* Neutral Colors */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Semantic Colors */
  --bg-app: var(--green-50);
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: var(--slate-50);
  --bg-hover: var(--green-50);

  --text-primary: var(--slate-900);
  --text-secondary: var(--slate-600);
  --text-muted: var(--slate-500);
  --text-inverse: #ffffff;

  --border-default: rgba(34, 197, 94, 0.15);
  --border-strong: rgba(34, 197, 94, 0.3);
  --border-muted: var(--slate-200);

  --accent-primary: var(--green-600);
  --accent-primary-hover: var(--green-700);
  --accent-primary-light: rgba(22, 163, 74, 0.1);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(34, 197, 94, 0.15);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --sidebar-width: 280px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
  --content-max-width: 1600px;
}

/* ============================================ */
/* RESET & BASE */
/* ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-app);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ============================================ */
/* APP LAYOUT */
/* ============================================ */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ============================================ */
/* SIDEBAR */
/* ============================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width var(--transition-normal);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

/* Sidebar Header */
.sidebar-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--header-height);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}

.sidebar-brand {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sidebar.collapsed .sidebar-brand {
  display: none;
}

.sidebar-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar-subtitle {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
  background: var(--bg-hover);
  color: var(--accent-primary);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
}

.nav-section {
  margin-bottom: var(--space-4);
}

.nav-section-title {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar.collapsed .nav-section-title {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  font-weight: var(--font-semibold);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--accent-primary);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar.collapsed .nav-label {
  display: none;
}

.nav-badge {
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  border-radius: var(--radius-full);
  background: var(--red-500);
  color: white;
}

.sidebar.collapsed .nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 5px;
  font-size: 10px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border-default);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.user-profile:hover {
  background: var(--bg-hover);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--green-400), var(--green-600));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: white;
  flex-shrink: 0;
}

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

.sidebar.collapsed .user-info {
  display: none;
}

.user-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* ============================================ */
/* MAIN CONTENT AREA */
/* ============================================ */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Top Header */
.top-header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.breadcrumb-item {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.breadcrumb-item:hover {
  color: var(--accent-primary);
}

.breadcrumb-separator {
  color: var(--slate-300);
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: var(--font-medium);
}

.page-title-header {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.header-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}

.header-btn:hover {
  background: var(--bg-hover);
  color: var(--accent-primary);
}

.header-btn .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--red-500);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--green-500), var(--green-600));
  color: white;
  box-shadow: var(--shadow-sm), 0 2px 8px rgba(34, 197, 94, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--green-600), var(--green-700));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-primary-light);
}

/* Main Content */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-6);
  background: var(--bg-app);
}

.content-container {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* View Container - All views render here */
.view-container {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-container.active {
  display: block;
}

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

/* ============================================ */
/* CARDS & COMPONENTS */
/* ============================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-elevated);
}

.card-title {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.card-body {
  padding: var(--space-5);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  transition: all var(--transition-fast);
}

.stat-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-icon.green { background: var(--accent-primary-light); }
.stat-icon.blue { background: var(--blue-100); }
.stat-icon.yellow { background: var(--yellow-100); }
.stat-icon.red { background: var(--red-100); }
.stat-icon.purple { background: var(--purple-100); }

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

/* Progress Ring */
.progress-ring {
  position: relative;
  width: 80px;
  height: 80px;
}

.progress-ring svg {
  transform: rotate(-90deg);
}

.progress-ring .ring-bg {
  fill: none;
  stroke: var(--slate-200);
  stroke-width: 8;
}

.progress-ring .ring-fill {
  fill: none;
  stroke: var(--accent-primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.progress-ring .ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  font-weight: var(--font-extrabold);
  color: var(--accent-primary);
}

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: var(--slate-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-400), var(--green-600));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ============================================ */
/* HELP PANEL */
/* ============================================ */
.help-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  max-width: 92vw;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-default);
  box-shadow: var(--shadow-xl);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: right var(--transition-normal);
}

.help-panel.open {
  right: 0;
}

.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.help-overlay.open {
  opacity: 1;
  visibility: visible;
}

.help-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.help-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.help-close:hover {
  background: var(--red-100);
  color: var(--red-500);
}

.help-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}

.help-section {
  margin-bottom: var(--space-6);
}

.help-section-title {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.help-item {
  padding: var(--space-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.help-item:hover {
  background: var(--accent-primary-light);
}

.help-item-title {
  font-weight: var(--font-medium);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.help-item-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================ */
/* TOAST NOTIFICATIONS */
/* ============================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  background: var(--bg-card);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 300px;
  animation: toastIn 0.3s ease;
  border-left: 4px solid var(--accent-primary);
}

.toast.error {
  border-left-color: var(--red-500);
}

.toast.warning {
  border-left-color: var(--yellow-500);
}

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

/* ============================================ */
/* LOADING STATES */
/* ============================================ */
.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, var(--slate-100) 25%, var(--slate-200) 50%, var(--slate-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: -100%;
    height: 100vh;
    z-index: 150;
    transition: left var(--transition-normal);
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 140;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
  }

  .mobile-overlay.open {
    opacity: 1;
    visibility: visible;
  }

  .mobile-menu-btn {
    display: flex;
  }
}

@media (min-width: 1025px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* ============================================ */
/* VIEW-SPECIFIC STYLES */
/* ============================================ */

/* Dashboard View */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-5);
}

.dashboard-grid .span-8 { grid-column: span 8; }
.dashboard-grid .span-4 { grid-column: span 4; }
.dashboard-grid .span-6 { grid-column: span 6; }
.dashboard-grid .span-12 { grid-column: span 12; }

@media (max-width: 1200px) {
  .dashboard-grid .span-8,
  .dashboard-grid .span-4,
  .dashboard-grid .span-6 {
    grid-column: span 12;
  }
}

/* Campaign Card */
.campaign-card {
  border: 2px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.campaign-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.campaign-card-header {
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  cursor: pointer;
}

.campaign-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--accent-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

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

.campaign-name {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.campaign-meta {
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-1);
}

.campaign-progress {
  width: 140px;
  flex-shrink: 0;
}

.campaign-status {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.campaign-status.active {
  background: var(--accent-primary-light);
  color: var(--green-700);
}

.campaign-status.planning {
  background: var(--blue-100);
  color: var(--blue-500);
}

/* Activity Item */
.activity-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-default);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.activity-icon.complete { background: var(--accent-primary-light); }
.activity-icon.progress { background: var(--blue-100); }
.activity-icon.blocked { background: var(--red-100); }

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.activity-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.empty-state h3 {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.empty-state p {
  font-size: var(--text-sm);
  max-width: 360px;
  margin: 0 auto;
}

/* Loader */
.loader {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Quick Action Buttons */
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.quick-action-btn:hover {
  background: white;
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--gray-100);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

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

.modal-footer {
  border-top: 1px solid var(--gray-200);
}

/* Work Block Cards hover state */
.work-block-card {
  cursor: pointer;
}

/* Campaign Stats */
.campaign-stat {
  text-align: center;
}

.campaign-stat .stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.campaign-stat .stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

/* Filter Buttons */
.filter-btn {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.filter-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* Wizard Steps */
.wizard-steps {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-6);
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.wizard-step.active {
  color: var(--accent-primary);
  font-weight: var(--font-semibold);
}

.wizard-step.completed {
  color: var(--green-600);
}

.wizard-step-number {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  background: var(--gray-200);
  color: var(--text-muted);
}

.wizard-step.active .wizard-step-number {
  background: var(--accent-primary);
  color: white;
}

.wizard-step.completed .wizard-step-number {
  background: var(--green-500);
  color: white;
}

.wizard-step-connector {
  width: 40px;
  height: 2px;
  background: var(--gray-200);
}

.wizard-step.completed + .wizard-step-connector,
.wizard-step-connector.completed {
  background: var(--green-500);
}

/* Form inputs */
input, select, textarea {
  font-family: inherit;
  font-size: var(--text-base);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}

/* Text center utility */
.text-center {
  text-align: center;
}

/* ============================================ */
/* FLEET MANAGEMENT VIEW - PHASE A INTEGRATED
/* ============================================ */

/* Fleet Color Palette */
.fleet-management-page {
  --fm-primary: #22c55e;
  --fm-primary-dark: #16a34a;
  --fm-primary-light: #dcfce7;
  --fm-primary-bg: #f0fdf4;
  --fm-secondary: #f97316;
  --fm-secondary-light: #ffedd5;
  --fm-success: #22c55e;
  --fm-warning: #f59e0b;
  --fm-danger: #ef4444;
  --fm-info: #3b82f6;
  --fm-rlc-blue: #3b82f6;
  --fm-rlc-light: #dbeafe;
  --fm-gx-green: #22c55e;
  --fm-gx-light: #dcfce7;
  --fm-text: #1a1a1a;
  --fm-text-secondary: #666666;
  --fm-text-muted: #999999;
  --fm-border: #e5e5e5;
  --fm-bg: #f8f9fa;
  --fm-bg-white: #ffffff;
  --fm-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --fm-shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --fm-shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --fm-radius-sm: 4px;
  --fm-radius-md: 8px;
  --fm-radius-lg: 12px;
  --fm-radius-full: 9999px;
}

/* Fleet Management Page */
.fleet-management-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--fm-bg);
}

/* ========================================
   PAGE TOOLBAR - Integrated Portal Style
   ======================================== */
.fleet-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--fm-bg-white);
  border-bottom: 1px solid var(--fm-border);
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.fleet-page-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: var(--fm-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Company Filter Pills */
.company-pills {
  display: flex;
  background: #f0f0f0;
  padding: 4px;
  border-radius: var(--fm-radius-md);
  gap: 2px;
}

.company-pill {
  padding: 6px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: #666;
  transition: all 0.15s;
}

.company-pill:hover {
  background: rgba(255,255,255,0.7);
}

.company-pill.active {
  background: var(--fm-bg-white);
  color: var(--fm-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* RLC = Blue when active */
.company-pill[data-company="rlc"].active {
  background: var(--fm-rlc-blue);
  color: white;
}

/* GX = Green when active */
.company-pill[data-company="gx"].active {
  background: var(--fm-gx-green);
  color: white;
}

/* Toolbar Actions */
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--fm-border);
  background: var(--fm-bg-white);
  border-radius: var(--fm-radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.action-btn:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

.action-btn.primary {
  background: var(--fm-primary);
  border-color: var(--fm-primary);
  color: white;
}

.action-btn.primary:hover {
  background: var(--fm-primary-dark);
}

@media (max-width: 900px) {
  .action-btn .btn-text {
    display: none;
  }
  .action-btn {
    padding: 8px 10px;
  }
}

/* ========================================
   COMBINED TOOLBAR ROW - Stats + Filters
   ======================================== */
.fleet-toolbar-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--fm-bg);
  border-bottom: 1px solid var(--fm-border);
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Inline Stats */
.fleet-stats-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--fm-text-secondary);
}

.stat-item strong {
  color: var(--fm-text);
  font-weight: 600;
}

.stat-divider {
  color: #ddd;
}

/* Inline Filters */
.fleet-filters-inline {
  display: flex;
  gap: 10px;
}

.fleet-filters-inline select {
  padding: 7px 28px 7px 12px;
  border: 1px solid var(--fm-border);
  border-radius: var(--fm-radius-md);
  font-size: 12px;
  background: var(--fm-bg-white);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.fleet-filters-inline select:focus {
  outline: none;
  border-color: var(--fm-primary);
}

/* View Toggle Inline */
.view-toggle-inline {
  display: flex;
  margin-left: auto;
  background: var(--fm-bg-white);
  border: 1px solid var(--fm-border);
  border-radius: var(--fm-radius-md);
  overflow: hidden;
}

.view-toggle-inline .view-btn {
  padding: 7px 14px;
  border: none;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  color: var(--fm-text-secondary);
  transition: all 0.15s;
}

.view-toggle-inline .view-btn:not(:last-child) {
  border-right: 1px solid var(--fm-border);
}

.view-toggle-inline .view-btn:hover {
  background: var(--fm-bg);
}

.view-toggle-inline .view-btn.active {
  background: var(--fm-primary);
  color: white;
}

/* Drag hint tooltip (minimal) */
.drag-hint-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--fm-bg);
  color: var(--fm-text-muted);
  font-size: 12px;
  cursor: help;
  margin-left: 8px;
}

.drag-hint-tooltip:hover {
  background: #e5e5e5;
  color: var(--fm-text-secondary);
}

/* Main Content Layout */
.fleet-content {
  display: flex;
  flex: 1;
  align-items: flex-start;
}

.fleet-main {
  flex: 1;
  padding: 20px;
}

/* .fleet-sidebar defined in Part 3 below */

/* Department Sections - Polished */
.department-section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--fm-border);
}

.dept-icon {
  width: 36px;
  height: 36px;
  background: var(--fm-primary-light);
  border-radius: var(--fm-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.section-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--fm-text);
}

.vehicle-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--fm-text-muted);
  background: var(--fm-bg);
  padding: 4px 10px;
  border-radius: var(--fm-radius-full);
}

/* Vehicle Grid */
.vehicles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.vehicles-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.placeholder-text {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--fm-text-muted);
  font-style: italic;
}

/* Sidebar Placeholder */
.sidebar-placeholder {
  padding: 20px;
  text-align: center;
  color: var(--fm-text-muted);
}

/* ========================================
   VEHICLE CARDS - Part 2 Enhanced
   ======================================== */

.vehicle-card {
  position: relative;
  background: white;
  border: 2px solid #e5e5e5;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

/* Card-level drag handle - full-width grip bar at top */
.vehicle-card .card-drag-handle {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.03);
  border-bottom: 1px solid #e5e7eb;
  margin: -12px -12px 8px -12px;
  padding: 0 12px;
  width: calc(100% + 24px);
  border-radius: 10px 10px 0 0;
  cursor: grab;
  color: #c0c7d0;
  font-size: 14px;
  letter-spacing: 3px;
  z-index: 2;
  transition: all 0.15s;
  user-select: none;
  flex-shrink: 0;
}

.vehicle-card .card-drag-handle:hover {
  background: rgba(0,0,0,0.06);
  color: #6b7280;
}

.vehicle-card .card-drag-handle:active {
  cursor: grabbing;
  background: rgba(0,0,0,0.08);
  color: #374151;
}

.vehicle-card.dragging {
  opacity: 0.4;
  border: 2px dashed #f59e0b;
  transform: scale(0.95);
}

.vehicle-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

/* PHASE B: Company-specific hover colors */
.vehicle-card[data-company="rlc"]:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.vehicle-card[data-company="gx"]:hover {
  border-color: #22c55e;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.vehicle-card.selected {
  background: #f8fafc;
}

.vehicle-card[data-company="rlc"].selected {
  border-color: #3b82f6;
  background: #eff6ff;
}

.vehicle-card[data-company="gx"].selected {
  border-color: #22c55e;
  background: #f0fdf4;
}

/* PHASE B: Department-based left border colors */
.vehicle-card[data-department="lawn"],
.vehicle-card[data-department="lawn care"] {
  border-left: 4px solid #22c55e;  /* Green */
}

.vehicle-card[data-department="tree"],
.vehicle-card[data-department="tree care"] {
  border-left: 4px solid #8b5cf6;  /* Purple */
}

.vehicle-card[data-department="pest"],
.vehicle-card[data-department="pest control"] {
  border-left: 4px solid #ef4444;  /* Red */
}

.vehicle-card[data-department="irrigation"] {
  border-left: 4px solid #3b82f6;  /* Blue */
}

.vehicle-card[data-department="landscape"] {
  border-left: 4px solid #f59e0b;  /* Orange */
}

/* Status override for maintenance/down */
.vehicle-card.maintenance,
.vehicle-card.in_shop {
  border-left-color: #f59e0b !important;
}

.vehicle-card.down {
  border-left-color: #991b1b !important;
}

/* Company Badge */
.company-badge {
  position: absolute;
  top: 34px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  z-index: 1;
}

/* PHASE B: CORRECT COLORS - RLC = BLUE, GX = GREEN */
.company-badge.rlc {
  background: #dbeafe;  /* Light blue */
  color: #1d4ed8;       /* Dark blue text */
  border: 1px solid #93c5fd;
}

.company-badge.gx, .company-badge.greenx {
  background: #dcfce7;  /* Light green */
  color: #166534;       /* Dark green text */
  border: 1px solid #86efac;
}

/* Status Indicators */
.status-indicators {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.indicator {
  font-size: 12px;
}

.indicator.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.indicator.dot.active { background: #22c55e; }
.indicator.dot.spare { background: #f59e0b; }
.indicator.dot.maintenance { background: #ef4444; }
.indicator.dot.down { background: #991b1b; }
.indicator.dot.in_shop { background: #f59e0b; }

/* PHASE B: Wash Indicator */
.wash-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.wash-indicator.needs-wash {
  background: #fee2e2;
  animation: pulse-wash 2s infinite;
}

.wash-indicator.wash-due {
  background: #fef3c7;
}

.wash-indicator.wash-ok {
  background: #dcfce7;
  font-size: 8px;
  color: #166534;
}

@keyframes pulse-wash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Truck Icon */
.truck-icon {
  width: 80px;
  height: 50px;
  margin: 16px auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.truck-svg {
  width: 100%;
  height: 100%;
}

/* PHASE B: Truck SVG colors - RLC = BLUE, GX = GREEN */
.truck-svg.rlc { color: #3b82f6; }  /* Blue */
.truck-svg.gx, .truck-svg.greenx { color: #22c55e; }  /* Green */

/* Truck Number */
.truck-number {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
}

/* Year/Make Info */
.truck-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.year-make {
  font-size: 12px;
  color: #666;
}

.age-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  color: white;
}

.age-badge.age-new { background: #22c55e; }
.age-badge.age-medium { background: #f59e0b; }
.age-badge.age-old { background: #ef4444; }

/* Equipment Section */
.equipment-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  min-height: 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.equipment-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  font-size: 10px;
  color: #333;
  transition: all 0.2s;
  position: relative;
}

.equipment-chip .chip-grip {
  color: #ccc;
  font-size: 9px;
  letter-spacing: -2px;
  cursor: grab;
  padding: 0 2px;
  user-select: none;
  transition: color 0.15s;
}

.equipment-chip .chip-grip:hover {
  color: #888;
}

.equipment-chip .chip-grip:active {
  cursor: grabbing;
  color: #555;
}

.equipment-chip.dragging {
  opacity: 0.4;
  border-style: dashed;
  border-color: #3b82f6;
}

.eq-icon {
  font-size: 10px;
}

.eq-name {
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-equipment {
  font-size: 10px;
  color: #666;
  font-style: italic;
}

.no-equipment {
  font-size: 11px;
  color: #aaa;
  font-style: italic;
  padding: 8px 0;
}

/* Equipment Section - drop zone for equipment */
.equipment-section {
  transition: all 0.2s;
  border: 2px solid transparent;
}

.equipment-section.drag-over {
  background: #eff6ff;
  border: 2px dashed #3b82f6;
}

/* Tech Section */
.tech-section {
  margin-top: auto;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.tech-section.unassigned {
  border: 2px dashed #d1d5db;
  background: #fafafa;
}

.tech-section.drag-over {
  border: 2px dashed #22c55e !important;
  background: #f0fdf4;
}

.tech-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
  border-radius: 20px;
  cursor: default;
  transition: all 0.2s;
}

.tech-chip .chip-grip {
  color: #86efac;
  font-size: 10px;
  letter-spacing: -2px;
  cursor: grab;
  padding: 0 2px;
  user-select: none;
  transition: color 0.15s;
}

.tech-chip .chip-grip:hover {
  color: #22c55e;
}

.tech-chip .chip-grip:active {
  cursor: grabbing;
  color: #166534;
}

.tech-chip.dragging {
  opacity: 0.4;
  border-style: dashed;
  border-color: #22c55e;
}

.tech-chip:hover {
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.2);
}

/* Sidebar drop zones - highlight when items can be dropped back */
.sidebar-section.drop-target-zone {
  border: 2px dashed transparent;
  border-radius: 8px;
  transition: all 0.2s;
}

.sidebar-section.drop-target-zone.drag-over {
  border-color: #f59e0b;
  background: #fffbeb;
}

.sidebar-section .drop-back-hint {
  display: none;
  text-align: center;
  padding: 8px;
  color: #f59e0b;
  font-size: 11px;
  font-weight: 600;
}

.sidebar-section.drop-target-zone.active .drop-back-hint {
  display: block;
}

.tech-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}

.tech-name {
  font-size: 12px;
  font-weight: 500;
  color: #166534;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-placeholder {
  font-size: 11px;
  color: #aaa;
  padding: 14px 10px;
  text-align: center;
  width: 100%;
}

/* ========================================
   VIEW MODES
   ======================================== */

/* Normal view (default) */
.vehicles-grid.normal {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

/* Compact view */
.vehicles-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.vehicles-grid.compact .vehicle-card {
  min-height: 160px;
  padding: 8px;
}

.vehicles-grid.compact .truck-icon {
  width: 60px;
  height: 35px;
  margin: 12px auto 4px;
}

.vehicles-grid.compact .truck-number {
  font-size: 16px;
}

.vehicles-grid.compact .truck-info {
  margin-bottom: 8px;
}

.vehicles-grid.compact .equipment-section {
  display: none;
}

.vehicles-grid.compact .tech-section {
  min-height: 36px;
}

.vehicles-grid.compact .tech-chip {
  padding: 4px 8px;
}

.vehicles-grid.compact .tech-avatar {
  width: 22px;
  height: 22px;
  font-size: 8px;
}

.vehicles-grid.compact .tech-name {
  font-size: 11px;
  max-width: 60px;
}

/* List view */
.vehicles-grid.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vehicles-grid.list .vehicle-card {
  flex-direction: row;
  align-items: center;
  min-height: auto;
  padding: 12px 16px;
  gap: 16px;
  flex-wrap: nowrap;
}

.vehicles-grid.list .card-drag-handle {
  display: none;
}

.vehicles-grid.list .company-badge {
  position: static;
  flex-shrink: 0;
  order: -1;
}

.vehicles-grid.list .status-indicators {
  position: static;
  flex-shrink: 0;
  order: 10;
}

.vehicles-grid.list .truck-icon {
  width: 50px;
  height: 30px;
  margin: 0;
  flex-shrink: 0;
}

.vehicles-grid.list .truck-number {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  min-width: 60px;
  text-align: left;
  flex-shrink: 0;
}

.vehicles-grid.list .truck-info {
  margin: 0;
  min-width: 100px;
  flex-shrink: 0;
}

.vehicles-grid.list .equipment-section {
  flex: 1;
  margin: 0;
  min-height: auto;
  padding: 4px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.vehicles-grid.list .tech-section {
  margin: 0;
  min-height: auto;
  min-width: 140px;
  flex-shrink: 0;
}

/* ========================================
   SIDEBAR - Part 3 (Polished)
   ======================================== */

.fleet-sidebar {
  width: 300px;
  background: var(--fm-bg-white, white);
  border-left: 1px solid var(--fm-border, #e5e5e5);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 120px);
  align-self: flex-start;
}

.sidebar-section {
  border-bottom: 1px solid var(--fm-border, #e5e5e5);
}

.sidebar-section:last-child {
  border-bottom: none;
  flex: 1;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--fm-bg, #f8f9fa);
  border-bottom: 1px solid var(--fm-border, #e5e5e5);
  position: sticky;
  top: 0;
}

.sidebar-icon {
  width: 28px;
  height: 28px;
  background: var(--fm-bg-white, white);
  border-radius: var(--fm-radius-sm, 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: var(--fm-shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
}

.sidebar-header h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--fm-text, #1a1a1a);
  flex: 1;
}

.count-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  background: var(--fm-primary, #22c55e);
  color: white;
  border-radius: var(--fm-radius-full, 9999px);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.count-badge.warning {
  background: var(--fm-warning, #f59e0b);
}

.count-badge.danger {
  background: var(--fm-danger, #ef4444);
}

.sidebar-content {
  padding: 12px;
  max-height: calc(25vh - 40px);
  min-height: 80px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Sidebar Items - Polished */
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--fm-bg-white, white);
  border: 1px solid var(--fm-border, #e5e5e5);
  border-radius: var(--fm-radius-md, 8px);
  cursor: grab;
  transition: all 0.15s;
}

.sidebar-item:hover {
  background: var(--fm-primary-bg, #f0fdf4);
  border-color: var(--fm-primary, #22c55e);
  transform: translateX(2px);
}

.sidebar-item:active {
  cursor: grabbing;
}

.sidebar-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.sidebar-item .item-icon {
  font-size: 18px;
  width: 32px;
  text-align: center;
}

.sidebar-item .item-details {
  flex: 1;
  min-width: 0;
}

.sidebar-item .item-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--fm-text, #1a1a1a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item .item-meta {
  display: block;
  font-size: 11px;
  color: var(--fm-text-secondary, #666);
}

.sidebar-item .item-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fm-success, #22c55e);
}

.sidebar-item .item-status.maintenance {
  width: auto;
  height: auto;
  background: transparent;
}

.sidebar-item .status-text {
  font-size: 10px;
  color: var(--fm-warning, #f59e0b);
  font-weight: 500;
}

/* Tech Avatar in Sidebar */
.tech-avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Maintenance Item */
.maintenance-item {
  cursor: pointer;
  border-left: 3px solid var(--fm-warning, #f59e0b);
}

.maintenance-item:hover {
  background: #fffbeb;
  border-color: var(--fm-warning, #f59e0b);
}

/* Empty State - Polished */
.sidebar-empty-message {
  text-align: center;
  padding: 24px 16px;
  color: var(--fm-text-muted, #999);
  font-size: 12px;
  font-style: italic;
}

/* Drop Target Highlight */
.drop-target {
  position: relative;
}

.drop-target::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px dashed #22c55e;
  border-radius: inherit;
  background: rgba(34, 197, 94, 0.05);
  pointer-events: none;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Vehicle card drag over state */
.vehicle-card.drag-over {
  border-color: #22c55e;
  background: #f0fdf4;
  transform: scale(1.02);
}

/* Responsive - Fleet Management (Phase A integrated) */
@media (max-width: 1200px) {
  .fleet-sidebar {
    width: 260px;
  }
}

@media (max-width: 1000px) {
  .fleet-page-toolbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .fleet-toolbar-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
  }

  .view-toggle-inline {
    margin-left: 0;
    width: 100%;
  }

  .view-toggle-inline .view-btn {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 900px) {
  .fleet-content {
    flex-direction: column;
  }

  .fleet-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--fm-border, #e5e5e5);
    flex-direction: row;
    height: auto;
    position: static;
    max-height: none;
    align-self: auto;
  }

  .sidebar-section {
    flex: 1;
    border-bottom: none;
    border-right: 1px solid var(--fm-border, #e5e5e5);
  }

  .sidebar-section:last-child {
    border-right: none;
  }

  .sidebar-content {
    max-height: 180px;
    min-height: 60px;
  }

  .action-btn .btn-text {
    display: none;
  }

  .fleet-stats-inline {
    flex-wrap: wrap;
    gap: 8px;
  }

  .stat-divider {
    display: none;
  }

  .fleet-filters-inline {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .fleet-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .view-toggle {
    margin-left: 0;
  }

  .vehicles-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .vehicle-card {
    padding: 10px;
  }

  .vehicle-card .vehicle-number {
    font-size: 14px;
  }
}

/* ===== Vehicle Detail Slide-Out Panel ===== */
.detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.detail-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  background: #fff;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
  transform: translateX(0);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 1001;
}
.detail-overlay.hidden .detail-panel {
  transform: translateX(100%);
}
.panel-header {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  z-index: 1;
}
.panel-close {
  width: 36px;
  height: 36px;
  border: none;
  background: #f3f4f6;
  border-radius: 8px;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.panel-close:hover {
  background: #e5e7eb;
}
.panel-title h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}
.panel-title p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 14px;
}
.panel-content {
  padding: 20px;
}
.panel-section {
  margin-bottom: 24px;
}
.panel-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.info-item {
  background: #f9fafb;
  padding: 12px;
  border-radius: 8px;
}
.info-item span {
  display: block;
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.info-item strong {
  font-size: 14px;
  color: #111827;
}
.panel-tech-assigned {
  padding: 12px;
  background: #f0fdf4;
  border-radius: 8px;
  color: #166534;
  font-weight: 500;
}
.panel-tech-unassigned {
  padding: 12px;
  background: #fef3c7;
  border-radius: 8px;
  color: #92400e;
}
.panel-eq-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 8px;
}
.panel-eq-item strong {
  font-size: 14px;
}
.panel-eq-item .eq-serial {
  color: #6b7280;
  font-size: 12px;
}
.panel-eq-empty {
  padding: 12px;
  color: #6b7280;
  text-align: center;
  font-style: italic;
}
.panel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #6b7280;
}
.panel-error {
  padding: 20px;
  text-align: center;
  color: #dc2626;
}
.panel-error button {
  margin-top: 12px;
  padding: 8px 16px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
}
/* Panel edit/form styles */
.panel-actions {
  display: flex;
  gap: 8px;
  padding: 0 20px 16px;
}
.panel-actions .btn-edit {
  flex: 1;
  padding: 10px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.panel-actions .btn-edit:hover { background: #2563eb; }
.panel-actions .btn-save {
  flex: 1;
  padding: 10px;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.panel-actions .btn-save:hover { background: #16a34a; }
.panel-actions .btn-cancel {
  flex: 1;
  padding: 10px;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.panel-actions .btn-cancel:hover { background: #e5e7eb; }
.panel-form-group {
  margin-bottom: 14px;
}
.panel-form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.panel-form-group input,
.panel-form-group select,
.panel-form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
}
.panel-form-group textarea {
  min-height: 60px;
  resize: vertical;
}
.panel-form-group input:focus,
.panel-form-group select:focus,
.panel-form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}
.panel-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.panel-form-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.panel-form-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.panel-form-toggle label {
  margin: 0;
  font-size: 14px;
  color: #374151;
  text-transform: none;
  cursor: pointer;
}
/* Modal form styles (reuse same patterns) */
.modal-form-group {
  margin-bottom: 16px;
}
.modal-form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}
.modal-form-group input,
.modal-form-group select,
.modal-form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}
.modal-form-group textarea {
  min-height: 60px;
  resize: vertical;
}
.modal-form-group input:focus,
.modal-form-group select:focus,
.modal-form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}
.modal-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-form-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.modal-form-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
@media (max-width: 768px) {
  .detail-panel {
    width: 100vw;
    max-width: 100vw;
  }
}

/* ===== Drag Handle Styles ===== */
.sidebar-item .drag-handle {
  width: 36px;
  min-width: 36px;
  height: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-right: 1px solid #e5e7eb;
  border-radius: 7px 0 0 7px;
  margin: -10px 0 -10px -12px;
  cursor: grab;
  color: #9ca3af;
  font-size: 14px;
  letter-spacing: -3px;
  transition: all 0.15s;
  flex-shrink: 0;
}
.sidebar-item .drag-handle:hover {
  background: #e5e7eb;
  color: #6b7280;
}
.sidebar-item .drag-handle:active {
  cursor: grabbing;
  background: #d1d5db;
}
.sidebar-item.dragging {
  opacity: 0.4;
  border: 2px dashed #22c55e;
  transform: scale(0.95);
}
.sidebar-item .item-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  min-width: 0;
}

/* ============================================ */
/* SMALL PHONE (480px) */
/* ============================================ */
@media (max-width: 480px) {
  .content-container {
    padding: 8px !important;
  }

  .dashboard-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 12px;
    font-size: 14px;
  }

  .vehicles-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .vehicles-grid.compact {
    grid-template-columns: 1fr !important;
  }

  .vehicle-card {
    font-size: 14px;
  }

  .campaign-card-header {
    padding: 12px;
  }

  .campaign-card-body {
    padding: 12px;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
    margin-bottom: 6px;
  }

  .action-btn span:last-child {
    display: inline !important;
  }

  .fleet-page-toolbar {
    flex-direction: column;
    gap: 8px;
  }

  .fleet-filters-inline {
    flex-wrap: wrap;
    gap: 6px;
  }

  .help-panel {
    width: 100vw;
    max-width: 100vw;
  }

  .top-header {
    padding: 8px 12px;
  }

  .page-title-header h2 {
    font-size: 1.1rem;
  }

  .breadcrumb {
    font-size: 0.8rem;
  }
}
