/* ==========================================================================
   Variables y Tokens de Diseño - Backoffice del Operador
   ========================================================================== */
:root {
    --color-primario: #1D4ED8;
    --color-secundario: #F97316;
    --color-texto-primario: #FFFFFF;
    --color-texto-secundario: #0F172A;

    --color-fondo: #F8FAFC;
    --color-superficie: #FFFFFF;
    --color-borde: #E2E8F0;
    --color-texto: #0F172A;
    --color-texto-secundario-base: #475569;

    --color-exito: #15803D;
    --color-alerta: #B45309;
    --color-error: #B91C1C;
    --color-info: #0369A1;

    /* ==========================================================================
       Escala Tipográfica Centralizada (Design Tokens de Fuentes)
       ========================================================================== */
    --fs-h1: 1.25rem;       /* 20px - Título principal de página */
    --fs-h2: 1.05rem;       /* 16.8px - Título de sección o panel */
    --fs-h3: 0.95rem;       /* 15.2px - Título de subsección o modal */
    --fs-base: 0.875rem;    /* 14px - Cuerpo de texto y celdas estándar */
    --fs-sm: 0.8125rem;     /* 13px - Texto secundario y controles de formulario */
    --fs-xs: 0.75rem;       /* 12px - Timestamps, metadata y etiquetas */
    --fs-micro: 0.7rem;     /* 11.2px - Rótulos mínimos y micro-indicadores */

    /* Badges de estados según especificación */
    --badge-admitido-bg: #64748B;
    --badge-deposito-bg: #2563EB;
    --badge-asignado-bg: #4F46E5;
    --badge-transito-bg: #D97706;
    --badge-entregado-bg: #16A34A;
    --badge-no-entregado-bg: #DC2626;
    --badge-reprogramado-bg: #7C3AED;
    --badge-en-devolucion-bg: #EA580C;
    --badge-devuelto-bg: #475569;
    --badge-extraviado-bg: #991B1B;
}

