/* ==========================================================================
   Sidebar Dropdown Final
   Arquivo carregado pelo header.php:
   assets/css/sidebar-dropdown.css
   ========================================================================== */

/* Garante rolagem interna do sidebar sem travar a tela */
.app-shell {
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

.app-sidebar {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 14px !important;
    scrollbar-width: thin;
}

.app-main {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar discreta */
.app-sidebar::-webkit-scrollbar {
    width: 6px;
}

.app-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.app-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.30);
}

/* Grupo */
.sidebar-group {
    margin-top: 0;
}

/* Título do grupo clicável, mantendo a estética do título antigo */
.sidebar-group-toggle {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
    margin: 0;
    text-align: left;
    cursor: pointer;
}

/* Preserva a estética dos títulos Principal / Financeiro / Sistema */
.sidebar-section-title-button {
    display: block;
    flex: 1;
    margin-bottom: 0;
}

/* Seta do dropdown */
.sidebar-group-arrow {
    font-size: .72rem;
    opacity: .62;
    transition: transform .18s ease, opacity .18s ease;
    margin-right: 18px;
}

.sidebar-group.is-open .sidebar-group-arrow {
    transform: rotate(180deg);
    opacity: .95;
}

/* Conteúdo do grupo */
.sidebar-group-content {
    display: none;
    margin-top: 4px;
}

.sidebar-group.is-open .sidebar-group-content {
    display: block;
}

/* Compacta apenas os links; títulos de grupo não são reduzidos */
.app-sidebar .sidebar-menu {
    padding: 0 12px;
}

.app-sidebar .sidebar-menu > .sidebar-link {
    min-height: 32px !important;
    height: 32px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 1px !important;
    font-size: .84rem !important;
}

.app-sidebar .sidebar-menu > .sidebar-link i {
    font-size: .94rem !important;
}

.app-sidebar .sidebar-menu > .sidebar-link span,
.app-sidebar .sidebar-menu > .sidebar-link i {
    line-height: 1 !important;
}

/* Módulo desativado */
.sidebar-section-muted {
    opacity: .65;
    font-weight: 600;
    font-size: .66rem;
    text-transform: lowercase;
    letter-spacing: 0;
}

/* Rodapé segue a rolagem */
.sidebar-footer {
    position: static !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin-top: 10px !important;
    padding-bottom: 12px !important;
}

.app-sidebar .sidebar-footer .sidebar-link {
    min-height: 32px !important;
    height: 32px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 1px !important;
    font-size: .84rem !important;
}

/* Mobile */
@media (max-width: 991px) {
    .app-shell {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .app-sidebar {
        height: 100vh !important;
        max-height: 100vh !important;
        overflow-y: auto !important;
    }

    .app-main {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .app-sidebar .sidebar-menu > .sidebar-link,
    .app-sidebar .sidebar-footer .sidebar-link {
        min-height: 38px !important;
        height: 38px !important;
        font-size: .88rem !important;
    }
}
