/* Logística Añelo · tema oscuro */
:root {
  color-scheme: dark;
  --fondo: #0E131A;
  --superficie: #161D27;
  --superficie-2: #1D2633;
  --superficie-3: #243042;
  --borde: #273243;
  --borde-2: #364356;
  --tinta: #E8ECF2;
  --tinta-2: #C5CDD8;
  --tinta-3: #94A1B2;
  --barra: #0A0E14;
  --acento: #F97316;
  --acento-txt: #FB923C;
  --acento-btn: #C2410C;
  --acento-btn-hover: #EA580C;
  --acento-fondo: rgba(249, 115, 22, .10);
  --ok: #4ADE80;
  --ok-fondo: rgba(74, 222, 128, .10);
  --ok-borde: rgba(74, 222, 128, .45);
  --warn: #FBBF24;
  --warn-fondo: rgba(251, 191, 36, .10);
  --warn-borde: rgba(251, 191, 36, .45);
  --error: #F87171;
  --error-fondo: rgba(248, 113, 113, .12);
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--fondo); color: var(--tinta); font-size: 14px; line-height: 1.35;
}
a { color: var(--acento-txt); }
a:hover { color: #FDBA74; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid #60A5FA; outline-offset: 2px; }
.mono { font-family: var(--mono); }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--borde-2); border-radius: 6px; border: 2px solid var(--superficie); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- encabezado ---------- */
.top { background: var(--barra); color: var(--tinta); border-bottom: 1px solid var(--borde); }
.top .in { max-width: 1600px; margin: 0 auto; padding: 8px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.top .marca { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.top .marca-txt { display: flex; flex-direction: column; line-height: 1.15; }
.logo-mini { height: 34px; width: auto; display: block; }
.logo-login { width: 150px; height: auto; display: block; margin: 0 auto 4px; }
.top .marca small { font-size: 10px; color: var(--acento-txt); letter-spacing: .08em; font-weight: 700; }
.top .marca h1 { margin: 0; font-size: 18px; font-weight: 600; }
.top nav { display: flex; flex-wrap: wrap; gap: 2px; }
.top nav a { height: 36px; padding: 0 12px; border-radius: 8px; display: flex; align-items: center; text-decoration: none; color: var(--tinta-3); font-weight: 600; font-size: 13px; }
.top nav a:hover { background: var(--superficie-2); color: var(--tinta); }
.top nav a.activo { background: var(--superficie-3); color: var(--tinta); box-shadow: inset 0 -2px 0 var(--acento); }
.top .usuario { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tinta-3); }
.top .usuario button { background: transparent; border: 1px solid var(--borde-2); color: var(--tinta-2); border-radius: 8px; height: 32px; padding: 0 10px; font-size: 12px; }
.top .usuario button:hover { background: var(--superficie-2); }
.demo-banda { background: var(--warn-fondo); color: var(--warn); text-align: center; font-size: 12px; padding: 4px; font-weight: 600; border-bottom: 1px solid var(--borde); }

main.pag { max-width: 1600px; margin: 0 auto; padding: 16px 20px 32px; display: flex; flex-direction: column; gap: 14px; }
h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .01em; }
.etq { font-size: 11px; font-weight: 700; color: var(--tinta-3); letter-spacing: .06em; text-transform: uppercase; }
.suave { color: var(--tinta-3); font-size: 12px; }

