/* RESET BÁSICO */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background-color: #f4f6f9; /* Gris muy suave para el fondo del contenido */
}

/* --- SIDEBAR (Barra Lateral) --- */
.sidebar {
    height: 100vh; /* Ocupa todo el alto de la pantalla */
    width: 260px;  /* Ancho fijo */
    position: fixed; /* Se queda quieta al hacer scroll */
    top: 0;
    left: 0;
    background-color: #003366; /* Azul Corporativo */
    color: white;
    display: flex;
    flex-direction: column; /* Elementos uno debajo del otro */
    padding: 20px;
    box-shadow: 4px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

/* LOGO */
.sidebar-brand {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* ENLACES */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1; /* Ocupa el espacio disponible */
}

.nav-link {
    text-decoration: none;
    color: rgba(255,255,255,0.8);
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(5px); /* Pequeña animación a la derecha */
}

.nav-link.active {
    background-color: #007bff; /* Azul brillante para la opción activa */
    color: white;
    box-shadow: 0 4px 10px rgba(0,123,255,0.3);
}

/* ZONA DE USUARIO (Abajo) */
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: auto; /* Empuja esto al final del sidebar */
}

.user-info {
    font-size: 14px;
    margin-bottom: 10px;
    color: #ccc;
    text-align: center;
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-logout:hover {
    background-color: #bb2d3b;
}

/* --- AJUSTE DEL CONTENIDO PRINCIPAL --- */
/* Esta clase se inyectará automáticamente en el JS */
.body-with-sidebar {
    margin-left: 260px; /* Mismo ancho que el sidebar */
    padding: 20px;
    transition: margin-left 0.3s;
}

/* RESPONSIVE (Móviles) */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .body-with-sidebar {
        margin-left: 0;
    }
    .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
}