/* Ancho del menú lateral */
:root {
    --sidebar-width: 240px;
}

body {
    background-color: #f8f9fa;
    position: relative;
}

/* Estilos para el menú lateral (Sidebar) */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    background-color: #212529; /* Color oscuro */
    padding-top: 20px;
    z-index: 1030;
    transition: transform 0.3s ease;
}

.sidebar .sidebar-header {
    padding: 0 1.5rem 1rem 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .sidebar-header a {
    color: #fff;
    font-size: 1.2rem; /* Ajustado para texto más largo */
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.sidebar .sidebar-header a i {
    margin-right: 10px;
    font-size: 1.5rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.65);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link .bi {
    margin-right: 10px;
}

.sidebar .nav-heading {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    font-weight: bold;
}

/* Contenido Principal */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    transition: margin-left 0.3s ease;
}

/* Barra Superior del Usuario (Desktop) */
.user-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.75rem 2rem;
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

/* Overlay para el fondo oscuro en móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1020;
}

/* --- ESTILOS RESPONSIVE PARA MÓVILES --- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }

    .sidebar.toggled {
        transform: translateX(0);
    }
    
    .main-content, .user-bar {
        margin-left: 0;
    }

    .sidebar-overlay.active {
        display: block;
    }
}