/* =====================================================================
   Vector Cargo · sistema de diseño de la web
   Marca: azul marino #0E2A52, azul #0D47A1, naranja #F26A1B (tomados del logo)
   ===================================================================== */
:root {
  --marino: #0E2A52;
  --marino-2: #16386B;
  --azul: #0D47A1;
  --azul-2: #1168A2;
  --azul-claro: #4F8EDC;
  --azul-suave: #EAF1FB;
  --naranja: #F26A1B;
  --naranja-2: #C9500F;
  --naranja-suave: #FEF0E7;

  --fondo: #F3F5F9;
  --superficie: #FFFFFF;
  --superficie-2: #F8FAFC;
  --borde: #E4E9F0;
  --borde-2: #D3DBE6;
  --texto: #14213D;
  --texto-2: #52627A;
  --texto-3: #8693A7;

  --verde: #188038; --verde-suave: #E7F5EC;
  --rojo: #C62828; --rojo-suave: #FDECEC;
  --ambar: #A86400; --ambar-suave: #FFF4DE;
  --morado: #7B1FA2; --morado-suave: #F4E9F8;
  --gris: #64748B; --gris-suave: #EEF1F5;

  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --sombra-1: 0 1px 2px rgba(15, 30, 60, .06);
  --sombra-2: 0 1px 3px rgba(15, 30, 60, .08), 0 4px 14px rgba(15, 30, 60, .06);
  --sombra-3: 0 12px 40px rgba(10, 25, 55, .18);
  --foco: 0 0 0 3px rgba(13, 71, 161, .22);

  --fuente: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --barra-lateral: 264px;
  --alto-barra: 64px;
  --t-rapida: 140ms cubic-bezier(.2, .7, .2, 1);
  --t-media: 260ms cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--fuente); font-size: 14px; line-height: 1.5; color: var(--texto);
  background: var(--fondo); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 750; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--borde); margin: 16px 0; }
