/* COMPROVAL — capa propia sobre el sistema Pulso.
   Cargar después de tokens.css y componentes.css.

   1. Traduce las clases que ya usa el JS del portal (tarjeta, kpis, pastilla,
      envoltorio, aviso, fila, subtabs…) a los tokens del sistema, para que
      cada vista se vea como el diseño sin reescribir su lógica.
   2. Añade lo que el sistema no trae: seis estados (aprobado a mano,
      anulado), gráfico SVG, mapa de lectura, clasificador, reglas, etc. */

.oculto { display: none !important; }

/* Nombres heredados del portal clasico, usados en estilos en linea del JS.
   Apuntan a los tokens del sistema; no definen colores nuevos. */
:root, :root[data-theme="dark"] {
  --fondo: var(--bg); --panel: var(--surface); --panel2: var(--surface-subtle); --panel3: var(--surface-hover);
  --borde: var(--border); --borde2: var(--border-strong); --texto: var(--text); --tenue: var(--text-2); --debil: var(--text-3);
  --marca: var(--brand); --marca2: var(--brand-hover); --marca-suave: var(--brand-soft); --oro: var(--accent-text); --oro-suave: var(--accent-soft);
  --ok-suave: var(--ok-soft); --ok-texto: var(--ok-text); --malo: var(--risk); --malo-suave: var(--risk-soft); --malo-texto: var(--risk-text);
  --alerta: var(--missing); --alerta-suave: var(--missing-soft); --alerta-texto: var(--missing-text);
  --espera: var(--pending); --espera-suave: var(--pending-soft); --espera-texto: var(--pending-text);
  --neutro: var(--border-strong); --neutro-suave: var(--surface-subtle); --serif: var(--font);
  --r: var(--radius-lg); --r2: var(--radius-md); --sombra: var(--shadow-sm); --sombra-alta: var(--shadow-md); --foco: 0 0 0 3px var(--focus);
}

