:root {
  --primary: #25B1CF;
  --primary-hover: #1E9AB5;
  --primary-light: #E8F7FA;
  --secondary: #83BC28;
  --secondary-hover: #6FA020;
  --secondary-light: #F4F9E8;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --success: #10B981;
  --success-light: #ECFDF5;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --text: #1A2332;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --sidebar-bg: #FFFFFF;
  --sidebar-w: 250px;
  --topbar-h: 56px;
  --accent-line: 20px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 6px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 10px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
  --transition: 0.2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Accent line ─── */
#accent-line {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--accent-line);
  background: var(--primary);
  z-index: 9999;
}

/* ─── Topbar ─── */
#topbar {
  position: fixed;
  top: var(--accent-line);
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-toggle {
  color: var(--text) !important;
  font-size: 1.2rem;
  padding: 4px 8px;
  text-decoration: none;
  background: none;
  border: none;
}
.topbar-toggle:hover {
  background: var(--border-light);
  border-radius: var(--radius);
}
.topbar-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-logo {
  height: 40px;
  width: auto;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-user-info {
  text-align: right;
  line-height: 1.3;
}
.topbar-greeting {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}
.topbar-user {
  font-size: 0.9rem;
}
.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}
.btn-topbar-logout {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.btn-topbar-logout:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-light);
  transform: translateY(-1px);
}
.btn-topbar-icon {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.btn-topbar-icon:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
}

/* ─── Sidebar ─── */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform 0.3s ease;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
  padding-top: calc(var(--accent-line) + var(--topbar-h) + 0.75rem);
}
.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 0.75rem 1.25rem 0.4rem;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.6rem 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 450;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}
.sidebar-item:hover {
  background: var(--border-light);
  color: var(--text);
  border-left-color: var(--primary);
  padding-left: 1.5rem;
}
.sidebar-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}
.sidebar-item-icon {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.sidebar-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
}

/* ─── Main content ─── */
#main-content {
  margin-left: var(--sidebar-w);
  margin-top: calc(var(--accent-line) + var(--topbar-h));
  min-height: calc(100vh - var(--accent-line) - var(--topbar-h));
  padding: 1.5rem;
  transition: margin-left 0.3s ease;
  display: flex;
  flex-direction: column;
}

/* ─── Welcome ─── */
.welcome-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: calc(100vh - var(--accent-line) - var(--topbar-h) - 3rem);
}
.welcome-card {
  text-align: center;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 3rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.welcome-logo {
  width: 120px;
  height: auto;
  margin-bottom: 1.5rem;
}
.welcome-title {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.welcome-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ─── Footer ─── */
#app-footer {
  margin-left: var(--sidebar-w);
}
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
  background: var(--primary);
  gap: 0.5rem;
}
.footer-logo {
  width: 50px;
  height: auto;
  filter: brightness(0) invert(1);
}
.footer-copyright {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.9);
}
.footer-line-green {
  height: 6px;
  background: var(--secondary);
}

/* ─── Toast ─── */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 420px;
  width: calc(100% - 40px);
}
.toast-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 4px solid;
  position: relative;
}
.toast-custom.removing {
  animation: slideOutRight 0.3s ease forwards;
}
@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
  to { transform: translateX(120%); opacity: 0; }
}
.toast-success { background: var(--success-light); border-color: var(--success); }
.toast-error { background: var(--danger-light); border-color: var(--danger); }
.toast-info { background: var(--primary-light); border-color: var(--primary); }
.toast-warning { background: var(--warning-light); border-color: var(--warning); }
.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-text { flex: 1; font-size: 0.9rem; color: var(--text); line-height: 1.4; }
.toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 2px 0 0 8px; font-size: 1.2rem;
  transition: color 0.15s; line-height: 1; flex-shrink: 0;
}
.toast-close:hover { color: var(--text); }

/* ─── Panel card ─── */
.panel-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ─── Forms ─── */
.form-control {
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,177,207,0.15);
}
.form-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

/* ─── Buttons ─── */
.btn {
  border-radius: var(--radius);
  font-weight: 500;
  padding: 0.5rem 1.2rem;
  transition: all var(--transition);
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,177,207,0.3);
}

/* ─── Table ─── */
.table-custom thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  padding: 0.75rem 1rem;
  background: var(--bg);
  white-space: nowrap;
}
.table-custom tbody td {
  padding: 0.7rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.88rem;
}
.table-custom tbody tr:last-child td { border-bottom: none; }
.table-custom tbody tr:hover { background: var(--primary-light); }

