/* =================================================================== */
/* ==                ESTILOS GENERALES Y VARIABLES                  == */
/* =================================================================== */
:root {
    --color-primario: #21274f;
    --color-secundario: #00aaff;
    --color-acento: #84bd00;
    --color-texto-claro: #ffffff;
    --color-texto-oscuro: #333333;
    --color-fondo-claro: #f8f9fa;
    --fuente-principal: 'Roboto', sans-serif;
}

html, body {
    font-family: var(--fuente-principal);
    color: var(--color-texto-oscuro);
    background-color: var(--color-fondo-claro);
}

a, .btn-link {
    color: var(--color-secundario);
}

.btn-primary {
    background-color: var(--color-primario) !important;
    border-color: var(--color-primario) !important;
    color: var(--color-texto-claro) !important;
}

.btn-accent {
    background-color: var(--color-acento) !important;
    border-color: var(--color-acento) !important;
    color: var(--color-texto-claro) !important;
    font-weight: 500;
}

    .btn-accent:hover {
        background-color: #76a800;
        border-color: #76a800;
    }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--color-secundario);
}

/* =================================================================== */
/* ==       ESTILOS PARA EL LAYOUT INTERNO (ANTI-CONFLICTO)         == */
/* =================================================================== */

.page:has(.sidebar) {
    position: relative;
    display: flex;
    flex-direction: column;
}

    .page:has(.sidebar) main {
        flex: 1;
    }

.page > .sidebar {
    background-image: linear-gradient(180deg, var(--color-primario) 0%, #1a1f3c 70%);
}

.top-row {
    background-color: #f7f7f7;
    border-bottom: 1px solid #d6d5d5;
    justify-content: flex-end;
    height: 4.5rem;
    display: flex;
    align-items: center;
    padding-right: 1.5rem;
}

.navbar-toggler {
    appearance: none;
    cursor: pointer;
    width: 3.5rem;
    height: 2.5rem;
    color: var(--color-primario);
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    z-index: 10;
    border: 1px solid var(--color-primario);
    border-radius: 4px;
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(33, 39, 79, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem;
}

    .navbar-toggler:checked {
        background-color: rgba(33, 39, 79, 0.2);
    }

.nav-scrollable {
    display: none;
    background-color: var(--color-primario);
}

.navbar-toggler:checked ~ .nav-scrollable {
    display: block;
}

/* =================================================================== */
/* ==   REGLAS RESPONSIVE PARA LAYOUT INTERNO (ANTI-CONFLICTO)      == */
/* =================================================================== */

@media (min-width: 992px) {
    .page:has(.sidebar) {
        flex-direction: row;
    }

    .page > .sidebar {
        width: 280px; /* Ajustado para el nuevo menú */
        height: 100vh;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .navbar-toggler, .nav-scrollable {
        display: none !important;
    }

    .page:has(.sidebar) main {
        width: calc(100% - 280px);
        margin-left: auto;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 900;
        width: 100%;
    }
}

/* =================================================================== */
/* ==      ESTILOS PARA LA BARRA DE NAVEGACIÓN LATERAL (SIDEBAR)    == */
/* =================================================================== */

.nav-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--color-primario);
    background-image: linear-gradient(180deg, var(--color-primario) 0%, #1a1f3c 100%);
    color: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.15);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) transparent;
}

/* --- LOGO --- */
.logo-container {
    padding: 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
    background-color: rgba(0,0,0,0.1);
}

    .logo-container img {
        max-width: 160px; /* Tamaño controlado */
        height: auto;
        filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.3));
        transition: transform 0.3s ease;
    }

    .logo-container a:hover img {
        transform: scale(1.05);
    }

/* --- ITEMS DEL MENÚ --- */
.nav-item {
    margin-bottom: 0.2rem;
}

    .nav-item .nav-link {
        color: #d1d5db; /* Gris claro para inactivo */
        border-radius: 4px;
        padding: 0.8rem 1rem;
        transition: all 0.25s ease-in-out;
        border-left: 4px solid transparent;
        font-size: 0.95rem;
        font-weight: 400;
        display: flex;
        align-items: center;
    }

        /* Efecto Hover */
        .nav-item .nav-link:hover {
            background-color: rgba(255, 255, 255, 0.08);
            color: white;
            padding-left: 1.3rem; /* Desplazamiento sutil */
        }

        /* Estado Activo */
        .nav-item .nav-link.active {
            background-color: rgba(255, 255, 255, 0.12);
            color: white;
            border-left-color: var(--color-acento); /* Borde verde */
            font-weight: 600;
        }

        /* Iconos (Bootstrap Icons y FontAwesome) */
        .nav-item .nav-link span.bi,
        .nav-item .nav-link span.fas {
            font-size: 1.2rem;
            width: 30px;
            text-align: center;
            margin-right: 10px;
            color: var(--color-secundario);
            transition: color 0.3s ease;
        }