/* Utilidades Tipográficas Centralizadas */
.fs-pagina-titulo   { font-size: var(--fs-h1) !important; font-weight: 700; line-height: 1.3; }
.fs-seccion-titulo  { font-size: var(--fs-h2) !important; font-weight: 600; line-height: 1.3; }
.fs-subseccion      { font-size: var(--fs-h3) !important; font-weight: 600; line-height: 1.35; }
.fs-cuerpo          { font-size: var(--fs-base) !important; line-height: 1.45; }
.fs-secundario      { font-size: var(--fs-sm) !important; line-height: 1.4; color: var(--color-texto-secundario-base); }
.fs-metadata        { font-size: var(--fs-xs) !important; line-height: 1.35; color: #64748B; }
.fs-micro           { font-size: var(--fs-micro) !important; line-height: 1.3; }

body {
    background-color: var(--color-fondo);
    color: var(--color-texto);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
}

/* ==========================================================================
   Variables y Tokens de Barra Lateral Anclada y Colapsable
   ========================================================================== */
:root {
    --sidebar-ancho: 250px;
    --sidebar-ancho-colapsada: 68px;
}

html.sidebar-colapsada,
body.sidebar-colapsada {
    --sidebar-ancho: var(--sidebar-ancho-colapsada);
}

/* ==========================================================================
   Barra Lateral Oscura Anclada (Fixed Sidebar)
   ========================================================================== */
.sidebar-oscura {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-ancho);
    height: 100vh;
    background-color: #0F172A;
    color: #94A3B8;
    z-index: 1040;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

/* Contenedor Principal con margen dinámico */
.layout-contenido-principal {
    margin-left: var(--sidebar-ancho);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-oscura .nav-link {
    color: #94A3B8;
    font-size: 0.85rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
}

.sidebar-oscura .nav-link:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-oscura .nav-link.active {
    color: #FFFFFF;
    background-color: var(--color-primario);
    font-weight: 600;
}

.sidebar-seccion {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #64748B;
    padding: 0.75rem 0.75rem 0.25rem 0.75rem;
    white-space: nowrap;
}

/* Botón de alternancia colapsar/expandir */
.btn-colapsar-sidebar {
    background: transparent;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease;
}

.btn-colapsar-sidebar:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.icono-expandir {
    display: none;
}

.icono-colapsar {
    display: block;
}

/* Estado Colapsado de la Barra Lateral */
.sidebar-colapsada .icono-colapsar {
    display: none;
}

.sidebar-colapsada .icono-expandir {
    display: block;
}

.sidebar-colapsada .sidebar-texto,
.sidebar-colapsada .sidebar-seccion,
.sidebar-colapsada .sidebar-marca-texto {
    display: none !important;
}

.sidebar-colapsada .sidebar-cabecera {
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0.75rem 0.5rem !important;
    gap: 0.5rem;
}

.sidebar-colapsada .sidebar-oscura .nav-link {
    justify-content: center !important;
    padding: 0.65rem 0.5rem !important;
    text-align: center;
}

.sidebar-colapsada .sidebar-oscura .nav-link svg {
    margin: 0 !important;
}

.sidebar-colapsada .sidebar-pie {
    padding: 0.75rem 0.5rem !important;
}

.sidebar-colapsada .sidebar-pie > div {
    justify-content: center !important;
}

/* ==========================================================================
   Tablas Compactas
   ========================================================================== */
.table-compacta {
    font-size: 0.85rem;
}

.table-compacta th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: #475569;
    background-color: #F1F5F9;
    border-bottom: 1px solid var(--color-borde);
    padding: 0.55rem 0.75rem;
}

.table-compacta td {
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
}

/* ==========================================================================
   Clases de Marca
   ========================================================================== */
.btn-marca {
    background-color: var(--color-primario);
    color: var(--color-texto-primario);
    border: 1px solid var(--color-primario);
    font-weight: 600;
}

.btn-marca:hover {
    filter: brightness(0.92);
    color: var(--color-texto-primario);
}

.badge-estado {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.775rem;
    font-weight: 600;
    color: #FFFFFF;
}

.badge-estado-admitido      { background-color: var(--badge-admitido-bg); }
.badge-estado-endeposito    { background-color: var(--badge-deposito-bg); }
.badge-estado-asignadoaruta { background-color: var(--badge-asignado-bg); }
.badge-estado-entransito    { background-color: var(--badge-transito-bg); }
.badge-estado-entregado     { background-color: var(--badge-entregado-bg); }
.badge-estado-noentregado   { background-color: var(--badge-no-entregado-bg); }
.badge-estado-reprogramado  { background-color: var(--badge-reprogramado-bg); }
.badge-estado-endevolucion  { background-color: var(--badge-en-devolucion-bg); }
.badge-estado-devuelto      { background-color: var(--badge-devuelto-bg); }
.badge-estado-extraviado    { background-color: var(--badge-extraviado-bg); }

/* Banner demo para selector en desarrollo */
.banner-demo-dev {
    background-color: #FEF3C7;
    border-bottom: 1px solid #FCD34D;
    color: #92400E;
    font-size: 0.85rem;
    padding: 0.35rem 1rem;
}

/* ==========================================================================
   Estandarización de Paneles y Tarjetas (Clean UI)
   ========================================================================== */
.panel-estandar {
    background-color: var(--color-superficie);
    border: 1px solid var(--color-borde);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.panel-estandar-header {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--color-borde);
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
}

.panel-estandar-body {
    padding: 1.25rem;
    flex-grow: 1;
}

.panel-estandar-footer {
    background-color: #F8FAFC;
    border-top: 1px solid var(--color-borde);
    padding: 0.75rem 1.25rem;
}

/* ==========================================================================
   Tarjetas Métricas Estandarizadas
   ========================================================================== */
.metrica-card {
    background-color: #FFFFFF;
    border: 1px solid var(--color-borde);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    min-height: 104px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.metrica-card:hover {
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.08);
}

.metrica-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.metrica-card__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #64748B;
    margin: 0;
}

