/* ============================================================================
   Portal del Socio — COOPUCATECI · sistema de estilos propio (mobile-first).
   Identidad: verde cooperativo + dorado. Diseño tipo app: tarjetas suaves,
   gradientes, glass, navegación inferior y micro-animaciones.
   ========================================================================== */

:root {
    --pf-green:      #14a05c;   /* primario más vivo */
    --pf-green-400:  #2ec27e;   /* verde brillante (acentos, activos) */
    --pf-green-600:  #0f8a4e;
    --pf-green-700:  #0c6b3d;
    --pf-green-900:  #0a3d27;
    --pf-gold:       #e0a82e;
    --pf-gold-600:   #c8901a;

    --pf-bg:         #e9f1ec;
    --pf-surface:    #ffffff;
    --pf-ink:        #14231b;
    --pf-muted:      #343434;
    --pf-line:       #e6ece7;
    --pf-danger:     #d64545;
    --pf-warning:    #c8901a;
    --pf-success:    #148f5b;
    --pf-info:       #1c7ea3;

    --pf-radius:     18px;
    --pf-radius-sm:  12px;
    --pf-shadow:     0 6px 24px rgba(13, 92, 58, .10), 0 1px 2px rgba(13, 92, 58, .06);
    --pf-shadow-lg:  0 18px 48px rgba(13, 92, 58, .18);
    --pf-font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Proyecto profesional: SIEMPRE en claro (sin modo oscuro), incluso si el SO
   del socio está en dark. Forzamos el esquema claro. */
:root { color-scheme: light; }

/* ── Fuente del Portal: "Plus Jakarta Sans" (suave, moderna, profesional).
   Auto-alojada en el proyecto (licencia OFL) → se consume SIEMPRE local, sin CDN. ── */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("./fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("./fonts/plus-jakarta-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("./fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("./fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 800; font-display: swap; src: url("./fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--pf-font);
    background: var(--pf-bg);
    color: var(--pf-ink);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    font-size: 16px;
}
a { color: var(--pf-green-600); text-decoration: none; }
img { max-width: 100%; }

/* Scrollbar fina y sutil (mismo estándar que el backoffice) */
* { scrollbar-width: thin; scrollbar-color: rgba(12,60,40,.28) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; -webkit-appearance: none; }
::-webkit-scrollbar-thumb { background-color: rgba(12,60,40,.24); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(12,60,40,.4); }
::-webkit-scrollbar-track { background: transparent; border-radius: 10px; }
::-webkit-scrollbar-corner { background: transparent; }

/* ── App shell (contenedor tipo teléfono en desktop) ── */
.pf-app { max-width: 520px; margin: 0 auto; min-height: 100vh; position: relative; background: var(--pf-bg); }

/* ============================ AUTH (login split con imagen) ============================ */
.pf-auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--pf-surface); }

/* Panel del formulario (izquierda) */
.pf-auth-main { position: relative; display: flex; align-items: center; justify-content: center; padding: 48px 24px 44px; background: var(--pf-surface); }
.pf-auth-card-logo { text-align: center; margin-bottom: 18px; }
.pf-auth-card-logo img { height: 88px; width: auto; }
.pf-auth-card { width: 100%; max-width: 360px; background: transparent; border-radius: 0; padding: 0; box-shadow: none; animation: pf-up .5s both; }
.pf-auth-card h1 { font-size: 28px; font-weight: 800; color: var(--pf-green-700); text-align: center; margin: 0 0 6px; }
.pf-auth-card .pf-sub { color: var(--pf-muted); font-size: 14px; text-align: center; margin: 0 0 26px; }
.pf-auth-foot { text-align: center; margin-top: 18px; color: var(--pf-muted); font-size: 13px; }
.pf-auth-foot a { color: var(--pf-green-700); font-weight: 700; }

/* Panel de imagen + bienvenida (derecha) */
.pf-auth-aside {
    position: relative; overflow: hidden; color: #fff;
    display: flex; align-items: center; padding: 56px 52px; min-height: 320px;
    background-image:
        linear-gradient(135deg, rgba(20,143,91,.82), rgba(10,61,39,.92)),
        url("../images/portal-login.jpg");
    background-size: cover; background-position: center;
}
.pf-auth-aside::after { content: ""; position: absolute; right: -90px; bottom: -130px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,.12), transparent); pointer-events: none; }
.pf-auth-aside-inner { position: relative; z-index: 1; animation: pf-up .6s .1s both; max-width: 480px; }
.pf-auth-welcome { font-size: 48px; font-weight: 800; line-height: 1.08; margin: 0 0 16px; letter-spacing: -.01em; }
.pf-auth-welcome b { color: var(--pf-gold); }
.pf-auth-tag { font-size: 15.5px; opacity: .92; margin: 0 0 26px; max-width: 42ch; line-height: 1.5; }
.pf-auth-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pf-auth-feats li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 600; }
.pf-auth-feats .ic { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); display: flex; align-items: center; justify-content: center; font-size: 19px; flex: 0 0 auto; }

/* Escritorio: formulario (izq, angosto) | imagen (der, ancho) */
@media (min-width: 900px) { .pf-auth { grid-template-columns: .82fr 1.18fr; } }
/* Móvil: imagen como cabecera compacta arriba, formulario abajo */
@media (max-width: 899px) {
    .pf-auth-aside { order: -1; padding: 30px 24px; min-height: auto; }
    .pf-auth-welcome { font-size: 30px; }
    .pf-auth-tag { margin-bottom: 0; }
    .pf-auth-feats { display: none; }
    .pf-auth-card-logo img { height: 72px; }
    .pf-auth-main { padding: 24px 22px 36px; }
}

/* ── Form ── */
.pf-field { margin-bottom: 15px; }
.pf-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--pf-ink); }
.pf-input {
    width: 100%; height: 52px; padding: 0 15px;
    border: 1.5px solid var(--pf-line); border-radius: var(--pf-radius-sm);
    background: var(--pf-surface); color: var(--pf-ink); font-size: 16px;
    transition: border-color .15s, box-shadow .15s;
}
.pf-input:focus { outline: none; border-color: var(--pf-green); box-shadow: 0 0 0 4px rgba(20,143,91,.14); }
.pf-input-group { position: relative; }
.pf-input-group .pf-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    border: 0; background: transparent; color: var(--pf-muted); font-size: 13px; font-weight: 700;
    padding: 8px 10px; cursor: pointer; border-radius: 8px;
}
.pf-hint { font-size: 12px; color: var(--pf-muted); margin-top: 6px; }

.pf-btn {
    width: 100%; height: 52px; border: 0; border-radius: var(--pf-radius-sm);
    background: linear-gradient(135deg, var(--pf-green), var(--pf-green-700));
    color: #fff; font-size: 16px; font-weight: 800; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 8px 20px rgba(20,143,91,.30); transition: transform .2s ease, box-shadow .25s ease, filter .25s ease;
}
.pf-btn:hover { filter: brightness(1.05); box-shadow: 0 10px 26px rgba(20,143,91,.38); }
.pf-btn:active { transform: translateY(1px) scale(.995); }
.pf-btn-gold { background: linear-gradient(135deg, var(--pf-gold), var(--pf-gold-600)); box-shadow: 0 8px 20px rgba(200,144,26,.30); }
.pf-btn-ghost { background: transparent; color: var(--pf-green-700); box-shadow: none; border: 1.5px solid var(--pf-line); }
/* Botón de salida (cerrar sesión): rojo suave, distinto a las acciones verdes */
.pf-btn-logout { background: #fff; color: var(--pf-danger); box-shadow: none; border: 1.5px solid #f0c9c9; }
.pf-btn-logout:hover { background: #fdecec; color: #b42a2a; filter: none; box-shadow: 0 6px 16px rgba(200,50,50,.16); }
.pf-btn-logout i { color: inherit; }
.pf-links { display: flex; justify-content: center; margin-top: 14px; }
.pf-links a { font-size: 14px; font-weight: 700; }

.pf-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--pf-muted); margin: 4px 0 16px; }
.pf-check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--pf-green); }

