/* ═══════════════════════════════════════════════════════════════
   CLAVIJERO — Vistas Monitor y Cumplimiento
   Coherente con la paleta del portal (variables --accent, --bg-*).
   Prefijos:
     cmt-* → Cumplimiento de Puntualidad (App.ComplianceMonitor)
     hw-*  → Monitor de Regularidad / Headway (App.HeadwayMonitor)
     cc-*  → CommandCenter / sub-componentes del HeadwayMonitor
   ═══════════════════════════════════════════════════════════════ */

/* ═══ SIDEBAR — Acceso rápido a Servicios ════════════════════ */
.nav-services-wrap { display: flex; flex-direction: column; }
.nav-services-main { position: relative; }
.nav-services-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}
.nav-services-toggle i { font-size: 0.7rem; transition: transform 0.2s; }
.nav-services-toggle:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.nav-services-wrap.is-collapsed .nav-services-toggle i { transform: rotate(-90deg); }
.nav-services-wrap.is-collapsed .nav-services-list { display: none; }
.sidebar.collapsed .nav-services-toggle,
.sidebar.collapsed .nav-services-list { display: none !important; }

.nav-services-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 4px 0 6px 28px;
    margin: 0 16px 6px 16px;
    border-left: 1px dashed rgba(255,255,255,0.08);
    margin-left: 36px;
}
.nav-services-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    border-radius: 7px;
    transition: all 0.15s;
    line-height: 1.2;
    min-width: 0;
}
.nav-services-item:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text);
}
.nav-services-item.is-current {
    background: rgba(0,184,148,0.14);
    color: var(--accent);
    font-weight: 600;
}
.nav-services-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.55;
    flex-shrink: 0;
}
.nav-services-item.is-current .nav-services-dot { opacity: 1; }
.nav-services-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.nav-services-empty,
.nav-services-error {
    padding: 6px 10px;
    font-size: 0.74rem;
    color: var(--text-muted);
    font-style: italic;
}
.nav-services-error { color: #fca5a5; font-style: normal; }
.nav-services-error i { margin-right: 5px; }

/* ─── Switcher de vistas Tablero / Monitor / Cumplimiento ───── */
.cu-view-tabs {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: rgba(0,0,0,0.28);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.cu-view-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
    white-space: nowrap;
    line-height: 1;
    outline: none;
}
.cu-view-tab i { font-size: 0.86rem; opacity: 0.85; }
.cu-view-tab:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}
.cu-view-tab.active {
    color: #062f22;
    background: var(--accent);
    box-shadow: 0 4px 14px rgba(0,184,148,0.35), 0 0 0 1px rgba(0,184,148,0.4);
}
.cu-view-tab.active i { opacity: 1; }
.cu-view-tab:focus-visible {
    box-shadow: 0 0 0 2px rgba(0,184,148,0.5);
}
@media (max-width: 768px) {
    .cu-view-tab span { display: none; }
    .cu-view-tab { padding: 7px 10px; }
}

/* ─── Estados comunes ─────────────────────────────────────────── */
.cmt-loading,
.cmt-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 24px;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.cmt-loading i { color: var(--accent); }
.cmt-empty i   { color: #f59e0b; font-size: 1.4rem; }

/* ═══ CUMPLIMIENTO DE PUNTUALIDAD ═════════════════════════════ */

.cmt-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px;
    margin: 0 0 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: sticky;
    top: 0;
    z-index: 5;
}
.cmt-filter-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.cmt-filter-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0;
    flex-shrink: 0;
}
.cmt-route-sel {
    flex: 1;
    min-width: 220px;
    background: rgba(0,0,0,0.25);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}
.cmt-route-sel:focus { border-color: var(--accent); }
.cmt-route-sel option { background: var(--bg-card); color: var(--text); }