::selection { background: rgba(13, 71, 161, .16); }
:focus-visible { outline: none; box-shadow: var(--foco); border-radius: 6px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: .01em; overflow-wrap: anywhere; }
.muted { color: var(--texto-2); }
.sutil { color: var(--texto-3); }
.pequeno { font-size: 12.5px; }
.mini { font-size: 11.5px; }
.negrita { font-weight: 700; }
.centro { text-align: center; }
.derecha { text-align: right; }
.oculto { display: none !important; }
table.sr { display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.truncar { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fila { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fila-arriba { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.columna { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.envolver { flex-wrap: wrap; }
.crece { flex: 1 1 auto; min-width: 0; }
.entre { justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.rejilla { display: grid; gap: 16px; }
.rejilla-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rejilla-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rejilla-auto { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 900px) { .rejilla-2, .rejilla-3 { grid-template-columns: 1fr; } }

/* ---------------- Íconos ---------------- */
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 22px; height: 22px; }
.ic-xl { width: 28px; height: 28px; }

/* ---------------- Botones ---------------- */
.btn {
  --b-bg: var(--superficie); --b-fg: var(--texto); --b-borde: var(--borde-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--b-borde);
  background: var(--b-bg); color: var(--b-fg); font-weight: 650; font-size: 13.5px; letter-spacing: .005em;
  cursor: pointer; white-space: nowrap; user-select: none; text-decoration: none !important;
  transition: background var(--t-rapida), border-color var(--t-rapida), box-shadow var(--t-rapida), transform var(--t-rapida), color var(--t-rapida);
}
.btn:hover { background: var(--superficie-2); border-color: var(--texto-3); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.cargando { opacity: .6; cursor: not-allowed; pointer-events: none; }
.btn-primario { --b-bg: var(--azul); --b-fg: #fff; --b-borde: var(--azul); box-shadow: 0 1px 2px rgba(13, 71, 161, .25); }
.btn-primario:hover { background: #0B3D8B; border-color: #0B3D8B; }
.btn-acento { --b-bg: var(--naranja); --b-fg: #fff; --b-borde: var(--naranja); box-shadow: 0 1px 2px rgba(242, 106, 27, .3); }
.btn-acento:hover { background: var(--naranja-2); border-color: var(--naranja-2); }
.btn-marino { --b-bg: var(--marino); --b-fg: #fff; --b-borde: var(--marino); }
.btn-marino:hover { background: var(--marino-2); border-color: var(--marino-2); }
.btn-peligro { --b-bg: var(--superficie); --b-fg: var(--rojo); --b-borde: #F1C4C4; }
.btn-peligro:hover { background: var(--rojo-suave); border-color: var(--rojo); }
.btn-peligro-lleno { --b-bg: var(--rojo); --b-fg: #fff; --b-borde: var(--rojo); }
.btn-peligro-lleno:hover { background: #A51F1F; }
.btn-exito { --b-bg: var(--verde); --b-fg: #fff; --b-borde: var(--verde); }
.btn-exito:hover { background: #136B2E; }
.btn-fantasma { --b-bg: transparent; --b-borde: transparent; --b-fg: var(--texto-2); }
.btn-fantasma:hover { background: var(--gris-suave); border-color: transparent; color: var(--texto); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn-lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn-icono { width: 38px; padding: 0; }
.btn-icono.btn-sm { width: 32px; }
.btn-bloque { width: 100%; }
.btn .giro { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: girar .7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.grupo-btn { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- Formularios ---------------- */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > label, .etiqueta { font-size: 12.5px; font-weight: 650; color: var(--texto-2); }
.campo .ayuda { font-size: 12px; color: var(--texto-3); }
.campo .error-campo { font-size: 12px; color: var(--rojo); font-weight: 600; }
.campo .obl { color: var(--rojo); }
.entrada, .selector, .area {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--borde-2);
  background: var(--superficie); font-size: 14px; transition: border-color var(--t-rapida), box-shadow var(--t-rapida);
}
.area { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.selector { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2352627A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.entrada:hover, .selector:hover, .area:hover { border-color: var(--texto-3); }
.entrada:focus, .selector:focus, .area:focus { outline: none; border-color: var(--azul); box-shadow: var(--foco); }
.entrada[readonly], .entrada:disabled, .selector:disabled { background: var(--superficie-2); color: var(--texto-2); }
.campo.invalido .entrada, .campo.invalido .selector, .campo.invalido .area { border-color: var(--rojo); }
.con-icono { position: relative; }
.con-icono > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--texto-3); pointer-events: none; }
.con-icono > .entrada { padding-left: 38px; }
.form-rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-rejilla .ancho { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-rejilla { grid-template-columns: 1fr; } }

.interruptor { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.interruptor input { position: absolute; opacity: 0; pointer-events: none; }
.interruptor .pista { width: 38px; height: 22px; border-radius: 99px; background: var(--borde-2); position: relative; transition: background var(--t-rapida); flex: none; }
.interruptor .pista::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform var(--t-rapida); }
.interruptor input:checked + .pista { background: var(--verde); }
.interruptor input:checked + .pista::after { transform: translateX(16px); }
.interruptor input:focus-visible + .pista { box-shadow: var(--foco); }
.casilla { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.casilla input { width: 16px; height: 16px; accent-color: var(--azul); }

/* ---------------- Tarjetas ---------------- */
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--r-lg); box-shadow: var(--sombra-1); min-width: 0; }
.tarjeta-cab { display: flex; align-items: center; gap: 12px; padding: 16px 18px 0; min-width: 0; }
.tarjeta-cab h2, .tarjeta-cab h3 { flex: 1; min-width: 0; }
.tarjeta-cuerpo { padding: 16px 18px 18px; }
.tarjeta-pie { padding: 12px 18px; border-top: 1px solid var(--borde); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.tarjeta.interactiva { cursor: pointer; transition: border-color var(--t-rapida), box-shadow var(--t-rapida), transform var(--t-rapida); }
.tarjeta.interactiva:hover { border-color: var(--borde-2); box-shadow: var(--sombra-2); }
.seccion-titulo { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.seccion-titulo h2 { font-size: 15px; }
.seccion-titulo .linea { flex: 1; height: 1px; background: var(--borde); }

/* Indicadores (KPI) */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--sombra-1); position: relative; overflow: hidden; min-width: 0; }
.kpi .kpi-et { font-size: 12px; font-weight: 650; color: var(--texto-2); display: flex; align-items: center; gap: 6px; }
.kpi .kpi-val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .kpi-sub { font-size: 12px; color: var(--texto-3); margin-top: 2px; }
.kpi .kpi-ic { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--azul-suave); color: var(--azul); }
.kpi.naranja .kpi-ic { background: var(--naranja-suave); color: var(--naranja); }
.kpi.verde .kpi-ic { background: var(--verde-suave); color: var(--verde); }
.kpi.rojo .kpi-ic { background: var(--rojo-suave); color: var(--rojo); }
.kpi.morado .kpi-ic { background: var(--morado-suave); color: var(--morado); }
.kpi.boton { cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.kpi.boton:hover { border-color: var(--borde-2); box-shadow: var(--sombra-2); }
.kpi.activo { border-color: var(--azul); box-shadow: var(--foco); }

/* ---------------- Chips / insignias ---------------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--gris-suave); color: var(--gris); border: 1px solid transparent; }
.chip .punto { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.pendiente { background: var(--naranja-suave); color: #B44A0E; }
.chip.asignada, .chip.azul { background: var(--azul-suave); color: #1559B8; }
.chip.encamino, .chip.morado { background: var(--morado-suave); color: var(--morado); }
.chip.entregado, .chip.verde { background: var(--verde-suave); color: var(--verde); }
.chip.noentregado, .chip.rojo { background: var(--rojo-suave); color: var(--rojo); }
.chip.reprogramado, .chip.ambar { background: var(--ambar-suave); color: var(--ambar); }
.chip.naranja { background: var(--naranja-suave); color: #B44A0E; }
.chip.cancelada, .chip.gris, .chip.neutro { background: var(--gris-suave); color: var(--gris); }
.chip.borde { background: var(--superficie); border-color: var(--borde-2); color: var(--texto-2); }
.insignia { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--naranja); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.insignia.azul { background: var(--azul); }
.insignia.gris { background: var(--gris-suave); color: var(--texto-2); }

/* Filtros tipo pestaña (segmentado) */
.segmentos { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: #E9EDF3; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.segmentos::-webkit-scrollbar { display: none; }
.segmento { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 9px; font-size: 13px; font-weight: 650; color: var(--texto-2); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; transition: background var(--t-rapida), color var(--t-rapida); }
.segmento:hover { color: var(--texto); }
.segmento.activo { background: var(--superficie); color: var(--texto); box-shadow: 0 1px 2px rgba(15, 30, 60, .12); }
.segmento .cuenta { font-size: 11.5px; color: var(--texto-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.segmento.activo .cuenta { color: var(--azul); }

/* Barra de herramientas de una lista */
.herramientas { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.buscador { position: relative; flex: 1 1 240px; max-width: 380px; min-width: 180px; }
.buscador .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--texto-3); }
.buscador input { width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--borde-2); background: var(--superficie); padding: 0 12px 0 36px; font-size: 13.5px; }
.buscador input:focus { outline: none; border-color: var(--azul); box-shadow: var(--foco); }

/* ---------------- Tablas ---------------- */
.tabla-caja { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sombra-1); }
.tabla-desliza { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-3); font-weight: 700; padding: 11px 14px; background: var(--superficie-2); border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla td { padding: 12px 14px; border-bottom: 1px solid var(--borde); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr { transition: background var(--t-rapida); }
.tabla tbody tr.clic { cursor: pointer; }
.tabla tbody tr.clic:hover { background: #F7F9FC; }
.tabla .num { text-align: right; white-space: nowrap; }
@media (max-width: 760px) {
  .tabla.apilable thead { display: none; }
  .tabla.apilable tr { display: block; border-bottom: 1px solid var(--borde); padding: 8px 4px; }
  .tabla.apilable td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 12px; text-align: right; }
  .tabla.apilable td::before { content: attr(data-et); font-size: 12px; font-weight: 650; color: var(--texto-3); text-align: left; }
  .tabla.apilable td.sin-et::before { content: none; }
}

/* ---------------- Lista de elementos ---------------- */
.lista { display: flex; flex-direction: column; gap: 10px; }
.elemento { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--r-lg); padding: 14px 16px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--sombra-1); min-width: 0; transition: border-color var(--t-rapida), box-shadow var(--t-rapida); }
.elemento.clic { cursor: pointer; }
.elemento.clic:hover { border-color: var(--borde-2); box-shadow: var(--sombra-2); }
.elemento .cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.elemento .titulo { font-weight: 750; font-size: 14.5px; display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.elemento .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--texto-2); }
.elemento .meta span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.elemento .acciones { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .elemento { flex-wrap: wrap; } .elemento .acciones { width: 100%; justify-content: flex-start; } }

.avatar { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--azul-suave); color: var(--azul); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.circulo { border-radius: 50%; }
.avatar.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 18px; }

/* Vacío y carga */
.vacio:not(.tipo) { text-align: center; padding: 48px 20px; color: var(--texto-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vacio .ic-caja { width: 56px; height: 56px; border-radius: 16px; background: var(--azul-suave); color: var(--azul); display: grid; place-items: center; }
.vacio h3 { color: var(--texto); }
.esqueleto { background: linear-gradient(90deg, #EDF1F6 0%, #F7F9FC 40%, #EDF1F6 80%); background-size: 200% 100%; animation: brillo 1.2s ease-in-out infinite; border-radius: 10px; }
@keyframes brillo { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.barra-progreso { height: 6px; border-radius: 99px; background: var(--gris-suave); overflow: hidden; }
.barra-progreso > i { display: block; height: 100%; background: var(--azul); border-radius: inherit; transition: width var(--t-media); }

/* Aviso en línea */
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13px; background: var(--azul-suave); color: #183E77; border: 1px solid #D3E2F7; }
.aviso.naranja { background: var(--naranja-suave); color: #8A3A0B; border-color: #F9D8C3; }
.aviso.rojo { background: var(--rojo-suave); color: #8E1D1D; border-color: #F4C9C9; }
.aviso.verde { background: var(--verde-suave); color: #135F2B; border-color: #C8E8D3; }
.aviso .ic { margin-top: 1px; }

/* ---------------- Estructura del panel ---------------- */
.app { display: grid; grid-template-columns: var(--barra-lateral) minmax(0, 1fr); min-height: 100dvh; }
.lateral {
  position: sticky; top: 0; height: 100dvh; background: var(--superficie); border-right: 1px solid var(--borde);
  display: flex; flex-direction: column; z-index: 40;
}
.lateral .marca { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; }
.lateral .marca img { width: 40px; height: 40px; border-radius: 11px; box-shadow: var(--sombra-1); background: #fff; }
.palabra-marca { font-weight: 800; font-size: 17px; letter-spacing: -.01em; line-height: 1.1; white-space: nowrap; }
.palabra-marca .v { color: var(--marino); } .palabra-marca .c { color: var(--naranja); }
.lateral .marca small { display: block; font-size: 11.5px; color: var(--texto-3); font-weight: 600; margin-top: 2px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; scrollbar-width: thin; }
.nav .grupo { font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-3); padding: 14px 10px 6px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 10px; border-radius: 10px;
  color: var(--texto-2); font-weight: 620; font-size: 13.5px; text-decoration: none; transition: background var(--t-rapida), color var(--t-rapida);
}
.nav a:hover { background: var(--superficie-2); color: var(--texto); }
.nav a.activo { background: var(--azul-suave); color: var(--azul); }
.nav a.activo::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--naranja); }
.nav a .insignia { margin-left: auto; }
.lateral .pie { border-top: 1px solid var(--borde); padding: 12px; display: flex; align-items: center; gap: 10px; }
.lateral .pie .quien { flex: 1; min-width: 0; }
.lateral .pie .quien b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lateral .pie .quien span { font-size: 11.5px; color: var(--texto-3); }
/* Pie con versión y créditos (contrato 6.6) */
.creditos { display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center; font-size: 11px; line-height: 1.45; color: var(--texto-3); }
.creditos .dev { font-size: 10.5px; opacity: .9; }
.lateral .creditos { padding: 0 12px 12px; }

.app-principal { min-width: 0; display: flex; flex-direction: column; }
.superior {
  position: sticky; top: 0; z-index: 30; height: var(--alto-barra); display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: rgba(243, 245, 249, .86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color var(--t-rapida), background var(--t-rapida);
}
.superior.con-sombra { border-bottom-color: var(--borde); background: rgba(255, 255, 255, .9); }
.superior .titulo-vista { flex: 1; min-width: 0; }
.superior .titulo-vista h1 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.superior .titulo-vista p { font-size: 12.5px; color: var(--texto-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.superior .acciones-sup { display: flex; align-items: center; gap: 8px; }
.en-vivo { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 99px; background: var(--verde-suave); color: var(--verde); font-size: 12px; font-weight: 700; white-space: nowrap; }
.en-vivo i { width: 7px; height: 7px; border-radius: 50%; background: var(--verde); box-shadow: 0 0 0 0 rgba(24, 128, 56, .5); animation: pulso 2s infinite; }
.en-vivo.desconectado { background: var(--gris-suave); color: var(--gris); }
.en-vivo.desconectado i { background: var(--gris); animation: none; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(24, 128, 56, .45); } 70% { box-shadow: 0 0 0 7px rgba(24, 128, 56, 0); } 100% { box-shadow: 0 0 0 0 rgba(24, 128, 56, 0); } }
.campana { position: relative; }
.campana .insignia { position: absolute; top: -4px; right: -4px; border: 2px solid var(--fondo); }
.boton-menu { display: none; }

/* Ocultar menú (computador): botón al pie del menú y pestaña "Menú" en el borde izquierdo */
.ocultar-menu { display: flex; align-items: center; gap: 10px; margin: 0 12px 12px; height: 38px; padding: 0 10px; border: 1px solid var(--borde); border-radius: 10px; background: var(--superficie-2); color: var(--texto-2); font-weight: 650; font-size: 13px; cursor: pointer; transition: background var(--t-rapida), color var(--t-rapida); }
.ocultar-menu:hover { background: var(--azul-suave); color: var(--azul); border-color: #D3E2F7; }
.tab-menu { display: none; position: fixed; left: 10px; top: 50%; transform: translateY(-50%); z-index: 45; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 999px; background: var(--superficie); border: 1px solid var(--borde); box-shadow: var(--sombra-2); color: var(--texto-2); font-size: 11px; font-weight: 750; cursor: pointer; transition: background var(--t-rapida), color var(--t-rapida), box-shadow var(--t-rapida); }
.tab-menu .tab-icono { width: 32px; height: 32px; border-radius: 50%; background: var(--azul); color: #fff; display: grid; place-items: center; }
.tab-menu .tab-icono .ic { width: 17px; height: 17px; }
.tab-menu:hover { background: var(--azul); color: #fff; border-color: var(--azul); box-shadow: 0 10px 26px -10px rgba(13, 71, 161, .6); }
.tab-menu:hover .tab-icono { background: rgba(255,255,255,.18); }
@media (min-width: 1081px) {
  .app.menu-oculto { grid-template-columns: minmax(0, 1fr); }
  .app.menu-oculto .lateral { display: none; }
  .app.menu-oculto .tab-menu { display: flex; }
  .app.menu-oculto .app-principal { padding-left: 58px; }
}
@media (max-width: 1080px) { .ocultar-menu { display: none; } }

/* Franja para activar los avisos */
.aviso-notif { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 24px 0; padding: 12px 14px; border-radius: 12px; background: var(--naranja-suave); border: 1px solid #F9D8C3; color: #7A3309; font-size: 13px; }
.aviso-notif[hidden] { display: none; }
.aviso-notif > .ic { color: var(--naranja); }
@media (max-width: 1080px) { .aviso-notif { margin: 10px 14px 0; } }

.contenido { padding: 22px 24px 48px; width: 100%; max-width: 1380px; margin: 0 auto; flex: 1; animation: entrar var(--t-media); }
@keyframes entrar { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cabecera-vista { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.cabecera-vista .izq { min-width: 0; }
.cabecera-vista .izq p { color: var(--texto-2); margin-top: 4px; }
.velo { display: none; }
.barra-inferior { display: none; }

@media (max-width: 1080px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .lateral { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform var(--t-media); box-shadow: var(--sombra-3); }
  .app.menu-abierto .lateral { transform: none; }
  .app.menu-abierto .velo { display: block; position: fixed; inset: 0; background: rgba(10, 22, 45, .38); z-index: 35; animation: aparecer var(--t-media); }
  .boton-menu { display: inline-flex; }
  .superior { padding: 0 14px; }
  .contenido { padding: 16px 14px 40px; }
}
@media (max-width: 640px) {
  .superior .ocultar-movil { display: none !important; }
  .app.con-barra .contenido { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .app.con-barra .barra-inferior {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px); border-top: 1px solid var(--borde); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .barra-inferior a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 10px; color: var(--texto-3); font-size: 11px; font-weight: 700; text-decoration: none; position: relative; min-width: 0; }
  .barra-inferior a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .barra-inferior a.activo { color: var(--azul); }
  .barra-inferior a.activo .ic { stroke-width: 2.2; }
  .barra-inferior a .insignia { position: absolute; top: 2px; left: 55%; }
  h1 { font-size: 20px; }
}
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- Diálogos ---------------- */
.capa-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(10, 22, 45, .45); animation: aparecer 160ms ease-out; }
.modal { background: var(--superficie); border-radius: var(--r-xl); box-shadow: var(--sombra-3); width: min(560px, 100%); max-height: min(88dvh, 920px); display: flex; flex-direction: column; animation: subir 220ms cubic-bezier(.2, .8, .2, 1); min-width: 0; }
.modal.ancho { width: min(860px, 100%); }
.modal.extra { width: min(1180px, 100%); }
.modal.angosto { width: min(420px, 100%); }
.modal-cab { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--borde); }
.modal-cab h2 { flex: 1; font-size: 17px; min-width: 0; }
.modal-cab p { font-size: 12.5px; color: var(--texto-3); }
.modal-cuerpo { padding: 18px 20px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.modal-pie { padding: 14px 20px; border-top: 1px solid var(--borde); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.modal-pie .izq { margin-right: auto; }
@keyframes subir { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .capa-modal { padding: 0; align-items: end; }
  .modal, .modal.ancho, .modal.extra, .modal.angosto { width: 100%; max-height: 94dvh; border-radius: 20px 20px 0 0; animation: hoja 260ms cubic-bezier(.2, .8, .2, 1); }
  .modal.pantalla { max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .modal-pie { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}
@keyframes hoja { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* Menú contextual */
.menu-flotante { position: fixed; z-index: 120; min-width: 210px; max-width: 300px; background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; box-shadow: var(--sombra-3); padding: 6px; animation: aparecer 120ms ease-out; }
.menu-flotante button { width: 100%; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 0; background: transparent; border-radius: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; color: var(--texto); }
.menu-flotante button:hover { background: var(--superficie-2); }
.menu-flotante button.peligro { color: var(--rojo); }
.menu-flotante hr { margin: 6px 4px; }

/* Avisos emergentes */
.tostadas { position: fixed; z-index: 200; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 460px); }
.tostada { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: #13213A; color: #fff; font-size: 13.5px; font-weight: 600; box-shadow: var(--sombra-3); animation: tostada 240ms cubic-bezier(.2, .8, .2, 1); max-width: 100%; }
.tostada.error { background: #A61F1F; }
.tostada.exito .ic { color: #6EE7A0; }
.tostada.saliendo { opacity: 0; transform: translateY(8px); transition: all 200ms; }
@keyframes tostada { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .app.con-barra ~ .tostadas, .tostadas { bottom: calc(90px + env(safe-area-inset-bottom)); } }

/* Visor de fotos y PDF (js/visor.js): uno solo para todo; siempre oscuro, controles blancos */
.visor { position: fixed; inset: 0; z-index: 150; background: rgba(8, 14, 28, .95); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; display: flex; flex-direction: column; animation: aparecer 160ms; overscroll-behavior: contain; -webkit-tap-highlight-color: transparent; color-scheme: dark; }
.visor .btn { --b-bg: rgba(255,255,255,.1); --b-fg: #fff; --b-borde: transparent; }
.visor .btn:hover { background: rgba(255,255,255,.2); border-color: transparent; }
.visor :focus-visible { box-shadow: 0 0 0 3px rgba(79, 142, 220, .75); }
.visor .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.visor-cab { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 10px 18px; min-height: 58px; flex: none; position: relative; z-index: 3; }
.visor-tit { flex: 1; min-width: 0; }
.visor-titulo { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.visor-sub { font-size: 12px; line-height: 1.35; color: rgba(255,255,255,.68); font-weight: 500; }
.visor-cuenta { font-size: 12.5px; color: rgba(255,255,255,.82); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; padding: 3px 9px; border-radius: 99px; background: rgba(255,255,255,.1); }
.visor-acc { display: flex; align-items: center; gap: 6px; flex: none; }
.visor-acc .btn.cargando { opacity: .55; }
.visor-escena { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.visor-img { position: absolute; left: 0; top: 0; max-width: none; max-height: none; transform-origin: 0 0; border-radius: 3px; box-shadow: 0 10px 40px rgba(0,0,0,.4); -webkit-user-drag: none; user-select: none; cursor: zoom-in; transition: opacity 180ms ease-out; }
.visor-img.cargando { opacity: 0; }
.visor-img.suave { transition: transform 220ms cubic-bezier(.2, .7, .2, 1), opacity 180ms ease-out; }
.visor-img.moviendo { will-change: transform; }
.visor-escena.con-zoom .visor-img { cursor: grab; }
.visor-escena.arrastrando .visor-img { cursor: grabbing; }
.visor-carga { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.visor-giro { width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.22); border-top-color: #fff; border-radius: 50%; animation: girar .8s linear infinite; }
.visor-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px 64px; text-align: center; font-size: 14px; color: rgba(255,255,255,.85); }
.visor-error .ic { color: #FFB38A; }
.visor-nav { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background var(--t-rapida), opacity var(--t-rapida); }
.visor-nav:hover { background: rgba(255,255,255,.26); }
.visor-nav[disabled] { opacity: .2; cursor: default; }
.visor-nav.ant { left: 12px; }
.visor-nav.sig { right: 12px; }
.visor-nav .ic { width: 22px; height: 22px; }
.visor-zoom { position: absolute; left: 50%; bottom: 14px; z-index: 2; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; background: rgba(8, 14, 28, .78); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 6px 24px rgba(0,0,0,.35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.visor-zoom button { height: 38px; min-width: 38px; border: 0; border-radius: 10px; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.visor-zoom button:hover { background: rgba(255,255,255,.14); }
.visor-zoom button[disabled] { opacity: .35; cursor: default; background: transparent; }
.visor-zoom .ajustar { padding: 0 10px; border-left: 1px solid rgba(255,255,255,.12); border-radius: 0 10px 10px 0; }
.visor-nivel { min-width: 50px; text-align: center; font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; color: rgba(255,255,255,.88); }
.visor-tiras { flex: none; display: flex; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent; }
.visor-tiras > :first-child { margin-left: auto; }
.visor-tiras > :last-child { margin-right: auto; }
.visor-tiras button { flex: none; width: 54px; height: 54px; padding: 0; border-radius: 9px; overflow: hidden; border: 2px solid transparent; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; opacity: .6; transition: opacity var(--t-rapida), border-color var(--t-rapida); }
.visor-tiras button:hover { opacity: .9; }
.visor-tiras button[aria-current="true"] { border-color: var(--naranja); opacity: 1; }
.visor-tiras img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.visor-tira-pdf { display: grid; place-items: center; width: 100%; height: 100%; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; background: rgba(198, 40, 40, .55); }
/* PDF dibujado con pdf.js: páginas en columna con desplazamiento propio */
.visor-pdf { position: absolute; inset: 0; overflow: auto; touch-action: pan-x pan-y; overscroll-behavior: contain; padding: 46px 16px 80px; user-select: text; outline: none; }
.visor-pdf-hoja { display: flex; flex-direction: column; align-items: center; gap: 14px; width: max-content; min-width: 100%; transform-origin: 0 0; }
.visor-pdf-pag { position: relative; flex: none; background: #fff; border-radius: 2px; box-shadow: 0 4px 22px rgba(0,0,0,.4); }
.visor-pdf-pag::before { content: attr(data-n); position: absolute; inset: 0; display: grid; place-items: center; color: #B8C1CE; font-size: 22px; font-weight: 700; }
.visor-pdf-pag.lista::before { content: none; }
.visor-pdf-pag canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.visor-pagina { position: absolute; top: 10px; left: 50%; z-index: 2; transform: translateX(-50%); padding: 5px 12px; border-radius: 99px; background: rgba(8, 14, 28, .78); border: 1px solid rgba(255,255,255,.12); font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
/* PDF que no se pudo leer: lector del navegador dentro de un iframe, con aviso */
.visor-marco { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; padding: 0 16px 16px; }
.visor-marco iframe { flex: 1; width: 100%; min-height: 0; border: 0; border-radius: 8px; background: #fff; }
.visor-nota { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(242, 106, 27, .16); border: 1px solid rgba(242, 106, 27, .35); color: #FFD9C2; font-size: 12.5px; line-height: 1.45; }
.visor-nota .ic { margin-top: 1px; color: #FFB38A; }
@media (max-width: 640px) {
  .visor-cab { gap: 6px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px 14px; min-height: 54px; }
  .visor-titulo { font-size: 14px; }
  .visor-et { display: none; }
  .visor-acc { gap: 4px; }
  .visor .visor-acc .btn { width: 38px; height: 38px; padding: 0; }
  .visor-nav { width: 40px; height: 40px; background: rgba(0,0,0,.4); }
  .visor-nav.ant { left: 6px; }
  .visor-nav.sig { right: 6px; }
  .visor-escena.modo-pdf .visor-nav { display: none; }
  .visor-zoom { bottom: 10px; }
  .visor-error { padding: 24px 52px; }
  .visor-pdf { padding: 44px 8px 76px; }
  .visor-marco { padding: 0 8px 8px; }
  .visor-tiras { gap: 6px; padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); }
  .visor-tiras button { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) { .visor, .visor-img.suave { animation: none; transition: none; } }

/* Galería de fotos */
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.galeria .foto { padding: 0; font: inherit; display: block; width: 100%; position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--gris-suave); border: 1px solid var(--borde); cursor: zoom-in; }
.galeria .foto img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-media); }
.galeria .foto:hover img { transform: scale(1.04); }
.galeria .foto .quitar { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: rgba(10, 20, 40, .7); color: #fff; display: grid; place-items: center; cursor: pointer; }

/* Archivo adjunto */
.archivo { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--borde); border-radius: 12px; background: var(--superficie); min-width: 0; }
.archivo .tipo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--rojo-suave); color: var(--rojo); flex: none; font-size: 10.5px; font-weight: 800; }
.archivo .tipo.img { background: var(--azul-suave); color: var(--azul); }
.archivo .tipo.vacio { background: var(--gris-suave); color: var(--texto-3); }
.zona-archivo { border: 1.5px dashed var(--borde-2); border-radius: 14px; padding: 18px; text-align: center; color: var(--texto-2); background: var(--superficie-2); cursor: pointer; transition: border-color var(--t-rapida), background var(--t-rapida); }
.zona-archivo:hover, .zona-archivo.encima { border-color: var(--azul); background: var(--azul-suave); }

/* Mapas */
.mapa { position: relative; width: 100%; height: 420px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--borde); background: #EEF1F4; }
.mapa.alto { height: min(70dvh, 640px); }
.mapa.bajo { height: 280px; }
.mapa .maplibregl-ctrl-attrib { font-size: 10px; }
.pin { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; cursor: pointer; }
.pin .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.pin.grande { width: 38px; height: 38px; }
/* Pin dividido: varias paradas en el mismo punto (contrato 6.5) */
.pin-dividido { width: 36px; height: 36px; cursor: pointer; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .32)); }
.pin-dividido svg { width: 36px; height: 36px; font-family: var(--fuente); }
.pop-paradas { display: flex; flex-direction: column; gap: 8px; min-width: 210px; max-width: 250px; }
.pop-paradas-cab { font-size: 11.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--texto-3); }
.pop-paradas ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
.pop-paradas li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; min-width: 0; }
.pop-paradas li + li { border-top: 1px solid var(--borde); }
.pop-paradas .marca { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 10.5px; font-weight: 800; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--borde-2); }
.pop-paradas .crece { overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 1px; }
.pop-paradas .btn { margin-top: 6px; align-self: flex-start; }
.mapa-leyenda { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; z-index: 2; }
.mapa-leyenda .chip { background: rgba(255,255,255,.95); box-shadow: var(--sombra-1); border-color: var(--borde); color: var(--texto-2); cursor: pointer; }
.mapa-leyenda .chip.activo { color: var(--texto); border-color: var(--borde-2); }
.mapa-leyenda .chip:not(.activo) { opacity: .55; }
.mapa-ruta { position: absolute; left: 10px; bottom: 10px; right: 10px; z-index: 2; display: flex; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.mapa-ruta > * { pointer-events: auto; }
.burbuja { background: rgba(255,255,255,.96); border: 1px solid var(--borde); border-radius: 12px; padding: 8px 12px; box-shadow: var(--sombra-2); font-size: 12.5px; font-weight: 650; }
.maplibregl-popup-content { border-radius: 12px !important; padding: 12px 14px !important; box-shadow: var(--sombra-2) !important; font-family: var(--fuente); }

/* PIN en cajitas */
.cajas-pin { display: flex; gap: 10px; justify-content: center; }
.cajas-pin input { width: 46px; height: 54px; border-radius: 12px; border: 1.5px solid var(--borde-2); text-align: center; font-size: 22px; font-weight: 800; background: var(--superficie); caret-color: var(--azul); transition: border-color var(--t-rapida), box-shadow var(--t-rapida), transform var(--t-rapida); -webkit-text-security: disc; }
.cajas-pin.ver input { -webkit-text-security: none; }
.cajas-pin input:focus { outline: none; border-color: var(--azul); box-shadow: var(--foco); }
.cajas-pin input.lleno { border-color: var(--marino); }
.cajas-pin.error input { border-color: var(--rojo); animation: temblor 360ms; }
@keyframes temblor { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (max-width: 400px) { .cajas-pin { gap: 7px; } .cajas-pin input { width: 40px; height: 50px; font-size: 20px; } }

/* Barras de gráfico (sin librerías) */
.grafico-barras { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.grafico-barras .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.grafico-barras .pila { flex: 1; width: 100%; max-width: 44px; display: flex; flex-direction: column-reverse; border-radius: 8px 8px 4px 4px; overflow: hidden; background: var(--gris-suave); }
.grafico-barras .pila i { display: block; width: 100%; transition: height var(--t-media); }
.grafico-barras .et { font-size: 11.5px; color: var(--texto-3); font-weight: 650; white-space: nowrap; }
.grafico-barras .val { font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.barra-h { display: grid; grid-template-columns: minmax(90px, 180px) 1fr auto; align-items: center; gap: 10px; font-size: 13px; padding: 5px 0; }
.barra-h .pista { height: 10px; border-radius: 99px; background: var(--gris-suave); overflow: hidden; }
.barra-h .pista i { display: block; height: 100%; border-radius: inherit; background: var(--azul); }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--texto-2); }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Notas del conductor al cerrar */
.notas-cond { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.notas-cond li { border: 1px solid var(--borde); border-radius: 12px; background: var(--superficie-2); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.notas-cond .cab { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.notas-cond .fecha { font-size: 12px; color: var(--texto-2); font-weight: 650; font-variant-numeric: tabular-nums; }
.notas-cond .por { font-size: 11.5px; color: var(--texto-3); }
.notas-cond .acc { margin-left: auto; display: inline-flex; gap: 2px; }
.notas-cond .texto { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; }

/* Recorrido (puntos A/B) */
.paradas { display: flex; flex-direction: column; gap: 0; }
.parada { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.parada:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; border-left: 2px dashed var(--borde-2); }
.parada .marca-parada { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; flex: none; z-index: 1; }
.parada .marca-parada.retiro { background: #6A1B9A; }
.parada .marca-parada.entrega { background: var(--naranja); }
.parada .tramo { font-size: 11.5px; color: var(--texto-3); font-weight: 650; }

/* =====================================================================
   Ronda 7 (contrato §7): línea de tiempo, avance por punto, botón Avisar,
   avisos con acciones, visor de fotos y alarma de emergencia
   ===================================================================== */
/* Línea de tiempo (js/linea-tiempo.js) */
.lt { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lt-vacia { font-size: 12.5px; color: var(--texto-3); }
.lt-ver { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 2px; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--azul); cursor: pointer; border-radius: 6px; }
.lt-ver:hover { text-decoration: underline; }
.lt-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lt-item { --lt-c: var(--gris); --lt-s: var(--gris-suave); display: flex; gap: 12px; position: relative; padding-bottom: 14px; min-width: 0; }
.lt-item:last-child { padding-bottom: 0; }
.lt-item:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--borde); border-radius: 2px; }
.lt-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--lt-s); color: var(--lt-c); z-index: 1; }
.lt-azul { --lt-c: var(--azul); --lt-s: var(--azul-suave); }
.lt-verde { --lt-c: var(--verde); --lt-s: var(--verde-suave); }
.lt-rojo { --lt-c: var(--rojo); --lt-s: var(--rojo-suave); }
.lt-morado { --lt-c: var(--morado); --lt-s: var(--morado-suave); }
.lt-naranja { --lt-c: var(--naranja-2); --lt-s: var(--naranja-suave); }
.lt-ambar { --lt-c: var(--ambar); --lt-s: var(--ambar-suave); }
.lt-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; padding-top: 3px; }
.lt-titulo { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-weight: 700; font-size: 13.5px; line-height: 1.35; min-width: 0; }
.lt-titulo > span:first-child { overflow-wrap: anywhere; min-width: 0; }
.lt-punto { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--superficie-2); border: 1px solid var(--borde-2); color: var(--texto-2); }
.lt-texto { font-size: 13px; color: var(--texto); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.lt-ref { font-size: 12px; color: var(--texto-3); border-left: 2px solid var(--borde-2); padding-left: 8px; overflow-wrap: anywhere; }
.lt-meta { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: 11.5px; color: var(--texto-3); font-variant-numeric: tabular-nums; }
.lt-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.lt-chip { height: 22px; font-size: 11.5px; gap: 4px; }
.lt-chip .ic { width: 12px; height: 12px; stroke-width: 2.4; }
.lt-emergencia .lt-cuerpo { background: var(--rojo-suave); border: 1px solid #F1C4C4; border-radius: 12px; padding: 8px 10px; }
.lt-emergencia .lt-titulo { color: var(--rojo); letter-spacing: .02em; }
.lt-emergencia .lt-ic { background: var(--rojo); color: #fff; }
/* Avance por punto (solo lectura) */
.lt-avance { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lt-progreso { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 650; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.lt-barra { flex: 1; height: 8px; border-radius: 99px; background: var(--gris-suave); overflow: hidden; max-width: 260px; }
.lt-barra i { display: block; height: 100%; border-radius: inherit; background: var(--verde); transition: width var(--t-media); }
.lt-puntos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lt-pt { display: flex; gap: 12px; position: relative; padding-bottom: 14px; min-width: 0; }
.lt-pt:last-child { padding-bottom: 0; }
.lt-pt:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 32px; bottom: 2px; border-left: 2px dashed var(--borde-2); }
.lt-pt-listo:not(:last-child)::before { border-left-style: solid; border-left-color: #9ED3AF; }
.lt-marca { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; flex: none; z-index: 1; background: var(--gris); }
.lt-marca.retiro { background: #6A1B9A; }
.lt-marca.entrega { background: var(--naranja); }
.lt-marca.general { background: var(--gris-suave); color: var(--texto-2); }
.lt-pt-listo .lt-marca { box-shadow: 0 0 0 3px var(--verde-suave); }
.lt-dir { font-size: 12.5px; color: var(--texto-2); overflow-wrap: anywhere; }
.lt-minis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lt-mini { position: relative; width: 52px; height: 52px; padding: 0; border-radius: 9px; overflow: hidden; border: 1px solid var(--borde); background: var(--gris-suave); cursor: zoom-in; flex: none; }
.lt-mini img { width: 100%; height: 100%; object-fit: cover; }
.lt-mas { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 20, 40, .55); color: #fff; font-weight: 800; font-size: 13px; }

/* Botón flotante "Avisar" del conductor */
.vc-avisar { position: fixed; z-index: 60; right: calc(24px + env(safe-area-inset-right)); bottom: calc(24px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px; border-radius: 99px; border: 0;
  background: var(--naranja); color: #fff; font: inherit; font-weight: 750; font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(242, 106, 27, .38), 0 2px 4px rgba(15, 30, 60, .18); transition: transform var(--t-rapida), background var(--t-rapida); }
.vc-avisar[hidden] { display: none; }
.vc-avisar:hover { background: var(--naranja-2); }
.vc-avisar:active { transform: scale(.97); }
.vc-avisar:focus-visible { box-shadow: 0 0 0 4px rgba(242, 106, 27, .35), 0 6px 18px rgba(242, 106, 27, .38); }
.vc-avisar .ic { width: 20px; height: 20px; stroke-width: 2; }
.vc-avisar-latido { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; animation: vc-latido 2.4s ease-out infinite; }
@keyframes vc-latido { 0% { box-shadow: 0 0 0 0 rgba(242, 106, 27, .45); } 70% { box-shadow: 0 0 0 14px rgba(242, 106, 27, 0); } 100% { box-shadow: 0 0 0 0 rgba(242, 106, 27, 0); } }
body.con-avisar .contenido { padding-bottom: 104px; }
body.con-avisar .tostadas { bottom: 92px; }
@media (max-width: 640px) {
  .vc-avisar { right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); height: 50px; }
  .app.con-barra ~ .vc-avisar, body:has(.app.con-barra) .vc-avisar { bottom: calc(80px + env(safe-area-inset-bottom)); }
  body.con-avisar .app.con-barra .contenido { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  body.con-avisar .tostadas { bottom: calc(146px + env(safe-area-inset-bottom)); }
}

/* Avisos con botones (ui.js avisoAccion) */
.tostada.con-acciones { align-items: flex-start; width: 100%; }
.tostada.con-acciones > .ic { margin-top: 2px; }
.tostada.urgente { background: #8A3A0B; }
.tostada-titulo { display: block; font-weight: 800; margin-bottom: 2px; }
.tostada.con-acciones .crece > span { display: block; font-weight: 500; overflow-wrap: anywhere; }
.tostada-acciones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tostada-acciones .btn { --b-bg: rgba(255,255,255,.12); --b-fg: #fff; --b-borde: rgba(255,255,255,.22); }
.tostada-acciones .btn:hover { background: rgba(255,255,255,.2); }
.tostada-acciones .btn-acento { --b-bg: var(--naranja); --b-borde: var(--naranja); }
.tostada-acciones .btn-primario { --b-bg: var(--azul-claro); --b-borde: var(--azul-claro); }
.tostada-x { flex: none; width: 28px; height: 28px; margin: -3px -6px 0 0; border: 0; border-radius: 8px; background: transparent; color: rgba(255,255,255,.75); display: grid; place-items: center; cursor: pointer; }
.tostada-x:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Alarma de emergencia (buzon.js): ventana roja sobre todo */
.vc-emerg { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; background: rgba(120, 10, 10, .78); animation: vc-emerg-fondo 1.2s ease-in-out infinite alternate; overflow-y: auto; }
@keyframes vc-emerg-fondo { from { background: rgba(120, 10, 10, .72); } to { background: rgba(190, 20, 20, .86); } }
.vc-emerg-caja { width: min(560px, 100%); background: var(--superficie); border-radius: var(--r-xl); box-shadow: 0 20px 60px rgba(0,0,0,.4); overflow: hidden; animation: subir 220ms cubic-bezier(.2, .8, .2, 1); }
.vc-emerg-cab { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: var(--rojo); color: #fff; }
.vc-emerg-cab h2 { font-size: 19px; letter-spacing: .01em; }
.vc-emerg-cab p { font-size: 13px; opacity: .85; margin-top: 2px; }
.vc-emerg-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); flex: none; animation: vc-latido-rojo 1.2s ease-out infinite; }
@keyframes vc-latido-rojo { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); } 100% { box-shadow: 0 0 0 16px rgba(255,255,255,0); } }
.vc-emerg-lista { list-style: none; margin: 0; padding: 0; max-height: min(64dvh, 560px); overflow-y: auto; }
.vc-emerg-lista li { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.vc-emerg-lista li + li { border-top: 1px solid var(--borde); }
.vc-emerg-dato { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.vc-emerg-dato b { font-size: 15px; }
.vc-emerg-dato span { font-size: 13.5px; color: var(--texto-2); font-weight: 600; }
.vc-emerg-dato q { font-size: 15px; font-weight: 650; color: var(--texto); quotes: "\201C" "\201D"; }
.vc-emerg-dato small { font-size: 12px; color: var(--texto-3); }
.vc-emerg-acc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vc-emerg-acc .btn { min-width: 0; font-size: 14px; padding: 0 10px; }
.vc-emerg-acc .btn span { overflow: hidden; text-overflow: ellipsis; }
.vc-emerg-atender { --b-bg: var(--rojo); --b-fg: #fff; --b-borde: var(--rojo); }
.vc-emerg-atender:hover { background: #A51F1F; }
body.con-emergencia { overflow: hidden; }
@media (max-width: 640px) {
  .vc-emerg { padding: 12px; place-items: end center; }
  .vc-emerg-acc { grid-template-columns: minmax(0, 1fr); }
  .vc-emerg-lista li { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }
}

/* Selector de fechas (js/selector-fechas.js, Ronda 11 §8) */
.sf { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.sf-det { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.sf-nav { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.sf-flecha { flex: none; }
.sf-flecha:disabled { opacity: .4; cursor: not-allowed; }
.sf-rotulo { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 12px; border-radius: 10px; border: 1px solid var(--borde-2); background: var(--superficie); font: inherit; font-size: 13px; color: var(--texto); cursor: pointer; min-width: 0; max-width: 100%; white-space: nowrap; transition: border-color var(--t-rapida), background var(--t-rapida); }
.sf-rotulo:hover { border-color: var(--azul); background: var(--superficie-2); }
.sf-rotulo b { font-weight: 750; }
.sf-rotulo .s { font-weight: 600; color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; min-width: 0; font-variant-numeric: tabular-nums; }
.sf-rotulo .ic { color: var(--texto-3); flex: none; }
.sf-txt { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--texto-2); min-width: 0; font-variant-numeric: tabular-nums; }
.sf-txt .ic { color: var(--texto-3); flex: none; }
.sf-rango { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.sf-rango label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--texto-2); min-width: 0; }
.sf-rango .entrada { height: 34px; width: 152px; padding: 0 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.sf-anio-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.sf-anio { font-size: 15px; min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.sf-lista { display: flex; flex-direction: column; gap: 2px; max-height: min(56dvh, 460px); overflow-y: auto; overscroll-behavior: contain; }
.sf-op { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left; padding: 9px 12px; border: 1px solid transparent; border-radius: 10px; background: transparent; font: inherit; color: inherit; cursor: pointer; }
.sf-op:hover, .sf-op:focus-visible { background: var(--superficie-2); border-color: var(--borde); }
.sf-op b { font-size: 13.5px; min-width: 84px; }
.sf-op span { font-size: 13px; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.sf-op small { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--azul); }
.sf-op.activo { background: var(--azul-suave); border-color: #D3E2F7; }
.sf-meses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sf-mes { height: 40px; border: 1px solid var(--borde-2); border-radius: 10px; background: var(--superficie); font: inherit; font-size: 13px; font-weight: 650; color: var(--texto); cursor: pointer; }
.sf-mes:hover:not(:disabled) { border-color: var(--azul); }
.sf-mes.actual { color: var(--azul); }
.sf-mes.activo { background: var(--azul); border-color: var(--azul); color: #fff; }
.sf-mes:disabled { opacity: .4; cursor: not-allowed; }
@media (max-width: 420px) {
  .sf .segmento { padding: 0 9px; font-size: 12.5px; }
  .sf-rango .entrada { width: 136px; }
  .sf-rango label > span { min-width: 40px; }
}

/* Impresión */
@media print {
  .lateral, .superior, .barra-inferior, .tostadas, .no-imprimir { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .tarjeta, .kpi { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Camión de carga animado (Ronda 14): el mismo de la app */
.vc-carga { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--texto-2); font-size: 14px; }
.vc-camion { width: 132px; height: auto; overflow: hidden; display: block; }
.vc-camion-cuerpo { animation: vc-rebote .52s ease-in-out infinite alternate; }
.vc-camion-ruedas .rueda path { transform-box: fill-box; transform-origin: center; animation: vc-giro .52s linear infinite; }
.vc-camion-camino line { stroke: #B8C3D3; stroke-linecap: round; }
.vc-camion-camino .base { stroke-width: 1.6; }
.vc-camion-camino .trazos { stroke-width: 1.4; stroke-dasharray: 9 13; animation: vc-camino .42s linear infinite; }
.vc-camion-viento line { stroke: #F26A1B; stroke-width: 1.6; stroke-linecap: round; animation: vc-viento .7s linear infinite; }
.vc-camion-viento line:nth-child(2) { animation-delay: -.233s; }
.vc-camion-viento line:nth-child(3) { animation-delay: -.466s; }
@keyframes vc-rebote { from { transform: translateY(0); } to { transform: translateY(-1.2px); } }
@keyframes vc-giro { to { transform: rotate(360deg); } }
@keyframes vc-camino { to { stroke-dashoffset: 22; } }
@keyframes vc-viento { from { transform: translateX(0); opacity: .55; } to { transform: translateX(10px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .vc-camion * { animation-duration: 2.4s !important; } }
