/* ═══════════════════════════════════════════════════════════
   PORTAL ESTILOS — LoConsigo Fintech Premium
   Glassmorphism • Modern • Responsive
   ═══════════════════════════════════════════════════════════ */

:root {
    /* Primary palette — deep navy + emerald */
    --primary-900: #0c1222;
    --primary-800: #0f172a;
    --primary-700: #1e293b;
    --primary-600: #334155;
    --primary-500: #3b82f6;
    --primary-400: #60a5fa;
    --primary-300: #93c5fd;
    --primary-200: #bfdbfe;
    --primary-100: #dbeafe;
    --primary-50: #eff6ff;

    --accent-green: #10b981;
    --accent-green-light: #d1fae5;
    --accent-amber: #f59e0b;
    --accent-amber-light: #fef3c7;
    --accent-red: #ef4444;
    --accent-red-light: #fee2e2;
    --accent-purple: #8b5cf6;

    --surface: #f8fafc;
    --surface-elevated: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
    --glass-blur: blur(16px);

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'DM Mono', monospace;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
}

/* ═══ RESET & BASE ═══ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--surface);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ═══ PANTALLAS ═══ */
.pantalla {
    display: none;
}

.pantalla.activa {
    display: block;
}

/* ═══ LOGIN PAGE ═══ */
.login-bg-shapes {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    background: linear-gradient(135deg, var(--primary-900) 0%, #1a1a3e 50%, var(--primary-800) 100%);
}

.login-bg-shapes::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: float 8s ease-in-out infinite;
}

.login-bg-shapes::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: float 6s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-30px) scale(1.05);
    }
}

.login-container {
    position: relative;
    z-index: 1;
    max-width: 420px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    padding: 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    font-size: 32px;
    font-weight: 900;
    color: white;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.login-logo span {
    color: var(--primary-400);
}

.login-header h1 {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 4px;
}

.login-header p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

/* Steps */
.login-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.step {
    text-align: center;
}

.step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-500);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 3px;
}

.step-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.step-divider {
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 1px;
}

/* Form */
.login-form .campo {
    margin-bottom: 14px;
}

.login-form .campo label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.login-form .campo input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: var(--font-main);
    color: white;
    transition: all 0.2s;
}

.login-form .campo input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.login-form .campo input:focus {
    outline: none;
    border-color: var(--primary-400);
    background: rgba(255, 255, 255, 0.15);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary-500);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-login:hover {
    background: var(--primary-400);
    transform: translateY(-1px);
}

