:root {
    --color-institucional-azul: #18529D;
    --color-institucional-verde: #28AD56;
    --sidebar-width: 250px;
    --navbar-height: 70px; /* Definimos la altura exacta del navbar */
}

body {
    overflow-x: hidden;
    background-color: #f4f6f9;
    font-family: 'Roboto', sans-serif;
}

/* --- NAVBAR (BARRA SUPERIOR) --- */
/* CORRECCIÓN: El Navbar ahora tiene el Z-Index más alto para que el botón siempre sea clicable */
.navbar {
    height: var(--navbar-height);
    z-index: 1060; /* MÁS ALTO QUE EL SIDEBAR */
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
    background-color: #fff;
}

/* --- WRAPPER PRINCIPAL --- */
#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
    margin-top: var(--navbar-height); /* Empuja todo el contenido hacia abajo */
}

/* --- SIDEBAR (MENÚ LATERAL) --- */
#sidebar-wrapper {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--navbar-height); /* Empieza DEBAJO del navbar */
    left: 0;
    height: calc(100vh - var(--navbar-height)); /* Ocupa el resto de la altura */
    margin-left: calc(var(--sidebar-width) * -1); /* Oculto por defecto en Móvil */
    z-index: 1050; 
    background-color: #ffffff;
    border-right: 1px solid #dee2e6;
    transition: margin 0.25s ease-out;
    overflow-y: auto;
}

/* --- CONTENIDO DE LA PÁGINA --- */
#page-content-wrapper {
    width: 100%;
    padding-left: 0;
    transition: all 0.25s ease-out;
}

/* --- ESTILOS INTERNOS --- */
.sidebar-heading {
    padding: 1rem;
    font-size: 1.2rem;
    color: var(--color-institucional-azul);
    font-weight: bold;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.list-group-item {
    border: none;
    padding: 15px 25px;
    color: #495057;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    color: var(--color-institucional-azul);
    font-weight: 500;
}

.active-link {
    color: var(--color-institucional-azul) !important;
    background-color: #e9ecef !important;
    border-right: 4px solid var(--color-institucional-azul);
    font-weight: bold;
}

/* --- RESPONSIVIDAD (LÓGICA BLINDADA) --- */

/* MÓVIL: Al presionar botón (toggled), el menú APARECE (margin 0) */
#wrapper.toggled #sidebar-wrapper {
    margin-left: 0;
}

/* PC (Pantallas grandes) */
@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0; /* Visible por defecto */
    }
    
    #page-content-wrapper {
        padding-left: var(--sidebar-width); /* Empuja el contenido */
    }

    /* Al presionar botón en PC: SE OCULTA */
    #wrapper.toggled #sidebar-wrapper {
        margin-left: calc(var(--sidebar-width) * -1);
    }
    
    #wrapper.toggled #page-content-wrapper {
        padding-left: 0;
    }
}
/* --- ESTILOS DEL LOGIN --- */
.login-card {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: none; /* Quitar borde default de bootstrap */
}

.login-side-image {
    background: url('https://images.unsplash.com/photo-1497366216548-37526070297c?auto=format&fit=crop&q=80') no-repeat center center;
    background-size: cover;
    position: relative;
    min-height: 500px; /* Altura mínima para que se vea la imagen */
}

.login-side-image::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(24, 82, 157, 0.8); /* Tu azul institucional con transparencia */
}

.login-content {
    padding: 3rem;
}