/* 
=================================
TRACKSY PRO - SISTEMA DE DISEÑO
Repartidor PWA - Versión Profesional 2025
=================================
*/

:root {
  /* TEMA CLARO (DEFAULT) */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --shadow-color: rgba(0, 0, 0, 0.1);

  /* Texto sobre fondos de color */
  --text-on-primary: #ffffff;
  --text-on-surface: #0f172a;
  --text-on-dark: #ffffff;
}

/* ===== CDN FALLBACK STYLES ===== */
.cdn-fallback-mode {
  /* Estilos para cuando los CDNs están bloqueados */
  --cdn-fallback-indicator: 1;
}

.fa-to-bi-active .fas {
  /* Forzar uso de Bootstrap Icons cuando FontAwesome está bloqueado */
  font-family: "bootstrap-icons" !important;
}

#cdn-fallback-notice {
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== SWEETALERT2 OVERRIDES ===== */
/* Asegurar que SweetAlert2 funcione correctamente en todos los temas */
.swal2-container {
  z-index: 10000 !important;
}

.swal2-popup {
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xl) !important;
}

.swal2-title {
  color: var(--text-primary) !important;
}

.swal2-content {
  color: var(--text-secondary) !important;
}

.swal2-input,
.swal2-textarea {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
}

.swal2-input:focus,
.swal2-textarea:focus {
  border-color: var(--primary-500) !important;
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25) !important;
  outline: none !important;
}

.swal2-confirm {
  background: var(--primary-600) !important;
  color: var(--text-on-primary) !important;
  border: none !important;
  border-radius: var(--radius-md) !important;
  padding: 0.75rem 1.5rem !important;
  font-weight: 600 !important;
}

.swal2-confirm:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25) !important;
}

.swal2-cancel {
  background: var(--bg-secondary) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.75rem 1.5rem !important;
  font-weight: 600 !important;
}

.swal2-cancel:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--border-color), 0.5) !important;
}

/* Tema oscuro específico */
[data-theme="dark"] .swal2-popup {
  background: var(--bg-primary) !important;
  border: 1px solid var(--border-color) !important;
}

/* TEMA OSCURO */
[data-theme="dark"] {
  --bg-primary: #0a0f1c;
  --bg-secondary: #1a2332;
  --bg-tertiary: #2a3441;
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-tertiary: #cbd5e1;
  --border-color: #3a4553;
  --border-light: #2a3441;
  --surface: #1a2332;
  --surface-elevated: #2a3441;
  --shadow-color: rgba(0, 0, 0, 0.5);

  /* Texto sobre fondos de color - en tema oscuro */
  --text-on-primary: #ffffff;
  --text-on-surface: #f8fafc;
  --text-on-dark: #f8fafc;
}

/* ===== TRANSICIONES SUAVES PARA TEMA ===== */
*,
*::before,
*::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

:root {

  /* COLORES PRINCIPALES */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-200: #bbf7d0;
  --success-300: #86efac;
  --success-400: #4ade80;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;
  --success-800: #166534;
  --success-900: #14532d;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-200: #fde68a;
  --warning-300: #fcd34d;
  --warning-400: #fbbf24;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;
  --warning-800: #92400e;
  --warning-900: #78350f;

  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-200: #fecaca;
  --danger-300: #fca5a5;
  --danger-400: #f87171;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;
  --danger-800: #991b1b;
  --danger-900: #7f1d1d;

  /* ESCALA DE GRISES */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* GRADIENTES - Optimizados para tema claro */
  --gradient-primary: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
  --gradient-success: linear-gradient(135deg, var(--success-500) 0%, var(--success-700) 100%);
  --gradient-warning: linear-gradient(135deg, var(--warning-500) 0%, var(--warning-700) 100%);
  --gradient-danger: linear-gradient(135deg, var(--danger-500) 0%, var(--danger-700) 100%);
  --gradient-hero: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 50%, var(--primary-900) 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.08) 100%);

  /* Gradientes adicionales para elementos específicos */
  --gradient-success-light: linear-gradient(135deg, #f0fdf4, #dcfce7);
  --gradient-warning-light: linear-gradient(135deg, #fff7ed, #fed7aa);
  --gradient-error: linear-gradient(90deg, #dc3545 0%, #e74c3c 100%);
  --gradient-orange: linear-gradient(90deg, #fd7e14 0%, #e67e22 100%);

  /* SOMBRAS */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);

  /* TIPOGRAFÍA */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'Cascadia Code', monospace;

  /* ESPACIADO */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* BORDER RADIUS */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 2rem;
  --radius-full: 9999px;

  /* TRANSICIONES */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 300ms ease-in-out;
}

/* TEMA OSCURO */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --border-color: #334155;
  --border-light: #475569;
  --surface: #1e293b;
  --surface-elevated: #334155;
  --shadow-color: rgba(0, 0, 0, 0.3);

  /* Colores ajustados para tema oscuro - más claros y vibrantes */
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;

  /* Gradientes optimizados para tema oscuro */
  --gradient-primary: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-hero: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 50%, var(--primary-800) 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);

  /* Gradientes adicionales para tema oscuro */
  --gradient-success-light: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
  --gradient-warning-light: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.1));
  --gradient-error: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
  --gradient-orange: linear-gradient(90deg, #f97316 0%, #ea580c 100%);

  /* Texto sobre fondos de color - en tema oscuro */
  --text-on-primary: #ffffff;
  --text-on-surface: #f8fafc;
  --text-on-dark: #f8fafc;

  /* Ajustes para tema oscuro - (gradient-glass ya definido arriba) */

  /* Sombras más intensas para modo oscuro */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

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

html {
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary) !important;
  color: var(--text-primary);
  overflow-x: hidden;
  overflow-y: auto !important;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  min-height: 100vh;
  height: auto !important;
  max-height: none !important;
}

/* Mobile scroll fix */
@media (max-width: 768px) {

  html,
  body {
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-primary) !important;
  }
}

/* Asegurar que todos los contenedores principales usen el fondo del tema */
.app-container,
.app-content,
.container-fluid,
.tab-content,
.tab-content.active {
  background: var(--bg-primary) !important;
  color: var(--text-primary);
}

/* Forzar scroll en mobile para todos los contenedores */
@media (max-width: 768px) {

  body,
  html {
    overflow-y: auto !important;
    height: auto !important;
    max-height: none !important;
    position: relative !important;
  }

  .app-container,
  .tab-content,
  .tab-content.active,
  #app,
  #deliveries,
  #profile {
    overflow-y: visible !important;
    max-height: none !important;
    height: auto !important;
    position: relative !important;
    min-height: auto !important;
  }

  /* FORZAR que el contenido pueda crecer más allá de 100vh */
  .app-container {
    min-height: auto !important;
    height: auto !important;
    max-height: none !important;
  }

  /* Debug: agregar scroll visible a todos los contenedores */
  * {
    -webkit-overflow-scrolling: touch !important;
  }
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-content {
  text-align: center;
  color: var(--text-on-primary);
}

.logo-container {
  width: 5rem;
  height: 5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.logo-container i {
  font-size: 2.5rem;
}

.logo-container img {
  border-radius: var(--radius-lg);
  object-fit: contain;
}

.loading-content h2 {
  font-weight: 800;
  font-size: 2rem;
  margin-bottom: var(--space-2);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-8);
}

.loading-dots span {
  width: 0.75rem;
  height: 0.75rem;
  background: var(--surface);
  border-radius: var(--radius-full);
  animation: loadingDots 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes loadingDots {

  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== APP CONTAINER ===== */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--gray-50);
}

/* Mobile app container fix */
@media (max-width: 768px) {
  .app-container {
    min-height: 100vh;
  }
}

/* ===== HEADER ===== */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  padding-top: var(--safe-area-top);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  height: 100%;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary-600);
}