/* ---------- botones ---------- */
.btn { height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--borde-2); background: var(--superficie-2); color: var(--tinta); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: var(--superficie-3); }
.btn.prim { background: var(--acento-btn); border-color: var(--acento-btn); color: #fff; }
.btn.prim:hover { background: var(--acento-btn-hover); border-color: var(--acento-btn-hover); }
.btn.prim:disabled { background: var(--superficie-2); border-color: var(--borde); color: var(--tinta-3); }
.btn.icono { width: 30px; padding: 0; }
.btn.chico { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.peligro { color: var(--error); }
.btn.fantasma { background: transparent; }

/* ---------- tarjetas ---------- */
.card { background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; }
.card .cab { padding: 10px 14px; border-bottom: 1px solid var(--borde); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card .cuerpo, .card.cuerpo { padding: 12px 14px; }
.vacio { padding: 18px 14px; color: var(--tinta-3); font-size: 13px; text-align: center; }
.alerta { display: flex; align-items: center; gap: 10px; background: var(--warn-fondo); border: 1px solid var(--warn-borde); border-radius: 10px; padding: 9px 12px; color: var(--warn); font-weight: 600; font-size: 13px; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--borde); background: var(--superficie); color: var(--tinta-2); font-weight: 700; font-size: 12px; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 8px; }
.chip:hover { border-color: var(--borde-2); background: var(--superficie-2); }
.chip.on { background: var(--acento-fondo); border-color: var(--acento); color: var(--tinta); }
.chip .n { font-size: 11px; font-weight: 600; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 10px; background: var(--superficie-3); color: var(--tinta-2); }
.chip.on .n { background: var(--acento-btn); color: #fff; }
.chip.apagado { color: var(--tinta-3); font-weight: 600; }

.estado { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.e-A_CARGAR { background: rgba(148, 161, 178, .16); color: #CBD5E1; }
.e-CARGANDO { background: rgba(251, 191, 36, .15); color: #FCD34D; }
.e-P_LOCACION { background: rgba(96, 165, 250, .16); color: #93C5FD; }
.e-LOCACION { background: rgba(167, 139, 250, .17); color: #C4B5FD; }
.e-FINALIZADO { background: rgba(74, 222, 128, .14); color: #86EFAC; }
.e-CANCELADO { background: rgba(248, 113, 113, .15); color: #FCA5A5; }
.n-vencido { background: rgba(248, 113, 113, .15); color: #FCA5A5; }
.n-por_vencer { background: rgba(251, 191, 36, .15); color: #FCD34D; }
.n-ok { background: rgba(74, 222, 128, .14); color: #86EFAC; }

.aviso { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; }
.aviso::before { content: ""; width: 6px; height: 6px; border-radius: 3px; background: currentColor; flex: none; }
.aviso.ok { color: var(--ok); }
.aviso.warn { color: var(--warn); }
.aviso.error { color: var(--error); }

/* ---------- formularios ---------- */
label.campo, div.campo { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; color: var(--tinta-3); letter-spacing: .04em; text-transform: uppercase; }
.campo input, .campo select, .campo textarea, input.txt, select.txt {
  height: 38px; border: 1px solid var(--borde-2); border-radius: 8px; padding: 0 10px; font-size: 14px; background: var(--superficie-2); color: var(--tinta); font-weight: 400; letter-spacing: 0; text-transform: none;
}
.campo input:focus, .campo select:focus, input.txt:focus, select.txt:focus { border-color: var(--acento); outline: none; box-shadow: 0 0 0 3px rgba(249, 115, 22, .2); }
.campo textarea { height: 70px; padding: 8px 10px; resize: vertical; }
input::placeholder { color: #6B7787; }
.fila-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
input[type="checkbox"] { accent-color: var(--acento); width: 16px; height: 16px; }

/* ---------- tablas ---------- */
.tabla-wrap { overflow: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11px; color: var(--tinta-3); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 8px 10px; white-space: nowrap; border-bottom: 1px solid var(--borde); position: sticky; top: 0; background: var(--superficie); z-index: 1; }
table.t td { padding: 6px 10px; border-top: 1px solid var(--borde); vertical-align: middle; }
table.t tbody tr:first-child td { border-top: 0; }
table.t tbody tr:hover td { background: rgba(255, 255, 255, .02); }
table.t input.txt, table.t select.txt { height: 32px; font-size: 13px; }
td.guardando { background: var(--warn-fondo) !important; }

/* ---------- toast y modal ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--superficie-3); color: var(--tinta); border: 1px solid var(--borde-2); padding: 11px 18px; border-radius: 10px; font-weight: 600; z-index: 50; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
#toast.error { background: #3B1418; border-color: rgba(248, 113, 113, .5); color: #FECACA; }
dialog.modal { border: 1px solid var(--borde-2); border-radius: 14px; padding: 0; width: min(560px, calc(100% - 24px)); background: var(--superficie); color: var(--tinta); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
dialog.modal::backdrop { background: rgba(3, 6, 10, .65); }
dialog.modal .cab { padding: 12px 16px; border-bottom: 1px solid var(--borde); display: flex; justify-content: space-between; align-items: center; }
dialog.modal .cuerpo { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
dialog.modal .pie { padding: 10px 16px 14px; display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.x { width: 40px; height: 40px; border: 0; background: none; font-size: 22px; color: var(--tinta-3); border-radius: 8px; }

/* ---------- estructura común: panel lateral + contenido ---------- */
.top .in { max-width: none; }
.vista { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: calc(100vh - 53px); }
.panel { background: #0B1017; border-right: 1px solid var(--borde); padding: 14px 12px; display: flex; flex-direction: column; gap: 14px; min-height: 0; overflow-y: auto; }
.panel-tit { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; min-height: 30px; }
.panel-sec { display: flex; flex-direction: column; gap: 6px; }
.panel-sec > .etq { padding: 0 4px; }
.panel-nota { font-size: 12px; color: var(--tinta-3); line-height: 1.45; padding: 0 4px; margin: 0; }
.panel-pie { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.etq-acento { color: var(--acento-txt); }
.contenido { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; }
.cont-cab { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cont-cab h2 { font-size: 16px; }
.cont-cab .esp, .grilla-cab .esp { flex: 1; }
.tabla-card { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.tabla-card .tabla-wrap { flex: 1; min-height: 0; }

/* opciones del panel (filtros como lista) */
.opcion { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--tinta-2); font-weight: 600; font-size: 13px; text-align: left; }
.opcion:hover { background: var(--superficie-2); }
.opcion.on { background: var(--acento-fondo); border-color: var(--acento); color: var(--tinta); }
.opcion .n { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--tinta-3); }
.opcion.on .n { color: var(--acento-txt); }
.opcion .pto { width: 8px; height: 8px; border-radius: 4px; flex: none; }

/* KPIs */
.kpis { display: flex; flex-direction: column; gap: 8px; }
.kpis > .etq { padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.kpi { background: var(--superficie); border: 1px solid var(--borde); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; text-align: left; color: var(--tinta); }
button.kpi:hover { border-color: var(--borde-2); }
button.kpi.on { border-color: var(--acento); background: var(--acento-fondo); }
.kpi b { font-family: var(--mono); font-size: 22px; font-weight: 600; line-height: 1.1; }
.kpi span { font-size: 11.5px; color: var(--tinta-3); font-weight: 600; }

/* segmentado */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; background: var(--superficie-2); border: 1px solid var(--borde-2); border-radius: 9px; padding: 3px; }
.seg button { height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--tinta-3); font-weight: 700; font-size: 12px; padding: 0 6px; white-space: nowrap; }
.seg button.on { background: var(--superficie-3); color: var(--tinta); box-shadow: inset 0 -2px 0 var(--acento); }

/* ---------- asignar ---------- */
.vista-asignar { grid-template-columns: 210px minmax(0, 1fr) 300px; }
.lista-clientes { display: flex; flex-direction: column; gap: 3px; }
.cli { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--tinta); font-weight: 700; font-size: 13px; text-align: left; flex: none; }
.cli:hover { background: var(--superficie-2); }
.cli.on { background: var(--acento-fondo); border-color: var(--acento); }
.cli.apagado { color: var(--tinta-3); font-weight: 600; }
.cli-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cli-hab { font-size: 11px; font-weight: 600; color: var(--tinta-3); flex: none; }
.cli-n { font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--acento-btn); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.panel-clientes .kpis { margin-top: auto; border-top: 1px solid var(--borde); padding-top: 12px; flex: none; }
@media (min-width: 1000px) {
  .panel-clientes { overflow: hidden; }
  .panel-clientes .lista-clientes { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}

.centro { padding: 10px 14px; display: grid; grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "armar" "datos" "grilla"; min-width: 0; min-height: 0; }
.armar { grid-area: armar; background: var(--superficie); border: 1px solid var(--acento); border-bottom: 0; border-radius: 12px 12px 0 0; padding: 10px 14px 8px; display: flex; flex-direction: column; gap: 6px; }
.armar-cab { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.armar-cab .suave { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.armar-cab .falta { flex: none; font-size: 12px; color: var(--tinta-3); white-space: nowrap; }
.armar-cab .falta.listo { color: var(--ok); font-weight: 600; }
.frase { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.frase-par { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.frase-txt { font-size: 15px; color: var(--tinta-2); white-space: nowrap; }
.slot { position: relative; height: 40px; max-width: 250px; padding: 0 12px; border-radius: 10px; border: 1px dashed var(--borde-2); background: var(--superficie-2); color: var(--tinta-3); display: inline-flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 0; min-width: 0; text-align: left; }
.slot:hover { border-color: var(--acento); }
.slot-et { font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tinta-3); }
.slot-val { font-size: 13.5px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot.mono .slot-val { font-family: var(--mono); font-weight: 600; }
.slot.lleno { border: 1px solid var(--ok-borde); background: var(--ok-fondo); color: var(--tinta); }
.slot.activo { border: 2px solid var(--acento); background: var(--acento-fondo); box-shadow: 0 0 0 3px rgba(249, 115, 22, .15); }
.slot.activo .slot-et { color: var(--acento-txt); }
.slot-auto { position: absolute; top: -7px; right: -6px; width: 18px; height: 18px; border-radius: 9px; background: var(--acento-btn); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; }

.datos-orden { grid-area: datos; background: var(--superficie); border: 1px solid var(--acento); border-top: 1px solid var(--borde); border-radius: 0 0 12px 12px; padding: 8px 14px 10px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.do-fila { display: flex; gap: 10px; align-items: flex-end; }
.do-resumen { display: none; align-items: center; gap: 10px; min-height: 34px; }
.do-res-txt { flex: 1; min-width: 0; font-size: 13px; color: var(--tinta-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.do-resumen .btn.prim { height: 34px; padding: 0 20px; }
@media (min-width: 1000px) {
  .datos-orden.plegado .do-fila { display: none; }
  .datos-orden.plegado .do-resumen { display: flex; }
}
@media (max-width: 999px) {
  #do-plegar { display: none; }
  .grilla-cab { flex-wrap: wrap !important; }
  .grilla-cab h2 { white-space: nowrap; }
  .g-sub { white-space: normal; flex-basis: 100%; order: 3; }
  .grilla-cab .buscar { flex: 1 1 100% !important; order: 2; }
  .armar-cab { flex-wrap: wrap; }
  .armar-cab .falta { white-space: normal; font-size: 11px; }
}
.grilla-cab { flex-wrap: nowrap !important; }
.g-sub { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grilla-cab .buscar { flex: none; }
.do-fila .campo { font-size: 10px; gap: 2px; }
.do-fila .campo input, .do-fila .campo select { height: 32px; font-size: 13px; width: 100%; }
.do-cli { flex: 1.3; min-width: 0; }
.do-sub { flex: 1.3; min-width: 0; }
.do-pres { flex: 0 0 150px; }
.do-tn { flex: 0 0 90px; }
.do-fecha { flex: 0 0 140px; }
.do-hora { flex: 0 0 92px; }
.do-op { flex: 0 1 170px; min-width: 120px; }
.do-op select { height: 34px; width: 100%; border: 1px solid var(--borde-2); border-radius: 8px; background: var(--superficie-2); color: var(--tinta); padding: 0 8px; font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.do-obs { flex: 1; min-width: 0; }
.do-armar { display: flex; align-items: center; gap: 10px; flex: none; }
.do-armar .btn { height: 34px; padding: 0 20px; font-size: 14px; }
.op-auto { height: 34px; display: flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--tinta); text-transform: none; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-auto.vacio-op { color: var(--tinta-3); font-weight: 400; font-size: 12px; }
.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--superficie-2); border: 1px solid var(--borde-2); border-radius: 8px; padding: 3px; }
.toggle button { height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--tinta-3); font-weight: 700; font-size: 12px; text-transform: none; letter-spacing: 0; }
.toggle button.on { background: var(--acento-btn); color: #fff; }

.grilla-box { grid-area: grilla; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.grilla-cab { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grilla-cab h2 { font-size: 15px; }
.grilla-cab .buscar { height: 32px; width: 280px; font-size: 13px; }
.grilla { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); grid-auto-rows: 36px; gap: 5px; align-content: start; padding: 2px; }
.grilla[data-tipo="tractor"], .grilla[data-tipo="acoplado"] { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grilla[data-tipo="destino"] { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grilla[data-tipo="producto"] { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (min-width: 1500px) {
  .grilla { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
  .grilla[data-tipo="tractor"], .grilla[data-tipo="acoplado"] { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
.grilla .vacio { grid-column: 1 / -1; }
.tile { text-align: left; border-radius: 8px; border: 1px solid var(--borde); background: var(--superficie); color: var(--tinta); padding: 0 9px; display: flex; flex-direction: row; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.tile:hover { border-color: var(--acento); background: var(--acento-fondo); }
.tile.hab { border: 1px dashed var(--acento); background: rgba(249, 115, 22, .06); }
.tile.elegido { border: 2px solid var(--acento); background: var(--acento-fondo); padding: 0 9px; }
.tile.apagado { opacity: .62; }
.tile-nom { flex: 0 1 auto; min-width: 0; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tile-nom.mono { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.tile-sub { flex: 0 1000 auto; min-width: 12px; margin-left: auto; font-size: 11px; color: var(--tinta-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.hab .tile-sub { color: var(--acento-txt); font-weight: 700; }
.tile-aviso { width: 7px; height: 7px; border-radius: 4px; background: var(--warn); flex: none; }
.grilla-pie { font-size: 11px; color: var(--tinta-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.panel-curso { border-right: 0; border-left: 1px solid var(--borde); }
.panel-tit .links { display: flex; gap: 10px; font-size: 12px; }
.lista-curso { display: flex; flex-direction: column; gap: 8px; }
.curso { background: var(--superficie); border: 1px solid var(--borde); border-left: 3px solid var(--borde); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.curso-1 { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12.5px; }
.curso-1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.curso-2 { font-size: 11px; color: var(--tinta-3); }
.curso-3 { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--tinta-2); min-height: 24px; }
.curso-3 .btn { height: 24px; padding: 0 8px; font-size: 11px; }

/* En la compu, las pantallas con panel entran sin scroll de página */
@media (min-width: 1000px) and (min-height: 480px) {
  body.app-full { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
  body.app-full .vista { flex: 1; min-height: 0; }
  body.app-full .contenido { overflow: hidden; }
}
@media (min-width: 1000px) and (max-width: 1350px) {
  .vista.vista-asignar { grid-template-columns: 165px minmax(0, 1fr) 225px; }
  .vista { grid-template-columns: 210px minmax(0, 1fr); }
  .frase-txt { font-size: 15px; }
  .slot { padding: 0 10px; max-width: 200px; }
  .do-fila { gap: 8px; }
  .do-pres { flex-basis: 128px; }
  .do-tn { flex-basis: 76px; }
  .do-fecha { flex-basis: 132px; }
  .do-hora { flex-basis: 92px; }
  .do-op { flex-basis: 130px; min-width: 100px; }
  .do-obs { min-width: 80px; }
  .do-armar .btn { padding: 0 16px; }
  .armar-cab .suave { display: none; }
  .armar-cab .falta { margin-left: auto; }
  .grilla-cab .buscar { width: 190px; }
  .panel-curso .panel-tit h2 { font-size: 13px; }
  .panel-tit .links { gap: 8px; font-size: 11px; white-space: nowrap; }
  .grilla { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
  .panel-clientes .kpi-grid { grid-template-columns: 1fr; }
  .panel-clientes .kpi { flex-direction: row; align-items: baseline; gap: 8px; padding: 6px 10px; }
  .panel-clientes .kpi b { font-size: 16px; }
}
@media (min-width: 1000px) and (max-height: 800px) {
  .armar { padding: 10px 14px 8px; gap: 8px; }
  .slot { height: 42px; }
  .datos-orden { padding: 8px 14px 10px; gap: 6px; margin-bottom: 10px; }
  .centro { padding: 10px 14px; }
  .kpi b { font-size: 18px; }
  .cli { height: 32px; }
}
@media (min-width: 1000px) and (max-height: 700px) {
  .top .in { padding-top: 4px; padding-bottom: 4px; }
  .top .marca h1 { font-size: 16px; }
  .top nav a { height: 32px; }
  .logo-mini { height: 26px; }
  .armar-cab .suave { display: none; }
  .armar-cab .falta { margin-left: auto; }
  .frase-txt { font-size: 14px; }
  .slot { height: 38px; }
  .slot-val { font-size: 13.5px; }
  .do-fila .campo { font-size: 10px; gap: 2px; }
  .do-fila .campo input, .do-fila .campo select, .do-op select { height: 30px; }
  .op-auto { height: 30px; }
  .toggle button { height: 22px; }
  .do-armar .btn { height: 34px; }
  .grilla { grid-auto-rows: 32px; gap: 4px; }
  .grilla-cab .buscar { height: 30px; }
  .grilla-box { gap: 6px; }
  .kpi-grid, .panel-clientes .kpi-grid { grid-template-columns: 1fr 1fr; gap: 4px; }
  .kpi, .panel-clientes .kpi { flex-direction: row; align-items: baseline; gap: 6px; padding: 4px 8px; min-width: 0; }
  .kpi b { font-size: 15px; }
  .kpi span { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .panel { padding: 10px; gap: 10px; }
  .cli { height: 30px; font-size: 12.5px; }
}

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr); }
.login-marca { position: relative; overflow: hidden; background: #0B1017; border-right: 1px solid var(--borde); padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.login-marca::before { content: ""; position: absolute; inset: 0; background: radial-gradient(900px 500px at 0% 0%, rgba(249, 115, 22, .12), transparent 60%), radial-gradient(700px 500px at 100% 100%, rgba(28, 178, 232, .08), transparent 60%); pointer-events: none; }
.login-marca > * { position: relative; }
.login-marca .logo-login { width: 130px; margin: 0; }
.login-marca h1 { margin: 0; font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -.01em; }
.login-marca h1 span { color: var(--acento-txt); }
.login-marca p { margin: 10px 0 0; font-size: 16px; color: var(--tinta-2); max-width: 480px; line-height: 1.5; }
.demo-frase { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; color: var(--tinta-2); max-width: 560px; }
.demo-frase .slot { height: 40px; pointer-events: none; }
.demo-frase .slot-val { font-size: 13.5px; color: var(--tinta); }
.login-pie { font-size: 12px; color: var(--tinta-3); }
.login-lado { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.login { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.login h2 { font-size: 24px; font-weight: 700; }
.login .campo input { height: 46px; font-size: 16px; }
.login-movil { display: none; text-align: center; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--superficie-2); border: 1px solid var(--borde-2); border-radius: 10px; padding: 4px; }
.tabs button { height: 40px; border: 0; border-radius: 8px; background: transparent; font-weight: 700; color: var(--tinta-3); }
.tabs button.on { background: var(--superficie-3); color: var(--tinta); box-shadow: inset 0 -2px 0 var(--acento); }
@media (max-width: 899px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-marca { display: none; }
  .login-movil { display: block; }
  .login-movil .logo-login { width: 120px; margin: 0 auto 6px; }
  .login-lado { min-height: 100vh; background: radial-gradient(900px 500px at 50% -10%, #1B2638 0%, var(--fondo) 60%); padding-top: max(32px, env(safe-area-inset-top)); }
}

/* ---------- chofer ---------- */
.chofer { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.chofer header { background: var(--barra); border-bottom: 1px solid var(--borde); padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 5; }
.chofer header small { color: var(--acento-txt); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; }
.chofer header h1 { margin: 0; font-size: 19px; }
.chofer main { flex: 1; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.viaje-ch { background: var(--superficie); border: 1px solid var(--acento); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.viaje-ch .frase { gap: 6px; }
.viaje-ch .frase-txt { font-size: 15px; }
.viaje-ch .slot { height: 44px; pointer-events: none; }
.viaje-ch .slot.lleno { max-width: 100%; }
.viaje-ch .slot-val { color: var(--tinta); }
.viaje-ch .slot.activo { grid-column: 1 / -1; max-width: 100%; }
.dato { display: flex; flex-direction: column; gap: 2px; }
.dato span:first-child { font-size: 11px; color: var(--tinta-3); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.dato span:last-child { font-size: 15px; font-weight: 600; }
.pasos { display: flex; flex-direction: column; }
.paso { display: flex; align-items: center; gap: 12px; min-height: 42px; position: relative; }
.paso:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: 32px; bottom: -10px; width: 2px; background: var(--borde-2); }
.paso.hecho:not(:last-child)::after { background: #16A34A; }
.paso .bola { width: 26px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; border: 2px solid var(--borde-2); color: var(--tinta-3); background: var(--superficie); flex: none; position: relative; z-index: 1; }
.paso.hecho .bola { background: #16A34A; border-color: #16A34A; color: #fff; }
.paso.actual .bola { border-color: var(--acento); color: var(--acento-txt); }
.paso .p-txt { flex: 1; color: var(--tinta-2); }
.paso.hecho .p-txt { color: var(--tinta); }
.paso.actual .p-txt { font-weight: 700; color: var(--tinta); }
.paso .hora { font-family: var(--mono); font-size: 13px; color: var(--tinta-3); }
.btn-grande { height: 64px; border-radius: 14px; border: 0; background: var(--acento-btn); color: #fff; font-size: 19px; font-weight: 700; width: 100%; }
.btn-grande:active { background: var(--acento-btn-hover); }
.btn-grande:disabled { opacity: .6; }

/* formulario en dos columnas (modal de la orden) */
.campos-viaje { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.campos-viaje .c-full { grid-column: 1 / -1; }
.campos-viaje input, .campos-viaje select { height: 36px; font-size: 13px; }

/* ---------- celular ---------- */
@media (max-width: 999px) {
  /* encabezado compacto: menú en una fila deslizable */
  .top .in { padding: 8px 12px; gap: 6px 10px; padding-top: max(8px, env(safe-area-inset-top)); }
  .top .marca { margin-right: 0; flex: 1; min-width: 0; }
  .top .marca h1 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .logo-mini { height: 28px; }
  .top .usuario > span { display: none; }
  .top nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin: 0 -4px; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { flex: none; height: 34px; }
  main.pag { padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); gap: 12px; }

  /* panel arriba, contenido abajo */
  .vista, .vista-asignar { display: flex; flex-direction: column; min-height: 0; }
  .panel { border-right: 0; border-bottom: 1px solid var(--borde); padding: 10px 12px; gap: 10px; overflow: visible; }
  .panel-pie { margin-top: 0; }
  .contenido { padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi { padding: 6px 8px; }
  .kpi b { font-size: 18px; }
  .kpi span { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .panel .opciones-fila { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .panel .opciones-fila .opcion { width: auto; flex: none; border-color: var(--borde); }
  .panel .opciones-fila::-webkit-scrollbar { display: none; }
  .panel-nota { display: none; }
  .cont-cab input.txt { width: 100% !important; height: 42px; font-size: 16px; }
  .cont-cab .suave { display: none; }

  /* asignar */
  .panel-clientes .panel-tit { display: none; }
  .lista-clientes { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 6px; padding-bottom: 2px; }
  .lista-clientes::-webkit-scrollbar { display: none; }
  .cli { border: 1px solid var(--borde); background: var(--superficie); height: 36px; }
  .cli-hab { display: none; }
  .panel-clientes .kpis { margin-top: 0; border-top: 0; padding-top: 0; }
  .panel-clientes .kpis > .etq { display: none; }
  .centro { display: flex; flex-direction: column; padding: 0 12px 12px; gap: 12px; }
  .armar { position: sticky; top: 0; z-index: 4; border-radius: 0 0 14px 14px; border: 1px solid var(--acento); border-top: 0; margin: 0 -12px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
  .armar-cab .suave { display: none; }
  .frase { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .frase-par { display: contents; }
  .frase-txt { display: none; }
  .slot { height: 42px; max-width: none; width: 100%; padding: 0 9px; grid-column: span 2; }
  .frase-par:nth-child(4) .slot, .frase-par:nth-child(5) .slot { grid-column: span 3; }
  .slot-val { font-size: 13px; }
  .grilla-box { order: 1; scroll-margin-top: 150px; }
  .grilla-cab .buscar { width: 100%; height: 42px; font-size: 16px; }
  .grilla, .grilla[data-tipo] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(46px, auto); overflow: visible; }
  .grilla[data-tipo="producto"], .grilla[data-tipo="destino"] { grid-template-columns: 1fr; }
  .tile { padding: 6px 10px; }
  .tile-nom:not(.mono) { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
  .grilla-pie { white-space: normal; }
  .datos-orden { order: 2; border-radius: 14px; border-top: 1px solid var(--acento); margin: 0; scroll-margin-top: 150px; }
  .do-fila { flex-wrap: wrap; }
  .do-cli, .do-sub, .do-obs { flex: 1 1 100%; }
  .do-pres { flex: 1 1 140px; }
  .do-tn { flex: 1 1 90px; }
  .do-fecha { flex: 1 1 140px; }
  .do-hora { flex: 1 1 90px; }
  .do-op { flex: 1 1 100%; }
  .do-fila .campo input, .do-fila .campo select, .do-op select { height: 42px; font-size: 16px; }
  .do-armar { flex: 1 1 100%; flex-direction: column; align-items: stretch; }
  .do-armar .falta { max-width: none; text-align: left; }
  .do-armar .btn { height: 50px; font-size: 16px; }
  .panel-curso { border-left: 0; border-top: 1px solid var(--borde); border-bottom: 0; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

  /* tablas como tarjetas (las etiquetas las pone comun.js) */
  table.t thead { display: none; }
  table.t, table.t tbody, table.t tr, table.t td { display: block; width: 100%; }
  table.t tr { border-top: 1px solid var(--borde); padding: 8px 12px; }
  table.t tbody tr:first-child { border-top: 0; }
  table.t td { border: 0 !important; padding: 3px 0; display: flex; align-items: center; gap: 10px; min-height: 26px; }
  table.t td[data-label]::before { content: attr(data-label); flex: 0 0 36%; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--tinta-3); }
  table.t td[data-label=""]::before { display: none; }
  table.t td > * { min-width: 0; }
  table.t input.txt, table.t select.txt { width: 100% !important; height: 38px; font-size: 16px; }
  .tabla-wrap { overflow: visible; }
  .campos-viaje input, .campos-viaje select { height: 42px; font-size: 16px; }
}

/* ---------- cartel de instalación ---------- */
.instalar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60; max-width: 460px; margin: 0 auto;
  background: var(--superficie-3); border: 1px solid var(--acento); border-radius: 14px; padding: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
  display: flex; flex-direction: column; gap: 10px; color: var(--tinta); }
.instalar .fila { display: flex; gap: 12px; align-items: center; }
.instalar img { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.instalar b { font-size: 15px; }
.instalar p { margin: 2px 0 0; font-size: 13px; color: var(--tinta-2); }
.instalar ol { margin: 0; padding-left: 20px; font-size: 14px; color: var(--tinta-2); display: flex; flex-direction: column; gap: 6px; }
.instalar ol svg { vertical-align: -3px; }
.instalar .acciones { display: flex; gap: 8px; justify-content: flex-end; }
.instalar .flecha-ios { text-align: center; font-size: 22px; color: var(--acento-txt); line-height: 1; margin-top: -4px; animation: rebote 1.2s infinite; }
@keyframes rebote { 50% { transform: translateY(5px); } }
@media (min-width: 1000px) { .instalar { left: auto; right: 20px; bottom: 20px; width: 380px; } }