/* ── Flash ── */
.pf-flash { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: center; animation: pf-up .35s both; }
.pf-flash-success { background: #e7f6ee; color: #0d5c3a; }
.pf-flash-danger  { background: #fdeaea; color: #a52828; }
.pf-flash-warning { background: #fbf1dc; color: #8a6410; }
.pf-flash-info    { background: #e7f2f7; color: #14607d; }

/* ============================ APP ============================ */
.pf-topbar {
    background: linear-gradient(135deg, var(--pf-green), var(--pf-green-700));
    color: #fff; padding: 18px 18px 22px;
    border-radius: 0 0 26px 26px; box-shadow: var(--pf-shadow);
    position: relative; overflow: hidden;
}
.pf-topbar::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.08); }
.pf-topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
.pf-hello { font-size: 13px; opacity: .85; }
.pf-name  { font-size: 20px; font-weight: 800; line-height: 1.15; }
.pf-avatar { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.4); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: #fff; overflow: hidden; }
.pf-avatar img { width: 100%; height: 100%; object-fit: cover; }

.pf-main { padding: 18px 16px 96px; display: flex; flex-direction: column; }
.pf-footer { margin-top: auto; padding: 16px 2px 4px; display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--pf-muted); border-top: 1px solid var(--pf-line); }
.pf-footer a { color: var(--pf-green-700); font-weight: 700; }
.pf-footer .pf-footer-left { font-weight: 600; }
@media (max-width: 560px) { .pf-footer { justify-content: center; text-align: center; } }
.pf-section-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--pf-muted); margin: 20px 4px 10px; }

.pf-card { background: var(--pf-surface); border-radius: var(--pf-radius); padding: 16px; box-shadow: var(--pf-shadow); animation: pf-up .5s both; }
.pf-card + .pf-card { margin-top: 12px; }

/* Tarjeta destacada: próxima cuota */
.pf-hero-card {
    background: linear-gradient(135deg, var(--pf-green-600), var(--pf-green-900));
    color: #fff; border-radius: var(--pf-radius); padding: 18px; box-shadow: var(--pf-shadow-lg);
    position: relative; overflow: hidden; animation: pf-up .5s both;
}
.pf-hero-card::before { content: ""; position: absolute; right: -30px; bottom: -40px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(closest-side, rgba(224,168,46,.35), transparent); }
.pf-hero-card .pf-hc-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
.pf-hero-card .pf-hc-amount { font-size: 30px; font-weight: 800; margin: 4px 0; }
.pf-hero-card .pf-hc-meta { font-size: 13.5px; opacity: .9; }
.pf-hero-card .pf-badge-mora { display: inline-block; margin-top: 8px; background: var(--pf-danger); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.pf-hero-card.ok { background: linear-gradient(135deg, var(--pf-green), var(--pf-green-900)); }

/* Grid de stats */
.pf-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf-stat { background: var(--pf-surface); border-radius: var(--pf-radius); padding: 15px; box-shadow: var(--pf-shadow); animation: pf-up .5s both; }
.pf-stat .pf-ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 10px; }
.pf-ic-green { background: rgba(20,143,91,.12); color: var(--pf-green); }
.pf-ic-gold  { background: rgba(224,168,46,.16); color: var(--pf-gold-600); }
.pf-ic-blue  { background: rgba(28,126,163,.12); color: var(--pf-info); }
.pf-stat .pf-stat-label { font-size: 12.5px; color: var(--pf-muted); }
.pf-stat .pf-stat-value { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }

/* Listas (movimientos, cuotas) */
.pf-list { list-style: none; margin: 0; padding: 0; }
.pf-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--pf-line); }
.pf-list li:last-child { border-bottom: 0; }
.pf-list .pf-li-main { font-weight: 700; font-size: 14.5px; }
.pf-list .pf-li-sub { font-size: 12.5px; color: var(--pf-muted); }
.pf-amount-pos { color: var(--pf-success); font-weight: 800; }
.pf-amount-neg { color: var(--pf-danger); font-weight: 800; }
.pf-money-lg { font-size: 26px; font-weight: 800; }

.pf-empty { text-align: center; color: var(--pf-muted); padding: 26px 10px; }
.pf-empty .pf-emoji { font-size: 34px; display: block; margin-bottom: 8px; }

.pf-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 20px; }
.pf-pill i { font-size: 12px; }
.pf-pill-ok { background: rgba(20,143,91,.14); color: var(--pf-green); }
.pf-pill-warn { background: rgba(200,144,26,.16); color: var(--pf-gold-600); }
.pf-pill-bad { background: rgba(214,69,69,.14); color: var(--pf-danger); }

/* Acciones rápidas */
.pf-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.pf-quick a { background: var(--pf-surface); border-radius: var(--pf-radius-sm); padding: 14px 8px; text-align: center; box-shadow: var(--pf-shadow); color: var(--pf-ink); font-size: 12.5px; font-weight: 700; }
.pf-quick a .pf-q-ic { font-size: 22px; display: block; margin-bottom: 6px; }

/* ── Bottom nav ── */
.pf-nav {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
    width: 100%; max-width: 520px;
    display: flex; justify-content: space-around; align-items: center;
    background: var(--pf-surface); border-top: 1px solid var(--pf-line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0));
    box-shadow: 0 -6px 24px rgba(13,92,58,.08); z-index: 50;
}
.pf-nav a { flex: 1; text-align: center; color: var(--pf-muted); font-size: 10.5px; font-weight: 700; padding: 4px 2px; }
.pf-nav a .pf-nav-ic { font-size: 21px; display: block; line-height: 1.1; }
.pf-nav a.active { color: var(--pf-green); }
.pf-nav a.active .pf-nav-ic { transform: translateY(-1px); }

/* Encabezado de página interna */
.pf-page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pf-back { width: 38px; height: 38px; border-radius: 12px; background: var(--pf-surface); box-shadow: var(--pf-shadow); display: inline-flex; align-items: center; justify-content: center; color: var(--pf-ink); font-size: 18px; }
.pf-page-title { font-size: 20px; font-weight: 800; }

/* Animación */
@keyframes pf-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.pf-stagger > * { animation: pf-up .5s both; }
.pf-stagger > *:nth-child(2) { animation-delay: .06s; }
.pf-stagger > *:nth-child(3) { animation-delay: .12s; }
.pf-stagger > *:nth-child(4) { animation-delay: .18s; }
.pf-stagger > *:nth-child(5) { animation-delay: .24s; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* Barra de progreso (avance de cuotas) */
.pf-progress { height: 8px; border-radius: 6px; background: var(--pf-line); overflow: hidden; margin-top: 10px; }
.pf-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--pf-green), var(--pf-gold)); border-radius: 6px; }
.pf-loan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pf-loan-code { font-weight: 800; font-size: 16px; }
.pf-kv { display: flex; justify-content: space-between; font-size: 14px; padding: 5px 0; }
.pf-kv .k { color: var(--pf-muted); }
.pf-kv .v { font-weight: 700; }
.pf-profile-row { display: flex; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--pf-line); font-size: 14.5px; }
.pf-profile-row:last-child { border-bottom: 0; }
.pf-profile-row .k { color: var(--pf-muted); }
.pf-profile-row .v { font-weight: 700; text-align: right; }

