/* ===== CLIENTES_TABLAS_V2 (r124, dueño 10-oct-2026) — la pestaña Clientes como TABLAS DE VENTAS =====
   «ya no vamos a trabajar con tarjetas porque vamos a tener mayor control con esta tabla».
   Todo vive bajo .ct2 (la raíz que pinta /clientes_tablas_v2.js) y bajo body.clientes-tablas-view, que app.js solo pone
   con la pestaña Clientes abierta Y la bandera encendida. Sin esa clase este fichero no cambia nada de la app.
   Tamaños: la tabla se acomoda al ANCHO DE SU CAJA (container query), no al de la pantalla: en la PC ocupa todo el
   ancho; con una conversación abierta al lado, o en el celular (Z Fold cerrado ≈ 344-374 px, abierto ≈ 670-710 px),
   cada viaje pasa a ser un renglón apilado. */

/* La lista ocupa el ancho entero mientras no haya conversación abierta (mismo molde que la pestaña Precios). */
@media (min-width: 900px) {
  body.clientes-tablas-view:not(.ct-chat) #view-list { right: 0; width: auto; border-right: 0; }
  body.clientes-tablas-view:not(.ct-chat) #view-thread,
  body.clientes-tablas-view:not(.ct-chat) #view-table { display: none; }
}
@media (min-width: 760px) and (max-width: 899px) {
  body.clientes-tablas-view:not(.ct-chat) #view-list { right: 0; width: auto; border-right: 0; }
  body.clientes-tablas-view:not(.ct-chat) #view-thread,
  body.clientes-tablas-view:not(.ct-chat) #view-table { display: none; }
}
@media (min-width: 700px) and (max-width: 759px) {
  body.messenger-premium.clientes-tablas-view:not(.ct-chat) #view-list { right: 0; width: auto; border-right: 0; }
  body.messenger-premium.clientes-tablas-view:not(.ct-chat) #view-thread,
  body.messenger-premium.clientes-tablas-view:not(.ct-chat) #view-table { display: none; }
}
/* Ya no hay «Tarjetas | Tabla»: Clientes ES la tabla. */
body.clientes-tablas-view .salesview-seg { display: none; }

