/* Fondo de Ahorros e Inversiones San Gabriel — estilos de la aplicación
   Paleta tomada del escudo: azul marino, verde y dorado sobre un fondo crema. */
:root {
  --azul-950: #0a1830; --azul-900: #10244a; --azul-800: #1a3566; --azul-700: #1e3a6e; --azul-600: #2a4f8c; --azul-100: #dbe5f5; --azul-50: #eef3fb;
  --verde-800: #11522c; --verde-700: #1a6b3c; --verde-600: #1e8048; --verde-500: #2a9a5a; --verde-200: #b6dcc7; --verde-100: #d8eee2; --verde-50: #eef7f2;
  --oro-700: #8f7230; --oro-600: #a8873a; --oro-500: #c9a84c; --oro-300: #e3cf8f; --oro-100: #f5ecc8; --oro-50: #fbf7e8;
  --rojo-700: #b3261e; --rojo-100: #fbe3e1; --ambar-700: #a15c07; --ambar-100: #fdecc8;
  --fondo: #f5f2ec; --superficie: #ffffff; --superficie-2: #faf8f4; --linea: #e8e2d6; --linea-fuerte: #d6cdbb;
  --tinta: #12203d; --texto-2: #46536b; --texto-3: #7a8499; --texto-4: #a4acba;
  --sombra-1: 0 1px 2px rgba(16, 36, 74, .06), 0 1px 1px rgba(16, 36, 74, .04);
  --sombra-2: 0 8px 24px -8px rgba(16, 36, 74, .18), 0 2px 6px rgba(16, 36, 74, .06);
  --sombra-3: 0 24px 60px -20px rgba(10, 24, 48, .45);
  --radio: 18px; --radio-s: 12px;
  --fuente: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --ancho-menu: 264px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--fuente); color: var(--tinta); background: var(--fondo); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--azul-700); }