/* ── Íconos Tabler (misma librería que el backoffice) ── */
@font-face {
    font-family: "tabler-icons"; font-style: normal; font-weight: 400;
    src: url("./fonts/tabler-icons.woff2?v3.35.0") format("woff2"),
         url("./fonts/tabler-icons.ttf?v3.35.0") format("truetype");
}
.ti {
    font-family: "tabler-icons" !important; speak: none; display: inline-block;
    font-style: normal; font-weight: normal; font-variant: normal; text-transform: none;
    line-height: 1; vertical-align: -0.125em;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
.ti-home:before        { content: "\eac1"; }
.ti-pig-money:before   { content: "\f38c"; }
.ti-credit-card:before { content: "\ea84"; }
.ti-receipt:before     { content: "\edfd"; }
.ti-user:before        { content: "\eb4d"; }
.ti-coins:before       { content: "\f65d"; }
.ti-report-money:before{ content: "\eecd"; }
.ti-circle-check:before{ content: "\ea67"; }
.ti-file-invoice:before{ content: "\eb67"; }
.ti-wallet:before      { content: "\eb75"; }
.ti-building-bank:before{ content: "\ebe2"; }
.ti-alert-triangle:before{ content: "\ea06"; }
.ti-chevron-left:before{ content: "\ea60"; }
.ti-logout:before      { content: "\eba8"; }

/* Loader superior minimalista: barra de progreso al navegar entre páginas */
.pf-loadbar {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 9999;
    background: linear-gradient(90deg, var(--pf-green-400), var(--pf-green), var(--pf-gold));
    box-shadow: 0 0 10px rgba(20,143,91,.55);
    opacity: 0; pointer-events: none; border-radius: 0 3px 3px 0;
    transition: width .45s cubic-bezier(.22,1,.36,1), opacity .3s ease;
}
.pf-loadbar.active { opacity: 1; }
.pf-loadbar.done { width: 100% !important; opacity: 0; transition: width .2s ease, opacity .35s ease .1s; }

/* Overlay de carga minimalista: velo tenue oscuro + spinner sobre disco blanco
   (contrasta en cualquier fondo, incluido el verde del login). */
.pf-nav-overlay { position: fixed; inset: 0; z-index: 9990; display: flex; align-items: center; justify-content: center; background: rgba(10,33,22,.32); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; }
.pf-nav-overlay.show { opacity: 1; visibility: visible; }
.pf-nav-disc { width: 66px; height: 66px; border-radius: 50%; background: #fff; box-shadow: var(--pf-shadow-lg); display: flex; align-items: center; justify-content: center; }
.pf-nav-spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(20,143,91,.2); border-top-color: var(--pf-green); animation: pf-rot .7s linear infinite; }

/* Spinner de botón (anti clic-fantasma) */
.pf-btn[disabled] { opacity: .75; cursor: progress; }
.pf-spin { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: pf-rot .6s linear infinite; vertical-align: -3px; }
@keyframes pf-rot { to { transform: rotate(360deg); } }

/* ============================================================================
   ESCRITORIO (≥ 992px): vista "web" completa — barra lateral (sidebar) + encabezado
   + contenido ancho en columnas, aprovechando el ancho de la pantalla.
   En móvil/tablet se mantiene la vista tipo app (barra inferior).
   ========================================================================== */
/* ============================================================================
   DASHBOARD estilo panel (inspiración fintech). Componentes globales (mobile
   apila; escritorio los distribuye en columnas). Topbar = barra blanca con
   buscador; el saludo/balance vive en la tarjeta hero del contenido.
   ========================================================================== */
.pf-nav-brand { display: none; }
.pf-nav-promo { display: none; }

/* Topbar blanca con buscador + acciones */
.pf-topbar { background: var(--pf-surface); color: var(--pf-ink); padding: 11px 14px; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--pf-line); position: relative; overflow: visible; display: flex; align-items: center; gap: 10px; }
.pf-topbar::after { display: none; }
.pf-search { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--pf-bg); border: 1px solid var(--pf-line); border-radius: 999px; padding: 9px 14px; color: var(--pf-muted); min-width: 0; }
.pf-search input { border: 0; background: transparent; outline: none; width: 100%; font-size: 14px; color: var(--pf-ink); }
.pf-bell { position: relative; width: 42px; height: 42px; border-radius: 50%; background: var(--pf-bg); display: inline-flex; align-items: center; justify-content: center; color: var(--pf-ink); font-size: 20px; flex: 0 0 auto; }
.pf-bell .pf-dot { position: absolute; top: 9px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--pf-danger); border: 2px solid var(--pf-surface); }
.pf-user { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; color: inherit; }
.pf-user .pf-avatar, .pf-usermenu .pf-avatar { width: 42px; height: 42px; background: linear-gradient(135deg, var(--pf-green), var(--pf-green-700)); color: #fff; border: 0; }
.pf-user-info { display: none; }
.pf-user-name { font-weight: 800; font-size: 14px; line-height: 1.1; }
.pf-user-role { font-size: 12px; color: var(--pf-muted); }

/* Grid del dashboard */
.pf-dash { display: grid; grid-template-columns: 1fr; gap: 16px; }
.pf-dcol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Hero: saludo + balance */
.pf-hero { background: linear-gradient(135deg, rgba(20,143,91,.90), rgba(10,61,39,.95)), url("../images/portal-login.jpg") center/cover no-repeat; color: #fff; border-radius: var(--pf-radius); padding: 20px; position: relative; overflow: hidden; box-shadow: var(--pf-shadow-lg); }
.pf-hero::after { content: ""; position: absolute; right: -40px; bottom: -55px; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(closest-side, rgba(224,168,46,.30), transparent); }
.pf-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; position: relative; z-index: 1; }
.pf-hero-hi { font-size: 18px; font-weight: 800; }
.pf-hero-sub { font-size: 13px; opacity: .9; margin-top: 3px; max-width: 46ch; }
.pf-hero-badge { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.4); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; white-space: nowrap; display: inline-flex; gap: 5px; align-items: center; }
.pf-hero-bal-label { font-size: 12px; opacity: .85; margin-top: 16px; text-transform: uppercase; letter-spacing: .04em; position: relative; z-index: 1; }
.pf-hero-bal { font-size: 34px; font-weight: 800; position: relative; z-index: 1; line-height: 1.1; }
.pf-hero-delta { font-size: 13px; opacity: .95; position: relative; z-index: 1; }

/* Acciones rápidas (botones) */
.pf-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pf-action { background: var(--pf-surface); border-radius: var(--pf-radius-sm); padding: 14px 6px; text-align: center; box-shadow: var(--pf-shadow); color: var(--pf-ink); font-size: 12px; font-weight: 700; }
.pf-action .pf-a-ic { width: 44px; height: 44px; margin: 0 auto 8px; border-radius: 14px; background: rgba(20,143,91,.10); color: var(--pf-green); display: flex; align-items: center; justify-content: center; font-size: 22px; }

/* Encabezado de card + "Ver todo" — con línea chula de separación */
.pf-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--pf-line); position: relative; }
.pf-card-head::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 46px; height: 2.5px; border-radius: 3px; background: linear-gradient(90deg, var(--pf-green-400), var(--pf-green-700)); }
.pf-card-title { font-weight: 800; font-size: 16px; }
.pf-card-link { font-size: 13px; font-weight: 700; color: var(--pf-green); }

