/* ===================================================================
   PORTAL COOSEMECADI - Estilos Globales
   =================================================================== */

/* ─── Variables ─────────────────────────────────────────────────── */
:root {
    --portal-primary: #1a6b3a;
    --portal-primary-dark: #124d2a;
    --portal-accent: #f5a623;
    --portal-bg: #f0f2f5;
}

/* ─── Login Page ─────────────────────────────────────────────────── */
.login-page {
    display: flex;
    min-height: 100vh;
}

/* Panel izquierdo */
.login-left {
    width: 45%;
    background: linear-gradient(160deg, var(--portal-primary) 0%, var(--portal-primary-dark) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 3.5rem;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 320px;
    height: 320px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.login-left::after {
    content: "";
    position: absolute;
    bottom: -100px;
    left: -60px;
    width: 280px;
    height: 280px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.login-left-content {
    position: relative;
    z-index: 1;
    margin-top: 2rem;
}

.login-brand-icon {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.15);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.75rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.login-brand-icon .rzi {
    font-size: 38px !important;
    color: white !important;
}

.login-brand-name {
    color: white;
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: 3px;
    margin-bottom: 0.3rem;
}

.login-brand-tagline {
    color: rgba(255,255,255,0.65);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.login-brand-divider {
    width: 48px;
    height: 3px;
    background: rgba(255,255,255,0.35);
    border-radius: 2px;
    margin: 1.75rem 0;
}

.login-brand-desc {
    color: rgba(255,255,255,0.75);
    font-size: 0.92rem;
    line-height: 1.65;
    max-width: 320px;
    margin-bottom: 2rem;
}

.login-brand-features {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.8);
    font-size: 0.88rem;
    font-weight: 500;
}

.login-feature .rzi {
    font-size: 18px !important;
    color: rgba(255,255,255,0.6) !important;
}

.login-left-footer {
    position: relative;
    z-index: 1;
    color: rgba(255,255,255,0.35);
    font-size: 0.75rem;
    margin: 0;
}

/* Panel derecho */
.login-right {
    flex: 1;
    background: #f8faf9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-form-wrapper {
    width: 100%;
    max-width: 380px;
}

.login-form-header {
    margin-bottom: 2rem;
}

.login-form-header h2 {
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.3rem;
}

.login-form-header p {
    color: #888;
    font-size: 0.9rem;
    margin: 0;
}

.login-field {
    margin-bottom: 1.25rem;
}

.login-field .rz-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.35rem;
    display: block;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff5f5;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 0.65rem 1rem;
    color: #c0392b;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.login-error .rzi {
    font-size: 18px !important;
    flex-shrink: 0;
}

.login-btn {
    margin-top: 0.5rem;
}

.login-mobile-brand {
    display: none;
}

/* Responsive: oculta panel izquierdo en mobile */
@media (max-width: 768px) {
    .login-left {
        display: none;
    }
    .login-right {
        width: 100%;
        min-height: 100vh;
        padding: 2rem 1.5rem;
        background: #ffffff;
    }
    .login-form-wrapper {
        max-width: 100%;
    }
    .login-mobile-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 2rem;
        padding-bottom: 1.75rem;
        border-bottom: 1px solid #e8e8e8;
    }
    .login-mobile-brand .login-brand-icon {
        width: 60px;
        height: 60px;
        background: var(--portal-primary);
        border-radius: 16px;
        margin-bottom: 1rem;
        border: none;
    }
    .login-mobile-brand .login-brand-icon .rzi {
        color: white !important;
        font-size: 30px !important;
    }
    .login-mobile-brand .login-brand-name {
        color: var(--portal-primary);
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
    .login-mobile-brand .login-brand-tagline {
        color: #888;
        font-size: 0.85rem;
    }
}

/* ─── Header ─────────────────────────────────────────────────────── */
.rz-header {
    background: var(--portal-primary) !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25) !important;
    border-bottom: none !important;
    height: 60px !important;
}

.portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 1.25rem;
    height: 60px;
}

.portal-header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-brand-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.25);
}

.portal-brand-icon .rzi {
    font-size: 20px !important;
    color: white !important;
}

.portal-brand-texts {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.portal-logo-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    letter-spacing: 1.5px;
}

.portal-subtitle {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.portal-header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 24px;
    padding: 0.3rem 0.9rem 0.3rem 0.4rem;
}

.portal-user-avatar {
    width: 30px;
    height: 30px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-user-avatar .rzi {
    font-size: 18px !important;
    color: white !important;
}

.portal-username {
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
}


/* ─── Sidebar ────────────────────────────────────────────────────── */
.rz-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e8ece9 !important;
    box-shadow: 2px 0 12px rgba(0,0,0,0.06) !important;
    width: 230px !important;
    min-width: 230px !important;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 0 0;
    overflow-y: auto;
}

/* Etiquetas de sección */
.sidebar-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1.6px;
    color: #aab8b0;
    padding: 1rem 1.25rem 0.35rem;
    text-transform: uppercase;
}

/* Items del menú */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    margin: 1px 0.65rem;
    border-radius: 8px;
    color: #3d6b50;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

.sidebar-item:hover {
    background: #edf5f0;
    color: var(--portal-primary);
    text-decoration: none;
}

.sidebar-item.active {
    background: #e0f0e8;
    color: var(--portal-primary);
    font-weight: 700;
}