:focus-visible { outline: 3px solid var(--oro-500); outline-offset: 2px; border-radius: 6px; }
.oculto { display: none !important; }
.sin-js { padding: 24px; }
.solo-lectores { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.heroe .monto, .kpi .valor, .anio-monto, .anio-cab .y, .prestamo-cab .cod, .medidor .valor, .ingreso-tarjeta h1, .barra h2 { font-variant-numeric: lining-nums; font-feature-settings: 'lnum' 1; }
svg.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ───────── Pantalla de carga ───────── */
.cargando-pantalla { min-height: 100dvh; display: grid; place-items: center; background: linear-gradient(160deg, var(--azul-950), var(--azul-800)); }
.cargando-pantalla img { width: 96px; height: 96px; animation: latido 1.6s ease-in-out infinite; }
@keyframes latido { 50% { transform: scale(1.06); opacity: .85; } }

/* ───────── Ingreso ───────── */
.ingreso { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.ingreso-marca { position: relative; overflow: hidden; color: #fff; padding: clamp(32px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 90% at 0% 0%, var(--azul-800) 0%, var(--azul-950) 70%); }
.ingreso-marca::before { content: ""; position: absolute; inset: auto -20% -35% auto; width: 90%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(42, 154, 90, .35), transparent 65%); }
.ingreso-marca::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--verde-600), var(--oro-500), var(--verde-600)); }
.marca-escudo { width: clamp(96px, 14vw, 150px); filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .35)); position: relative; z-index: 1; }
.marca-titulo { font-family: var(--serif); font-size: clamp(30px, 4.2vw, 52px); line-height: 1.1; font-weight: 600; position: relative; z-index: 1; text-wrap: balance; }
.marca-titulo em { color: var(--oro-300); font-style: normal; }
.marca-sub { color: #c4d0e8; max-width: 38ch; margin-top: 14px; position: relative; z-index: 1; }
.marca-pie { color: #9fb0d2; font-size: 13px; position: relative; z-index: 1; }
.ingreso-form-zona { display: grid; place-items: center; padding: 28px 20px; background: var(--fondo); }
.ingreso-tarjeta { width: min(420px, 100%); background: var(--superficie); border: 1px solid var(--linea); border-radius: 24px; padding: clamp(26px, 4vw, 40px); box-shadow: var(--sombra-2); }
.ingreso-tarjeta h1 { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--azul-900); }
.ingreso-tarjeta .sub { color: var(--texto-2); margin: 6px 0 24px; }
.ingreso-movil-escudo { display: none; }

/* ───────── Formularios ───────── */
.campo { display: grid; gap: 6px; margin-bottom: 16px; }
.campo label { font-size: 13px; font-weight: 600; color: var(--texto-2); }
.entrada { position: relative; }
.entrada input { width: 100%; height: 50px; padding: 0 16px; border: 1.5px solid var(--linea-fuerte); border-radius: 14px; background: var(--superficie); font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.entrada input:hover { border-color: var(--texto-4); }
.entrada input:focus { outline: none; border-color: var(--azul-600); box-shadow: 0 0 0 4px rgba(42, 79, 140, .15); }
.entrada.con-boton input { padding-right: 52px; }
.entrada .ojo { position: absolute; right: 6px; top: 6px; width: 38px; height: 38px; border: 0; background: transparent; border-radius: 10px; color: var(--texto-3); display: grid; place-items: center; }
.entrada .ojo:hover { background: var(--superficie-2); color: var(--tinta); }
.ayuda { font-size: 12.5px; color: var(--texto-3); }
.aviso-error { background: var(--rojo-100); color: var(--rojo-700); border: 1px solid #f1bdb9; border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; }
.aviso-info { background: var(--azul-50); color: var(--azul-800); border: 1px solid var(--azul-100); border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; }

/* ───────── Botones ───────── */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 14px; border: 1.5px solid transparent; font-weight: 700; font-size: 15px;
  transition: transform .06s, background .15s, box-shadow .15s, border-color .15s; white-space: nowrap; }
.boton:active { transform: translateY(1px); }
.boton[disabled] { opacity: .6; cursor: progress; }
.boton.primario { background: linear-gradient(180deg, var(--verde-600), var(--verde-700)); color: #fff; box-shadow: 0 6px 16px -6px rgba(26, 107, 60, .7); }
.boton.primario:hover:not([disabled]) { background: linear-gradient(180deg, var(--verde-500), var(--verde-600)); }
.boton.azul { background: var(--azul-700); color: #fff; }
.boton.azul:hover:not([disabled]) { background: var(--azul-600); }
.boton.contorno { background: var(--superficie); border-color: var(--linea-fuerte); color: var(--tinta); }
.boton.contorno:hover:not([disabled]) { background: var(--superficie-2); border-color: var(--texto-4); }
.boton.oro { background: linear-gradient(180deg, var(--oro-500), var(--oro-600)); color: #1f1705; }
.boton.peligro { background: var(--rojo-700); color: #fff; }
.boton.bloque { width: 100%; }
.boton.chico { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 11px; }
.boton .rueda { width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: gira .7s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ───────── Estructura de la aplicación ───────── */
.app { min-height: 100dvh; display: grid; grid-template-columns: var(--ancho-menu) minmax(0, 1fr); }
.menu { position: sticky; top: 0; height: 100dvh; background: linear-gradient(180deg, var(--azul-900), var(--azul-950)); color: #dbe5f5; display: flex; flex-direction: column; padding: 22px 16px; }
.menu-marca { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.menu-marca img { width: 48px; height: 48px; }
.menu-marca b { display: block; font-family: var(--serif); font-size: 17px; color: #fff; line-height: 1.15; font-weight: 600; }
.menu-marca span { font-size: 11.5px; color: #9fb0d2; letter-spacing: .04em; text-transform: uppercase; }
.menu nav { display: grid; gap: 4px; margin-top: 18px; }
.menu a.enlace { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: #c4d0e8; text-decoration: none; font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s; position: relative; }
.menu a.enlace:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.menu a.enlace.activo { background: rgba(255, 255, 255, .11); color: #fff; }
.menu a.enlace.activo::before { content: ""; position: absolute; left: -16px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--oro-500); }
.menu .insignia { margin-left: auto; background: var(--oro-500); color: #2b2005; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.menu .grupo { margin: 18px 14px 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #8497bd; font-weight: 800; }
.menu { overflow-y: auto; }
.menu-pie { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 12.5px; color: #9fb0d2; }
.contenido { min-width: 0; }
.barra { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(16px, 3vw, 36px);
  background: rgba(245, 242, 236, .85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--linea); }
.barra h2 { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--azul-900); }
.barra .movil-marca { display: none; align-items: center; gap: 10px; }
.barra .movil-marca img { width: 34px; height: 34px; }
.avatar-boton { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 10px; border: 1px solid var(--linea); background: var(--superficie); padding: 5px 14px 5px 5px; border-radius: 99px; box-shadow: var(--sombra-1); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--verde-600), var(--azul-700)); }
.avatar-boton span.n { font-weight: 600; font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pagina { padding: clamp(16px, 3vw, 36px); max-width: 1180px; margin: 0 auto; display: grid; gap: 22px; animation: entra .28s ease both; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } }
.fila-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.fila-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pestanas-movil { display: none; }

/* ───────── Tarjetas ───────── */
.tarjeta { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra-1); padding: 22px; }
.tarjeta h3 { font-size: 16px; font-weight: 700; color: var(--azul-900); margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tarjeta h3 small { font-weight: 600; color: var(--texto-3); font-size: 12.5px; }
.etiqueta { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--texto-3); }

.heroe { position: relative; overflow: hidden; color: #fff; border-radius: 24px; padding: clamp(22px, 3vw, 36px); background: radial-gradient(120% 140% at 0% 0%, var(--azul-700) 0%, var(--azul-950) 75%); box-shadow: var(--sombra-3);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; }
.heroe::before { content: ""; position: absolute; inset: auto -8% -50% auto; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(201, 168, 76, .28), transparent 66%); }
.heroe::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--verde-600), var(--oro-500), var(--verde-600)); }
.heroe > * { position: relative; z-index: 1; }
.heroe .etiqueta { color: #aebfe0; }
.heroe .monto { font-family: var(--serif); font-size: clamp(40px, 7vw, 68px); font-weight: 600; line-height: 1.05; margin: 6px 0 14px; letter-spacing: -.01em; }
.heroe .monto small { font-size: .5em; color: var(--oro-300); margin-left: 2px; }
.heroe .pastillas { display: flex; flex-wrap: wrap; gap: 8px; }
.pastilla { display: inline-flex; align-items: center; gap: 7px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); border-radius: 99px; padding: 6px 14px; font-size: 13.5px; color: #e6edf9; }
.pastilla b { color: #fff; font-weight: 700; }
.medidor { width: 132px; text-align: center; }
.medidor svg { width: 132px; height: 132px; }
.medidor .valor { font-family: var(--serif); font-size: 32px; font-weight: 600; fill: #fff; }
.medidor .nivel { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--oro-300); font-weight: 700; margin-top: -4px; }

.kpi { display: grid; gap: 4px; }
.kpi .valor { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--azul-900); line-height: 1.1; }
.kpi .detalle { font-size: 13px; color: var(--texto-3); }
.kpi .icono-caja { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 8px; }
.icono-caja.v { background: var(--verde-100); color: var(--verde-700); }
.icono-caja.a { background: var(--azul-100); color: var(--azul-700); }
.icono-caja.o { background: var(--oro-100); color: var(--oro-700); }

.entrada select, .entrada textarea { width: 100%; height: 50px; padding: 0 16px; border: 1.5px solid var(--linea-fuerte); border-radius: 14px; background: var(--superficie); font-size: 16px; }
.entrada select:focus { outline: none; border-color: var(--azul-600); box-shadow: 0 0 0 4px rgba(42, 79, 140, .15); }
.fila-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.buscador { position: relative; }
.buscador svg { position: absolute; left: 14px; top: 15px; color: var(--texto-3); }
.buscador input { width: 100%; height: 50px; padding: 0 16px 0 44px; border: 1.5px solid var(--linea-fuerte); border-radius: 14px; background: var(--superficie); font-size: 16px; }
.buscador input:focus { outline: none; border-color: var(--azul-600); box-shadow: 0 0 0 4px rgba(42, 79, 140, .15); }
.volver { display: inline-flex; align-items: center; gap: 6px; color: var(--azul-700); font-weight: 700; text-decoration: none; font-size: 14px; }
.atajos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.atajo { display: flex; align-items: center; gap: 14px; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); padding: 16px 18px; text-decoration: none; color: var(--tinta); box-shadow: var(--sombra-1); transition: transform .12s, box-shadow .12s; position: relative; }
.atajo:hover { transform: translateY(-2px); box-shadow: var(--sombra-2); }
.atajo b { display: block; } .atajo span.d { font-size: 13px; color: var(--texto-3); }
.atajo .icono-caja { margin: 0; flex: none; }
.atajo .insignia { margin-left: auto; background: var(--oro-500); color: #2b2005; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 99px; }
.clave-grande { font-family: ui-monospace, Consolas, monospace; font-size: 30px; font-weight: 700; letter-spacing: .08em; text-align: center; padding: 18px; border-radius: 14px; background: var(--oro-50); border: 1.5px dashed var(--oro-500); color: var(--tinta); user-select: all; }
.cuentas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cuenta-caja .monto { font-family: var(--serif); font-size: 32px; font-weight: 600; color: var(--azul-900); }
.sub-linea { font-size: 13px; color: var(--texto-3); }
.lista .item .botones { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.item.cae { flex-wrap: wrap; }

/* ───────── Alertas, listas, etiquetas ───────── */
.alerta { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 16px; border: 1px solid; }
.alerta .ico { margin-top: 2px; }
.alerta b { display: block; }
.alerta p { font-size: 14px; opacity: .92; }
.alerta .boton { margin-left: auto; align-self: center; }
.alerta.mora { background: var(--rojo-100); border-color: #f1bdb9; color: #7d1a14; }
.alerta.oro { background: var(--oro-50); border-color: var(--oro-300); color: #5c4710; }
.alerta.info { background: var(--azul-50); border-color: var(--azul-100); color: var(--azul-800); }
.lista { display: grid; }
.item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--linea); }
.item:last-child { border-bottom: 0; padding-bottom: 0; }
.item:first-child { padding-top: 0; }
.item .punto { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--verde-50); color: var(--verde-700); }
.item .punto.sale { background: var(--rojo-100); color: var(--rojo-700); }
.item .punto.oro { background: var(--oro-100); color: var(--oro-700); }
.item .txt { min-width: 0; flex: 1; }
.item .txt b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .txt span { font-size: 13px; color: var(--texto-3); }
.item .der { text-align: right; font-weight: 700; }
.item .der small { display: block; font-weight: 500; color: var(--texto-3); font-size: 12.5px; }
.pos { color: var(--verde-700); } .neg { color: var(--rojo-700); }
.insignia-estado { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--superficie-2); color: var(--texto-2); border: 1px solid var(--linea); }
.insignia-estado.ok { background: var(--verde-100); color: var(--verde-800); border-color: var(--verde-200); }
.insignia-estado.mora { background: var(--rojo-100); color: var(--rojo-700); border-color: #f1bdb9; }
.insignia-estado.pend { background: var(--ambar-100); color: var(--ambar-700); border-color: #f3d78f; }
.insignia-estado.azul { background: var(--azul-100); color: var(--azul-800); border-color: #c6d5ee; }
.vacio { text-align: center; color: var(--texto-3); padding: 28px 12px; }
.vacio .ico { width: 36px; height: 36px; color: var(--texto-4); margin-bottom: 8px; }

/* ───────── Préstamos ───────── */
.prestamo-cab { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.prestamo-cab .cod { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--azul-900); line-height: 1; }
.prestamo-cab .sub { color: var(--texto-3); font-size: 13.5px; margin-top: 6px; }
.progreso { height: 10px; border-radius: 99px; background: var(--verde-100); overflow: hidden; }
.progreso > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--verde-600), var(--verde-500)); }
.progreso-txt { display: flex; justify-content: space-between; font-size: 13px; color: var(--texto-2); margin: 8px 0 18px; }
.datos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.dato span { display: block; font-size: 12px; color: var(--texto-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.dato b { font-size: 17px; font-weight: 700; }
.proxima { background: var(--superficie-2); border: 1px solid var(--linea); border-radius: 14px; padding: 14px 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.proxima.mora { background: var(--rojo-100); border-color: #f1bdb9; }
.tabla-caja { overflow-x: auto; margin-top: 14px; border: 1px solid var(--linea); border-radius: 14px; }
table.tabla { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.tabla th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--texto-3); background: var(--superficie-2); padding: 10px 14px; position: sticky; top: 0; }
.tabla td { padding: 10px 14px; border-top: 1px solid var(--linea); }
.tabla .d { text-align: right; }
.tabla tr.mora td { background: #fff6f5; }

/* ───────── Ganancias ───────── */
.anio { display: grid; gap: 14px; }
.anio-cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.anio-cab .y { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--azul-900); }
.anio-monto { font-family: var(--serif); font-size: 44px; font-weight: 600; color: var(--verde-700); line-height: 1; }
.anio-monto small { font-family: var(--fuente); font-size: 13px; color: var(--texto-3); font-weight: 500; margin-left: 8px; }
.acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.nota { font-size: 13px; color: var(--texto-3); }
.nota.grande { font-size: 15px; color: var(--texto-2); line-height: 1.55; }

/* ───────── Modal ───────── */
dialog { border: 0; border-radius: 22px; padding: 0; width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); box-shadow: var(--sombra-3); color: var(--tinta); background: var(--superficie); }
dialog::backdrop { background: rgba(10, 24, 48, .55); backdrop-filter: blur(3px); }
dialog[open] { animation: modal .22s ease both; }
@keyframes modal { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-cab { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 6px; }
.modal-cab h3 { font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--azul-900); }
.modal-cuerpo { padding: 10px 24px 8px; overflow: auto; }
.modal-pie { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 22px; }
.cerrar { border: 0; background: var(--superficie-2); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--texto-2); }
.cerrar:hover { background: var(--linea); }
.comprobante-img { width: 100%; height: auto; border: 1px solid var(--linea); border-radius: 12px; background: #fff; }

/* ───────── Avisos flotantes ───────── */
.avisos { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 28px)); }
.aviso { background: var(--azul-950); color: #fff; padding: 13px 18px; border-radius: 14px; box-shadow: var(--sombra-3); font-size: 14.5px; display: flex; gap: 10px; align-items: center; animation: modal .22s ease both; }
.aviso.ok { background: var(--verde-800); } .aviso.mal { background: var(--rojo-700); }

/* ───────── Esqueletos de carga ───────── */
.esqueleto { background: linear-gradient(90deg, #ece7dc 25%, #f6f2ea 37%, #ece7dc 63%); background-size: 400% 100%; animation: brillo 1.3s ease infinite; border-radius: 12px; }
@keyframes brillo { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ───────── Celular ───────── */
@media (max-width: 960px) {
  .ingreso { grid-template-columns: 1fr; }
  .ingreso-marca { display: none; }
  .ingreso-form-zona { align-content: center; background: linear-gradient(180deg, var(--azul-900) 0, var(--azul-900) 190px, var(--fondo) 190px); padding-top: 28px; }
  .ingreso-movil-escudo { display: block; width: 88px; margin: 0 auto 14px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); }
  .ingreso-tarjeta { margin-top: 0; }
  .app { grid-template-columns: 1fr; }
  .menu { display: none; }
  .barra .movil-marca { display: flex; }
  .barra h2 { display: none; }
  .avatar-boton span.n { display: none; }
  .avatar-boton { padding: 5px; }
  .pagina { padding-bottom: 104px; }
  .pestanas-movil { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; z-index: 30; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); background: rgba(16, 36, 74, .96);
    backdrop-filter: blur(12px); border-radius: 22px; padding: 6px; box-shadow: var(--sombra-3); }
  .pestanas-movil a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; color: #aebfe0; text-decoration: none; font-size: 10.5px; font-weight: 700; border-radius: 16px; position: relative; }
  .pestanas-movil a.activo { background: rgba(255, 255, 255, .12); color: #fff; }
  .pestanas-movil a.activo svg { color: var(--oro-300); }
  .atajos, .cuentas { grid-template-columns: 1fr; }
  .fila-campos { grid-template-columns: 1fr; }
  .pestanas-movil.seis { grid-template-columns: repeat(6, 1fr); }
  .pestanas-movil.seis a { font-size: 9.5px; padding: 8px 0; }
  .fila-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .fila-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .fila-3 .tarjeta { padding: 16px; }
  .fila-3 .icono-caja { display: none; }
  .fila-2 { grid-template-columns: 1fr; }
  .datos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heroe { grid-template-columns: 1fr; }
  .medidor { width: auto; display: flex; align-items: center; gap: 14px; text-align: left; }
  .medidor svg { width: 96px; height: 96px; }
  .medidor .valor { font-size: 34px; }
  .avisos { left: 14px; right: 14px; bottom: 100px; max-width: none; }
  .alerta { flex-wrap: wrap; }
  .alerta .boton { margin-left: 0; width: 100%; }
}
@media (max-width: 420px) {
  .kpi .valor { font-size: 26px; }
  .anio-monto { font-size: 36px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .menu, .barra, .pestanas-movil, .avisos { display: none !important; } body { background: #fff; } }
.alto-esqueleto { height: 120px; }
/* Filas con acciones: el texto puede ocupar varias líneas y los botones bajan cuando falta espacio */
.item.cae .txt { flex: 1 1 200px; }
.item.cae .txt b { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.pagina > *, .tarjeta { min-width: 0; }
@media (max-width: 960px) {
  .item.cae { gap: 10px 12px; }
  .item.cae .botones { flex: 1 1 100%; justify-content: flex-start; padding-left: 54px; }
  .item.cae > .boton { margin-left: 54px; }
  .item.cae .der { margin-left: auto; }
}

/* ───────── Préstamos agrupados (activos / pagados por año) ───────── */
.grupo-prestamos { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra-1); overflow: hidden; }
.grupo-prestamos.nivel-2 { border-radius: 14px; box-shadow: none; background: var(--superficie-2); }
.grupo-cab, .fila-prestamo-cab { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px 20px; border: 0; background: transparent; text-align: left; }
.grupo-cab:hover, .fila-prestamo-cab:hover { background: var(--superficie-2); }
.nivel-2 > .grupo-cab:hover { background: #f1ede4; }
.grupo-titulo { flex: 1; min-width: 0; display: grid; }
.grupo-titulo b { font-size: 16px; color: var(--azul-900); }
.nivel-2 .grupo-titulo b { font-size: 15px; }
.grupo-titulo small { color: var(--texto-3); font-size: 13px; }
.flecha { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--texto-3); transition: transform .18s; flex: none; }
.flecha.abierta { transform: rotate(90deg); }
.grupo-cuerpo { padding: 4px 16px 16px; display: grid; gap: 14px; }
.nivel-2 .grupo-cuerpo { padding: 0 10px 10px; gap: 8px; }
.fila-prestamo { background: var(--superficie); border: 1px solid var(--linea); border-radius: 12px; overflow: hidden; }
.fila-prestamo-cab { padding: 12px 14px; }
.fila-prestamo > .tarjeta { border: 0; border-top: 1px solid var(--linea); border-radius: 0; box-shadow: none; }
@media (max-width: 960px) { .grupo-cab { padding: 14px 14px; } .grupo-cuerpo { padding: 2px 10px 12px; } }

/* ───────── Buscador de socios y paginador ───────── */
.paginador { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--linea); }
.pagina-actual { font-weight: 700; color: var(--texto-2); font-size: 14px; }
.gira { display: inline-flex; transform: rotate(180deg); }
.campo-ancho { grid-column: 1 / -1; }
.resultados-socio { display: grid; gap: 6px; margin-top: 4px; }
.resultado-socio { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--linea); border-radius: 12px; background: var(--superficie); text-align: left; }
.resultado-socio:hover, .resultado-socio:focus-visible { background: var(--verde-50); border-color: var(--verde-200); }
.resultado-socio span { color: var(--texto-3); font-size: 13px; }
.elegido { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--verde-50); color: var(--verde-800); font-weight: 600; }

/* ───────── Control total: tablas como hoja de cálculo ───────── */
.pagina.ancha { max-width: none; }
.hoja { max-height: 68vh; overflow: auto; margin-top: 12px; }
.hoja-tabla { min-width: 0; width: max-content; min-width: 100%; font-size: 13.5px; }
.hoja-tabla th { white-space: nowrap; top: 0; z-index: 2; }
.hoja-tabla td { white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.hoja-tabla .acciones-col { position: sticky; left: 0; z-index: 1; background: var(--superficie); display: flex; gap: 6px; align-items: center; border-right: 1px solid var(--linea); min-width: 120px; }
.hoja-tabla thead .acciones-col { background: var(--superficie-2); z-index: 3; }
.hoja-tabla tfoot td { position: sticky; bottom: 0; background: var(--oro-50); font-weight: 700; border-top: 2px solid var(--oro-300); }
.hoja-tabla tfoot .acciones-col { background: var(--oro-50); }
.hoja-tabla tbody tr:hover td { background: var(--verde-50); }
.hoja-tabla tbody tr:hover .acciones-col { background: var(--verde-50); }
.hoja-tabla th.col-editable::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--verde-500); }
.nulo { color: var(--texto-4); }
.json-corto { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--texto-2); }
td.clic { cursor: zoom-in; }
.json-completo { background: var(--superficie-2); border: 1px solid var(--linea); border-radius: 12px; padding: 14px; font-size: 13px; overflow: auto; max-height: 55vh; white-space: pre-wrap; }
.tam-pagina { font-size: 13px; color: var(--texto-3); display: flex; align-items: center; gap: 8px; }
.tam-pagina select { height: 34px; border: 1.5px solid var(--linea-fuerte); border-radius: 10px; padding: 0 8px; background: var(--superficie); }
.lista-hist { display: grid; gap: 12px; }
.hist { border: 1px solid var(--linea); border-radius: 12px; padding: 12px 14px; background: var(--superficie-2); }
.hist-cab { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hist-cab span, .hist-motivo { font-size: 13px; color: var(--texto-3); }
.hist-cambios { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; }
.hist-cambios .antes { color: var(--rojo-700); text-decoration: line-through; }
.hist-cambios .despues { color: var(--verde-700); font-weight: 600; }
/* Menú desplegable «Control total» */
.menu .boton-menu { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.menu .flecha-menu { margin-left: auto; display: grid; transition: transform .15s; }
.menu .boton-menu[aria-expanded="true"] .flecha-menu { transform: rotate(90deg); }
.submenu { display: grid; gap: 2px; margin: 0 0 6px 16px; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .12); }
.menu a.enlace.sub { padding: 7px 12px; font-size: 13.5px; font-weight: 500; }
.menu a.enlace.sub.activo::before { left: -11px; top: 7px; bottom: 7px; }
@media (max-width: 960px) { .hoja { max-height: 62vh; } .hoja-tabla .acciones-col { min-width: 104px; } }
.menu button.enlace { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: #c4d0e8; font: inherit; font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s; }
.menu button.enlace:hover { background: rgba(255, 255, 255, .07); color: #fff; }

/* ───────── Resumen financiero ───────── */
.linea-balance { display: flex; align-items: baseline; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--linea); }
.linea-balance .et { flex: 1; min-width: 0; display: grid; }
.linea-balance .et small { color: var(--texto-3); font-size: 12.5px; font-weight: 500; }
.linea-balance b { font-size: 16px; font-variant-numeric: tabular-nums; }
.linea-balance .ver { font-size: 12.5px; color: var(--azul-700); text-decoration: none; font-weight: 600; white-space: nowrap; }
.linea-balance .ver:hover { text-decoration: underline; }
.linea-balance.nivel-1 { padding-left: 22px; color: var(--texto-2); border-bottom-style: dashed; }
.linea-balance.nivel-1 b { font-size: 14.5px; font-weight: 600; }
.linea-balance.fuerte { border-top: 1.5px solid var(--linea-fuerte); border-bottom: 0; }
.linea-balance.fuerte b { font-size: 18px; color: var(--azul-900); }
.linea-balance.destacada { background: var(--verde-50); border: 1px solid var(--verde-200); border-radius: 14px; padding: 14px 16px; margin-top: 8px; }
.linea-balance.destacada b { color: var(--verde-800); font-size: 22px; font-family: var(--serif); }
.titulo-balance { margin: 16px 0 2px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--texto-3); font-weight: 800; }
.titulo-balance:first-of-type { margin-top: 0; }
.hero-fecha { text-align: right; display: grid; gap: 2px; }
.hero-fecha b { color: #fff; font-size: 15px; }
.tabla tfoot td { background: var(--superficie-2); font-weight: 700; border-top: 2px solid var(--linea-fuerte); }
.resumen-uti { margin-bottom: 14px; }
@media (max-width: 960px) { .hero-fecha { text-align: left; } .linea-balance .ver { display: none; } }
.insignia-estado { white-space: nowrap; }
