/*
 * Corrección específica para el estado activo del menú
 * Asegura que el elemento activo se mantenga marcado correctamente
 */

/* Asegurar que el elemento activo tenga la máxima prioridad */
.app-menu__item.active {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    color: #ffffff !important;
    border-left: 4px solid #2E7D32 !important;
}

.app-menu__item.active .app-menu__icon,
.app-menu__item.active .app-menu__label {
    color: #ffffff !important;
}

/* Elementos no activos */
.app-menu__item:not(.active) {
    background-color: transparent !important;
    border-left: 4px solid transparent !important;
}

.app-menu__item:not(.active) .app-menu__icon,
.app-menu__item:not(.active) .app-menu__label {
    color: #ffffff !important;
}

/* Hover para elementos no activos */
.app-menu__item:not(.active):hover {
    background: linear-gradient(135deg, #66BB6A 0%, #4CAF50 100%) !important;
    border-left: 4px solid #4CAF50 !important;
}

.app-menu__item:not(.active):hover .app-menu__icon,
.app-menu__item:not(.active):hover .app-menu__label {
    color: #ffffff !important;
}

/* Transiciones suaves */
.app-menu__item {
    transition: all 0.3s ease !important;
    border-left: 4px solid transparent;
}

/* Asegurar que el estado activo persista durante la navegación */
.app-menu__item.active {
    position: relative;
}

.app-menu__item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #2E7D32;
    z-index: 1;
}

/* Mejoras para el sidebar colapsado */
.sidebar-mini.sidenav-toggled .app-menu__item.active {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
}

.sidebar-mini.sidenav-toggled .app-menu__item.active::before {
    display: none;
}

/* Tooltip mejorado para sidebar colapsado */
.sidebar-mini.sidenav-toggled .app-menu__item:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

/* Asegurar que el estado activo sea visible en todas las resoluciones */
@media (max-width: 768px) {
    .app-menu__item.active {
        background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    }
}

/* Prevenir conflictos con otros estilos */
.app-menu__item.active {
    box-shadow: none !important;
}

/* Asegurar que el texto sea legible */
.app-menu__item.active .app-menu__label {
    font-weight: 500 !important;
}

.treeview-menu .treeview-item {
    position: relative;
    border-left: 4px solid transparent !important;
    transition: all 0.3s ease !important;
}

.treeview-menu .treeview-item .icon {
    color: inherit !important;
}

.treeview-menu .treeview-item:hover,
.treeview-menu .treeview-item:focus {
    background: linear-gradient(135deg, #66BB6A 0%, #4CAF50 100%) !important;
    color: #ffffff !important;
    border-left: 4px solid #4CAF50 !important;
}

.treeview-menu .treeview-item:hover .icon,
.treeview-menu .treeview-item:focus .icon {
    color: #ffffff !important;
}

.treeview-menu .treeview-item.active {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
    color: #ffffff !important;
    border-left: 4px solid #2E7D32 !important;
    font-weight: 500 !important;
}

.treeview-menu .treeview-item.active .icon {
    color: #ffffff !important;
}