.metrica-card__valor {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-texto);
    margin: 0;
}

/* ==========================================================================
   Botón de Ayuda Contextual (?) y Popover
   ========================================================================== */
.btn-ayuda {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #CBD5E1;
    background-color: #F8FAFC;
    color: #64748B;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease-in-out;
    flex-shrink: 0;
    line-height: 1;
}

.btn-ayuda:hover, .btn-ayuda.activo {
    background-color: #0F172A;
    border-color: #0F172A;
    color: #FFFFFF;
}

.ayuda-popover {
    position: fixed;
    z-index: 1070;
    max-width: 320px;
    background-color: #0F172A;
    color: #F8FAFC;
    font-size: 0.8rem;
    line-height: 1.4;
    padding: 0.75rem 0.95rem;
    border-radius: 0.45rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    display: none;
    pointer-events: auto;
}

.ayuda-popover.visible {
    display: block;
    animation: fadeIn 0.15s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Estandarización de Paneles y Modales con Altura Estable
   Regla de UX: Los paneles y modales nunca deben variar de tamaño ni producir
   saltos visuales de interfaz al alternar entre opciones o pestañas.
   ========================================================================== */
.contenedor-accion-fija {
    min-height: 105px;
    height: 105px;
    max-height: 105px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.opcion-tarjeta-fija {
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    background-color: #FAFAFA;
}

.opcion-tarjeta-fija:hover {
    background-color: #F1F5F9;
}

/* ==========================================================================
   Estados Tipográficos Limpios (Sin Paneles Redondeados / Badges Innecesarios)
   Paleta sobria de 3 colores según directriz de diseño:
   1. Entregado (Éxito): Verde
   2. Estados Intermedios (Admitido, Depósito, Asignado, Tránsito, etc.): Azul
   3. Extraviado / No Entregado (Fallo): Rojo
   ========================================================================== */
.estado-entregado {
    color: #15803D !important;
    font-weight: 600;
}

.estado-intermedio {
    color: #1D4ED8 !important;
    font-weight: 600;
}

.estado-fallo {
    color: #B91C1C !important;
    font-weight: 600;
}

.badge {
    color: #0F172A; /* Color oscuro legible por defecto */
}

/* Variante Warning / Demora / Alerta */
.badge.bg-warning-subtle,
.bg-warning-subtle {
    background-color: #FEF3C7 !important;
    color: #92400E !important;
}

.text-warning-emphasis,
.text-warning {
    color: #B45309 !important;
}

.border-warning-subtle {
    border-color: #FCD34D !important;
}

/* Variante Success / Cumplimiento / Entregado */
.badge.bg-success-subtle,
.bg-success-subtle {
    background-color: #DCFCE7 !important;
    color: #166534 !important;
}

.text-success-emphasis,
.text-success {
    color: #15803D !important;
}

.border-success-subtle {
    border-color: #86EFAC !important;
}

/* Variante Danger / Fallo / No Entregado / Extraviado */
.badge.bg-danger-subtle,
.bg-danger-subtle {
    background-color: #FEE2E2 !important;
    color: #991B1B !important;
}

.text-danger-emphasis,
.text-danger {
    color: #B91C1C !important;
}

.border-danger-subtle {
    border-color: #FCA5A5 !important;
}

/* Variante Primary / Tránsito / En Curso */
.badge.bg-primary-subtle,
.bg-primary-subtle {
    background-color: #DBEAFE !important;
    color: #1E40AF !important;
}

.text-primary-emphasis,
.text-primary {
    color: #1D4ED8 !important;
}

.border-primary-subtle {
    border-color: #93C5FD !important;
}

/* Variante Info / Depósito */
.badge.bg-info-subtle,
.bg-info-subtle {
    background-color: #E0F2FE !important;
    color: #075985 !important;
}

.text-info-emphasis,
.text-info {
    color: #0369A1 !important;
}

.border-info-subtle {
    border-color: #7DD3FC !important;
}

/* Variante Secondary / Admitido / Neutral */
.badge.bg-secondary-subtle,
.bg-secondary-subtle {
    background-color: #F1F5F9 !important;
    color: #334155 !important;
}

.text-secondary-emphasis,
.text-secondary {
    color: #475569 !important;
}

.border-secondary-subtle {
    border-color: #CBD5E1 !important;
}

/* ==========================================================================
   Componente Universal de Notificaciones Toast Flotantes y Panel de Detalle
   Ubicación: Superior derecha de la pantalla
   Capacidad: Acumulación máxima de 5 notificaciones (la más reciente arriba)
   ========================================================================== */
#contenedorNotificacionesToast {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1095;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    width: 380px;
    max-width: calc(100vw - 2.5rem);
}

.toast-notificacion {
    pointer-events: auto;
    cursor: pointer;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    border: 1px solid #E2E8F0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, opacity 0.25s ease;
    animation: animEntradaToast 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-notificacion:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -4px rgba(15, 23, 42, 0.16), 0 10px 12px -4px rgba(15, 23, 42, 0.1);
}

.toast-notificacion.toast-saliendo {
    animation: animSalidaToast 0.3s ease forwards;
}

.toast-notificacion.tipo-exito  { border-left: 5px solid #10B981; }
.toast-notificacion.tipo-error  { border-left: 5px solid #EF4444; }
.toast-notificacion.tipo-alerta { border-left: 5px solid #F59E0B; }
.toast-notificacion.tipo-info   { border-left: 5px solid #3B82F6; }

.toast-cuerpo {
    padding: 0.9rem 1rem 0.75rem 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.toast-icono {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tipo-exito .toast-icono  { background-color: #ECFDF5; color: #10B981; }
.tipo-error .toast-icono  { background-color: #FEF2F2; color: #EF4444; }
.tipo-alerta .toast-icono { background-color: #FFFBEB; color: #F59E0B; }
.tipo-info .toast-icono   { background-color: #EFF6FF; color: #3B82F6; }

.toast-contenido {
    flex-grow: 1;
    min-width: 0;
}

.toast-titulo {
    font-size: var(--fs-base);
    font-weight: 700;
    color: #0F172A;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.toast-mensaje {
    font-size: var(--fs-sm);
    color: #475569;
    line-height: 1.4;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.toast-indicador-clic {
    font-size: var(--fs-micro);
    color: #2563EB;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.toast-btn-cerrar {
    background: none;
    border: none;
    color: #94A3B8;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
    flex-shrink: 0;
    margin-left: 0.25rem;
}

.toast-btn-cerrar:hover {
    color: #0F172A;
    background-color: #F1F5F9;
}

.toast-progreso-barra {
    height: 3px;
    width: 100%;
    background-color: #F1F5F9;
    overflow: hidden;
}

.toast-progreso-relleno {
    height: 100%;
    width: 100%;
    transform-origin: left;
    transition: width linear;
}

.tipo-exito .toast-progreso-relleno  { background-color: #10B981; }
.tipo-error .toast-progreso-relleno  { background-color: #EF4444; }
.tipo-alerta .toast-progreso-relleno { background-color: #F59E0B; }
.tipo-info .toast-progreso-relleno   { background-color: #3B82F6; }

/* Offcanvas Drawer de Detalle */
.panel-notificacion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.panel-notificacion-overlay.activo {
    opacity: 1;
    pointer-events: auto;
}

.panel-notificacion-lateral {
    position: fixed;
    top: 0;
    right: 0;
    width: 480px;
    max-width: 100vw;
    height: 100vh;
    background: #FFFFFF;
    box-shadow: -10px 0 30px rgba(15, 23, 42, 0.2);
    z-index: 1105;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.panel-notificacion-lateral.abierto {
    transform: translateX(0);
}

.panel-notificacion-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #F8FAFC;
}

.panel-notificacion-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.panel-notificacion-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #E2E8F0;
    background-color: #F8FAFC;
    display: flex;
    justify-content: flex-end;
}

.panel-estadisticas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 1.25rem;
}

.panel-stat-card {
    background-color: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 0.85rem;
    text-align: center;
}

.panel-stat-label {
    font-size: var(--fs-micro);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #64748B;
    margin-bottom: 0.25rem;
}

.panel-stat-valor {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

@keyframes animEntradaToast {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes animSalidaToast {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
}


/* ==========================================================================
   Mapas de Seguimiento Leaflet — Estilo Corporativo Última Milla
   ========================================================================== */
.um-mapa-leaflet {
    width: 100%;
    background-color: #F1F5F9;
    font-family: inherit;
    z-index: 1;
}

.um-mapa-leaflet .leaflet-tile-pane {
    filter: saturate(0.82) contrast(1.03);
}

.um-mapa-leaflet .leaflet-control-zoom {
    border: 1px solid #CBD5E1 !important;
    border-radius: 6px !important;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
}

.um-mapa-leaflet .leaflet-control-zoom a {
    background-color: #FFFFFF !important;
    color: #0F172A !important;
    border-bottom: 1px solid #E2E8F0 !important;
    width: 28px !important;
    height: 28px !important;
    line-height: 26px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
}

.um-mapa-leaflet .leaflet-control-zoom a:hover {
    background-color: #F8FAFC !important;
    color: var(--color-primario) !important;
}

.um-mapa-leaflet .leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.85) !important;
    color: #64748B !important;
    font-size: 0.65rem !important;
    padding: 1px 6px !important;
    border-top-left-radius: 4px;
}

.um-div-icon {
    background: transparent !important;
    border: none !important;
}

/* Marcador de Depósito Logístico Central */
.um-marker-deposito {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: #0F172A;
    border: 2px solid #FFFFFF;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Marcadores de Paradas de Entrega */
.um-marker-parada {
    border-radius: 9999px;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.24);
    transition: transform 0.15s ease;
}

.um-marker-parada:hover {
    transform: scale(1.12);
}

.um-parada-entregado {
    background-color: #15803D;
}

.um-parada-activo {
    background-color: #1D4ED8;
}

.um-parada-pendiente {
    background-color: #475569;
}

.um-parada-fallo {
    background-color: #B91C1C;
}

.um-parada-destacada {
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.22), 0 3px 8px rgba(15, 23, 42, 0.3);
}

/* Marcador de Camión de Reparto */
.um-marker-camion-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: auto;
}

.um-marker-camion-etiqueta {
    background-color: #0F172A;
    color: #FFFFFF;
    font-size: 0.66rem;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    margin-bottom: 3px;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.um-marker-camion-circulo {
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    border: 2.5px solid #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.3);
    transition: transform 0.15s ease;
}

.um-marker-camion-wrap:hover .um-marker-camion-circulo,
.um-camion-seleccionado .um-marker-camion-circulo {
    transform: scale(1.12);
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.35);
}

.um-camion-movimiento {
    background-color: #15803D;
}

.um-camion-ruta {
    background-color: #1D4ED8;
}

.um-camion-detenido {
    background-color: #B45309;
}

.um-camion-riesgo {
    background-color: #B91C1C;
}

/* Popups de Leaflet adaptados al diseño */
.um-mapa-leaflet .leaflet-popup-content-wrapper {
    background: #FFFFFF;
    color: #0F172A;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
    padding: 0;
}

.um-mapa-leaflet .leaflet-popup-content {
    margin: 10px 12px;
    line-height: 1.4;
}

.um-mapa-leaflet .leaflet-popup-tip {
    background: #FFFFFF;
}

.um-popup-titulo {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 2px;
}

.um-popup-sub {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1E293B;
}

.um-popup-meta {
    font-size: 0.7rem;
    color: #64748B;
    margin-top: 2px;
}

.um-popup-estado {
    font-size: 0.7rem;
    color: #0F172A;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #F1F5F9;
}

.um-popup-alerta {
    font-size: 0.7rem;
    font-weight: 600;
    color: #B91C1C;
    margin-top: 3px;
}
