/* =====================================================================
   San Gabriel · capa visual v35 ("pulido")
   Se carga DESPUÉS de estilos.css y oscuro.css. Solo cambia el aspecto en
   pantalla (nunca lo impreso). Las clases de Tailwind siguen funcionando.
   ===================================================================== */
@media screen {

:root {
  --sg-950: #062f31; --sg-900: #0a3f43; --sg-800: #0d5f5f; --sg-700: #0f766e; --sg-600: #0d9488; --sg-500: #14b8a6; --sg-100: #ccfbf1; --sg-50: #f0fdfa;
  --fondo: #f2f5f7;
  --borde-card: rgba(15, 23, 42, 0.075);
  --sombra-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 6px 20px -10px rgba(15, 23, 42, 0.10);
  --sombra-card-hover: 0 2px 4px rgba(15, 23, 42, 0.05), 0 14px 32px -12px rgba(15, 23, 42, 0.18);
  --sombra-modal: 0 32px 80px -16px rgba(2, 20, 30, 0.45), 0 0 0 1px rgba(15, 23, 42, 0.06);
  --th-fondo: #f7f9fb; --th-texto: #64748b; --td-borde: #eef2f6; --fila-hover: rgba(13, 148, 136, 0.045);
}

/* ---------- Tipografía ---------- */
html { font-optical-sizing: auto; text-rendering: optimizeLegibility; }
body { font-feature-settings: "cv11", "ss01", "ss03"; letter-spacing: -0.006em; }
.font-black { font-weight: 800; }
:is(.text-xs, .text-\[11px\], .text-\[10px\], .text-\[9px\]).font-black { font-weight: 700; }
:is(h1, h2, h3, .text-xl, .text-2xl, .text-3xl, .text-4xl, .text-5xl) { letter-spacing: -0.02em; }
:is(.text-3xl, .text-4xl, .text-5xl).font-black { letter-spacing: -0.035em; }
.uppercase:not([class*="tracking-"]) { letter-spacing: 0.05em; }
.uppercase.tracking-wide, .uppercase.tracking-wider { letter-spacing: 0.06em; }
.tabular-nums, table, .kpi { font-variant-numeric: tabular-nums; }

/* ---------- Fondo general del sistema ---------- */
body.bg-slate-100 {
  background-color: var(--fondo);
  background-image:
    radial-gradient(1100px 520px at 100% -8%, rgba(20, 184, 166, 0.09), transparent 62%),
    radial-gradient(900px 480px at 18% -12%, rgba(14, 116, 144, 0.06), transparent 60%);
  background-attachment: fixed;
}

/* Un bloque oculto al principio ya no deja un hueco arriba */
:is(.space-y-2, .space-y-3, .space-y-4, .space-y-5, .space-y-6, .space-y-8) > :not(.hidden):not(.dash-oculto):not(:not(.hidden):not(.dash-oculto) ~ *) { margin-top: 0 !important; }

/* ---------- Menú lateral ---------- */
#sidebar {
  background: linear-gradient(180deg, #0f6664 0%, #0c5455 42%, #093f43 100%) !important;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}
#sidebar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(380px 240px at 0% 0%, rgba(94, 234, 212, 0.16), transparent 70%),
    radial-gradient(320px 320px at 110% 100%, rgba(45, 212, 191, 0.08), transparent 70%);
}
#sidebar > * { position: relative; }
#sidebar #headerLogo { filter: none; }
#menuNav { padding-top: 14px; }
#menuNav > div > p:first-child {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  color: rgba(204, 251, 241, 0.48); font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  cursor: pointer; user-select: none; border-radius: 8px; padding-top: 3px; padding-bottom: 3px;
}
#menuNav > div > p:first-child:hover { color: rgba(204, 251, 241, 0.85); }
#menuNav .grupo-flecha { width: 14px; height: 14px; opacity: 0.55; transition: transform 0.2s; }
#menuNav > div.grupo-cerrado .grupo-flecha { transform: rotate(-90deg); }
#menuNav > div.grupo-cerrado > div { display: none; }
#menuNav .grupo-cuenta { display: none; margin-left: auto; font-size: 10px; letter-spacing: 0; background: rgba(255, 255, 255, 0.08); color: rgba(204, 251, 241, 0.7); border-radius: 999px; padding: 1px 7px; }
#menuNav > div.grupo-cerrado .grupo-cuenta { display: inline-block; }
.nav-item { color: rgba(255, 255, 255, 0.72); font-weight: 600; border-radius: 10px; padding-top: 7px; padding-bottom: 7px; position: relative; }
.nav-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.nav-item .nav-icono { opacity: 0.8; }
.nav-item:hover .nav-icono { opacity: 1; }
.nav-item.activo {
  background: #fff; color: var(--sg-800); font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 10px 24px -10px rgba(0, 0, 0, 0.45);
}
.nav-item.activo .nav-icono { color: var(--sg-600); opacity: 1; }
#userAvatar { background: linear-gradient(135deg, #5eead4, #14b8a6); color: var(--sg-950); }

