:root {
    --sidebar-width: 260px;
    --sidebar-bg: #0b0f19; /* Un tono mucho más profundo y premium */
    --sidebar-color: #8b9bb4; /* Texto inactivo más legible pero sutil */
    --sidebar-active-bg: linear-gradient(118deg, #3b82f6, #2563eb); /* Gradiente vibrante */
    --sidebar-active-color: #ffffff;
    --topbar-height: 70px;
    --bg-main: #f4f7fe;
}
/* 1. Forzar que el contenedor principal ocupe siempre el 100% del alto de la pantalla */
#app-wrapper {
    min-height: 100vh;
}

/* 2. Actualización del Sidebar: Alto total, fijo y con scroll independiente */
.app-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.04);
    
    /* REGLAS CLAVE PARA EL DISEÑO PREMIUM FIJO */
    height: 100vh; /* Ocupa el 100% del alto de la ventana */
    position: sticky; /* Se queda pegado al hacer scroll en el contenido */
    top: 0;
    overflow-y: auto; /* Permite scroll internamente si tienes muchos módulos */
}

/* 3. Estilizar la barra de scroll del menú para que no se vea fea en Windows */
.app-sidebar::-webkit-scrollbar {
    width: 6px;
}
.app-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.app-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Etiquetas de categoría más elegantes */
.sidebar-menu .menu-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1rem;
    color: #4f6384 !important;
    margin-top: 1.5rem;
    text-transform: uppercase;
}

/* Enlaces del menú: Efecto píldora y transiciones */
.sidebar-menu .nav-link {
    color: var(--sidebar-color);
    font-size: 0.925rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    margin: 0.25rem 1rem; /* Genera el efecto de píldora despegada de los bordes */
    border-radius: 0.5rem;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
}


.sidebar-menu .nav-link i {
    font-size: 1.15rem;        
    transition: color 0.2s ease;

}

/* Hover: Microinteracción de desplazamiento */
.sidebar-menu .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

/* Estado Activo: Gradiente y Sombra (Glow) */
.sidebar-menu .nav-link.active {
    color: var(--sidebar-active-color);
    background: var(--sidebar-active-bg);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    font-weight: 600;
}

.sidebar-menu .nav-link.active:hover {
    transform: none; /* Evitamos que el activo se mueva */
}


@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.spin-animation {
    display: inline-block;
    animation: spin 0.5s ease-in-out;
}