.btn-login:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.error-msg {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.login-alt {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.login-alt p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.btn-whatsapp-req {
    width: 100%;
    padding: 12px;
    background: #25d366;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-whatsapp-req:hover {
    background: #20bd5a;
}

.login-footer {
    text-align: center;
    margin-top: 16px;
}

.volver-inicio {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 13px;
    display: inline-block;
    padding: 8px 6px;
    transition: color 0.2s;
}

.volver-inicio:hover {
    color: var(--primary-400);
}

/* ═══ DASHBOARD LAYOUT ═══ */
.portal-header {
    background: var(--surface-elevated);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-logo {
    font-size: 20px;
    font-weight: 900;
    color: var(--primary-800);
    letter-spacing: -0.02em;
}

.portal-logo span {
    color: var(--primary-500);
}

.portal-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
}

#portalNombreCliente {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.user-status {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-cerrar {
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-cerrar:hover {
    background: var(--accent-red-light);
    color: var(--accent-red);
    border-color: var(--accent-red);
}

/* ═══ QUICK STATS BAR ═══ */
.quick-stats-bar {
    background: var(--surface-elevated);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    gap: 24px;
    justify-content: center;
}

.quick-stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qs-icon {
    font-size: 20px;
}

.qs-data {
    display: flex;
    flex-direction: column;
}

.qs-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.qs-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══ NAV TABS ═══ */
.portal-nav {
    background: var(--surface-elevated);
    display: flex;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.portal-nav::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1;
    min-width: max-content;
    padding: 14px 16px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: var(--font-main);
}

.tab-btn:hover {
    color: var(--primary-500);
}

.tab-btn.activo {
    color: var(--primary-500);
    border-bottom-color: var(--primary-500);
    font-weight: 700;
}

/* ═══ MAIN CONTENT ═══ */
.portal-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 80px;
}

.panel-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

/* ═══ WELCOME SECTION ═══ */
.welcome-section {
    margin-bottom: 20px;
}

.welcome-title {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 4px;
}

.welcome-sub {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ═══ GLASS CARD ═══ */
.card.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.card h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══ ESTATUS BADGE ═══ */
.estatus-container {
    margin-bottom: 16px;
}

.estatus-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
}

.estatus-badge.al-corriente {
    background: var(--accent-green-light);
    color: #065f46;
    border: 1.5px solid #6ee7b7;
}

.estatus-badge.pago-proximo {
    background: var(--accent-amber-light);
    color: #92400e;
    border: 1.5px solid #fcd34d;
}

.estatus-badge.atrasado {
    background: var(--accent-red-light);
    color: #991b1b;
    border: 1.5px solid #fca5a5;
}

/* ═══ URGENCIA ═══ */
.urgencia-container {
    margin-bottom: 16px;
}

/* ═══ BANNER CONVENIO ACTIVO ═══ */
.convenio-banner {
    margin-bottom: 16px;
    padding: 16px 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1.5px solid #86efac;
    display: flex;
    align-items: center;
    gap: 14px;
}

.convenio-banner-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.convenio-banner-content {
    flex: 1;
}

.convenio-banner-title {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #166534;
}

.convenio-banner-text {
    margin: 4px 0 0;
    font-size: 12px;
    color: #15803d;
    line-height: 1.4;
}

.convenio-banner-amount {
    margin-top: 8px;
    font-size: 20px;
    font-weight: 900;
    color: #0f172a;
    font-family: 'JetBrains Mono', monospace;
}

.mensaje-urgencia {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mensaje-urgencia.dias-restantes {
    background: var(--primary-50);
    color: #1e40af;
    border: 1.5px solid var(--primary-200);
}

.mensaje-urgencia.urgente {
    background: #fff7ed;
    color: #c2410c;
    border: 1.5px solid #fdba74;
}

.mensaje-urgencia.vencido {
    background: var(--accent-red-light);
    color: #991b1b;
    border: 1.5px solid #fca5a5;
}

/* ═══ BARRA DE PROGRESO ═══ */
.progreso-container {
    margin-bottom: 16px;
}

.barra-progreso-wrapper {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
}

.barra-progreso-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.barra-progreso-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.barra-progreso-pct {
    font-size: 18px;
    font-weight: 900;
    color: var(--primary-500);
    font-family: var(--font-mono);
}

.barra-progreso-track {
    background: var(--border-light);
    border-radius: var(--radius-full);
    height: 16px;
    overflow: hidden;
}

.barra-progreso-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--primary-500), var(--accent-green));
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}

.barra-progreso-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.barra-progreso-footer span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ═══ MINI SÁBANA ═══ */
.sabana-container {
    margin-bottom: 16px;
}

.mini-sabana-container {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    padding: 18px;
    border: 1px solid var(--border);
}

.mini-sabana-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 14px;
    text-align: center;
}

.mini-sabana-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.mes-cuadro {
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: center;
    transition: all 0.2s;
    border: 1.5px solid transparent;
}

.mes-cuadro:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mes-cuadro.pagado {
    background: var(--accent-green-light);
    border-color: #6ee7b7;
    color: #065f46;
}

.mes-cuadro.pendiente {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-muted);
}

.mes-cuadro.mora {
    background: var(--accent-red-light);
    border-color: #fca5a5;
    color: #991b1b;
}

.mes-cuadro .mes-icon {
    font-size: 14px;
    margin-bottom: 2px;
}

.mes-cuadro .mes-nombre {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.mes-cuadro .mes-monto {
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
}

/* ═══ WHATSAPP SMART LINK ═══ */
.reportar-container {
    margin-bottom: 16px;
}

.btn-whatsapp-smart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    font-family: var(--font-main);
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp-smart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* ═══ STATS GRID ═══ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.stat-card {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-primary);
    margin-top: 4px;
    font-family: var(--font-mono);
}