.ct2 {
  container-type: inline-size;
  container-name: ct2;
  --ct-bg: var(--bg, #f4f6f8);
  --ct-surface: var(--card, #fff);
  --ct-soft: #f4f7f9;
  --ct-line: var(--line, #e3e8ee);
  --ct-ink: var(--text, #1a1f26);
  --ct-muted: var(--mut, #57606a);
  --ct-faint: var(--mut2, #8b949e);
  --ct-accent: #137c68;
  --ct-accent-ink: #fff;
  --ct-yisus: var(--yisus, #059669);
  --ct-carlos: var(--carlos, #2563eb);
  --ct-select: #7c3aed;
  --ct-lejos-bg: #fde4e4; --ct-lejos-ink: #9b1c1c; --ct-lejos-bar: #d64545;
  --ct-medio-bg: #ffe9d2; --ct-medio-ink: #93470a; --ct-medio-bar: #e8862a;
  --ct-casi-bg: #fff5c2; --ct-casi-ink: #6e5600; --ct-casi-bar: #d4ac0d;
  --ct-listo-bg: #dff4e7; --ct-listo-ink: #0b6b45; --ct-listo-bar: #1f9d62;
  --ct-orange: #c55a11; --ct-orange-ink: #fff; --ct-orange-edge: #a1480b;
  --ct-red: #c0292b; --ct-red-ink: #fff; --ct-red-edge: #981f21;
  --ct-cancel: #6b7686; --ct-cancel-ink: #fff; --ct-cancel-edge: #566070;
  --ct-danger-ink: #b42323;
  --ct-on-color: rgba(255, 255, 255, .14);
  --ct-on-color-line: rgba(255, 255, 255, .45);
  --ct-today-bg: #fde6c4; --ct-today-ink: #8a4500;
  --ct-tomorrow-bg: #e2ebff; --ct-tomorrow-ink: #1d4ed8;
  --ct-shadow: 0 1px 2px rgba(20, 48, 42, .07), 0 8px 24px rgba(20, 48, 42, .06);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
  padding: 12px 12px 120px;
  color: var(--ct-ink); font-size: 14px; line-height: 1.4;
  background: var(--ct-bg);
}
:root[data-theme="dark"] .ct2, :root[data-theme="dark"] .ct2-capa {
  --ct-soft: #1b2434;
  --ct-accent: #2bb88c; --ct-accent-ink: #06130e;
  --ct-select: #a78bfa;
  --ct-lejos-bg: #3a1519; --ct-lejos-ink: #ff9ea4; --ct-lejos-bar: #e05a62;
  --ct-medio-bg: #3a2410; --ct-medio-ink: #ffb877; --ct-medio-bar: #ec8f3a;
  --ct-casi-bg: #332d0c; --ct-casi-ink: #f2d865; --ct-casi-bar: #e0bb2a;
  --ct-listo-bg: #143222; --ct-listo-ink: #7ee2a8; --ct-listo-bar: #2fb36f;
  --ct-orange: #b4520f; --ct-orange-ink: #fff7ef; --ct-orange-edge: #d8742c;
  --ct-red: #a3232b; --ct-red-ink: #fff1f2; --ct-red-edge: #d24a52;
  --ct-cancel: #3d4757; --ct-cancel-ink: #d5dce6; --ct-cancel-edge: #566173;
  --ct-danger-ink: #ff8f95;
  --ct-today-bg: #3a2a10; --ct-today-ink: #f6c56f;
  --ct-tomorrow-bg: #1c2a44; --ct-tomorrow-ink: #9cbcff;
  --ct-shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .18);
}
.ct2 button, .ct2 input, .ct2-capa button, .ct2-capa input { font: inherit; color: inherit; }
.ct2 button, .ct2-capa button { cursor: pointer; }
.ct2 :focus-visible, .ct2-capa :focus-visible { outline: 2px solid var(--ct-accent); outline-offset: 2px; }

/* barra: tablas + crear + chat abierto */
.ct2-barra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ct2-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.ct2-chipw { display: inline-flex; align-items: center; gap: 4px; }
.ct2-chip, .ct2-chip-otras { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ct-line); background: var(--ct-surface); border-radius: 999px; padding: 7px 8px 7px 14px; font-weight: 750; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ct-ink); }
.ct2-chip-otras { border-style: dashed; border-color: var(--ct-faint); color: var(--ct-muted); }
.ct2-cnt { font-size: 11.5px; font-weight: 750; color: var(--ct-muted); background: var(--ct-soft); border-radius: 999px; padding: 1px 8px; }
.ct2-chip.on { background: var(--ct-ink); color: var(--ct-surface); border-color: var(--ct-ink); }
.ct2-chip.on .ct2-cnt { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.ct2-mas { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--ct-line); background: var(--ct-surface); font-weight: 800; color: var(--ct-muted); }
.ct2-btn { border: 1px solid var(--ct-line); background: var(--ct-surface); border-radius: 999px; padding: 8px 14px; font-weight: 750; font-size: 13px; color: var(--ct-ink); }
.ct2-btn.primario { background: var(--ct-accent); border-color: var(--ct-accent); color: var(--ct-accent-ink); }
.ct2-btn.peligro { background: var(--ct-red); border-color: var(--ct-red); color: var(--ct-red-ink); }
.ct2-btn:disabled { opacity: .6; cursor: default; }
.ct2-link { border: 0; background: none; padding: 0; color: var(--ct-accent); font-weight: 750; text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
.ct2-regla, .ct2-nota { margin: 0; font-size: 12.5px; color: var(--ct-muted); max-width: 90ch; }
.ct2-regla b { color: var(--ct-ink); font-weight: 700; }
.ct2-nota { padding: 8px 11px; border-radius: 10px; border: 1px dashed var(--ct-faint); background: var(--ct-surface); }
.ct2-aviso { margin: 0; padding: 18px 12px; text-align: center; color: var(--ct-muted); }
.ct2-corto, .ct2-como .op.ct2-corto { display: none; }

/* Meta · Generado · Falta + cuenta en pesos */
.ct2-resumen { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; }
.ct2-caja { background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: 14px; box-shadow: var(--ct-shadow); min-width: 0; }
.ct2-kpis { padding: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-content: start; }
.ct2-kpi { display: grid; gap: 3px; align-content: start; padding: 10px 12px; border-radius: 11px; background: var(--ct-soft); min-width: 0; }
.ct2-kpi-lbl { font-size: 11px; font-weight: 780; letter-spacing: .07em; text-transform: uppercase; color: var(--ct-muted); }
.ct2-kpi-num, .ct2-kpi-in input { font-size: 26px; font-weight: 820; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; color: var(--ct-ink); }
.ct2-kpi-in { display: flex; align-items: baseline; gap: 2px; border-bottom: 1.5px dashed var(--ct-faint); cursor: text; }
.ct2-kpi-in span { font-size: 20px; font-weight: 820; color: var(--ct-muted); }
.ct2-kpi-in input { width: 100%; min-width: 0; border: 0; background: transparent; padding: 0; }
.ct2-kpi-in input:focus-visible { outline: none; }
.ct2-kpi-in:focus-within { border-bottom-color: var(--ct-accent); border-bottom-style: solid; }
.ct2-kpi-sub { font-size: 11.5px; color: var(--ct-muted); }
.ct2-falta.lejos { background: var(--ct-lejos-bg); }
.ct2-falta.medio { background: var(--ct-medio-bg); }
.ct2-falta.casi { background: var(--ct-casi-bg); }
.ct2-falta.listo { background: var(--ct-listo-bg); }
.ct2-falta.lejos :is(.ct2-kpi-lbl, .ct2-kpi-num, .ct2-kpi-sub) { color: var(--ct-lejos-ink); }
.ct2-falta.medio :is(.ct2-kpi-lbl, .ct2-kpi-num, .ct2-kpi-sub) { color: var(--ct-medio-ink); }
.ct2-falta.casi :is(.ct2-kpi-lbl, .ct2-kpi-num, .ct2-kpi-sub) { color: var(--ct-casi-ink); }
.ct2-falta.listo :is(.ct2-kpi-lbl, .ct2-kpi-num, .ct2-kpi-sub) { color: var(--ct-listo-ink); }
.ct2-avance { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--ct-soft); overflow: hidden; }
.ct2-avance-bar { height: 100%; width: 0; border-radius: inherit; background: var(--ct-lejos-bar); transition: width .35s ease, background-color .35s ease; }
.ct2-avance-bar.medio { background: var(--ct-medio-bar); }
.ct2-avance-bar.casi { background: var(--ct-casi-bar); }
.ct2-avance-bar.listo { background: var(--ct-listo-bar); }
.ct2-niveles { grid-column: 1 / -1; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--ct-muted); }
.ct2-niveles span { display: inline-flex; align-items: center; gap: 5px; }
.ct2-niveles i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.ct2-n-lejos { background: var(--ct-lejos-bar); } .ct2-n-medio { background: var(--ct-medio-bar); }
.ct2-n-casi { background: var(--ct-casi-bar); } .ct2-n-listo { background: var(--ct-listo-bar); }

.ct2-cuenta { padding: 14px; display: grid; gap: 10px; align-content: start; }
.ct2-cuenta-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.ct2-cuenta-head h2 { margin: 0; font-size: 13.5px; font-weight: 780; }
.ct2-cuenta-head span { font-size: 12px; color: var(--ct-muted); }
.ct2-gastos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ct2-gasto { display: grid; gap: 4px; min-width: 0; position: relative; }
.ct2-gasto-lbl { font-size: 11px; font-weight: 780; letter-spacing: .05em; text-transform: uppercase; color: var(--ct-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct2-g-nombre { width: 100%; min-width: 0; border: 0; border-bottom: 1px dashed var(--ct-faint); background: transparent; padding: 0 20px 1px 0; font-size: 11px; font-weight: 780; letter-spacing: .05em; text-transform: uppercase; color: var(--ct-muted); }
.ct2-g-quita { position: absolute; top: -3px; right: 0; width: 20px; height: 20px; border: 0; border-radius: 6px; background: transparent; color: var(--ct-faint); font-size: 12px; font-weight: 800; line-height: 1; padding: 0; }
.ct2-g-quita:hover { color: var(--ct-danger-ink); }
.ct2-g-in { display: flex; align-items: center; gap: 2px; border: 1px solid var(--ct-line); border-radius: 9px; padding: 6px 8px; background: var(--ct-soft); }
.ct2-g-in:focus-within { border-color: var(--ct-accent); }
.ct2-g-in span { color: var(--ct-faint); font-weight: 700; font-size: 13px; }
.ct2-g-in input { width: 100%; min-width: 0; border: 0; background: transparent; padding: 0; font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.ct2-g-in input:focus-visible { outline: none; }
.ct2-g-agregar { justify-self: start; border: 1px dashed var(--ct-faint); background: transparent; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 750; color: var(--ct-accent); }
.ct2-res { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 9px 11px; border-radius: 10px; background: var(--ct-soft); font-variant-numeric: tabular-nums; }
.ct2-res-total { font-weight: 750; }
.ct2-op { color: var(--ct-faint); font-weight: 800; }
.ct2-dolar { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ct-muted); font-weight: 700; }
.ct2-dolar input { width: 72px; border: 1px solid var(--ct-line); border-radius: 8px; padding: 4px 7px; background: var(--ct-surface); font-weight: 780; font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.ct2-res-usd { font-size: 16px; font-weight: 820; }
.ct2-dolar-txt { margin: 0; font-size: 11.5px; color: var(--ct-muted); }

/* hojas */
.ct2-hoja-top { display: grid; gap: 8px; padding: 11px 12px; border-bottom: 1px solid var(--ct-line); }
.ct2-titulo { margin: 0; font-size: 14.5px; font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ct2-leyenda, .ct2-como { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--ct-muted); }
.ct2-leyenda span.it { display: inline-flex; align-items: center; gap: 7px; }
.ct2-leyenda b { color: var(--ct-ink); }
.ct2-como .op { display: inline-flex; align-items: baseline; gap: 6px; }
.ct2-op-n { font-size: 10.5px; font-weight: 820; letter-spacing: .06em; text-transform: uppercase; color: var(--ct-select); white-space: nowrap; }
.ct2-op-n.peligro { color: var(--ct-danger-ink); }
.ct2-sw { width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; flex: none; border: 1.5px solid var(--ct-faint); font-size: 11px; font-weight: 900; line-height: 1; background: var(--ct-surface); }
.ct2-sw.naranja { background: var(--ct-orange); border-color: var(--ct-orange-edge); color: var(--ct-orange-ink); }
.ct2-sw.rojo { background: var(--ct-red); border-color: var(--ct-red-edge); color: var(--ct-red-ink); }
.ct2-sw.cancelado { background: var(--ct-cancel); border-color: var(--ct-cancel-edge); color: var(--ct-cancel-ink); }
.ct2-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.ct2-hoja { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 960px; font-size: 13.5px; }
.ct2-hoja th, .ct2-hoja td { padding: 7px 10px; border-bottom: 1px solid var(--ct-line); text-align: left; vertical-align: middle; white-space: nowrap; background: var(--ct-surface); }
.ct2-hoja thead th { font-size: 11px; font-weight: 780; letter-spacing: .06em; text-transform: uppercase; color: var(--ct-muted); background: var(--ct-soft); }
.ct2-hoja .num { text-align: right; font-variant-numeric: tabular-nums; }
.ct2-hoja .c-ruta { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 0 var(--ct-line); min-width: 280px; }
.ct2-rc { display: flex; align-items: center; gap: 9px; }
.ct2-fila td { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ct2-fila input { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.ct2-sel { width: 17px; height: 17px; margin: 0; accent-color: var(--ct-select); flex: none; cursor: pointer; }
.ct2-estado { width: 22px; height: 22px; padding: 0; border-radius: 6px; border: 1.5px solid var(--ct-faint); background: transparent; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 900; line-height: 1; color: inherit; }
.ct2-estado:hover { border-color: var(--ct-select); }
.ct2-n { width: 22px; text-align: right; font-size: 12px; font-weight: 700; color: var(--ct-faint); font-variant-numeric: tabular-nums; flex: none; }
.ct2-ruta { display: grid; min-width: 0; line-height: 1.25; white-space: normal; }
.ct2-ruta-o { font-weight: 750; }
.ct2-ruta-d { color: var(--ct-muted); }
.ct2-chofer { width: 150px; border: 1px solid var(--ct-line); border-radius: 8px; padding: 6px 8px; background: var(--ct-soft); }
.ct2-m { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--ct-line); border-radius: 8px; padding: 0 8px; background: var(--ct-soft); }
.ct2-m span { color: var(--ct-faint); font-weight: 700; }
.ct2-m input { width: 58px; border: 0; background: transparent; padding: 6px 0; text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.ct2-m input:focus-visible { outline: none; }
.ct2-m:focus-within, .ct2-chofer:focus { border-color: var(--ct-accent); }
.ct2-hoja input.guardando { opacity: .6; }
.ct2-hoja input.guardado, .ct2-m.guardado { box-shadow: 0 0 0 2px var(--ct-listo-bar); }
.ct2-hoja input.mal, .ct2-m.mal { box-shadow: 0 0 0 2px var(--ct-lejos-bar); }
.ct2-precio { font-weight: 750; }
.ct2-chip-dia { display: inline-block; font-size: 10.5px; font-weight: 820; letter-spacing: .06em; padding: 2px 7px; border-radius: 999px; margin-right: 7px; vertical-align: 1px; background: var(--ct-soft); }
.ct2-chip-dia.hoy { background: var(--ct-today-bg); color: var(--ct-today-ink); }
.ct2-chip-dia.manana { background: var(--ct-tomorrow-bg); color: var(--ct-tomorrow-ink); }
.ct2-hora { color: var(--ct-muted); }
.ct2-acc { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ct2-tel, .ct2-mapa { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--ct-line); background: var(--ct-soft); border-radius: 999px; padding: 5px 11px 5px 9px; font-variant-numeric: tabular-nums; font-weight: 650; text-decoration: none; color: var(--ct-ink); white-space: nowrap; font-size: 13px; }
.ct2-tel:hover, .ct2-mapa:hover { border-color: var(--ct-accent); }
.ct2-marca { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--ct-faint); }
.ct2-marca.yisus { background: var(--ct-yisus); }
.ct2-marca.carlos { background: var(--ct-carlos); }
.ct2-go { font-size: 11.5px; font-weight: 780; color: var(--ct-accent); }

.ct2-fila.naranja td { background: var(--ct-orange); color: var(--ct-orange-ink); border-bottom-color: var(--ct-orange-edge); }
.ct2-fila.rojo td { background: var(--ct-red); color: var(--ct-red-ink); border-bottom-color: var(--ct-red-edge); }
.ct2-fila.cancelado td { background: var(--ct-cancel); color: var(--ct-cancel-ink); border-bottom-color: var(--ct-cancel-edge); }
.ct2-fila:is(.naranja, .rojo, .cancelado) :is(.ct2-ruta-d, .ct2-n, .ct2-hora, .ct2-m span, .ct2-go) { color: inherit; opacity: .85; }
.ct2-fila:is(.naranja, .rojo, .cancelado) .ct2-estado { border-color: currentColor; }
.ct2-fila:is(.naranja, .rojo, .cancelado) :is(.ct2-chofer, .ct2-m, .ct2-tel, .ct2-mapa, .ct2-chip-dia) { background: var(--ct-on-color); border: 1px solid var(--ct-on-color-line); color: inherit; }
.ct2-fila:is(.naranja, .rojo, .cancelado) input::placeholder { color: inherit; opacity: .75; }
.ct2-fila:is(.naranja, .rojo, .cancelado) .ct2-marca { box-shadow: 0 0 0 2px var(--ct-on-color-line); }
.ct2-fila.cancelado :is(.ct2-ruta-o, .ct2-ruta-d, .ct2-precio, .ct2-m input) { text-decoration: line-through; }
.ct2-fila.sel-on td { box-shadow: inset 0 2px 0 var(--ct-select), inset 0 -2px 0 var(--ct-select); }
.ct2-fila.sel-on .c-ruta { box-shadow: inset 3px 0 0 var(--ct-select), inset 0 2px 0 var(--ct-select), inset 0 -2px 0 var(--ct-select), 1px 0 0 var(--ct-line); }
@keyframes ct2-llega { from { box-shadow: inset 0 0 0 999px rgba(124, 58, 237, .32); } to { box-shadow: inset 0 0 0 999px rgba(124, 58, 237, 0); } }
.ct2-fila.nueva td { animation: ct2-llega 2.6s ease-out; }
.ct2-sec th { background: var(--ct-soft); padding: 8px 10px; font-size: 12.5px; font-weight: 780; color: var(--ct-ink); text-transform: none; letter-spacing: 0; }
.ct2-sec-lbl { position: sticky; left: 10px; display: inline-flex; gap: 8px; align-items: center; }
.ct2-sec-n { font-size: 11px; font-weight: 750; color: var(--ct-muted); background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: 999px; padding: 0 7px; font-variant-numeric: tabular-nums; }
.ct2-titulo .ct2-sec-n { background: var(--ct-soft); }
.ct2-hoja tfoot td { background: var(--ct-soft); font-weight: 820; border-bottom: 0; font-variant-numeric: tabular-nums; }
.ct2-tf-lbl { display: block; font-size: 10.5px; font-weight: 780; letter-spacing: .06em; text-transform: uppercase; color: var(--ct-muted); }
.ct2-vacio td { white-space: normal; text-align: center; color: var(--ct-muted); padding: 30px 16px; line-height: 1.6; }
.ct2-vacio b { color: var(--ct-ink); }
.ct2-sinfecha > summary { cursor: pointer; padding: 11px 12px; font-weight: 800; font-size: 14px; list-style-position: inside; }

/* La caja angosta (celular, Z Fold, o con una conversación abierta al lado): cada viaje es un renglón apilado. */
@container ct2 (max-width: 759px) {
  .ct2-resumen { grid-template-columns: minmax(0, 1fr); }
  .ct2-scroll { overflow: visible; }
  table.ct2-hoja { display: block; min-width: 0; }
  .ct2-hoja thead { display: none; }
  .ct2-hoja tbody, .ct2-hoja tfoot, .ct2-hoja tr { display: block; }
  .ct2-hoja tr.ct2-fila {
    display: grid; grid-template-columns: minmax(0, 1fr) 112px;
    grid-template-areas: "ruta ruta" "dia precio" "chofer com" "acc acc";
    gap: 8px 10px; padding: 11px 12px; border-bottom: 1px solid var(--ct-line); background: var(--ct-surface);
  }
  .ct2-hoja tr.ct2-fila > td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; background: transparent; }
  .ct2-hoja tr.ct2-fila > td.c-ruta { grid-area: ruta; position: static; box-shadow: none; min-width: 0; }
  .ct2-hoja tr.ct2-fila > td.c-dia { grid-area: dia; align-self: end; }
  .ct2-hoja tr.ct2-fila > td.c-precio { grid-area: precio; text-align: right; }
  .ct2-hoja tr.ct2-fila > td.c-chofer { grid-area: chofer; }
  .ct2-hoja tr.ct2-fila > td.c-com { grid-area: com; text-align: left; }
  .ct2-hoja tr.ct2-fila > td.c-acc { grid-area: acc; }
  .ct2-hoja tr.ct2-fila > td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font-size: 10.5px; font-weight: 780; letter-spacing: .06em; text-transform: uppercase; color: var(--ct-muted); }
  .ct2-hoja tr.ct2-fila.naranja { background: var(--ct-orange); color: var(--ct-orange-ink); }
  .ct2-hoja tr.ct2-fila.rojo { background: var(--ct-red); color: var(--ct-red-ink); }
  .ct2-hoja tr.ct2-fila.cancelado { background: var(--ct-cancel); color: var(--ct-cancel-ink); }
  .ct2-hoja tr.ct2-fila:is(.naranja, .rojo, .cancelado) > td[data-label]::before { color: inherit; opacity: .8; }
  .ct2-hoja tr.ct2-fila.sel-on { box-shadow: inset 0 0 0 3px var(--ct-select); }
  .ct2-hoja tr.ct2-fila.sel-on > td { box-shadow: none; }
  .ct2-hoja tr.ct2-fila.nueva { animation: ct2-llega 2.6s ease-out; }
  .ct2-hoja tr.ct2-fila.nueva > td { animation: none; }
  .ct2-chofer { width: 100%; }
  .ct2-m input { width: 64px; }
  .ct2-hoja tr.ct2-sec th { display: block; }
  .ct2-sec-lbl { position: static; }
  .ct2-hoja tfoot tr { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 18px; padding: 10px 12px; background: var(--ct-soft); }
  .ct2-hoja tfoot td { display: block; padding: 0; border: 0; background: transparent; }
  .ct2-hoja tfoot td:empty { display: none; }
  .ct2-hoja tfoot .c-ruta { position: static; box-shadow: none; min-width: 0; align-self: center; }
  .ct2-hoja tfoot .num { text-align: left; }
  .ct2-hoja tr.ct2-vacio td { display: block; }
}
@container ct2 (min-width: 520px) and (max-width: 759px) {
  .ct2-hoja tr.ct2-fila {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 112px;
    grid-template-areas: "ruta ruta dia" "chofer com precio" "acc acc acc";
  }
  .ct2-hoja tr.ct2-fila > td.c-dia { text-align: right; align-self: center; }
  .ct2-hoja tr.ct2-fila > td.c-precio { align-self: end; }
}
@container ct2 (max-width: 560px) {
  .ct2-largo { display: none; }
  .ct2-corto { display: inline; }
  .ct2-como .op.ct2-largo { display: none; }
  .ct2-como .op.ct2-corto { display: inline-flex; }
  .ct2-kpis { padding: 10px; gap: 7px; }
  .ct2-kpi { padding: 8px 9px; }
  .ct2-kpi-num, .ct2-kpi-in input { font-size: 19px; }
  .ct2-kpi-in span { font-size: 15px; }
  .ct2-kpi-sub { font-size: 10.5px; }
  .ct2-gastos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container ct2 (max-width: 400px) {
  .ct2-kpis { gap: 6px; padding: 8px; }
  .ct2-kpi { padding: 7px; }
  .ct2-kpi-num, .ct2-kpi-in input { font-size: 17px; }
  .ct2-kpi-lbl { font-size: 10px; letter-spacing: .05em; }
}

/* capa flotante: menú de la fila, menú de la tabla, barra de marcadas, ventana, aviso con «Deshacer» */
.ct2-capa {
  --ct-surface: var(--card, #fff); --ct-soft: #f4f7f9; --ct-line: var(--line, #e3e8ee); --ct-ink: var(--text, #1a1f26);
  --ct-muted: var(--mut, #57606a); --ct-faint: var(--mut2, #8b949e); --ct-accent: #137c68; --ct-accent-ink: #fff;
  --ct-orange: #c55a11; --ct-orange-ink: #fff; --ct-orange-edge: #a1480b; --ct-red: #c0292b; --ct-red-ink: #fff; --ct-red-edge: #981f21;
  --ct-cancel: #6b7686; --ct-cancel-ink: #fff; --ct-cancel-edge: #566070; --ct-danger-ink: #b42323;
  --ct-bar-bg: #172b2b; --ct-bar-ink: #fff; --ct-bar-btn: rgba(255, 255, 255, .12); --ct-bar-danger: #ffb4b4;
  --ct-scrim: rgba(8, 14, 18, .5); --ct-pop: 0 14px 36px rgba(10, 20, 24, .22);
  font-size: 14px; color: var(--ct-ink);
}
:root[data-theme="dark"] .ct2-capa { --ct-bar-bg: #e7edf5; --ct-bar-ink: #0e131b; --ct-bar-btn: rgba(14, 19, 27, .08); --ct-bar-danger: #b42323; --ct-scrim: rgba(0, 0, 0, .6); --ct-pop: 0 14px 36px rgba(0, 0, 0, .5); }
.ct2-menu { position: fixed; z-index: 120; min-width: 260px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto; background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: 12px; box-shadow: var(--ct-pop); padding: 6px; display: grid; gap: 2px; }
.ct2-menu[hidden] { display: none; }
.ct2-menu-t { margin: 4px 8px 6px; font-size: 11.5px; color: var(--ct-muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 290px; }
.ct2-menu button, .ct2-menu a { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 10px; font-weight: 650; color: var(--ct-ink); text-decoration: none; font-size: 14px; }
.ct2-menu button:hover, .ct2-menu a:hover, .ct2-menu button:focus-visible, .ct2-menu a:focus-visible { background: var(--ct-soft); outline: none; }
.ct2-menu .peligro { color: var(--ct-danger-ink); }
.ct2-menu hr { border: 0; border-top: 1px solid var(--ct-line); margin: 4px 2px; }
.ct2-bulk { position: fixed; z-index: 110; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; padding: 8px; background: var(--ct-bar-bg); color: var(--ct-bar-ink); border-radius: 16px; box-shadow: var(--ct-pop); width: max-content; max-width: calc(100vw - 24px); }
.ct2-bulk[hidden] { display: none; }
.ct2-bulk-n { padding: 0 8px; font-weight: 780; font-size: 13px; }
.ct2-bulk button { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 999px; padding: 8px 12px; background: var(--ct-bar-btn); color: inherit; font-weight: 720; font-size: 13px; }
.ct2-bulk button.peligro { color: var(--ct-bar-danger); }
.ct2-bulk .ct2-sw { border-color: currentColor; }
.ct2-modal { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; padding: 16px; }
.ct2-modal[hidden] { display: none; }
.ct2-modal-fondo { position: absolute; inset: 0; background: var(--ct-scrim); }
.ct2-modal-caja { position: relative; width: min(440px, 100%); background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: 16px; padding: 18px; display: grid; gap: 14px; box-shadow: var(--ct-pop); }
.ct2-modal-caja h2 { margin: 0; font-size: 17px; }
.ct2-fechas { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.ct2-fechas label { display: grid; gap: 5px; font-size: 12px; font-weight: 750; color: var(--ct-muted); min-width: 0; }
.ct2-fechas input { border: 1px solid var(--ct-line); border-radius: 10px; padding: 9px 10px; background: var(--ct-soft); font-size: 15px; min-width: 0; width: 100%; color: var(--ct-ink); }
.ct2-ayuda { margin: 0; font-size: 12.5px; color: var(--ct-muted); }
.ct2-ayuda b { color: var(--ct-ink); }
.ct2-ayuda.mal { color: var(--ct-danger-ink); font-weight: 700; }
.ct2-check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.ct2-check input { accent-color: var(--ct-accent); width: 16px; height: 16px; margin: 0; }
.ct2-botones { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.ct2-aviso-flota { position: fixed; z-index: 140; left: 50%; transform: translateX(-50%); bottom: calc(78px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 14px; background: var(--ct-bar-bg); color: var(--ct-bar-ink); padding: 10px 16px; border-radius: 12px; font-weight: 680; font-size: 13px; box-shadow: var(--ct-pop); width: max-content; max-width: calc(100vw - 32px); }
.ct2-aviso-flota[hidden] { display: none; }
.ct2-aviso-flota button { border: 0; background: transparent; color: inherit; padding: 0; font-weight: 820; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
@media (max-width: 400px) {
  .ct2-fechas { grid-template-columns: minmax(0, 1fr); }
  .ct2-bulk button { padding: 7px 10px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .ct2-fila.nueva td, .ct2-hoja tr.ct2-fila.nueva { animation: none; }
  .ct2-avance-bar { transition: none; }
}