.header-brand i {
  font-size: 1.5rem;
}

.header-brand img {
  border-radius: var(--radius-md);
  object-fit: contain;
}

.app-version {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: monospace;
  margin-left: 4px;
  opacity: 0.8;
}

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

.header-btn {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.header-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: scale(1.05);
}

.header-btn:active {
  transform: scale(0.95);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-normal);
  cursor: pointer;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: scale(1.05);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle .theme-icon {
  position: absolute;
  font-size: 1.1rem;
  transition: all var(--transition-normal);
}

.theme-toggle .sun-icon {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

.theme-toggle .moon-icon {
  transform: rotate(180deg) scale(0);
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  transform: rotate(-180deg) scale(0);
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  transform: rotate(0deg) scale(1);
  opacity: 1;
}

.notification-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--danger-500);
  color: var(--text-on-primary);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: var(--space-2) var(--space-4);
  padding-bottom: calc(var(--space-2) + var(--safe-area-bottom));
  height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
  z-index: 30;
  box-shadow: var(--shadow-lg);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border: none;
  background: none;
  color: var(--gray-500);
  transition: all var(--transition-base);
  cursor: pointer;
  border-radius: var(--radius-lg);
  min-width: 3.5rem;
}

.nav-item i {
  font-size: 1.25rem;
  transition: transform var(--transition-base);
}

.nav-item span {
  font-size: 0.75rem;
  font-weight: 500;
}

.nav-item.active {
  color: var(--primary-600);
  background: var(--primary-50);
}

.nav-item.active i {
  transform: scale(1.1);
}

.nav-item:not(.active):hover {
  color: var(--gray-700);
  background: var(--gray-100);
}

/* ===== MAIN CONTENT ===== */
.app-content {
  flex: 1;
  padding-bottom: var(--bottom-nav-height);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-content {
  display: none;
  padding: var(--space-6) 0;
  background-color: var(--bg-primary);
}

.tab-content.active {
  display: block;
  animation: fadeInUp 0.3s ease-out;
}

/* Mobile tab content optimization */
@media (max-width: 768px) {
  .tab-content {
    padding: var(--space-4) var(--space-3);
    padding-bottom: 8rem;
    /* Extra space for bottom navigation */
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }

  /* Específicamente para entregas y perfil */
  #deliveries,
  #profile {
    overflow-y: auto !important;
    height: auto !important;
    max-height: none !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* ===== STATUS CARD ===== */
.status-card {
  background: var(--gradient-hero);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  margin: 0 var(--space-6) var(--space-8);
  color: var(--text-on-primary);
  position: relative;
  overflow: hidden;
}

.status-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-glass);
  pointer-events: none;
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
  position: relative;
  z-index: 1;
}

.status-info h3 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: var(--space-1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.status-info p {
  opacity: 0.9;
  font-weight: 500;
}

.status-avatar {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.status-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-metrics {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  position: relative;
  z-index: 1;
}

.metric {
  text-align: center;
  flex: 1;
}

.metric-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.metric-label {
  font-size: 0.875rem;
  opacity: 0.9;
  font-weight: 500;
  margin-top: var(--space-1);
}

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 var(--space-6) var(--space-4);
}

.section-header h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.section-header i {
  color: var(--primary-600);
}

.btn-link {
  color: var(--primary-600);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  background: none;
  cursor: pointer;
  transition: color var(--transition-base);
}

.btn-link:hover {
  color: var(--primary-700);
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: 0 var(--space-6) var(--space-8);
}

.action-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

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

.action-card:active {
  transform: translateY(0);
}

.action-icon {
  width: 3rem;
  height: 3rem;
  background: var(--primary-100);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
}

.action-icon i {
  font-size: 1.5rem;
}

.action-info {
  text-align: center;
}

.action-info h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.action-info p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ===== DELIVERIES LIST ===== */
.deliveries-list {
  margin: 0 var(--space-6);
}

.delivery-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.delivery-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-500);
}

.delivery-card.completed::before {
  background: var(--success-500);
}

.delivery-card.pending::before {
  background: var(--warning-500);
}

.delivery-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-200);
}

.delivery-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-3);
}

.delivery-info h5 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.delivery-address {
  color: var(--text-secondary);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.delivery-status {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.delivery-status.completed {
  background: var(--success-100);
  color: var(--success-700);
}

.delivery-status.pending {
  background: var(--warning-100);
  color: var(--warning-700);
}

.delivery-status.in-progress {
  background: var(--primary-100);
  color: var(--primary-700);
}

.delivery-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--gray-100);
}

.delivery-packages {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.delivery-time {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* ===== FILTER TABS ===== */
.filter-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  margin: 0 var(--space-6) var(--space-6);
}

.filter-tab {
  flex: 1;
  padding: var(--space-2) var(--space-4);
  border: none;
  background: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-base);
  cursor: pointer;
}

.filter-tab.active {
  background: var(--surface);
  color: var(--primary-600);
  box-shadow: var(--shadow-sm);
}

/* ===== MAP VIEW ===== */
.map-container {
  margin: 0 var(--space-6);
}

.map-view {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  height: 25rem;
  position: relative;
  overflow: hidden;
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray-500);
}

.map-placeholder i {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  color: var(--primary-400);
}

.map-placeholder h4 {
  font-weight: 600;
  margin-bottom: var(--space-2);
}

/* ===== PROFILE SECTION ===== */
.profile-header {
  text-align: center;
  margin: 0 var(--space-6) var(--space-8);
}

.profile-avatar {
  position: relative;
  width: 5rem;
  height: 5rem;
  margin: 0 auto var(--space-4);
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 4px solid var(--bg-primary);
  box-shadow: var(--shadow-lg);
}

.avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 2rem;
  height: 2rem;
  background: var(--primary-600);
  border: 2px solid var(--bg-primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-primary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.avatar-edit:hover {
  background: var(--primary-700);
  transform: scale(1.1);
}

.profile-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.profile-header p {
  color: var(--text-secondary);
}

.profile-options {
  margin: 0 var(--space-6);
}

.option-group {
  margin-bottom: var(--space-8);
}

.option-group h5 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.option-item {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: left;
}

.option-item:hover {
  border-color: var(--primary-200);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.option-item.danger {
  border-color: var(--danger-200);
  color: var(--danger-700);
}

.option-item.danger:hover {
  border-color: var(--danger-300);
  background: var(--danger-50);
}

.option-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.option-item.danger .option-icon {
  background: var(--danger-100);
  color: var(--danger-600);
}

.option-content {
  flex: 1;
}

.option-content span {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.option-content small {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.option-item.danger .option-content span {
  color: var(--danger-700);
}

.option-item>i:last-child {
  color: var(--gray-400);
  font-size: 1.25rem;
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: var(--space-6);
}

.login-content {
  width: 100%;
  max-width: 24rem;
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-10);
  color: var(--text-on-primary);
}

.login-logo {
  width: 4rem;
  height: 4rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.login-logo i {
  font-size: 2rem;
}

.login-logo img {
  border-radius: var(--radius-lg);
  object-fit: contain;
}

.login-header h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--space-2);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.login-header p {
  opacity: 0.9;
  font-weight: 500;
}

.login-form {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-2xl);
}

/* ===== BIOMETRIC SECTION ===== */
.biometric-section {
  margin-bottom: var(--space-8);
}

.traditional-section {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.show-traditional {
  width: 100%;
  padding: var(--space-3);
  background: transparent;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  color: var(--neutral-600);
  font-weight: 500;
  transition: all 0.2s ease;
  margin-top: var(--space-4);
}

.show-traditional:hover {
  background: var(--neutral-50);
  border-color: var(--neutral-400);
}

.biometric-btn {
  width: 100%;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  color: var(--text-on-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.biometric-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.biometric-btn:active {
  transform: translateY(0);
}

.biometric-icon {
  width: 3rem;
  height: 3rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.biometric-icon i {
  font-size: 1.5rem;
}

.biometric-text {
  text-align: left;
}

.biometric-text h4 {
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.biometric-text p {
  opacity: 0.9;
  font-size: 0.875rem;
}

.divider {
  position: relative;
  text-align: center;
  margin: var(--space-6) 0;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gray-300);
}

.divider span {
  background: rgba(255, 255, 255, 0.95);
  padding: 0 var(--space-4);
  color: var(--gray-500);
  font-size: 0.875rem;
  position: relative;
}

/* ===== FORM STYLES ===== */
.form-group {
  margin-bottom: var(--space-6);
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group i {
  position: absolute;
  left: var(--space-4);
  color: var(--gray-400);
  z-index: 1;
}

.input-group input {
  width: 100%;
  padding: var(--space-4) var(--space-12) var(--space-4) var(--space-12);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-xl);
  font-size: 1rem;
  transition: all var(--transition-base);
  background: var(--surface);
  outline: none;
}

.input-group input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px var(--primary-100);
}

.password-toggle {
  position: absolute;
  right: var(--space-4);
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: var(--space-2);
  z-index: 1;
}

.password-toggle:hover {
  color: var(--text-secondary);
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-8);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.checkbox-label input {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.forgot-password {
  color: var(--primary-600);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
}

.forgot-password:hover {
  color: var(--primary-700);
}

.login-btn {
  width: 100%;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-6);
  color: var(--text-on-primary);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ===== SPINNER ===== */
.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: var(--space-2);
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* ===== SETUP BIOMETRIC ===== */
.setup-biometric {
  text-align: center;
  margin-top: var(--space-8);
}

.setup-info {
  margin-bottom: var(--space-8);
}

.setup-info i {
  font-size: 3rem;
  color: var(--primary-600);
  margin-bottom: var(--space-4);
}

.setup-info h4 {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.setup-info p {
  color: var(--text-secondary);
}

.setup-btn {
  width: 100%;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-6);
  color: var(--text-on-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  margin-bottom: var(--space-3);
}

.setup-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.skip-btn {
  width: 100%;
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-6);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
}

.skip-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

/* ===== 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: 60;
  padding: var(--space-6);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 24rem;
  max-height: 90vh;
  overflow: hidden;
  animation: modalSlideUp 0.3s ease-out;
}

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

.modal-header h4 {
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 2rem;
  height: 2rem;
  border: none;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.modal-close:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(2rem) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== UTILITIES ===== */
.text-center {
  text-align: center;
}

.d-none {
  display: none !important;
}

.d-flex {
  display: flex;
}

.align-items-center {
  align-items: center;
}

.justify-content-between {
  justify-content: space-between;
}

.w-100 {
  width: 100%;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .action-card {
    flex-direction: row;
    text-align: left;
  }

  .status-metrics {
    gap: var(--space-2);
  }

  .metric-value {
    font-size: 1.5rem;
  }

  .login-content {
    padding: var(--space-4);
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
  /* Dark mode styles can be added here in the future */
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* 
=================================
DELIVERY MANAGEMENT
Gestión de Entregas y Preparación
=================================
*/

/* Loading State */
.delivery-loading {
  padding: 3rem 1rem;
  text-align: center;
}

.delivery-loading .spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Active Delivery */
.delivery-active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.delivery-header-card {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  color: var(--text-on-primary);
  box-shadow: var(--shadow-lg);
}

.delivery-status .badge {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.delivery-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat-item {
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1rem;
  backdrop-filter: blur(10px);
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

/* Delivery Stops */
.delivery-stops {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.stops-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stop-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.stop-item:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-sm);
}

.stop-item.pending {
  border-left: 4px solid var(--warning-500);
  background: var(--warning-50);
}

.stop-item.delivered {
  border-left: 4px solid var(--success-500);
  background: var(--success-50);
}

.stop-item.incident {
  border-left: 4px solid var(--danger-500);
  background: var(--danger-50);
}

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

.stop-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.stop-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.stop-status {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.stop-status.pending {
  background: var(--warning-100);
  color: var(--warning-700);
}

.stop-status.delivered {
  background: var(--success-100);
  color: var(--success-700);
}

.stop-status.incident {
  background: var(--danger-100);
  color: var(--danger-700);
}

.stop-address {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.stop-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

.stop-packages,
.stop-time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stop-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: fit-content;
}

/* Delivery Footer */
.delivery-footer {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

/* Preparation Form */
.delivery-prepare {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.prepare-header {
  text-align: center;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.prepare-info {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.info-card i {
  font-size: 1.125rem;
}

/* Stops Preparation */
.stops-preparation {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Accordion Styles for Preparation */
.accordion-item {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg) !important;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.accordion-item:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Hover acordeón - tema oscuro */
[data-theme="dark"] .accordion-item:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.accordion-button {
  background: var(--surface) !important;
  border: none !important;
  padding: 1.5rem !important;
  font-weight: 600;
  box-shadow: none !important;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  color: var(--text-primary) !important;
}

/* Botón acordeón - tema oscuro */
[data-theme="dark"] .accordion-button {
  background: #1e293b !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .accordion-button:focus {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
}

.accordion-button:not(.collapsed) {
  background: var(--primary-50) !important;
  color: var(--primary-700) !important;
}

/* Acordeón activo - tema oscuro */
[data-theme="dark"] .accordion-button:not(.collapsed) {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
  border-color: rgba(59, 130, 246, 0.3);
}

.accordion-button.has-packages {
  background: var(--success-50) !important;
  color: var(--success-700) !important;
  border-left: 4px solid var(--success-500) !important;
}

/* Acordeón con packages - tema oscuro */
[data-theme="dark"] .accordion-button.has-packages {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #4ade80 !important;
  border-left: 4px solid #22c55e !important;
}

.accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23666'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e") !important;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

/* Interfaz de Cantidad de Bultos */
.bultos-input-section {
  background: var(--surface-elevated);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  text-align: center;
}

.bultos-input-section h6 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-weight: 600;
}

/* Interfaz de Bultos por Departamentos */
.bultos-departamentos {
  background: var(--surface-elevated);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.bultos-departamentos h6 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-weight: 600;
  text-align: center;
  font-size: 1rem;
}

.info-adicional {
  margin-top: 1.5rem;
}

.info-adicional .info-section {
  margin-bottom: 1rem;
}

/* Grid de departamentos */
.departamentos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.departamento-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.departamento-card:hover {
  box-shadow: 0 4px 12px var(--shadow-color);
  border-color: var(--primary-300);
}

.departamento-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex: 1;
}

.departamento-header i {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-700) !important;
  font-size: 1.2rem;
  background: var(--primary-100) !important;
  border-radius: 8px;
  padding: 6px;
}

.departamento-titulo {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

/* Controles de bultos dentro de las cards */
.departamento-card .bultos-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: auto;
}

.departamento-card .bultos-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  background: var(--surface);
  color: var(--text-primary) !important;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 0 2px 4px var(--shadow-color);
}

.departamento-card .bultos-btn:hover {
  border-color: var(--primary-500);
  color: var(--primary-700) !important;
  background: var(--primary-100) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px var(--shadow-color);
}

.departamento-card .bultos-input {
  width: 50px !important;
  height: 36px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  border: 2px solid var(--border-color) !important;
  border-radius: 8px;
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: none;
}

.departamento-card .bultos-input:focus {
  border-color: var(--primary-500) !important;
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25) !important;
  outline: none;
}

/* Estilos para el header de paradas */
.parada-header-content {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

.parada-numero {
  background: var(--primary-600);
  color: var(--text-on-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

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

.parada-cliente {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.parada-cliente i {
  color: var(--primary-600) !important;
  width: 14px;
}

.parada-direccion {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.parada-direccion i {
  color: var(--text-primary) !important;
  width: 14px;
  flex-shrink: 0;
}

.parada-stats {
  flex-shrink: 0;
}

.parada-stats .badge {
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.parada-stats .badge i {
  font-size: 0.75rem;
}

/* Asegurar visibilidad de iconos FontAwesome */
.fas,
.fa {
  color: inherit !important;
}

/* Iconos específicos con mayor contraste */
.bultos-btn .fas {
  color: var(--text-primary) !important;
  font-weight: 900 !important;
}

.departamento-header .fas {
  color: var(--primary-700) !important;
  font-weight: 900 !important;
}

@media (max-width: 768px) {
  .departamentos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .departamento-card {
    padding: 0.75rem;
    min-height: 100px;
  }

  .departamento-header i {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  .departamento-titulo {
    font-size: 0.85rem;
  }

  .departamento-card .bultos-btn {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }

  .departamento-card .bultos-input {
    width: 45px !important;
    height: 32px;
    font-size: 1rem;
  }

  .parada-header-content {
    gap: 0.75rem;
  }

  .parada-numero {
    width: 35px;
    height: 35px;
    font-size: 0.8rem;
  }

  .parada-cliente {
    font-size: 0.9rem;
  }

  .parada-direccion {
    font-size: 0.8rem;
  }
}

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

  .departamento-card {
    min-height: 90px;
  }
}

.parada-details {
  padding: 1.5rem;
  background: var(--surface);
  color: var(--text-primary);
}

.info-section {
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-500);
}

.info-section:last-child {
  margin-bottom: 0;
}

.info-section h6 {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-section h6 i {
  color: var(--primary-600) !important;
  width: 16px;
}

.info-section p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 500;
}

.accordion-button:not(.collapsed)::after {
  transform: rotate(180deg);
}

.stop-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.stop-main-info {
  flex: 1;
  text-align: left;
}

.stop-main-info strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

.stop-main-info .text-muted {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.stop-packages-summary {
  margin-left: 1rem;
}

.packages-count-badge {
  background: var(--gray-100);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.packages-count-badge.has-packages {
  background: var(--success-100);
  color: var(--success-700);
  border-color: var(--success-200);
  animation: pulse 0.5s ease;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.accordion-body {
  padding: 0 !important;
  background: var(--surface) !important;
}

/* Departments Grid */
.departments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  background: var(--surface);
}

.department-control {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.department-control:hover {
  background: var(--surface);
  border-color: var(--primary-200);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.department-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.department-label::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-400);
}

.department-label[data-dept="blisters"]::before {
  background: #3b82f6;
}

.department-label[data-dept="pedidos"]::before {
  background: #10b981;
}

.department-label[data-dept="receta"]::before {
  background: #f59e0b;
}

.department-label[data-dept="estupes"]::before {
  background: #ef4444;
}

.department-label[data-dept="nevera"]::before {
  background: #06b6d4;
}

.department-label[data-dept="otros"]::before {
  background: #6b7280;
}

/* Bultos Control - Estilo mejorado */
.bultos-control {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: var(--surface);
  border: 2px solid var(--gray-200);
  transition: all 0.2s ease;
  width: 100%;
}

.bultos-control:hover {
  border-color: var(--primary-300);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.bultos-control:focus-within {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.bultos-btn {
  background: var(--gray-50);
  border: none;
  color: var(--text-secondary);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 3rem;
  font-size: 1.2rem;
  font-weight: 600;
  position: relative;
}

.bultos-btn:hover {
  background: var(--primary-50);
  color: var(--primary-600);
  transform: scale(1.05);
}

.bultos-btn:active {
  background: var(--primary-100);
  transform: scale(0.95);
}

.bultos-btn.bultos-minus {
  border-right: 1px solid var(--gray-200);
}

.bultos-btn.bultos-minus:hover {
  background: var(--red-50);
  color: var(--red-600);
}

.bultos-btn.bultos-plus {
  border-left: 1px solid var(--gray-200);
}

.bultos-btn.bultos-plus:hover {
  background: var(--green-50);
  color: var(--green-600);
}

.bultos-input {
  border: none !important;
  padding: 1rem !important;
  text-align: center !important;
  font-weight: 600 !important;
  font-size: 1.1rem !important;
  min-width: 4.5rem;
  flex: 1;
  background: white !important;
  transition: all 0.2s ease;
  box-shadow: none !important;
  color: var(--gray-800) !important;
}

.bultos-input:focus {
  outline: none !important;
  background: var(--primary-50) !important;
  color: var(--primary-700) !important;
}

.bultos-input.quantity-updated {
  background: var(--primary-50) !important;
  color: var(--primary-700) !important;
}

.bultos-input.quantity-increased {
  animation: quantityIncrease 0.4s ease;
}

.bultos-input.quantity-decreased {
  animation: quantityDecrease 0.4s ease;
}

@keyframes quantityIncrease {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
    background: var(--green-100) !important;
    color: var(--green-700) !important;
  }

  100% {
    transform: scale(1);
  }
}

@keyframes quantityDecrease {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.9);
    background: var(--orange-100) !important;
    color: var(--orange-700) !important;
  }

  100% {
    transform: scale(1);
  }
}

.stop-preparation-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.2s ease;
}

.stop-preparation-card:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-md);
}

.stop-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.stop-info {
  flex: 1;
}

.stop-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: var(--text-primary);
}

.stop-address {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.stop-summary {
  text-align: right;
}

.packages-count {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--gray-100);
  transition: all 0.2s ease;
}

.packages-count.has-packages {
  background: var(--primary-100);
  color: var(--primary-700);
}

/* Legacy styles for compatibility */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  padding: 1rem 1.5rem 1.5rem 1.5rem;
}

.package-control {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.package-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin: 0;
}

.quantity-control {
  display: flex;
  align-items: stretch;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.quantity-btn {
  background: var(--gray-50);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 2.5rem;
}

.quantity-btn:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.quantity-btn:active {
  background: var(--gray-200);
  transform: scale(0.95);
}

.quantity-btn.minus {
  border-right: none;
}

.quantity-btn.plus {
  border-left: none;
}

.quantity-input {
  border: 1px solid var(--border-color);
  border-left: none;
  border-right: none;
  padding: 0.5rem;
  text-align: center;
  font-weight: 500;
  font-size: 0.875rem;
  width: 3rem;
  background: var(--surface);
  transition: all 0.2s ease;
}

.quantity-input:focus {
  outline: none;
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.quantity-input.quantity-updated {
  background: var(--primary-50);
  border-color: var(--primary-300);
}

.quantity-input.quantity-increased {
  animation: quantityIncrease 0.3s ease;
}

.quantity-input.quantity-decreased {
  animation: quantityDecrease 0.3s ease;
}

/* Preparation Summary */
.preparation-summary {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.summary-header h6 {
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Summary styling mejorado */
.preparation-summary {
  margin: 2rem 0;
}

.summary-card {
  background: var(--surface-elevated);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 2rem;
  transition: all 0.3s ease;
}

.summary-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.summary-item {
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.summary-item::after {
  content: '';
  position: absolute;
  right: -1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 60%;
  background: var(--border-color);
}

.summary-item:last-child::after {
  display: none;
}

.summary-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-on-primary);
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.summary-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.summary-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Responsive summary */
@media (max-width: 768px) {
  .summary-card {
    padding: 1.5rem;
    gap: 1.5rem;
    grid-template-columns: repeat(3, 1fr);
  }

  .summary-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .summary-number {
    font-size: 1.75rem;
  }

  .summary-label {
    font-size: 0.75rem;
  }

  .summary-item::after {
    display: none;
  }

  .summary-item {
    gap: 0.5rem;
  }
}

/* Preparation Summary Styles */
.preparation-summary-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

.summary-header {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.summary-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

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

.stat-icon {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  color: #6c757d;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.paradas-summary {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

.parada-summary-card {
  border: 1px solid #e9ecef;
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.parada-summary-card:hover {
  border-color: #dee2e6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.parada-summary-card.no-bultos {
  border-color: #ffc107;
  background: #fff8e1;
}

.parada-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.parada-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.parada-order {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #007bff;
  color: var(--text-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.parada-details {
  flex: 1;
}

.parada-nombre {
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.25rem;
}

.parada-direccion {
  color: #6c757d;
  font-size: 0.9rem;
}

.parada-bultos-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-filled {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.badge-empty {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.parada-bultos-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e9ecef;
}

.bulto-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 0.85rem;
}

.dept-name {
  flex: 1;
  margin-left: 0.5rem;
}

.dept-quantity {
  font-weight: 600;
  color: #007bff;
  background: var(--surface);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
}

.parada-empty {
  color: #856404;
  font-style: italic;
  text-align: center;
  padding: 0.75rem;
  background: #fff8e1;
  border-radius: 6px;
  margin-top: 0.75rem;
}

.summary-actions {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.stat-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1.25rem;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

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

.stat-icon i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: #6c757d;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-stat {
  text-align: center;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.summary-stat .stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.summary-stat .stat-number.text-primary {
  color: var(--primary-600) !important;
}

.summary-stat .stat-number.text-success {
  color: var(--success-600) !important;
}

.summary-stat .stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.summary-departments {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-200);
}

.summary-subtitle {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin: 0 0 0.75rem 0;
}

.departments-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  width: 100%;
}

.dept-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.dept-name {
  color: var(--text-secondary);
}

.dept-count {
  font-weight: 600;
  color: var(--primary-600);
}

/* Preparation Actions */
.preparation-actions {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

/* Error States */
.no-stops-available,
.delivery-error {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.no-stops-available i {
  color: var(--gray-400);
  margin-bottom: 1rem;
}

/* Confirmation Modal Styles */
.confirmation-details {
  margin-top: 1rem;
  max-height: 200px;
  overflow-y: auto;
}

.stop-confirmation {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
}

.stop-confirmation:last-child {
  border-bottom: none;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .delivery-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stop-item {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .stop-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .stop-actions {
    flex-direction: row;
    justify-content: stretch;
  }

  .packages-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

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

  .departments-grid {
    grid-template-columns: 1fr 1fr;
  }

  .prepare-info {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

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

  .departments-grid {
    grid-template-columns: 1fr;
  }

  .quantity-control {
    max-width: 140px;
    margin: 0 auto;
  }
}

/* ===== BULTOS CARDS ===== */
.bultos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.bulto-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

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

.bulto-header {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.bulto-details {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.bulto-description {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.bulto-peso,
.bulto-dim {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
}

/* ===== LOGIN FORM EXCEPTION ===== */
/* Los formularios de login mantienen colores claros incluso en tema oscuro */
[data-theme="dark"] .login-form,
[data-theme="dark"] .auth-container,
[data-theme="dark"] .login-container {
  background: #ffffff !important;
  color: #0f172a !important;
}

[data-theme="dark"] .login-form .input-group input,
[data-theme="dark"] .auth-container .input-group input,
[data-theme="dark"] .login-container .input-group input {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}

[data-theme="dark"] .login-form .input-group input:focus,
[data-theme="dark"] .auth-container .input-group input:focus,
[data-theme="dark"] .login-container .input-group input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
}

[data-theme="dark"] .login-form .input-group i,
[data-theme="dark"] .auth-container .input-group i,
[data-theme="dark"] .login-container .input-group i,
[data-theme="dark"] .login-form .password-toggle,
[data-theme="dark"] .auth-container .password-toggle,
[data-theme="dark"] .login-container .password-toggle {
  color: #64748b !important;
}

[data-theme="dark"] .login-form label,
[data-theme="dark"] .auth-container label,
[data-theme="dark"] .login-container label,
[data-theme="dark"] .login-form .form-text,
[data-theme="dark"] .auth-container .form-text,
[data-theme="dark"] .login-container .form-text {
  color: #475569 !important;
}

/* ===== MEJORAS CONTRASTE TEMA OSCURO ===== */
[data-theme="dark"] .action-card,
[data-theme="dark"] .delivery-card,
[data-theme="dark"] .option-item {
  border: 1px solid #3a4553 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .action-card:hover,
[data-theme="dark"] .delivery-card:hover,
[data-theme="dark"] .option-item:hover {
  border-color: #4a5563 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

/* ===== DELIVERY PREPARATION STYLES ===== */
.paradas-container {
  margin-bottom: var(--space-6);
  max-height: none;
  overflow: visible;
}

.action-buttons {
  margin: var(--space-4) 0;
  padding: 0 var(--space-3);
}

.action-buttons .btn {
  border-radius: var(--radius-lg);
  font-weight: 600;
  padding: var(--space-4) var(--space-6);
  transition: all 0.2s ease;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .tab-content {
    padding: var(--space-4) var(--space-3);
    padding-bottom: calc(var(--bottom-nav-height) + var(--space-3));
    min-height: auto;
  }

  .action-buttons {
    margin: var(--space-4) 0;
    padding: 0;
  }

  .app-content {
    padding-bottom: var(--bottom-nav-height);
  }

  .paradas-container {
    margin-bottom: var(--space-4);
  }
}

/* ===== DELIVERY INTERFACE STYLES ===== */
.delivery-stats-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: var(--space-4) 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.stat-item {
  padding: var(--space-2);
}

.stat-item i {
  font-size: 1.5rem;
  margin-bottom: var(--space-2);
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.deliveries-container {
  margin: var(--space-4) 0;
}

.deliveries-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.delivery-item {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.2s ease;
}

.delivery-item:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-md);
}

.delivery-header-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
}

.delivery-info h4 {
  margin: 0 0 var(--space-1) 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
}

.delivery-info .address {
  margin: 0 0 var(--space-2) 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.delivery-info .address i {
  margin-right: var(--space-1);
}

.bultos-info {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.bultos-info i {
  margin-right: var(--space-1);
}

.delivery-status-icon {
  flex-shrink: 0;
  margin-left: var(--space-3);
}

.delivery-status-icon i {
  font-size: 1.5rem;
}

.delivery-actions {
  padding: 0 var(--space-4) var(--space-4) var(--space-4);
  border-top: 1px solid var(--border-light);
  background: var(--bg-secondary);
}

.action-buttons-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.delivery-completed,
.delivery-incidence {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-light);
  background: var(--bg-secondary);
}

.completed-info small,
.incidence-info small {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Estado específico para delivery items */
.delivery-item.entregado {
  border-left: 4px solid var(--success-500);
}

.delivery-item.incidencia {
  border-left: 4px solid var(--danger-500);
}

.delivery-item.pendiente {
  border-left: 4px solid var(--warning-500);
}

/* Mobile optimizations for delivery interface */
@media (max-width: 768px) {
  .delivery-header-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .delivery-status-icon {
    margin-left: 0;
    margin-top: var(--space-2);
    align-self: flex-end;
  }

  .action-buttons-row {
    flex-direction: column;
  }

  .action-buttons-row .btn {
    width: 100%;
  }

  .stat-item {
    padding: var(--space-1);
  }

  .stat-number {
    font-size: 1.5rem;
  }
}

/* ===== NUEVAS TARJETAS DE ENTREGA MODERNAS ===== */

.delivery-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  transition: all 0.2s ease;
  overflow: hidden;
  position: relative;
}

.delivery-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--warning-500);
  transition: background-color 0.2s ease;
}

.delivery-card.entregado::before {
  background: var(--success-500);
}

.delivery-card.incidencia::before {
  background: var(--danger-500);
}

.delivery-card-content {
  padding: var(--space-3);
  cursor: pointer;
  position: relative;
}

.delivery-card-content:hover {
  background: var(--bg-tertiary);
}

.delivery-card.pendiente .delivery-card-content:active {
  transform: scale(0.98);
}

.delivery-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.delivery-card-info {
  flex: 1;
  min-width: 0;
  padding-right: var(--space-4);
  /* Espacio para el botón de opciones */
}

.delivery-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.delivery-card-address {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin: 2px 0 0;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.delivery-card-bultos {
  margin-top: 4px;
}

.bultos-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px var(--space-2);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}


.delivery-status {
  font-size: 1.5rem;
}

.btn-options {
  background: none;
  border: none;
  padding: var(--space-1);
  border-radius: var(--radius-md);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.btn-options.card-options-top {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 10;
  background: var(--surface-elevated);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px var(--shadow-color);
}

.btn-options:hover {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.btn-options.card-options-top:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-options:active {
  transform: scale(0.95);
}

/* Estado de la tarjeta (entregado/incidencia) */
.delivery-card-status {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-light);
}

.delivery-card-status.delivered {
  background: linear-gradient(135deg, var(--success-50) 0%, transparent 100%);
  margin: var(--space-2) calc(-1 * var(--space-3)) calc(-1 * var(--space-3));
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--success-200);
}

.delivery-card-status.incidence {
  background: linear-gradient(135deg, var(--danger-50) 0%, transparent 100%);
  margin: var(--space-2) calc(-1 * var(--space-3)) calc(-1 * var(--space-3));
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--danger-200);
}

.status-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.status-notes {
  margin: var(--space-1) 0 0;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-style: italic;
}

/* Menú de opciones desplegable */
.options-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.options-menu.show {
  opacity: 1;
}

.options-menu-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
}

.options-menu-content {
  position: absolute;
  background: var(--surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px var(--shadow-color);
  min-width: 200px;
  overflow: hidden;
  transform: translateY(-10px);
  transition: transform 0.2s ease;
}

.options-menu.show .options-menu-content {
  transform: translateY(0);
}

.options-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: left;
}

.options-menu-item:hover {
  background: var(--bg-tertiary);
}

.options-menu-item:active {
  background: var(--bg-secondary);
}

.options-menu-item i {
  font-size: 1.1rem;
  width: 16px;
  display: flex;
  justify-content: center;
}

/* Tema oscuro para el menú */
[data-theme="dark"] .delivery-card-status.delivered {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, transparent 100%);
  border-top-color: rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .delivery-card-status.incidence {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, transparent 100%);
  border-top-color: rgba(239, 68, 68, 0.3);
}

/* Responsivo para tarjetas */
@media (max-width: 768px) {
  .delivery-card {
    margin-bottom: var(--space-1);
  }

  .delivery-card-content {
    padding: var(--space-2);
  }

  .delivery-card-header {
    gap: var(--space-1);
    align-items: center;
  }

  .delivery-card-title {
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.1;
  }

  .delivery-card-address {
    font-size: 0.75rem;
    margin: 1px 0 0;
    line-height: 1.1;
    color: var(--text-tertiary);
  }

  .delivery-card-bultos {
    margin-top: 2px;
  }

  .bultos-badge {
    font-size: 0.7rem;
    padding: 0 var(--space-1);
    height: 16px;
  }

  .delivery-status {
    font-size: 1rem;
  }

  .btn-options {
    width: 20px;
    height: 20px;
    padding: 0;
  }

  .delivery-card-status {
    margin-top: var(--space-1);
    padding-top: var(--space-1);
  }

  .delivery-card-status.delivered,
  .delivery-card-status.incidence {
    margin: var(--space-1) calc(-1 * var(--space-2)) calc(-1 * var(--space-2));
    padding: var(--space-1) var(--space-2);
  }

  .status-notes {
    font-size: 0.7rem;
  }

  .card-options-top {
    top: 6px;
    right: 6px;
    padding: 4px;
    width: 28px;
    height: 28px;
  }

  .options-menu-content {
    right: var(--space-3) !important;
    min-width: 160px;
  }

  .options-menu-item {
    padding: var(--space-2) var(--space-3);
    font-size: 0.85rem;
  }
}

/* ===================================
   DELIVERY STEPS MODAL
   =================================== */

.delivery-steps-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.delivery-steps-modal.show {
  opacity: 1;
  visibility: visible;
}

.delivery-steps-modal .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.delivery-steps-content {
  position: relative;
  background: var(--bg-primary);
  margin: 20px auto;
  max-width: 600px;
  max-height: 90vh;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  z-index: 100000;
}

.delivery-wizard-content {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 100000;
  overflow: hidden;
  margin: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
}

.delivery-steps-modal.show .delivery-steps-content {
  transform: translateY(0);
}

.delivery-steps-modal.show .delivery-wizard-content {
  transform: translateY(0);
}

/* ===================================
   WIZARD PROGRESS BAR
   =================================== */

.wizard-progress {
  padding: var(--space-4) var(--space-4) var(--space-3);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.progress-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: var(--space-3);
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.step-indicators {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.step-indicator:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 60%;
  right: -40%;
  height: 2px;
  background: var(--border-color);
  z-index: 1;
}

.step-indicator.completed:not(:last-child)::after {
  background: var(--primary-color);
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 2px solid var(--border-color);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.step-indicator.active .step-number {
  background: var(--primary-color);
  color: var(--text-on-primary);
  border-color: var(--primary-color);
}

.step-indicator.completed .step-number {
  background: var(--success-color);
  color: var(--text-on-primary);
  border-color: var(--success-color);
}

.step-label {
  font-size: 0.75rem;
  margin-top: var(--space-1);
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
}

.step-indicator.active .step-label {
  color: var(--primary-color);
  font-weight: 600;
}

.step-indicator.completed .step-label {
  color: var(--success-color);
}

/* ===================================
   WIZARD STEPS
   =================================== */

.wizard-step {
  display: none;
  padding: var(--space-4);
  animation: fadeInUp 0.3s ease;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

.wizard-step.active {
  display: flex;
  flex-direction: column;
}

.wizard-step h4 {
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  font-size: 1.25rem;
}

.step-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-description {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  font-size: 1rem;
  line-height: 1.5;
}

/* Fullscreen optimizations */
.delivery-wizard-content {
  /* Asegurar que ocupe toda la pantalla */
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

/* Smooth scrolling for content */
.wizard-step {
  scroll-behavior: smooth;
}

/* Better touch targets for mobile */
.wizard-footer .btn {
  min-height: 48px;
  font-size: 1rem;
}

.step-number {
  min-width: 32px;
  min-height: 32px;
}

/* ===================================
   DELIVERY SUMMARY (STEP 1)
   =================================== */

.delivery-summary h4,
.delivery-summary h5 {
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.delivery-summary h5 {
  margin-top: var(--space-4);
  font-size: 1.1rem;
}

.bultos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
}

.bulto-summary-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
}

.bulto-summary-item i {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.bulto-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.bulto-count {
  background: var(--primary-color);
  color: var(--text-on-primary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.delivery-notes-display {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  border-left: 4px solid var(--warning-color);
}

.delivery-notes-display h6 {
  margin: 0 0 var(--space-2) 0;
  color: var(--text-primary);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.delivery-notes-display p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ===================================
   PHOTO CAPTURE (STEP 2)
   =================================== */

.photo-capture-wizard {
  text-align: center;
}

.photo-area {
  min-height: 300px;
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: var(--space-3);
  width: 100%;
}

.photo-placeholder p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 1rem;
}

.photo-preview {
  padding: var(--space-3);
}

.photo-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-md);
}

.photo-actions {
  margin-top: var(--space-3);
}

/* ===================================
   SIGNATURE CAPTURE (STEP 3)
   =================================== */

.signature-capture-wizard {
  text-align: center;
}

.signature-area-wizard {
  position: relative;
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  background: white;
  margin: var(--space-3) 0;
  overflow: hidden;
  flex: 1;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.signature-area-wizard canvas {
  display: block;
  width: 100%;
  height: 200px;
  cursor: crosshair;
  background: white;
}

.signature-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  pointer-events: none;
  background: rgba(248, 250, 252, 0.9);
}

.signature-placeholder p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 1rem;
}

.signature-controls {
  text-align: center;
  margin-top: var(--space-2);
}

/* ===================================
   FINAL STEP (STEP 4)
   =================================== */

.final-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.delivery-confirmation {
  background: var(--bg-secondary);
  padding: var(--space-3);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
}

.confirmation-checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.check-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
}

.check-item i {
  font-size: 1.1rem;
}

/* ===================================
   WIZARD FOOTER
   =================================== */

.wizard-footer {
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: center;
}

.wizard-footer .btn {
  min-width: 100px;
}

.delivery-steps-content .modal-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: var(--bg-primary);
  position: relative;
  z-index: 10;
}

.delivery-wizard-content .modal-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: var(--bg-primary);
  position: relative;
  z-index: 10;
  min-height: 70px;
}

.delivery-steps-content .modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.delivery-steps-content .modal-header h3 i {
  margin-right: var(--space-2);
  color: var(--primary-color);
}

.delivery-steps-content .btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
}

.delivery-steps-content .btn-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.delivery-steps-content .modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 300px;
}

.delivery-wizard-content .modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  background: var(--bg-primary);
}

.delivery-address {
  background: var(--bg-secondary);
  padding: var(--space-3);
  border-radius: var(--border-radius-sm);
  margin-bottom: var(--space-4);
  border-left: 4px solid var(--primary-color);
}

.delivery-address strong {
  color: var(--text-primary);
  font-size: 1rem;
  display: block;
  margin-bottom: var(--space-1);
}

.delivery-address small {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Steps */
.delivery-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.step-item {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: all 0.2s ease;
}

.step-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.step-header {
  display: flex;
  align-items: center;
  padding: var(--space-3);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  gap: var(--space-3);
}

.step-number {
  width: 32px;
  height: 32px;
  background: var(--primary-color);
  color: var(--text-on-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.step-info {
  flex: 1;
}

.step-info h4 {
  margin: 0 0 4px 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.step-info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.step-status {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.step-content {
  padding: var(--space-3);
}

/* Signature Canvas */
.signature-area {
  text-align: center;
}

.signature-area canvas {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-primary);
  cursor: crosshair;
  max-width: 100%;
  height: auto;
}

.signature-controls {
  margin-top: var(--space-2);
}

/* Photo Capture */
.photo-capture {
  text-align: center;
}

.photo-preview {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-secondary);
}

/* Modal Footer */
.delivery-steps-content .modal-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  flex-shrink: 0;
}

.delivery-wizard-content .modal-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  flex-shrink: 0;
  background: var(--bg-primary);
  position: relative;
  z-index: 10;
  min-height: 80px;
  align-items: center;
}

.delivery-steps-content .modal-footer .btn {
  min-width: 120px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .delivery-steps-content {
    margin: 0;
    max-height: 100vh;
    height: 100vh;
  }

  .delivery-wizard-content .modal-header,
  .delivery-wizard-content .modal-footer {
    padding: var(--space-3);
  }

  .wizard-progress {
    padding: var(--space-3) var(--space-3) var(--space-2);
  }

  .wizard-step {
    padding: var(--space-3);
  }

  .step-indicators {
    gap: var(--space-1);
  }

  .step-number {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .step-label {
    font-size: 0.7rem;
  }

  .signature-area-wizard canvas {
    height: 180px;
  }

  .photo-area {
    min-height: 250px;
  }

  .photo-placeholder {
    min-height: 250px;
  }

  .bultos-grid {
    grid-template-columns: 1fr;
  }

  .wizard-footer {
    flex-direction: row;
    justify-content: space-between;
    min-height: 70px;
  }

  .wizard-footer .btn {
    flex: 1;
    max-width: 140px;
  }

  .delivery-wizard-content .modal-header {
    min-height: 60px;
  }
}

/* ===== AUTENTICACIÓN BIOMÉTRICA ===== */
.login-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  text-align: center;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.login-divider span {
  padding: 0 1rem;
  color: var(--text-tertiary);
  font-size: 0.875rem;
  background: var(--bg-primary);
}

.biometric-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  border: none;
  border-radius: 12px;
  color: var(--text-on-primary);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.biometric-btn:hover {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.biometric-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.biometric-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.biometric-btn i {
  font-size: 1.25rem;
}

.biometric-btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

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

/* Estado del botón biométrico según disponibilidad */
.biometric-btn.not-supported {
  background: linear-gradient(135deg, var(--gray-400) 0%, var(--gray-500) 100%);
  cursor: not-allowed;
}

.biometric-btn.not-configured {
  background: linear-gradient(135deg, var(--warning-500) 0%, var(--warning-600) 100%);
  box-shadow: 0 4px 12px rgba(251, 146, 60, 0.3);
}

.biometric-btn.not-configured:hover {
  background: linear-gradient(135deg, var(--warning-600) 0%, var(--warning-700) 100%);
  box-shadow: 0 6px 20px rgba(251, 146, 60, 0.4);
}

/* Responsive para botón biométrico */
@media (max-width: 768px) {
  .biometric-btn {
    padding: 0.875rem;
    font-size: 0.9rem;
  }

  .biometric-btn i {
    font-size: 1.125rem;
  }
}

/* ===== MEDIDOR DE FORTALEZA DE CONTRASEÑA ===== */
.password-strength-container {
  margin-top: 0.75rem;
}

.strength-meter-container {
  position: relative;
  height: 6px;
  background-color: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.strength-meter {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  transition: all 0.3s ease;
  background: var(--gradient-error);
}

.strength-meter.strength-weak {
  background: var(--gradient-error);
  box-shadow: 0 0 8px rgba(220, 53, 69, 0.4);
}

.strength-meter.strength-fair {
  background: var(--gradient-warning);
  box-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
}

.strength-meter.strength-good {
  background: var(--gradient-warning);
  box-shadow: 0 0 8px rgba(253, 126, 20, 0.4);
}

.strength-meter.strength-strong {
  background: var(--gradient-success);
  box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}

.strength-text {
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.3s ease;
  margin: 0;
  text-align: left;
}

/* Estilos para inputs de contraseña */
.password-input-group {
  position: relative;
  margin-bottom: 1rem;
}

.password-input {
  width: 100%;
  padding: 0.75rem 3rem 0.75rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  background-color: var(--surface);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.password-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.password-toggle-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.3s ease;
}

.password-toggle-btn:hover {
  color: var(--text-primary);
}

.password-toggle-btn i {
  font-size: 1.125rem;
}

/* Tema oscuro para medidor de contraseña */
[data-theme="dark"] .strength-meter-container {
  background-color: var(--border-color);
}

[data-theme="dark"] .password-input {
  background-color: var(--surface);
  border-color: var(--border-color);
  color: var(--text-primary);
}

[data-theme="dark"] .password-input:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

/* ================================
   DASHBOARD PARA REPARTIDORES
   ================================ */

/* Welcome Card Enhancements */
.status-date {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* Summary Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 1px 3px var(--shadow-color);
  transition: all 0.2s ease;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.summary-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-on-primary);
}

.summary-icon.delivered {
  background: linear-gradient(135deg, var(--success-500), var(--success-600));
}

.summary-icon.pending {
  background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
}

.summary-icon.route {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
}

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

.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.summary-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Route Status Card */
.route-status-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px var(--shadow-color);
}

.route-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.route-status-badge {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.route-status-badge.active {
  background: var(--success-100);
  color: var(--success-700);
}

.route-status-badge.paused {
  background: var(--warning-100);
  color: var(--warning-700);
}

.route-status-badge.preparing {
  background: var(--primary-100);
  color: var(--primary-700);
}

.route-status-badge.error {
  background: var(--danger-100);
  color: var(--danger-700);
}

.route-time {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.route-info h5 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.route-info p {
  color: var(--text-secondary);
  margin: 0;
}

.route-progress {
  margin-top: 1rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success-500), var(--success-400));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Enhanced Action Cards */
.action-card.primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: var(--text-on-primary);
  border: none;
}

.action-card.primary .action-icon {
  background: rgba(255, 255, 255, 0.2);
}

.action-card.primary .action-info h5,
.action-card.primary .action-info p {
  color: var(--text-on-primary);
}

.action-icon.emergency {
  background: linear-gradient(135deg, var(--danger-500), var(--danger-600));
}

.action-icon.warning {
  background: linear-gradient(135deg, var(--warning-500), var(--warning-600));
}

/* Next Deliveries List */
.next-deliveries-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.next-delivery-item {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.next-delivery-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-color);
  border-color: var(--primary-300);
}

.delivery-order {
  width: 32px;
  height: 32px;
  background: var(--primary-100);
  color: var(--primary-700);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.delivery-info {
  flex: 1;
}

.delivery-address {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.delivery-details {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.delivery-distance {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* Performance Card */
.performance-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px var(--shadow-color);
}

.performance-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
}

.performance-metric {
  text-align: center;
}

.performance-metric .metric-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.performance-metric .metric-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 640px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .performance-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .route-status-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Dark Theme Adaptations */
[data-theme="dark"] .route-status-badge.active {
  background: var(--success-900);
  color: var(--success-300);
}

[data-theme="dark"] .route-status-badge.paused {
  background: var(--warning-900);
  color: var(--warning-300);
}

[data-theme="dark"] .route-status-badge.preparing {
  background: var(--primary-900);
  color: var(--primary-300);
}

[data-theme="dark"] .route-status-badge.error {
  background: var(--danger-900);
  color: var(--danger-300);
}

[data-theme="dark"] .delivery-order {
  background: var(--primary-900);
  color: var(--primary-300);
}

/* ===== DASHBOARD SIMPLE ===== */

/* Dashboard Container */
.dashboard-container {
  padding-top: 1rem;
  padding-bottom: 8rem;
  /* Extra space for bottom navigation */
  background-color: var(--bg-primary);
}

/* Section Header */
.section-header {
  margin: 2rem var(--space-6) 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

.section-header h4 {
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-header h4 i {
  color: var(--primary-color);
  font-size: 1.1rem;
}

/* Welcome Section */
.welcome-section {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: var(--text-on-primary);
  padding: 2rem 1.5rem;
  border-radius: 1rem;
  text-align: center;
  margin: 0 var(--space-6) 1.5rem;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.2);
}

.welcome-section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.welcome-section p {
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.welcome-section .date-text {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* GPS Status Card */
.gps-status-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  margin: 0 var(--space-6) 1.5rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.gps-indicator {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gps-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-on-primary);
  transition: all 0.3s ease;
}

.gps-icon.offline {
  background: var(--gradient-danger);
  animation: pulse-offline 2s infinite;
}

.gps-icon.online {
  background: var(--gradient-success);
  animation: pulse-online 2s infinite;
}

@keyframes pulse-offline {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes pulse-online {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }
}

.gps-info h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.gps-info p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Delivery Counters */
.delivery-counters {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1rem !important;
  margin: 0 var(--space-6) 1.5rem !important;
}

.counter-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 1rem !important;
  padding: 1.5rem !important;
  text-align: center !important;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  overflow: hidden !important;
  display: block !important;
}

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

.counter-card.delivered {
  background: var(--gradient-success-light);
  border-color: #22c55e;
}

.counter-card.pending {
  background: var(--gradient-warning-light);
  border-color: #f59e0b;
}

.counter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-color);
}

.counter-card.delivered::before {
  background: var(--gradient-success);
}

.counter-card.pending::before {
  background: var(--gradient-warning);
}

.counter-icon {
  margin-bottom: 1rem;
}

.counter-icon i {
  font-size: 2.5rem;
  color: var(--primary-color);
}

.counter-card.delivered .counter-icon i {
  color: #22c55e;
}

.counter-card.pending .counter-icon i {
  color: #f59e0b;
}

.counter-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.counter-number {
  font-size: 3rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.counter-card.delivered .counter-number {
  color: #16a34a;
}

.counter-card.pending .counter-number {
  color: #d97706;
}

.counter-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Prepare Delivery Button */
.prepare-delivery-section {
  display: flex;
  justify-content: center;
  margin: 2rem 1.5rem;
}

.prepare-delivery-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: var(--text-on-primary);
  border: none;
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
  min-width: 250px;
  justify-content: space-between;
}

.prepare-delivery-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(37, 99, 235, 0.4);
}

.prepare-delivery-btn:active {
  transform: translateY(0);
}

.prepare-delivery-btn i:first-child {
  font-size: 1.3rem;
}

.prepare-delivery-btn i:last-child {
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 480px) {
  .welcome-section {
    padding: 1.5rem 1rem;
    margin: 0 var(--space-4) 1.5rem;
  }

  .welcome-section h2 {
    font-size: 1.5rem;
  }

  .delivery-counters {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 0 var(--space-4) 1.5rem;
  }

  .counter-card {
    padding: 1.2rem;
  }

  .counter-number {
    font-size: 2rem;
  }

  .gps-status-card {
    padding: 1.2rem;
    margin: 0 var(--space-4) 1.5rem;
  }

  .gps-icon {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
}

/* ===== ESTILOS PARA PASO DE RECOGIDA ===== */
.pickup-section {
  margin-top: 1rem;
}

.pickup-option {
  margin-bottom: 1rem;
}

.pickup-choice {
  display: block;
  width: 100%;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--surface);
  color: var(--text-primary);
}

.pickup-choice:hover {
  border-color: var(--primary-300);
  background: var(--primary-50);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.pickup-choice.active {
  border-color: var(--primary-500);
  background: var(--primary-50);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.pickup-choice input[type="radio"] {
  display: none;
}

.choice-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.choice-content i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.pickup-form {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pickup-photo-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.pickup-photo-capture {
  margin-top: 0.5rem;
}

.pickup-photo-area {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  transition: all 0.3s ease;
}

.pickup-photo-area:hover {
  border-color: var(--primary-300);
  background: var(--primary-50);
}

.pickup-photo-btn {
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem;
}

.pickup-photo-btn i {
  font-size: 2rem;
  color: var(--primary-500);
}

.pickup-photo-preview {
  position: relative;
  display: inline-block;
}

.pickup-photo-preview img {
  max-width: 200px;
  max-height: 150px;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.pickup-photo-preview .remove-photo {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger-500);
  color: var(--text-on-primary);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pickup-form .form-group label {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pickup-form .form-control {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  background: var(--surface);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.pickup-form .form-control:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

/* Tema oscuro para recogida */
[data-theme="dark"] .pickup-choice {
  border-color: var(--border-color);
  background: var(--surface);
}

[data-theme="dark"] .pickup-choice:hover {
  border-color: var(--primary-400);
  background: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .pickup-choice.active {
  border-color: var(--primary-400);
  background: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .pickup-form {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

[data-theme="dark"] .pickup-photo-area {
  border-color: var(--border-color);
  background: var(--surface);
}

[data-theme="dark"] .pickup-photo-area:hover {
  border-color: var(--primary-400);
  background: rgba(59, 130, 246, 0.1);
}