/* ---------- Barra superior ---------- */
#vistaApp > div > header.sticky {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6);
  border-bottom-color: rgba(15, 23, 42, 0.06);
}
#vistaApp > div > header.sticky > .ml-auto > button {
  background: #fff; border: 1px solid rgba(15, 23, 42, 0.08); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
#vistaApp > div > header.sticky > .ml-auto > button:hover { border-color: rgba(13, 148, 136, 0.35); color: var(--sg-700); background: #fff; }
#tituloSeccion { font-weight: 800; letter-spacing: -0.02em; }

/* ---------- Tarjetas ---------- */
#vistaApp :is(.bg-white.rounded-2xl, .bg-white.rounded-xl, .bg-white.rounded-3xl):is(.shadow-sm, .shadow, .shadow-md),
#vistaApp .kpi {
  border-color: var(--borde-card);
  box-shadow: var(--sombra-card);
}
#vistaApp .kpi { border-radius: 18px; transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s; }
#vistaApp :is(button, a).kpi:hover, #vistaApp .kpi:has(button):hover { transform: translateY(-2px); box-shadow: var(--sombra-card-hover); }
#vistaApp .kpi-icono { border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04); }
/* Encabezado de cada pantalla (la tarjeta con el título y los botones principales) */
#vistaApp .seccion-app .bg-white.rounded-2xl:has(> div:first-child > h2.text-lg:first-child):not(:has(table)) {
  position: relative;
  background-image: radial-gradient(420px 160px at 100% 0%, rgba(20, 184, 166, 0.10), transparent 70%), linear-gradient(100deg, #fff 50%, #f6fbfa);
}
#vistaApp .seccion-app .bg-white.rounded-2xl:has(> div:first-child > h2.text-lg:first-child):not(:has(table))::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 260px; max-width: 50%; pointer-events: none; opacity: 0.5; border-radius: 0 16px 16px 0;
  background-image: radial-gradient(rgba(13, 148, 136, 0.28) 1px, transparent 1.3px); background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); mask-image: linear-gradient(90deg, transparent, #000 70%);
}
#vistaApp .seccion-app .bg-white.rounded-2xl:has(> div:first-child > h2.text-lg:first-child):not(:has(table)) > * { position: relative; z-index: 1; }
#vistaApp .seccion-app .bg-white.rounded-2xl > div:first-child > h2.text-lg:first-child { font-size: 1.25rem; }
html.oscuro #vistaApp .seccion-app .bg-white.rounded-2xl:has(> div:first-child > h2.text-lg:first-child):not(:has(table)) { background-image: radial-gradient(420px 160px at 100% 0%, rgba(45, 212, 191, 0.10), transparent 70%); }
/* Títulos de bloque: todos con el mismo estilo (sin mayúsculas gritonas) */
#vistaApp :is(h2, h3, h4).uppercase:not(.text-\[10px\]):not(.text-\[11px\]):not(.text-\[9px\]),
[id^="modal"] :is(h3, h4).uppercase:is(.text-xs, .text-sm):not(.text-white) {
  text-transform: none; letter-spacing: -0.01em; font-size: 15px; font-weight: 800; color: #1e293b;
}

/* ---------- Botones ---------- */
:is(button, a):is([class~="bg-teal-600"], [class~="bg-teal-700"], [class~="bg-sg-main"], [class~="bg-sg-dark"], [class~="bg-emerald-600"], [class~="bg-emerald-500"], [class~="bg-green-600"], [class~="bg-red-600"], [class~="bg-red-500"], [class~="bg-blue-600"], [class~="bg-indigo-600"], [class~="bg-sky-500"], [class~="bg-sky-600"], [class~="bg-purple-600"], [class~="bg-violet-600"], [class~="bg-amber-500"], [class~="bg-orange-500"], [class~="bg-slate-800"], [class~="bg-slate-900"]):not(:disabled):not(.sin-estilo) {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 2px rgba(15, 23, 42, 0.18), 0 6px 16px -8px var(--sombra-boton, rgba(13, 148, 136, 0.6));
  transition: background-color 0.15s, box-shadow 0.2s, transform 0.15s, filter 0.15s;
}
:is(button, a):is([class~="bg-red-600"], [class~="bg-red-500"]) { --sombra-boton: rgba(220, 38, 38, 0.55); }
:is(button, a):is([class~="bg-blue-600"], [class~="bg-indigo-600"], [class~="bg-sky-500"], [class~="bg-sky-600"]) { --sombra-boton: rgba(37, 99, 235, 0.5); }
:is(button, a):is([class~="bg-purple-600"], [class~="bg-violet-600"]) { --sombra-boton: rgba(124, 58, 237, 0.5); }
:is(button, a):is([class~="bg-amber-500"], [class~="bg-orange-500"]) { --sombra-boton: rgba(217, 119, 6, 0.5); }
:is(button, a):is([class~="bg-slate-800"], [class~="bg-slate-900"]) { --sombra-boton: rgba(15, 23, 42, 0.55); }
:is(button, a):is([class~="bg-teal-600"], [class~="bg-teal-700"], [class~="bg-sg-main"], [class~="bg-sg-dark"], [class~="bg-emerald-600"], [class~="bg-emerald-500"], [class~="bg-green-600"], [class~="bg-red-600"], [class~="bg-red-500"], [class~="bg-blue-600"], [class~="bg-indigo-600"], [class~="bg-sky-500"], [class~="bg-sky-600"], [class~="bg-purple-600"], [class~="bg-violet-600"], [class~="bg-amber-500"], [class~="bg-orange-500"], [class~="bg-slate-800"], [class~="bg-slate-900"]):not(:disabled):not(.sin-estilo):hover {
  transform: translateY(-1px); filter: saturate(1.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 4px rgba(15, 23, 42, 0.16), 0 10px 22px -8px var(--sombra-boton, rgba(13, 148, 136, 0.65));
}
:is(button, a):not(:disabled):active { transform: translateY(1px) !important; }
/* El verde principal un poco más vivo */
:is(button, a):is([class~="bg-teal-600"], [class~="bg-sg-main"]):not(.sin-estilo) { background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0)); }
/* Botones blancos con borde: al pasar el mouse se tiñen apenas */
#vistaApp button[class~="bg-white"][class*="border"]:not(:disabled):hover,
[id^="modal"] button[class~="bg-white"][class*="border"]:not(:disabled):hover { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 14px -8px rgba(15, 23, 42, 0.2); }
button:disabled, button[disabled] { filter: grayscale(0.25); }