/* ── Leyenda de estados ─────────────────────────────────────── */
.cmt-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.74rem;
    padding-top: 4px;
    border-top: 1px dashed rgba(255,255,255,0.06);
}
.cmt-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}
.cmt-legend i { font-size: 0.62rem; }
.cmt-leg--quemado    i { color: #b91c1c; }
.cmt-leg--demorado   i { color: #ef4444; }
.cmt-leg--leve       i { color: #f59e0b; }
.cmt-leg--a_tiempo   i { color: #22c55e; }
.cmt-leg--adelantado i { color: #38bdf8; }
.cmt-leg--sin_dato   i { color: #475569; }

/* ── Sección de ruta ────────────────────────────────────────── */
.cmt-route-section {
    margin: 0 0 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.cmt-route-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04), transparent);
    border-bottom: 1px solid var(--border);
    border-left: 4px solid var(--rc, var(--accent));
    flex-wrap: wrap;
}
.cmt-route-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--rc, var(--accent));
    flex-shrink: 0;
}
.cmt-route-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
}
.cmt-route-subtitle {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.cmt-dispatch-count {
    background: rgba(0,184,148,0.12);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.72rem;
}
.cmt-empty-route {
    padding: 18px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}
.cmt-empty-route i { margin-right: 6px; opacity: 0.6; }

/* ── Resumen de cumplimiento por ruta ─────────────────────── */
.cmt-route-summary {
    padding: 12px 16px;
    background: rgba(0,0,0,0.18);
    border-bottom: 1px solid var(--border);
}
.cmt-rs-bar {
    display: flex;
    height: 8px;
    border-radius: 99px;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
}
.cmt-rs-seg { height: 100%; }
.cmt-rs-verde { background: #22c55e; }
.cmt-rs-leve  { background: #f59e0b; }
.cmt-rs-rojo  { background: #ef4444; }
.cmt-rs-sin   { background: #475569; }
.cmt-rs-counts {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 0.74rem;
    color: var(--text-muted);
}
.cmt-rs-count b { color: var(--text); margin-right: 3px; }
.cmt-rs-count--verde b { color: #22c55e; }
.cmt-rs-count--leve  b { color: #f59e0b; }
.cmt-rs-count--rojo  b { color: #ef4444; }

/* ── Tabla de cumplimiento ──────────────────────────────────── */
.cmt-table-wrap {
    overflow-x: auto;
    max-height: 60vh;
}
.cmt-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.78rem;
}
.cmt-table thead th {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 0.66rem;
    font-weight: 600;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    z-index: 1;
}
.cmt-th-salida { min-width: 110px; }
.cmt-th-label  { min-width: 130px; }
.cmt-th-stop   { min-width: 90px; text-align: center; }
.cmt-th-stop-num {
    display: block;
    color: var(--accent);
    font-size: 0.6rem;
    font-weight: 700;
}
.cmt-th-stop-name {
    display: block;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
    font-size: 0.7rem;
    font-weight: 500;
    margin-top: 2px;
}
.cmt-row {
    background: rgba(255,255,255,0.012);
    cursor: pointer;
    transition: background 0.15s;
}
.cmt-row:hover { background: rgba(0,184,148,0.06); }
.cmt-row td {
    padding: 8px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}
.cmt-td-salida { font-weight: 600; }
.cmt-td-label  { color: var(--text-muted); font-weight: 500; }
.cmt-salida-prog {
    display: block;
    color: var(--text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.cmt-salida-real {
    display: block;
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 600;
    margin-top: 2px;
}
.cmt-salida-real i { margin-right: 3px; }

/* ── Celdas de paradas con colores de estado ──────────────── */
.cmt-cell {
    text-align: center;
    padding: 8px 6px !important;
    font-variant-numeric: tabular-nums;
    border-radius: 4px;
}
.cmt-cell--quemado    { background: rgba(185,28,28,0.18);  color: #fca5a5; }
.cmt-cell--demorado   { background: rgba(239,68,68,0.15);  color: #fecaca; }
.cmt-cell--leve       { background: rgba(245,158,11,0.15); color: #fcd34d; }
.cmt-cell--a_tiempo   { background: rgba(34,197,94,0.15);  color: #86efac; }
.cmt-cell--adelantado { background: rgba(56,189,248,0.15); color: #7dd3fc; }
.cmt-cell--sin_dato   { color: #475569; opacity: 0.6; }
.cmt-actual { font-weight: 700; font-size: 0.82rem; }
.cmt-delay  { font-size: 0.66rem; opacity: 0.85; margin-top: 1px; }

/* ── Etiquetas de origen / destino en headers ─────────────── */
.cmt-stop-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.4px;
}
.cmt-stop-origin { background: rgba(34,197,94,0.18);  color: #86efac; }
.cmt-stop-dest   { background: rgba(56,189,248,0.18); color: #7dd3fc; }

/* ── Status de fila ─────────────────────────────────────────── */
.cmt-row-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.66rem;
    font-weight: 600;
}
.cmt-row-status--a_tiempo   { background: rgba(34,197,94,0.18);  color: #86efac; }
.cmt-row-status--leve       { background: rgba(245,158,11,0.18); color: #fcd34d; }
.cmt-row-status--demorado   { background: rgba(239,68,68,0.18);  color: #fecaca; }
.cmt-row-status--quemado    { background: rgba(185,28,28,0.22);  color: #fca5a5; }
.cmt-row-status--adelantado { background: rgba(56,189,248,0.18); color: #7dd3fc; }
.cmt-row-status--sin_dato   { background: rgba(71,85,105,0.2);   color: #94a3b8; }


/* ═══ MONITOR DE REGULARIDAD (HEADWAY) ════════════════════════ */

/* ── Resumen superior ──────────────────────────────────────── */
.hw-summary-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin: 0 0 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.hw-summary-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 14px;
    border-right: 1px solid rgba(255,255,255,0.06);
    min-width: 80px;
}
.hw-summary-kpi:last-of-type { border-right: none; }
.hw-summary-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.hw-summary-lbl {
    font-size: 0.64rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.hw-summary-alert {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    background: rgba(239,68,68,0.12);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.3);
}

/* ── Tarjeta de ruta ──────────────────────────────────────── */
.hw-route-card {
    margin: 0 0 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.hw-route-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(255,255,255,0.04), transparent);
    flex-wrap: wrap;
}
.hw-route-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}
.hw-route-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.hw-route-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
}
.hw-route-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.hw-route-actions {
    display: flex;
    gap: 6px;
}
.hw-config-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.74rem;
    cursor: pointer;
    transition: all 0.15s;
}
.hw-config-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text);
}
.hw-fullscreen-btn:hover {
    background: rgba(0,184,148,0.12);
    color: var(--accent);
    border-color: rgba(0,184,148,0.4);
}

/* ── Pills ─────────────────────────────────────────────────── */
.hw-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid transparent;
}
.hw-pill i { font-size: 0.65rem; }
.hw-pill--enroute {
    background: rgba(0,184,148,0.14);
    color: var(--accent);
    border-color: rgba(0,184,148,0.3);
}
.hw-pill--headway {
    background: rgba(56,189,248,0.12);
    color: #7dd3fc;
    border-color: rgba(56,189,248,0.3);
}
.hw-pill--noconfig {
    background: rgba(245,158,11,0.12);
    color: #fcd34d;
    border-color: rgba(245,158,11,0.3);
}
.hw-pill--regularity-ok {
    background: rgba(34,197,94,0.14);
    color: #86efac;
    border-color: rgba(34,197,94,0.3);
}
.hw-pill--regularity-warning {
    background: rgba(245,158,11,0.14);
    color: #fcd34d;
    border-color: rgba(245,158,11,0.3);
}
.hw-pill--regularity-bad {
    background: rgba(239,68,68,0.14);
    color: #fca5a5;
    border-color: rgba(239,68,68,0.3);
}

/* ── Banner de despacho sugerido ──────────────────────────── */
.hw-dispatch-banner {
    margin: 12px 16px 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(56,189,248,0.08);
    border: 1px solid rgba(56,189,248,0.25);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.hw-dispatch-banner--soon {
    background: rgba(245,158,11,0.1);
    border-color: rgba(245,158,11,0.3);
}
.hw-dispatch-banner--urgent {
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.4);
    animation: pulseUrgent 1.6s ease-in-out infinite;
}
@keyframes pulseUrgent {
    0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.0); }
    50%     { box-shadow: 0 0 0 4px rgba(239,68,68,0.15); }
}
.hw-dispatch-banner-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.hw-dispatch-banner-text i { color: var(--accent); }
.hw-dispatch-banner--soon   .hw-dispatch-banner-text i { color: #f59e0b; }
.hw-dispatch-banner--urgent .hw-dispatch-banner-text i { color: #ef4444; }
.hw-dispatch-meta {
    font-size: 0.74rem;
    color: var(--text-muted);
    padding-left: 22px;
}
.hw-bunching-alert {
    margin: 8px 16px 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(239,68,68,0.1);
    color: #fca5a5;
    font-size: 0.78rem;
    border: 1px solid rgba(239,68,68,0.25);
}
.hw-bunching-alert i { margin-right: 6px; }
.hw-noconfig {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 18px 12px;
}
.hw-noconfig i { display: block; margin-bottom: 8px; opacity: 0.6; }

/* ── Panel de buses disponibles ───────────────────────────── */
.hw-available-panel {
    margin: 10px 16px 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0,0,0,0.18);
    border: 1px dashed rgba(255,255,255,0.08);
}
.hw-available-title {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.hw-available-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.hw-available-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.72rem;
    color: var(--text);
}

/* ── Timeline de buses por ruta ───────────────────────────── */
.hw-tl-wrap {
    padding: 12px 16px 16px;
    overflow-x: auto;
}
.hw-tl-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.hw-tl-header-info { width: 220px; flex-shrink: 0; }
.hw-tl-header-track {
    flex: 1;
    position: relative;
    height: 26px;
}
.hw-tl-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    border-radius: 2px;
    transform: translateY(-50%);
    opacity: 0.5;
}
.hw-tl-stop {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 2;
}
.hw-tl-stop--above .hw-tl-stop-label { order: -1; }
.hw-tl-stop-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--accent);
}
.hw-tl-stop--endpoint .hw-tl-stop-dot {
    width: 13px;
    height: 13px;
    background: var(--accent);
}
.hw-tl-stop-label {
    font-size: 0.58rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    background: var(--bg-card);
    padding: 1px 4px;
    border-radius: 3px;
}

/* ── Fila de bus ─────────────────────────────────────────── */
.hw-tl-bus-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.hw-tl-bus-row:first-of-type { border-top: none; }
.hw-tl-bus-info {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.hw-lane-light {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    border-radius: 8px;
    min-width: 40px;
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.hw-lane-light-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.hw-lane-light--ok      { color: #22c55e; background: rgba(34,197,94,0.12); }
.hw-lane-light--warn    { color: #f59e0b; background: rgba(245,158,11,0.12); }
.hw-lane-light--bad     { color: #ef4444; background: rgba(239,68,68,0.12); }
.hw-lane-light--leader  { color: #38bdf8; background: rgba(56,189,248,0.12); }
.hw-lane-light--offline { color: #64748b; background: rgba(100,116,139,0.12); }
.hw-lane-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hw-lane-title {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.hw-tl-bus-name { font-weight: 700; color: var(--text); font-size: 0.85rem; }
.hw-tl-bus-plate {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.05);
    padding: 1px 6px;
    border-radius: 4px;
}
.hw-lane-sub {
    display: flex;
    gap: 10px;
    font-size: 0.68rem;
    color: var(--text-muted);
}
.hw-lane-online       { color: var(--accent); }
.hw-lane-online--off  { color: #64748b; }
.hw-lane-online--on   { color: var(--accent); }
.hw-lane-speed i,
.hw-lane-prog i { margin-right: 3px; opacity: 0.7; }
.hw-lane-hw {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    min-width: 60px;
}
.hw-lane-hw-val { font-size: 0.95rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.hw-lane-hw-lbl { font-size: 0.55rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }
.hw-lane-hw--ok     { background: rgba(34,197,94,0.10); }
.hw-lane-hw--warn   { background: rgba(245,158,11,0.10); }
.hw-lane-hw--bad    { background: rgba(239,68,68,0.10); }
.hw-lane-hw--leader { background: rgba(56,189,248,0.10); }

/* ── Track de bus en timeline ────────────────────────────── */
.hw-tl-bus-track {
    flex: 1;
    position: relative;
    height: 36px;
}
.hw-tl-bus-rail {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: rgba(255,255,255,0.08);
    transform: translateY(-50%);
    border-radius: 1px;
}
.hw-tl-passage {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}
.hw-tl-passage-time {
    font-size: 0.6rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 1px 4px;
    border-radius: 3px;
}
.hw-tl-passage--ok        .hw-tl-passage-time { color: #22c55e; }
.hw-tl-passage--late      .hw-tl-passage-time { color: #ef4444; }
.hw-tl-passage--early     .hw-tl-passage-time { color: #38bdf8; }

/* ── Carro SVG ────────────────────────────────────────────── */
.hw-tl-car {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    z-index: 3;
    transition: left 0.4s ease;
}
.hw-tl-car-svg { width: 100%; height: auto; display: block; }
.hw-tl-car-body   { fill: var(--accent); }
.hw-tl-car-cabin  { fill: rgba(255,255,255,0.85); }
.hw-tl-car-wheel  { fill: #1f2937; }
.hw-tl-car--warn   .hw-tl-car-body { fill: #f59e0b; }
.hw-tl-car--bad    .hw-tl-car-body { fill: #ef4444; }
.hw-tl-car--leader .hw-tl-car-body { fill: #38bdf8; }
.hw-tl-car-label {
    display: block;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 2px;
}
.hw-tl-car-absent {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0.5;
}

/* ── Modal de configuración de intervalo ─────────────────── */
.hw-modal-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hw-modal-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}
.hw-modal-field label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hw-modal-field input {
    background: rgba(0,0,0,0.25);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 0.95rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.hw-modal-field input:focus { outline: none; border-color: var(--accent); }


/* ═══ COMMAND CENTER (cc-*) ═══════════════════════════════════ */
/* Panel de operaciones por ruta usado dentro del Monitor.        */

.cc-kpi-strip {
    display: flex;
    gap: 8px;
    padding: 10px 16px 14px;
    flex-wrap: wrap;
}
.cc-kpi {
    flex: 1;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
}
.cc-kpi-val { font-size: 1.4rem; font-weight: 800; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }
.cc-kpi-lbl { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.cc-kpi-sub { font-size: 0.62rem; color: var(--text-muted); opacity: 0.7; margin-top: 2px; }
.cc-kpi--enruta     { border-color: rgba(0,184,148,0.4); }
.cc-kpi--enruta     .cc-kpi-val { color: var(--accent); }
.cc-kpi--listo      { border-color: rgba(56,189,248,0.4); }
.cc-kpi--listo      .cc-kpi-val { color: #7dd3fc; }
.cc-kpi--disponible { border-color: rgba(255,255,255,0.1); }
.cc-kpi--finalizado { border-color: rgba(34,197,94,0.3); }
.cc-kpi--finalizado .cc-kpi-val { color: #86efac; }
.cc-kpi--offline    { border-color: rgba(100,116,139,0.3); }
.cc-kpi--offline    .cc-kpi-val { color: #94a3b8; }

/* ── Tarjetas de ruta del CC ─────────────────────────────── */
.cc-route-card {
    margin: 0 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.cc-route-card--alert { border-color: rgba(239,68,68,0.4); }
.cc-route-stripe {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 4px;
    background: var(--accent);
}
.cc-route-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 12px 22px;
    border-bottom: 1px solid var(--border);
}
.cc-route-identity { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.cc-route-texts { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cc-route-title { font-weight: 700; color: var(--text); font-size: 0.9rem; }
.cc-route-meta { font-size: 0.7rem; color: var(--text-muted); }
.cc-route-actions { display: flex; gap: 6px; }
.cc-config-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 4px 10px;
    color: var(--text-muted);
    font-size: 0.72rem;
    cursor: pointer;
}
.cc-config-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.cc-route-empty { padding: 16px; color: var(--text-muted); font-size: 0.82rem; text-align: center; }

/* ── Próximo despacho (pill grande) ───────────────────────── */
.cc-next-dispatch {
    margin: 10px 16px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(0,184,148,0.08);
    border: 1px solid rgba(0,184,148,0.25);
    display: flex;
    align-items: center;
    gap: 10px;
}
.cc-next-dispatch--soon   { background: rgba(245,158,11,0.10); border-color: rgba(245,158,11,0.3); }
.cc-next-dispatch--urgent { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.4); }
.cc-dispatch-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-dispatch-btn {
    margin-left: auto;
    padding: 7px 16px;
    background: var(--accent);
    color: #062f22;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
}
.cc-dispatch-btn:hover { filter: brightness(1.1); }
.cc-dispatch-btn--urgent { background: #ef4444; color: #fff; }
.cc-dr-section { display: flex; flex-direction: column; gap: 2px; }
.cc-toggle-btn, .cc-group-toggle {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
}

/* ── Tarjeta de bus ──────────────────────────────────────── */
.cc-bus-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.cc-bus-num   { font-weight: 800; color: var(--text); font-size: 0.9rem; }
.cc-bus-plate { font-size: 0.7rem; color: var(--text-muted); }
.cc-bus-speed { font-size: 0.68rem; color: var(--text-muted); }
.cc-bus-status-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cc-bus-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.66rem;
    font-weight: 600;
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
}
.cc-bus-ign { font-size: 0.62rem; color: var(--text-muted); }
.cc-bus-ign--on { color: #22c55e; font-weight: 700; }
.cc-bus-pin {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
    display: inline-block;
}
.cc-bus-pin-dot { background: currentColor; }
.cc-bus-pin-lbl { font-size: 0.62rem; color: var(--text-muted); margin-left: 4px; }

/* ── Carrusel/grilla de slots de despacho ─────────────────── */
.cc-cv-section { padding: 8px 16px 14px; }
.cc-cv-hdr {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0 8px;
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.cc-cv-hdr-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
}
.cc-cv-hdr-name { font-weight: 700; color: var(--text); text-transform: none; letter-spacing: 0; font-size: 0.82rem; }
.cc-cv-hdr-stats { margin-left: auto; }
.cc-cv-hdr-count {
    background: rgba(0,184,148,0.12);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.66rem;
    font-weight: 700;
}
.cc-cv-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
}
.cc-cv-slot {
    min-width: 130px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}
.cc-cv-slot--clickable { cursor: pointer; transition: all 0.15s; }
.cc-cv-slot--clickable:hover { transform: translateY(-1px); border-color: var(--accent); }
.cc-cv-slot--empty { background: rgba(255,255,255,0.02); border-style: dashed; opacity: 0.7; }
.cc-cv-slot--enruta     { border-color: rgba(0,184,148,0.4); }
.cc-cv-slot--asignado   { border-color: rgba(56,189,248,0.4); }
.cc-cv-slot--finalizado { border-color: rgba(34,197,94,0.3); opacity: 0.7; }
.cc-cv-slot--diferido   { border-color: rgba(245,158,11,0.4); }
.cc-cv-slot--cancelado  { border-color: rgba(239,68,68,0.4); opacity: 0.6; }
.cc-cv-time { font-weight: 800; font-size: 0.95rem; color: var(--text); font-variant-numeric: tabular-nums; }
.cc-cv-time--actual { color: var(--accent); font-size: 0.72rem; font-weight: 600; }
.cc-cv-num { font-size: 0.78rem; color: var(--text); font-weight: 700; }
.cc-cv-plate { font-size: 0.66rem; color: var(--text-muted); }
.cc-cv-meta { display: flex; gap: 6px; align-items: center; font-size: 0.62rem; color: var(--text-muted); }
.cc-cv-ign { color: var(--text-muted); }
.cc-cv-ign--on { color: #22c55e; font-weight: 700; }
.cc-cv-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 99px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.cc-cv-badge--enruta     { background: rgba(0,184,148,0.18);  color: var(--accent); }
.cc-cv-badge--asignado   { background: rgba(56,189,248,0.18); color: #7dd3fc; }
.cc-cv-badge--finalizado { background: rgba(34,197,94,0.18);  color: #86efac; }
.cc-cv-badge--diferido   { background: rgba(245,158,11,0.18); color: #fcd34d; }
.cc-cv-badge--cancelado  { background: rgba(239,68,68,0.18);  color: #fca5a5; }
.cc-cv-empty-body { color: var(--text-muted); font-size: 0.7rem; font-style: italic; padding: 8px 0; text-align: center; }
.cc-cv-foot { font-size: 0.62rem; color: var(--text-muted); margin-top: 2px; }
.cc-cv-body { display: flex; flex-direction: column; gap: 2px; }

/* ── Brecha entre despachos ──────────────────────────────── */
.cc-gap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.66rem;
    font-weight: 700;
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
}
.cc-gap--ok   { color: #22c55e; background: rgba(34,197,94,0.12); }
.cc-gap--warn { color: #f59e0b; background: rgba(245,158,11,0.12); }
.cc-gap--bad  { color: #ef4444; background: rgba(239,68,68,0.12); }
.cc-gap-lbl { font-size: 0.55rem; opacity: 0.7; text-transform: uppercase; }

/* ── Panel lateral de flota ──────────────────────────────── */
.cc-fleet-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
}
.cc-fleet-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.cc-fleet-title { font-weight: 700; color: var(--text); font-size: 0.85rem; }
.cc-fleet-search-wrap {
    flex: 1;
    position: relative;
}
.cc-fleet-search-wrap input {
    width: 100%;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 5px 10px;
    color: var(--text);
    font-size: 0.78rem;
    outline: none;
}
.cc-fleet-body { padding: 10px 14px 14px; }
.cc-fleet-section--enruta     .cc-fleet-section-dot { background: var(--accent); }
.cc-fleet-section--listo      .cc-fleet-section-dot { background: #7dd3fc; }
.cc-fleet-section--disponible .cc-fleet-section-dot { background: var(--text-muted); }
.cc-fleet-section--finalizado .cc-fleet-section-dot { background: #86efac; }
.cc-fleet-section--offline    .cc-fleet-section-dot { background: #64748b; }
.cc-fleet-section-hdr {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.4px;
}
.cc-fleet-section-dot { width: 8px; height: 8px; border-radius: 50%; }
.cc-fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}
.cc-body--fleet-only .cc-fleet-panel { display: block; }

/* ── Track horizontal con intervalos (regularidad) ──────── */
.cc-track-wrap { padding: 8px 16px 14px; }
.cc-track {
    position: relative;
    height: 8px;
    border-radius: 99px;
    background: rgba(255,255,255,0.05);
    overflow: hidden;
}
.cc-track-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: var(--accent);
    border-radius: 99px;
}
.cc-track-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.62rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .hw-tl-bus-info,
    .hw-tl-header-info { width: 160px; }
    .hw-summary-kpi    { min-width: 70px; padding: 4px 10px; }
    .cmt-table         { font-size: 0.72rem; }
    .cmt-th-stop       { min-width: 70px; }
}
@media (max-width: 640px) {
    .hw-tl-bus-row { flex-direction: column; align-items: stretch; }
    .hw-tl-bus-info, .hw-tl-header-info { width: 100%; }
    .hw-tl-header-track, .hw-tl-bus-track { min-width: 480px !important; }
    .cc-kpi-strip { padding: 8px; }
    .cc-kpi { min-width: 90px; padding: 8px 10px; }
}

/* ═══ MODAL ASIGNAR BUS — Buscador + Tarjetas ════════════════ */

.cu-assign-toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}
.cu-assign-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
}
.cu-assign-search:focus-within { border-color: var(--accent); }
.cu-assign-search i.fa-search { color: var(--text-muted); font-size: 0.82rem; }
.cu-assign-search input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
}
.cu-assign-search input::placeholder { color: var(--text-muted); opacity: 0.7; }
.cu-assign-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 6px;
    border-radius: 4px;
}
.cu-assign-clear:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.cu-assign-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cu-assign-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.cu-assign-chip i { font-size: 0.66rem; }
.cu-assign-chip:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.cu-assign-chip.is-active {
    background: rgba(0,184,148,0.16);
    color: var(--accent);
    border-color: rgba(0,184,148,0.45);
}

.cu-assign-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.cu-as-stat b { color: var(--text); margin-right: 3px; font-weight: 700; }
.cu-as-stat--ready  b { color: #22c55e; }
.cu-as-stat--online b { color: var(--accent); }
.cu-as-stat--free   b { color: #7dd3fc; }
.cu-as-stat--match  b { color: #fcd34d; }

.cu-assign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    max-height: 56vh;
    overflow-y: auto;
    padding: 4px 2px 8px;
}

.cu-assign-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.cu-assign-empty i { color: #f59e0b; font-size: 1.1rem; }

/* ── Tarjetas de bus ─────────────────────────────────────── */
.cu-as-card {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-muted);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
    font: inherit;
}
.cu-as-card:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: rgba(0,184,148,0.06);
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.cu-as-card:active { transform: translateY(0); }
.cu-as-card--ready    { border-left-color: #22c55e; }
.cu-as-card--online   { border-left-color: var(--accent); }
.cu-as-card--offline  { border-left-color: #64748b; opacity: 0.85; }
.cu-as-card--inuse    { border-left-color: #f59e0b; }
.cu-as-card--inuse:hover { border-color: #f59e0b; background: rgba(245,158,11,0.06); }

.cu-as-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.cu-as-card-id {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.cu-as-card-id > i { color: var(--accent); font-size: 0.85rem; }
.cu-as-card-name {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text);
}
.cu-as-card-plate {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 5px;
    font-size: 0.74rem;
    font-family: 'Plus Jakarta Sans', monospace, system-ui;
    color: var(--text);
    letter-spacing: 0.4px;
    align-self: flex-start;
}

.cu-as-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.cu-as-badge i { font-size: 0.6rem; }
.cu-as-badge--ready   { background: rgba(34,197,94,0.18);  color: #86efac; }
.cu-as-badge--online  { background: rgba(0,184,148,0.16);  color: var(--accent); }
.cu-as-badge--offline { background: rgba(100,116,139,0.18); color: #94a3b8; }
.cu-as-badge--inuse   { background: rgba(245,158,11,0.18); color: #fcd34d; }

.cu-as-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cu-as-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 99px;
    font-size: 0.66rem;
    color: var(--text-muted);
}
.cu-as-stat-pill i { font-size: 0.6rem; }

.cu-as-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px dashed rgba(255,255,255,0.06);
    font-size: 0.66rem;
    color: var(--text-muted);
}
.cu-as-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cu-as-card-meta i { color: var(--text-muted); opacity: 0.7; }

.cu-as-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
}
.cu-as-row--alert {
    background: rgba(245,158,11,0.10);
    color: #fcd34d;
    border: 1px solid rgba(245,158,11,0.25);
}
.cu-as-row--alert i { font-size: 0.72rem; }

@media (max-width: 640px) {
    .cu-assign-grid { grid-template-columns: 1fr; max-height: 60vh; }
    .cu-assign-summary { font-size: 0.66rem; }
}

/* ═══ MONITOR EN VIVO (lm-*) ════════════════════════════════════ */
/* Vista simple: lista de buses en ruta ahora con su recorrido por
   geocercas. Reemplaza al antiguo "Monitor de Regularidad". */

.lm-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.lm-summary-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 12px;
    border-right: 1px solid rgba(255,255,255,0.06);
}
.lm-summary-kpi:last-of-type { border-right: none; }
.lm-summary-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.lm-summary-lbl {
    font-size: 0.66rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.lm-summary-tip {
    margin-left: auto;
    font-size: 0.74rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.lm-summary-tip i { color: #38bdf8; }

.lm-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.lm-empty i { font-size: 2.4rem; opacity: 0.4; display: block; margin-bottom: 14px; }
.lm-empty-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.lm-empty-sub { font-size: 0.85rem; max-width: 460px; margin: 0 auto; }

/* ── Sección por ruta ──────────────────────────────────────── */
.lm-group {
    margin-bottom: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.lm-group-hdr {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    border-left: 4px solid var(--rc, var(--accent));
    background: linear-gradient(90deg, rgba(255,255,255,0.04), transparent);
}
.lm-group-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--rc, var(--accent));
    flex-shrink: 0;
}
.lm-group-name {
    font-weight: 700;
    color: var(--text);
    font-size: 0.92rem;
    flex: 1;
    min-width: 0;
}
.lm-group-count {
    background: rgba(0,184,148,0.12);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
}
.lm-group-body {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 12px;
    padding: 14px 16px;
}

/* ── Split: cards + map ────────────────────────────────────── */
.lm-group-split {
    display: grid;
    grid-template-columns: minmax(380px, 0.9fr) minmax(0, 1.5fr);
    gap: 0;
    align-items: stretch;
}
.lm-group-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    align-content: start;
    border-right: 1px solid var(--border);
    max-height: 760px;
    overflow-y: auto;
}
.lm-group-cards::-webkit-scrollbar { width: 6px; }
.lm-group-cards::-webkit-scrollbar-track { background: transparent; }
.lm-group-cards::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 99px; }
.lm-group-map-wrap {
    position: relative;
    min-height: 520px;
    background: #eef2f6;
}
.lm-group-map {
    position: absolute;
    inset: 0;
}
.lm-group-map .leaflet-container {
    background: #eef2f6;
    font-family: inherit;
}
.lm-group-map .leaflet-marker-icon { background: transparent; border: none; }
.lm-group-map .lm-stop-divicon { background: transparent !important; border: none !important; }
.lm-group-map .leaflet-bar a {
    background: #fff;
    color: #1f2937;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(15,23,42,0.10);
}
.lm-group-map .leaflet-bar a:hover {
    background: #f3f4f6;
    color: #0ea5e9;
}
.lm-map-badge {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    color: #1f2937;
    border: 1px solid rgba(0,0,0,0.08);
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    pointer-events: none;
    display: flex;
    gap: 8px;
    align-items: center;
    box-shadow: 0 4px 14px rgba(15,23,42,0.10);
}
.lm-map-badge .lm-map-badge-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--rc, var(--accent));
    box-shadow: 0 0 0 3px rgba(255,255,255,0.95), 0 0 0 4px var(--rc, var(--accent));
}

/* Leyenda de buses (colores) en esquina inferior izquierda del mapa */
.lm-map-legend {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 500;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    padding: 6px 10px;
    box-shadow: 0 4px 14px rgba(15,23,42,0.10);
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
}
.lm-legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #1f2937;
    font-weight: 700;
}
.lm-legend-swatch {
    width: 14px;
    height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}
.lm-legend-swatch--line {
    width: 22px;
    height: 4px;
    border-radius: 0;
    position: relative;
    overflow: hidden;
    /* superponemos una máscara con dashes para que se vea punteado */
    -webkit-mask-image: repeating-linear-gradient(to right, #000 0 5px, transparent 5px 9px);
            mask-image: repeating-linear-gradient(to right, #000 0 5px, transparent 5px 9px);
}
.lm-legend-num {
    font-variant-numeric: tabular-nums;
}
.lm-legend-divider {
    height: 1px;
    margin: 2px 0;
    background: rgba(0,0,0,0.08);
}
.lm-legend-stop {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-sizing: border-box;
    flex-shrink: 0;
}
.lm-legend-stop--passed {
    background: #10b981;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #10b981;
}
.lm-legend-stop--next {
    background: #f59e0b;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #f59e0b;
}
.lm-legend-stop--future {
    background: #fff;
    border: 2px dashed #94a3b8;
}

@media (max-width: 1100px) {
    .lm-group-split {
        display: flex;
        flex-direction: column;
    }
    /* Móvil/tablet: MAPA ARRIBA, lista de buses ABAJO */
    .lm-group-map-wrap {
        order: 1;
        min-height: 380px;
        height: 50vh;
        max-height: 520px;
        border-bottom: 1px solid var(--border);
    }
    .lm-group-cards {
        order: 2;
        border-right: none;
        border-bottom: none;
        max-height: none;
        padding: 12px;
        gap: 10px;
    }
    /* Leyenda más compacta para no estorbar el mapa pequeño */
    .lm-map-legend {
        padding: 4px 8px;
        font-size: 0.66rem;
        gap: 3px;
        bottom: 8px;
        left: 8px;
    }
    .lm-map-badge {
        font-size: 0.7rem;
        padding: 4px 10px;
        top: 8px;
    }
}

@media (max-width: 600px) {
    /* Pantallas muy pequeñas (móvil portrait) */
    .lm-group-map-wrap {
        height: 45vh;
        min-height: 320px;
    }
    .lm-summary {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 12px;
    }
    .lm-summary-kpi { padding: 4px 10px; border-right: 1px solid var(--border); }
    .lm-summary-val { font-size: 1.1rem; }
    .lm-summary-lbl { font-size: 0.62rem; }
    .lm-summary-tip {
        flex-basis: 100%;
        font-size: 0.7rem;
        margin-top: 4px;
        padding-top: 6px;
        border-top: 1px solid var(--border);
    }
    .lm-group-hdr { padding: 10px 12px; }
    .lm-group-name { font-size: 0.85rem; }
    .lm-card-top {
        grid-template-columns: auto 1fr auto;
        gap: 8px;
        padding: 10px 12px 8px;
    }
    .lm-card-avatar { width: 36px; height: 36px; font-size: 0.95rem; }
    .lm-card-bus-num { font-size: 1.05rem; }
    .lm-card-elapsed-big { font-size: 1.2rem; }
    .lm-card-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .lm-card-stats > .lm-card-stat:nth-child(n+5) { display: none; }
    .lm-row {
        grid-template-columns: 22px 1fr auto;
        font-size: 0.74rem;
        padding: 4px 6px;
    }
    .lm-row-name { font-size: 0.74rem; }
    .lm-row-time { font-size: 0.74rem; }
}

/* ── Marcador de bus estilo Moovit/Maps ──────────────────── */
.lm-bus-marker {
    width: 44px;
    height: 44px;
    position: relative;
}
.lm-bus-disc {
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--bc, #10b981);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.74rem;
    border: 2.5px solid #fff;
    box-shadow: 0 3px 10px rgba(15,23,42,0.30);
    letter-spacing: 0.3px;
    z-index: 2;
}
.lm-bus-marker.is-off .lm-bus-disc { background: #94a3b8; }
.lm-bus-marker.is-idle .lm-bus-disc { background: #f59e0b; }
.lm-bus-disc-num { line-height: 1; }

.lm-bus-heading {
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}
.lm-bus-heading::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 10px solid var(--bc, #10b981);
    filter: drop-shadow(0 -1px 2px rgba(15,23,42,0.25));
}
.lm-bus-marker.is-off .lm-bus-heading::before { border-bottom-color: #94a3b8; }
.lm-bus-marker.is-idle .lm-bus-heading::before { border-bottom-color: #f59e0b; }

.lm-bus-speed {
    position: absolute;
    bottom: -7px;
    right: -5px;
    background: #fff;
    color: var(--bc, #10b981);
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 99px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.25);
    border: 1.5px solid var(--bc, #10b981);
    line-height: 1.1;
    z-index: 3;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.lm-bus-pulse {
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--bc, #10b981);
    opacity: 0.30;
    animation: lmBusPulse 1.6s ease-out infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes lmBusPulse {
    0%   { transform: scale(0.6); opacity: 0.50; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* ── Marcador de parada — círculo perfecto ─────────────────── */
.lm-stop-divicon {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
/* FUTURA (default): círculo hueco con borde punteado, claramente "pendiente" */
.lm-stop-marker {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.85);
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px dashed #94a3b8;
    box-shadow: 0 1px 3px rgba(15,23,42,0.10);
    box-sizing: border-box;
    line-height: 1;
    aspect-ratio: 1 / 1;
    backdrop-filter: blur(2px);
}
/* PASADA: relleno sólido del color del bus / ruta */
.lm-stop-marker--passed-ok {
    background: var(--rc, #10b981);
    color: #fff;
    border: 3px solid #fff;
    font-weight: 800;
    font-size: 0.86rem;
    box-shadow: 0 2px 8px rgba(15,23,42,0.30), 0 0 0 2.5px var(--rc, #10b981);
}
/* PRÓXIMA: círculo naranja pulsante */
.lm-stop-marker--next {
    background: #f59e0b;
    color: #fff;
    border: 3px solid #fff;
    font-weight: 800;
    font-size: 0.86rem;
    box-shadow: 0 2px 8px rgba(15,23,42,0.30), 0 0 0 2.5px #f59e0b;
    animation: lmStopNextPulse 1.4s ease-in-out infinite;
}
@keyframes lmStopNextPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(15,23,42,0.30), 0 0 0 2.5px #f59e0b, 0 0 0 5px rgba(245,158,11,0.30); }
    50%      { box-shadow: 0 2px 8px rgba(15,23,42,0.30), 0 0 0 2.5px #f59e0b, 0 0 0 12px rgba(245,158,11,0); }
}
/* ORIGEN siempre verde (también si todavía no salió) */
.lm-stop-marker--origin {
    background: #10b981;
    color: #fff;
    border: 3px solid #fff;
    font-weight: 800;
    font-size: 0.86rem;
    border-style: solid !important;
    box-shadow: 0 2px 8px rgba(15,23,42,0.30), 0 0 0 2.5px #10b981;
}
/* DESTINO: rojo si futuro (hueco) o sólido si llegó */
.lm-stop-marker--dest {
    background: rgba(255,255,255,0.85);
    color: #ef4444;
    border: 2.5px dashed #ef4444;
    font-size: 0.78rem;
}
.lm-stop-marker--dest.lm-stop-marker--passed-ok {
    background: #ef4444;
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(15,23,42,0.30), 0 0 0 2.5px #ef4444;
}

.lm-stop-marker { transition: transform 0.15s ease; }
.lm-stop-divicon:hover .lm-stop-marker { transform: scale(1.18); }

/* Tooltip enriquecido — listado de pases al pasar el mouse */
.lm-stop-tooltip {
    background: #fff !important;
    color: #1f2937 !important;
    border: 1px solid rgba(15,23,42,0.10) !important;
    border-radius: 10px !important;
    padding: 10px 12px !important;
    font-size: 0.78rem !important;
    box-shadow: 0 6px 20px rgba(15,23,42,0.18) !important;
    min-width: 180px;
}
.lm-stop-tooltip::before { display: none !important; }
.lm-stop-tt-title {
    font-weight: 800;
    color: #0f172a;
    font-size: 0.82rem;
    line-height: 1.2;
    margin-bottom: 1px;
}
.lm-stop-tt-sub {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 8px;
}
.lm-stop-tt-passes {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px dashed rgba(15,23,42,0.12);
    padding-top: 6px;
}
.lm-stop-tt-pass {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.74rem;
}
.lm-stop-tt-time {
    font-weight: 700;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}
.lm-stop-tt-bus {
    font-weight: 800;
    color: #fff;
    background: var(--rc, #10b981);
    padding: 1px 8px;
    border-radius: 99px;
    font-size: 0.7rem;
}
.lm-stop-tt-empty {
    font-size: 0.74rem;
    color: #94a3b8;
    font-style: italic;
    border-top: 1px dashed rgba(15,23,42,0.12);
    padding-top: 6px;
}

/* ── Card seleccionada (focus por mapa) ──────────────────── */
.lm-card.lm-card--focus {
    border-color: var(--accent) !important;
    background: rgba(0,210,255,0.10) !important;
    box-shadow: 0 0 0 2px rgba(0,210,255,0.35);
}

.lm-bus-popup {
    font-size: 0.78rem;
    line-height: 1.45;
    color: #1f2937;
}
.lm-bus-popup b { color: #0ea5e9; }
.lm-bus-popup .lm-bp-row { margin-top: 3px; color: #4b5563; }
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 6px 18px rgba(15,23,42,0.18) !important;
}

/* ── Tarjeta de bus ────────────────────────────────────────── */
.lm-card {
    text-align: left;
    width: 100%;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-left: 4px solid var(--rc, var(--accent));
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s;
    font: inherit;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lm-card:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: rgba(0,184,148,0.05);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.lm-card-hdr {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.lm-card-bus {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lm-card-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--text-muted);
    flex-shrink: 0;
}
.lm-card-dot--on  { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.6); }
.lm-card-dot--off { background: #64748b; }
.lm-card-num {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text);
}
.lm-card-num i { color: var(--accent); font-size: 0.95rem; }
.lm-card-plate {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.78rem;
    font-family: 'Plus Jakarta Sans', monospace, system-ui;
    letter-spacing: 0.4px;
}
.lm-card-times {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
    font-size: 0.74rem;
    line-height: 1.25;
}
.lm-card-time-prog { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.lm-card-time-real { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.lm-card-elapsed {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(56,189,248,0.12);
    color: #7dd3fc;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.66rem;
    font-weight: 700;
    margin-top: 2px;
}
.lm-card-elapsed i { font-size: 0.6rem; }

.lm-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.7rem;
}
.lm-card-ign,
.lm-card-speed {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(0,0,0,0.2);
    color: var(--text-muted);
    border-radius: 99px;
}
.lm-card-ign { color: #22c55e; }
.lm-card-ign--off { color: var(--text-muted); }

/* (Bloque legacy de timeline antiguo eliminado — reemplazado por .lm-row*) */

@media (max-width: 720px) {
    .lm-group-body { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════
   TARJETAS DE BUS REDISEÑADAS — Timeline compacto con color por bus
   ═══════════════════════════════════════════════════════════════════ */
.lm-card {
    text-align: left;
    width: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 4px solid var(--bc, #10b981);
    border-radius: 12px;
    padding: 0;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    font: inherit;
    overflow: hidden;
}
.lm-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.30);
    border-color: var(--bc, #10b981);
}
.lm-card.lm-card--focus {
    box-shadow: 0 0 0 2px var(--bc, #10b981), 0 8px 24px rgba(0,0,0,0.35) !important;
}

/* Top: avatar + identificación + minutos en ruta */
.lm-card-top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 12px 14px 10px;
    align-items: center;
    background: linear-gradient(90deg, color-mix(in srgb, var(--bc, #10b981) 14%, transparent), transparent 70%);
}
.lm-card-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bc, #10b981);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--bc, #10b981) 35%, transparent);
    flex-shrink: 0;
}
.lm-card-id { min-width: 0; }
.lm-card-id-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.lm-card-bus-num {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.3px;
}
.lm-card-plate {
    background: rgba(255,255,255,0.08);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
}
.lm-card-meta-line {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    margin-top: 3px;
    color: var(--text-muted);
}
.lm-card-meta-line i { font-size: 0.55rem; margin-right: 3px; }
.lm-card-conn.is-online { color: #22c55e; }
.lm-card-conn.is-offline { color: #94a3b8; }
.lm-card-ign.is-on { color: #22c55e; }
.lm-card-ign.is-off { color: #94a3b8; }
.lm-card-spd { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.lm-card-sep { opacity: 0.4; }

.lm-card-elapsed-wrap { text-align: right; line-height: 1; }
.lm-card-elapsed-big {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--bc, #10b981);
    font-variant-numeric: tabular-nums;
}
.lm-card-elapsed-big span {
    font-size: 0.7rem;
    margin-left: 2px;
    color: var(--text-muted);
    font-weight: 600;
}
.lm-card-elapsed-lbl {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-top: 1px;
}
.lm-card-elapsed-pending {
    font-size: 0.7rem;
    color: #f59e0b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Stats strip */
.lm-card-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 1px;
    background: rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.lm-card-stat {
    background: rgba(0,0,0,0.18);
    padding: 6px 8px;
    text-align: center;
    line-height: 1.1;
}
.lm-card-stat-val {
    display: block;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.lm-card-stat-tot { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }
.lm-card-stat-lbl {
    display: block;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 600;
}
.lm-card-stat--delay .lm-card-stat-val { font-size: 0.78rem; }
.lm-card-stat--a_tiempo .lm-card-stat-val { color: #4ade80; }
.lm-card-stat--leve .lm-card-stat-val { color: #fbbf24; }
.lm-card-stat--demorado .lm-card-stat-val { color: #f87171; }
.lm-card-stat--quemado .lm-card-stat-val { color: #f87171; }
.lm-card-stat--adelantado .lm-card-stat-val { color: #38bdf8; }

/* Filas de paradas — timeline compacto */
.lm-rows {
    padding: 6px 8px 10px;
    display: flex;
    flex-direction: column;
}
.lm-row {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    transition: background 0.1s;
}
.lm-row + .lm-row { margin-top: 2px; }
.lm-row:hover { background: rgba(255,255,255,0.05); }
.lm-row-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    flex-shrink: 0;
}
.lm-row.is-past .lm-row-dot {
    background: var(--bc, #10b981);
    color: #fff;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--bc, #10b981) 25%, transparent);
}
.lm-row.is-past .lm-row-dot i { font-size: 0.55rem; }
.lm-row.is-next .lm-row-dot {
    background: #f59e0b;
    color: #fff;
    animation: lmRowPulse 1.4s ease-in-out infinite;
}
.lm-row.is-future .lm-row-dot {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    border: 1px dashed rgba(255,255,255,0.18);
}
@keyframes lmRowPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.6); }
    50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); }
}

.lm-row-name {
    color: var(--text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.lm-row.is-future .lm-row-name { color: var(--text-muted); font-weight: 500; }
.lm-row.is-next .lm-row-name { color: #fbbf24; font-weight: 700; }

.lm-row-tag {
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.lm-row-tag--origin { background: rgba(34,197,94,0.18); color: #86efac; }
.lm-row-tag--dest   { background: rgba(239,68,68,0.20); color: #fca5a5; }
.lm-row-tag--next   { background: rgba(245,158,11,0.22); color: #fcd34d; }

.lm-row-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.lm-row-time {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--text);
    font-size: 0.78rem;
}
.lm-row-time.is-eta { color: #fbbf24; }
.lm-row-time.is-future { color: var(--text-muted); font-weight: 500; }
.lm-row-delay {
    font-variant-numeric: tabular-nums;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 99px;
}
.lm-row-delay--a_tiempo  { background: rgba(34,197,94,0.18);  color: #4ade80; }
.lm-row-delay--leve      { background: rgba(245,158,11,0.20); color: #fbbf24; }
.lm-row-delay--demorado  { background: rgba(239,68,68,0.20);  color: #f87171; }
.lm-row-delay--quemado   { background: rgba(185,28,28,0.28);  color: #fca5a5; }
.lm-row-delay--adelantado{ background: rgba(56,189,248,0.20); color: #38bdf8; }
.lm-row-delay--sin_dato  { display: none; }
