/* ═══════════════════════════════════════════════════════════════════════════
   InmoPagos — la hoja de estilo entera.
   Los colores y las tipografías salen del programa de escritorio que RITOFA ya
   usa; lo que cambia es el orden: seis tamaños de letra, dos radios, y nada
   por debajo de 11 px.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg:#f0f3f8; --surface:#fff; --surface2:#f7f9fc; --line:#dde5f0; --line2:#eef2f8;
  --text:#0d1f33; --text2:#3a4a5c; --text3:#627082;
  --navy:#0f2942; --navy2:#1e3d5c; --navylt:#e8edf5; --gold:#c9a84c; --ritofa:#035e81;
  --success:#1a7a4a; --successbg:#e8f5ee;
  --warn:#9a640b; --warnbg:#fef3e2;
  --danger:#c0392b; --dangerbg:#fde8e8;
  --teal:#1a7a6e; --tealbg:#e8f5f3;
  --purple:#6c3483; --purplebg:#f0e8f8;
  --sh:0 2px 12px rgba(15,41,66,.09);
  --sh2:0 16px 48px rgba(15,41,66,.22);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: 'Sora', system-ui, sans-serif; font-size: 14px; color: var(--text);
       background: var(--bg); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button { font-family: inherit; }
h1, h2 { margin: 0; letter-spacing: -.01em; }

.cifra { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.etiqueta { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--text3); font-weight: 600; }
.menor { font-size: 12px; color: var(--text3); }
.suave { color: var(--text2); }
.fuerte { font-weight: 700; }
.der { text-align: right; }
.nom { font-weight: 500; }

/* ── botones y campos ─────────────────────────────────────────────────────── */
.btn { height: 36px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface);
       color: var(--text); font-size: 14px; padding: 0 14px; cursor: pointer;
       display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { border-color: var(--text3); }
.btn:disabled { opacity: .5; cursor: default; }
.btnp { height: 36px; border-radius: 6px; border: 1px solid transparent; background: var(--navy);
        color: #fff; font-size: 14px; font-weight: 600; padding: 0 16px; cursor: pointer;
        display: inline-flex; align-items: center; gap: 8px; }
.btnp:hover { background: var(--navy2); }
.btnp:disabled { opacity: .5; cursor: default; }
.btnPeligro { height: 36px; border-radius: 6px; border: 1px solid transparent; background: var(--danger);
              color: #fff; font-size: 14px; font-weight: 600; padding: 0 16px; cursor: pointer; }
.btnPeligro:hover { background: #a5311f; }
.campo { height: 36px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface);
         color: var(--text); font-family: inherit; font-size: 14px; padding: 0 10px; width: 100%; }
.campo:focus { outline: 2px solid var(--teal); outline-offset: -1px; }
textarea.campo { height: auto; }
.pastilla { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 20px;
            font-size: 12px; font-weight: 600; }
.pastilla.mini { height: 20px; padding: 0 7px; font-size: 12px; margin-left: 6px; }
.punto { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; display: inline-block; }
.bolita { width: 9px; height: 9px; border-radius: 50%; display: block; }
.proy { display: inline-flex; align-items: center; gap: 7px; }

/* ── la pantalla de entrar ────────────────────────────────────────────────── */
.pantalla { min-height: 100vh; background: var(--navy); position: relative; overflow: hidden;
            display: flex; flex-direction: column; }
.resplandor { position: absolute; top: 20px; left: 50%; width: 780px; height: 780px; margin-left: -390px;
              border-radius: 50%; pointer-events: none;
              background: radial-gradient(circle, rgba(34,161,146,.16) 0%, rgba(15,41,66,0) 62%); }
.centro { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center;
          justify-content: center; padding: 40px 20px 24px; }
.sello { display: flex; align-items: center; gap: 11px; padding: 8px 18px 8px 8px; border-radius: 30px;
         background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); }
.logoGrande { display: block; margin-top: 26px; }
.nombre { color: #fff; font-size: 72px; font-weight: 800; letter-spacing: -.035em; line-height: 1;
          margin-top: 20px; text-align: center; }
.lema { color: var(--gold); font-size: 16px; font-weight: 500; letter-spacing: .1em; margin-top: 13px; text-align: center; }
.frase { color: #aebccd; font-size: 16px; line-height: 1.6; margin: 22px 0 0; max-width: 600px;
         text-align: center; text-wrap: pretty; }
.acceso { width: 100%; max-width: 420px; background: #fff; border-radius: 12px;
          box-shadow: 0 18px 50px rgba(0,0,0,.34); padding: 26px; margin-top: 32px; }
.google { height: 52px; width: 100%; border-radius: 6px; border: 1px solid var(--line); background: #fff;
          font-size: 15px; font-weight: 500; color: var(--text); cursor: pointer;
          display: flex; align-items: center; justify-content: center; gap: 12px; }
.google:hover { border-color: var(--text3); }
.google:disabled { opacity: .55; cursor: default; }
.cimiento { position: relative; background: rgba(0,0,0,.20); border-top: 1px solid rgba(255,255,255,.10);
            padding: 22px 56px 26px; }
