/* Componentes estilo iOS: botones, chips, campos, listas agrupadas, segmentados, interruptores,
   selector de fecha y lo propio de cada pantalla. Solo usa tokens (styles.css / temas.css). */

/* ---------- Botones (píldoras) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 999px; background: var(--fill); color: var(--accent-texto); cursor: pointer; white-space: nowrap;
  font-size: var(--t-sub); font-weight: 600; text-decoration: none; transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); opacity: 0.85; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primario { background: var(--accent-relleno); color: var(--accent-ink); }
.btn.peligro { background: var(--critical-soft); color: var(--critical); }
.btn.quieto { background: transparent; color: var(--accent-texto); font-weight: 500; }
.btn.wa { background: var(--ok-soft); color: var(--ok); }
.btn.chico { padding: 0 12px; font-size: 14px; }
.btn.ancho { width: 100%; min-height: 50px; font-size: var(--t-cuerpo); }
.btn-icono {
  display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--accent-texto); cursor: pointer;
}
.peligro-texto { color: var(--critical); }
.btn.quieto.peligro-texto { color: var(--critical); }
.enlace {
  min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent-texto); cursor: pointer;
  font-size: var(--t-sub); font-weight: 500; text-decoration: none;
}
.fila-botones { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 15;
  display: inline-flex; align-items: center; gap: 6px; min-height: 50px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--accent-relleno); color: var(--accent-ink); font-size: var(--t-cuerpo); font-weight: 600; box-shadow: var(--sombra); cursor: pointer;
}

/* ---------- Chips y contadores ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 2px 9px; border-radius: 7px;
  background: var(--surface-2); color: var(--ink); font-size: var(--t-nota); font-weight: 500; line-height: 1.2;
}
.chip.critico { background: var(--critical-soft); color: var(--critical); font-weight: 600; }
.chip.acento { background: var(--accent-soft); color: var(--accent-texto); font-weight: 600; }
.chip.aviso { background: var(--warning-soft); color: var(--warning); }
.chip.quieto { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.cuenta {
  display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--fill);
  color: var(--ink); font-size: 12px; font-weight: 600; line-height: 20px; text-align: center;
}

/* ---------- Campos ---------- */
.campo { display: grid; gap: 6px; min-width: 0; }
.campo > label, legend { font-size: var(--t-nota); font-weight: 500; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; background-color: var(--fill);
  color: var(--ink); font-size: var(--t-cuerpo); -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
select {
  padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 55%, calc(100% - 14px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
textarea { resize: vertical; min-height: 88px; line-height: 1.4; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--critical-vivo); }
input:disabled { color: var(--muted); }
.ayuda { font-size: var(--t-nota); color: var(--muted); }
.error-campo { color: var(--critical); font-weight: 500; font-size: var(--t-sub); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; }
legend + * { clear: both; }
.fila-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.nota-estado { padding: 12px 16px; border-radius: var(--radio-grupo); background: var(--warning-soft); color: var(--ink); font-size: var(--t-sub); }

/* ---------- Listas agrupadas insertadas (iOS "inset grouped") ---------- */
.seccion { display: grid; gap: 7px; min-width: 0; }
.seccion-titulo, .seccion-hist > h3, .riesgo > h3, .hoja-cuerpo section > h3 {
  padding: 0 16px; font-size: var(--t-nota); font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted);
}
.seccion-pie { padding: 0 16px; font-size: var(--t-nota); color: var(--muted); }
.grupo, .historial, .movimientos, .filas { background: var(--surface); border-radius: var(--radio-grupo); overflow: hidden; }
.grupo > *, .historial > li, .movimientos > li, .filas > li { position: relative; }
.grupo > :not([hidden]) ~ :not([hidden]):not(.ayuda):not(.error-campo)::before,
.historial > li + li::before, .movimientos > li + li::before, .filas > li + li::before,
.interruptor + .interruptor::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; height: var(--hair); background: var(--line); pointer-events: none;
}
.grupo :focus-visible { outline-offset: -3px; }
.grupo > .ayuda, .grupo > .error-campo { padding: 0 16px 12px; }
.grupo > .nota-estado { border-radius: 0; }
.grupo.sin-celda { background: none; border-radius: 0; overflow: visible; }
.grupo.sin-celda > *::before { display: none; }
.grupo .campo {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); align-items: center; column-gap: 12px; row-gap: 0;
  min-height: 48px; padding: 0 16px;
}
.grupo .campo > label { padding-block: 12px; font-size: var(--t-cuerpo); font-weight: 400; color: var(--ink); }
.grupo .campo > input, .grupo .campo > select { padding: 12px 0; border-radius: 0; background-color: transparent; text-align: right; }
.grupo .campo > select { padding-right: 20px; text-align-last: right; background-position: calc(100% - 5px) 55%, 100% 55%; }
.grupo .campo > .ayuda, .grupo .campo > .error-campo { grid-column: 1 / -1; margin-top: -4px; padding-bottom: 12px; }
.grupo .campo:has(> textarea) { grid-template-columns: 1fr; row-gap: 4px; padding-block: 10px 6px; }
.grupo .campo:has(> textarea) > label { padding: 0; font-size: var(--t-nota); color: var(--muted); }
.grupo .campo > textarea { min-height: 66px; padding: 0; border-radius: 0; background-color: transparent; }
/* Campos de texto (filas, buscador, nota de Hoy, monto de Operaciones): sin anillo al enfocar, solo el cursor (como iOS). */
.grupo .campo > :is(input:is([type="text"], [type="number"], [type="search"], [type="email"], [type="tel"]), textarea),
.buscador input, .panel .campo > textarea, .celda-monto input { caret-color: var(--accent); }
.grupo .campo > :is(input:is([type="text"], [type="number"], [type="search"], [type="email"], [type="tel"]), textarea):is(:focus, :focus-visible),
:is(.buscador input, .panel .campo > textarea, .celda-monto input):is(:focus, :focus-visible) { outline: none; }
/* Con teclado o puntero fino, la fila (o el campo con relleno) apenas se tiñe; sin :has() no hay indicador extra. En táctil, solo el cursor. */
@media (pointer: fine) {
  .grupo .campo:has(> :is(input:is([type="text"], [type="number"], [type="search"], [type="email"], [type="tel"]), textarea):focus-visible) { background-color: var(--accent-soft); }
  :is(.buscador input, .panel .campo > textarea, .celda-monto input):focus-visible { background-color: var(--accent-soft); }
}
.grupo > .segmentado { padding: 12px 16px; }
.grupo.sin-celda > .segmentado { padding: 0; }
.fila-accion { padding: 0 16px; }
.fila-accion > .btn {
  width: 100%; min-height: 48px; justify-content: flex-start; padding: 0; border-radius: 0; background: transparent;
  font-size: var(--t-cuerpo); font-weight: 400;
}