/* ---------- Campos ---------- */
:is(.seccion-app, [id^="modal"], #vistaLogin) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):not([type="range"]), select, textarea):not(.sin-estilo):hover:not(:focus):not(:disabled) { border-color: rgb(203 213 225); }
:is(.seccion-app, [id^="modal"]) select:not(.sin-estilo) { cursor: pointer; }
:is(.seccion-app, [id^="modal"]) label.block, :is(.seccion-app, [id^="modal"]) label.text-\[10px\] { color: #5b6b80; }

/* ---------- Tablas ---------- */
:is(#vistaApp, [id^="modal"]) table > thead { background: var(--th-fondo); }
:is(#vistaApp, [id^="modal"]) table > thead th {
  color: var(--th-texto); font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  border-bottom: 1px solid #e6ebf1; background-color: var(--th-fondo);
}
:is(#vistaApp, [id^="modal"]) table > thead[class*="bg-teal"] th,
:is(#vistaApp, [id^="modal"]) table > thead[class*="bg-slate-8"] th,
:is(#vistaApp, [id^="modal"]) table > thead[class*="bg-sg"] th { background-color: transparent; color: inherit; }
:is(#vistaApp, [id^="modal"]) table > tbody > tr > td { border-color: var(--td-borde); }
:is(#vistaApp, [id^="modal"]) table > tbody > tr:not([class*="bg-"]):hover > td { background-color: var(--fila-hover); }
:is(#vistaApp, [id^="modal"]) table > tfoot { background: linear-gradient(180deg, #f8fafc, #f3f6f9); }
:is(#vistaApp, [id^="modal"]) table > tbody > tr > td[colspan].italic,
:is(#vistaApp, [id^="modal"]) table > tbody > tr > td[colspan]:only-child.text-slate-400 { padding-top: 34px !important; padding-bottom: 34px !important; font-style: normal; color: #94a3b8; }
:is(#vistaApp, [id^="modal"]) table > tbody > tr > td[colspan].italic::before,
:is(#vistaApp, [id^="modal"]) table > tbody > tr > td[colspan]:only-child.text-slate-400::before {
  content: ""; display: block; width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 12px;
  background: #f1f5f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / 20px no-repeat;
}
/* Números de documento, ficha y códigos: misma letra que el resto, con cifras parejas */
:is(#vistaApp, [id^="modal"]) :is(td, span, div, p, b).font-mono { font-family: inherit; font-feature-settings: "tnum"; letter-spacing: 0; }

/* Etiquetas de tipo (CUOTA, GASTO…) */
.etq { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.5; white-space: nowrap; }
.etq::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; opacity: 0.7; }
.etq-cuota { background: #e6f7f5; color: #0f766e; }
.etq-consulta { background: #eef2ff; color: #4338ca; }
.etq-gasto { background: #fef2f2; color: #b91c1c; }
.etq-ingreso { background: #eff6ff; color: #1d4ed8; }
.etq-otro { background: #f1f5f9; color: #475569; }

/* ---------- Pestañas tipo "segmento" ---------- */
#vistaApp [class~="bg-slate-100"][class~="p-1"][class~="rounded-xl"] { background: #eef2f5; box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05); }
#vistaApp [class~="bg-slate-100"][class~="p-1"][class~="rounded-xl"] > button[class~="bg-white"] { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 2px 8px -2px rgba(15, 23, 42, 0.12); color: var(--sg-800); }

/* ---------- Ventanas ---------- */
[id^="modal"].fixed.inset-0:not(.hidden) {
  background-color: rgba(8, 20, 32, 0.5);
  -webkit-backdrop-filter: blur(6px) saturate(1.2); backdrop-filter: blur(6px) saturate(1.2);
}
[id^="modal"].fixed.inset-0:not(.hidden) > div:first-child,
[id^="modal"].fixed.inset-0:not(.hidden) > form:first-child {
  box-shadow: var(--sombra-modal);
  animation: sg-ventana 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
[id^="modal"].fixed.inset-0 > div:first-child.rounded-2xl { border-radius: 20px; }
@keyframes sg-ventana { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
/* Encabezados oscuros de ventana: degradé suave con brillo */
[id^="modal"] :is([class~="bg-sg-dark"], [class~="from-teal-900"], [class~="bg-teal-800"], [class~="bg-teal-900"]):not(button) {
  background-image: radial-gradient(500px 160px at 0% 0%, rgba(94, 234, 212, 0.18), transparent 70%), linear-gradient(120deg, #0a4f51 0%, #0d6461 55%, #0f766e 100%);
}

/* Perfil: si no hay notas, el grupo familiar ocupa todo el ancho */
.lg\:grid-cols-3:has(> #perfilNotasDiv.hidden) > .lg\:col-span-2 { grid-column: 1 / -1; }
/* Botón de cerrar (×) de las ventanas con encabezado oscuro */
[id^="modal"] :is([class~="bg-sg-dark"], [class~="from-teal-900"], [class~="bg-teal-800"], [class~="bg-teal-900"], [class~="from-sg-dark"]) button:is(.text-2xl, .text-3xl) {
  width: 36px; height: 36px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px;
  background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 24px; font-weight: 400; line-height: 1;
}
[id^="modal"] :is([class~="bg-sg-dark"], [class~="from-teal-900"], [class~="bg-teal-800"], [class~="bg-teal-900"], [class~="from-sg-dark"]) button:is(.text-2xl, .text-3xl):hover { background: rgba(255, 255, 255, 0.2); }

/* ---------- Avisos flotantes ---------- */
#toast-container > div {
  border-radius: 16px !important; width: 330px !important;
  box-shadow: 0 20px 44px -14px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.04) !important;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
#toast-container > div > span:first-child { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.6); font-size: 18px; }

/* ---------- Inicio: tarjeta de bienvenida y accesos ---------- */
.hero-inicio {
  position: relative; overflow: hidden; border-radius: 24px; color: #fff; padding: 26px 28px 22px;
  background:
    radial-gradient(520px 260px at 100% 0%, rgba(94, 234, 212, 0.28), transparent 70%),
    radial-gradient(420px 300px at 0% 120%, rgba(45, 212, 191, 0.18), transparent 70%),
    linear-gradient(120deg, #0a4a4c 0%, #0d6461 50%, #0f7a72 100%);
  box-shadow: 0 18px 40px -22px rgba(6, 47, 49, 0.75);
}
.hero-inicio::before { /* trama de puntos */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.22;
  background-image: radial-gradient(rgba(255, 255, 255, 0.45) 1px, transparent 1.2px); background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 100%); mask-image: linear-gradient(100deg, transparent 35%, #000 100%);
}
.hero-inicio::after { /* cruz médica de fondo */
  content: ""; position: absolute; right: 34px; top: -26px; width: 150px; height: 150px; transform: rotate(-10deg); opacity: 0.07; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 2h6a1 1 0 0 1 1 1v5h5a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-5v5a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1v-5H3a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h5V3a1 1 0 0 1 1-1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hero-inicio > * { position: relative; z-index: 1; }
.hero-inicio #saludoDashboard { color: #fff; }
.hero-inicio .hero-fecha { color: rgba(204, 251, 241, 0.85); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.hero-inicio .hero-sub { color: rgba(236, 253, 245, 0.78); }
#accesosRapidos { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin-top: 20px; }
#accesosRapidos > .acceso {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left;
  padding: 12px 14px 13px; border-radius: 16px; font-size: 13px; font-weight: 700; line-height: 1.2; color: #fff;
  background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background-color 0.15s, transform 0.15s, border-color 0.15s;
}
#accesosRapidos > .acceso:hover { background: rgba(255, 255, 255, 0.17); border-color: rgba(255, 255, 255, 0.28); transform: translateY(-2px); }
#accesosRapidos > .acceso > span:first-child { width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.14); font-size: 16px; }
#accesosRapidos > .acceso.principal { background: #fff; color: var(--sg-800); border-color: #fff; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.5); }
#accesosRapidos > .acceso.principal > span:first-child { background: var(--sg-600); color: #fff; }
#btnPersonalizarInicio { color: #64748b; }

/* ---------- Perfil del socio: avatar con iniciales ---------- */
.avatar-perfil { width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; letter-spacing: 0.02em;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); color: #fff; }

/* ---------- Pantalla de ingreso ---------- */
#vistaLogin.grid > div:first-child::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.25;
  background-image: radial-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(70% 60% at 70% 30%, #000, transparent); mask-image: radial-gradient(70% 60% at 70% 30%, #000, transparent);
}
#vistaLogin.grid > div:first-child > * { z-index: 1; }
#vistaLogin.grid > div:last-child { background: radial-gradient(700px 400px at 100% 0%, rgba(20, 184, 166, 0.08), transparent 70%), #fff; }
#vistaLogin #formLogin input { background: #fff; border-color: #e2e8f0; padding-top: 13px; padding-bottom: 13px; border-radius: 14px; }
#vistaLogin #formLogin button[type="submit"] { border-radius: 14px; font-size: 15px; }
.login-tarjetas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 36px; max-width: 420px; }
.login-tarjetas > div { border-radius: 16px; padding: 14px 16px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.login-tarjetas b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; color: #fff; }
.login-tarjetas span { font-size: 11.5px; color: rgba(204, 251, 241, 0.75); font-weight: 600; }

/* ---------- Pantalla de carga ---------- */
#cargandoApp { background: radial-gradient(600px 400px at 50% 40%, rgba(94, 234, 212, 0.18), transparent 70%), linear-gradient(135deg, #0a4a4c, #0b3a40 60%, #0b1f2e) !important; }

/* ---------- Detalles ---------- */
::selection { background: #99f6e4; color: #042f2e; }
#vistaApp a:not([class]) { color: var(--sg-700); }
hr { border-color: #e9eef3; }
kbd { font-family: inherit; }

/* =========================== Portal del socio =========================== */
.portal-login { box-shadow: 0 30px 70px -30px rgba(6, 47, 49, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.05); position: relative; }
.portal-login::before { content: ""; position: absolute; left: 32px; right: 32px; top: 0; height: 4px; border-radius: 0 0 6px 6px; background: linear-gradient(90deg, #14b8a6, #0d9488 50%, #10b981); }
#vistaLogin.min-h-screen:has(.portal-login) {
  background:
    radial-gradient(700px 420px at 85% -10%, rgba(20, 184, 166, 0.16), transparent 65%),
    radial-gradient(600px 400px at -10% 110%, rgba(16, 185, 129, 0.10), transparent 65%);
}
.portal-login input { background: #f8fafc; }
.portal-cabecera {
  background: radial-gradient(500px 120px at 0% 0%, rgba(94, 234, 212, 0.2), transparent 70%), linear-gradient(110deg, #0a4a4c, #0d6461 60%, #0f766e);
  box-shadow: 0 8px 24px -14px rgba(6, 47, 49, 0.6);
}
.hero-portal {
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(94, 234, 212, 0.28), transparent 70%),
    linear-gradient(120deg, #0a4a4c 0%, #0d6461 55%, #0f7a72 100%);
  box-shadow: 0 18px 40px -22px rgba(6, 47, 49, 0.7);
}
.hero-portal > .absolute { display: none; }
.hero-portal::after {
  content: ""; position: absolute; right: 22px; top: -18px; width: 120px; height: 120px; transform: rotate(-10deg); opacity: 0.08; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 2h6a1 1 0 0 1 1 1v5h5a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1h-5v5a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1v-5H3a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h5V3a1 1 0 0 1 1-1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
#vistaDashboard .rounded-2xl.shadow-sm { border-color: var(--borde-card); box-shadow: var(--sombra-card); }
#vistaDashboard h3.uppercase { text-transform: none; letter-spacing: -0.01em; font-size: 15px; font-weight: 800; color: #1e293b; }
#vistaDashboard h3.uppercase > span:first-child { width: 30px; height: 30px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #f0fdfa; color: #0d9488; }
#vistaDashboard .rounded-2xl > .bg-slate-50.border-b { background: #fff; border-bottom-color: #f1f5f9; }

/* =========================== Modo oscuro =========================== */
html.oscuro { --fondo: #0a1222; --borde-card: rgba(148, 163, 184, 0.12); --th-fondo: #0f182b; --th-texto: #8a9ab3; --td-borde: #1b2640; --fila-hover: rgba(45, 212, 191, 0.05);
  --sombra-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.5); --sombra-card-hover: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 36px -12px rgba(0, 0, 0, 0.6); }
:where(html.oscuro body *, html.oscuro body ::before, html.oscuro body ::after) { border-color: #22304a; }
html.oscuro body.bg-slate-100 { background-color: #0a1222; background-image: radial-gradient(1100px 520px at 100% -8%, rgba(20, 184, 166, 0.08), transparent 62%), radial-gradient(900px 480px at 18% -12%, rgba(56, 189, 248, 0.04), transparent 60%); }
html.oscuro #sidebar { background: linear-gradient(180deg, #0b3f43 0%, #08303a 50%, #071f2c 100%) !important; }
html.oscuro .nav-item.activo { background: rgba(255, 255, 255, 0.94); }
html.oscuro #vistaApp > div > header.sticky { background: rgba(10, 18, 34, 0.72); border-bottom-color: rgba(148, 163, 184, 0.1); }
html.oscuro #vistaApp > div > header.sticky > .ml-auto > button { background: #121c30; border-color: #26344e; color: #cbd5e1; }
html.oscuro :is(#vistaApp, [id^="modal"]) table > thead th { border-bottom-color: #1f2b44; }
html.oscuro :is(#vistaApp, [id^="modal"]) table > tfoot { background: #0f182b; }
html.oscuro :is(#vistaApp, [id^="modal"]) table > tbody > tr > td[colspan]::before { background-color: #16223a; }
html.oscuro #vistaApp :is(h2, h3, h4).uppercase:not(.text-\[10px\]):not(.text-\[11px\]):not(.text-\[9px\]),
html.oscuro [id^="modal"] :is(h3, h4).uppercase:is(.text-xs, .text-sm):not(.text-white) { color: #e2e8f0; }
html.oscuro #vistaApp [class~="bg-slate-100"][class~="p-1"][class~="rounded-xl"] { background: #0f182b; box-shadow: inset 0 0 0 1px #1f2b44; }
html.oscuro #vistaApp [class~="bg-slate-100"][class~="p-1"][class~="rounded-xl"] > button[class~="bg-white"] { background: #1c2942; color: #5eead4; }
html.oscuro .etq-cuota { background: rgba(20, 184, 166, 0.14); color: #5eead4; }
html.oscuro .etq-consulta { background: rgba(99, 102, 241, 0.16); color: #a5b4fc; }
html.oscuro .etq-gasto { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
html.oscuro .etq-ingreso { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
html.oscuro .etq-otro { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; }
html.oscuro .hero-inicio { background: radial-gradient(520px 260px at 100% 0%, rgba(94, 234, 212, 0.18), transparent 70%), linear-gradient(120deg, #083a3e 0%, #0b4e50 50%, #0d5f5d 100%); box-shadow: 0 0 0 1px rgba(94, 234, 212, 0.1); }
html.oscuro [id^="modal"].fixed.inset-0:not(.hidden) { background-color: rgba(2, 6, 14, 0.65); }
html.oscuro #toast-container > div > span:first-child { background: rgba(255, 255, 255, 0.08); }

/* ---------- Celular ---------- */
@media (max-width: 767px) {
  .hero-inicio { padding: 20px 18px 18px; border-radius: 20px; }
  .hero-inicio::after { width: 96px; height: 96px; right: 10px; top: 46px; }
  #accesosRapidos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
  #accesosRapidos > .acceso { flex-direction: row; align-items: center; padding: 10px 11px; font-size: 12.5px; }
  #accesosRapidos > .acceso > span:first-child { width: 28px; height: 28px; flex-shrink: 0; }
  #toast-container { left: 12px; right: 12px !important; bottom: 12px !important; }
  #toast-container > div { width: auto !important; }
  .tabla-apilada > tbody > tr, .tabla-apilada > tfoot > tr { border-color: var(--borde-card) !important; border-radius: 16px; box-shadow: var(--sombra-card) !important; }
}

@media (prefers-reduced-motion: reduce) {
  [id^="modal"].fixed.inset-0:not(.hidden) > div:first-child { animation: none; }
  #vistaApp .kpi, #accesosRapidos > .acceso, :is(button, a) { transition: none !important; }
}
} /* fin @media screen */

/* =====================================================================
   v44 · Psicofísicos
   ===================================================================== */
@media screen {
.psi-hero { background: linear-gradient(120deg, var(--sg-800) 0%, var(--sg-700) 55%, #0e7490 100%); color: #fff; box-shadow: var(--sombra-card); position: relative; overflow: hidden; }
.psi-hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.14), transparent 65%); pointer-events: none; }
.psi-hero > * { position: relative; z-index: 1; }
.psi-hero-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); }
.psi-hero-ico .ico { width: 24px; height: 24px; }
.psi-btn-pri { background: #fff; color: var(--sg-800); box-shadow: 0 6px 18px -8px rgba(0,0,0,.35); }
.psi-btn-pri:hover { background: var(--sg-50); }
.psi-btn-sec { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.28); }
.psi-btn-sec:hover { background: rgba(255,255,255,.2); }

.psi-kpi { border-color: var(--borde-card); box-shadow: var(--sombra-card); transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; overflow: hidden; min-width: 0; }
.psi-kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--psi-c); opacity: .85; }
.psi-kpi:hover { transform: translateY(-1px); box-shadow: var(--sombra-card-hover); }
.psi-kpi-on { border-color: var(--psi-c) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--psi-c) 18%, transparent), var(--sombra-card); }
.psi-kpi-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: var(--psi-c); background: color-mix(in srgb, var(--psi-c) 12%, transparent); }
.psi-kpi-amber { --psi-c: #d97706; } .psi-kpi-sky { --psi-c: #0284c7; } .psi-kpi-emerald { --psi-c: #059669; } .psi-kpi-violet { --psi-c: #7c3aed; }

.psi-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #475569; background: #f1f5f9; border: 1px solid transparent; transition: background .15s; }
.psi-chip:hover { background: #e2e8f0; }
.psi-chip-on { background: var(--sg-700); color: #fff; }
.psi-chip-on:hover { background: var(--sg-800); }
.psi-chip-n { font-size: 10px; padding: 0 6px; border-radius: 999px; background: rgba(15,23,42,.08); }
.psi-chip-on .psi-chip-n { background: rgba(255,255,255,.22); }

.psi-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.psi-dot-falta { border: 1.5px dashed #cbd5e1; background: #fff; }
.psi-dot-hecho { background: #14b8a6; }
.psi-dot-pagado { background: #2563eb; }

.psi-fila { transition: background .15s; }
.psi-fila:hover { background: var(--fila-hover); }
.psi-fila-dem { box-shadow: inset 3px 0 0 #ef4444; }
.psi-av { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--sg-800); background: linear-gradient(135deg, var(--sg-100), #e0f2fe); }

.psi-et { border-radius: 10px; padding: 5px 4px; text-align: center; min-width: 0; border: 1.5px solid transparent; }
.psi-et-n { display: block; font-size: 10px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psi-et-f { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.psi-et-f .ico { width: 11px; height: 11px; }
.psi-et-falta { border-style: dashed; border-color: #cbd5e1; color: #94a3b8; background: #fff; }
.psi-et-falta .psi-et-f { font-weight: 600; }
.psi-et-hecho { background: #ccfbf1; color: #115e59; border-color: #99f6e4; }
.psi-et-pagado { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }

.psi-barra { height: 5px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.psi-barra i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sg-600), #0ea5e9); }

.psi-pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; background: #f1f5f9; color: #475569; }
.psi-est-proc { background: #fef3c7; color: #92400e; } .psi-est-fin { background: #e0f2fe; color: #075985; } .psi-est-sub { background: #d1fae5; color: #065f46; }
.psi-res-apto { background: #059669; color: #fff; } .psi-res-lentes { background: #0d9488; color: #fff; } .psi-res-no { background: #dc2626; color: #fff; } .psi-res-obs { background: #f59e0b; color: #fff; } .psi-res-pend { background: #f1f5f9; color: #64748b; }

.psi-accion { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #475569; background: #f1f5f9; transition: background .15s, color .15s; }
.psi-accion:hover { background: var(--sg-100); color: var(--sg-800); }
.psi-accion-borrar:hover { background: #fee2e2; color: #dc2626; }

.psi-modal-head { background: linear-gradient(120deg, var(--sg-800), var(--sg-700)); color: #fff; }
.psi-sub { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--sg-700); }
.psi-lbl { display: block; font-size: 11px; font-weight: 700; color: #64748b; margin-bottom: 4px; }
.psi-inp { width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 14px; outline: none; background: #fff; transition: border-color .15s, box-shadow .15s; }
.psi-inp:focus { border-color: var(--sg-500); box-shadow: 0 0 0 3px rgba(20,184,166,.18); }
.psi-inp:disabled { background: #eff6ff; color: #1e40af; cursor: not-allowed; }
.psi-inp-sm { padding: 6px 8px; font-size: 13px; min-width: 0; }
.psi-etapa-in { display: grid; grid-template-columns: 30px minmax(0, 1fr) 134px auto; align-items: center; gap: 6px; padding: 6px; border-radius: 12px; border: 1px solid #e2e8f0; background: #fff; transition: background .15s, border-color .15s; }
.psi-et-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 10px; font-weight: 800; background: #f1f5f9; color: #64748b; }
.psi-et-nom { font-size: 11.5px; font-weight: 700; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psi-hoy { font-size: 11px; font-weight: 800; color: var(--sg-700); padding: 5px 9px; border-radius: 8px; background: var(--sg-50); }
.psi-hoy:hover { background: var(--sg-100); }
.psi-etapa-ok { border-color: #99f6e4; background: #f0fdfa; }
.psi-etapa-ok .psi-et-ico { background: #14b8a6; color: #fff; }
.psi-etapa-pagada { border-color: #bfdbfe; background: #eff6ff; }
.psi-etapa-pagada .psi-et-ico { background: #2563eb; color: #fff; }
.psi-etapa-pagada .psi-hoy { visibility: hidden; }

.psi-area { display: flex; flex-direction: column; align-items: center; padding: 10px 6px; border-radius: 14px; border: 1.5px solid #e2e8f0; background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 0; }
.psi-area:hover { border-color: var(--sg-500); transform: translateY(-1px); }
.psi-area-n { font-size: 22px; font-weight: 800; line-height: 1; color: #7c3aed; }
.psi-area-t { font-size: 12px; font-weight: 800; color: #334155; margin-top: 4px; }
.psi-area-s { font-size: 10px; color: #94a3b8; }
.psi-area-cero .psi-area-n { color: #10b981; }
.psi-area-on { border-color: var(--sg-600); background: var(--sg-50); box-shadow: 0 0 0 3px rgba(20,184,166,.18); }

/* Oscuro */
html.oscuro .psi-chip { background: #16213a; color: #cbd5e1; }
html.oscuro .psi-chip:hover { background: #1e2b48; }
html.oscuro .psi-chip-on { background: var(--sg-600); color: #fff; }
html.oscuro .psi-chip-n { background: rgba(255,255,255,.08); }
html.oscuro .psi-dot-falta, html.oscuro .psi-et-falta { background: transparent; border-color: #334155; color: #64748b; }
html.oscuro .psi-et-hecho { background: rgba(20,184,166,.16); color: #5eead4; border-color: rgba(45,212,191,.3); }
html.oscuro .psi-et-pagado { background: rgba(59,130,246,.16); color: #93c5fd; border-color: rgba(96,165,250,.3); }
html.oscuro .psi-av { background: rgba(45,212,191,.14); color: #5eead4; }
html.oscuro .psi-barra { background: #1e293b; }
html.oscuro .psi-pill, html.oscuro .psi-res-pend { background: #16213a; color: #94a3b8; }
html.oscuro .psi-est-proc { background: rgba(245,158,11,.16); color: #fcd34d; } html.oscuro .psi-est-fin { background: rgba(14,165,233,.16); color: #7dd3fc; } html.oscuro .psi-est-sub { background: rgba(16,185,129,.16); color: #6ee7b7; }
html.oscuro .psi-accion { background: #16213a; color: #94a3b8; }
html.oscuro .psi-accion:hover { background: rgba(45,212,191,.14); color: #5eead4; }
html.oscuro .psi-accion-borrar:hover { background: rgba(239,68,68,.15); color: #fca5a5; }
html.oscuro .psi-inp { background: #0f182b; border-color: #2a3954; color: #e2e8f0; }
html.oscuro .psi-inp:disabled { background: rgba(59,130,246,.1); color: #93c5fd; }
html.oscuro .psi-etapa-in, html.oscuro .psi-area { background: #0f182b; border-color: #22304a; }
html.oscuro .psi-et-ico { background: #16213a; color: #94a3b8; }
html.oscuro .psi-et-nom, html.oscuro .psi-area-t { color: #cbd5e1; }
html.oscuro .psi-hoy { background: rgba(45,212,191,.12); color: #5eead4; }
html.oscuro .psi-etapa-ok { background: rgba(20,184,166,.08); border-color: rgba(45,212,191,.3); }
html.oscuro .psi-etapa-pagada { background: rgba(59,130,246,.08); border-color: rgba(96,165,250,.3); }
html.oscuro .psi-area-on { background: rgba(20,184,166,.1); border-color: var(--sg-500); }
html.oscuro .psi-sub { color: #5eead4; }
html.oscuro .psi-lbl { color: #94a3b8; }
}

/* v44 · historial de rendiciones, cobradores, bajas y papelera */
@media screen {
.psi-hero-rojo { background: linear-gradient(120deg, #7f1d1d 0%, #9f1239 55%, #be123c 100%); }
.psi-hero-gris { background: linear-gradient(120deg, #1e293b 0%, #334155 60%, #475569 100%); }
.psi-av-rojo { background: linear-gradient(135deg, #ffe4e6, #fef2f2); color: #9f1239; }
.hr-cob { box-shadow: var(--sombra-card); transition: transform .15s, border-color .15s, box-shadow .15s; min-width: 0; }
.hr-cob:hover { transform: translateY(-1px); border-color: var(--sg-500); }
.hr-cob-on { border-color: var(--sg-600) !important; box-shadow: 0 0 0 3px rgba(20,184,166,.18), var(--sombra-card); }
.hr-fila { transition: background .15s; }
.hr-fila:hover { background: var(--fila-hover); }
.hr-hora { min-width: 52px; padding: 6px 8px; border-radius: 10px; background: var(--sg-50); color: var(--sg-800); font-weight: 800; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.hr-dia { background: linear-gradient(90deg, #f8fafc, #fff); }
.pap-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.pap-ico-socio { background: #ffe4e6; color: #be123c; }
.pap-ico-recibo { background: #fef3c7; color: #b45309; }
html.oscuro .hr-hora { background: rgba(45,212,191,.12); color: #5eead4; }
html.oscuro .hr-dia { background: linear-gradient(90deg, #0f182b, transparent); }
html.oscuro .psi-av-rojo { background: rgba(244,63,94,.14); color: #fda4af; }
html.oscuro .pap-ico-socio { background: rgba(244,63,94,.14); color: #fda4af; }
html.oscuro .pap-ico-recibo { background: rgba(245,158,11,.14); color: #fcd34d; }
}
