.sidebar {
    display: flex;
    flex-direction: column;
    max-width: 450px;
    padding: 32px 30px;
    background: var(--Fundametal-White, #FFF);
    border-right: 1px solid var(--background-Grey-2, #C3D4DA);
    box-sizing: border-box;
    overflow-y: auto;
    flex-shrink: 0;
    height: 100%;
}

.sidebar-header {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
    align-self: stretch;
    padding: 16px 16px 30px 16px;
}

.sidebar-header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1 0 0;
    background: rgba(255, 255, 255, 0);
}

.sidebar-header-btn {
    display: flex;
    width: 36px;
    height: 36px;
    padding: 10px 10px 9px 10px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    aspect-ratio: 1/1;
    border-radius: 2px;
    background-color: var(--Secondario, #F9BD00);
    border: none;
    cursor: pointer;
}

.sidebar-header-info h2 {
    flex: 1 0 0;
    color: var(--Text-Black, #000);
    font-family: "Titillium Web", sans-serif;
    font-size: 24px;
    font-style: normal;
    font-weight: 700;
    line-height: 120%;
    margin: 0;
}

.sidebar-header-info span {
    color: var(--Secondary-Color, #6C757D);
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 21px;
    margin: 0;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.menu-item-suggested {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: stretch;
    border-radius: 2px;
    background: var(--primary, #00A4B7);
    width: 100%;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: stretch;
    border-radius: 2px;
    background: var(--background-white, #FFF);
    width: 100%;
}

.menu-item:hover {
    background: #11616F;
}

    .menu-item:hover {
        background: #11616F;
    }

        .menu-item:hover .menu-item-text,
        .menu-item:hover .menu-item-icon {
            color: #ffffff;
        }

.menu-item-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 0 0;
    padding: 10px 28px 10px 16px;
}

.menu-item-icontext {
    display: flex;
    align-items: center;
    gap: 4px;
    align-self: stretch;
    cursor: pointer;
}

.menu-item-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
    color: black;
}

.menu-item-text {
    flex: 1;
    color: var(--Text-Black, #000);
    font-family: Inter;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.menu-item-arrow {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 16px;
    height: 16px;
}

.menu-item-arrow.open {
    transform: rotate(180deg);
}
.menu-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    width: 100%;
}

.menu-item.active .menu-children {
    max-height: fit-content;
}

.menu-item.active > .menu-item-icontext {
    background: var(--Primario, #01A2B7);
    color: white;
}

.menu-item.active {
}

.menu-item.active > .menu-item-icontext {
    background: var(--Primario, #01A2B7);
    color: white;
}

.menu-item.active > .menu-item-icontext .menu-item-text,
.menu-item.active > .menu-item-icontext .menu-item-icon {
    color: black;
}

.menu-item-child:hover {
    background: #e0e0e0;
}

    .menu-item-child:hover .menu-item-child-text {
        text-decoration: underline;
        color: black !important;
    }

.menu-item-child {
    display: flex;
    padding: 8px 16px 8px 38px;
    align-items: center;
    align-self: stretch;
    /*border-radius: 2px;*/
    background: var(--background-Grey1---Light, #F2F2F2);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.menu-item-child.active {
    border-left: 8px solid var(--Secondario, #F9BD00);
    background: var(--background-Grey1---Light, #F2F2F2);
    color: black;
}

.menu-item-child:visited,
.menu-item-child:hover,
.menu-item-child:active {
    color: black;
    text-decoration: none;
}

.menu-item-child-text {
    align-self: stretch;
    color: var(--Text-Black, #000);
    font-family: Inter;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
}

.menu-item-child.active .menu-item-child-text {
    color: var(--Text-Black, #000) !important;
    font-family: Inter;
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 150%;
    text-decoration: underline;
}

.menu-item-child:hover .menu-item-child-text {
    text-decoration: underline;
    color: black !important;
}

.sidebar-footer {
    display: flex;
    /*width: 282px;*/
    min-height: 160px;
    padding-top: 24px;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    flex: 1 0 0;
}

.sidebar-back-wrapper {
    display: flex;
    padding: 12px 0 0 0px;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 4px;
    flex: 1 0 0;
    align-self: stretch;
    cursor: pointer;
}

.sidebar-back {
    display: flex;
    width: 282px;
    height: 36px;
    padding: 6px 12px;
    align-items: center;
    gap: 10px;
    border-radius: 2px;
}

.sidebar-exit-wrapper {
    display: flex;
    padding: 10px 28px 20px 16px;
    align-items: center;
    gap: 4px;
    align-self: stretch;
    border-radius: 2px;
    border-top: 1px solid var(--background-Grey-4---Dark, #6C757D);
    background: var(--background-white, #FFF);
    cursor:pointer;
}

.sidebar-exit {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 0 0;
}

.footer-back-link {
    flex: 1;
    color: var(--Text-Black, #000);
    font-family: Inter;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    cursor: pointer;
    text-decoration: none;
    color: #11616F;
}

.footer-exit-link {
    flex: 1;
    color: var(--Text-Black, #000);
    font-family: Inter;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.footer-back-icon {
    color: #11616F;
}


.footer-exit-link:visited,
.footer-exit-link:hover,
.footer-exit-link:active {
    color: inherit;
    text-decoration: none;
}

.footer-back-link:visited,
.footer-back-link:hover,
.footer-back-link:active {
    text-decoration: none;
    color: #11616F;
}

sidebar-mobile-actions {
    width: 100%;
    gap: 1rem;
    padding: 20px 0px;
}

/* Stili per utente non autenticato (solo pulsante "Apri una richiesta di assistenza") */
.sidebar-mobile-actions.guest-actions {
    justify-content: center !important;
}

    .sidebar-mobile-actions.guest-actions .topbar-new-ticket {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
    }

/* Stili per utente autenticato (entrambi i pulsanti) */
.sidebar-mobile-actions.auth-actions {
    margin-bottom: 20px;
    justify-content: space-between !important;
}

    .sidebar-mobile-actions.auth-actions .btn {
        width: calc(50% - 0.5rem) !important;
        max-width: calc(50% - 0.5rem) !important;
        min-width: unset !important;
        flex: 1 1 auto !important;
    }

/* Reset delle larghezze base */
.sidebar-mobile-actions .btn {
    width: auto;
    min-width: unset;
    max-width: unset;
    flex: 0 1 auto;
}

/* Pulsante "Apri una richiesta di assistenza" unificato in css/base.css (.topbar-new-ticket) */

.topbar-ticket-list {
    display: flex;
    height: 38px;
    padding: 6px 12px;
    justify-content: center;
    align-items: center;
    gap: 8px;
    border-radius: 2px;
    background: var(--white);
    border: 1px solid var(--primary-dark-1);
    cursor: pointer;
    color: var(--primary-dark-1);
    font-family: "Inter", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 150%;
}

    .topbar-ticket-list:hover {
        background-color: var(--primary);
    }

@media (max-width: 991px) {

    .sidebar {
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 100vw !important;
        border-right: none !important;
        height: 100% !important;
        max-height: 100% !important;
        padding: 24px 20px 0px 20px;
        box-sizing: border-box;
        overflow-y: auto;
    }

    .sidebar-menu,
    .sidebar-footer,
    .sidebar-back,
    .sidebar-exit-wrapper {
        width: 100% !important;
    }

    .sidebar-back {
        width: 100% !important;
    }
}

@media (max-width: 991px) {

    #mobileSidebar {
        position: fixed;
        top: 56px;
        right: 0;
        width: 100vw;
        height: calc(100vh - 56px);
        transform: translateX(100%);
        transition: transform 0.5s cubic-bezier(0.20, 0.8, 0.25, 1);
        z-index: 1050;
        border: none;
    }

        #mobileSidebar.show {
            transform: translateX(0);
        }

        #mobileSidebar .offcanvas-body {
            height: 100%;
            padding: 0;
            overflow-y: auto;
        }

        #mobileSidebar .sidebar {
            width: 100%;
            height: 100%;
            padding: 24px 20px 20px 20px;
            box-sizing: border-box;
            border-right: none;
            overflow-y: auto;
        }
}
.menu-item:not(.active):hover {
    background: #11616F;
}

    .menu-item:not(.active):hover > .menu-item-icontext .menu-item-text,
    .menu-item:not(.active):hover > .menu-item-icontext .menu-item-icon {
        color: #ffffff;
        text-decoration: underline;
    }