:root {
  --ink: #111827;
  --muted: #5f6b7a;
  --line: #e5e7eb;
  --paper: #f3f4f6;
  --card: #ffffff;
  --accent: #475f7b;
  --sidebar: #07111f;
  --oscuro: #07111f;
  --ok: #198754;
  --ok-bg: #d1e7dd;
  --bad: #be4646;
  --bad-bg: #f8d7da;
  --warm: #e8eef5;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  /* Fuentes del sistema: se ven igual de bien en todos los equipos sin descargar nada. */
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
code { font-size: 0.92em; }
h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }
h2 { font-size: 1.05rem; margin: 28px 0 8px; }
h3 { font-size: 1rem; margin: 18px 0 8px; }
.app { display: flex; min-height: 100vh; align-items: stretch; }
aside {
  width: 240px;
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: visible;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  color: #fff;
  padding: 22px 16px;
  z-index: 4;
}
.marca-app {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  margin: 0 0 22px;
}
.marca-app img { width: 36px; height: 36px; background: transparent; border-radius: 8px; }
.marca-app span { font-weight: 600; line-height: 1.15; }
aside nav { flex: 1; min-height: 0; overflow-y: auto; }
aside nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #cbd5e1;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 4px;
}
aside nav a.activo, aside nav a:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pie-menu { position: relative; margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
aside .contraer, aside .cuenta {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
aside .contraer:hover, aside .cuenta:hover { background: rgba(255, 255, 255, .16); }
aside .avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  font-weight: 600;
}
.cuenta-textos { min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.cuenta-textos strong { font-size: 0.92rem; }
.cuenta-textos small { color: rgba(255, 255, 255, .78); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cuenta-panel {
  position: absolute;
  left: calc(100% + 8px);
  bottom: 0;
  width: 230px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  z-index: 5;
}
.cuenta-panel p { margin: 0 0 4px; }
.cuenta-nombre { font-weight: 600; }
.cuenta-panel form { margin: 10px 0 0; }
.cuenta-panel button { width: 100%; }
aside.contraida { width: 76px; padding-left: 12px; padding-right: 12px; }
aside.contraida .marca-app { justify-content: center; }
aside.contraida .marca-app span,
aside.contraida .etiq,
aside.contraida .cuenta-textos { display: none; }
aside.contraida nav a,
aside.contraida .contraer,
aside.contraida .cuenta { justify-content: center; padding-left: 0; padding-right: 0; }
aside.contraida .contraer .ico { transform: rotate(180deg); }
.cuerpo { flex: 1; min-width: 0; width: 100%; padding: 24px 32px 48px; }
main { width: 100%; }
header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.titulo { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.titulo h1, .titulo h2 { margin: 0; }
.titulo .nota { margin: 4px 0 0; }
.seccion { margin-top: 28px; }
.nota { color: var(--muted); margin-top: 0; }
.aviso { padding: 10px 12px; border-radius: 8px; }
.aviso.ok { background: var(--ok-bg); color: var(--ok); }
.aviso.mal { background: var(--bad-bg); color: var(--bad); }
.franja { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--warm); border: 1px solid #c5d0de; color: var(--accent); border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; }
.botonera, .acciones-fila { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.botonera { justify-content: flex-end; }
.acciones-fila { justify-content: flex-end; }
.botonera form, .acciones-fila form, .franja form { margin: 0; }
.resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 18px 0; }
.resumen a {
  display: block;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
}
.resumen strong { display: block; font-size: 1.6rem; }
.resumen span { color: var(--muted); }
.tabla { width: 100%; overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid #f0f1f4; vertical-align: middle; overflow-wrap: break-word; }
.tabla tr:last-child td { border-bottom: 0; }
th { font-size: 0.82rem; color: #4b5563; font-weight: 600; background: #fafbfc; border-bottom-color: var(--line); }
td { font-size: 0.95rem; }
.tabla tbody tr:hover td { background: #f9fafb; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sin-salto { white-space: nowrap; }
.secundaria { display: block; font-size: 0.85rem; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.8rem; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.mal { background: var(--bad-bg); color: var(--bad); }
.panel { width: min(640px, 100%); background: white; border: 1px solid var(--line); border-radius: 10px; padding: 8px 20px 20px; }
.panel.ancho { width: auto; }
.correo-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 8px; }
.correo-previa { background: #f3f4f6; border-radius: 10px; padding: 16px; }
textarea { min-height: 220px; resize: vertical; }
@media (max-width: 860px) {
  .correo-grid { grid-template-columns: 1fr; }
}
label { display: block; margin: 12px 0; font-size: 0.92rem; }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font: inherit;
  background: white;
}
input[type="checkbox"] {
  display: inline-block;
  width: auto;
  margin: 0 6px 0 0;
  padding: 0;
  vertical-align: -1px;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
button, .boton {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
button.secundario, a.secundario { background: white; color: var(--ink); border: 1px solid #ced4da; }
button.peligro { background: white; color: var(--bad); border: 1px solid #e7b6b6; }
button.cerrar { background: transparent; color: var(--muted); border: 0; font-size: 1.5rem; line-height: 1; padding: 0 4px; }
.acciones-fila button { padding: 4px 10px; font-size: 0.88rem; }
dialog.modal {
  border: 0;
  padding: 0;
  margin: auto;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border-radius: 10px;
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(7, 17, 31, .35);
}
dialog.modal.ancha { width: min(680px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: rgba(7, 17, 31, .48); }
.modal-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-cabecera h2 { margin: 0; }
.modal-cuerpo { padding: 4px 18px 18px; }
.modal-acciones { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ingreso {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #07111f url("/marca/corp-fondo.jpg?v=oficina") center / cover no-repeat;
}
.tarjeta {
  width: min(100%, 400px);
  background: white;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
  padding: 32px 28px 28px;
}
.marca-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 22px;
  color: #3d4f68;
  font-size: 1.35rem;
  font-weight: 600;
}
.marca-login img { height: 40px; width: 40px; border-radius: 8px; }
.tarjeta h1 { margin: 4px 0 8px; font-size: 1.25rem; }
.tarjeta button { width: 100%; }
.tarjeta .secundario { width: auto; }
.fondo-marca {
  min-height: 100vh;
  margin: 0;
  background: #07111f url("/marca/corp-fondo.jpg?v=oficina") center / cover no-repeat;
}
#mapa { height: 420px; border-radius: 12px; border: 1px solid var(--line); }

/* App del teléfono: el mapa ocupa la pantalla y las acciones van en una hoja inferior. */
/* Fijo a los bordes de la ventana y no con 100dvh: instalada en Android 15, Chrome
   informa un 100dvh más alto que el área visible y la hoja queda bajo la barra de navegación. */
.telefono {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: min(100%, 480px);
  margin: 0 auto;
  overflow: hidden;
  background: #eceef1;
  color: #111827;
}
@media (min-width: 481px) {
  .telefono { box-shadow: 0 0 40px rgba(7, 17, 31, .35); }
}
.app-movil #mapa { position: absolute; inset: 0; height: auto; margin: 0; border: 0; border-radius: 0; z-index: 0; }
.app-movil .leaflet-tile-pane { filter: grayscale(.45) sepia(.45) hue-rotate(176deg) saturate(.55) brightness(1.08) contrast(.94); }
.app-movil .leaflet-top.leaflet-right { top: calc(60px + env(safe-area-inset-top)); right: auto; left: 8px; }
.app-movil .leaflet-control-attribution { font-size: 10px; max-width: 52vw; }

.barra-app {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 8px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--sidebar);
  color: #fff;
}
.barra-app img { width: 28px; height: 28px; border-radius: 8px; }
.barra-nombre { flex: 1; font-weight: 600; letter-spacing: -0.01em; }
.menu-app { position: relative; }
.menu-app summary {
  list-style: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.menu-app summary::-webkit-details-marker { display: none; }
.menu-app summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.menu-panel {
  position: absolute;
  top: calc(48px + env(safe-area-inset-top));
  right: 0;
  width: min(320px, calc(100vw - 32px));
  max-height: 70dvh;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(7, 17, 31, .22);
}
.menu-panel p { margin: 0 0 6px; }
.menu-nombre { font-size: 1.1rem; font-weight: 600; }
.menu-panel h2 { margin: 16px 0 6px; font-size: .95rem; }
.menu-panel form { margin: 0; }
.menu-panel button { width: 100%; margin-top: 10px; padding: 10px 14px; border-radius: 10px; }
.menu-panel .lista-viajes { font-size: .9rem; color: #374151; }

.estado-turno {
  position: absolute;
  top: calc(68px + env(safe-area-inset-top));
  right: 16px;
  z-index: 1100;
  height: 40px;
  margin: 0;
  padding: 0 16px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  box-shadow: 0 2px 10px rgba(7, 17, 31, .18);
  font-size: .9rem;
  font-weight: 600;
}
.estado-turno::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; }
.estado-turno.activo { background: var(--ok); color: #fff; }
.estado-turno.activo::before { background: #fff; }
.pista-mapa {
  position: absolute;
  top: calc(68px + env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  z-index: 1100;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  box-shadow: 0 2px 10px rgba(7, 17, 31, .12);
  font-size: .85rem;
  font-weight: 500;
  text-align: center;
}
.toast {
  position: absolute;
  top: calc(116px + env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  z-index: 1300;
  margin: 0;
  box-shadow: 0 4px 16px rgba(7, 17, 31, .18);
  pointer-events: none;
  animation: desvanecer 5s ease forwards;
}
@keyframes desvanecer {
  0%, 80% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}

.hoja {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  max-height: 78%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px calc(22px + env(safe-area-inset-bottom));
  background: var(--warm);
  border-radius: 0;
  border-top: 3px solid var(--accent);
  box-shadow: 0 -8px 24px rgba(7, 17, 31, .16);
}
.asa { display: none; }
.hoja h1 { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.hoja p { margin: 0; }
.hoja .nota { color: #5f6b7a; font-size: .95rem; }
.cabeza-hoja { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hoja form { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.hoja button { width: 100%; min-height: 52px; border-radius: 14px; font-size: 1.05rem; font-weight: 600; }
.hoja button[type="submit"]:not(.secundario):not(.texto):not(.texto-peligro) { min-height: 56px; background: var(--accent); }
.hoja button.secundario { background: #fff; color: #111827; border: 1px solid #c5d0de; }
.hoja button.texto,
.hoja button.texto-peligro { min-height: 44px; background: transparent; color: #374151; }
.hoja button.texto-peligro { color: var(--bad); }
.acciones { display: flex; flex-direction: column; gap: 4px; }

.trayecto { border: 1px solid #c5d0de; border-radius: 8px; background: #fff; }
.tramo { display: flex; align-items: center; gap: 14px; min-height: 58px; margin: 0; padding: 6px 16px; font-size: 1rem; }
.tramo + .tramo { border-top: 1px solid #e3e6ea; }
.tramo.solo { min-height: 0; padding: 0 4px; }
.tramo-textos { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.tramo-rotulo { font-size: .78rem; color: #5f6b7a; }
.tramo-valor { font-weight: 600; }
.tramo select { margin: 0; padding: 0; border: 0; background: transparent; color: #111827; font-weight: 600; }
.hoja .punto-recogida,
.hoja .punto-destino { flex: none; width: 12px; height: 12px; border: 0; }
.campo { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: .85rem; font-weight: 500; color: #5f6b7a; }
.campo input { margin: 0; height: 48px; padding: 0 14px; border: 1px solid #c5d0de; border-radius: 8px; background: #fff; color: #111827; font-size: 1rem; }

.anillos { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.tramo-anillo { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; color: #5f6b7a; }
.tramo-anillo .barra { height: 6px; border-radius: 3px; background: #c5d0de; }
.tramo-anillo.hecho .barra { background: var(--accent); }
.tramo-anillo.actual { color: var(--oscuro); font-weight: 600; }
.tramo-anillo.actual .barra { background: var(--oscuro); }
.pasos { list-style: none; margin: 0; padding: 0 0 0 4px; display: flex; flex-direction: column; font-size: .9rem; color: #5f6b7a; }
.pasos li { position: relative; padding: 7px 0 7px 22px; }
.pasos li::before { content: ""; position: absolute; left: 0; top: 12px; width: 10px; height: 10px; margin: 0; border-radius: 50%; background: #c5d0de; }
.pasos li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 24px; bottom: -8px; width: 2px; background: #c5d0de; }
.pasos li.hecho::before { background: var(--ok); }
.pasos li.hecho:not(:last-child)::after { background: var(--ok); }
.pasos li.actual { color: var(--oscuro); font-weight: 600; }
.pasos li.actual::before { background: var(--accent); box-shadow: 0 0 0 3px #d5e0ec; }

.tarjeta-persona { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 8px; background: #fff; border: 1px solid #c5d0de; }
.hoja .avatar { flex: none; width: 48px; height: 48px; border-radius: 8px; background: var(--warm); color: var(--accent); border: 1px solid #c5d0de; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 600; }
.persona-textos { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.persona-textos strong { font-size: 1.05rem; font-weight: 600; }
.persona-textos span { font-size: .9rem; color: #5f6b7a; }
.placa { flex: none; padding: 4px 8px; border: 2px solid #111827; border-radius: 8px; background: #fff; font-size: .95rem; font-weight: 700; letter-spacing: .06em; }
.hoja .placa { border-color: var(--accent); color: var(--oscuro); }
.etiqueta-estado { font-size: .9rem; font-weight: 600; color: var(--ok); }
.fila-titulo { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.navegar { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 8px; background: #fff; color: var(--accent); border: 1px solid #c5d0de; font-weight: 600; text-decoration: none; }

.oferta { display: flex; flex-direction: column; gap: 16px; }
.oferta + .oferta { padding-top: 16px; border-top: 1px solid #c5d0de; }
.reloj-oferta { display: flex; flex-direction: column; gap: 8px; }
.reloj-leyenda { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.reloj-leyenda .reloj { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent); }
.reloj-leyenda h1 { margin: 0; }
.reloj-pista { height: 6px; border-radius: 3px; background: #c5d0de; overflow: hidden; }
.reloj-pista .avance { display: block; height: 100%; width: 100%; border-radius: 3px; background: var(--accent); transform-origin: left center; }
.filtros { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; margin: 0 0 20px; }
.filtros label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 0.92rem; }
.filtros input { width: auto; margin: 0; height: 38px; }
.filtros button, .filtros a.boton { height: 38px; margin: 0; display: inline-flex; align-items: center; }
.lista-viajes { margin: 0; padding-left: 18px; }
.lista-viajes li { margin: 6px 0; }
.reloj { font-variant-numeric: tabular-nums; font-weight: 600; }
.marca-viaje { background: transparent; border: 0; }
.punto-recogida, .punto-destino { display: block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; }
.punto-recogida { background: var(--accent); }
.punto-destino { background: var(--oscuro); border-radius: 3px; }
@media (max-width: 900px) {
  .app { flex-direction: column; }
  aside, aside.contraida { position: static; width: 100%; height: auto; padding: 14px 16px; }
  aside .contraer { display: none; }
  aside.contraida .marca-app { justify-content: flex-start; }
  aside.contraida .marca-app span,
  aside.contraida .etiq { display: inline; }
  aside.contraida .cuenta-textos { display: flex; }
  aside.contraida nav a,
  aside.contraida .cuenta { justify-content: flex-start; padding: 8px 10px; }
  .cuenta-panel, aside.contraida .cuenta-panel { left: 0; top: calc(100% + 8px); bottom: auto; width: min(230px, 100%); }
  .marca-app { margin-bottom: 10px; }
  aside nav { display: flex; gap: 6px; overflow-x: auto; }
  aside nav a { margin: 0; white-space: nowrap; }
  .cuerpo { padding: 16px 16px 40px; }
  .titulo, .botonera { align-items: flex-start; justify-content: flex-start; }
  header { align-items: flex-start; }
}

/* Consola: componentes compartidos. */
.insignia { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; white-space: nowrap; background: #eef1f4; color: #374151; }
.insignia::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8a94a3; }
.insignia.sin-punto::before { display: none; }
.insignia.ok { background: #d1e7dd; color: #0f5132; }
.insignia.ok::before { background: #198754; }
.insignia.alerta { background: #fdf0d5; color: #7a4a00; }
.insignia.alerta::before { background: #b45309; }
.insignia.mal { background: #f8d7da; color: #842029; }
.insignia.mal::before { background: #be4646; }
.insignia.info { background: #e0ecfb; color: #1d4f91; }
.insignia.info::before { background: #2f6fd0; }
.insignia.apagado { background: #f1f3f5; color: #4b5563; }
.insignia.apagado::before { background: #b6bcc5; }
.tabla .placa { padding: 1px 6px; border-width: 1.5px; border-radius: 6px; font-size: 0.8rem; }

.cabeza { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; }
.cabeza h1 { margin: 0; }
.cabeza .cuenta-total { margin-left: 10px; font-size: 0.95rem; font-weight: 400; color: var(--muted); }
.cabeza-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cabeza-acciones form { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; font-size: 0.9rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #374151; text-decoration: none; }
.chip span { color: var(--muted); }
.chip.activo { background: var(--oscuro); border-color: var(--oscuro); color: #fff; font-weight: 600; }
.chip.activo span { color: rgba(255, 255, 255, .75); }
a.chip:hover { border-color: #c4cad2; }
.datos-empresa { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; font-size: 0.88rem; }
.datos-empresa .chip.ok { background: #d1e7dd; border-color: #b7dcc8; color: #0f5132; font-weight: 600; }
.datos-empresa .chip.mal { background: #f8d7da; border-color: #f1b9be; color: #842029; font-weight: 600; }

.buscar { display: flex; align-items: center; gap: 8px; margin: 0; height: 40px; padding: 0 12px; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; color: var(--muted); }
.buscar input { width: 290px; margin: 0; padding: 0; border: 0; outline: none; background: transparent; font-size: 0.92rem; color: var(--ink); }
.buscar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(71, 95, 123, .15); }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.persona { display: flex; align-items: center; gap: 12px; min-width: 0; }
.persona .ini { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--warm); color: var(--accent); display: grid; place-items: center; font-size: 0.85rem; font-weight: 600; }
.persona strong { display: block; font-weight: 600; }

.acciones-fila button, .acciones-fila .boton { height: 34px; padding: 0 12px; border-radius: 9px; font-size: 0.88rem; }
.menu-fila { position: relative; }
.menu-fila summary { list-style: none; width: 34px; height: 34px; border: 1px solid #d1d5db; border-radius: 9px; background: #fff; color: #374151; display: grid; place-items: center; cursor: pointer; }
.menu-fila summary::-webkit-details-marker { display: none; }
.menu-fila[open] summary { border-color: var(--accent); background: var(--warm); }
.menu-fila summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.menu-lista { position: absolute; z-index: 6; top: 40px; right: 0; width: 230px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgba(7, 17, 31, .16); text-align: left; }
.menu-lista form { margin: 0; }
.menu-lista button { width: 100%; height: auto; display: block; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 0.9rem; text-align: left; }
.menu-lista button:hover { background: #f3f4f6; }
.menu-lista button.peligro { color: var(--bad); border: 0; }
.menu-lista hr { margin: 4px 6px; border: 0; border-top: 1px solid #eef0f3; }

.resumen a { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 14px; }
.resumen .ico-caja { flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--warm); color: var(--accent); display: grid; place-items: center; }
.resumen .ico-caja.ok { background: #d1e7dd; color: #146c43; }
.resumen strong { font-size: 1.5rem; line-height: 1.1; }

.bitacora { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.bitacora-cabeza { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #eef0f3; }
.bitacora-cabeza h2 { margin: 0; font-size: 1.05rem; }
.bitacora h3 { margin: 0; padding: 12px 20px 4px; font-size: 0.75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.bitacora ul { list-style: none; margin: 0; padding: 0 8px 8px; }
.bitacora li { display: flex; align-items: center; gap: 14px; padding: 9px 12px; border-radius: 10px; }
.bitacora li:hover { background: #f9fafb; }
.bitacora .ini { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 0.82rem; font-weight: 600; }
.bitacora .ini.sistema { background: #eef1f4; color: #4b5563; }
.bitacora .ini.alerta { background: #f8d7da; color: #a3282f; }
.bitacora .ini.soporte { background: #fdf0d5; color: #8a5300; }
.bitacora .ini svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bitacora .texto { flex: 1; min-width: 0; }
.bitacora .linea { font-weight: 550; }
.bitacora time { flex: none; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }

.filtros-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.filtros-barra form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.filtros-barra label { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 0.9rem; color: #4b5563; }
.filtros-barra input[type="date"] { width: auto; height: 36px; margin: 0; padding: 0 8px; border-radius: 9px; }
.filtros-barra button { height: 36px; }
.filtros-barra .chips { margin: 0; }
.separador { width: 1px; height: 28px; background: var(--line); }
.segmentado { display: inline-flex; padding: 3px; border-radius: 10px; background: #f1f3f5; }
.segmentado a { padding: 6px 12px; border-radius: 8px; color: #374151; font-size: 0.9rem; text-decoration: none; }
.segmentado a.activo { background: #fff; box-shadow: 0 1px 3px rgba(7, 17, 31, .12); color: var(--oscuro); font-weight: 600; }
.informe { margin-top: 24px; }
.informe-cabeza { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.informe-cabeza h2 { margin: 0; }
.ayuda { position: relative; }
.ayuda summary { list-style: none; width: 26px; height: 26px; border: 1px solid #d1d5db; border-radius: 50%; display: grid; place-items: center; color: var(--accent); font-weight: 700; font-size: 0.85rem; cursor: pointer; }
.ayuda summary::-webkit-details-marker { display: none; }
.ayuda p { position: absolute; z-index: 5; top: 32px; left: 0; width: min(360px, 80vw); margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 8px 24px rgba(7, 17, 31, .14); font-size: 0.88rem; color: #374151; }
.barra-pct { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.barra-pct span { flex: 1; height: 8px; border-radius: 4px; background: #eef1f4; overflow: hidden; }
.barra-pct i { display: block; height: 8px; border-radius: 4px; background: var(--accent); }
.barra-pct strong { width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

/* El aviso de éxito de la consola flota arriba y se va solo. */
.cuerpo > .aviso.ok { position: fixed; z-index: 30; top: 18px; right: 24px; max-width: min(420px, calc(100vw - 48px)); box-shadow: 0 6px 20px rgba(7, 17, 31, .16); pointer-events: none; animation: desvanecer 5s ease forwards; }

.mapa-cabeza { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mapa-cabeza h1 { margin: 0; }
.leyenda { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.leyenda button { display: inline-flex; align-items: center; gap: 7px; height: auto; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #374151; font-size: 0.88rem; font-weight: 600; }
.leyenda button i { width: 10px; height: 10px; border-radius: 50%; }
.leyenda button[aria-pressed="false"] { border-style: dashed; color: var(--muted); font-weight: 400; opacity: .75; }
.mapa-consola { display: flex; flex-wrap: wrap; gap: 14px; height: calc(100vh - 150px); min-height: 520px; }
.mapa-consola #mapa { flex: 999 1 480px; height: auto; min-height: 420px; border-radius: 14px; }
.mapa-consola .leaflet-tile-pane { filter: grayscale(1) brightness(1.04) contrast(.92); }
.unidades { flex: 1 1 280px; max-width: 100%; min-height: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.unidades .buscar { margin: 12px; }
.unidades .buscar input { width: 100%; }
.unidades ul { list-style: none; margin: 0; padding: 0 6px 8px; overflow-y: auto; }
.unidades li button { width: 100%; height: auto; display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; font-weight: 400; }
.unidades li button:hover, .unidades li button[aria-current="true"] { background: #eef2f6; }
.unidades li i { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.unidades li .placa { padding: 1px 6px; border-width: 1.5px; border-radius: 6px; font-size: 0.8rem; }
.unidades .vacio { padding: 12px 16px; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 900px) {
  .mapa-consola { height: auto; }
  .mapa-consola #mapa { min-height: 60vh; }
  .unidades { max-height: 40vh; }
  .buscar input { width: 100%; }
}
.datos-empresa { list-style: none; padding: 0; }
.menu-nota { margin: 6px 10px; font-size: 0.85rem; }
.barra-pct progress { flex: 1; height: 8px; border: 0; border-radius: 4px; background: #eef1f4; overflow: hidden; appearance: none; -webkit-appearance: none; }
.barra-pct progress::-webkit-progress-bar { background: #eef1f4; border-radius: 4px; }
.barra-pct progress::-webkit-progress-value { background: var(--accent); border-radius: 4px; }
.barra-pct progress::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
.e-disponible { background: #198754; }
.e-en_viaje { background: #b45309; }
.e-sin_senal { background: #be4646; }
.e-fuera { background: #475f7b; }
.e-sin_conductor { background: #94a3b8; }
.col-texto { min-width: 150px; }

/* Idioma: enlaces bajo el ingreso y botones en el menú de la App. */
.idiomas { display: flex; justify-content: center; gap: 4px; margin-top: 16px; font-size: 0.88rem; }
.idiomas a { padding: 4px 10px; border-radius: 999px; color: var(--muted); text-decoration: none; }
.idiomas a:hover { color: var(--ink); background: #f1f3f5; }
.idiomas a[aria-current="true"] { color: var(--oscuro); background: var(--warm); font-weight: 600; }
.idioma-cuenta { margin: 14px 0 0; }
.idioma-cuenta h2 { margin: 0 0 8px; }
.idiomas-botones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.menu-panel .idiomas-botones button { margin: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 0.9rem; }
.menu-panel .idiomas-botones button[aria-pressed="true"] { border-color: var(--oscuro); background: var(--oscuro); color: #fff; font-weight: 600; }

.aviso.rastreo { margin-bottom: 16px; }

/* Verificación en dos pasos */
input.codigo { font-size: 1.35rem; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; max-width: 12ch; }
.tarjeta input.codigo { max-width: none; }
.dos-pasos h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dos-pasos .llave { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 1.15rem; letter-spacing: .08em; background: var(--warm); border: 1px solid #c5d0de; border-radius: 8px; padding: 10px 12px; margin: 8px 0; overflow-wrap: anywhere; user-select: all; }
.dos-pasos .pasos-lista { padding-left: 1.2em; display: grid; gap: 10px; }
.dos-pasos form.en-linea { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.dos-pasos button.enlace { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; width: auto; min-height: 0; }