/* ═══ PRÉSTAMO CARDS ═══ */
.prestamos-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prestamo-card {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    padding: 18px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.prestamo-card:hover {
    border-color: var(--primary-400);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.prestamo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.prestamo-id {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.prestamo-estado {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.estado-activo {
    background: var(--accent-green-light);
    color: #065f46;
}

.prestamo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.prestamo-dato label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.prestamo-dato .valor {
    font-size: 15px;
    font-weight: 900;
    color: var(--text-primary);
    margin-top: 2px;
    font-family: var(--font-mono);
}

/* ═══ DETALLE PRÉSTAMO ═══ */
.prestamo-detalle {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.detalle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.detalle-item {
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius-sm);
}

.detalle-item label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
}

.detalle-item .val {
    font-size: 16px;
    font-weight: 900;
    color: var(--text-primary);
    margin-top: 2px;
    font-family: var(--font-mono);
}

/* ═══ FORMULARIOS ═══ */
.comprobante-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.campo {
    margin-bottom: 14px;
}

.campo label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.campo input,
.campo select,
.campo textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-main);
    color: var(--text-primary);
    background: var(--surface-elevated);
    transition: border-color 0.2s;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    outline: none;
    border-color: var(--primary-400);
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
}

.upload-zone:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

#uploadPlaceholder p {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
}

#uploadPlaceholder small {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-enviar {
    width: 100%;
    padding: 14px;
    background: var(--primary-500);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-main);
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-enviar:hover {
    background: var(--primary-400);
}

.btn-enviar:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

/* ═══ HISTORIAL ═══ */
.historial-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-pdf {
    padding: 10px 18px;
    background: var(--primary-500);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-main);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-pdf:hover {
    background: var(--primary-400);
}

#filtroPrestamoHistorial select {
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-main);
    background: var(--surface-elevated);
}

.table-responsive {
    overflow-x: auto;
}

