/* ADHENNA · Logística de Buses y Venta de Pasajes
   Paleta del logo: negro #000, azul #005BFF, gris #706F6F + franjas azul pastel */
:root {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --ink: #0B0D12;
  --ink-2: #3E4450;
  --muted: #706F6F;
  --line: #E4E8EF;
  --blue: #005BFF;
  --blue-700: #0046C7;
  --pastel-1: #F0F5FF;
  --pastel-2: #DDE8FF;
  --pastel-3: #BFD3FF;
  --pastel-4: #9DBCFF;
  --ok: #0E9F6E;
  --ok-bg: #E7F7F0;
  --warn: #C27803;
  --warn-bg: #FFF5DB;
  --bad: #D9383E;
  --bad-bg: #FDECEC;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .16);
  --font-title: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --font: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14.5px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
h1, h2, h3, h4 { font-family: var(--font-title); margin: 0; letter-spacing: .01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-family: var(--font-title); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ── Franjas: motivo tomado de la "E" del logo ── */
.stripes { display: grid; gap: 4px; }
.stripes i { display: block; height: 5px; border-radius: 3px; background: var(--pastel-3); }
.stripes i:nth-child(1) { width: 100%; background: var(--pastel-2); }
.stripes i:nth-child(2) { width: 72%; background: var(--pastel-3); }
.stripes i:nth-child(3) { width: 44%; background: var(--pastel-4); }
.band { height: 6px; background: linear-gradient(90deg, var(--pastel-2) 0 33%, var(--pastel-3) 33% 66%, var(--pastel-4) 66% 100%); }

/* ── Login ── */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; background: var(--bg); }
.login::before, .login::after { content: ''; position: absolute; left: -10%; right: -10%; height: 90px; border-radius: 60px; transform: rotate(-8deg); }
.login::before { top: 12%; background: var(--pastel-2); box-shadow: 0 130px 0 var(--pastel-1); }
.login::after { bottom: 10%; background: var(--pastel-3); opacity: .55; box-shadow: 0 -130px 0 var(--pastel-1); }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 400px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.login-card .inner { padding: 30px 28px 26px; }
.login-card img { width: 230px; max-width: 80%; display: block; margin: 0 auto 6px; }
.login-card .producto { text-align: center; font-family: var(--font-title); letter-spacing: .28em; text-transform: uppercase; color: var(--muted); font-size: 12px; margin-bottom: 22px; }
.roles-hint { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.roles-hint button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 20px; padding: 4px 11px; font-size: 12px; cursor: pointer; color: var(--ink-2); }

/* ── Formularios ── */
label.f { display: grid; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.input, input[type=text], input[type=number], input[type=password], input[type=tel], input[type=date], input[type=month], input[type=search], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; min-height: 42px;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 91, 255, .14); }
textarea { min-height: 70px; resize: vertical; }
.grid { display: grid; gap: 14px; align-content: start; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; align-content: start; }
.chk { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; cursor: pointer; }
.chk input { width: 18px; height: 18px; accent-color: var(--blue); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 9px 15px; font-weight: 600; cursor: pointer; background: var(--blue); color: #fff; min-height: 40px; white-space: nowrap; transition: background .15s, transform .05s; }
.btn:hover { background: var(--blue-700); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sec { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.sec:hover { background: var(--surface-2); border-color: var(--pastel-3); }
.btn.soft { background: var(--pastel-1); color: var(--blue-700); }
.btn.soft:hover { background: var(--pastel-2); }
.btn.dark { background: var(--ink); }
.btn.dark:hover { background: #262a33; }
.btn.ok { background: var(--ok); }
.btn.bad { background: var(--surface); color: var(--bad); border-color: #f3c4c6; }
.btn.bad:hover { background: var(--bad-bg); }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn.lg { padding: 13px 20px; min-height: 52px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--ink-2); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--pastel-1); color: var(--blue); }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── Shell oficina ── */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 20px 20px 14px; border-bottom: 1px solid var(--line); }
.side .brand img { width: 150px; display: block; }
.side .brand .app { margin-top: 12px; font-family: var(--font-title); font-weight: 600; font-size: 15px; }
.side .brand .empresa { font-size: 12px; color: var(--muted); }
.side .brand .stripes { margin-top: 12px; }
.nav { padding: 12px 10px; display: grid; gap: 2px; overflow-y: auto; flex: 1; align-content: start; }
.nav .sec-t { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 12px 12px 4px; font-family: var(--font-title); }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; position: relative; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: var(--pastel-1); color: var(--blue-700); }
.nav a.on::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--blue); }
.nav a .badge { margin-left: auto; }
.side .yo { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--pastel-2); color: var(--blue-700); display: grid; place-items: center; font-family: var(--font-title); font-weight: 700; flex: none; }
.side .yo .who { flex: 1; min-width: 0; }
.side .yo .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .yo .who span { font-size: 11.5px; color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 16px 28px; background: rgba(243, 245, 248, .85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid transparent; }
.top .titulo { flex: 1; min-width: 0; }
.top .titulo .crumb { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-family: var(--font-title); }
.top .menu-btn { display: none; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 5px 11px; border-radius: 20px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 0 rgba(14, 159, 110, .5); animation: pulso 2s infinite; }
.dot.off { background: var(--bad); }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(14, 159, 110, .45); } 70% { box-shadow: 0 0 0 8px rgba(14, 159, 110, 0); } 100% { box-shadow: 0 0 0 0 rgba(14, 159, 110, 0); } }
.content { padding: 8px 28px 40px; display: grid; gap: 18px; align-content: start; }

