/* Monitoreo GPS e integración con GPS Control */
.gps-actualizado { align-self: center; font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.gps-cuerpo { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: stretch; }
.gps-lista { display: flex; flex-direction: column; gap: 10px; padding: 14px; height: 640px; min-width: 0; }
.gps-lista input[type="search"] { border: 1px solid var(--linea); border-radius: 10px; padding: 9px 12px; background: #fff; color: var(--tinta); font: inherit; font-size: 12.5px; }
:root[data-tema="noche"] .gps-lista input[type="search"] { background: var(--panel-secundario); }
.gps-filtros { display: flex; flex-wrap: wrap; gap: 6px; }
.gps-chip { border: 1px solid var(--linea); background: #fff; color: var(--tinta); border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.gps-chip b { color: var(--brillo); margin-left: 2px; }
.gps-chip.activa { background: var(--azul); border-color: var(--azul); color: #fff; }
.gps-chip.activa b { color: #fff; }
:root[data-tema="noche"] .gps-chip { background: var(--panel-secundario); }
:root[data-tema="noche"] .gps-chip.activa { background: #1e88d8; border-color: #1e88d8; }
.gps-items { flex: 1; overflow: auto; display: grid; gap: 6px; align-content: start; padding-right: 2px; }
.gps-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--linea); border-radius: 12px; padding: 9px 11px; background: #fff; color: var(--tinta); font: inherit; cursor: pointer; }
:root[data-tema="noche"] .gps-item { background: var(--panel); }
.gps-item:hover { border-color: rgba(30, 136, 216, .55); }
.gps-item.activa { border-color: var(--brillo); box-shadow: 0 0 0 2px rgba(30, 136, 216, .2); }
.gps-punto { width: 11px; height: 11px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.gps-item-c { display: grid; gap: 1px; min-width: 0; }
.gps-item-c b { font-size: 13px; letter-spacing: .02em; }
.gps-item-c small { font-size: 10.5px; color: var(--muted); }
.gps-dir { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tenue) !important; }
.gps-item-d { text-align: right; font-size: 10px; color: var(--tenue); display: grid; gap: 2px; }
.gps-item-d em { font-style: normal; font-weight: 800; color: var(--brillo); }
.gps-alerta { font-style: normal; display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--rojo); color: #fff; font-size: 10px; font-weight: 800; vertical-align: 1px; }
.gps-mapa-caja { position: relative; padding: 0; overflow: hidden; height: 640px; }
.gps-mapa { position: absolute; inset: 0; background: #cfe3f1; }
.gps-capas { position: absolute; z-index: 600; top: 12px; left: 12px; display: flex; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 18px rgba(11, 42, 68, .25); }
.gps-capas button { border: 0; background: #fff; padding: 7px 12px; font: inherit; font-size: 11.5px; font-weight: 700; color: var(--navy); cursor: pointer; }
.gps-capas button.activa { background: var(--azul); color: #fff; }
.gps-recorrido { position: absolute; z-index: 600; left: 12px; bottom: 12px; right: 12px; background: rgba(255, 255, 255, .96); color: #0b2a44; border-radius: 14px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(11, 42, 68, .3); max-width: 560px; }
.gps-recorrido[hidden] { display: none; }
:root[data-tema="noche"] .gps-recorrido { background: rgba(17, 31, 44, .96); color: var(--tinta); }
.gps-rec-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.gps-rec-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gps-rec-kpi span { display: block; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.gps-rec-kpi b { font-size: 15px; }
.gps-pin { background: none; border: 0; }
.gps-pin-i { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .45); display: grid; place-items: center; transition: transform .15s; }
.gps-pin-i.asig { box-shadow: 0 0 0 3px #1e88d8, 0 3px 10px rgba(0, 0, 0, .45); }
.gps-pin-i.sel { transform: scale(1.3); z-index: 10; }
.gps-pin-i svg { width: 16px; height: 16px; fill: #fff; }
.gps-pin-i span { width: 8px; height: 8px; border-radius: 50%; background: #fff; opacity: .9; }
.gps-tip { font-weight: 800; font-size: 11px; letter-spacing: .04em; padding: 2px 7px; }
.gps-pop { min-width: 250px; color: #0b2a44; font-family: inherit; }
.gps-pop h4 { margin: 0 0 6px; font-size: 16px; letter-spacing: .04em; }
.gps-pop h4 small { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #5b7a92; margin-left: 4px; }
.gps-pop table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 8px; }
.gps-pop th { text-align: left; color: #5b7a92; font-weight: 600; padding: 3px 8px 3px 0; vertical-align: top; white-space: nowrap; width: 1%; background: none; text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.gps-pop td { padding: 3px 0; color: #0b2a44; border: 0; }
.gps-alerta-pop { margin: 0 0 6px; padding: 5px 8px; border-radius: 8px; background: #ffe7e9; color: #8a1018; font-size: 11.5px; font-weight: 700; }
.gps-ver-recorrido { width: 100%; padding: 9px 12px !important; font-size: 11px !important; }
/* línea corta de GPS en tarjetas, tablas y viajes */
.gps-linea { display: inline-grid; grid-template-columns: auto 1fr; gap: 1px 7px; align-items: center; font-size: 11px; line-height: 1.35; }
.gps-linea i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); grid-row: span 2; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.gps-linea b { color: var(--tinta); font-size: 11.5px; }
.gps-linea em { grid-column: 2; font-style: normal; color: var(--muted); font-size: 10.5px; }
.gps-linea.sin { color: var(--tenue); display: inline; }
.gps-bloque { padding: 8px 10px; border-radius: 10px; background: var(--panel-secundario); border: 1px solid var(--linea); }
.piloto-paneles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
code { background: rgba(30, 136, 216, .12); border-radius: 5px; padding: 1px 5px; font-size: .92em; }
@media (max-width: 1100px) { .gps-cuerpo { grid-template-columns: 1fr; } .gps-lista { height: 380px; } .gps-mapa-caja { height: 520px; } .piloto-paneles { grid-template-columns: 1fr; } }
/* La ventana del mapa es siempre clara: sus tablas no heredan los colores del modo noche */
.leaflet-popup .gps-pop th { background: transparent !important; color: #5b7a92 !important; border: 0 !important; }
.leaflet-popup .gps-pop td { color: #0b2a44 !important; border: 0 !important; background: transparent !important; }
.gps-capas button { color: #0b2a44; }
.gps-capas button.activa { color: #fff; background: #0b2a44; }
:root[data-tema="noche"] .gps-capas button.activa { background: #1e88d8; }
/* Mapa vectorial (MapLibre): pines, burbujas agrupadas, ventana y modo noche */
.gps-mapa .maplibregl-canvas { outline: none; }
:root[data-tema="noche"] .gps-mapa:not(.sat) .maplibregl-canvas { filter: invert(.92) hue-rotate(180deg) brightness(.92) contrast(.95); }
.gps-pin { cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.gps-pin-t { margin-top: 3px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, .95); color: #0b2a44; font-size: 10.5px; letter-spacing: .04em; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); white-space: nowrap; }
.gps-cluster { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #1e88d8; color: #fff; font-weight: 800; font-size: 15px; border: 4px solid rgba(255, 255, 255, .95); box-shadow: 0 0 0 4px rgba(30, 136, 216, .28), 0 4px 12px rgba(0, 0, 0, .35); cursor: pointer; }
.gps-cluster.alerta { background: #d0283a; box-shadow: 0 0 0 4px rgba(225, 29, 46, .28), 0 4px 12px rgba(0, 0, 0, .35); }
.gps-punta { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.maplibregl-popup-content { border-radius: 14px; padding: 14px 16px; box-shadow: 0 12px 34px rgba(11, 42, 68, .35); }
.maplibregl-popup .gps-pop th { background: transparent !important; color: #5b7a92 !important; border: 0 !important; }
.maplibregl-popup .gps-pop td { color: #0b2a44 !important; border: 0 !important; background: transparent !important; }
.gps-lista select { border: 1px solid var(--linea); border-radius: 10px; padding: 9px 12px; background: #fff; color: var(--tinta); font: inherit; font-size: 12.5px; }
:root[data-tema="noche"] .gps-lista select { background: var(--panel-secundario); }
/* Base Huachipa, giro 360°, sentido y horas del recorrido */
.gps-base { display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.gps-base span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #0b2a44; color: #fff; font-size: 17px; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); }
.gps-base b { margin-top: 3px; padding: 1px 7px; border-radius: 6px; background: #0b2a44; color: #fff; font-size: 10.5px; letter-spacing: .05em; white-space: nowrap; }
.gps-flecha { width: 22px; height: 22px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.gps-flecha svg { width: 22px; height: 22px; fill: #fff; stroke: #1e88d8; stroke-width: 2; }
.gps-parada { display: flex; align-items: center; gap: 5px; }
.gps-parada i { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #d98a0b; color: #fff; font-style: normal; font-weight: 800; font-size: 12px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.gps-parada b, .gps-extremo b { padding: 1px 7px; border-radius: 6px; background: rgba(255, 255, 255, .96); color: #0b2a44; font-size: 10.5px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.gps-extremo { display: flex; align-items: center; gap: 5px; }
.gps-extremo span { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.gps-hover .maplibregl-popup-content { padding: 6px 10px; font-size: 12px; color: #0b2a44; border-radius: 9px; }
.gps-pista { margin: 6px 0 8px; font-size: 10.5px; color: var(--muted); }
/* Más vida y claridad: colores vivos, pulso en unidades en movimiento y mapa grande en Inicio */
:root[data-tema="noche"] .gps-mapa:not(.sat) .maplibregl-canvas, :root[data-tema="noche"] .inicio-mapa-lienzo .maplibregl-canvas { filter: invert(.92) hue-rotate(180deg) brightness(.92) contrast(.95); }
.gps-pin.mov .gps-pin-i { position: relative; }
.gps-pin.mov .gps-pin-i::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 3px solid var(--c); opacity: 0; animation: gps-pulso 1.8s ease-out infinite; pointer-events: none; }
@keyframes gps-pulso { 0% { transform: scale(1); opacity: .75; } 100% { transform: scale(2.3); opacity: 0; } }
.gps-pin-i { box-shadow: 0 3px 12px rgba(0, 0, 0, .4), 0 0 0 4px color-mix(in srgb, var(--c) 28%, transparent); }
.gps-cluster { background: linear-gradient(145deg, #3aa0ee, #1565c0); }
.gps-cluster.alerta { background: linear-gradient(145deg, #f0455a, #b0182a); }
.gps-mapa-caja, .inicio-mapa { box-shadow: 0 14px 40px rgba(30, 136, 216, .18); }
.inicio-mapa { padding: 0; overflow: hidden; margin: 0 0 16px; }
.inicio-mapa-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.inicio-mapa-cab h2 { margin: 2px 0 0; }
.inicio-mapa-acc { display: flex; gap: 8px; flex-wrap: wrap; }
.inicio-mapa-lienzo { height: clamp(460px, 68vh, 760px); background: #dcebf7; }
@media (max-width: 700px) { .inicio-mapa-lienzo { height: 360px; } }
/* Satélite con más claridad, brillo y color real */
.gps-mapa.sat .maplibregl-canvas, .mc-mapa.sat .maplibregl-canvas { filter: url(#tms-sat-fria) brightness(1.1) contrast(1.06) saturate(1.02); }
:root[data-tema="noche"] .gps-mapa.sat .maplibregl-canvas, :root[data-tema="noche"] .mc-mapa.sat .maplibregl-canvas { filter: url(#tms-sat-fria) brightness(1.02) contrast(1.08); }

.gps-indicadores-abajo { margin-top: 16px; margin-bottom: 0; }

.gps-calle { display: block; text-align: center; margin-top: 6px; font-size: 12px; color: #1e88d8; }
.tms-tooltip { background: #fff; color: #0b1a2b; border-radius: 8px; padding: 6px 10px; font-size: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.3); white-space: nowrap; margin-bottom: 14px; pointer-events: none; }

/* Cuadro de cada unidad (Google o mapa propio): siempre blanco, de día y de noche. Las etiquetas no se ponen azules y la letra queda más oscura (sin engrosarla). */
.gps-pop { color: #0b1a2b; }
.gps-pop table, .gps-pop table tr { background: transparent; border: 0; }
.gps-pop table th { background: transparent !important; color: #34475a !important; text-transform: none; letter-spacing: 0; border: 0; }
.gps-pop table td { background: transparent !important; color: #0b1a2b !important; border: 0; }
:root .gps-pop .etiqueta.gris { color: #55696d; background: #eaf0f4; }
:root .gps-pop .etiqueta.verde { color: #11734c; background: #e0f6ec; }
:root .gps-pop .etiqueta.ambar { color: #8a5608; background: #fff1d8; }
:root .gps-pop .etiqueta.rojo { color: #b3151d; background: #ffe7e9; }
:root .gps-pop .etiqueta.azul { color: #155c94; background: #e2f0fd; }
.gps-pop .gps-alerta-pop { color: #b3151d; }