.cimientoCabeza { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.totales { display: flex; gap: 30px; flex-wrap: wrap; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 15px; }
.proyecto { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 8px; background: rgba(255,255,255,.05); }
.aviso { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 8px;
         font-size: 13px; line-height: 1.5; }
.aviso.ok { background: var(--tealbg); color: #12554c; border: 1px solid #a8d8d0; }
.aviso.malo { background: var(--dangerbg); color: #8c2c20; border: 1px solid #efb4ae; }
.aviso.duda { background: var(--warnbg); color: #6d4707; border: 1px solid #e3c184; }

/* ── el armazón del programa ──────────────────────────────────────────────── */
.marco { display: flex; min-height: 100vh; }
.lateral { width: 216px; flex-shrink: 0; background: var(--navy); display: flex; flex-direction: column;
           padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.marcaLateral { display: flex; align-items: center; gap: 11px; padding: 0 6px 18px; }
.marcaLateral img { display: block; flex-shrink: 0; }
.nombrePrograma { color: #fff; font-weight: 700; font-size: 19px; letter-spacing: -.02em; line-height: 1; }
.marcaEmpresa { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.marcaEmpresa img { border-radius: 3px; }
.marcaEmpresa span { color: #c3d1e2; font-size: 12px; font-weight: 700; letter-spacing: .09em; }
.menu { display: flex; flex-direction: column; gap: 2px; }
.nav { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border: 0;
       border-radius: 6px; background: transparent; color: #c7d4e4; cursor: pointer; font-size: 14px;
       width: 100%; text-align: left; }
.nav:hover { background: var(--navy2); color: #fff; }
.nav.activo { background: var(--navy2); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--gold); }
.nav span { flex-grow: 1; }
.globo { background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; border-radius: 20px;
         padding: 2px 8px; flex-grow: 0 !important; }
.pieLateral { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.conexion { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 6px;
            background: rgba(255,255,255,.06); color: #c7d4e4; font-size: 13px; }
.conexion.sinRed { background: rgba(183,119,13,.2); border: 1px solid rgba(214,154,44,.5); color: #f0d190; }
.luz { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.luz.verde { background: #3fb07a; } .luz.ambar { background: #e5b45a; }
.yo { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy2); color: #fff;
          display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.yoNombre { color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yoRol { color: #c3d1e2; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.salir { background: transparent; border: 0; color: #8fa6bd; cursor: pointer; padding: 4px; flex-shrink: 0; }
.salir:hover { color: #fff; }
.contenido { flex-grow: 1; min-width: 0; }
.menuChico { display: none; position: fixed; left: 14px; bottom: 14px; z-index: 40; width: 46px; height: 46px;
             border-radius: 50%; border: 0; background: var(--navy); color: #fff; box-shadow: var(--sh2); cursor: pointer; }

/* ── cabecera y cuerpo de cada pantalla ───────────────────────────────────── */
.cabecera { padding: 20px 28px 16px; border-bottom: 1px solid var(--line); background: var(--surface);
            position: sticky; top: 0; z-index: 5; }
.filaCabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cabecera h1 { font-size: 20px; font-weight: 700; }
.sub { color: var(--text3); font-size: 13px; margin-top: 3px; }
.datosCliente { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 6px; }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; }
.cuerpo { padding: 18px 28px 32px; }
.vacio { color: var(--text3); font-size: 14px; line-height: 1.6; padding: 34px 4px; text-align: center; }
.volver { display: inline-flex; align-items: center; gap: 8px; color: var(--text3); font-size: 13px; cursor: pointer; }
.volver:hover { color: var(--teal); }
.subtitulo { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--text3);
             font-weight: 600; padding: 16px 8px 8px; border-top: 1px solid var(--line2); margin-top: 8px; }
.buscador { position: relative; min-width: 240px; flex-grow: 1; max-width: 340px; }
.buscador .lupa { position: absolute; left: 11px; top: 9px; color: var(--text3); }
.buscador .campo { padding-left: 34px; }

.chips { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.chip { height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border-radius: 20px;
        border: 1px solid var(--line); background: var(--surface); color: var(--text2); font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--text3); }
.chip.sel { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.chip .n { opacity: .7; }
.chip.fino { height: 28px; font-size: 12px; }
.separador { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

/* ── tablas ───────────────────────────────────────────────────────────────── */
.tabla { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh); overflow: hidden; }
.tabla table, table.fino { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; font-size: 12px; letter-spacing: .05em; text-transform: uppercase;
            color: var(--text3); font-weight: 600; padding: 12px 10px 10px; border-bottom: 1px solid var(--line); }
.tabla th:first-child, .tabla td:first-child { padding-left: 18px; }
.tabla th:last-child, .tabla td:last-child { padding-right: 18px; }
.tabla td { padding: 12px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr[data-id], .tabla tbody tr[data-abrir] { cursor: pointer; }
.tabla tbody tr[data-id]:hover, .tabla tbody tr[data-abrir]:hover { background: var(--surface2); }
table.fino td { padding: 10px 8px; border-bottom: 1px solid var(--line2); }
table.fino tr:last-child td { border-bottom: 0; }

/* ── tarjetas y paneles ───────────────────────────────────────────────────── */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.tarjeta { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 15px 18px; box-shadow: var(--sh); }
.tarjeta.alerta { background: var(--warnbg); border-color: var(--warn); }
.tarjeta.bien { background: var(--successbg); border-color: #b6ddc7; }
.grande { font-size: 21px; font-weight: 500; margin-top: 7px; }
.dos { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; align-items: start; }
.dosCol { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--sh); overflow: hidden; }
.panelCabeza { display: flex; align-items: center; justify-content: space-between; gap: 12px;
               padding: 13px 18px; border-bottom: 1px solid var(--line); }
.titulo { font-size: 16px; font-weight: 600; }
.scroll { max-height: 480px; overflow: auto; }
.piePanel { padding: 12px 18px; font-size: 13px; color: var(--teal); cursor: pointer; border-top: 1px solid var(--line2); }
.linea { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line2); cursor: pointer; }
.linea:hover { background: var(--surface2); }
.linea.apagada { opacity: .6; }
.pista { height: 8px; border-radius: 4px; background: #dbe3ee; margin-top: 8px; overflow: hidden; }
.pista .relleno { height: 8px; border-radius: 4px; background: var(--teal); }
.barraAvance { height: 6px; border-radius: 3px; background: #dbe3ee; margin-top: 16px; overflow: hidden; }
.barraAvance div { height: 6px; border-radius: 3px; background: var(--success); }

/* ── DÓNDE ESTOY AL TABULAR (17-sep-2026) ───────────────────────────────────
   Antes el foco solo se veía en `.campo`. Quien navega con el teclado —o quien
   usa un lector de pantalla— no sabía dónde estaba en el menú, los botones, los
   chips ni las filas de las tablas. Medido: el verde del sistema da 5,18:1
   sobre blanco y 4,66:1 sobre el fondo, pero solo 2,86:1 sobre el azul de la
   barra; por eso ahí el anillo es dorado, que da 6,49:1. El mínimo de la norma
   para un indicador es 3:1.
   Se usa `:focus-visible` y no `:focus` a propósito: así el anillo NO sale al
   hacer clic con el ratón, solo al navegar con el teclado.              */
:root { --foco: var(--teal); --focoOscuro: var(--gold); }

:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--foco);
  outline-offset: 2px;
  border-radius: 6px;
}
.lateral :where(button, a):focus-visible { outline-color: var(--focoOscuro); }
.fondoVentana :where(button, a, input, select, textarea):focus-visible { outline-color: var(--foco); }

/* El campo conserva su marco propio, que es más claro dentro de un formulario. */
.campo:focus-visible { outline: 2px solid var(--foco); outline-offset: -1px; border-radius: 6px; }

/* Quien no ve bien el color: el sistema operativo puede pedir más contraste. */
@media (prefers-contrast: more) {
  :root { --line: #b8c6d8; --line2: #ccd8e8; --text3: #4c5a6b; }
  .tarjeta, .panel, .tabla { border-width: 1px; border-color: #b8c6d8; }
}
/* Y quien pide menos movimiento, lo pide de verdad. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
                           transition-duration: .01ms !important; }
}

/* ── ventanas ─────────────────────────────────────────────────────────────── */
.fondoVentana { position: fixed; inset: 0; background: rgba(13,31,51,.55); z-index: 60;
                display: flex; align-items: center; justify-content: center; padding: 24px; }
.ventana { width: 100%; max-height: 100%; background: var(--surface); border-radius: 12px;
           box-shadow: var(--sh2); display: flex; flex-direction: column; overflow: hidden; }
.ventanaCabeza { padding: 18px 24px; border-bottom: 1px solid var(--line);
                 display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.ventanaCabeza h2 { font-size: 18px; font-weight: 700; }
.cerrar { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface);
          color: var(--text3); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.cerrar:hover { border-color: var(--text3); color: var(--text); }
.ventanaCuerpo { padding: 22px 24px; overflow: auto; }
.ventanaPie { padding: 15px 24px; border-top: 1px solid var(--line); background: var(--surface2);
              display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ── avisos flotantes ─────────────────────────────────────────────────────── */
.avisos { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80;
          display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.avisoFlotante { background: var(--navy); color: #fff; font-size: 14px; padding: 12px 18px; border-radius: 8px;
                 box-shadow: var(--sh2); transition: opacity .35s, transform .35s; max-width: 520px; }
.avisoFlotante.malo { background: var(--danger); }
.avisoFlotante.bien { background: var(--success); }
/* «duda»: ni bien ni mal. Lo usa el archivado en Drive, que puede fallar sin
   que la descarga se pierda: el archivo ya está en el equipo. Sin este color
   salía neutro y se leía como si no hubiera pasado nada. */
.avisoFlotante.duda { background: var(--warn); }
.girando { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line);
           border-top-color: var(--teal); border-radius: 50%; animation: gira .8s linear infinite; vertical-align: -2px; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ── «hay una versión nueva»: la franja fija de arriba (17-nov-2026; ver ui.js) ──
   Mientras está, todo lo fijo de la página baja lo que ella mide (`--altoFranja`, que mide ui.js), igual que
   con la franja del ensayo: si no, taparía la cabecera de la pantalla y la de las ventanas. `--arriba` es lo
   que ya ocupa otra franja encima (0 en el programa; la del ensayo, en el ensayo). */
.franjaVersion { position: fixed; top: var(--arriba, 0px); left: 0; right: 0; z-index: 94; box-sizing: border-box;
                 min-height: 46px; padding: 7px 16px; display: flex; align-items: center; justify-content: center;
                 gap: 8px 16px; flex-wrap: wrap; background: var(--danger); color: #fff; font-size: 14px; font-weight: 600;
                 line-height: 1.3; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.22); }
.franjaVersion button { height: 32px; border-radius: 6px; border: 0; background: #fff; color: var(--danger);
                        font: inherit; font-weight: 700; padding: 0 16px; cursor: pointer; }
.franjaVersion button:hover { background: var(--dangerbg); }
.franjaVersion button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
body.conFranja { padding-top: calc(var(--arriba, 0px) + var(--altoFranja, 46px)); }
body.conFranja .lateral { top: calc(var(--arriba, 0px) + var(--altoFranja, 46px));
                          height: calc(100vh - var(--arriba, 0px) - var(--altoFranja, 46px)); }
body.conFranja .cabecera,
body.conFranja .fondoVentana { top: calc(var(--arriba, 0px) + var(--altoFranja, 46px)); }

/* ── pantallas chicas ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nombre { font-size: 44px; } .logoGrande { width: 88px; height: 88px; }
  .lema { font-size: 13px; } .frase { font-size: 15px; }
  .cimiento { padding: 20px 20px 24px; } .rejilla { grid-template-columns: 1fr; }
  .dos, .dosCol { grid-template-columns: 1fr; }
  .lateral { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%);
             transition: transform .22s; box-shadow: var(--sh2); }
  .lateral.abierta { transform: none; }
  .menuChico { display: block; }
  .cabecera, .cuerpo { padding-left: 16px; padding-right: 16px; }
  .cuerpo { padding-bottom: 80px; }
  .tabla { overflow-x: auto; } .tabla table { min-width: 760px; }
  .nav, .linea, .chip { min-height: 44px; }
}

/* ── al imprimir: solo el documento ───────────────────────────────────────── */
@media print {
  /* ⭐ SOLO SE IMPRIME EL RECIBO.
     Antes esto era una lista NEGRA («oculta la barra, la cabecera, el pie…»), y
     cualquier trozo de pantalla que no estuviera en la lista se colaba en el
     papel. Ahora `imprimirSolo()` (ui.js) marca con `.fueraDeImpresion` TODO lo
     que no es la hoja: sube desde la hoja hasta <body> y apaga a los hermanos de
     cada escalón. Lo que no está en el camino de la hoja, no se imprime. Punto.
     La lista negra se queda debajo como segundo cinturón, por si algo imprime
     sin pasar por ahí.                                                          */
  .fueraDeImpresion { display: none !important; }
  .lateral, .menuChico, .cabecera, .ventanaCabeza, .ventanaPie, .cerrar, .avisos, .noImprimir { display: none !important; }
  .ventana { max-width: none !important; width: auto !important; border-radius: 0 !important; }
  body, .marco, .contenido, .cuerpo, .fondoVentana, .ventana, .ventanaCuerpo {
    background: #fff !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important;
    max-height: none !important; overflow: visible !important; display: block !important; }
  .fondoVentana { position: static !important; }
  .paraImprimir { box-shadow: none !important; }
  .hojaA4 { zoom: 1 !important; width: 190mm !important; height: 277mm !important;
            border: 3px solid var(--rNavy) !important; box-shadow: none !important; }
  .hojaEnvoltura { overflow: visible !important; gap: 0 !important; display: block !important; }
  .hojaA4 + .hojaA4 { page-break-before: always; break-before: page; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
@page { size: A4 portrait; margin: 10mm; }

/* ── ventanas de pago y recibo ─────────────────────────────────────────────── */
.cuadro { border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.rejillaCampos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rejillaCampos label.etiqueta { display: block; margin-bottom: 6px; }
.filaTotal { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--text2); }
.filaTotal.borde { padding-top: 11px; border-top: 1px solid var(--line); color: var(--text); }
.lineaReparto { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line);
                border-radius: 8px; margin-bottom: 8px; }
.rayaCampo { height: 1px; background: var(--line); margin: 18px 0 14px; }

/* ── la hoja del recibo ──────────────────────────────────────────────────────
   Calcada del generador vivo del escritorio y comprobada contra un recibo real
   ya emitido: A4 con margen de 10 mm, marco azul de 190 × 277 mm y, de ahí para
   adentro, milímetros. El formato NO tiene fondos de color: todo es blanco, y
   solo las etiquetas van sobre gris claro.                                    */
:root {
  --rNavy: var(--navy);       /* 15,41,66  — el marco y los títulos           */
  --rGris: #f0f2f5;           /* 240,242,245 — el gris de las etiquetas       */
  --rGris2: #5a5a5a;          /*  90,90,90  — el texto de las etiquetas       */
  --rBorde: #aab4c3;          /* 170,180,195 — la línea de cada celda         */
}
.hojaEnvoltura { overflow-x: auto; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hojaA4 { position: relative; width: 190mm; height: 277mm; flex-shrink: 0;
          background: #fff; border: 3px solid var(--rNavy); box-sizing: border-box;
          overflow: hidden; display: flex; flex-direction: column;
          font-size: 8.5pt; color: #141414; }
.hojaA4 * { box-sizing: border-box; }
.rResto { flex: 1 1 auto; }

/* el número del recibo, arriba a la derecha de la hoja */
.rNumero { position: absolute; top: 1mm; right: 3mm; z-index: 2;
           font-size: 6.5pt; color: var(--rGris2); }

.rFila { display: flex; width: 100%; flex-shrink: 0; }
.rDer  { display: flex; flex-direction: column; }
.rDer > .rCel { flex: 1; border-right: 0; }
/* ⚠ LOS BORDES VAN EN PÍXELES ENTEROS, NO EN MILÍMETROS.
   0,25 mm son 0,94 px: el navegador redondea eso a CERO en unos sitios y a uno
   en otros, y la cuadrícula del recibo aparecía con líneas sueltas ausentes,
   distintas en cada impresión. 1 px son 0,26 mm — misma raya a la vista, pero
   siempre dibujada. Lo mismo vale para el marco y para la raya de las firmas. */
.rCel  { display: flex; align-items: center; padding: 0 3mm; min-width: 0; background: #fff;
         border-right: 1px solid var(--rBorde); border-bottom: 1px solid var(--rBorde); }
.rFila > .rCel:last-child, .rDer > .rCel:last-child { border-right: 0; }
.rCel.centro { justify-content: center; text-align: center; }

/* 1 · encabezado */
.rPromo { flex-direction: column; justify-content: center; align-items: center;
          text-align: center; gap: 1.1mm; }
.rPromoNom  { font-size: 10pt; font-weight: 700; color: var(--rNavy); line-height: 1.15; }
.rPromoProy { font-size: 8.5pt; color: var(--rNavy); }
.rPromoRuc  { font-size: 8pt; color: var(--rGris2); }
.rPromoTit  { font-size: 9pt; font-weight: 700; color: var(--rNavy); letter-spacing: .05em; }
.rApilada { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1.4mm; }
.rEtq   { font-size: 7pt; font-weight: 700; color: var(--rGris2); }
.rDato2 { font-size: 9.5pt; font-weight: 700; }
.rMonto { font-size: 10pt; color: var(--rNavy); }

/* 2 · etiquetas y valores */
.rLbl { height: 9mm; background: var(--rGris); font-size: 6.5pt; font-weight: 700;
        color: var(--rGris2); padding: 0 2mm; letter-spacing: .01em; }
.rVal { height: 9mm; font-size: 8.5pt; }
.rDirEtq { font-size: 7.5pt; color: var(--rGris2); display: inline-block; width: 23mm; flex-shrink: 0; }

/* 3 · el comprobante */
.rComprobante { display: flex; align-items: center; justify-content: center; flex-shrink: 0;
                background: #fff; border-bottom: 1px solid var(--rBorde); overflow: hidden; padding: 4mm; }
.rHueco { font-size: 8pt; font-style: italic; color: var(--rGris2); text-align: center; }
.rRejilla { display: grid; gap: 4mm; width: 100%; height: 100%; }
.rFoto { display: flex; flex-direction: column; align-items: center; justify-content: center;
         min-width: 0; min-height: 0; overflow: hidden; }
.rFoto img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* 4 y 5 · tablas y observaciones */
.rTd  { justify-content: center; text-align: center; font-size: 8pt; }
.rObs { align-items: flex-start; padding: 2mm 4mm; }
.rObsTexto { width: 100%; line-height: 1.25; overflow: hidden; }
.rConcepto { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1.4mm; }
.rConceptoTit  { font-size: 8.5pt; font-weight: 700; }
.rConceptoTipo { font-size: 7pt; color: var(--rGris2); }

/* Los componentes de un pago múltiple, uno por línea con su valor a la derecha.
   El punteado los une sin tener que dibujar una tabla dentro de la casilla: es
   lo que hace legible la lista cuando los conceptos son de largo distinto. */
.rConceptoLinea { display: flex; align-items: baseline; gap: 1.5mm; line-height: 1.35; }
.rConceptoLinea .rConceptoTit { flex: 0 1 auto; white-space: nowrap;
                                overflow: hidden; text-overflow: ellipsis; }
.rConceptoPunteado { flex: 1 1 auto; border-bottom: 1px dotted var(--rGris2);
                     transform: translateY(-1px); min-width: 4mm; }
.rConceptoVal { flex: 0 0 auto; font-size: 8.5pt; font-weight: 700; font-variant-numeric: tabular-nums; }
.rConceptoMas { font-size: 7pt; color: var(--rGris2); font-style: italic; }

/* 6 · firmas */
.rFirma { position: relative; flex-direction: column; align-items: center; justify-content: flex-end;
          padding-bottom: 1.6mm; gap: 2.2mm; }
.rLinea { position: absolute; left: 12mm; right: 12mm; bottom: 14mm; height: 1px; background: #646464; }
.rFirmaQuien { font-size: 7.5pt; color: var(--rGris2); text-align: center; line-height: 1.1; }
.rFirmaTit   { font-size: 7.5pt; font-weight: 700; letter-spacing: .03em; }

.rPie { flex-shrink: 0; height: 6mm; display: flex; align-items: center; justify-content: center;
        background: var(--rGris); font-size: 6.5pt; color: var(--rGris2); }

/* el sello «PAGO RECIBIDO» con su QR, en «RECIBÍ CONFORME» (9-nov-2026): el mismo del PDF */
.rSello { flex-direction: row; align-items: center; justify-content: flex-start; gap: 3mm; padding: 2mm 3mm; }
.rSelloQR { width: 22mm; height: 22mm; flex-shrink: 0; }
.rSelloQR svg { width: 100%; height: 100%; display: block; }
.rSelloTxt { display: flex; flex-direction: column; gap: .4mm; font-size: 7pt; line-height: 1.2; min-width: 0; }
.rSelloTit { font-size: 8.5pt; font-weight: 700; color: var(--rNavy); }
.rSelloGris { font-size: 6.5pt; color: var(--rGris2); }

/* ── LA HOJA DEL ESTADO DE CUENTA ───────────────────────────────────────────
   A diferencia del recibo, que es un formato cerrado de una página, esto es un
   documento que FLUYE: un cliente con 33 cuotas y 40 pagos ocupa dos o tres
   páginas, y está bien. Por eso lleva alto automático y `page-break` en las
   filas, para que ninguna se parta por la mitad.                           */
.hojaEC { width: 190mm; background: #fff; padding: 0 0 10mm; box-sizing: border-box;
          font-size: 9pt; color: #141414; border: 1px solid var(--line); }
.hojaEC * { box-sizing: border-box; }
.ecCabeza { display: flex; justify-content: space-between; align-items: flex-start; gap: 10mm;
            background: var(--navy); color: #fff; padding: 6mm 8mm 5mm; }
.ecFranja { height: 2.5mm; background: var(--gold); }
.ecEmpresa { font-size: 12pt; font-weight: 700; line-height: 1.2; }
.ecEmpresaSub { font-size: 8pt; color: #cfdae8; margin-top: 1.5mm; }
.ecTitulo { font-size: 13pt; font-weight: 700; letter-spacing: .04em; }
.ecCliente { background: #f0f3f8; margin: 6mm 8mm 0; padding: 4mm 5mm; border-radius: 1.5mm; }
.ecClienteNom { font-size: 11pt; font-weight: 700; color: var(--navy); }
.ecClienteDato { font-size: 8.5pt; color: #3c4b5a; margin-top: 1.8mm; }
.ecCifras { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; margin: 5mm 8mm 0; }
.ecCifra { border-radius: 1.5mm; padding: 3.5mm 3mm; text-align: center; color: #fff; }
.ecCifraV { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11pt; font-weight: 700; }
.ecCifraL { font-size: 7.5pt; margin-top: 1.2mm; opacity: .92; }
.ecSeccion { font-size: 9.5pt; font-weight: 700; color: var(--navy); letter-spacing: .03em;
             margin: 6mm 8mm 2mm; }
.ecTabla { width: calc(100% - 16mm); margin: 0 8mm; border-collapse: collapse; font-size: 8.5pt; }
.ecTabla th { background: var(--navy); color: #fff; font-weight: 600; text-align: left;
              padding: 2mm 2.5mm; font-size: 8pt; }
.ecTabla.ecVerde th { background: var(--success); }
.ecTabla td { padding: 2mm 2.5mm; border-bottom: 1px solid #e2e8f2; }
.ecTabla tbody tr:nth-child(even) td { background: #f6f8fc; }
.ecTabla.ecVerde tbody tr:nth-child(even) td { background: #f1f8f4; }
.ecTabla .der { text-align: right; }
/* ⚠ NO usar .centro aquí: es una clase GLOBAL de la pantalla de entrar
   (display:flex; flex-direction:column). Una celda de tabla que la heredaba
   dejaba de comportarse como celda y se apilaba debajo de la anterior — así se
   rompió la TABLA DE CUOTAS del estado de cuenta. Clase propia y punto. */
.ecTabla .ecC { text-align: center; }

/* ⚠⚠ UN IMPORTE RECORTADO ES PEOR QUE UNO QUE SE DOBLA.
   Aquí hubo `table-layout: fixed` con anchos en porcentaje y
   `text-overflow: ellipsis`. Resultado: «$ 3.158,…» y «PE…» — el papel decía
   un número que no era, y en silencio. Un estado de cuenta que miente sobre un
   monto no sirve para nada.
   Ahora manda el CONTENIDO: reparto automático (sin `table-layout: fixed`) y
   `white-space: nowrap` en todo lo que es una cifra, una fecha o un código, de
   modo que el navegador le da a cada columna lo que necesita. Solo pueden
   doblarse la descripción y el banco, que son texto y ahí es normal.
   **Y NADA de `overflow: hidden` ni `text-overflow: ellipsis`**: si alguna vez
   algo no cupiera, que se vea, no que se esconda.                          */
.ecTabla th, .ecTabla td { vertical-align: middle; white-space: nowrap; }
.ecTabla th:first-child, .ecTabla td:first-child,
.ecTabla th.ecLibre, .ecTabla td.ecLibre { white-space: normal; }
.ecTabla th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.ecTabla .cifra { font-family: 'JetBrains Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.ecTabla tr.ecTotal td { background: var(--navylt) !important; font-weight: 700; color: var(--navy);
                         border-top: 1.5px solid var(--navy); border-bottom: 0; }
.ecVacio { margin: 0 8mm; padding: 4mm; text-align: center; font-size: 8.5pt; color: var(--text3);
           border: 1px dashed var(--line); border-radius: 1.5mm; }
.ecPie { margin: 7mm 8mm 0; padding-top: 3mm; border-top: 1px solid #e2e8f2; text-align: center;
         font-size: 7.5pt; color: #64707c; line-height: 1.5; }

@media print {
  .hojaEC { width: auto; border: 0; padding: 0; }
  .ecTabla tr, .ecCifras, .ecCliente { page-break-inside: avoid; break-inside: avoid; }
  .ecSeccion { page-break-after: avoid; break-after: avoid; }
  .ecTabla thead { display: table-header-group; }   /* el encabezado se repite en cada página */
}

/* la página 2 del pago combinado */
.rCab2 { flex-direction: column; align-items: center; justify-content: center; gap: 1.6mm; }
.rCab2Tit { font-size: 9.5pt; font-weight: 700; color: var(--rNavy); text-align: center; }
.rCab2Sub { font-size: 7pt; color: var(--rGris2); text-align: center; }

.recuadroAnulado { margin: 14px 0 0; padding: 10px 14px; border: 1px dashed var(--danger);
                   border-radius: 7px; background: rgba(192,57,43,.04); }
.selloAnulado { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
                justify-content: center; pointer-events: none; transform: rotate(-24deg); z-index: 3; }
.selloAnulado div:first-child { font-size: 92px; font-weight: 800; letter-spacing: .1em;
                                color: rgba(192,57,43,.20); line-height: 1; }
.selloAnulado div:last-child { font-size: 18px; letter-spacing: .28em; color: rgba(192,57,43,.28); margin-top: 6px; }

@media (max-width: 900px) {
  .rejillaCampos { grid-template-columns: 1fr; }
  .selloAnulado div:first-child { font-size: 54px; }
  .hojaA4 { zoom: .58; }
}

/* ── el manual de uso ───────────────────────────────────────────────────────
   Una hoja que se lee en pantalla y se imprime igual. Ancho de lectura
   limitado: un párrafo de 20 cm de ancho no lo lee nadie.                  */
.manualHoja { background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
              box-shadow: var(--sh); padding: 30px 34px 26px; max-width: 900px; }
.manualCabeza { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px;
                padding-bottom: 20px; border-bottom: 2px solid var(--navy); }
.manualCap { margin-top: 26px; }
.manualTit { font-size: 17px; font-weight: 700; color: var(--navy); margin: 0 0 4px;
             padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.manualParte { margin-top: 16px; }
.manualSub { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.manualLista { margin: 0; padding-left: 20px; }
.manualLista li { font-size: 14px; line-height: 1.65; color: var(--text2); margin-bottom: 5px;
                  max-width: 72ch; text-wrap: pretty; }
.manualLista li strong { color: var(--text); font-weight: 600; }
.manualPie { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line);
             font-size: 13px; line-height: 1.6; color: var(--text3); max-width: 72ch; }

@media print {
  .manualHoja { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .manualCap, .manualParte { page-break-inside: avoid; break-inside: avoid; }
  .manualTit { page-break-after: avoid; break-after: avoid; }
}

/* ── el gráfico de barras de reportes ──────────────────────────────────────── */
.barras { display: flex; align-items: flex-end; gap: 10px; height: 220px; }
.colBarra { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
            height: 100%; min-width: 0; }
.valorBarra { font-size: 12px; color: var(--text3); margin-bottom: 5px; white-space: nowrap; }
.barra { width: 100%; max-width: 54px; background: var(--teal); border-radius: 4px 4px 0 0; min-height: 3px; }
/* la zona donde vive la barra, para poder colgar la raya del cobrado a su altura */
.zonaBarra { position: relative; width: 100%; flex-grow: 1; display: flex;
             align-items: flex-end; justify-content: center; min-height: 0; }
.rayaCobrado { position: absolute; left: 8%; right: 8%; height: 2px; background: var(--success);
               border-radius: 1px; }
.rayaCobrado::after { content: ''; position: absolute; right: -1px; top: -2px; width: 6px; height: 6px;
                      border-radius: 50%; background: var(--success); }
.colBarra:hover .barra { background: #12655b; }
.pieBarra { font-size: 12px; color: var(--text3); text-align: center; margin-top: 8px; line-height: 1.3; }
.tarjeta.tramo.sel { outline: 2px solid var(--navy); outline-offset: -1px; }
.tarjetas.cuatro { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ── usuarios y bitácora ───────────────────────────────────────────────────── */
.opcion { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 12px;
          border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font-size: 13px; }
.opcion:hover { border-color: var(--text3); }
.opcion input { width: 16px; height: 16px; accent-color: #1a7a6e; flex-shrink: 0; }
.diaBitacora { position: sticky; top: 0; background: var(--surface2); border-bottom: 1px solid var(--line);
               padding: 9px 20px; font-size: 12px; font-weight: 600; color: var(--text2); z-index: 2; }
.asiento { display: flex; gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--line2); align-items: flex-start; }
.horaAsiento { color: var(--text3); font-size: 12px; width: 44px; flex-shrink: 0; padding-top: 4px; }
.iconoAsiento { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center;
                justify-content: center; flex-shrink: 0; }
.cambioAsiento { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; flex-wrap: wrap; }
.cambioAsiento .antes { padding: 3px 9px; border-radius: 5px; background: var(--dangerbg); color: #8c2c20; text-decoration: line-through; }
.cambioAsiento .despues { padding: 3px 9px; border-radius: 5px; background: var(--successbg); color: #14603f; }
.grupoMenu { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: #93a6bd;
             font-weight: 700; padding: 16px 12px 6px; }
.lateral { overflow-y: auto; }

/* ── el buscador de códigos de la UAFE (selector-uafe.js) ─────────────────── */
/* La lista sale FLOTANDO sobre lo de abajo, no empujándolo: si empujara, los
   campos saltarían de sitio cada vez que alguien escribe una letra. */
.selUafe { position: relative; }
.selUafeLista { position: absolute; z-index: 40; left: 0; right: 0; top: 100%; margin-top: 3px;
                max-height: 280px; overflow-y: auto; background: var(--surface);
                border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--sh2); }
.selUafeTitulo { padding: 7px 11px; font-size: 12px; color: var(--text3);
                 background: var(--surface2); position: sticky; top: 0; }
.selUafeVacio { padding: 12px; font-size: 13px; color: var(--text3); }
.selUafeOpc { display: flex; gap: 9px; align-items: baseline; width: 100%; text-align: left;
              padding: 7px 11px; border: 0; background: none; cursor: pointer;
              font-family: inherit; font-size: 13px; color: var(--text); border-radius: 0; }
.selUafeOpc:hover, .selUafeOpc.sel { background: var(--tealbg); }
.selUafeCod { flex-shrink: 0; min-width: 62px; color: var(--teal); font-weight: 600; }
.selUafeNom { line-height: 1.45; }
.selUafeElegido { min-height: 17px; }

/* ── LA PANTALLA DE CUMPLIMIENTO (UAFE) — propuesta B ─────────────────────
   Elegida por el usuario el 24-sep entre tres.

   EL PROBLEMA QUE RESUELVE: la pantalla son CUATRO bloques seguidos —periodo,
   fichas por completar, transacciones y los tres reportes— y con todas las
   cabeceras en blanco no se veía dónde acababa uno y empezaba el siguiente.

   Se usa el verde azulado que el sistema YA tiene para lo de cumplimiento, no
   un color nuevo: un filete arriba y la cabecera en su tono claro. Separa sin
   gritar y, de paso, se sabe de un vistazo en qué pantalla se está.

   ⚠ TODO CUELGA DE «.vistaUafe»: el resto del programa no cambia ni un píxel.
   Los contrastes están medidos, no estimados (var(--teal) sobre var(--tealbg)
   da 4,64:1, por encima del 4,5 que pide la norma para texto normal; el
   texto suave de la cabecera queda en 4,52, justo por encima).          */
.vistaUafe .cuadro { padding: 0; overflow: hidden; border-top: 3px solid var(--teal); }
.vistaUafe .cabCuadro { display: flex; align-items: flex-start; justify-content: space-between;
                        gap: 16px; flex-wrap: wrap; padding: 14px 18px;
                        background: var(--tealbg); border-bottom: 1px solid var(--line2); }
.vistaUafe .cabCuadro > div:first-child > strong { color: var(--teal); font-size: 15px; font-weight: 600; }
.vistaUafe .cuerpoCuadro { padding: 18px; }
/* La tabla de muestra va pegada a su cabecera, sin marco doble. */
.vistaUafe .tabla { border: 0; border-radius: 0; box-shadow: none; }
.vistaUafe .tabla th { background: var(--tealbg); color: var(--teal); }
/* Las líneas de los paneles ya traen su propio relleno. */
.vistaUafe .linea { padding: 12px 18px; }