/* Dona (conic-gradient) */
/* Cuando la leyenda cabe al lado, ésta crece (flex:1) y la dona queda a la izq.;
   cuando la leyenda baja (columna angosta), la dona queda SOLA en su fila y se
   centra gracias a justify-content:center. */
.pf-donut-wrap { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.pf-donut { width: 172px; height: 172px; border-radius: 50%; flex: 0 0 auto; position: relative; animation: pf-pop .5s ease both; }
.pf-donut::after { content: ""; position: absolute; inset: 24px; background: var(--pf-surface); border-radius: 50%; }
.pf-donut-center { position: absolute; inset: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 1; text-align: center; padding: 4px; }
.pf-donut-center .v { font-size: 15px; font-weight: 800; white-space: nowrap; letter-spacing: -.02em; }
.pf-donut-center .l { font-size: 10.5px; color: var(--pf-muted); margin-top: 1px; }
@keyframes pf-pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.pf-legend { flex: 1 1 190px; min-width: 160px; display: flex; flex-direction: column; gap: 9px; margin: 0; padding: 0; list-style: none; }
.pf-legend .row { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.pf-legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.pf-legend .nm { flex: 1 1 auto; min-width: 0; color: var(--pf-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-legend .vl { flex: 0 0 auto; font-weight: 700; white-space: nowrap; }
.pf-legend .pc { flex: 0 0 auto; color: var(--pf-muted); min-width: 44px; text-align: right; white-space: nowrap; }
/* Fila de leyenda en 2 líneas: nombre COMPLETO arriba, monto (porcentaje) abajo.
   Evita el word-wrap/elipsis del nombre cuando la columna es angosta. */
.pf-legend .row.lg2 { align-items: flex-start; }
.pf-legend .row.lg2 .dot { margin-top: 5px; }
.pf-legend .lg2-body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.pf-legend .lg2-nm { font-size: 13px; color: var(--pf-ink); font-weight: 600; line-height: 1.25; }
.pf-legend .lg2-val { font-size: 13px; font-weight: 700; }
.pf-legend .lg2-pc { color: var(--pf-muted); font-weight: 600; }

/* Barras (serie mensual) */
.pf-bars { display: flex; align-items: flex-end; gap: 5px; height: 176px; padding-top: 6px; }
.pf-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.pf-bar > .b { width: 100%; max-width: 26px; border-radius: 7px 7px 0 0; background: #cdeadb; transform-origin: bottom; animation: pf-grow-b .7s cubic-bezier(.22,1,.36,1) both; }
.pf-bar.act > .b { background: linear-gradient(180deg, var(--pf-green-400), var(--pf-green-700)); }
@keyframes pf-grow-b { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.pf-bar > .lb { font-size: 10px; color: var(--pf-muted); }

/* Top categorías (barras horizontales) */
.pf-cat { margin-bottom: 13px; }
.pf-cat:last-child { margin-bottom: 0; }
.pf-cat-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.pf-cat-top .pc { color: var(--pf-muted); font-weight: 700; }
.pf-cat-bar { height: 8px; border-radius: 6px; background: var(--pf-line); overflow: hidden; }
.pf-cat-bar > span { display: block; height: 100%; border-radius: 6px; }

/* Item de lista con ícono (próximas cuotas / actividad) */
.pf-item { display: flex; align-items: center; gap: 12px; padding: 10px 10px; margin: 0 -10px; border-bottom: 1px solid var(--pf-line); }
.pf-item:last-child { border-bottom: 0; }
.pf-item-ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 auto; background: rgba(20,143,91,.10); color: var(--pf-green); }
.pf-item-ic.warn { background: rgba(200,144,26,.15); color: var(--pf-gold-600); }
.pf-item-ic.bad { background: rgba(214,69,69,.12); color: var(--pf-danger); }
.pf-item-main { flex: 1; min-width: 0; }
.pf-item-t { font-weight: 700; font-size: 14px; }
.pf-item-s { font-size: 12px; color: var(--pf-muted); }
.pf-item-amt { font-weight: 800; font-size: 14px; white-space: nowrap; }

/* Promo + frase */
.pf-promo { background: linear-gradient(135deg, #eaf6ef, #dff0e6); border-radius: var(--pf-radius); padding: 18px; box-shadow: var(--pf-shadow); }
.pf-promo h4 { margin: 0 0 4px; font-size: 15px; font-weight: 800; }
.pf-promo p { margin: 0 0 12px; font-size: 13px; color: var(--pf-muted); }
.pf-quote { background: linear-gradient(135deg, var(--pf-green-700), var(--pf-green-900)); color: #fff; border-radius: var(--pf-radius); padding: 18px 20px; box-shadow: var(--pf-shadow); font-style: italic; font-weight: 600; }

/* ── ESCRITORIO (≥ 992px): sidebar flotante + 3 columnas ── */
@media (min-width: 992px) {
    body { background: var(--pf-bg); }
    /* Topbar full-width arriba; sidebar + contenido debajo (el sidebar YA NO puede
       inflar la fila del topbar → se elimina el espacio vacío). Todo pegado al borde. */
    .pf-app {
        max-width: none; display: grid; min-height: 100vh;
        grid-template-columns: 262px 1fr; grid-template-areas: "side head" "side main";
        grid-template-rows: 64px 1fr; gap: 0; padding: 0;
        transition: grid-template-columns .3s cubic-bezier(.22,1,.36,1);
    }
    /* Transición suave de los elementos del sidebar al contraer/expandir */
    .pf-nav, .pf-nav-brand, .pf-nav-brand img, .pf-nav a { transition: padding .3s ease, margin .3s ease, gap .3s ease, background-color .2s ease, color .2s ease, height .3s ease, font-size .2s ease; }
    @media (prefers-reduced-motion: reduce) { .pf-app, .pf-nav, .pf-nav-brand, .pf-nav a { transition: none; } }
    /* Sidebar a altura COMPLETA (ocupa el rincón superior izq. con la marca).
       La fila del topbar es fija (64px) → el sidebar ya no puede inflarla. */
    /* Sidebar con el mismo estilo del login: verde degradado + acentos dorados */
    .pf-nav {
        grid-area: side; position: sticky; top: 0; height: 100vh; overflow-y: auto;
        transform: none; left: auto; bottom: auto; width: auto; max-width: none;
        flex-direction: column; justify-content: flex-start; gap: 3px;
        padding: 16px 12px; border: 0; border-radius: 0; box-shadow: none; color: #fff;
        background:
            radial-gradient(520px 320px at 120% -5%, rgba(224,168,46,.22), transparent 60%),
            linear-gradient(170deg, rgba(12,107,61,.88), rgba(10,61,39,.95) 85%),
            url("../images/portal-login.jpg") center/cover no-repeat;
    }
    .pf-nav-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 14px 8px 16px; margin: 0 4px 10px; color: #fff; font-weight: 800; font-size: 13.5px; line-height: 1.25; border-bottom: 1px solid rgba(255,255,255,.14); }
    .pf-nav-brand img { height: 84px; width: auto; background: #fff; border-radius: 16px; padding: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
    .pf-nav a { flex: 0 0 auto; display: flex; align-items: center; gap: 11px; width: 100%; font-size: 14.5px; font-weight: 700; color: rgba(255,255,255,.82); padding: 10px 12px; border-radius: 11px; transition: background-color .2s ease, color .2s ease; }
    .pf-nav a .pf-nav-ic { display: inline; font-size: 19px; }
    .pf-nav a:hover { background: rgba(255,255,255,.10); color: #fff; }
    .pf-nav a.active { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 3px 0 0 var(--pf-gold); }
    .pf-nav a.active .pf-nav-ic { color: var(--pf-gold); }
    /* CTA del sidebar en dorado (resalta sobre el verde) */
    .pf-nav a.pf-btn { justify-content: center; color: var(--pf-green-900); width: 100%; padding: 0 16px; border-radius: var(--pf-radius-sm); background: linear-gradient(135deg, var(--pf-gold), var(--pf-gold-600)); box-shadow: 0 8px 20px rgba(0,0,0,.18); }
    .pf-nav a.pf-btn:hover { color: var(--pf-green-900); background: linear-gradient(135deg, var(--pf-gold), var(--pf-gold-600)); box-shadow: 0 10px 26px rgba(0,0,0,.26); filter: brightness(1.03); }
    .pf-nav-promo { display: block; margin-top: auto; }
    /* Promo del sidebar: tarjeta translúcida sobre el verde */
    .pf-nav .pf-promo { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); }
    .pf-nav .pf-promo h4 { color: #fff; }
    .pf-nav .pf-promo p { color: rgba(255,255,255,.82); }
    .pf-nav .pf-promo-ic { width: 52px; height: 52px; border-radius: 16px; background: rgba(255,255,255,.16); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; margin: 0 auto 8px; }

    /* Navbar superior blanca, ancho completo, pegada arriba (altura fija 64px) */
    .pf-topbar { grid-area: head; height: 64px; display: flex; align-items: center; background: var(--pf-surface); border: 0; border-bottom: 1px solid var(--pf-line); padding: 0 24px; position: sticky; top: 0; z-index: 40; }
    .pf-user-info { display: block; }
    .pf-main { grid-area: main; padding: 22px 24px 15px; }

    .pf-dash { grid-template-columns: 1.5fr 1.12fr 1fr; align-items: start; }
    .pf-stat-grid { grid-template-columns: repeat(4, 1fr); }
    .pf-cards2 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
    .pf-cards2 > .pf-full, .pf-cards2 > .pf-section-title { grid-column: 1 / -1; }
    .pf-cards2 > .pf-card { margin-top: 0; }
}

/* Tablet: 2 columnas de dashboard */
@media (min-width: 700px) and (max-width: 991px) {
    .pf-dash { grid-template-columns: 1fr 1fr; }
}

/* Íconos Tabler adicionales (dashboard) */
.ti-search:before        { content: "\eb1c"; }
.ti-bell:before          { content: "\ea35"; }
.ti-arrow-down-left:before { content: "\ea13"; }
.ti-arrow-up-right:before  { content: "\ea24"; }
.ti-trending-up:before   { content: "\eb43"; }
.ti-calendar-event:before{ content: "\ea52"; }
.ti-cash:before          { content: "\ea55"; }
.ti-arrow-right:before   { content: "\ea1f"; }
.ti-chevron-right:before { content: "\ea61"; }
.ti-plant-2:before       { content: "\ed7e"; }
.ti-seeding:before       { content: "\ed51"; }

/* ============================================================================
   Interacciones ligeras (solo transiciones/al cargar — sin loops que gasten CPU)
   ========================================================================== */
.pf-card, .pf-action, .pf-promo, .pf-stat { transition: transform .18s ease, box-shadow .18s ease; }
.pf-card:hover { box-shadow: var(--pf-shadow-lg); }
.pf-action:hover, .pf-stat:hover, .pf-promo:hover { transform: translateY(-3px); box-shadow: var(--pf-shadow-lg); }
.pf-action:active { transform: translateY(0) scale(.98); }
.pf-item { transition: background .15s ease; border-radius: 10px; }
.pf-item:hover { background: var(--pf-bg); }
.pf-card-link { transition: opacity .15s; } .pf-card-link:hover { opacity: .7; }

/* Barras horizontales (top categorías / progreso) crecen al cargar */
.pf-cat-bar > span { transform-origin: left; animation: pf-grow-w .8s cubic-bezier(.22,1,.36,1) both; }
@keyframes pf-grow-w { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Aparición suave de columnas del dashboard */
.pf-dcol { animation: pf-up .5s ease both; }
.pf-dcol:nth-child(2) { animation-delay: .07s; }
.pf-dcol:nth-child(3) { animation-delay: .14s; }

/* Menú desplegable del perfil (topbar) */
.pf-usermenu { position: relative; flex: 0 0 auto; }
.pf-usermenu-trigger { display: flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer; color: inherit; padding: 3px 6px 3px 3px; border-radius: 999px; transition: background .15s; }
.pf-usermenu-trigger:hover { background: var(--pf-bg); }
.pf-usermenu-trigger .pf-chev { color: var(--pf-muted); font-size: 16px; transition: transform .2s; }
.pf-usermenu.open .pf-usermenu-trigger .pf-chev { transform: rotate(180deg); }
.pf-menu { position: absolute; right: 0; top: calc(100% + 10px); background: var(--pf-surface); border: 1px solid var(--pf-line); border-radius: 16px; box-shadow: var(--pf-shadow-lg); min-width: 240px; padding: 8px; z-index: 60; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s ease, transform .16s ease, visibility .16s; }
.pf-usermenu.open .pf-menu { opacity: 1; visibility: visible; transform: none; }
.pf-menu-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; border-bottom: 1px solid var(--pf-line); margin-bottom: 6px; }
.pf-menu-head .pf-avatar { width: 40px; height: 40px; }
.pf-menu-head .nm { font-weight: 800; font-size: 14px; }
.pf-menu-head .rl { font-size: 12px; color: var(--pf-muted); }
.pf-menu a, .pf-menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; border-radius: 10px; color: var(--pf-ink); font-size: 14px; font-weight: 600; background: none; border: 0; text-align: left; cursor: pointer; font-family: inherit; }
.pf-menu a:hover, .pf-menu button:hover { background: var(--pf-bg); }
.pf-menu a i, .pf-menu button i { font-size: 18px; color: var(--pf-muted); }
.pf-menu .danger { color: var(--pf-danger); } .pf-menu .danger i { color: var(--pf-danger); }
.pf-menu-sep { height: 1px; background: var(--pf-line); margin: 6px 0; }
.ti-chevron-down:before  { content: "\ea5f"; }
.ti-lock:before          { content: "\eae2"; }
.ti-settings:before      { content: "\eb20"; }
.ti-user-circle:before   { content: "\ef68"; }

/* ── Ajustes finos (topbar, socio, mora) ── */
.pf-user-name, .pf-user-role { display: block; }
.pf-topbar-spacer { flex: 1; }
.pf-bell .pf-count { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--pf-danger); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--pf-surface); line-height: 1; }

/* Badge de mora en el hero: rojo y con más presencia */
.pf-hero-badge.mora { background: #e23b3b; border-color: rgba(255,255,255,.4); box-shadow: 0 4px 12px rgba(180,30,30,.35); }

/* Banner de mora (énfasis: la cooperativa sabe que el socio está atrasado) */
.pf-alert { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-radius: var(--pf-radius); margin-bottom: 16px; flex-wrap: wrap; box-shadow: var(--pf-shadow); }
.pf-alert-mora { background: #fdecec; border: 1px solid #f3c2c2; color: #8a2020; }
.pf-alert-ic { width: 46px; height: 46px; border-radius: 14px; background: #f6cccc; color: #c0392b; display: flex; align-items: center; justify-content: center; font-size: 24px; flex: 0 0 auto; animation: pf-attn 2.2s ease-in-out infinite; }
.pf-alert-body { flex: 1; min-width: 200px; }
.pf-alert-t { font-weight: 800; font-size: 16px; }
.pf-alert-s { font-size: 13.5px; opacity: .92; }
.pf-alert .pf-btn { width: auto; padding: 0 20px; height: 44px; background: linear-gradient(135deg, #e23b3b, #b42a2a); box-shadow: 0 8px 18px rgba(200,50,50,.28); }
@keyframes pf-attn { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.09); } }

/* ── Títulos más llamativos y profesionales (barra de acento verde) ── */
.pf-card-title { position: relative; padding-left: 13px; font-size: 16.5px; font-weight: 800; color: var(--pf-ink); }
.pf-card-title::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 3px; width: 4px; border-radius: 4px; background: linear-gradient(180deg, var(--pf-green-400), var(--pf-green-700)); }
.pf-page-title { position: relative; padding-left: 15px; font-size: 22px; font-weight: 800; color: var(--pf-ink); letter-spacing: -.01em; }
.pf-page-title::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 5px; border-radius: 5px; background: linear-gradient(180deg, var(--pf-green-400), var(--pf-green-700)); }
.pf-section-title { position: relative; padding-left: 15px; color: var(--pf-green-700); }
.pf-section-title::before { content: ""; position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 7px; height: 7px; border-radius: 2px; background: var(--pf-green); }

/* ============================================================================
   PÁGINAS INTERNAS (Ahorros / Préstamos / Nómina / Perfil)
   Hero de página, tiles con acento, chips, perfil — presencia y divisiones chulas.
   ========================================================================== */
/* Hero de página interna (verde, con el número clave) */
.pf-phero { background: linear-gradient(135deg, rgba(20,143,91,.90), rgba(10,61,39,.95)), url("../images/portal-login.jpg") center/cover no-repeat; color:#fff; border-radius: var(--pf-radius); padding: 22px; position: relative; overflow: hidden; box-shadow: var(--pf-shadow-lg); margin-bottom: 20px; }
.pf-phero::after { content:""; position:absolute; right:-40px; bottom:-60px; width:210px; height:210px; border-radius:50%; background: radial-gradient(closest-side, rgba(224,168,46,.30), transparent); }
.pf-phero-top { display:flex; align-items:center; gap:14px; position:relative; z-index:1; }
.pf-phero-ic { width:54px; height:54px; border-radius:17px; background: rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.30); display:flex; align-items:center; justify-content:center; font-size:27px; flex:0 0 auto; }
.pf-phero-hi { font-size:20px; font-weight:800; line-height:1.15; }
.pf-phero-sub { font-size:13px; opacity:.9; margin-top:2px; }
.pf-phero-top .pf-hero-badge { margin-left:auto; }
.pf-phero-bal-label { font-size:12px; opacity:.85; margin-top:18px; text-transform:uppercase; letter-spacing:.04em; position:relative; z-index:1; }
.pf-phero-bal { font-size:34px; font-weight:800; line-height:1.1; letter-spacing:-.01em; position:relative; z-index:1; }
.pf-phero-foot { font-size:13px; opacity:.95; margin-top:5px; position:relative; z-index:1; }

/* Mini-botón outline (acciones secundarias, ej. ver histórico) */
.pf-mini-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 13px; border: 1.5px solid var(--pf-green-400); border-radius: 999px; color: var(--pf-green-700); font-weight: 700; font-size: 12.5px; transition: background-color .15s ease, color .15s ease; }
.pf-mini-btn:hover { background: var(--pf-green); color: #fff; border-color: var(--pf-green); }

/* Acciones de documentos (descargar PDFs) */
.pf-doc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.pf-doc-actions .pf-btn { height: 48px; font-size: 14px; }
@media (max-width: 560px) { .pf-doc-actions { grid-template-columns: 1fr; } }

/* Tarjetas de acción para nueva solicitud */
.pf-req-actions { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .pf-req-actions { grid-template-columns: repeat(3, 1fr); } }
.pf-req { text-align: left; background: var(--pf-bg); border: 1px solid var(--pf-line); border-radius: var(--pf-radius-sm); padding: 16px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; font-family: inherit; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.pf-req:hover { transform: translateY(-3px); box-shadow: var(--pf-shadow); border-color: var(--pf-green-400); }
.pf-req-ic { width: 44px; height: 44px; border-radius: 13px; background: rgba(20,143,91,.12); color: var(--pf-green); display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 6px; }
.pf-req-ic.gold { background: rgba(224,168,46,.16); color: var(--pf-gold-600); }
.pf-req-ic.blue { background: rgba(28,126,163,.12); color: var(--pf-info); }
.pf-req-t { font-weight: 800; font-size: 14.5px; }
.pf-req-s { font-size: 12.5px; color: var(--pf-muted); }

/* Rejilla de 2 columnas para formularios (ej. cambio de datos) */
.pf-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 520px) { .pf-grid2 { grid-template-columns: 1fr; } }

/* Textarea y select con el estilo de los inputs del portal */
textarea.pf-input { height: auto; min-height: 84px; padding: 12px 15px; resize: vertical; line-height: 1.5; }
select.pf-input { appearance: auto; -webkit-appearance: auto; cursor: pointer; }

/* Rejilla de tiles (cuentas/productos) — responsive */
.pf-tiles { display:grid; grid-template-columns: 1fr; gap:14px; }
@media (min-width:560px){ .pf-tiles { grid-template-columns: 1fr 1fr; } }
@media (min-width:992px){ .pf-tiles { grid-template-columns: repeat(3, 1fr); } }

/* Tile de cuenta/producto con acento superior de color */
.pf-tile { background: var(--pf-surface); border-radius: var(--pf-radius); padding: 18px; box-shadow: var(--pf-shadow); position:relative; overflow:hidden; border-top: 3px solid var(--pf-green); display:flex; flex-direction:column; transition: transform .18s ease, box-shadow .18s ease; animation: pf-up .5s both; }
.pf-tile:hover { transform: translateY(-3px); box-shadow: var(--pf-shadow-lg); }
.pf-tile.gold { border-top-color: var(--pf-gold); }
.pf-tile.blue { border-top-color: var(--pf-info); }
.pf-tile-ic { width:48px; height:48px; border-radius:15px; display:flex; align-items:center; justify-content:center; font-size:24px; margin-bottom:12px; background: rgba(20,143,91,.12); color: var(--pf-green); }
.pf-tile.gold .pf-tile-ic { background: rgba(224,168,46,.16); color: var(--pf-gold-600); }
.pf-tile.blue .pf-tile-ic { background: rgba(28,126,163,.12); color: var(--pf-info); }
.pf-tile-name { font-weight:800; font-size:15px; }
.pf-tile-sub { font-size:12.5px; color:var(--pf-muted); margin-top:1px; }
.pf-tile-amt { font-size:24px; font-weight:800; margin-top:12px; letter-spacing:-.01em; }
.pf-tile-foot { font-size:12.5px; color:var(--pf-muted); margin-top:4px; }

/* Chips de desglose (nómina/detalles) */
.pf-chips { display:flex; flex-wrap:wrap; gap:8px; }
.pf-chip { display:inline-flex; align-items:center; gap:7px; background: var(--pf-bg); border:1px solid var(--pf-line); border-radius:999px; padding:7px 13px; font-size:13px; font-weight:700; }
.pf-chip i { color: var(--pf-green); font-size:15px; }
.pf-chip .amt { color: var(--pf-green-700); font-weight:800; }

/* Rejilla clave/valor (perfil / detalles) */
.pf-kv-grid { display:grid; grid-template-columns: 1fr; gap:0; }
.pf-kv-grid .kv { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 2px; border-bottom:1px solid var(--pf-line); }
.pf-kv-grid .kv:last-child { border-bottom:0; }
.pf-kv-grid .k { color:var(--pf-muted); font-size:13.5px; display:flex; align-items:center; gap:9px; }
.pf-kv-grid .k i { width:30px; height:30px; border-radius:9px; background:rgba(20,143,91,.10); color:var(--pf-green); display:inline-flex; align-items:center; justify-content:center; font-size:16px; flex:0 0 auto; }
.pf-kv-grid .v { font-weight:700; text-align:right; font-size:14px; }
@media (min-width:700px){ .pf-kv-grid { grid-template-columns: 1fr 1fr; column-gap:32px; } }

/* Perfil: cabecera con avatar grande sobre el hero */
.pf-profile-hero { display:flex; align-items:center; gap:18px; position:relative; z-index:1; }
.pf-profile-hero .av { width:78px; height:78px; border-radius:24px; background: rgba(255,255,255,.18); border:2px solid rgba(255,255,255,.38); display:flex; align-items:center; justify-content:center; font-size:33px; font-weight:800; color:#fff; flex:0 0 auto; }
.pf-profile-hero .nm { font-size:22px; font-weight:800; line-height:1.15; }
.pf-profile-hero .rl { font-size:13.5px; opacity:.9; margin-top:2px; }
.pf-profile-hero .chips { display:flex; gap:8px; flex-wrap:wrap; margin-top:9px; }
.pf-profile-hero .chips span { background: rgba(255,255,255,.16); border:1px solid rgba(255,255,255,.30); border-radius:999px; padding:4px 11px; font-size:12px; font-weight:700; display:inline-flex; align-items:center; gap:6px; }

/* Barra de progreso etiquetada (préstamos) */
.pf-prog-lbl { display:flex; justify-content:space-between; align-items:baseline; font-size:12.5px; color:var(--pf-muted); margin-top:14px; margin-bottom:7px; font-weight:700; }
.pf-prog-lbl b { color:var(--pf-green-700); font-size:14px; }

/* Fila de detalle dentro de tarjeta de préstamo */
.pf-detail-grid { display:grid; grid-template-columns: 1fr 1fr; gap:2px 18px; margin-top:14px; }
.pf-detail { padding:8px 0; }
.pf-detail .k { font-size:11.5px; color:var(--pf-muted); text-transform:uppercase; letter-spacing:.03em; font-weight:700; }
.pf-detail .v { font-size:16px; font-weight:800; margin-top:2px; }
.pf-detail .v.bad { color: var(--pf-danger); }

/* Nota muda a la derecha del encabezado de card (conteos, "solo lectura") */
.pf-head-note { font-size: 13px; color: var(--pf-muted); font-weight: 700; }

/* Tiles anidados dentro de un panel blanco: sub-tarjetas sobre fondo tenue
   (así el título vive DENTRO de la card y el fondo queda limpio) */
.pf-tiles.inset { margin: 0; }
.pf-tiles.inset .pf-tile { background: var(--pf-bg); box-shadow: none; border: 1px solid var(--pf-line); }
.pf-tiles.inset .pf-tile:hover { box-shadow: var(--pf-shadow); transform: translateY(-2px); }

/* Filas del historial (nómina) dentro del panel, separadas por hairline */
.pf-nrow { padding: 15px 2px; border-bottom: 1px solid var(--pf-line); }
.pf-nrow:first-child { padding-top: 2px; }
.pf-nrow:last-child { border-bottom: 0; padding-bottom: 2px; }
.pf-nrow-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.pf-nrow-m { font-weight: 800; font-size: 15.5px; display: flex; align-items: center; gap: 11px; }
.pf-nrow-ic { width: 40px; height: 40px; border-radius: 13px; background: rgba(20,143,91,.10); color: var(--pf-green); display: flex; align-items: center; justify-content: center; font-size: 19px; flex: 0 0 auto; }
.pf-nrow-sub { font-size: 12px; color: var(--pf-muted); font-weight: 600; margin-top: 1px; }
.pf-nrow-t { font-weight: 800; font-size: 17px; color: var(--pf-green-700); white-space: nowrap; }

/* Botón que abre la tabla de amortización en un modal */
.pf-amort-btn { margin-top: 14px; padding: 14px 2px 0; width: 100%; background: none; border: 0; border-top: 1px solid var(--pf-line); display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--pf-green-700); cursor: pointer; font-family: inherit; }
.pf-amort-btn .pf-amort-count { margin-left: auto; font-size: 12px; color: var(--pf-muted); font-weight: 600; }
.pf-amort-btn .pf-amort-chev { font-size: 16px; color: var(--pf-muted); transition: transform .18s ease; }
.pf-amort-btn:hover .pf-amort-chev { transform: translateX(3px); }

/* ── Modal genérico del portal (usado por la tabla de amortización) ── */
.pf-modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 18px; }
.pf-modal.open { display: flex; }
.pf-modal-backdrop { position: absolute; inset: 0; background: rgba(10,40,25,.45); opacity: 0; transition: opacity .26s ease; }
.pf-modal.in .pf-modal-backdrop { opacity: 1; }
.pf-modal-card { position: relative; background: var(--pf-surface); border-radius: var(--pf-radius); box-shadow: var(--pf-shadow-lg); width: 100%; max-width: 820px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; opacity: 0; transform: translateY(16px) scale(.97); transition: opacity .28s ease, transform .3s cubic-bezier(.22,1,.36,1); }
.pf-modal.in .pf-modal-card { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .pf-modal-backdrop, .pf-modal-card { transition: none; }
}
/* Header con fondo destacado (tinte verde de marca) */
.pf-modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--pf-line); background: linear-gradient(135deg, rgba(20,143,91,.13), rgba(20,143,91,.03)); }
.pf-modal-head .ic { width: 46px; height: 46px; border-radius: 14px; background: var(--pf-surface); color: var(--pf-green); box-shadow: 0 2px 8px rgba(20,143,91,.18); display: flex; align-items: center; justify-content: center; font-size: 22px; flex: 0 0 auto; }
.pf-modal-title { font-weight: 800; font-size: 16.5px; }
.pf-modal-sub { font-size: 12.5px; color: var(--pf-muted); }
.pf-modal-close { margin-left: auto; width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--pf-bg); color: var(--pf-muted); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease; flex: 0 0 auto; }
.pf-modal-close:hover { background: #f6dede; color: var(--pf-danger); }
/* Responsive: en móvil el modal ocupa casi toda la pantalla */
@media (max-width: 640px) {
    .pf-modal { padding: 10px; }
    .pf-modal-card { max-width: 100%; max-height: 94vh; }
    .pf-modal-head { padding: 16px 16px; }
    .pf-modal-body { padding: 14px 14px 16px; }
}
.pf-modal-body { flex: 1; min-height: 0; padding: 16px 20px 20px; overflow: auto; -webkit-overflow-scrolling: touch; }
/* Variante para la amortización: header + resumen fijos y tabla con scroll propio */
.pf-modal-body.pf-body-flex { overflow: hidden; display: flex; flex-direction: column; gap: 14px; }

/* Mini-resumen de la amortización (arriba de la tabla) */
.pf-amort-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pf-as { background: var(--pf-bg); border: 1px solid var(--pf-line); border-radius: 12px; padding: 11px 13px; display: flex; flex-direction: column; gap: 2px; }
.pf-as .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--pf-muted); font-weight: 700; }
.pf-as .v { font-size: 16px; font-weight: 800; color: var(--pf-ink); letter-spacing: -.01em; }
@media (max-width: 560px) { .pf-amort-summary { grid-template-columns: 1fr; } }

/* Contenedor con scroll de la tabla (encabezado fijo) */
.pf-amort-scroll { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--pf-line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.pf-amort-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.pf-amort-table thead th { position: sticky; top: 0; z-index: 1; text-align: right; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--pf-muted); font-weight: 700; padding: 10px 12px; background: var(--pf-surface); box-shadow: inset 0 -1px 0 var(--pf-line); white-space: nowrap; }
.pf-amort-table td { text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--pf-line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pf-amort-table th:first-child, .pf-amort-table td:first-child { text-align: center; font-weight: 800; }
.pf-amort-table th:nth-child(2), .pf-amort-table td:nth-child(2),
.pf-amort-table th:last-child,  .pf-amort-table td:last-child { text-align: left; }
.pf-amort-table tbody tr:nth-child(odd) td { background: rgba(20,143,91,.025); }
.pf-amort-table tbody tr:hover td { background: var(--pf-bg); }
.pf-amort-table tbody tr:last-child td { border-bottom: 0; }
.pf-amort-table tr.is-paid td { color: var(--pf-muted); }
.pf-amort-table tr.is-late td, .pf-amort-table tr.is-late:hover td { background: #fdecec; }
.pf-amort-table .cuota-col { font-weight: 800; color: var(--pf-ink); }

/* Íconos Tabler adicionales (páginas internas) */
.ti-list-details:before  { content: "\ef40"; }
.ti-clipboard-list:before{ content: "\ea6d"; }
.ti-send:before          { content: "\eb1e"; }
.ti-upload:before        { content: "\eb47"; }
.ti-photo:before         { content: "\eb0a"; }
.ti-eye:before           { content: "\ea9a"; }
.ti-download:before      { content: "\ea96"; }
.ti-user-off:before      { content: "\ecf9"; }
.ti-shield-check:before  { content: "\eb22"; }
.ti-menu-2:before        { content: "\ec42"; }
.ti-ban:before           { content: "\ea2e"; }

/* ── Botón contraer/expandir el sidebar (escritorio) ── */
.pf-collapse-btn { display: none; width: 42px; height: 42px; border-radius: 50%; background: var(--pf-bg); border: 0; color: var(--pf-ink); font-size: 20px; cursor: pointer; align-items: center; justify-content: center; flex: 0 0 auto; transition: background .15s ease; }
.pf-collapse-btn:hover { background: #e2eae5; }
@media (min-width: 992px) {
    .pf-collapse-btn { display: inline-flex; }
    /* Modo contraído: sidebar angosto, solo íconos */
    html.pf-nav-collapsed .pf-app { grid-template-columns: 74px 1fr; }
    html.pf-nav-collapsed .pf-nav { padding: 16px 10px; }
    html.pf-nav-collapsed .pf-nav-brand { padding: 10px 2px 12px; margin: 0 0 8px; font-size: 0; }
    html.pf-nav-collapsed .pf-nav-brand img { height: 48px; padding: 6px; }
    html.pf-nav-collapsed .pf-nav a { justify-content: center; font-size: 0; gap: 0; padding: 11px 0; }
    html.pf-nav-collapsed .pf-nav a .pf-nav-ic { font-size: 20px; }
    html.pf-nav-collapsed .pf-nav-promo { display: none; }
}
.ti-paperclip:before     { content: "\eb02"; }

/* Separador suave entre bloques dentro de una card */
.pf-section-sep { height: 1px; background: var(--pf-line); margin: 4px 0 6px; }
.ti-x:before             { content: "\eb55"; }
.ti-id:before            { content: "\eac3"; }
.ti-mail:before          { content: "\eae5"; }
.ti-phone:before         { content: "\eb09"; }
.ti-map-pin:before       { content: "\eae8"; }
.ti-briefcase:before     { content: "\ea46"; }
.ti-device-mobile:before { content: "\ea8a"; }
.ti-clock:before         { content: "\ea70"; }
.ti-percentage:before    { content: "\ecf4"; }
.ti-gift:before          { content: "\eb68"; }
.ti-cash-banknote:before { content: "\ee25"; }
.ti-history:before       { content: "\ebea"; }
.ti-file-text:before     { content: "\eaa2"; }
.ti-calendar-due:before  { content: "\f621"; }
.ti-calendar:before      { content: "\ea53"; }
.ti-shield-lock:before   { content: "\ed58"; }
.ti-discount-2:before    { content: "\ee7c"; }
.ti-users:before         { content: "\ebf2"; }
.ti-award:before         { content: "\ea2c"; }
.ti-check:before         { content: "\ea5e"; }
.ti-hourglass:before     { content: "\ef93"; }

/* ── Refuerzo BOLD en labels/eyebrows en mayúsculas (consistencia en todo el portal) ── */
.pf-phero-bal-label,
.pf-hero-bal-label,
.pf-hc-label,
.pf-stat-label,
.pf-detail .k { font-weight: 700; }

/* ── Glyphs Tabler adicionales (2FA) ── */
.ti-lock-check:before     { content: "\f926"; }
.ti-shield-plus:before    { content: "\f9cb"; }
.ti-lock-off:before       { content: "\ed1e"; }
.ti-brand-whatsapp:before { content: "\ec74"; }
.ti-refresh:before        { content: "\eb13"; }

/* ── 2FA: selector de método ── */
.pf-2fa-methods { display: flex; flex-direction: column; gap: 10px; }
.pf-2fa-methods form { margin: 0; }
.pf-method-btn {
    width: 100%; display: flex; align-items: center; gap: 12px;
    text-align: left; cursor: pointer;
    background: var(--pf-surface); border: 1px solid var(--pf-line);
    border-radius: 14px; padding: 13px 14px; color: var(--pf-ink);
    transition: border-color .15s, box-shadow .15s, transform .05s;
}
.pf-method-btn:hover { border-color: var(--pf-green); box-shadow: var(--pf-shadow); }
.pf-method-btn:active { transform: scale(.995); }
.pf-method-btn .ic {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--pf-bg); color: var(--pf-green); font-size: 20px;
}
.pf-method-btn .tx { display: flex; flex-direction: column; line-height: 1.25; flex: 1 1 auto; }
.pf-method-btn .tx small { color: var(--pf-muted); font-size: .82rem; margin-top: 2px; }
.pf-method-btn .go { color: var(--pf-muted); font-size: 18px; }

/* ── 2FA: código OTP, códigos de recuperación, badge activo ── */
.pf-code-input {
    letter-spacing: .3em; text-align: center; font-weight: 700;
    font-size: 1.35rem; font-variant-numeric: tabular-nums;
}
.pf-codes-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.pf-codes-grid.pf-codes-one { grid-template-columns: 1fr; }
.pf-codes-grid code {
    display: block; text-align: center;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: .98rem; letter-spacing: .06em; font-weight: 700;
    color: var(--pf-ink); background: var(--pf-bg);
    border: 1px solid var(--pf-line); border-radius: 10px;
    padding: 11px 6px; word-break: break-all;
}
.pf-badge-ok {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(20, 160, 92, .14); color: var(--pf-success);
    border-radius: 999px; padding: 2px 10px; font-weight: 700;
    font-size: .82rem; margin-right: 6px;
}