/* ---------- Control segmentado con píldora deslizante (CSS :has) ---------- */
.segmentado { min-width: 0; }
.seg-opciones, .seg-pestanas {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 2px;
  border-radius: 10px; background: var(--fill); isolation: isolate; --n: 2; --i: 0;
}
.seg-pestanas { --n: 4; }
.seg-opciones:has(> :nth-child(3)) { --n: 3; }
.seg-opciones:has(> :nth-child(4)) { --n: 4; }
.seg-opciones:has(> :nth-child(5)) { --n: 5; }
.seg-opciones:has(> :nth-child(2) > input:checked), .seg-pestanas:has(> :nth-child(2)[aria-pressed="true"]) { --i: 1; }
.seg-opciones:has(> :nth-child(3) > input:checked), .seg-pestanas:has(> :nth-child(3)[aria-pressed="true"]) { --i: 2; }
.seg-opciones:has(> :nth-child(4) > input:checked), .seg-pestanas:has(> :nth-child(4)[aria-pressed="true"]) { --i: 3; }
.seg-opciones:has(> :nth-child(5) > input:checked) { --i: 4; }
.seg-opciones::before, .seg-pestanas::before {
  content: ""; position: absolute; z-index: -1; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--n));
  border-radius: 8px; background: var(--pastilla); box-shadow: var(--sombra-pastilla);
  transform: translateX(calc(100% * var(--i))); transition: transform 0.4s var(--curva);
}
.seg-opciones:not(:has(input:checked))::before { opacity: 0; }
.seg-op { position: relative; display: flex; min-width: 0; }
.seg-op input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.seg-op span {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; padding: 0 6px; border-radius: 8px;
  color: var(--ink); font-size: var(--t-nota); font-weight: 500; line-height: 1.15; text-align: center; cursor: pointer;
}
.seg-op input:checked + span { font-weight: 600; }
.seg-op input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -2px; }
.seg-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 50px; padding: 4px 2px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: var(--t-nota); font-weight: 500; cursor: pointer;
}
.seg-btn[aria-pressed="true"] { font-weight: 600; }
.seg-btn .cuenta { min-width: 0; padding: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.2; }
@supports not selector(:has(*)) {
  .seg-opciones::before, .seg-pestanas::before { display: none; }
  .seg-op input:checked + span, .seg-btn[aria-pressed="true"] { background: var(--pastilla); box-shadow: var(--sombra-pastilla); }
}

