:host {
    display: contents;
}

:host .layout-sidebar-menu {
    width: 100%;
}

:host .layout-sidebar-menu__section {
    margin-top: 0.875rem;
}

:host .layout-sidebar-menu__section:first-child {
    margin-top: 0;
}

:host .layout-sidebar-menu__section-label {
    color: var(--p-text-muted-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 0.35rem;
    text-transform: uppercase;
}

:host .layout-sidebar-menu__list {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

:host .layout-sidebar-menu__list--nested {
    margin-left: 1.25rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--p-content-border-color);
}

:host .layout-sidebar-menu__item-row {
    align-items: center;
    border-radius: 0.375rem;
    display: flex;
    min-height: 2.25rem;
    width: 100%;
}

:host .layout-sidebar-menu__item-main {
    align-items: center;
    color: inherit;
    display: flex;
    flex: 1 1 auto;
    font-weight: 500;
    gap: 0.75rem;
    min-height: 2.25rem;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
}

:host a.layout-sidebar-menu__item-main {
    cursor: pointer;
}

:host .layout-sidebar-menu__item-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

:host .layout-sidebar-menu__toggle {
    align-items: center;
    align-self: stretch;
    background: transparent;
    border: 0;
    border-radius: 0.375rem;
    color: var(--p-text-muted-color);
    cursor: pointer;
    display: flex;
    flex: 0 0 2rem;
    justify-content: center;
    padding: 0;
}

:host .layout-sidebar-menu__item-row:has(:is(.layout-sidebar-menu__item-main, .layout-sidebar-menu__toggle):is(:hover, :focus-visible)) {
    background: var(--p-content-hover-background);
}

:host :is(.layout-sidebar-menu__item-main, .layout-sidebar-menu__toggle):focus-visible {
    outline: 2px solid var(--p-primary-color);
    outline-offset: -2px;
}

:host .layout-sidebar-menu__list--nested :is(.layout-sidebar-menu__item-main, .layout-sidebar-menu__item-row) {
    min-height: 2rem;
}

:host .layout-sidebar-menu__list--nested .layout-sidebar-menu__item-main {
    padding: 0.375rem 0.625rem;
}

:host .p-panelmenu-item-link-active {
    background: transparent;
    color: var(--p-primary-700);
}

:host .layout-sidebar-menu__item-row:has(.p-panelmenu-item-link-active) {
    background: var(--p-primary-50);
}

:host .layout-sidebar-menu__item-row:has(.p-panelmenu-item-link-active) .layout-sidebar-menu__toggle {
    color: var(--p-primary-700);
}

:host-context(.p-dark) .p-panelmenu-item-link-active {
    color: var(--p-primary-400);
}

:host-context(.p-dark) .layout-sidebar-menu__item-row:has(.p-panelmenu-item-link-active) {
    background: color-mix(in srgb, var(--p-primary-900) 30%, transparent);
}

:host-context(.p-dark) .layout-sidebar-menu__item-row:has(.p-panelmenu-item-link-active) .layout-sidebar-menu__toggle {
    color: var(--p-primary-400);
}