.tabla-pagos {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tabla-pagos th {
    text-align: left;
    padding: 10px 12px;
    background: var(--surface);
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tabla-pagos td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
}

.tabla-pagos .vacio {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

/* ═══ CALCULADORA ═══ */
.calc-intro {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.info-card {
    background: linear-gradient(135deg, var(--primary-50), #f0fdf4);
    border: 1.5px solid var(--primary-200);
}

.calc-result {
    background: white;
}

.calc-result h3 {
    font-size: 16px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 16px;
}

#calcDetalle {
    font-size: 14px;
    line-height: 2;
    color: var(--text-secondary);
}

.calc-total-box {
    margin-top: 16px;
    padding: 18px;
    background: #f0fdf4;
    border-radius: var(--radius-lg);
    border: 1.5px solid #bbf7d0;
    text-align: center;
}

.calc-total-label {
    font-size: 11px;
    font-weight: 700;
    color: #166534;
    text-transform: uppercase;
}

.calc-total-value {
    font-size: 28px;
    font-weight: 900;
    color: #15803d;
    font-family: var(--font-mono);
}

.calc-ahorro {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.btn-whatsapp-calc {
    display: block;
    margin-top: 16px;
    padding: 14px;
    background: #10b981;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 800;
    transition: all 0.2s;
}

.btn-whatsapp-calc:hover {
    background: #059669;
}

/* ═══ DOCUMENTOS ═══ */
.doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: var(--surface-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    transition: all 0.2s;
}

.doc-item:hover {
    border-color: var(--primary-400);
}

.doc-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-nombre {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.doc-fecha {
    font-size: 12px;
    color: var(--text-muted);
}

.doc-link {
    padding: 8px 16px;
    background: var(--primary-500);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s;
}

.doc-link:hover {
    background: var(--primary-400);
}

/* ═══ MENSAJES ═══ */
.mensajes-intro {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.help-card {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 1.5px solid #bbf7d0;
}

.help-card h3 {
    color: #166534;
}

.btn-whatsapp-help {
    display: block;
    padding: 12px;
    background: #25d366;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    margin-top: 12px;
    transition: all 0.2s;
}

.btn-whatsapp-help:hover {
    background: #20bd5a;
}

/* ═══ MI PERFIL / NOSOTROS ═══ */
.perfil-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

.perfil-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.perfil-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-green));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    font-weight: 900;
}

.perfil-nombre {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
}

.perfil-datos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.perfil-dato {
    padding: 14px;
    background: var(--surface);
    border-radius: var(--radius-md);
}

.perfil-dato label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
    margin-bottom: 4px;
}

.perfil-dato .valor {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ═══ NOSOTROS ═══ */
.nosotros-hero {
    background: linear-gradient(135deg, var(--primary-900), var(--primary-700));
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

.nosotros-hero h3 {
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 8px;
}

.nosotros-hero h3 span {
    color: var(--primary-400);
}

.nosotros-hero p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.nosotros-vision {
    background: var(--surface-elevated);
    border-radius: var(--radius-lg);
    padding: 22px;
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.nosotros-vision h4 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.nosotros-vision p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.nosotros-valores {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.valor-item {
    text-align: center;
    padding: 18px 12px;
    background: var(--surface-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.valor-item .valor-icon {
    font-size: 28px;
    margin-bottom: 6px;
}

.valor-item .valor-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ═══ BADGES ═══ */
.badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.badge-verde {
    background: var(--accent-green-light);
    color: #065f46;
}

.badge-amarillo {
    background: var(--accent-amber-light);
    color: #92400e;
}

.badge-rojo {
    background: var(--accent-red-light);
    color: #991b1b;
}

/* ═══ TOAST ═══ */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-800);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-width: 90%;
}

.toast-cerrar {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    margin-left: 8px;
    opacity: 0.7;
}

.toast-cerrar:hover {
    opacity: 1;
}

/* ═══ EMPTY STATE ═══ */
.vacio {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
}

.loading-placeholder {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══ MI CUENTA ═══ */
.cuenta-fila {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.cuenta-fila:last-child {
    border-bottom: none;
}

.cuenta-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.cuenta-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.codigo-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary-50);
    border: 1.5px solid var(--primary-200);
    border-radius: var(--radius-sm);
    font-size: 18px;
    font-weight: 900;
    color: var(--primary-500);
    letter-spacing: 2px;
    font-family: var(--font-mono);
}

/* ═══ ALERTA ═══ */
.alerta {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alerta-rojo {
    background: var(--accent-red-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    .login-container {
        padding: 20px 16px;
    }

    .glass {
        padding: 24px 20px;
    }

    .quick-stats-bar {
        gap: 16px;
        padding: 10px 16px;
    }

    .portal-content {
        padding: 16px 12px 60px;
    }

    .panel-title {
        font-size: 18px;
    }

    .mini-sabana-grid {
        grid-template-columns: repeat(4, 60px) !important;
        gap: 6px !important;
        justify-content: center;
    }

    .mes-cuadro {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        padding: 4px !important;
    }

    .mes-cuadro .mes-nombre {
        font-size: 9px !important;
    }

    .mes-cuadro .mes-monto {
        font-size: 9px !important;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .prestamo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detalle-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .perfil-datos {
        grid-template-columns: 1fr;
    }

    .nosotros-valores {
        grid-template-columns: repeat(2, 1fr);
    }

    .comprobante-form .form-row {
        grid-template-columns: 1fr;
    }

    .historial-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (min-width: 769px) {
    .mini-sabana-grid {
        grid-template-columns: repeat(12, 1fr);
        gap: 10px;
    }

    .mes-cuadro {
        padding: 14px;
        height: auto;
        min-height: 80px;
    }

    .mes-cuadro .mes-nombre {
        font-size: 12px;
    }

    .mes-cuadro .mes-monto {
        font-size: 14px;
    }
}

@media (max-width: 600px) {
    .perfil-avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .perfil-nombre {
        font-size: 17px;
    }

    .tab-btn {
        font-size: 12px;
        padding: 12px 10px;
    }

    .qs-value {
        font-size: 14px;
    }

    .portal-header {
        padding: 10px 16px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* ══════════════════════════════════════════════════════════════════
   MEJORAS PORTAL v2.0 — Glassmorphism elevado + UX móvil
══════════════════════════════════════════════════════════════════ */

/* ── Fondo login más vibrante ── */
.login-bg-shapes {
    background: linear-gradient(135deg, #06090f 0%, #0c1222 40%, #0f1a35 70%, #080f1e 100%) !important;
}

.login-bg-shapes::before {
    background: radial-gradient(circle, rgba(37,99,235,0.35) 0%, transparent 70%) !important;
    width: 700px !important;
    height: 700px !important;
}

.login-bg-shapes::after {
    background: radial-gradient(circle, rgba(124,58,237,0.2) 0%, transparent 70%) !important;
}

/* ── Card glass más elevado ── */
.glass {
    background: rgba(255, 255, 255, 0.07) !important;
    backdrop-filter: blur(24px) saturate(1.6) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.6) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    box-shadow: 0 24px 80px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1) !important;
}

/* ── Logo animado ── */
.login-logo {
    animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 0 0px rgba(96,165,250,0)); }
    50%       { filter: drop-shadow(0 0 20px rgba(96,165,250,0.4)); }
}

/* ── Step indicators mejorados ── */
.step-num {
    background: linear-gradient(135deg, var(--primary-500), #7c3aed) !important;
    box-shadow: 0 4px 12px rgba(59,130,246,0.4) !important;
}

/* ── Input con glassmorphism ── */
.form-input,
input[type="tel"],
input[type="text"],
input[type="number"] {
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    color: white !important;
    transition: all 0.2s !important;
}

.form-input:focus,
input[type="tel"]:focus,
input[type="text"]:focus {
    background: rgba(255,255,255,0.12) !important;
    border-color: rgba(96,165,250,0.5) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15) !important;
}

.form-input::placeholder { color: rgba(255,255,255,0.35) !important; }

/* ── Botón primario del portal mejorado ── */
.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    box-shadow: 0 8px 24px rgba(37,99,235,0.4) !important;
    border-radius: 14px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    transition: all 0.2s !important;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    pointer-events: none;
}

.btn-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 14px 32px rgba(37,99,235,0.5) !important;
}

.btn-primary:active {
    transform: scale(0.97) !important;
}

/* ── Header portal con blur ── */
.portal-header {
    backdrop-filter: blur(20px) saturate(1.5) !important;
    -webkit-backdrop-filter: blur(20px) saturate(1.5) !important;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1), 0 4px 20px rgba(0,0,0,0.08) !important;
}

/* ── Tarjetas de info con mejor sombra ── */
.qs-card,
.info-card,
.prestamo-card {
    transition: transform 0.2s, box-shadow 0.2s !important;
}

.qs-card:active,
.info-card:active {
    transform: scale(0.98) !important;
}

/* ── Mes cuadro con mejor hover ── */
.mes-cuadro {
    transition: transform 0.15s, box-shadow 0.15s !important;
}

.mes-cuadro:active {
    transform: scale(0.95) !important;
}

/* ── Tab buttons con underline animado ── */
.tab-btn.activo {
    position: relative;
}

.tab-btn.activo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    border-radius: 2px;
    animation: tabLine 0.2s ease both;
}

@keyframes tabLine {
    from { width: 0; left: 50%; }
    to   { width: 60%; left: 20%; }
}

/* ── Selección con color de marca ── */
::selection {
    background: rgba(37, 99, 235, 0.2);
    color: white;
}

/* ── Safe areas para iOS/Android con notch ── */
.portal-content {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ── Input de código OTP más grande ── */
.otp-digit,
input.otp,
[id*="codigo"],
[id*="otp"] {
    letter-spacing: 0.4em !important;
    font-size: 24px !important;
    text-align: center !important;
}

/* ── Animación de entrada para pantallas ── */
.pantalla.activa {
    animation: portalFadeIn 0.3s cubic-bezier(0.4,0,0.2,1) both;
}

@keyframes portalFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Avatar usuario con gradiente ── */
.user-avatar,
.perfil-avatar {
    background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
    box-shadow: 0 4px 16px rgba(37,99,235,0.35) !important;
}