/* ---------- Interruptores (booleanos) ---------- */
.interruptores > legend { padding: 12px 16px 0; margin-bottom: 4px; }
.interruptor { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 16px; cursor: pointer; }
.interruptor input { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; opacity: 0; }
.pista { position: relative; flex-shrink: 0; width: 51px; height: 31px; border-radius: 999px; background: var(--fill-fuerte); transition: background 0.25s ease; }
.pista::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: var(--perilla); box-shadow: var(--sombra-perilla); transition: transform 0.3s var(--curva);
}
.interruptor input:checked + .pista { background: var(--ok-vivo); }
.interruptor input:checked + .pista::before { transform: translateX(20px); }
.interruptor input:focus-visible + .pista { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Selector de fecha y hora (ui-fecha.js) ---------- */
.fecha-resumen {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 6px 12px 6px 16px; border: 0;
  background: none; color: var(--ink); font-size: var(--t-cuerpo); text-align: left; cursor: pointer;
}
.fecha-et { flex: 1; min-width: 0; }
.fecha-lado { display: grid; justify-items: end; gap: 2px; }
.fecha-valor { padding: 5px 10px; border-radius: 8px; background: var(--fill); font-weight: 500; white-space: nowrap; }
.fecha-valor.vacia { background: transparent; color: var(--muted); }
.fecha-resumen[aria-expanded="true"] .fecha-valor { color: var(--accent-texto); }
.fecha-rel { font-size: var(--t-nota); color: var(--muted); }
.fecha-rel:empty { display: none; }
.fecha-chev { width: 18px; height: 18px; color: var(--muted); transition: transform 0.3s var(--curva); }
.fecha-resumen[aria-expanded="true"] .fecha-chev { transform: rotate(180deg); }
.fecha-panel { display: grid; gap: 16px; padding: 4px 16px 16px; }
.fecha-atajos { display: flex; flex-wrap: wrap; gap: 8px; }
.atajo {
  min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--fill); color: var(--ink);
  font-size: var(--t-sub); font-weight: 500; cursor: pointer;
}
.atajo[aria-pressed="true"] { background: var(--accent-relleno); color: var(--accent-ink); font-weight: 600; }
.atajo.quitar { color: var(--critical); }
.atajo.quitar[aria-pressed="true"] { background: var(--critical-soft); color: var(--critical); }
.cal { display: grid; gap: 6px; }
.cal-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-mes { padding-left: 4px; font-size: var(--t-cuerpo); font-weight: 600; }
.cal-flechas { display: flex; }
.cal-rejilla { display: grid; gap: 2px; }
.cal-fila { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); justify-items: center; }
.cal-dia-sem { padding: 2px 0 4px; font-size: var(--t-cap); font-weight: 600; color: var(--muted); }
.cal-celda { display: grid; place-items: center; width: 100%; }
.cal-dia {
  display: grid; place-items: center; width: 100%; max-width: 44px; min-height: 0; aspect-ratio: 1; padding: 0; border: 0;
  border-radius: 50%; background: none; color: var(--ink); font-size: 19px; font-weight: 400; cursor: pointer;
}
.cal-dia:hover { background: var(--fill); }
.cal-dia.pasado { color: var(--muted); }
.cal-dia.hoy { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent-texto); font-weight: 600; }
.cal-celda[aria-selected="true"] .cal-dia { background: var(--accent-relleno); box-shadow: none; color: var(--accent-ink); font-weight: 600; }
.cal-dia:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.hora-bloque { display: grid; gap: 10px; padding-top: 12px; border-top: var(--hair) solid var(--line); }
.fecha-panel > .hora-bloque:first-child { padding-top: 0; border-top: 0; }
.hora-titulo { font-size: var(--t-nota); font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); }
.pasos { display: flex; align-items: center; justify-content: center; gap: 8px; }
.paso { display: flex; align-items: center; border-radius: 12px; background: var(--fill); }
.paso-btn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px;
  background: none; color: var(--accent-texto); cursor: pointer;
}
.paso-valor, .pasos-sep { font-size: var(--t-titulo2); font-weight: 600; font-variant-numeric: tabular-nums; }
.paso-valor { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 2px; border-radius: 8px; }

