/* layout.css — shell applicativa: side menu, topbar e media query di layout (>=992px). */

/*Start SideMenu*/

.layout-menu {
    position: fixed;
    top: 0;
    left: 0;
    margin-right: 0;
    margin-left: 0;
}

    .layout-menu .nav-item a.active {
        border-radius: 0.375rem;
        color: var(--mud-palette-primary, #696cff);
        background-color: var(--back-color-active-link);
    }

        .layout-menu .nav-item a.active:hover {
            text-decoration: none;
            color: var(--mud-palette-primary, #696cff);
            background-color: var(--back-color-active-link);
            transition: background-color 0.23s ease 0.1s;
        }

        .layout-menu .nav-item a.active:before {
            content: "";
            position: absolute;
            right: 0;
            width: 0.25rem;
            height: 2.5rem;
            border-radius: 0.375rem;
            background: var(--mud-palette-primary, #696cff);
            margin-top: -8px;
        }

#LgLink:before {
    height: 3.5rem !important;
    margin-top: 0px !important;
}

.layout-menu .nav-item a:hover {
    text-decoration: none;
    color: var(--txt-color);
    background-color: var(--back-color-hover-link);
    transition: background-color 0.23s ease 0.1s;
}

.layout-menu .nav-item a {
    background-color: none;
    transition: background-color 0.23s ease 0.1s;
}

.bg-menu-theme {
    background-color: var(--mud-palette-surface, #fff);
    color: var(--mud-palette-text-secondary, #697a8d);
}

.menu-vertical {
    transform: translate3d(-100%, 0, 0);
    width: var(--menu-width);
    height: 100vh;
    box-shadow: 0 0.125rem 0.375rem 0 rgb(161 172 184 / 12%);
    transition: all 0.23s ease 0.1s;
    z-index: var(--z-shell-menu);
    display: flex;
    flex-direction: column;
}

/* Layout interno: logo fisso in alto, lista voci che scrolla */
.layout-menu .navbar {
    height: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
}

.layout-menu #menu {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* Etichetta di sezione del menu (usata con .rep-eyebrow) */
.menu-section-label {
    padding: 1rem 1.5rem 0.25rem;
    list-style: none;
}

.menu-vertical-click {
    transform: translate3d(0, 0, 0);
    transition: all 0.23s ease 0.1s;
}

.rotate-icon-right {
    transform: rotateZ(0deg);
    transition: all 0.23s ease 0.1s;
}

.rotate-icon-left {
    transform: rotateZ(180deg);
    transition: all 0.23s ease 0.1s;
}

.rotate-icon-subMenu-down {
    transform: rotateZ(90deg);
    transition: all 0.23s ease 0.1s;
}

.open-sub-menu {
    display: block;
    transition: all 0.23s ease 0.1s;
}

.close-sub-menu {
    display: none;
    transition: all 0.23s ease 0.1s;
}

.overlay {
    position: fixed;
    background-color: var(--back-color-overlay);
    height: 100vh;
    width: 100%;
    left: var(--menu-width);
    display: block;
    transition: all 0.23s ease 0.1s;
    opacity: 0.35;
    z-index: var(--z-shell-overlay);
}
/*End SideMenu*/

/*Start Topbar*/
/* Sticky funziona finché MudLayout/.main non introducono un overflow container:
   lo scroll deve restare sul body. */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-shell-topbar);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    min-height: var(--topbar-height);
    padding: 0.5rem 1rem;
    background-color: var(--mud-palette-surface, #fff);
    box-shadow: 0 2px 6px 0 rgba(67, 89, 113, 0.12);
}

.topbar-start,
.topbar-end {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    min-width: 0;
}

/* Zona metriche ispezioni (solo manager): occupa lo spazio centrale e
   scorre in orizzontale invece di impilare le chip una sotto l'altra. */
.topbar-metrics {
    display: flex;
    align-items: center;
    gap: 0.5rem 1rem;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
}

.topbar-metrics::-webkit-scrollbar {
    height: 6px;
}

.topbar-metrics::-webkit-scrollbar-thumb {
    background: var(--back-color-dark);
    border-radius: 3px;
}

.topbar-end {
    margin-left: auto;
}

.metric-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    flex: 0 0 auto;
}

.metric-caption {
    font-family: var(--font-text);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    color: var(--txt-color);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.metric-chips {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: nowrap;
}

.metric-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0.5rem 0.125rem 0.125rem;
    border-radius: 999px;
    background: var(--back-color-light);
    flex: 0 0 auto;
    cursor: default;
}

.metric-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.metric-value {
    font-family: var(--font-text);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    color: var(--txt-color);
}

@media (min-width: 992px) {
    .app-topbar {
        margin-left: var(--menu-width);
    }
}

/* Sotto xl le metriche scendono su una seconda riga a piena larghezza,
   restando orizzontali e scorribili. */
@media (max-width: 1199.98px) {
    .topbar-metrics {
        order: 3;
        flex-basis: 100%;
    }
}

@media (max-width: 767.98px) {
    .metric-caption,
    .topbar-version {
        display: none;
    }

    .metric-divider {
        display: none;
    }
}
/*End Topbar*/

/*media query shell*/
@media (min-width: 992px) {
    .body-page {
        padding-left: calc(var(--menu-width) + var(--content-gap)) !important;
    }

    .menu-vertical {
        transform: translate3d(0, 0, 0);
    }

    .overlay {
        display: none;
    }
}
