/* Cabeçalho */
body > #content > #header {
    display: flex;
    align-items: center;
    height: 44px;
    background: #1b5e38 !important;
    border-bottom: 0;
    position: relative;
    z-index: 1000;
}

.top-navigation #header > #header-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
    width: auto !important;
    height: 100%;
    padding: 0 16px;
    float: none;
    background: rgba(0, 0, 0, 0.14) !important;
    color: #fff;
    text-decoration: none;
}

.top-navigation #header > #header-logo > span {
    font-weight: 600;
    white-space: nowrap;
}

.top-navigation #header > #header-info {
    flex: 0 0 auto;
    width: auto !important;
    margin-left: auto;
    padding-right: 14px;
    float: none;
}

.top-navigation #header > #header-info .dropdown button i {
    color: #fff;
}

/* Navegação */
.top-navigation #header > #header-nav {
    flex: 1 1 auto;
    display: flex;
    align-items: stretch;
    float: none;
    height: 100%;
    margin-left: 8px;
}

.menu-principal {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu-item {
    position: relative;
    display: flex;
    align-items: stretch;
}

.menu-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 11px;
    border-bottom: 3px solid transparent;
    color: #fff !important;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.menu-toggle:hover,
.menu-toggle:focus,
.menu-item.open > .menu-toggle {
    background-color: rgba(255, 255, 255, 0.14);
    color: #fff !important;
    text-decoration: none;
}

.menu-item.ativo > .menu-toggle {
    border-bottom-color: #fff;
}

.menu-seta {
    font-size: 14px;
    opacity: 0.8;
}

.menu-item.open > .menu-toggle .menu-seta {
    transform: rotate(180deg);
}

.menu-ambiente {
    display: flex;
    align-items: center;
    margin-left: 8px;
    white-space: nowrap;
}

.menu-ambiente b {
    font-size: 12px !important;
    padding: 3px 8px !important;
}

/* Painel de cada menu: um bloco por grupo */
.menu-painel {
    top: 100%;
    left: 0;
    min-width: 0;
    margin: 0;
    padding: 10px 8px;
    border: 1px solid #d5dbd6;
    border-radius: 0 0 3px 3px;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.menu-item.open > .menu-painel {
    display: grid;
    grid-template-columns: repeat(var(--colunas, 1), max-content);
    gap: 8px 12px;
    max-width: 96vw;
    overflow-x: auto;
}

.menu-grupo-titulo {
    margin-bottom: 2px;
    padding: 2px 8px 3px;
    border-bottom: 1px solid #d5dbd6;
    color: #26302a;
    font-size: 12px;
    font-weight: 700;
}

.menu-grupo-titulo .fa {
    width: 16px;
    margin-right: 5px;
    font-size: 12px;
    text-align: center;
}

.menu-link {
    display: block;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 3px;
    color: #26302a;
    font-size: 11.5px;
    line-height: 1.4;
    text-decoration: none;
}

.menu-link-icone {
    width: 16px;
    margin-right: 6px;
    color: #9db3a5;
    font-size: 11px;
    text-align: center;
}

.menu-link:hover .menu-link-icone,
.menu-link:focus .menu-link-icone,
.menu-link.ativo .menu-link-icone {
    color: #1b5e38;
}

.menu-link:hover,
.menu-link:focus {
    background: #e8f0ea;
    color: #1b5e38;
    text-decoration: none;
}

.menu-link.ativo {
    background: #e8f0ea;
    color: #1b5e38;
    font-weight: 600;
}

.sub-menu {
    z-index: 9999 !important;
}

@media (max-width: 991px) {
    .top-navigation #header > #header-logo {
        padding: 0 12px;
    }

    .top-navigation #header > #header-logo > span {
        display: none;
    }

    .menu-toggle {
        padding: 0 10px;
        font-size: 13px;
    }

    .menu-toggle .nav-label {
        display: none;
    }

    .menu-item {
        position: static;
    }

    .menu-painel {
        position: fixed;
        top: 44px;
        left: 0;
        right: 0;
        max-height: calc(100vh - 44px);
        overflow-y: auto;
        border-radius: 0;
    }

    .menu-item.open > .menu-painel {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        max-width: none;
    }

    .menu-link {
        white-space: normal;
    }
}
