/* ═══ MI HISTORIAL (Basilisco Driver) · 2026-11-24 (SW v137) — PLAN_EJECUCION_HISTORIAL_EN_DRIVER.md (F3) ═══
   Mismo lenguaje que el menú (menu.css): vidrio oscuro, azul eléctrico, Orbitron en títulos y Space Mono en las horas.
   Los colores por tipo de evento son los del historial del conductor de la web (src/modules/conductor/historial.css), así la
   oficina y el chofer reconocen lo mismo de un vistazo. Sin color-mix (teléfonos con WebView antiguo): tonos con rgba. */
.mh-screen { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px 28px; }
.mh-screen > * { flex-shrink: 0; }
.mh-screen [hidden] { display: none !important; }

/* ── Selector de día: queda pegado arriba al bajar por la línea de tiempo ── */
.mh-dia {
  position: sticky; top: 0; z-index: 500; display: flex; align-items: center; gap: 8px; padding: 6px;
  border-radius: 16px; background: rgba(13, 18, 32, 0.94); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.mh-flecha {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; cursor: pointer;
  color: var(--blue-electric); background: rgba(0, 212, 255, 0.08); border: 1px solid rgba(0, 212, 255, 0.28);
}
.mh-flecha svg { width: 22px; height: 22px; }
.mh-flecha:disabled { color: #3a4256; background: transparent; border-color: rgba(255, 255, 255, 0.06); cursor: default; }
.mh-flecha:not(:disabled):active { transform: scale(0.94); background: rgba(0, 212, 255, 0.16); }
.mh-dia-txt {
  position: relative; flex: 1; min-width: 0; min-height: 48px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px; text-align: center; border-radius: 12px; cursor: pointer;
}
.mh-dia-txt:active { background: rgba(255, 255, 255, 0.04); }
.mh-dia-nombre { font-family: var(--font-display); font-size: 1rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-primary); }
.mh-dia-fecha { font-size: 0.92rem; color: var(--text-dim); }
/* El calendario del teléfono: invisible encima del día (tocar el día lo abre) */
.mh-dia-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; }
.mh-flecha:focus-visible, .mh-dia-txt:focus-within, .mh-ev--mapa:focus-visible, .mh-link:focus-visible, .mh-btn:focus-visible {
  outline: 2px solid #ffffff; outline-offset: 2px;
}

/* ── Avisos (sin señal, viajes que no se pudieron calcular) ── */
.mh-aviso {
  padding: 10px 12px; border-radius: 12px; font-size: 0.95rem; line-height: 1.35; color: #ffe08a;
  background: rgba(255, 204, 0, 0.08); border: 1px solid rgba(255, 204, 0, 0.32);
}
.mh-aviso p { margin: 0; }
.mh-aviso p + p { margin-top: 6px; }