/* ─── Badges ─── */
.badge-activo {
  background: rgba(16,185,129,0.12);
  color: #059669;
  font-weight: 500;
  padding: 0.3em 0.7em;
  border-radius: 20px;
  font-size: 0.75rem;
  display: inline-block;
}
.badge-inactivo {
  background: rgba(148,163,184,0.12);
  color: #64748B;
  font-weight: 500;
  padding: 0.3em 0.7em;
  border-radius: 20px;
  font-size: 0.75rem;
  display: inline-block;
}

/* ─── Action buttons ─── */
.btn-action {
  width: 34px; height: 34px;
  border-radius: var(--radius);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  margin: 0 2px;
}
.btn-action i { font-size: 0.85rem; }
.btn-action-ver { background: rgba(37,177,207,0.1); color: #25B1CF; }
.btn-action-ver:hover { background: #25B1CF; color: #fff; transform: translateY(-2px) scale(1.1); box-shadow: 0 4px 12px rgba(37,177,207,0.35); }
.btn-action-editar { background: rgba(245,158,11,0.12); color: #D97706; }
.btn-action-editar:hover { background: #F59E0B; color: #fff; transform: translateY(-2px) scale(1.1); box-shadow: 0 4px 12px rgba(245,158,11,0.3); }
.btn-action-eliminar { background: rgba(239,68,68,0.1); color: #DC2626; }
.btn-action-eliminar:hover { background: #EF4444; color: #fff; transform: translateY(-2px) scale(1.1); box-shadow: 0 4px 12px rgba(239,68,68,0.3); }

/* ─── Pagination ─── */
.pagination-custom { display: flex; gap: 3px; }
.pagination-custom .page-item .page-link {
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 0.35rem 0.7rem;
  border-radius: 6px !important;
  transition: all 0.15s ease;
  background: var(--surface);
}
.pagination-custom .page-item .page-link:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}
.pagination-custom .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.pagination-custom .page-item.disabled .page-link {
  opacity: 0.4;
  pointer-events: none;
}

/* ─── Loading ─── */
.loading-row td { padding: 3rem 0; }
.spinner-table {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state-icon { font-size: 3rem; color: var(--text-muted); opacity: 0.4; }

/* ─── Page content ─── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-header h4 { font-weight: 700; margin: 0; }

/* ─── Table toolbar / search ─── */
.table-search-bar {
  position: relative;
  max-width: 400px;
  margin-bottom: 1rem;
}
.table-search-bar .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.table-search-bar .form-control {
  padding-left: 2.2rem;
  border-radius: 8px;
}
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1rem 0;
}
.table-search {
  position: relative;
  flex: 1;
  max-width: 400px;
}
.table-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.table-search .form-control {
  padding-left: 2.2rem;
  border-radius: 8px;
}

/* ─── TH rounded ─── */
.table-custom thead th {
  border-radius: 8px;
}
.th-foto { width: 60px; }
.th-acciones { width: 140px; text-align: right; }

/* ─── Action buttons row ─── */
.acciones-cell {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

/* ─── Tabla foto ─── */
.tabla-foto {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.tabla-foto-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border-light);
  color: var(--text-muted);
  font-size: 1rem;
}

/* ─── Persona: botones verdes ─── */
.btn-persona-nueva {
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  padding: 0.5rem 1.2rem;
  transition: all var(--transition);
}
.btn-persona-nueva:hover {
  background: var(--secondary-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(131,188,40,0.3);
}
.btn-persona-guardar {
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  transition: all var(--transition);
}
.btn-persona-guardar:hover {
  background: var(--secondary-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(131,188,40,0.3);
}

/* ─── Persona: inputs verdes en modal ─── */
.form-green {
  border-radius: 8px;
  border: 1.5px solid var(--border);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-green:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(131,188,40,0.15);
  outline: none;
}
select.form-green {
  border-radius: 8px;
}

/* ─── Persona: foto preview en modal ─── */
.persona-foto-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  background: var(--secondary-light);
  color: var(--secondary);
  font-size: 2.2rem;
}
.persona-foto-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.persona-foto-label {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--secondary);
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 1rem;
}
.persona-foto-label:hover {
  text-decoration: underline;
}
.persona-foto-ver {
  width: 120px;
  height: 120px;
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-size: 2.8rem;
  margin-bottom: 1rem;
}

/* ─── Ver persona modal ─── */
.ver-detalle {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ver-row {
  display: flex;
  align-items: center;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border-light);
}
.ver-row:last-child { border-bottom: none; }
.ver-label {
  width: 160px;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.ver-valor {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

/* ─── Utilities ─── */
.bg-primary-light { background: var(--primary-light) !important; }
.bg-danger-light { background: var(--danger-light) !important; }
.bg-success-light { background: var(--success-light) !important; }
.fw-medium { font-weight: 500; }

/* ─── Responsive ─── */
@media (max-width: 991.98px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.sidebar-open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  #topbar { left: 0; }
  #main-content { margin-left: 0; }
  #app-footer { margin-left: 0; }
}
@media (max-width: 767.98px) {
  .topbar-logo { height: 30px; }
  .topbar-user-info { display: none; }
  .topbar-right { gap: 8px; }
}
@media (max-width: 575.98px) {
  #topbar { padding: 0 0.75rem; }
  #main-content { padding: 1rem; }
  .topbar-center { display: none; }
  .topbar-right { gap: 6px; }
  .btn-topbar-icon,
  .btn-topbar-logout,
  .topbar-avatar { width: 32px; height: 32px; }
  .topbar-avatar { font-size: 0.8rem; }
}

/* ─── Badges (fix modulo personas) ─── */
.badge-status {
  display: inline-block;
  font-weight: 500;
  padding: 0.3em 0.7em;
  border-radius: 20px;
  font-size: 0.72rem;
  white-space: nowrap;
}
.badge-active, .badge-activo { background: rgba(16,185,129,0.12); color: #059669; }
.badge-inactive, .badge-inactivo { background: rgba(148,163,184,0.15); color: #64748B; }
.badge-warning { background: rgba(245,158,11,0.15); color: #B45309; }
.badge-info, .badge-primary { background: rgba(37,177,207,0.15); color: #1E9AB5; }
.badge-danger { background: rgba(239,68,68,0.12); color: #DC2626; }
.badge-secondary { background: rgba(131,188,40,0.15); color: #6FA020; }

/* ─── Empty state ─── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 2.5rem 1rem; color: var(--text-muted); text-align: center;
}
.empty-state i { font-size: 2.5rem; opacity: 0.4; }
.empty-state p { margin: 0; font-size: 0.9rem; }

/* ─── Inactive row ─── */
.inactive-row { opacity: 0.55; }

/* ─── Generic green button ─── */
.btn-green {
  background: var(--secondary); color: #fff; border: none;
  border-radius: var(--radius); font-weight: 500; padding: 0.5rem 1.2rem;
  transition: all var(--transition);
}
.btn-green:hover {
  background: var(--secondary-hover); color: #fff;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(131,188,40,0.3);
}

.icon-primary { color: var(--primary); }
.icon-excel { color: #217346; }
.icon-pdf { color: #DC2626; }
.max-width-search { max-width: 400px; }
.max-width-filter { max-width: 280px; width: 100%; }
.confirm-modal-content { border-radius: var(--radius-lg); }
.confirm-modal-button { border-radius: var(--radius); }
.progress-slim-bar { width: var(--progress-width, 0%); }
.progress-slim-bar.progress-width-dynamic { width: var(--progress-width, 0%); }
.page-title-icon { color: var(--primary); }
.icon-excel { color: #217346; }
.icon-pdf { color: #DC2626; }
.search-width { max-width: 400px; }
.filter-width { max-width: 280px; width: 100%; }
.description-cell { max-width: 220px; }
.description-cell-maintenance { max-width: 200px; }
.loading-view { min-height: 200px; }
.map-route-outbound { stroke: #25B1CF; }
.map-route-return { stroke: #83BC28; }
.btn-action-reactivar { background: rgba(16,185,129,0.12); color: #059669; }
.btn-action-reactivar:hover { background: #10B981; color: #fff; transform: translateY(-2px) scale(1.1); box-shadow: 0 4px 12px rgba(16,185,129,0.35); }
.btn-action-completar { background: rgba(131,188,40,0.15); color: #6FA020; }
.btn-action-completar:hover { background: #83BC28; color: #fff; transform: translateY(-2px) scale(1.1); box-shadow: 0 4px 12px rgba(131,188,40,0.35); }
.btn-action-iniciar { background: rgba(37,177,207,0.12); color: #1E9AB5; }
.btn-action-iniciar:hover { background: #25B1CF; color: #fff; transform: translateY(-2px) scale(1.1); box-shadow: 0 4px 12px rgba(37,177,207,0.35); }
.btn-action-descargar { background: rgba(100,116,139,0.12); color: #475569; }
.btn-action-descargar:hover { background: #64748B; color: #fff; transform: translateY(-2px) scale(1.1); }
.btn-action-cancelar { background: rgba(239,68,68,0.1); color: #DC2626; }
.btn-action-cancelar:hover { background: #EF4444; color: #fff; transform: translateY(-2px) scale(1.1); }

/* ─── Detail modal (generic) ─── */
.detail-grid { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.detail-row { display: flex; align-items: flex-start; padding: 0.6rem 1rem; border-bottom: 1px solid var(--border-light); }
.detail-row:last-child { border-bottom: none; }
.detail-label { width: 42%; min-width: 120px; font-size: 0.8rem; color: var(--text-muted); flex-shrink: 0; }
.detail-value { font-size: 0.88rem; color: var(--text); font-weight: 500; word-break: break-word; }

/* ─── File upload / preview ─── */
.file-preview { margin-bottom: 0.5rem; text-align: center; }
.file-preview img { max-width: 100%; max-height: 160px; border-radius: var(--radius); border: 1px solid var(--border); }
.file-preview .file-preview-name { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; }

/* ─── Map ─── */
.map-container { width: 100%; height: 380px; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; background: var(--border-light); }
.map-container.map-lg { height: 460px; }
.route-form-map { height: 340px; }
.route-legend { display: flex; gap: 1rem; justify-content: center; color: var(--text-muted); font-size: 0.8rem; }
.route-legend-line { display: inline-block; width: 24px; height: 4px; border-radius: 4px; margin-right: 0.3rem; vertical-align: middle; }
.route-legend-outbound { background: #25B1CF; }
.route-legend-return { background: #83BC28; }
.map-placeholder { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 0.5rem; height: 100%; color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 1rem; }
.map-placeholder i { font-size: 2rem; opacity: 0.4; }

/* ─── Monitoreo ─── */
.monitoreo-grid, #monitoreoContainer { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.monitoreo-empty { grid-column: 1 / -1; min-height: 260px; }
.monitoreo-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1rem; cursor: pointer; transition: all 0.2s ease; }
.monitoreo-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.monitoreo-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.monitoreo-placa { font-weight: 700; font-size: 1rem; color: var(--primary); }
.monitoreo-choice { font-size: 0.78rem; color: var(--text-muted); }
.monitoreo-ruta { font-size: 0.85rem; color: var(--text); margin-bottom: 0.3rem; display: flex; align-items: center; gap: 0.4rem; }
.monitoreo-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.65rem 0; }
.monitoreo-foot { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.chip { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 0.22rem 0.65rem; font-size: 0.74rem; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 0.35rem; }
.chip-danger { color: #B91C1C; background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25); }
.progress-slim { height: 6px; background: var(--border-light); border-radius: 20px; overflow: hidden; }
.progress-slim-bar { display: block; height: 100%; background: var(--secondary); border-radius: 20px; }
.progress-bar-danger { background: #EF4444 !important; }
.alerta-item { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.78rem; padding: 0.35rem 0.5rem; border-radius: 6px; background: rgba(239,68,68,0.07); color: #B91C1C; margin-top: 0.35rem; }
.alerta-item .alerta-msg { flex: 1; font-weight: 500; }
.alerta-item-inactiva { opacity: 0.6; background: var(--bg); color: var(--text-secondary); }
.monitoreo-live { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; font-weight: 600; color: var(--secondary); background: rgba(131,188,40,0.12); border-radius: 20px; padding: 0.28rem 0.7rem; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--secondary); animation: livePulse 1.5s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }

/* Export buttons group */
.btn-group-export { display: inline-flex; gap: 0.35rem; align-items: center; }

/* ─── Viajes: multi-destino ─── */
.destino-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.destino-row .destino-orden { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600; flex-shrink: 0; }
.destino-row select { flex: 1; }

/* ─── Dashboard home ─── */
.home-page { padding-top: 1rem; }
.home-hero { text-align: center; margin-bottom: 2rem; padding: 1rem 0; }
.home-logo { width: 80px; height: 80px; object-fit: contain; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); padding: 0.5rem; margin-bottom: 0.75rem; box-shadow: var(--shadow-sm); }
.home-hero h3 { margin-bottom: 0.25rem; color: var(--text); font-weight: 600; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.home-shortcut { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem 1rem; text-align: center; cursor: pointer; text-decoration: none; color: var(--text); transition: all 0.2s ease; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center; }
.home-shortcut:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary); color: var(--primary); }
.home-shortcut i { font-size: 1.7rem; margin-bottom: 0.6rem; color: var(--primary); }
.home-shortcut span { font-size: 0.83rem; font-weight: 500; }

/* ─── Section title en modales ─── */
.modal-section-title { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin: 0.25rem 0 0.5rem; }

/* ─── Totales / resumen ─── */
.totales-box { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; }
.totales-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.2rem 0; }
.totales-row.total { font-weight: 700; font-size: 0.95rem; border-top: 1px solid var(--border); margin-top: 0.35rem; padding-top: 0.5rem; color: var(--primary); }