/* ---------- tipografía y texto ---------- */
h2 { font-size: var(--text-lg); font-weight: 600; letter-spacing: -.02em; margin: 28px 0 12px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
h2:first-child { margin-top: 0; }
h2 .sub { font-size: 12px; color: var(--text-3); font-weight: 500; margin-left: auto; letter-spacing: 0; }
.k { color: var(--text-3); font-size: 13px; }
.linea { margin: 22px 0 9px; font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.linea::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- controles heredados ---------- */
button { font: inherit; }
:where(button:not(.btn):not(.help__button):not(.subtab):not(.tab):not(.nav-link)) {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--control-height); padding: 10px 16px; border: 1px solid var(--brand-edge);
  border-radius: var(--radius-md); background: var(--brand); color: var(--on-brand);
  font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
:where(button:not(.btn):not(.help__button):not(.subtab):not(.tab):not(.nav-link)):hover { background: var(--brand-hover); color: var(--on-brand-hover); }
/* Acción secundaria con aspecto de enlace (p. ej. «¿Su celular no está registrado?»). */
button.enlace { background: none; border: 0; min-height: 44px; padding: 8px 4px; color: var(--brand-text); font-size: 13px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
button.enlace:hover { background: none; color: var(--text); }
button.sec:not(.btn) { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
button.sec:not(.btn):hover { background: var(--surface-hover); color: var(--text); }
button.ok:not(.btn) { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
button.ok:not(.btn):hover { background: var(--ok-text); color: #fff; }
button.malo:not(.btn) { background: var(--risk); border-color: var(--risk); color: var(--on-risk); }
button.malo:not(.btn):hover { box-shadow: inset 0 0 0 2px currentColor; background: var(--risk); }
button:disabled { background: var(--disabled-bg) !important; border-color: var(--disabled-bg) !important; color: var(--disabled-text) !important; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-gap);
}
.btn-icono { padding: 10px !important; width: 44px; min-width: 44px; }
:where(input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea) {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-md); color: var(--text); background: var(--surface); line-height: 1.4; font: inherit;
}
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }
input:hover:not(:disabled), select:hover:not(:disabled) { border-color: var(--text-2); }
textarea { min-height: 88px; resize: vertical; }
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; color: var(--text); }
.fila { display: flex; gap: 12px; flex-wrap: wrap; }
.fila > * { flex: 1 1 170px; min-width: 0; }
.buscador { position: relative; flex: 2 1 240px; }
.buscador input { padding-left: 38px; }
.buscador::before { content: ""; position: absolute; left: 13px; top: 50%; width: 14px; height: 14px; transform: translateY(-55%);
  border: 1.7px solid var(--text-3); border-radius: 50%; box-shadow: 4px 4px 0 -2px var(--text-3); }

/* ---------- superficies ---------- */
.tarjeta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.aviso { display: block; padding: 12px 14px; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--border); font-size: 13px; margin: 12px 0; }
.aviso:has(> svg.icon) { display: flex; gap: 10px; align-items: flex-start; }
.aviso.error { background: var(--risk-soft); color: var(--risk-text); border-color: var(--risk); }
.aviso.alerta { background: var(--missing-soft); color: var(--missing-text); border-color: var(--missing); }
.aviso.ok, .aviso.bien { background: var(--ok-soft); color: var(--ok-text); border-color: var(--ok); }

/* ---------- pestañas heredadas ---------- */
.tabs:not(.tabs--sistema) { display: flex; gap: 4px; background: var(--surface-subtle); border-radius: 8px; padding: 4px; overflow: auto; width: fit-content; max-width: 100%; border: 0; margin-bottom: 16px; scrollbar-width: none; }
.tabs:not(.tabs--sistema) button { background: transparent; min-height: 40px; padding: 8px 14px; border: 1px solid transparent; border-radius: 6px; color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; flex: 0 0 auto; }
.tabs:not(.tabs--sistema) button:hover { background: var(--surface-hover); color: var(--text); }
.tabs:not(.tabs--sistema) button.activa { background: var(--surface); color: var(--brand-text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.tabs .contador { display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 6px; border-radius: 5px; font-size: 11px; background: var(--missing-soft); color: var(--missing-text); font-weight: 700; }
.subtabs:not(.menor) { display: flex; gap: 4px; background: var(--surface-subtle); border-radius: 8px; padding: 4px; overflow: auto; width: fit-content; max-width: 100%; margin: 0 0 20px; border: 0; }
.subtabs:not(.menor) button { background: transparent; min-height: 44px; padding: 8px 14px; border: 1px solid transparent; border-radius: 6px; color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; flex: 0 0 auto; }
.subtabs:not(.menor) button:hover { background: var(--surface-hover); }
.login-form .subtabs:not(.menor) { width: 100%; }
.login-form .subtabs:not(.menor) button { flex: 1 1 0; }
.subtabs:not(.menor) button[aria-selected="true"], .subtabs:not(.menor) button.activa { background: var(--surface); color: var(--brand-text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.subtabs.menor { display: flex; gap: 16px; background: transparent; padding: 0; border-radius: 0; width: auto; border-bottom: 1px solid var(--border); margin: 8px 0 16px; overflow: auto; scrollbar-width: thin; }
.subtabs.menor button { min-height: 44px; padding: 10px 2px; color: var(--text-2); border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; font-size: 14px; font-weight: 500; white-space: nowrap; flex: 0 0 auto; }
.subtabs.menor button:hover { color: var(--text); background: transparent; }
.subtabs.menor button.activa { color: var(--brand-text); border-bottom-color: var(--brand-text); font-weight: 600; background: transparent; }
.subtabs.menor .n { display: inline-block; min-width: 20px; padding: 0 5px; margin-left: 6px; border-radius: 5px; background: var(--surface-subtle); color: var(--text-2); font-size: 11px; text-align: center; }

/* ---------- estados: seis, siempre con texto ---------- */
[data-status="aprobado"] { --state: var(--ok); --state-soft: var(--ok-soft); --state-text: var(--ok-text); --on-state: var(--on-ok); }
[data-status="anulado"], [data-status="neutro"] { --state: var(--border-strong); --state-soft: var(--surface-subtle); --state-text: var(--text-2); --on-state: #fff; }
[data-status="lectura"] { --state: var(--missing); --state-soft: var(--missing-soft); --state-text: var(--missing-text); --on-state: var(--on-missing); }
.pastilla { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; padding: 4px 9px; border-radius: var(--radius-sm); font-size: 12px; line-height: 1.4; font-weight: 600; white-space: nowrap; color: var(--state-text, var(--text-2)); background: var(--state-soft, var(--surface-subtle)); }
.pastilla::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--state, var(--text-3)); flex-shrink: 0; }
.p-CONFIRMADO { --state: var(--ok); --state-soft: var(--ok-soft); --state-text: var(--ok-text); }
.p-APROBADO_MANUAL { --state: var(--ok); --state-soft: var(--ok-soft); --state-text: var(--ok-text); }
.p-PENDIENTE { --state: var(--pending); --state-soft: var(--pending-soft); --state-text: var(--pending-text); }
.p-SOSPECHOSO { --state: var(--risk); --state-soft: var(--risk-soft); --state-text: var(--risk-text); }
.p-YA_USADO { --state: var(--used); --state-soft: var(--used-soft); --state-text: var(--used-text); }
.p-NO_ENCONTRADO { --state: var(--missing); --state-soft: var(--missing-soft); --state-text: var(--missing-text); }
.p-ANULADO { --state: var(--border-strong); --state-soft: var(--surface-subtle); --state-text: var(--text-2); }

/* ---------- entrega de un pago (Pagos recibidos) ----------
   Tres estados que se distinguen sin leer: color, icono y borde propios. */
.entrega { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 5px; border: 1px solid; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.entrega svg { flex-shrink: 0; width: 18px; height: 18px; padding: 3px; border-radius: 50%; box-sizing: border-box; }
.entrega--ok { background: var(--ok-soft); color: var(--ok-text); border-color: color-mix(in srgb, var(--ok) 38%, transparent); }
.entrega--ok svg { background: var(--ok); color: var(--on-ok); }
.entrega__ver { margin-left: 3px; padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--ok-text); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); font-variant-numeric: tabular-nums; }
tr.clicable:hover .entrega__ver { background: var(--ok); color: var(--on-ok); border-color: var(--ok); }
.entrega--libre { background: var(--missing-soft); color: var(--missing-text); border-style: dashed; border-color: color-mix(in srgb, var(--missing) 60%, transparent); }
.entrega--libre svg { color: var(--missing); padding: 1px; }
.entrega--manual { background: var(--surface-subtle); color: var(--text-2); border-color: var(--border); }
.entrega--manual svg { background: var(--surface); color: var(--text-2); border: 1px solid var(--border); }

/* ---------- indicadores ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 12px 18px 14px; position: relative; display: flex; flex-direction: column; min-height: 104px; min-width: 0; }
.kpi .r { font-size: 13px; color: var(--text-2); font-weight: 500; min-height: 36px; display: flex; align-items: center; padding-right: 26px; }
.kpi .n { font-size: 28px; font-weight: 600; line-height: 1.12; font-variant-numeric: tabular-nums; letter-spacing: -.04em; margin: 2px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .n.larga { font-size: 22px; }
.kpi .d { font-size: 12px; color: var(--text-3); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kpi.k-ok { border-top: 3px solid var(--ok); }
.kpi.k-malo { border-top: 3px solid var(--risk); }
.kpi.k-alerta { border-top: 3px solid var(--missing); }
.kpi.filtrable { cursor: pointer; }
.kpi.filtrable:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.kpi .ver { position: absolute; right: 14px; top: 12px; font-size: 11px; color: var(--text-3); opacity: 0; transition: opacity var(--duration-fast); }
.kpi.filtrable:hover .ver, .kpi.filtrable:focus-visible .ver { opacity: 1; }
.kpi .ayuda { position: absolute; right: 8px; top: 6px; }

/* ---------- tablas ---------- */
/* ---------- recorrido guiado ----------
   El fondo se oscurece y lo que se esta explicando queda a la vista. El truco
   es la sombra: un hueco del tamano del elemento con una sombra enorme
   alrededor oscurece TODO menos ese hueco, sin tener que tocar el z-index de
   la pagina ni mover nada de sitio. Un <dialog> modal no sirve para esto: su
   fondo tapa tambien aquello que se quiere ensenar. */
.tour-foco {
  position: fixed; z-index: 9998; pointer-events: none; border-radius: 10px;
  box-shadow: 0 0 0 9999px rgb(15 23 42 / 62%), 0 0 0 3px var(--accent-text);
  transition: top .35s cubic-bezier(.4,0,.2,1), left .35s cubic-bezier(.4,0,.2,1),
              width .35s cubic-bezier(.4,0,.2,1), height .35s cubic-bezier(.4,0,.2,1);
}
/* Sin objetivo (bienvenida y despedida): se oscurece todo por igual. */
.tour-foco.sin-objetivo { box-shadow: 0 0 0 9999px rgb(15 23 42 / 62%); border-radius: 0; }

.tour-globo {
  position: fixed; z-index: 9999; width: min(380px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 18px 50px rgb(15 23 42 / 28%);
  padding: 18px 20px 14px;
  transition: top .35s cubic-bezier(.4,0,.2,1), left .35s cubic-bezier(.4,0,.2,1);
}
.tour-globo[hidden] { display: none; }
.tour-globo h2 { margin: 6px 0 8px; font-size: 18px; line-height: 1.25; }
.tour-globo p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.tour-globo__paso { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.tour-globo__pie { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.tour-globo__pie .crece { flex: 1 1 auto; }
.tour-globo__pie button { min-height: 44px; white-space: nowrap; }

/* La flechita que ata el globo a lo que senala. */
.tour-globo::after {
  content: ""; position: absolute; width: 12px; height: 12px; background: var(--surface);
  border: 1px solid var(--border); transform: rotate(45deg);
}
.tour-globo[data-lado="abajo"]::after  { top: -7px; left: var(--flecha, 32px); border-right: 0; border-bottom: 0; }
.tour-globo[data-lado="arriba"]::after { bottom: -7px; left: var(--flecha, 32px); border-left: 0; border-top: 0; }
.tour-globo[data-lado="derecha"]::after { left: -7px; top: var(--flecha, 32px); border-right: 0; border-top: 0; }
.tour-globo[data-lado="izquierda"]::after { right: -7px; top: var(--flecha, 32px); border-left: 0; border-bottom: 0; }
.tour-globo[data-lado="centro"]::after { display: none; }

@media (max-width: 760px) {
  /* En un telefono no hay sitio al lado de nada: el globo vive abajo. */
  .tour-globo { width: calc(100vw - 24px); left: 12px !important; top: auto !important;
                bottom: 12px; max-height: 60dvh; overflow: auto; }
  .tour-globo::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-foco, .tour-globo { transition: none; }
}

.envoltorio { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); -webkit-overflow-scrolling: touch; }
.envoltorio table, table.datos { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 560px; }
.envoltorio th { padding: 10px 16px; text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); font-weight: 600; background: var(--surface-subtle); border-bottom: 1px solid var(--border); white-space: nowrap; }
.envoltorio td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.envoltorio tbody tr:last-child td { border-bottom: 0; }
.envoltorio tbody tr:hover td { background: var(--surface-hover); }
/* El motivo puede ocupar varias líneas sin empujar la acción fuera de la tabla. */
#tCola td:nth-child(5) { white-space: normal; overflow-wrap: anywhere; max-width: 340px; }
#tCola td:last-child { white-space: nowrap; }
@media (min-width: 761px) and (max-width: 1100px) {
  #tCola, #tCola tbody, #tCola tr { display: block; min-width: 0; }
  #tCola thead { display: none; }
  #tCola tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  #tCola tr:last-child { border-bottom: 0; }
  #tCola td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; white-space: normal; text-align: right; }
  #tCola td:nth-child(5) { max-width: none; }
  #tCola td::before { content: attr(data-th); color: var(--text-3); font-size: 12px; text-align: left; flex-shrink: 0; }
  #tCola td[data-th=""] { justify-content: flex-end; }
  #tCola td[data-th=""]::before { content: none; }
  #tCola td.vacio { display: block; text-align: center; }
  #tCola td.vacio::before { content: none; }
}
tr.clicable { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.vacio { padding: 36px 18px; text-align: center; color: var(--text-3); font-size: 14px; white-space: normal; }
tr.nuevo td { background: var(--ok-soft); }
.res { display: inline-block; padding: 2px 8px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; background: var(--surface-subtle); color: var(--text-2); }
.res.ingreso { background: var(--ok-soft); color: var(--ok-text); }
.res.duplicado { background: var(--missing-soft); color: var(--missing-text); }
.res.remitente_no_autenticado { background: var(--risk-soft); color: var(--risk-text); }
.res.sin_sede { background: var(--risk-soft); color: var(--risk-text); }

/* ---------- gráfico SVG (pagos por día) ---------- */
.grafico { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 16px 8px; box-shadow: var(--shadow-sm); position: relative; }
.grafico svg { width: 100%; height: auto; display: block; overflow: visible; }
.grafico .barra { fill: var(--accent-text); transition: opacity var(--duration-fast); }
.grafico .barra.apagada { opacity: .35; }
.grafico .barra.maxima { fill: var(--brand-text); }
.grafico .eje { stroke: var(--border-strong); stroke-width: 1; }
.grafico .rejilla { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.grafico text { fill: var(--text-3); font-size: 11px; font-family: inherit; }
.grafico .etiqueta { fill: var(--text); font-weight: 600; font-size: 11.5px; }
.grafico .toca { fill: transparent; }
.tooltip.flotante { position: absolute; pointer-events: none; display: block; width: auto; background: var(--text); color: var(--surface); padding: 8px 11px; border-radius: 8px; font-size: 12.5px; line-height: 1.4; box-shadow: var(--shadow-md); transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; opacity: 0; transition: opacity var(--duration-fast); z-index: 5; border: 0; top: auto; right: auto; }
.tooltip.flotante.visible { opacity: 1; }

/* ---------- caja (veredicto heredado, por si algo lo usa) ---------- */
#zonaCajero { max-width: var(--cash-max); margin: 0 auto; }
.razones { margin: 14px 0 0; padding: 0; list-style: none; font-size: 13px; }
.razones li { padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 6px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.razones .pts { color: var(--text-3); font-variant-numeric: tabular-nums; font-weight: 600; }
.razones .pos { color: var(--ok-text); }
.razones .neg { color: var(--risk-text); }
.cargando { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 900ms linear infinite; vertical-align: -3px; }

/* ---------- diálogos heredados ---------- */
dialog:not(.dialog) { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 24px; width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto; box-shadow: var(--shadow-dialog); }
dialog::backdrop { background: var(--overlay); }
#dlgDetalle { width: min(1040px, calc(100vw - 48px)); }
.detalle { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 24px; }
.comprobante { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; }
.comprobante img { max-width: 100%; border-radius: 8px; display: block; margin: 0 auto; cursor: zoom-in; }
.comprobante .sinimg { color: var(--text-3); font-size: 14px; padding: 44px 12px; }
.cotejo { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 0; }
.cotejo th, .cotejo td { padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: normal; word-break: break-word; background: none; text-align: left; }
.cotejo th { width: 32%; color: var(--text-3); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 13px; }
.cotejo td.calza { color: var(--ok-text); font-weight: 600; }
.cotejo td.difiere { color: var(--risk-text); font-weight: 600; }
.historial { list-style: none; margin: 0; padding: 0 0 0 18px; font-size: 13px; border-left: 1px solid var(--border-strong); margin-left: 4px; }
.historial li { position: relative; padding: 0 0 14px; }
.historial li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); position: absolute; left: -22px; top: 6px; }
.historial .cuando { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.historial .motivo { margin-top: 4px; font-style: italic; color: var(--text-2); }
.acciones:not(td):not(th) { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; justify-content: flex-end; }
.acciones:not(td):not(th) button { flex: 0 1 auto; }
td.acciones, th.acciones { text-align: right; white-space: nowrap; }
td.acciones button { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.candidatos { margin-top: 8px; }
.candidatos .cand { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.candidatos .cand .m { font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.candidatos .cand .d { font-size: 12.5px; color: var(--text-3); flex: 1 1 200px; }

/* ---------- notificaciones ---------- */
#toasts { position: fixed; right: 24px; bottom: 24px; z-index: var(--z-toast); width: min(420px, calc(100% - 32px)); display: grid; gap: 8px; }
#toasts .toast { border-left: 4px solid var(--border-strong); }
#toasts .toast.ok { border-left-color: var(--ok); }
#toasts .toast.malo { border-left-color: var(--risk); }

/* ---------- modo lectura, clasificar, revisar (herramientas de soporte) ---------- */
.campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.campo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; position: relative; }
.campo .k { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.campo .v { font-size: 20px; font-weight: 600; line-height: 1.2; margin-top: 5px; word-break: break-word; font-variant-numeric: tabular-nums; }
.campo .v.nulo { color: var(--text-3); font-style: italic; font-weight: 400; font-size: 15px; }
.campo.bien { border-left: 4px solid var(--ok); }
.campo.dudoso { border-left: 4px solid var(--missing); }
.campo.nada { border-left: 4px solid var(--border-strong); }
.medidor { height: 6px; background: var(--surface-hover); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.medidor i { display: block; height: 100%; background: var(--ok); }
.medidor i.medio { background: var(--missing); }
.medidor i.bajo { background: var(--risk); }
.texto-crudo { font: 12px/1.5 var(--font-mono); white-space: pre-wrap; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; max-height: 260px; overflow: auto; color: var(--text-2); }
.dos { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 18px; }
.mapa { position: relative; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.mapa canvas { width: 100%; height: auto; display: block; cursor: crosshair; }
.mapa .leyenda { display: flex; gap: 10px; flex-wrap: wrap; padding: 8px 10px; font-size: 12px; color: var(--text-3); border-top: 1px solid var(--border); background: var(--surface); }
.mapa .leyenda i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -2px; margin-right: 4px; }
.mapa .tip { position: absolute; pointer-events: none; background: var(--text); color: var(--surface); padding: 6px 9px; border-radius: 7px; font-size: 12px; white-space: nowrap; opacity: 0; transform: translate(-50%, calc(-100% - 8px)); z-index: 3; }
.mapa .tip.visible { opacity: 1; }
.opciones { display: flex; gap: 6px; flex-wrap: wrap; }
.opciones button { padding: 8px 12px; font-size: 13px; min-height: 40px; }
.opciones button.activa { background: var(--brand); color: var(--on-brand); border-color: var(--brand-edge); }
.clasif { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 18px; max-width: 1180px; margin: 0 auto; }
.clasif .foto { background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-md); display: flex; align-items: flex-start; justify-content: center; min-height: 320px; overflow: auto; max-height: 82vh; }
.clasif .foto img { max-width: 100%; height: auto; display: block; cursor: zoom-in; }
.clasif .foto img.grande { max-width: none; width: 180%; cursor: zoom-out; }
.tecla { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; font: 600 12px/1.4 var(--font-mono); background: var(--surface); color: var(--text-2); margin-right: 6px; }
.tipos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tipos button { text-align: left; padding: 12px; font-size: 14px; line-height: 1.3; justify-content: flex-start; display: block; }
.tipos button.activa { background: var(--brand); color: var(--on-brand); border-color: var(--brand-edge); }
.tipos button.activa .tecla { background: rgba(255, 255, 255, .18); color: inherit; border-color: transparent; }
.propuesta { font-size: 13px; color: var(--text-2); background: var(--surface-subtle); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.puntaje { display: inline-block; padding: 1px 7px; border-radius: 4px; font: 600 12px/1.6 var(--font-mono); background: var(--surface-subtle); }
.puntaje.alto { color: var(--ok-text); } .puntaje.medio { color: var(--missing-text); } .puntaje.bajo { color: var(--risk-text); }
.progreso { height: 8px; background: var(--surface-hover); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progreso i { display: block; height: 100%; background: var(--brand-text); }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ficha-rev { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
.ficha-rev .img { background: var(--surface-subtle); height: 260px; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: zoom-in; }
.ficha-rev .img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ficha-rev .cuerpo { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ficha-rev .lee { display: flex; gap: 6px; flex-wrap: wrap; }
.ficha-rev .lee span { padding: 3px 8px; border-radius: 5px; font: 600 13px/1.4 var(--font-mono); background: var(--surface-subtle); }
.ficha-rev .lee span.ok { background: var(--ok-soft); color: var(--ok-text); }
.ficha-rev .lee span.nulo { background: var(--risk-soft); color: var(--risk-text); font-weight: 500; }
.ficha-rev .campos-rev { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.ficha-rev .campos-rev input { padding: 7px 8px; font-size: 13px; min-height: 36px; }
.ficha-rev .acc { display: flex; gap: 6px; }
.ficha-rev .acc button { padding: 7px 10px; font-size: 12.5px; flex: 1; min-height: 40px; }
.ficha-rev.hecha { opacity: .45; }

/* ---------- correo y configuración ---------- */
.escucha { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.escucha .luz { width: 12px; height: 12px; border-radius: 50%; background: var(--risk); box-shadow: 0 0 0 4px var(--risk-soft); flex-shrink: 0; }
.escucha .luz.viva { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.escucha .datos { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.escucha .datos b { color: var(--text); }
.prueba { margin-top: 12px; font-size: 13px; }
.prueba ul { margin: 6px 0 0; padding-left: 18px; }
button.proveedor { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; width: 100%; justify-content: flex-start; }
button.proveedor .logo { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; background: var(--surface-subtle); color: var(--text); flex: 0 0 auto; }
button.proveedor small { color: inherit; opacity: .8; }
.regla { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.regla:last-child { border-bottom: none; }
.regla .n { font-weight: 600; font-size: 14px; }
.regla .d { font-size: 12.5px; color: var(--text-3); margin-top: 2px; max-width: 70ch; }
.regla .f { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.regla input[type=number] { text-align: right; }
.regla.cambiada .n::after { content: " · cambiada"; color: var(--missing-text); font-size: 11px; font-weight: 600; }
.sistema { margin: 0; }
.sistema dt { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-top: 12px; font-weight: 600; }
.sistema dd { margin: 2px 0 0; font-size: 14px; }
.rolchip { display: inline-block; padding: 3px 9px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; background: var(--brand-soft); color: var(--brand-text); }
.punto { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); display: inline-block; }
.punto.ok { background: var(--ok); }
.punto.mal { background: var(--risk); animation: latido 1.4s infinite; }
@keyframes latido { 50% { opacity: .4; } }
.refresco { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.refresco button { padding: 6px 12px; font-size: 12px; min-height: 36px; }
.pie-comproval { text-align: center; font-size: 11px; color: var(--text-3); padding: 18px 0 6px; }
details.plegable > summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 10px 0; color: var(--text-2); }

/* ---------- cascarón propio ---------- */
.overview-row > .finance-hero { align-self: start; }
.overview-row > .card > .envoltorio table { min-width: 0; }
.app-cuerpo { min-height: 100dvh; }
.sidebar .nav-link { width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer; font-family: inherit; }
.bottom-nav a, .bottom-nav button { font-family: inherit; background: transparent; border: 0; cursor: pointer; }
@media (max-width: 760px) {
  .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 8px; min-width: 60px; min-height: 60px; color: var(--text-3); font-size: 10px; font-weight: 500; text-decoration: none; border-radius: 8px; flex: 1; }
  .bottom-nav button[aria-current="page"] { color: var(--brand-text); background: var(--brand-soft); }
  .bottom-nav button .icon { width: 22px; height: 22px; }
  .page-title__actions .btn { white-space: nowrap; }
}
.nav-link .icon { width: 20px; height: 20px; }
/* Con logo propio, el cuadro deja de ser un cuadrado de color: se vuelve un
   marco neutro que se adapta al ancho del logo y lo centra sin recortarlo ni
   deformarlo. Es flex y no grid a proposito: en una cuadricula la altura en
   porcentaje de la imagen no se respeta, la fila crece al tamano real del
   archivo y un logo de 2000 px se salia del recuadro y tapaba el nombre.
   El servidor ya lo entrega sin margen vacio (app/api/marca.py), y el portal
   marca su forma (data-forma) para darle el recuadro que le sirve. */
.merchant__mark.con-logo { display: flex; align-items: center; justify-content: center; overflow: hidden; width: auto; min-width: 40px; max-width: 150px; height: 40px; padding: 4px 6px; background: #fff; border-color: var(--border); color: var(--text); }
.merchant__mark.con-logo img { display: block; flex: 0 1 auto; min-width: 0; width: auto; height: 100%; max-width: 100%; object-fit: contain; border-radius: 0; background: transparent; }
.mobile-header .merchant__mark.con-logo { height: 34px; max-width: 120px; }
.login-story .merchant__mark.con-logo { height: 56px; max-width: 220px; padding: 6px 8px; }
.cash-header .merchant__mark.con-logo { height: 40px; max-width: 140px; }
:root[data-theme="dark"] .merchant__mark.con-logo { background: #fff; }
.merchant > div { min-width: 0; }
.merchant__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* En la barra lateral el ancho es corto: con logo, el nombre va debajo. */
.sidebar .merchant:has(.con-logo) { flex-direction: column; align-items: flex-start; gap: 10px; }
.sidebar .merchant__mark.con-logo { max-width: 180px; height: 44px; }
/* Horizontal: todo el ancho y poca altura. Mediano y cuadrado: mas altos,
   porque a 44 px de alto un logo cuadrado quedaria de 44 x 44. */
.sidebar .merchant__mark.con-logo[data-forma="medio"] { height: 64px; }
.sidebar .merchant__mark.con-logo[data-forma="cuadrado"] { height: 64px; }
.login-story .merchant__mark.con-logo[data-forma="cuadrado"] { height: 72px; }
.mobile-header .merchant__mark.con-logo, .cash-header .merchant__mark.con-logo { max-width: 110px; }
.mas-lista { display: grid; gap: 4px; }
.mas-lista button { justify-content: flex-start; text-align: left; width: 100%; min-height: 48px; }
.mas-lista .nav-link { font-size: 15px; }

/* refinamientos móviles de las vistas heredadas */
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 10px 12px 12px; min-height: 92px; }
  .kpi .n { font-size: 24px; }
  .kpi .r { font-size: 12px; min-height: 32px; }
  .fila > * { flex: 1 1 100%; }
  .envoltorio th, .envoltorio td { padding: 10px 12px; }
  .envoltorio table { min-width: 0; }
  .detalle, .dos, .clasif { grid-template-columns: 1fr; }
  dialog:not(.dialog) { padding: 16px; width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  #dlgDetalle { width: calc(100vw - 24px); }
  .acciones { position: sticky; bottom: 0; background: var(--surface); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .acciones button { flex: 1 1 100%; }
  #toasts { bottom: 88px; right: 16px; }
  input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea { font-size: 16px; }
  .regla { grid-template-columns: 1fr; }
  .tipos { grid-template-columns: 1fr; }
}
@media (max-width: 380px) { .kpis { grid-template-columns: 1fr; } }

.dialog__head h2:focus, .dialog__head h3:focus { outline: none; box-shadow: none; }
.progreso i.alerta { background: var(--missing); } .progreso i.malo { background: var(--risk); }

/* ---------- primeros pasos y planes ---------- */
.pasos-inicio { display: grid; gap: 10px; }
.paso-inicio { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.paso-inicio.siguiente { border-color: var(--brand-edge); box-shadow: 0 0 0 3px var(--brand-soft); }
.paso-inicio.hecho { opacity: .8; } .paso-inicio.omitido { opacity: .6; }
.paso-num { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-subtle); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; color: var(--text-2); }
.paso-num .icon { width: 18px; height: 18px; }
.paso-inicio.hecho .paso-num { background: var(--ok-soft); color: var(--ok-text); }
.paso-inicio.siguiente .paso-num { background: var(--brand); color: var(--on-brand); }
.paso-cuerpo { flex: 1; min-width: 0; } .paso-titulo { font-weight: 600; }
.paso-acciones { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.paso-acciones button { padding: 8px 12px; font-size: 13px; min-height: 40px; }
.planes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.plan.actual { border-color: var(--brand-edge); box-shadow: 0 0 0 3px var(--brand-soft); }
.plan-lista { list-style: none; padding: 0; margin: 12px 0; font-size: 13px; display: grid; gap: 6px; }
.plan-lista li { display: flex; gap: 8px; } .plan-lista li::before { content: "✓"; color: var(--ok); font-weight: 700; }
.nav-link.bloqueada, .subtabs button.bloqueada { opacity: .55; }
.nav-link.bloqueada > span:first-of-type::after, .subtabs button.bloqueada::after { content: " 🔒"; font-size: 11px; }
@media (max-width: 760px) { .paso-inicio { flex-wrap: wrap; } .paso-acciones { width: 100%; justify-content: flex-start; } }

/* ---------- celular: tablas como tarjetas, comparacion apilada, pestañas con pista ---------- */
@media (max-width: 760px) {
  /* Las tablas que genera tabla() llevan data-th en cada celda: en celular se
     leen como tarjetas, sin desplazamiento horizontal. Estado y monto
     quedan visibles sin abrir nada. */
  .envoltorio table:has(td[data-th]) { display: block; min-width: 0; }
  .envoltorio table:has(td[data-th]) thead { display: none; }
  .envoltorio table:has(td[data-th]) tbody, .envoltorio table:has(td[data-th]) tr { display: block; }
  .envoltorio table:has(td[data-th]) tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .envoltorio table:has(td[data-th]) tr:last-child { border-bottom: 0; }
  .envoltorio table:has(td[data-th]) td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: 0; white-space: normal; text-align: right; }
  .envoltorio table:has(td[data-th]) td::before { content: attr(data-th); color: var(--text-3); font-size: 12px; font-weight: 500; text-align: left; flex-shrink: 0; }
  .envoltorio table:has(td[data-th]) td[data-th=""]::before { content: none; }
  .envoltorio table:has(td[data-th]) td[data-th=""] { justify-content: flex-end; }
  .envoltorio table:has(td[data-th]) td.vacio { display: block; text-align: center; }
  .envoltorio table:has(td[data-th]) td.vacio::before { content: none; }
  .envoltorio table:has(td[data-th]) tr.clicable:hover td { background: transparent; }
  .envoltorio table:has(td[data-th]) tr.clicable:hover { background: var(--surface-hover); }
  /* Ficha: comprobante contra banco, apilado */
  .cotejo, .cotejo tbody, .cotejo tr { display: block; }
  .cotejo thead { display: none; }
  .cotejo tr { padding: 8px 0; border-bottom: 1px solid var(--border); }
  .cotejo th { display: block; width: auto; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); border: 0; padding: 0 0 4px; }
  .cotejo td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; }
  .cotejo td::before { content: attr(data-th); color: var(--text-3); font-weight: 500; }
  /* Sub-pestañas: se ve que hay más a la derecha */
  .subtabs:not(.menor) { width: 100%; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); scroll-snap-type: x proximity; }
  .subtabs:not(.menor) button { scroll-snap-align: start; }
  .subtabs.menor { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
}


/* ---------- configuracion como menu (celular), ayuda de KPI por toque, ficha ---------- */
.subtabs .desc { display: none; }
.kpi .kpi-ayuda { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; min-height: 0; border-radius: 50%; padding: 0; font-size: 13px; font-weight: 700; background: var(--surface-subtle); color: var(--text-3); border: 1px solid transparent; }
.kpi .kpi-ayuda:hover { color: var(--text); background: var(--surface-hover); }
.kpi .kpi-tip { display: none; position: absolute; left: 8px; right: 8px; top: calc(100% - 6px); z-index: var(--z-tooltip); padding: 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); font-size: 13px; font-weight: 400; line-height: 1.45; }
.kpi.ayuda-abierta .kpi-tip, .kpi:has(.kpi-ayuda:focus-visible) .kpi-tip { display: block; }
.kpi.ayuda-abierta { z-index: 6; }
.kpi .ver { right: 44px; }
@media (max-width: 760px) {
  #pConfig.menu .subtabs { display: grid; gap: 8px; width: 100%; background: transparent; padding: 0; border: 0; margin: 0; -webkit-mask-image: none; mask-image: none; }
  #pConfig.menu .subtabs button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 60px; padding: 12px 40px 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); position: relative; text-align: left; white-space: normal; box-shadow: var(--shadow-sm); }
  #pConfig.menu .subtabs button::after { content: "›"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--text-3); }
  #pConfig.menu .subtabs button .t { font-size: 15px; font-weight: 600; }
  #pConfig.menu .subtabs button .desc { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; }
  #pConfig.menu .subtabs button.activa { background: var(--surface); color: var(--text); border-color: var(--border); }
  #pConfig:not(.menu) .subtabs { display: none; }
  /* Ficha: primero la decision y la comparacion, despues la evidencia. */
  .detalle > div:first-child { order: 2; }
  .comprobante img { max-height: 60vh; object-fit: contain; }
}

/* ---------- claridad operativa y configuración guiada ---------- */
.summary-period { color: var(--text-3); font-size: 13px; margin-bottom: 12px; }
.page-title { flex-wrap: wrap; }
.page-title > div:first-child { min-width: 0; flex: 1 1 240px; }
.page-title__actions { flex-wrap: wrap; max-width: 100%; }
#pResumen { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 1.6fr); gap: 16px 20px; }
#pResumen .summary-period { grid-column: 1 / -1; grid-row: 1; margin: 0; }
#pResumen .kpis { grid-column: 1 / -1; grid-row: 2; }
#pResumen .finance-hero { grid-column: 1; grid-row: 3; align-self: start; }
#pResumen .recent-payments { grid-column: 2; grid-row: 3; }
#avisoConexion { margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
#avisoConexion .grow { min-width: 200px; }
#pResumen .kpi .kpi-ayuda { width: 44px; height: 44px; min-height: 44px; right: 4px; top: 4px; }
#pResumen .kpi .r { padding-right: 38px; }
.table-open { background: transparent !important; color: var(--brand-text) !important; border: 0 !important; text-align: left; padding: 4px 0 !important; min-height: 44px; display: block !important; }
.table-open:hover { text-decoration: underline; }
.regla label.n { margin: 0; }
input[type="file"] { display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 44px; color: var(--text-2); }
input[type="file"]::file-selector-button { font: inherit; min-height: 44px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 12px; background: var(--surface); color: var(--text); margin-right: 8px; cursor: pointer; }
.setup-section-title { margin: 12px 0 0; }
.paso-inicio { flex-wrap: wrap; }
.paso-inicio.hecho, .paso-inicio.omitido { opacity: 1; }
.paso-titulo { font-size: 16px; }
.paso-acciones button { min-height: 44px; }
.setup-status { display: inline-block; font-size: 12px; color: var(--text-2); margin: 4px 0; }
.paso-inicio.hecho .setup-status { color: var(--ok-text); }
.setup-guide { flex: 1 1 100%; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.setup-guide summary { min-height: 44px; padding: 10px 0; cursor: pointer; color: var(--brand-text); font-weight: 600; font-size: 14px; }
.setup-instructions { padding-left: 24px; font-size: 14px; line-height: 1.6; list-style: revert; }
.setup-instructions li { margin: 10px 0; }
.setup-troubleshoot { padding: 12px; border-radius: 8px; background: var(--surface-subtle); margin: 12px 0 0; }
.setup-help { margin-top: 20px; }
@media (max-width: 1000px) {
  #pResumen { display: flex; flex-direction: column; }
  .page-title__actions { width: 100%; }
}
@media (max-width: 760px) {
  #pResumen .recent-payments tbody tr:nth-child(n+4) { display: none; }
  #avisoConexion .btn { width: 100%; }
  .page-title__actions { width: 100%; flex-wrap: wrap; }
  .page-title__actions .btn { flex: 1 1 150px; }
  .paso-cuerpo { flex-basis: calc(100% - 52px); }
  .paso-acciones { width: 100%; }
  .paso-acciones button { flex: 1 1 130px; }
}

/* ---- contraseña: ver / ocultar y aviso de mayúsculas ---- */
.clave-caja { position: relative; display: block; }
.clave-caja > input { width: 100%; padding-right: 48px; }
.clave-ojo { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; min-height: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--text-3); cursor: pointer; box-shadow: none; }
.clave-ojo:hover { color: var(--text); background: var(--surface-hover); }
.clave-ojo:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.clave-ojo svg { width: 20px; height: 20px; }
.clave-mayus { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--pending-text); }
.clave-mayus[hidden] { display: none; }
