/* Rutas en vivo (20/10/2026, simplificada): mapa MapLibre a pantalla completa. Ver js/rutas_vivo.js. */
.rv-caja { position: relative; height: calc(100vh - 120px); min-height: 480px; border-radius: var(--radius-md); overflow: hidden; background: #0b1220;
           border: 1px solid var(--border-card); }
.rv-caja .rv-mapa { position: absolute !important; inset: 0; width: 100%; height: 100%; }   /* la hoja de MapLibre lo pone en relative */
.rv-cargando { height: 100%; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; color: var(--text-secondary); }
.rv-spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--border-card); border-top-color: var(--accent-primary); animation: rv-gira .9s linear infinite; }
@keyframes rv-gira { to { transform: rotate(360deg); } }

/* Cifras arriba; botón y leyenda abajo */
.rv-cifras { position: absolute; top: 14px; left: 14px; right: 330px; display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none; z-index: 2; }
.rv-cifra, .rv-boton, .rv-leyenda { background: rgba(11, 18, 32, .85); border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; color: #e2e8f0; font-size: var(--letra-md); }
.rv-cifra { padding: 7px 12px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.rv-cifra i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.rv-abajo { position: absolute; left: 14px; right: 330px; bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; z-index: 2; }
.rv-boton { padding: 8px 14px; cursor: pointer; font-weight: 600; }
.rv-boton:hover { border-color: #009fe3; }
.rv-boton.rv-on { background: #009fe3; border-color: #009fe3; color: #fff; }
.rv-leyenda { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 12px; font-size: var(--letra-sm); color: #cbd5e1; }
.rv-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.rv-leyenda i { display: inline-block; }
.rv-l-hecho { width: 22px; height: 5px; border-radius: 3px; background: #22c55e; }
.rv-l-prevista { width: 22px; height: 0; border-top: 4px dashed rgba(56, 189, 248, .8); }
.rv-l-salida { width: 10px; height: 10px; border-radius: 50%; background: #0b1220; border: 3px solid #22c55e; }
.rv-l-hueco { width: 22px; height: 0; border-top: 3px dotted #cbd5e1; }
.rv-l-destino { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 3px solid #009fe3; }
.rv-l-aviso { width: 16px; height: 16px; border-radius: 5px; background: #f59e0b; color: #111; font-style: normal; font-weight: 800; font-size: var(--letra-2xs); text-align: center; line-height: 16px; }

/* Panel */
.rv-panel { position: absolute; top: 14px; right: 14px; bottom: 14px; width: 300px; z-index: 2; display: flex; flex-direction: column; gap: 10px; padding: 12px;
            background: rgba(11, 18, 32, .9); border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; }
.rv-buscar { width: 100%; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px; color: #e2e8f0; padding: 9px 12px; font-size: var(--letra-md); outline: none; }
.rv-buscar:focus { border-color: #009fe3; }
.rv-lista { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.rv-vacio { color: #94a3b8; font-size: var(--letra-md); padding: 16px 6px; text-align: center; }
.rv-tarjeta { border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; padding: 11px; cursor: pointer; }
.rv-tarjeta:hover { border-color: rgba(0, 159, 227, .6); }
.rv-tarjeta-sel { border: 2px solid #009fe3; background: rgba(0, 159, 227, .08); }
.rv-t-cab { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.rv-t-nombre { color: #f1f5f9; font-weight: 700; font-size: var(--letra-lg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-t-estado { font-size: var(--letra-xs); font-weight: 700; white-space: nowrap; }
.rv-t-sub { color: #cbd5e1; font-size: var(--letra-sm); margin: 4px 0 8px; }
.rv-barra { height: 6px; border-radius: 9px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.rv-barra span { display: block; height: 100%; border-radius: 9px; background: #009fe3; transition: width 1s ease; }
.rv-t-pie { display: flex; justify-content: space-between; color: #94a3b8; font-size: var(--letra-xs); margin-top: 5px; }
.rv-llego { color: #4ade80; font-weight: 600; }
.rv-t-hueco { color: #94a3b8; }
.rv-t-aviso { margin-top: 7px; color: #fbbf24; font-size: var(--letra-sm); }
.rv-t-aviso.rv-grave { color: #fca5a5; }
.rv-t-detalle { margin-top: 9px; padding-top: 9px; border-top: 1px solid rgba(255, 255, 255, .1); color: #cbd5e1; font-size: var(--letra-sm); display: flex; flex-direction: column; gap: 4px; }
.rv-t-detalle a { color: #38bdf8; }
.rv-finalizar { margin-top: 6px; align-self: flex-start; background: none; border: 1px solid #f87171; color: #f87171; border-radius: 8px; padding: 5px 12px; font-size: var(--letra-sm); cursor: pointer; }
.rv-finalizar:hover { background: rgba(248, 113, 113, .12); }

/* Conductores. .rv-marca la coloca MapLibre (con transform): los efectos van en .rv-avatar, dentro. */
.rv-marca { width: 66px; height: 50px; cursor: pointer; --c: #22c55e; }
.rv-marca.rv-parado { --c: #f59e0b; }
.rv-marca.rv-sin_senal { --c: #94a3b8; }
.rv-avatar { position: relative; width: 66px; height: 50px; transition: transform .2s ease; }
/* El vehículo en 3/4 (camión, autobús o furgoneta); debajo, un halo con el color de su estado; la foto, arriba a la derecha (20/10/2026) */
.rv-vehiculo { position: absolute; inset: 0; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .55)); }
.rv-vehiculo svg { width: 66px; height: 50px; display: block; transition: transform .3s ease; }
.rv-vehiculo.rv-oeste svg { transform: scaleX(-1); }
.rv-vehiculo .rv-v-halo { fill: var(--c); opacity: .55; }
.rv-sin_senal .rv-vehiculo { filter: grayscale(1) brightness(.85) drop-shadow(0 3px 4px rgba(0, 0, 0, .55)); opacity: .8; }
.rv-sel .rv-vehiculo { filter: drop-shadow(0 0 6px rgba(0, 159, 227, .95)) drop-shadow(0 3px 4px rgba(0, 0, 0, .55)); }
.rv-sel .rv-vehiculo .rv-v-halo { opacity: .85; }
.rv-marca:hover .rv-avatar, .rv-sel .rv-avatar { transform: scale(1.2); }
.rv-cara { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; display: flex; align-items: center;
           justify-content: center; background: #1e293b; border: 2px solid var(--c); color: #fff; font-weight: 700; font-size: var(--letra-2xs);
           box-shadow: 0 2px 8px rgba(0, 0, 0, .6); }
.rv-cara:not(.rv-con-foto) { display: none; }
.rv-cara img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rv-etiqueta { position: absolute; top: 50px; left: 50%; transform: translateX(-50%); white-space: nowrap; background: rgba(11, 18, 32, .9); color: #f1f5f9;
               font-size: var(--letra-xs); font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .12); pointer-events: none; }
.rv-sel .rv-etiqueta { background: #009fe3; border-color: #009fe3; color: #fff; }

/* Salida, destino y avisos del elegido */
.rv-salida { display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.rv-salida-texto { background: #0b1220; color: #e2e8f0; font-size: var(--letra-xs); font-weight: 700; padding: 4px 9px; border-radius: 8px; border: 2px solid #22c55e; white-space: nowrap;
                   box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.rv-salida-pin { width: 14px; height: 14px; border-radius: 50%; background: #0b1220; border: 4px solid #22c55e; }
.rv-destino { display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.rv-destino-texto { background: #fff; color: #0b1220; font-size: var(--letra-sm); font-weight: 700; padding: 5px 10px; border-radius: 8px; white-space: nowrap; text-align: center; line-height: 1.25;
                    box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.rv-destino-texto small { display: block; font-weight: 500; color: #475569; font-size: var(--letra-2xs); }
.rv-destino-pin { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid #009fe3; }
/* Paradas intermedias de un DeCA con varios destinos */
.rv-parada { display: flex; align-items: center; gap: 6px; pointer-events: none; }
.rv-parada-n { width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #0b1220; font-size: var(--letra-xs); font-weight: 800; display: flex; align-items: center; justify-content: center;
               border: 3px solid #009fe3; box-shadow: 0 3px 10px rgba(0, 0, 0, .5); }
.rv-parada-texto { background: rgba(11, 18, 32, .9); color: #e2e8f0; font-size: var(--letra-xs); font-weight: 600; padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.rv-parada-hecha .rv-parada-n { background: #16a34a; border-color: #16a34a; color: #fff; }
.rv-parada-hecha .rv-parada-texto { color: #86efac; }
.rv-parada-toca .rv-parada-n { background: #009fe3; color: #fff; }
.rv-aviso { width: 24px; height: 24px; border-radius: 7px; background: #f59e0b; color: #111; font-weight: 800; font-size: var(--letra-md); display: flex; align-items: center; justify-content: center;
            cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, .45); }
.rv-aviso-grave { background: #ef4444; color: #fff; }
.rv-popup .maplibregl-popup-content { background: #0b1220; color: #e2e8f0; border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; font-size: var(--letra-sm); padding: 8px 12px; }
.rv-popup .maplibregl-popup-tip { border-top-color: #0b1220 !important; border-bottom-color: #0b1220 !important; }
.rv-caja .maplibregl-ctrl-group { background: rgba(11, 18, 32, .85); border: 1px solid rgba(255, 255, 255, .1); }
.rv-caja .maplibregl-ctrl-group button + button { border-top-color: rgba(255, 255, 255, .1); }
.rv-caja .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.rv-caja .maplibregl-ctrl-bottom-right { right: 324px; }
/* La fila de abajo acaba antes del zoom (+/−): la leyenda en dos líneas tapaba el «−». */
.rv-caja .rv-abajo { right: 376px; }
.rv-caja .maplibregl-ctrl-attrib { background: rgba(11, 18, 32, .7); color: #94a3b8; }
.rv-caja .maplibregl-ctrl-attrib a { color: #94a3b8; }

@media (max-width: 768px) {
  .rv-caja { height: calc(100vh - 100px); }
  .rv-panel { top: auto; left: 10px; right: 10px; bottom: 10px; width: auto; height: 42%; }
  .rv-cifras { right: 14px; }
  .rv-caja .rv-abajo { right: 60px; bottom: calc(42% + 20px); }
  .rv-leyenda { display: none; }
  .rv-caja .maplibregl-ctrl-bottom-right { right: 0; bottom: calc(42% + 14px); }
}

/* Lo avisado al conductor (incidencias por delante) */
.rv-t-avisado { margin-top: 6px; font-size: var(--letra-xs); color: #93c5fd; }
.rv-t-avisado b { color: #4ade80; font-weight: 600; }
.rv-t-avisado-no { color: #94a3b8; }

/* Conductores que no salen en el mapa por la APP (21/10/2026) */
.rv-sinapp { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 6; max-width: min(560px, 46%);
             display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; padding: 9px 12px 9px 14px;
             background: rgba(11, 18, 32, .92); color: #f1f5f9; border: 1px solid #f59e0b; border-radius: 12px; font-size: var(--letra-md);
             box-shadow: 0 6px 20px rgba(0, 0, 0, .45); }
.rv-sinapp[hidden] { display: none; }
.rv-sinapp:hover { background: rgba(30, 41, 59, .95); }
.rv-sinapp.rv-sinapp-deca { border-color: #ef4444; }
.rv-sinapp small { color: #cbd5e1; font-size: var(--letra-xs); }
.rv-sinapp-icono { font-size: var(--letra-xl); }
.rv-sinapp-x { margin-left: 4px; padding: 2px 6px; border-radius: 6px; color: #94a3b8; }
.rv-sinapp-x:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.rv-sa h2 { margin: 0 0 6px; }
.rv-sa-intro { color: var(--text-secondary); margin: 0 0 14px; }
.rv-sa-lista { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.rv-sa-fila { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border-subtle); border-radius: 12px; }
.rv-sa-cara { position: relative; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: flex; align-items: center;
              justify-content: center; background: var(--bg-input); font-weight: 700; color: var(--text-muted); }
.rv-sa-cara img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rv-sa-texto { flex: 1; min-width: 0; }
.rv-sa-nombre { font-weight: 700; }
.rv-sa-emp { font-weight: 400; color: var(--text-muted); }
.rv-sa-deca { margin-left: 6px; font-size: var(--letra-xs); font-weight: 600; padding: 1px 8px; border-radius: 99px; background: rgba(239, 68, 68, .15); color: #ef4444; }
.rv-sa-estado { font-weight: 600; margin-top: 2px; }
.rv-sa-detalle { color: var(--text-secondary); font-size: var(--letra-sm); margin-top: 2px; }
.rv-sa-hacer { font-size: var(--letra-sm); margin-top: 6px; }
.rv-sa-accion { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 190px; text-align: right; }
.rv-sa-nota { font-size: var(--letra-xs); color: var(--text-muted); }
.rv-sa-ok { color: #22c55e; font-weight: 600; }
.rv-sa-error { color: #ef4444; }
@media (max-width: 1100px) { .rv-sinapp { top: 58px; max-width: calc(100% - 32px); } }