/* Iconos de Imagen (Equifax) */
.nav-icon-img {
    width: 30px;
    text-align: center;
    margin-right: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

    .nav-icon-img img {
        height: 16px;
        width: auto;
        /* Invierte el color de negro a blanco para que se vea en fondo oscuro */
        filter: brightness(0) invert(1);
        opacity: 0.8;
        transition: opacity 0.3s;
    }

/* Iconos en estado activo */
.nav-item .nav-link.active span.bi,
.nav-item .nav-link.active span.fas {
    color: var(--color-acento);
}

.nav-item .nav-link.active .nav-icon-img img {
    opacity: 1; /* Brillo total si está activo */
    filter: brightness(0) invert(1) drop-shadow(0 0 2px var(--color-acento));
}

/* Separadores de Sección */
.nav-separator {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
    padding: 1.5rem 1.5rem 0.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* =================================================================== */
/* ==       PÁGINAS DE AUTENTICACIÓN (LOGIN Y REGISTRO)           == */
/* =================================================================== */

.login-split-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.login-form-panel {
    background-color: white;
    width: 60%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 4rem;
    box-sizing: border-box;
    border: none;
}

.login-form-content {
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
}

.login-image-panel,
.register-image-panel {
    width: 40%;
    background-size: cover;
    background-position: center;
}

.login-image-panel {
    background-image: url('../img/FactoringTrabajo1.png');
    filter: grayscale(20%);
}

.register-image-panel {
    background-image: url('../img/FactoringTrabajo2.png');
}

.login-logo-container {
    text-align: center;
    margin-bottom: 1rem;
}

.login-logo {
    max-width: 240px;
    height: auto;
    transition: opacity 0.2s ease-in-out;
}

.login-logo-container a:hover .login-logo {
    opacity: 0.85;
}

.logo-divider {
    border: 0;
    border-top: 1px solid #e0e0e0;
    margin: 1rem auto 2.5rem;
    width: 100%;
}

.login-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    width: 100%;
}

.login-page-links a {
    color: var(--color-primario);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

    .login-page-links a:hover {
        color: var(--color-secundario);
        text-decoration: underline;
    }

.login-page-links .link-separator {
    margin: 0 0.5rem;
    color: #ccc;
}

.login-options-row .form-check-label {
    font-size: 0.9rem;
    color: #555;
}

.register-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* =================================================================== */
/* ==         ESTILOS FINALES Y REFINADOS PARA EL DASHBOARD         == */
/* =================================================================== */

.profile-header {
    background-color: var(--color-primario);
    color: var(--color-texto-claro);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    border-radius: 12px;
}

    .profile-header h1 {
        font-weight: 700;
        font-size: 2.5rem;
        margin: 0;
    }

    .profile-header p {
        margin-top: 0.5rem;
        margin-bottom: 0;
        font-size: 1.1rem;
        opacity: 0.85;
    }

.profile-data-card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    height: 100%;
    text-align: center;
}

.data-item-label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.data-item-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-texto-oscuro);
    word-wrap: break-word;
}

/* =================================================================== */
/* ==       ESTILOS PARA EL COMPONENTE LOGIN-DISPLAY                == */
/* =================================================================== */

.user-info-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

    .user-info-container form {
        margin: 0;
    }

.welcome-message {
    color: var(--color-texto-oscuro);
    text-decoration: none;
    font-weight: 500;
}

.btn-logout {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    border: 2px solid var(--color-primario) !important;
    background-color: transparent !important;
    color: var(--color-primario) !important;
    font-weight: 600 !important;
    padding: 0.4rem 1rem !important;
    border-radius: 8px !important;
    transition: all 0.2s ease-in-out !important;
    line-height: 1.5;
}

    .btn-logout:hover {
        background-color: var(--color-primario) !important;
        color: var(--color-texto-claro) !important;
    }