/* ---------- Tarjetas de cliente (Hoy y Clientes) ---------- */
.resumen { margin-bottom: 4px; color: var(--muted); font-size: var(--t-sub); }
.titulo-grupo {
  display: flex; align-items: center; gap: 8px; margin: 22px 4px 8px; font-size: var(--t-nota); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted);
}
.pend-atrasados .titulo-grupo { color: var(--critical); }
.pend-hoy .titulo-grupo { color: var(--accent-texto); }
.tarjetas { display: grid; gap: 10px; }
.tarjeta { position: relative; padding: 12px 14px 14px; border-radius: var(--radio); background: var(--surface); overflow: hidden; }
.tarjeta.estado-atrasados::before, .tarjeta.estado-hoy::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 4px; background: var(--critical-vivo);
}
.tarjeta.estado-hoy::before { background: var(--accent); }
.tarjeta-cabeza {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; min-height: 44px; margin-bottom: 8px;
  padding: 0; border: 0; background: none; color: var(--ink); text-align: left; cursor: pointer;
}
.nombre { font-size: var(--t-titulo3); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.rubro { font-size: var(--t-sub); color: var(--muted); }
.tel { margin-top: 8px; font-size: var(--t-sub); color: var(--muted); user-select: text; -webkit-user-select: text; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
/* "Editar" chico al pie de la tarjeta, a la derecha (44 px de blanco que se come parte del relleno de abajo). */
.acciones-tarjeta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 4px 0 -8px; }
.motivo { margin-top: 8px; padding-left: 10px; border-left: 3px solid var(--warning-vivo); font-size: var(--t-sub); color: var(--muted); }
.panel { display: grid; gap: 14px; margin-top: 12px; padding: 12px 10px; border-radius: 12px; background: var(--surface-2); }
.panel .fecha-panel { padding-inline: 8px; }
.panel .btn:not(.primario):not(.quieto):not(.wa):not(.peligro) { background: var(--surface); }
.otra-fecha { display: grid; gap: 10px; }
.buscador { position: relative; margin: 12px 0; }
.buscador .ico { position: absolute; left: 10px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.buscador input { padding-left: 36px; }
.pie-lista { display: grid; gap: 10px; margin-top: 16px; }
.vacio {
  display: grid; gap: 12px; justify-items: center; margin-top: 12px; padding: 32px 20px; border-radius: var(--radio-grupo);
  background: var(--surface); color: var(--muted); text-align: center;
}
.esqueleto { display: grid; gap: 10px; margin-top: 12px; }
.esq-fila { display: grid; gap: 8px; padding: 16px 14px; border-radius: var(--radio); background: var(--surface); }
.esq-fila span { display: block; width: 55%; height: 14px; border-radius: 6px; background: var(--fill); animation: latido 1.4s ease-in-out infinite; }
.esq-fila span + span { width: 32%; }

/* ---------- Hoja de detalle ---------- */
.form-hoja { display: grid; gap: 22px; }
.lectura { display: grid; gap: 4px; padding: 12px 16px; font-size: var(--t-sub); color: var(--muted); }
.lectura-terminos { color: var(--ink); font-weight: 600; }
.critico-texto { display: inline-flex; align-items: center; gap: 6px; color: var(--critical); font-weight: 600; }
.tel-extra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tel-extra .tel { margin: 0; color: var(--ink); }
.subpanel { display: grid; padding-bottom: 12px; }
.subpanel .fila-botones { padding: 8px 16px 0; }
.seccion-hist, .riesgo { display: grid; gap: 8px; }
.composer { display: grid; gap: 10px; padding: 12px; border-radius: var(--radio-grupo); background: var(--surface); }
.historial > li, .movimientos > li { padding: 11px 16px; }
.hist-meta { font-size: var(--t-nota); color: var(--muted); }
.hist-nota { white-space: pre-wrap; overflow-wrap: anywhere; }
.hist-vacio { color: var(--muted); font-size: var(--t-sub); }
.riesgo .confirmar > .btn { width: 100%; }
.confirmar { display: grid; gap: 8px; }
.pregunta { color: var(--critical); font-weight: 500; }
details.editar > summary {
  display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: var(--radio-grupo);
  background: var(--surface); color: var(--accent-texto); cursor: pointer; list-style: none;
}
details.editar > summary::-webkit-details-marker { display: none; }
details.editar[open] > summary { margin-bottom: 12px; }

/* ---------- Operaciones ---------- */
.selector-mes { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.mes-actual { min-width: 8ch; text-align: center; font-size: var(--t-titulo3); font-weight: 600; }
.tabla-scroll { overflow-x: auto; border-radius: var(--radio-grupo); background: var(--surface); -webkit-overflow-scrolling: touch; }
.tabla-ops { width: 100%; min-width: 820px; border-collapse: separate; border-spacing: 0; font-size: var(--t-sub); }
.tabla-ops th, .tabla-ops td { padding: 10px 12px; border-bottom: var(--hair) solid var(--line); vertical-align: top; text-align: left; }
.tabla-ops thead th { font-size: var(--t-nota); font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted); white-space: nowrap; }
.tabla-ops .num { text-align: right; white-space: nowrap; }
.tabla-ops .col-cliente {
  position: sticky; left: 0; z-index: 1; width: 200px; min-width: 180px; max-width: 220px; background: var(--surface);
  box-shadow: 1px 0 0 var(--line); font-weight: 400;
}
.nombre-fila { display: block; font-weight: 600; }
/* [30-sep-2026] Nombre en Operaciones = botón con aspecto de texto. El relleno da ≥ 44 px de toque (10 + 20 + 14) y el
   margen negativo lo compensa: la fila no crece y el área no sale de la celda por arriba. position: relative para ganar el
   toque sobre la línea de abajo. El anillo de foco abraza el nombre (dentro del relleno, sin que el scroll lo recorte). */
.tabla-ops .nombre-abrir {
  position: relative; width: calc(100% + 24px); margin: -10px -12px -14px; padding: 10px 12px 14px; border: 0; border-radius: 0;
  background: none; color: var(--ink); font: inherit; font-weight: 600; letter-spacing: inherit; text-align: left; cursor: pointer;
}
.tabla-ops .nombre-abrir:is(:hover, :focus-visible) { color: var(--accent-texto); text-decoration: underline; text-underline-offset: 3px; }
.tabla-ops .nombre-abrir:focus-visible { outline: none; }
.tabla-ops .nombre-abrir:focus-visible::before {
  content: ""; position: absolute; inset: 7px 9px 11px; border: 2px solid var(--focus); border-radius: 6px; pointer-events: none;
}
.tabla-ops .sub { display: block; font-size: var(--t-nota); color: var(--muted); }
.falta { display: block; font-size: var(--t-nota); color: var(--warning); font-weight: 500; }
.tabla-ops .chips { margin-top: 4px; }
.celda-monto { position: relative; min-width: 160px; }
.celda-monto .signo { position: absolute; left: 22px; top: 21px; color: var(--muted); pointer-events: none; }
.celda-monto input { padding-left: 24px; text-align: right; }
.negativo { color: var(--critical); }
.tabla-ops tfoot th, .tabla-ops tfoot td { font-weight: 600; border-bottom: 0; border-top: 1px solid var(--line-fuerte); }
@media (max-width: 599px) {
  .tabla-ops .col-cliente { width: 132px; min-width: 124px; max-width: 140px; }
  .celda-monto { min-width: 140px; }
}

/* ---------- Comisionistas ---------- */
.filas { margin-top: 12px; }
.fila-com, .fila-simple {
  display: grid; gap: 10px; width: 100%; min-height: 56px; padding: 12px 16px; border: 0; background: none;
  color: var(--ink); text-align: left; cursor: pointer;
}
.fila-com-nombre, .fila-simple { display: flex; flex-direction: column; }
.filas .nombre { font-size: var(--t-cuerpo); }
.cifras, .resumen-saldo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.resumen-saldo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cifra { display: grid; gap: 2px; min-width: 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.resumen-saldo .cifra { padding: 12px 14px; background: var(--surface); }
.cifra-et { font-size: 12px; color: var(--muted); }
.cifra-val { font-size: var(--t-sub); font-weight: 600; overflow-wrap: anywhere; }
.saldo.debe, .resumen-saldo .saldo.debe { background: var(--critical-soft); }
.saldo.debe .cifra-val, .saldo.debe .cifra-et { color: var(--critical); }
.movimientos > li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mov-que { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mov-que .sub { font-size: var(--t-nota); color: var(--muted); }
.mov-monto { font-weight: 600; white-space: nowrap; }
.mov.pago .mov-monto { color: var(--ok); }
.mov .confirmar { justify-items: end; }
.mov .confirmar:has(.pregunta) { flex-basis: 100%; justify-items: start; }

/* ---------- Ajustes ---------- */
#vista > .seccion, .ajustes-columnas > .seccion, #form-ajustes { margin-top: 18px; }
#form-ajustes { display: grid; gap: 22px; }
.estado-lista > li { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 16px; font-size: var(--t-sub); }

@media (min-width: 900px) {
  .fab { bottom: 24px; right: 32px; }
  .fila-com { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; }
}

/* ---------- Líneas de negocio (hoja del cliente) ---------- */
.lineas-lista { display: grid; gap: 12px; }
.linea-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 8px 0 16px; }
.linea-titulo { font-weight: 600; overflow-wrap: anywhere; }
.linea-aviso:empty { display: none; }
.linea-aviso { display: grid; gap: 8px; padding: 10px 16px 12px; }
.agregar-linea { justify-self: start; }

/* ---------- Posibles repetidos: pista en el alta, aviso al guardar y sección en Clientes ---------- */
.parecidos { display: grid; gap: 8px; }
.parecido { display: grid; gap: 8px; padding: 12px 16px; border-radius: var(--radio-grupo); background: var(--warning-soft); font-size: var(--t-sub); }
.parecido b { font-weight: 600; }
.parecido .pregunta { flex-basis: 100%; }
.aviso-dup { padding: 12px 16px; border-radius: var(--radio-grupo); background: var(--warning-soft); }
.pie-repetidos:empty { display: none; }
.pie-repetidos, .repetidos { display: grid; gap: 10px; }
.repetidos-lista { display: grid; gap: 12px; }
.rep-clientes > li { position: relative; }
.rep-clientes > li + li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: var(--hair); background: var(--line); }
.rep-acciones { padding: 10px 16px 12px; }
.lista-radio > legend { padding: 12px 16px 0; margin-bottom: 4px; }
.radio-fila { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 16px; cursor: pointer; }
.radio-fila + .radio-fila::before { content: ""; position: absolute; top: 0; left: 44px; right: 0; height: var(--hair); background: var(--line); }
.radio-fila input {
  width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; flex-shrink: 0; border-radius: 50%;
  background: var(--surface, transparent); box-shadow: inset 0 0 0 2px var(--muted); cursor: pointer;
}
.radio-fila input:checked { background: var(--accent-ink); box-shadow: inset 0 0 0 6px var(--accent-relleno); }
.radio-fila input:disabled { opacity: .5; cursor: default; }
.radio-texto { display: flex; flex-direction: column; min-width: 0; }
.radio-texto .nombre { font-size: var(--t-cuerpo); }

/* ---------- Operaciones por línea ---------- */
.tabla-ops .linea-etq { display: block; margin-top: 2px; font-size: var(--t-nota); font-weight: 600; color: var(--ink); }
.tabla-ops .grupo-cliente.multi .fila-linea:not(.primera) > th, .tabla-ops .grupo-cliente.multi .fila-linea:not(.primera) > td { border-top: 0; }
.tabla-ops .grupo-cliente.multi .fila-linea:not(:last-child) > * { border-bottom-style: dashed; }
.tabla-ops .fila-subtotal > * { font-weight: 600; background: var(--surface-2); }
.tabla-ops .fila-subtotal > th.col-cliente { background: var(--surface-2); font-size: var(--t-nota); color: var(--muted); }

/* ---------- Barra de pestañas con seis entradas (teléfono): caben a 390 px sin desplazarse ---------- */
@media (max-width: 899px) {
  .pestanas { display: flex; }
  .pestana { flex: 1 1 auto; width: auto; min-width: 44px; min-height: max(44px, var(--tabbar)); padding: 6px 2px 4px; font-size: 10px; letter-spacing: 0; }
  .pestana span { white-space: nowrap; }
  .pestana .ico { width: 24px; height: 24px; }
}