.sidebar-item.active .sidebar-item-icon {
    color: var(--portal-primary);
    opacity: 1;
}

.sidebar-item-icon {
    font-size: 19px !important;
    color: #6fa882;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.sidebar-item:hover .sidebar-item-icon {
    color: var(--portal-primary);
}

.sidebar-item-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer del sidebar con botón de logout */
.sidebar-footer {
    margin-top: auto;
    padding: 1rem 0.65rem 1.25rem;
    border-top: 1px solid #e8ece9;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    background: transparent;
    border: 1px solid #dde8e2;
    color: #7a9b87;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.sidebar-logout-btn:hover {
    background: #fdf0f0;
    border-color: #f5c6c6;
    color: #c0392b;
}

.sidebar-logout-btn .rzi {
    font-size: 18px !important;
}

/* Ajuste de body */
.rz-body {
    background: var(--portal-bg) !important;
}

/* ─── Mobile sidebar independiente ──────────────────────────────── */
.mobile-overlay {
    display: none;
}

.mobile-sidebar {
    display: none;
}

@media (max-width: 768px) {
    .mobile-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1000;
        animation: fadeInOverlay 0.2s ease;
    }

    @keyframes fadeInOverlay {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    .mobile-sidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100vh;
        background: #ffffff;
        z-index: 1001;
        box-shadow: 4px 0 24px rgba(0,0,0,0.2);
        animation: slideInSidebar 0.25s ease;
    }

    @keyframes slideInSidebar {
        from { transform: translateX(-100%); }
        to   { transform: translateX(0); }
    }

    .mobile-sidebar-header {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        padding: 0.9rem 1rem;
        border-bottom: 1px solid #e8ece9;
        background: #ffffff;
    }

    .mobile-sidebar-close {
        margin-left: auto;
        background: none;
        border: none;
        color: #666;
        cursor: pointer;
        padding: 0.25rem;
        display: flex;
        align-items: center;
    }

    .mobile-sidebar-close .rzi {
        font-size: 22px !important;
    }
}

/* ─── Hamburger button (oculto en desktop) ───────────────────────── */
.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    margin-right: 0.5rem;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.hamburger-btn:hover {
    background: rgba(255,255,255,0.22);
}

.hamburger-btn .rzi {
    font-size: 20px !important;
}

/* ─── Overlay backdrop (mobile) ──────────────────────────────────── */
.sidebar-overlay {
    display: none;
}

/* ─── Responsive mobile ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    /* Sidebar oculto por defecto en mobile — JS lo muestra con estilos inline */
    .rz-sidebar {
        display: none !important;
        background-color: #ffffff !important;
    }

    /* Fondo sólido garantizado cuando está abierto */
    .sidebar-nav {
        background-color: #ffffff !important;
        min-height: 100vh;
    }

    .sidebar-item,
    .sidebar-section-label,
    .sidebar-logout-btn {
        background-color: transparent;
    }

    /* Cuerpo ocupa todo el ancho */
    .rz-body {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Overlay oscuro detrás del sidebar */
    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1000;
        animation: fadeIn 0.2s ease;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to   { opacity: 1; }
    }

    /* Nombre de usuario oculto en header mobile */
    .portal-username {
        display: none;
    }
}

/* ─── Body Content ───────────────────────────────────────────────── */
.portal-body-content {
    padding: 1.5rem;
}

/* ─── Dashboard ──────────────────────────────────────────────────── */
.dashboard-container {
    max-width: 1200px;
}

.welcome-card {
    background: linear-gradient(135deg, var(--portal-primary) 0%, var(--portal-primary-dark) 100%) !important;
    color: white !important;
    border-radius: 12px !important;
}

.welcome-card h3,
.welcome-card p {
    color: white !important;
}

.portal-menu-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 10px !important;
    height: 100%;
}

.portal-menu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.portal-menu-card-inner {
    text-align: center;
    padding: 0.5rem;
}

.portal-menu-icon {
    font-size: 42px !important;
    color: var(--portal-primary);
    margin-bottom: 0.75rem;
}

.portal-menu-card-admin .portal-menu-icon {
    color: var(--portal-accent);
}

/* ─── Paginas internas genéricas ─────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--portal-primary);
}

.page-header h3 {
    margin: 0;
    color: var(--portal-primary);
}

.page-header .page-icon {
    font-size: 32px;
    color: var(--portal-primary);
}

/* ─── Resumen / Totales ──────────────────────────────────────────── */
.resumen-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.resumen-label {
    font-size: 0.78rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.resumen-valor {
    font-size: 1.15rem;
    font-weight: 700;
    color: #333;
}

.resumen-valor-grande {
    font-size: 1.5rem;
    font-weight: 700;
}

/* ─── Mis Ahorros ──────────────────────────────────────────────── */
.socio-header-card {
    border-left: 4px solid var(--portal-primary) !important;
}

.socio-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.socio-header-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--portal-primary);
    line-height: 1.2;
}

.socio-header-subtitle {
    font-size: 0.9rem;
    color: #5f6368;
    margin-top: 0.2rem;
}

.socio-header-meta {
    font-size: 0.85rem;
    color: #5f6368;
    font-weight: 600;
}

.mis-ahorros-tabs {
    margin-top: 0.2rem;
}