/* ── Resumen: kilómetros y tiempo al volante arriba, grandes ── */
.mh-resumen { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mh-dato {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 11px 12px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--glass-border);
}
.mh-dato b {
  font-family: var(--font-display); font-size: 1.02rem; letter-spacing: 0.3px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mh-dato > span { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: var(--text-dim); }
.mh-dato > small { font-size: 0.86rem; line-height: 1.25; color: #aab3c5; overflow-wrap: anywhere; }
/* Unidad chica junto al número (h, min, km): el dato cabe entero en teléfonos angostos */
.mh-dato b .mh-u { font-family: var(--font-body); font-size: 0.66em; font-weight: 700; letter-spacing: 0.3px; color: #9fb4cc; }
.mh-dato--grande { background: linear-gradient(160deg, rgba(0, 212, 255, 0.13), rgba(0, 132, 255, 0.04)); border-color: rgba(0, 212, 255, 0.3); }
.mh-dato--grande b { font-size: 1.4rem; color: #e9fbff; }
.mh-dato--vacio { background: rgba(255, 255, 255, 0.02); border-color: rgba(255, 255, 255, 0.06); }
.mh-dato--vacio b { color: #5b6478; }
.mh-dato--ancho { grid-column: 1 / -1; flex-direction: row; align-items: baseline; gap: 10px; }

/* ── Mapa del día: sus viajes y los puntos con lugar ── */
.mh-mapa {
  height: 210px; border-radius: 16px; overflow: hidden; background: #1b2436; border: 1px solid var(--glass-border);
  isolation: isolate;
}
.mh-mapa-l { width: 100%; height: 100%; }

/* ── Línea de tiempo ── */
.mh-linea {
  display: flex; flex-direction: column; padding: 4px 10px; border-radius: 16px; background: var(--glass);
  border: 1px solid var(--glass-border);
}
.mh-ev {
  --tono: #8b9ab3; --tono-fondo: rgba(139, 154, 179, 0.1); --tono-borde: rgba(139, 154, 179, 0.28);
  display: grid; grid-template-columns: 44px 34px minmax(0, 1fr); align-items: start; gap: 9px; width: 100%;
  padding: 10px 2px; margin: 0; text-align: left; color: inherit; font: inherit; background: none; border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mh-ev:last-child { border-bottom: 0; }
.mh-ev--mapa { cursor: pointer; border-radius: 10px; }
.mh-ev--mapa:active { background: rgba(0, 212, 255, 0.07); }
.mh-ev-hora { padding-top: 8px; font-family: var(--font-mono); font-size: 0.84rem; color: var(--text-dim); }
.mh-ev-ico {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--tono);
  background: var(--tono-fondo); border: 1px solid var(--tono-borde);
}
.mh-ev-ico svg { width: 18px; height: 18px; }
.mh-ev-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-top: 3px; }
.mh-ev-tit { font-size: 1.02rem; font-weight: 700; line-height: 1.22; color: var(--text-primary); overflow-wrap: anywhere; }
.mh-ev-det { font-size: 0.92rem; line-height: 1.3; color: #aab3c5; overflow-wrap: anywhere; }
.mh-ev--mapa .mh-ev-tit::after { content: ' ›'; color: var(--blue-electric); font-weight: 400; }
.mh-ev[data-tipo="viaje"], .mh-ev[data-tipo="toma"], .mh-ev[data-tipo="parada"], .mh-ev[data-tipo="relevo"] {
  --tono: #00d4ff; --tono-fondo: rgba(0, 212, 255, 0.1); --tono-borde: rgba(0, 212, 255, 0.32);
}
.mh-ev[data-tipo="aviso"], .mh-ev[data-tipo="checkin"] { --tono: #ffcc00; --tono-fondo: rgba(255, 204, 0, 0.09); --tono-borde: rgba(255, 204, 0, 0.3); }
.mh-ev[data-tipo="sos"] { --tono: #ff3355; --tono-fondo: rgba(255, 51, 85, 0.1); --tono-borde: rgba(255, 51, 85, 0.35); }
.mh-ev[data-tipo="exceso"] { --tono: #ff9f1a; --tono-fondo: rgba(255, 159, 26, 0.1); --tono-borde: rgba(255, 159, 26, 0.32); }
.mh-chip {
  align-self: flex-start; margin-top: 2px; padding: 2px 9px; border-radius: 99px; font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.3px; color: #aab3c5; background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.mh-chip--ok { color: #6fe6ff; background: rgba(0, 212, 255, 0.08); border-color: rgba(0, 212, 255, 0.32); }
.mh-chip--aviso { color: #ffd84d; background: rgba(255, 204, 0, 0.08); border-color: rgba(255, 204, 0, 0.32); }
.mh-chip--alerta { color: #ff6b85; background: rgba(255, 51, 85, 0.08); border-color: rgba(255, 51, 85, 0.35); }

/* ── Vacío, error, carga y enlace a RUTAS PASADAS ── */
.mh-vacio {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 12px; text-align: center;
  color: var(--text-dim); font-size: 0.95rem; line-height: 1.35;
}
.mh-vacio b { font-size: 1.02rem; color: var(--text-primary); }
.mh-error b { color: #ff8a9e; }
.mh-btn {
  margin-top: 8px; min-height: 46px; padding: 0 22px; border-radius: 12px; cursor: pointer; font-weight: 700;
  letter-spacing: 0.6px; color: #04101e; background: linear-gradient(135deg, #2ee6ff, #0084ff); border: 0;
}
.mh-cargando .mh-resumen, .mh-cargando .mh-linea { opacity: 0.55; transition: opacity 0.2s; }
.mh-link {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; padding: 0 14px;
  border-radius: 14px; cursor: pointer; font-size: 0.86rem; font-weight: 700; letter-spacing: 0.6px; color: var(--text-primary);
  background: var(--glass); border: 1px solid var(--glass-border);
}
.mh-link-ico { display: grid; place-items: center; color: var(--blue-electric); }
.mh-link-ico svg { width: 20px; height: 20px; }
.mh-link:active { background: rgba(0, 212, 255, 0.07); }

@media (max-width: 340px) {
  .mh-screen { padding: 10px 10px 24px; gap: 10px; }
  .mh-ev { grid-template-columns: 40px 30px minmax(0, 1fr); gap: 7px; }
  .mh-ev-ico { width: 30px; height: 30px; }
  .mh-dato--grande b { font-size: 1.22rem; }
  .mh-flecha { width: 44px; height: 44px; }
}