/* ── Tarjetas ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card > .hd { display: flex; align-items: center; gap: 10px; padding: 15px 18px 0; flex-wrap: wrap; }
.card > .hd h2, .card > .hd h3 { flex: 1; }
.card > .bd { padding: 15px 18px 18px; }
.card.pastel { background: linear-gradient(180deg, var(--pastel-1), var(--surface) 70%); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 14px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .val { font-family: var(--font-title); font-size: 27px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.kpi .stripes { position: absolute; right: 14px; top: 16px; width: 44px; }
.kpi.azul { background: var(--blue); border-color: var(--blue); color: #fff; }
.kpi.azul .lbl, .kpi.azul .sub { color: rgba(255, 255, 255, .8); }
.kpi.azul .stripes i { background: rgba(255, 255, 255, .35); }

/* ── Tablas ── */
.tabla-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--pastel-1); }
table.t td.r, table.t th.r { text-align: right; }
.vacio { text-align: center; padding: 34px 16px; color: var(--muted); }
.vacio .stripes { width: 70px; margin: 0 auto 12px; }

/* ── Etiquetas ── */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.azul { background: var(--pastel-1); color: var(--blue-700); border-color: var(--pastel-2); }
.tag.ok { background: var(--ok-bg); color: var(--ok); border-color: #bfe8d6; }
.tag.warn { background: var(--warn-bg); color: var(--warn); border-color: #f5dd9c; }
.tag.bad { background: var(--bad-bg); color: var(--bad); border-color: #f6c7c9; }
.tag.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.tabs button.on { background: var(--pastel-2); color: var(--blue-700); }

/* ── Tablero de pedidos ── */
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 200px; display: flex; flex-direction: column; gap: 9px; }
.col > .ch { display: flex; align-items: center; gap: 8px; padding: 4px 4px 6px; font-family: var(--font-title); font-weight: 600; }
.col > .ch .cnt { margin-left: auto; font-size: 12px; color: var(--muted); }
.col > .ch .bar { width: 4px; height: 16px; border-radius: 2px; background: var(--muted); }
.pedido { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pedido:hover { border-color: var(--pastel-4); box-shadow: var(--shadow); }
.pedido.nuevo { animation: nuevo 1.6s ease-out; }
@keyframes nuevo { 0% { box-shadow: 0 0 0 4px rgba(0, 91, 255, .45); } 100% { box-shadow: 0 0 0 0 rgba(0, 91, 255, 0); } }
.pedido .l1 { display: flex; align-items: center; gap: 6px; }
.pedido .l1 b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pedido .dir { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.pedido .l3 { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
.chip { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--pastel-1); color: var(--blue-700); font-weight: 600; }

/* ── Mapa ── */
.mapa { height: 520px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--pastel-1); z-index: 1; }
.mapa.sm { height: 260px; }
.leaflet-container { font-family: var(--font); }
.pin-rep { width: 40px; height: 40px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0, 70, 199, .45); display: grid; place-items: center; color: #fff; font-family: var(--font-title); font-weight: 700; font-size: 13px; position: relative; }
.pin-rep::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid rgba(0, 91, 255, .35); animation: onda 2s infinite; }
.pin-rep.off { background: var(--muted); box-shadow: none; }
.pin-rep.off::after { display: none; }
@keyframes onda { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.pin-ped { width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #fff; border: 3px solid var(--blue); display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.pin-ped span { transform: rotate(45deg); font-size: 11px; font-weight: 700; font-family: var(--font-title); color: var(--ink); }
.pin-ped.en_ruta { border-color: var(--warn); }
.pin-ped.entregado { border-color: var(--ok); background: var(--ok-bg); }
.pin-ped.rechazado { border-color: var(--bad); }
.pin-ped.pendiente { border-color: var(--muted); }
.pin-planta { width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }

/* ── Modal ── */
.modal-bg { position: fixed; inset: 0; background: rgba(11, 13, 18, .42); z-index: 1000; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); overflow: hidden; animation: sube .2s ease-out; }
.modal.xl { max-width: 900px; }
.modal .mh { display: flex; align-items: center; gap: 10px; padding: 18px 22px 12px; }
.modal .mh h2 { flex: 1; }
.modal .mb { padding: 6px 22px 18px; overflow-y: auto; }
.modal .mf { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface-2); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes sube { from { transform: translateY(14px); opacity: 0; } }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 2000; display: grid; gap: 8px; max-width: calc(100vw - 36px); }
.toast { background: var(--ink); color: #fff; padding: 11px 15px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; gap: 9px; align-items: center; animation: sube .2s; max-width: 380px; }
.toast.err { background: var(--bad); }
.toast.ok { background: var(--ok); }
.toast.azul { background: var(--blue); }

/* ── Productos (selector de cantidades) ── */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.prod { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); display: grid; gap: 8px; }
.prod.activo { border-color: var(--blue); background: var(--pastel-1); }
.prod .pn { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.prod .gota { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); flex: none; }
.prod .pp { font-size: 12px; color: var(--muted); }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.qty button { border: 0; background: transparent; width: 38px; height: 38px; font-size: 20px; cursor: pointer; color: var(--blue); font-weight: 700; }
.qty button:hover { background: var(--pastel-1); }
.qty input { border: 0; text-align: center; min-height: 38px; padding: 0; font-family: var(--font-title); font-weight: 700; font-size: 16px; box-shadow: none !important; }
.total-bar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--ink); color: #fff; }
.total-bar .v { font-family: var(--font-title); font-size: 24px; font-weight: 700; margin-left: auto; }

.lista-busqueda { border: 1px solid var(--line); border-radius: 10px; max-height: 230px; overflow-y: auto; }
.lista-busqueda div { padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.5px; }
.lista-busqueda div:last-child { border-bottom: 0; }
.lista-busqueda div:hover { background: var(--pastel-1); }

.alerta { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.alerta .tag { flex: none; }
.alerta.alto { background: var(--bad-bg); border-color: #f6c7c9; }
.alerta.medio { background: var(--warn-bg); border-color: #f5dd9c; }

.barra { height: 8px; border-radius: 4px; background: var(--pastel-1); overflow: hidden; }
.barra > i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.barra.warn > i { background: var(--warn); }
.barra.bad > i { background: var(--bad); }

.chart { width: 100%; height: auto; display: block; }
.stock-row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 12px; align-items: center; padding: 7px 0; }
.stock-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.stock-bar i { display: block; height: 100%; }

/* ═════════════ App del repartidor (celular) ═════════════ */
.rep { min-height: 100%; display: flex; flex-direction: column; background: var(--bg); max-width: 640px; margin: 0 auto; }
.rep-top { background: var(--surface); padding: 12px 16px 0; position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); }
.rep-top .fila { display: flex; align-items: center; gap: 10px; }
.rep-top img { height: 20px; }
.rep-top .hola { flex: 1; font-family: var(--font-title); font-weight: 600; font-size: 16px; }
.rep-estado { display: flex; gap: 6px; padding: 10px 0 12px; overflow-x: auto; }
.rep-estado .live { font-size: 11.5px; padding: 4px 9px; white-space: nowrap; }
.rep-body { flex: 1; padding: 14px 14px 96px; display: grid; gap: 12px; align-content: start; }
.rep-nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: center; z-index: 40; padding-bottom: env(safe-area-inset-bottom); }
.rep-nav > div { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 640px; }
.rep-nav button { border: 0; background: transparent; padding: 10px 4px 12px; display: grid; justify-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; position: relative; }
.rep-nav button svg.i { width: 22px; height: 22px; }
.rep-nav button.on { color: var(--blue); }
.rep-nav button.on::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--blue); }
.rep-nav .badge { position: absolute; top: 5px; left: calc(50% + 6px); }
.entrega { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.entrega .eh { display: flex; gap: 12px; padding: 14px 14px 10px; align-items: flex-start; }
.entrega .orden { width: 34px; height: 34px; border-radius: 10px; background: var(--pastel-2); color: var(--blue-700); display: grid; place-items: center; font-family: var(--font-title); font-weight: 700; flex: none; }
.entrega .info { flex: 1; min-width: 0; }
.entrega .info b { font-size: 15.5px; }
.entrega .info .dir { font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.entrega .acciones { display: grid; grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid var(--line); }
.entrega .acciones a, .entrega .acciones button { border: 0; background: transparent; padding: 11px 4px; display: flex; gap: 6px; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; color: var(--ink-2); text-decoration: none; cursor: pointer; }
.entrega .acciones > * + * { border-left: 1px solid var(--line); }
.entrega .cta { padding: 0 14px 14px; }
.entrega.hecha { opacity: .72; }
.entrega.nuevo { animation: nuevo 1.8s ease-out; }
.sheet-steps { display: grid; gap: 14px; }
.linea-ent { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }
.linea-ent .t { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.pagos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pagos button { border: 1.5px solid var(--line); background: #fff; border-radius: 11px; padding: 12px 8px; font-weight: 600; cursor: pointer; }
.pagos button.on { border-color: var(--blue); background: var(--pastel-1); color: var(--blue-700); }
.foto-prev { width: 100%; max-height: 200px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.aviso-nuevo { position: fixed; top: 12px; left: 12px; right: 12px; z-index: 3000; background: var(--blue); color: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: center; animation: sube .25s; max-width: 616px; margin: 0 auto; }
.aviso-nuevo b { display: block; font-family: var(--font-title); font-size: 16px; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-template-columns: repeat(4, 250px); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 262px; z-index: 900; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.abierto { transform: none; }
  .top { padding: 12px 16px; }
  .top .menu-btn { display: inline-grid; }
  .content { padding: 6px 16px 32px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .mapa { height: 400px; }
  .modal { border-radius: 16px; }
  .modal .mh, .modal .mb, .modal .mf { padding-left: 16px; padding-right: 16px; }
}

.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input { -moz-appearance: textfield; }
.qty input { min-width: 0; flex: 1; width: 100%; }
.grid > * { min-width: 0; }
@media (max-width: 640px) {
  .modal-bg { align-items: end; padding: 0; }
  .modal { max-width: 100%; border-radius: 20px 20px 0 0; max-height: 94vh; animation: subeHoja .22s ease-out; }
  .modal .mf { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .modal .mf .btn.lg { flex: 1; }
  .toasts { top: 12px; bottom: auto; left: 12px; right: 12px; justify-items: center; }
  @keyframes subeHoja { from { transform: translateY(40%); } }
}

/* ── Simulador ── */
.toast.msj { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 4px solid #25D366; align-items: flex-start; }
.toast.msj b { font-size: 13.5px; }
.toast.msj .msj-o { margin-left: 8px; font-size: 11px; color: var(--muted); }
.toast.msj .msj-ic { width: 30px; height: 30px; border-radius: 50%; background: #E8F9EE; color: #128C4B; display: grid; place-items: center; flex: none; }
.sim-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--pastel-3); background: var(--pastel-1); color: var(--blue-700); border-radius: 20px; padding: 6px 12px; font-weight: 600; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.sim-pill.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.sim-pill.on .dot { background: #fff; animation: pulsoB 1.4s infinite; }
@keyframes pulsoB { 50% { opacity: .35; } }
.vel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.vel button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 4px; font-weight: 700; cursor: pointer; font-family: var(--font-title); }
.vel button.on { border-color: var(--blue); background: var(--pastel-1); color: var(--blue-700); }
.camion { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.camion:last-child { border-bottom: 0; }
@media (max-width: 860px) { .sim-pill span.txt { display: none; } }

#app { min-height: 100%; }
.login { min-height: 100vh; }
@media (max-width: 640px) { .top { gap: 8px; padding: 10px 12px; } .top .crumb { display: none; } .top h1 { font-size: 20px; } #btnNuevoPedido span, #liveInd span:last-child { display: none; } #btnNuevoPedido { padding: 9px 11px; } }

/* ═════════════ ADHENNA Buses ═════════════ */
.mono { font-family: var(--mono); letter-spacing: .02em; }
.neg { color: var(--bad) !important; }
.kpi .val .de { font-size: 16px; color: var(--muted); margin-left: 4px; font-weight: 600; }
.cargando { height: 80px; background: linear-gradient(90deg, var(--surface-2), var(--pastel-1), var(--surface-2)); background-size: 200% 100%; animation: brillo 1.2s infinite; border-radius: 12px; }
@keyframes brillo { to { background-position: -200% 0; } }
.warn-btn { background: var(--warn); }
.warn-btn:hover { background: #a86702; }
.sub-t { font-family: var(--font-title); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; }
svg.i.grande { width: 42px; height: 42px; color: var(--pastel-4); margin-bottom: 8px; }
.lbl-f { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }

/* Buscador de venta */
.buscador .bd { align-items: flex-end; gap: 14px; }
.buscador label.f { min-width: 170px; }
.buscador .swap { margin-bottom: 6px; border: 1px solid var(--line); background: var(--surface); }
.fechas { gap: 6px; }
.chip-f { border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip-f.on { border-color: var(--blue); background: var(--pastel-1); color: var(--blue-700); }
.fechas input[type=date] { width: auto; }
.caja-estado { margin-left: auto; }
.caja-estado .tag { padding: 7px 12px; font-size: 12.5px; }
.caja-estado .tag svg { width: 15px; height: 15px; }

.venta-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 16px; align-items: start; }
.venta-izq { display: grid; gap: 16px; min-width: 0; align-content: start; }
.carro-col { position: sticky; top: 84px; }
.salidas-col .bd { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; }
.salidas-col .salida-it { flex: none; width: 285px; }
.salidas-col .vacio { width: 100%; }
.salida-it { display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; align-items: center; text-align: left; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; cursor: pointer; transition: border-color .15s, background .15s; width: 100%; }
.salida-it:hover { border-color: var(--pastel-4); }
.salida-it.on { border-color: var(--blue); background: var(--pastel-1); box-shadow: 0 0 0 3px rgba(0, 91, 255, .12); }
.salida-it.off { opacity: .55; }
.salida-it .hrs { display: grid; }
.salida-it .hrs b { font-size: 19px; font-family: var(--font-title); }
.salida-it .hrs span { font-size: 12px; }
.salida-it .det { font-size: 13px; min-width: 0; }
.salida-it .der { display: grid; justify-items: end; gap: 2px; }
.libres { font-weight: 700; font-size: 12.5px; color: var(--ok); background: var(--ok-bg); border-radius: 20px; padding: 2px 9px; white-space: nowrap; }
.libres.pocos { color: var(--warn); background: var(--warn-bg); }

.sal-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; width: 100%; flex-wrap: wrap; }
.sal-head h3 { font-size: 17px; }
.precios { display: flex; gap: 8px; }
.precios span { display: grid; background: var(--pastel-1); border-radius: 10px; padding: 6px 12px; text-align: right; }
.precios small { font-size: 11px; color: var(--blue-700); font-weight: 600; }
.precios b { font-family: var(--font-title); font-size: 17px; }
#vMapa.cerrada .bus-body { opacity: .6; }

/* ── Mapa de asientos (bus de perfil) ── */
.pisos { margin-bottom: 12px; }
.bus-body { display: flex; align-items: stretch; background: var(--surface-2); border: 2px solid var(--pastel-3); border-radius: 46px 18px 18px 46px; padding: 14px 14px 14px 10px; overflow-x: auto; position: relative; }
.bus-body::before { content: ''; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 34px; border-radius: 34px 0 0 34px; background: linear-gradient(90deg, var(--pastel-2), transparent); opacity: .7; }
.bus-frente { display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 4px 12px 4px 18px; border-right: 2px dashed var(--pastel-3); margin-right: 12px; position: relative; z-index: 1; }
.volante { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--ink-2); display: grid; place-items: center; color: var(--ink-2); }
.volante svg { width: 18px; height: 18px; }
.puerta { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border: 1.5px solid var(--line); border-radius: 6px; padding: 8px 3px; background: var(--surface); font-weight: 600; }
.bus-asientos { display: flex; gap: 6px; }
.bcol { display: grid; grid-template-rows: repeat(5, auto); gap: 6px; }
.bgap { height: 40px; }
.bgap.pasillo { height: 22px; }
.bus-cola { display: flex; align-items: flex-end; padding-left: 10px; }
.bano { width: 42px; height: 42px; border-radius: 10px; background: var(--surface); border: 1.5px dashed var(--line); display: grid; place-items: center; font-size: 11px; color: var(--muted); font-weight: 700; }
.seat { width: 44px; height: 40px; border-radius: 9px 12px 12px 9px; border: 1.5px solid var(--pastel-3); background: var(--surface); color: var(--ink); font-family: var(--font-title); font-weight: 700; font-size: 13.5px; cursor: pointer; position: relative; display: grid; place-items: center; transition: transform .08s, background .12s, border-color .12s; padding: 0; }
.seat::after { content: ''; position: absolute; right: 3px; top: 5px; bottom: 5px; width: 5px; border-radius: 3px; background: var(--pastel-2); }
.seat span { position: relative; z-index: 1; margin-right: 6px; }
.seat.libre:hover { border-color: var(--blue); background: var(--pastel-1); transform: translateY(-1px); }
.seat.salon_cama { width: 52px; height: 46px; border-color: #8FB2FF; }
.seat.salon_cama::before { content: ''; position: absolute; left: 4px; bottom: 4px; width: 10px; height: 3px; border-radius: 2px; background: var(--pastel-4); }
.bus-body.piso1 .bgap { height: 46px; }
.seat.parcial::before { content: ''; position: absolute; left: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.seat.sel { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 3px 10px rgba(0, 70, 199, .35); }
.seat.sel::after { background: rgba(255, 255, 255, .45); }
.seat.vendido { background: #E7E9EE; border-color: #D5D9E1; color: #9097A5; cursor: not-allowed; }
.seat.vendido::after { background: #D5D9E1; }
.seat.abordado { background: var(--ink); border-color: var(--ink); color: #fff; cursor: not-allowed; }
.seat.abordado::after { background: #4a4f5b; }
.seat.bloq { background: var(--warn-bg); border-color: #F0C35A; color: var(--warn); cursor: not-allowed; animation: latido 1.6s infinite; }
.seat.bloq::after { background: #F5DD9C; }
@keyframes latido { 50% { opacity: .55; } }
.seat.flash { animation: vendidoAhora 1.4s ease-out; }
@keyframes vendidoAhora { 0% { box-shadow: 0 0 0 0 rgba(224, 118, 43, .9); transform: scale(1.15); } 100% { box-shadow: 0 0 0 12px rgba(224, 118, 43, 0); transform: none; } }
.seat.mini { width: 18px; height: 16px; border-radius: 4px 5px 5px 4px; display: inline-block; cursor: default; vertical-align: middle; }
.seat.mini::after { right: 2px; top: 3px; bottom: 3px; width: 3px; }
.leyenda-asientos { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.leyenda-asientos span { display: inline-flex; align-items: center; gap: 6px; }
.leyenda-asientos .seat.bloq { animation: none; }

/* Carro de venta */
.carro-col .bd { display: grid; gap: 12px; }
.pasajeros { display: grid; gap: 10px; max-height: calc(100vh - 430px); min-height: 120px; overflow-y: auto; padding-right: 2px; }
.pax { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 12px; background: var(--surface-2); }
.pax-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pax-h .precio { margin-left: auto; font-family: var(--font-title); }
.pax .grid { gap: 8px; }
.pax input, .pax select { min-height: 36px; padding: 7px 10px; }
.nasiento { min-width: 32px; height: 30px; border-radius: 8px; background: var(--blue); color: #fff; display: inline-grid; place-items: center; font-family: var(--font-title); font-weight: 700; font-size: 14px; padding: 0 6px; flex: none; }
.nasiento svg { width: 16px; height: 16px; }
input.mal { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(217, 56, 62, .14); }
.pagos button { font-size: 13.5px; }
.pagos button svg { width: 16px; height: 16px; vertical-align: -3px; }

/* ── Boleto térmico 80 mm ── */
.tickets { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.ticket { width: 290px; background: #fff; border: 1px dashed #c9ced8; border-radius: 6px; padding: 14px 14px 12px; font-family: 'IBM Plex Sans', Arial, sans-serif; color: #000; font-size: 12px; display: grid; gap: 9px; box-shadow: var(--shadow); }
.ticket small { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: #555; }
.t-emp { text-align: center; display: grid; gap: 1px; font-size: 10.5px; }
.t-emp b { font-size: 14px; font-family: 'Chakra Petch', Arial, sans-serif; }
.t-tit { display: flex; justify-content: space-between; border-top: 1.5px solid #000; border-bottom: 1.5px solid #000; padding: 4px 0; font-weight: 700; font-size: 11.5px; letter-spacing: .06em; }
.t-ruta { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; }
.t-ruta b { font-size: 16px; font-family: 'Chakra Petch', Arial, sans-serif; }
.t-fl { font-size: 20px; font-weight: 700; }
.t-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.t-grid b { font-size: 13px; }
.t-asiento { font-size: 26px !important; font-family: 'Chakra Petch', Arial, sans-serif; line-height: 1; }
.t-pax { display: grid; gap: 1px; border-top: 1px dashed #999; padding-top: 7px; }
.t-pax b { font-size: 13.5px; }
.t-qr { display: grid; justify-items: center; gap: 3px; }
.t-qr img { width: 150px; height: 150px; }
.t-cod { font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600; letter-spacing: .06em; }
.t-tot { display: flex; justify-content: space-between; align-items: center; border-top: 1.5px solid #000; padding-top: 6px; }
.t-tot b { font-size: 17px; font-family: 'Chakra Petch', Arial, sans-serif; }
.t-pie { font-size: 9.5px; text-align: center; color: #333; line-height: 1.35; }
body.imprimiendo .ticket { break-inside: avoid; }

/* ── Encomiendas ── */
.enc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.timeline .tl { position: relative; padding-top: 16px; display: grid; gap: 2px; font-size: 12px; }
.timeline .tl i { position: absolute; top: 0; left: 0; right: 0; height: 5px; border-radius: 3px; background: var(--line); }
.timeline .tl.ok i { background: var(--blue); }
.timeline .tl span { color: var(--muted); font-size: 11.5px; }
.timeline.horiz { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }

/* ── Aviso de actividad en vivo ── */
.feed { position: fixed; left: 264px; bottom: 16px; z-index: 1500; display: grid; gap: 6px; pointer-events: none; max-width: 420px; }
.feed-it { display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 10px; padding: 8px 12px; font-size: 12.5px; box-shadow: var(--shadow-lg); animation: sube .25s; transition: opacity .35s, transform .35s; }
.feed-it.sale { opacity: 0; transform: translateX(-12px); }
.feed-it .fi { color: var(--blue); display: grid; }
.feed-it.alerta { border-left-color: var(--bad); }
.feed-it.alerta .fi { color: var(--bad); }
.feed-it.llegada { border-left-color: var(--ok); }
.feed-it.encomienda { border-left-color: #E0762B; }
@media (max-width: 860px) { .feed { left: 12px; } }

/* ── Tablero ── */
.tab-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tab-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.alertas-box { max-height: 390px; overflow-y: auto; }
.alerta svg { flex: none; margin-top: 1px; }
.alerta.alto svg { color: var(--bad); }
.alerta.medio svg { color: var(--warn); }
.flota-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.bus-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; font-family: var(--font-title); font-weight: 700; font-size: 12.5px; border: 1px solid var(--line); background: var(--surface-2); }
.bus-chip svg { width: 15px; height: 15px; }
.bus-chip.en_ruta { background: var(--warn-bg); color: var(--warn); border-color: #f5dd9c; }
.bus-chip.disponible { background: var(--ok-bg); color: var(--ok); border-color: #bfe8d6; }
.bus-chip.aseo { background: var(--pastel-1); color: var(--blue-700); border-color: var(--pastel-2); }
.bus-chip.taller { background: var(--bad-bg); color: var(--bad); border-color: #f6c7c9; }
.barra.mini { height: 4px; margin-top: 5px; }
.hbars { display: grid; gap: 10px; }
.hb { display: grid; grid-template-columns: 90px 1fr 92px; gap: 10px; align-items: center; font-size: 13px; }
.hb-bar { height: 12px; background: var(--surface-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.hb-bar i { display: block; height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; }
.hb-v { text-align: right; font-weight: 600; }
.hb-s { grid-column: 2 / 4; margin-top: -8px; }
.medios { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.medios span { display: grid; }
.medios small { font-size: 11px; color: var(--muted); }
.medios b { font-size: 14px; font-family: var(--font-title); }

/* ── Gráficos ── */
.chart-wrap { position: relative; }
.chart .grid-l { stroke: var(--line); stroke-width: 1; }
.chart .base-l { stroke: #C9CED8; stroke-width: 1; }
.chart .ax { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart .hit { cursor: default; }
.chart .hit.on { fill: rgba(0, 91, 255, .06); }
.tip { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 9px 12px; font-size: 12.5px; pointer-events: none; min-width: 170px; display: grid; gap: 3px; z-index: 5; }
.tip i, .leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tip div { display: flex; align-items: center; }
.tip .num { margin-left: auto; padding-left: 12px; font-weight: 600; }
.leyenda { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }

/* ── Mapa ── */
.mapa-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.mapa.grande { height: calc(100vh - 150px); min-height: 460px; }
.mapa.sm { height: 330px; }
.pin-bus { width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0, 70, 199, .45); display: grid; place-items: center; font-family: var(--font-title); font-weight: 700; font-size: 13px; }
.pin-bus.faena { background: #E0762B; box-shadow: 0 3px 10px rgba(224, 118, 43, .45); }
.pin-ofi { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); position: relative; }
.pin-ofi span { position: absolute; left: 16px; top: -5px; white-space: nowrap; font-family: var(--font-title); font-weight: 700; font-size: 12px; color: var(--ink); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; }
.pin-casa { width: 24px; height: 24px; border-radius: 50%; background: #E0762B; color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.3); }
.viaje { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; cursor: pointer; }
.viaje:hover { border-color: var(--pastel-4); background: var(--pastel-1); }
.viaje.faena { border-left: 4px solid #E0762B; }

/* ── Programación ── */
.mini-in { min-height: 34px !important; padding: 5px 8px !important; font-size: 13px; width: auto; max-width: 210px; }
.val-row td { background: var(--surface-2); }
.val-row .alerta { margin: 3px 0; }

/* ── Faenas ── */
.faena-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.faena-card { cursor: pointer; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.faena-card:hover { border-color: var(--pastel-4); box-shadow: var(--shadow-lg); }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-kpis div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: grid; }
.mini-kpis small { font-size: 11px; color: var(--muted); }
.mini-kpis b { font-family: var(--font-title); font-size: 17px; }

/* ── Flota ── */
.flota-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.bus-num { width: 42px; height: 42px; border-radius: 12px; background: var(--ink); color: #fff; font-family: var(--font-title); font-weight: 700; font-size: 17px; display: grid; place-items: center; }
.docs { display: flex; gap: 5px; flex-wrap: wrap; }
.doc { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: var(--ok-bg); color: var(--ok); }
.doc.warn { background: var(--warn-bg); color: var(--warn); }
.doc.bad { background: var(--bad-bg); color: var(--bad); }

/* ═════════════ Celular: embarque, conductor, mantención ═════════════ */
.mov-sal { width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.mov-sal .orden { width: auto; min-width: 52px; padding: 0 6px; font-size: 15px; }
.contador { display: flex; align-items: baseline; gap: 8px; }
.contador b { font-size: 40px; font-family: var(--font-title); line-height: 1; color: var(--blue); }
.pend { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pend:last-child { border-bottom: 0; }
.pend.hecho { opacity: .7; }
.pend .btn.sm { padding: 5px 9px; }
.chk-big { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; font-weight: 500; cursor: pointer; }
.chk-big input { width: 22px; height: 22px; accent-color: var(--blue); }
.gps-box { text-align: center; display: grid; gap: 2px; padding: 6px 0; }
.gps-vel { font-size: 54px; font-weight: 700; line-height: 1; font-family: var(--font-title); }
.rep-top img { height: 18px; }
.rep-body h2 { font-size: 17px; }

.escaner { position: fixed; inset: 0; background: #0B0D12; z-index: 3000; display: flex; flex-direction: column; color: #fff; }
.esc-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-family: var(--font-title); font-size: 16px; }
.esc-top .icon-btn { color: #fff; }
.esc-video { position: relative; flex: 1; overflow: hidden; display: grid; place-items: center; }
.esc-video video { width: 100%; height: 100%; object-fit: cover; }
.esc-marco { position: absolute; width: min(66vw, 300px); aspect-ratio: 1; border-radius: 22px; box-shadow: 0 0 0 100vmax rgba(11, 13, 18, .45); border: 3px solid rgba(255, 255, 255, .9); }
.esc-res { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; padding: 24px; animation: fade .12s; }
.esc-res.ok { background: rgba(14, 159, 110, .94); }
.esc-res.ya { background: rgba(194, 120, 3, .94); }
.esc-res.mal { background: rgba(217, 56, 62, .95); }
.esc-res b { font-family: var(--font-title); font-size: 34px; }
.esc-res span { font-size: 18px; }
.esc-ic svg { width: 64px; height: 64px; stroke-width: 2.4; }
.esc-sin { padding: 30px; text-align: center; color: #cfd5df; display: grid; justify-items: center; gap: 10px; }
.esc-sin svg { width: 48px; height: 48px; }
.esc-pie { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 10px; background: #13161d; }
.esc-pie input { background: #1f232c; border-color: #2c313c; color: #fff; }
.esc-cont { font-size: 12px; color: #9aa3b2; min-height: 16px; }

/* ── Responsive ── */
@media (max-width: 1280px) {
  .venta-grid { grid-template-columns: minmax(0, 1fr); }
  .carro-col { position: static; }
  .pasajeros { max-height: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .tab-grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 980px) {
  .venta-grid, .tab-grid, .tab-grid3, .mapa-grid, .enc-grid { grid-template-columns: 1fr; }
  .mapa.grande { height: 60vh; }
  .caja-estado { margin-left: 0; }
}
@media (max-width: 640px) {
  .seat { width: 38px; height: 36px; font-size: 12.5px; }
  .seat.salon_cama { width: 44px; height: 40px; }
  .bgap { height: 36px; }
  .medios { grid-template-columns: 1fr 1fr; }
  .timeline { grid-template-columns: 1fr 1fr; }
  .faena-grid, .flota-grid { grid-template-columns: 1fr; }
}

.rep-body { grid-template-columns: minmax(0, 1fr); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }
.salidas-col .salida-it { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: 'h d' 'h r'; row-gap: 6px; }
.salidas-col .salida-it .hrs { grid-area: h; }
.salidas-col .salida-it .det { grid-area: d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.salidas-col .salida-it .det div { overflow: hidden; text-overflow: ellipsis; }
.salidas-col .salida-it .der { grid-area: r; display: flex; gap: 8px; align-items: center; justify-content: space-between; }

label.f input, label.f select { min-width: 0; }
.buscador .chip-f, #pF .chip-f { text-transform: capitalize; }
.tab-grid.igual { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* ── Compras, estanque y clientes ── */
tr.anulada td { opacity: .5; text-decoration: line-through; }
.click-kpi { cursor: pointer; }
.click-kpi:hover { border-color: var(--pastel-4); }
.pax.conocido { border-color: var(--pastel-3); background: var(--pastel-1); }
.estanque-box { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center; }
.tanque { height: 200px; border: 3px solid var(--ink-2); border-radius: 18px 18px 14px 14px; position: relative; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.tanque .nivel { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #3D84FF, var(--blue)); transition: height .4s; }
.tanque .nivel.bajo { background: linear-gradient(180deg, #F08B8F, var(--bad)); }
.tanque span { position: relative; font-family: var(--font-title); font-weight: 700; font-size: 22px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.val-g { font-family: var(--font-title); font-size: 30px; font-weight: 700; }
@media (max-width: 640px) { .estanque-box { grid-template-columns: 1fr; } .tanque { height: 140px; } }

input:not([type]), input[type=email], input[type=time], input[type=month] { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; min-height: 42px; }
input:not([type]):focus, input[type=email]:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 91, 255, .14); }
input:disabled { background: var(--surface-2); color: var(--muted); }
.esc-pie input { background: #1f232c; border-color: #2c313c; color: #fff; }

.kpi .val { font-size: clamp(20px, 1.75vw, 27px); overflow-wrap: anywhere; }
a.btn { text-decoration: none; }
td.nw, .nw { white-space: nowrap; }

/* ── Programación: horario base, problemas, reemplazos ── */
.dias { display: inline-flex; gap: 3px; }
.dias i { font-style: normal; width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--surface-2); color: #B5BAC4; border: 1px solid var(--line); }
.dias i.on { background: var(--pastel-2); color: var(--blue-700); border-color: var(--pastel-3); }
.dias-sel { display: flex; gap: 6px; flex-wrap: wrap; }
.dias-sel label { cursor: pointer; }
.dias-sel input { position: absolute; opacity: 0; pointer-events: none; }
.dias-sel span { display: inline-block; padding: 7px 12px; border-radius: 9px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: 13px; text-transform: capitalize; }
.dias-sel input:checked + span { border-color: var(--blue); background: var(--pastel-1); color: var(--blue-700); }
.opciones { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.opc { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 11px; padding: 9px 11px; cursor: pointer; background: #fff; }
.opc input { margin-top: 3px; accent-color: var(--blue); }
.opc.on { border-color: var(--blue); background: var(--pastel-1); }
.opc.no { opacity: .62; cursor: not-allowed; background: var(--surface-2); }
.warn-t { color: var(--warn); }
.badge.rojo { background: var(--bad); }
.problema { border-left: 4px solid var(--bad); }
.problema-top { border: 1px solid #f6c7c9; background: var(--bad-bg); }
.problema-top svg.i { color: var(--bad); }
.parada select, .parada input { min-height: 38px; }
details.card summary { cursor: pointer; font-weight: 600; }
.kpi .val { font-size: clamp(18px, 1.5vw, 27px); }
