/* ─── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
    --blu: #6b2fa0;
    --blu-scuro: #2a1840;
    --blu-medio: #55238a;
    --blu-chiaro: #f3ebfa;
    --arancio: #e8710a;
    --brand-gradient: linear-gradient(135deg, #f59e42 0%, #b04fc0 55%, #6b2fa0 100%);
    --testo: #2a1840;
    --testo-sec: #5b4b6e;
    --bordo: #ddd1ea;
    --sfondo: #faf7fd;
    --bianco: #ffffff;
    --verde: #008055;
    --verde-light: #d4edda;
    --rosso: #c82333;
    --rosso-light: #fdecea;
    --giallo: #f1c40f;
    --giallo-light: #fff8e1;
    /* Palette tab navigazione — unica fonte di verità per CSS e JS */
    --tab-color-primary: #6b2fa0; /* viola Qwaser                      */
    --tab-color-blue: #6b2fa0; /* alias primary                     */
    --tab-color-dark: #2a1840; /* blu navy scuro                    */
    --tab-color-info: #3498db; /* azzurro cielo                     */
    --tab-color-default: #6366f1; /* indaco                            */
    --tab-color-secondary: #5b4b6e; /* ardesia                           */
    --tab-color-neutral: #6c757d; /* grigio medio                      */
    --tab-color-grey: #9e9e9e; /* grigio chiaro                     */
    --tab-color-success: #008055; /* verde scuro                       */
    --tab-color-green: #008055; /* alias success                     */
    --tab-color-teal: #00897b; /* verde acqua                       */
    --tab-color-emerald: #27ae60; /* verde smeraldo (distinto da teal) */
    --tab-color-warning: #e8710a; /* ambra                             */
    --tab-color-orange: #cc4400; /* arancio bruciato (distinto ambra) */
    --tab-color-gold: #f0b429; /* oro caldo                         */
    --tab-color-yellow: #d4a017; /* giallo senape                     */
    --tab-color-danger: #c82333; /* rosso PA                          */
    --tab-color-red: #c82333; /* alias danger                      */
    --tab-color-crimson: #8e1a1a; /* cremisi scuro (distinto da rosso) */
    --tab-color-pink: #e91e63; /* fucsia                            */
    --tab-color-accent: #9b59b6; /* ametista                          */
    --tab-color-purple: #9b59b6; /* alias accent                      */
    --tab-color-brown: #795548; /* marrone                           */
    --radius: 6px;
    --font: "Titillium Web", Arial, sans-serif;
    --shadow-sm: 0 2px 8px rgba(42, 24, 64, 0.1);
    --shadow-md: 0 4px 20px rgba(42, 24, 64, 0.14);
    --trans: 0.18s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html {
    scroll-behavior: smooth;
}
body {
    font-family: var(--font);
    color: var(--testo);
    background: var(--sfondo);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img {
    max-width: 100%;
    display: block;
}
a {
    color: var(--blu);
    text-decoration: underline;
}
a:hover {
    color: var(--blu-medio);
}
ul {
    list-style: none;
}
button {
    font-family: var(--font);
    cursor: pointer;
}
select,
input {
    font-family: var(--font);
}
:focus-visible {
    outline: 3px solid var(--arancio);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ─── SKIP LINK ── */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--blu-scuro);
    color: #fff;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 14px;
    z-index: 9999;
    border-radius: 0 0 4px 0;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 0;
    outline: 3px solid var(--arancio);
    outline-offset: 2px;
}

/* ─── UTILITY BAR ── */
.utility-bar {
    background: var(--blu-scuro);
    color: #fff;
    font-size: 13px;
}
.utility-bar__inner {
    margin: 0 auto;
    padding: 0 24px 0 260px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    gap: 16px;
    transition: padding-left 0.25s ease;
}
/* Pagine senza sidebar (login, accesso ateneo, redirect link brevi, ecc.):
   stesso criterio di .header-inner--flush, altrimenti utility-bar__left resta
   spostato a destra sotto la riserva di spazio per il menu laterale (260px)
   mentre il logo sotto è già allineato a 24px. */
.utility-bar__inner--flush {
    padding-left: 24px;
}
.utility-bar__left {
    display: flex;
    align-items: center;
    gap: 20px;
    color: #9fb8d0;
    font-size: 12px;
}
.utility-bar__right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.utility-bar a {
    color: #ddd1ea;
    text-decoration: none;
    font-size: 13px;
    transition: color var(--trans);
}
.utility-bar a:hover {
    color: #fff;
}
.utility-lang-flags {
    display: flex;
    align-items: center;
    gap: 4px;
}
.lang-flags--hidden {
    display: none;
}
.utility-lang-btn {
    background: none;
    border: 1.5px solid transparent;
    border-radius: 4px;
    padding: 2px 4px;
    cursor: pointer;
    line-height: 1;
    transition:
        border-color 0.15s,
        background 0.15s;
}
.utility-lang-btn .fi {
    font-size: 16px;
    display: block;
}
.utility-lang-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
}
.utility-lang-btn.active {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.15);
}
.utility-sep {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
}
.font-size-ctrl {
    display: flex;
    align-items: center;
    gap: 2px;
}
.font-size-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ddd1ea;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.4;
    transition:
        background var(--trans),
        color var(--trans),
        border-color var(--trans);
}
.font-size-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}
.font-size-btn--reset {
    font-size: 13px;
    font-weight: 600;
}
.font-size-btn[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
}
.btn-accedi {
    background: var(--arancio);
    color: #fff !important;
    padding: 5px 14px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none !important;
    transition: background var(--trans);
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-accedi:hover {
    background: #c8650a;
}
.user-nome {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ddd1ea;
    font-size: 13px;
    font-weight: 600;
}
.ticket-bell {
    position: relative;
    display: flex;
    align-items: center;
}
.ticket-bell__btn {
    position: relative;
    display: flex;
    align-items: center;
    background: transparent;
    border: none;
    color: #ddd1ea;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius);
    transition:
        color var(--trans),
        background var(--trans);
}
.ticket-bell__btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.ticket-bell__btn[aria-expanded="true"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}
.ticket-bell__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--arancio);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border: 1.5px solid var(--blu-scuro);
}
.ticket-bell__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: #fff;
    color: var(--testo);
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 2000;
}
.ticket-bell__dropdown[hidden] {
    display: none;
}
.ticket-bell__head {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--testo-sec);
    border-bottom: 1px solid var(--bordo);
}
.ticket-bell__list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 220px;
    overflow-y: auto;
}
.ticket-bell__list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--testo);
    gap: 8px;
}
.ticket-bell__list li + li {
    border-top: 1px solid var(--bordo);
}
.ticket-bell__list-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ticket-bell__count {
    flex-shrink: 0;
    background: var(--rosso);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
}
.ticket-bell__footer,
.utility-bar .ticket-bell__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--blu) !important;
    text-decoration: none;
    border-top: 1px solid var(--bordo);
    transition: background var(--trans);
}
.ticket-bell__footer:hover {
    background: var(--sfondo);
}
.user-menu {
    position: relative;
}
.user-menu__trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: #ddd1ea;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius);
    transition:
        color var(--trans),
        background var(--trans);
}
.user-menu__trigger:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.user-menu__trigger[aria-expanded="true"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}
.user-menu__trigger[aria-expanded="true"] .user-menu__caret {
    transform: rotate(180deg);
}
.user-menu__caret {
    transition: transform 0.2s;
    flex-shrink: 0;
}
.user-menu__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #fff;
    color: var(--testo);
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 2000;
    padding: 4px 0;
}
.user-menu__dropdown[hidden] {
    display: none;
}
.user-menu__header {
    padding: 10px 14px 8px;
    font-size: 12px;
    color: var(--testo-sec);
}
.user-menu__header strong {
    display: block;
    font-size: 13px;
    color: var(--testo);
    font-weight: 600;
}
.user-menu__sep {
    height: 1px;
    background: var(--bordo);
    margin: 4px 0;
}
.user-menu__item,
.utility-bar .user-menu__item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--testo) !important;
    text-decoration: none;
    transition:
        background var(--trans),
        color var(--trans);
}
.user-menu__item:hover,
.utility-bar .user-menu__item:hover {
    background: var(--sfondo);
    color: var(--blu) !important;
}
.user-menu__item svg {
    color: var(--testo-sec);
    flex-shrink: 0;
}
.user-menu__item:hover svg {
    color: var(--blu);
}
.user-menu__item--danger,
.utility-bar .user-menu__item--danger {
    color: var(--rosso) !important;
}
.user-menu__item--danger svg {
    color: var(--rosso);
}
.user-menu__item--danger:hover,
.utility-bar .user-menu__item--danger:hover {
    background: #fff5f5;
    color: #a01020 !important;
}
.user-menu__item--danger:hover svg {
    color: #a01020;
}

.user-menu__schema-switch {
    padding: 8px 12px;
}

.user-menu__schema-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--grigio-scuro, #666);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.user-menu__schema-select {
    width: 100%;
    font-size: 0.8rem;
    padding: 4px 6px;
    border: 1px solid var(--grigio-bordo, #ccc);
    border-radius: 4px;
    background: var(--bianco, #fff);
    cursor: pointer;
}

/* ─── HEADER ── */
.site-header {
    background: var(--bianco);
    border-bottom: 3px solid var(--blu);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}
.header-inner {
    margin: 0 auto;
    padding: 0 24px 0 260px;
    display: flex;
    align-items: center;
    height: 72px;
    gap: 32px;
    transition: padding-left 0.25s ease;
}
/* Pagine senza sidebar (login, accesso ateneo, redirect link brevi, ecc.):
   niente spazio riservato al menu laterale, il logo resta a sinistra. */
.header-inner--flush {
    padding-left: 24px;
}
.logo-area {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 60px;
    height: 60px;
}

.logo-img {
    width: auto;
    height: 48px;
    max-width: 180px;
    object-fit: contain;
    display: block;
}

.logo-text {
    line-height: 1.2;
}
.logo-text__abbr {
    font-size: 20px;
    font-weight: 700;
    color: var(--blu-scuro);
    letter-spacing: -0.3px;
}
.logo-text__full {
    font-size: 10px;
    color: var(--testo-sec);
    font-weight: 400;
    max-width: 220px;
    line-height: 1.3;
}

/* ── Wordmark SISValDidat ── */
.site-header .wm-label {
    line-height: 1.05;
}
.site-header .wm-name {
    font-family: "Audiowide", sans-serif;
    font-size: 30px;
    font-weight: 600;
    color: #2a1840;
    letter-spacing: 0;
}
.site-header .wm-name .acc {
    color: #f38b1c;
}
.site-header .wm-sub {
    font-size: 9px;
    color: var(--blu-medio);
    letter-spacing: 0.06em;
    margin-top: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

.footer-main .logo-area svg {
    width: 40px;
    height: 40px;
}

.footer-main .logo-img {
    height: 36px;
    margin-right: 8px;
}

.footer-main .wm-label {
    line-height: 1.05;
}
.footer-main .wm-name {
    font-family: "Audiowide", sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: var(--bianco);
    letter-spacing: 0;
}
.footer-main .wm-name .acc {
    color: #f38b1c;
}
.footer-main .wm-sub {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.06em;
    margin-top: 3px;
    text-transform: uppercase;
    font-weight: 600;
    max-width: 420px;
    text-align: justify;
}

.header-search {
    flex: 1;
    max-width: 400px;
    position: relative;
    margin-left: auto;
}
.header-search input {
    width: 100%;
    padding: 8px 40px 8px 14px;
    border: 1.5px solid var(--bordo);
    border-radius: 24px;
    font-size: 14px;
    color: var(--testo);
    background: var(--sfondo);
    transition:
        border-color var(--trans),
        box-shadow var(--trans);
}
.header-search input:focus {
    border-color: var(--blu);
    box-shadow: 0 0 0 3px rgba(107, 47, 160, 0.15);
    background: #fff;
}
.header-search button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--testo-sec);
    padding: 4px;
}
.hamburger {
    display: flex;
    background: none;
    border: 1.5px solid var(--bordo);
    border-radius: var(--radius);
    padding: 8px;
    color: var(--testo);
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
}

/* ─── SEARCH DROPDOWN ── */
.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 580px;
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    border: 1.5px solid var(--bordo);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    z-index: 200;
}
.sd-group {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--testo-sec);
    padding: 8px 14px 4px;
    background: var(--sfondo);
}
.sd-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 14px;
    font-size: 13px;
    color: var(--testo);
    text-decoration: none;
    transition: background var(--trans);
}
.sd-item:hover {
    background: var(--blu-chiaro);
}
.sd-item svg,
.sd-item i {
    color: var(--blu);
    flex-shrink: 0;
    font-size: 13px;
    margin-top: 3px;
}
.sd-item-body {
    flex: 1;
    min-width: 0;
}
.sd-item-title {
    display: block;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}
.sd-item-sub {
    display: block;
    color: var(--testo-sec);
    font-size: 11px;
    margin-top: 2px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
}
.sd-item span {
    flex: 1;
    white-space: normal;
    word-break: break-word;
}
.sd-item small {
    color: var(--testo-sec);
    font-size: 11px;
    display: block;
    margin-top: 2px;
}
.sd-empty {
    padding: 14px;
    font-size: 13px;
    color: var(--testo-sec);
    text-align: center;
}
.sd-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.sd-badge--faq {
    background: #fff3cd;
    color: #856404;
}
.sd-badge--guida {
    background: #d1ecf1;
    color: #0c5460;
}
.sd-badge--report {
    background: #d4edda;
    color: #155724;
}
.sd-badge--api {
    background: #e2d9f3;
    color: #4a2b8e;
}

/* ─── SIDEBAR NAV ── */
.app-layout {
    display: flex;
    align-items: flex-start;
    position: relative;
}
.app-sidenav {
    width: 260px;
    flex-shrink: 0;
    background: var(--bianco);
    border-right: 1px solid var(--bordo);
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 90;
    transition:
        width 0.25s ease,
        left 0.25s ease;
}
.app-sidenav-header {
    padding: 10px 12px 10px 18px;
    border-bottom: 1px solid var(--bordo);
    background: var(--blu-scuro);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidenav-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.sidenav-toggle svg {
    width: 16px;
    height: 16px;
}
.app-layout.sidenav-collapsed .app-sidenav {
    width: 0;
    overflow: hidden;
    border-right: none;
}
/* Freccia pin sidebar — visibile solo quando collassata, a metà altezza del contenuto */
.sidenav-pin-btn {
    display: none;
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 201;
    width: 18px;
    height: 40px;
    background: var(--blu-scuro);
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 0 8px rgba(0,0,0,0.18);
    transition: width 0.15s ease, background 0.15s ease;
    padding: 0;
}
.sidenav-pin-btn svg {
    width: 8px;
    height: 14px;
    flex-shrink: 0;
}
.sidenav-pin-btn:hover {
    width: 24px;
    background: var(--blu);
}
body.sidenav-collapsed .sidenav-pin-btn {
    display: flex;
}
body.sidenav-collapsed.sidenav-flyout-open .sidenav-pin-btn {
    display: none;
}
/* Overlay hover: quando collassata e si passa sopra, si apre senza spostare il contenuto */
.app-layout.sidenav-collapsed .app-sidenav.sidenav-hover {
    width: 260px;
    overflow-y: auto;
    border-right: 1px solid var(--bordo);
    position: fixed;
    top: 112px;
    left: 0;
    height: calc(100vh - 112px);
    z-index: 200;
    box-shadow: 4px 0 16px rgba(0,0,0,0.18);
}
body.sidenav-collapsed .header-inner,
body.sidenav-collapsed .utility-bar__inner {
    padding-left: 24px;
}
.sidenav-section {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(42, 24, 64, 0.4);
    padding: 18px 18px 6px;
    display: block;
}
.sidenav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    font-size: 14px;
    color: var(--testo-sec);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.12s;
    white-space: nowrap;
}
.sidenav-link:hover {
    background: var(--sfondo);
    color: var(--testo);
}
.sidenav-link.active {
    background: var(--blu-chiaro);
    color: var(--blu);
    font-weight: 700;
    border-left-color: var(--blu);
}
.sidenav-link svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    opacity: 0.7;
}
.sidenav-link.active svg {
    opacity: 1;
}
.sidenav-accordion-label {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidenav-accordion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 400;
    color: var(--testo-sec);
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all 0.12s;
}
.sidenav-accordion svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    opacity: 0.7;
}
.sidenav-accordion.open svg {
    opacity: 1;
}
.sidenav-accordion:hover {
    background: var(--sfondo);
    color: var(--testo);
}
.sidenav-accordion.open {
    color: var(--blu);
    border-left-color: var(--blu);
}
.sidenav-chevron {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.sidenav-accordion.open .sidenav-chevron {
    transform: rotate(180deg);
}
.sidenav-sub {
    display: none;
}
.sidenav-sub.open {
    display: block;
}
.sidenav-sub .sidenav-link {
    font-size: 13px;
    padding: 8px 18px 8px 28px;
}
.sidenav-divider {
    height: 1px;
    background: var(--bordo);
    margin: 8px 0;
}
.app-main {
    flex: 1;
    min-width: 0;
}
.sidenav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 89;
}
.sidenav-overlay.open {
    display: block;
}
.sidenav-close {
    display: none;
}

/* ─── BREADCRUMB ── */
.breadcrumb-bar {
    background: var(--bianco);
    border-bottom: 1px solid var(--bordo);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    min-height: 38px;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--testo-sec);
}
.sidenav-toggle {
    background: none;
    border: none;
    color: var(--testo-sec);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radius);
    flex-shrink: 0;
    transition:
        background var(--trans),
        color var(--trans);
}
.sidenav-toggle:hover {
    background: var(--sfondo);
    color: var(--testo);
}
.breadcrumb a:not(.bc-drop__link),
.breadcrumb
    > span:not(.breadcrumb-sep):not(.breadcrumb-badge):not(.breadcrumb-sub) {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.breadcrumb a {
    color: var(--blu);
    text-decoration: none;
}
.breadcrumb a:hover {
    text-decoration: none;
}
.breadcrumb-sep {
    color: var(--bordo);
    flex-shrink: 0;
}
.breadcrumb-badge {
    display: inline-block;
    background: var(--blu);
    color: #fff;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 5px;
    vertical-align: middle;
    line-height: 1.4;
}
.breadcrumb-sub {
    color: var(--testo-sec);
    font-size: 11px;
}

/* ── Breadcrumb dropdown (bc-drop) ─────────────────────────────── */
.bc-drop {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.bc-drop__btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    color: var(--testo-sec);
    padding: 2px 4px;
    border-radius: var(--radius);
    transition:
        background var(--trans),
        color var(--trans);
    white-space: nowrap;
    max-width: 300px;
}
.bc-drop__btn:hover {
    background: var(--sfondo);
    color: var(--testo);
}
.bc-drop__btn--current {
    color: var(--testo);
    font-weight: 600;
}
.bc-drop__btn--current:hover {
    background: var(--sfondo);
}
.bc-drop__caret {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    transition: transform 0.18s;
}
.bc-drop[data-open] .bc-drop__caret {
    transform: rotate(180deg);
}

/* Menu base (lista piatta, es. CDL della struttura attiva) */
.bc-drop__menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 400;
    min-width: 260px;
    max-width: 400px;
    background: var(--bianco);
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.bc-drop[data-open] > .bc-drop__menu {
    display: block;
}
.bc-drop__menu--flat {
    max-height: 420px;
    overflow-y: auto;
    padding: 4px 0;
}

/* Menu a due pannelli (strutture | CDL) */
.bc-drop__menu--tree {
    display: none;
    max-width: none;
    width: max-content;
    min-width: 480px;
}
.bc-drop[data-open] > .bc-drop__menu--tree {
    display: flex;
    flex-direction: row;
}
.bc-tree__left {
    width: 220px;
    flex-shrink: 0;
    max-height: 420px;
    overflow-y: auto;
    border-right: 1px solid var(--bordo);
    padding: 4px 0;
}
.bc-tree__right {
    flex: 1 1 260px;
    min-width: 260px;
    max-width: 360px;
    max-height: 420px;
    overflow-y: auto;
    padding: 4px 0;
    background: var(--sfondo);
}
.bc-tree__cdl-list {
    display: flex;
    flex-direction: column;
}

/* Link comune */
.bc-drop__link {
    display: block;
    padding: 7px 12px;
    font-size: 13px;
    color: var(--testo);
    text-decoration: none;
    transition: background var(--trans);
    width: 100%;
    box-sizing: border-box;
}
.bc-drop__link:hover {
    background: var(--sfondo);
}
.bc-tree__right .bc-drop__link:hover {
    background: #dce6f0;
}
.bc-drop__link--active {
    background: #eef4fd;
    font-weight: 600;
}
.bc-tree__strut {
    display: flex;
    align-items: center;
    gap: 6px;
}
.bc-tree__strut-nome {
    flex: 1;
    white-space: normal;
    line-height: 1.3;
}
.bc-tree__strut.bc-drop__link--hover {
    background: var(--sfondo);
}
.bc-drop__cdl-nome {
    display: inline;
    white-space: normal;
    line-height: 1.3;
}
.bc-drop__sede {
    display: block;
    color: var(--testo-sec);
    font-size: 11px;
    margin-top: 2px;
}
.bc-drop__sub-arrow {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0.4;
}
.bc-drop__curr-sep {
    color: var(--bordo);
    margin: 0 2px;
}

@media (max-width: 768px) {
    .bc-drop__menu--tree {
        flex-direction: column;
        min-width: calc(100vw - 32px);
    }
    .bc-tree__left {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--bordo);
        max-height: 180px;
    }
    .bc-drop__menu--flat {
        max-width: calc(100vw - 32px);
    }
}

/* ─── FOOTER ── */
.site-footer {
    background: var(--blu-scuro);
    color: rgba(255, 255, 255, 0.75);
}
.footer-main {
    margin: 0 auto;
    padding: 24px 24px 24px 260px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}
.footer-brand p {
    font-size: 13px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
}
.footer-col h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}
.footer-links {
    list-style: none;
}
.footer-links li {
    margin-bottom: 8px;
}
.footer-links a {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--trans);
    display: flex;
    align-items: center;
    gap: 6px;
}
.footer-links a:hover {
    color: #fff;
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 24px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.footer-bottom-left {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
}
.footer-bottom-links {
    display: flex;
    gap: 20px;
    font-size: 12px;
}
.footer-bottom-links a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color var(--trans);
}
.footer-bottom-links a:hover {
    color: #fff;
}
.footer-separator {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.valmon-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
}
.valmon-logo-box {
    border-radius: 3px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
}

/* ─── COOKIE BANNER ── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--blu-scuro);
    color: #fff;
    padding: 20px 24px;
    z-index: 999;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    transition: transform 0.3s ease;
}
.cookie-banner.hidden {
    transform: translateY(100%);
}
.cookie-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.82);
    flex: 1;
    min-width: 200px;
    line-height: 1.6;
}
.cookie-text a {
    color: #74b9ff;
}
.cookie-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.btn-cookie-accept {
    background: var(--arancio);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background var(--trans);
}
.btn-cookie-accept:hover {
    background: #c8650a;
}
.btn-cookie-info {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition:
        color var(--trans),
        border-color var(--trans);
}
.btn-cookie-info:hover {
    color: #fff;
    border-color: #fff;
}

/* ─── MOBILE NAV (rimosso, sostituito da sidebar drawer) ── */

/* ─── RESPONSIVE ── */
/* hamburger sempre visibile — su desktop collassa la sidebar, su mobile apre il drawer */
@media (max-width: 768px) {
    .header-inner,
    .utility-bar__inner {
        padding-left: 24px;
    }
    .utility-bar__left {
        display: none;
    }
    .header-search {
        display: none;
    }
    .logo-text__full {
        display: none;
    }
    .header-inner {
        height: 60px;
    }
    .footer-main {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
    /* Sidebar diventa drawer su mobile */
    .app-sidenav {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        width: 260px;
        z-index: 500;
        box-shadow: none;
    }
    .app-sidenav.open {
        left: 0;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }
    .sidenav-overlay.open {
        display: block;
    }
    .sidenav-close {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: 1.5px solid rgba(42, 24, 64, 0.2);
        border-radius: 50%;
        width: 32px;
        height: 32px;
        cursor: pointer;
        color: var(--testo-sec);
        font-size: 16px;
        flex-shrink: 0;
    }
    .app-sidenav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
}
@media (max-width: 1024px) {
    .footer-main {
        grid-template-columns: 1fr 1fr;
    }
}

.card__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: #faf7fd;
    border: 1px solid var(--bordo, #ddd1ea);
    border-radius: 8px;
}

/* ─── MOBILE NAV — inline-style replacements (CSP) ── */
.mobile-nav-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}
.mobile-nav-logo .logo-icon {
    width: 36px;
    height: 36px;
}
.mobile-nav-logo .logo-icon svg {
    width: 20px;
    height: 20px;
}
.mobile-nav-logo-name {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}
.mobile-nav-cta {
    margin-top: 24px;
}
.mobile-nav-cta a {
    background: var(--arancio);
    color: #fff;
    border-radius: 4px;
    padding: 14px 20px;
    text-decoration: none;
    font-weight: 700;
    display: block;
    text-align: center;
}

/* ─── FOOTER LOGO — inline-style replacements (CSP) ── */
.footer-logo-link {
    margin-bottom: 16px;
    display: inline-flex;
}
.footer-logo-link .logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.12);
}
.footer-logo-link .logo-icon svg {
    width: 22px;
    height: 22px;
}
.footer-logo-link .logo-text__abbr {
    font-size: 17px;
    color: #fff;
}
.footer-logo-link .logo-text__full {
    font-size: 10px;
    max-width: 200px;
    color: rgba(255, 255, 255, 0.6);
}

/* ─── DEBUG SESSION WIDGET (solo app.debug) ── */
.debug-session {
    margin: 12px;
    padding: 12px;
    background: #f4f4f4;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: monospace;
    font-size: 12px;
}
.debug-session summary {
    cursor: pointer;
    font-weight: bold;
}
.debug-session pre {
    margin-top: 8px;
    overflow: auto;
}

/* ─── ICON-SELECT component ──────────────────────────────────────────── */
/* ─── icon-select — componente select con icona e ricerca ────────────────── */

/* Wrapper */
.icon-select {
    position: relative;
    display: inline-block;
    min-width: 0;
    max-width: 100%;
}

/* Bottone trigger */
.icon-select__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 28px 6px 10px;
    border: 1.5px solid var(--bordo);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: var(--font);
    color: var(--testo);
    background: var(--sfondo);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
    position: relative;
}

/* Etichetta selezionata: tronca con ellissi invece di sforare il bottone */
.icon-select__label {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.icon-select__btn:focus {
    border-color: var(--blu);
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 47, 160, 0.1);
}

/* Chevron integrato nel bottone */
.icon-select__caret {
    width: 11px;
    height: 11px;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: transform 0.15s;
}
.icon-select[data-open] .icon-select__caret {
    transform: translateY(-50%) rotate(180deg);
}

/* Testo placeholder (nessuna selezione) */
.icon-select__label--placeholder {
    color: var(--testo-sec);
}

/* Pannello dropdown */
.icon-select__panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    background: #fff;
    border: 1.5px solid var(--blu);
    border-radius: var(--radius);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    overflow: hidden;
}
.icon-select[data-open] .icon-select__panel {
    display: block;
}

/* Barra di ricerca nel pannello */
.icon-select__search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--bordo);
}
.icon-select__search svg {
    width: 14px;
    height: 14px;
    color: #b9a3cf;
    flex-shrink: 0;
}
.icon-select__search-input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 13px;
    font-family: var(--font);
    color: var(--testo);
    background: transparent;
}
.icon-select__search-input::placeholder {
    color: #aab;
}
.icon-select__search-input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* Lista opzioni */
.icon-select__list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 220px;
    overflow-y: auto;
}
.icon-select__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 14px;
    font-family: var(--font);
    color: var(--testo);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.1s;
}
.icon-select__item:hover {
    background: #f3eef9;
}
.icon-select__item.is-active {
    background: #dde9f5;
    color: var(--blu);
    font-weight: 600;
}
.icon-select__item[hidden] {
    display: none;
}

/* Override dentro .form-field: si espande come select.form-control */
.form-field .icon-select {
    display: block;
}
.form-field .icon-select .icon-select__btn {
    width: 100%;
    height: 45px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%2317324D' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    justify-content: flex-start;
}
.form-field .icon-select .icon-select__btn:focus,
.form-field .icon-select[data-open] .icon-select__btn {
    border-color: var(--blu);
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 47, 160, 0.12);
    background-color: var(--blu-chiaro);
}
/* Il chevron nel DOM è sostituito dal background-image */
.form-field .icon-select .icon-select__btn > svg {
    display: none;
}

/* ─── Tooltip amCharts (radar e XY) ──────────────────────────────────────── */
/* ── Tooltip grafici — stile identico al template Bersaglio.html ─────────── */
.tt-wrap {
    width: 420px;
    background: transparent;
    border-radius: 10px;
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(42, 24, 64, 0.22),
        0 0 0 1px rgba(42, 24, 64, 0.08);
    font-family: var(--font, "Titillium Web", sans-serif);
    border: 4px solid
        color-mix(in srgb, var(--tt-color, #5b4b6e) 80%, transparent);
}
.tt-head {
    padding: 9px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    position: relative;
    background: color-mix(
        in srgb,
        var(--tt-color, #5b4b6e) 80%,
        transparent
    ) !important;
}
.tt-head::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #fff;
}
.tt-body {
    padding: 16px 18px 14px;
    text-align: center;
}
.tt-code {
    font-size: 22px;
    font-weight: 700;
    color: var(--blu-scuro, #2a1840);
    line-height: 1;
    margin-bottom: 8px;
}
.tt-question {
    font-size: 13px;
    line-height: 1.45;
    color: var(--testo, #2a1840);
    margin-bottom: 12px;
    max-width: 100%;
}
.tt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
    margin-top: 4px;
    border-top: 1px solid var(--bordo, #ddd1ea);
}
.tt-table thead {
    background: var(--sfondo, #ddeafa);
}

.tt-table thead th {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--testo-sec, #3391e9) !important;
    padding: 8px 4px 6px;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--bordo, #ddd1ea);
}

.tt-table thead th:nth-child(2),
.tt-table thead th:nth-child(3) {
    text-align: right;
}
.tt-table td {
    padding: 8px 4px;
    color: var(--testo, #2a1840);
    vertical-align: top;
    line-height: 1.4;
}
.tt-table td:first-child {
    font-size: 12px;
    color: var(--testo-sec, #5b4b6e);
    max-width: 180px;
    padding-right: 8px;
}
.tt-table td:nth-child(2),
.tt-table td:nth-child(3) {
    text-align: right;
    font-weight: 700;
    font-size: 14px;
    color: var(--blu-scuro, #2a1840);
    white-space: nowrap;
}
.tt-table td.tt-val--wrap {
    white-space: normal;
    word-break: break-word;
    text-align: left;
    max-width: 220px;
}
.tt-table tr + tr td {
    border-top: 1px solid var(--sfondo, #faf7fd);
}

/* ── Section title (condiviso tra pagine con grafici) ───────────────────────── */
.sec-title--mt {
    margin-top: 2rem;
}
.sec-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--blu-scuro, #2a1840);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--blu-chiaro, #f3ebfa);
}
.sec-title svg {
    color: var(--arancio, #f8ac07);
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.sec-title i {
    color: var(--arancio, #f8ac07);
    font-size: 26px;
}



/* ── Bottoni export grafici ──────────────────────────────────────────────────── */
.chart-export-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin-left: auto;
}
.chart-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    border: 1px solid var(--bordo, #ddd1ea);
    border-radius: 4px;
    background: #fff;
    color: var(--testo-sec, #5b4b6e);
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s;
}
.chart-export-btn:hover {
    background: var(--blu, #6b2fa0);
    color: #fff;
    border-color: var(--blu, #6b2fa0);
}
.chart-export-btn--pdf {
    border-color: #e53e3e;
    color: #e53e3e;
}
.chart-export-btn--pdf:hover {
    background: #e53e3e;
    color: #fff;
    border-color: #e53e3e;
}

/* ── ComboSelect — dropdown con ricerca ────────────────────────────────────── */
.cs-wrap {
    position: relative;
    display: block;
    width: 100%;
}
/* nasconde sempre il <select> nativo dentro il wrapper, a prescindere dall'inline style */
.cs-wrap select {
    display: none !important;
}
.cs-native-hidden {
    display: none !important;
}
/* neutralizza l'override di crud.css (.form-area input[type="text"]) */
.form-area .cs-wrap input[type="text"].cs-input,
.cs-input {
    width: 100%;
    padding: 10px 36px 10px 14px;
    border: 1.5px solid var(--bordo);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: var(--font);
    color: var(--testo);
    background: var(--sfondo);
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
    box-sizing: border-box;
    cursor: pointer;
}
.cs-input:focus {
    border-color: var(--blu);
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 47, 160, 0.12);
    background: #fff;
}
.cs-disabled .cs-input {
    color: var(--testo-sec);
    cursor: default;
    opacity: 0.7;
}
.cs-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--testo-sec);
    display: flex;
    transition: transform 0.15s;
}
.cs-wrap.cs-open .cs-arrow {
    transform: translateY(-50%) rotate(180deg);
}
.cs-drop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid var(--bordo);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-height: 220px;
    overflow-y: auto;
    z-index: 999;
    display: none;
}
.cs-wrap.cs-open .cs-drop {
    display: block;
}
.cs-item {
    padding: 9px 14px;
    font-size: 14px;
    color: var(--testo);
    cursor: pointer;
    transition: background 0.1s;
}
.cs-item:hover,
.cs-item.cs-focused {
    background: var(--blu-chiaro);
    color: var(--blu);
}
.cs-item.cs-selected {
    font-weight: 600;
    color: var(--blu);
}
.cs-empty {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--testo-sec);
    font-style: italic;
}

/* ── Barra immedesimazione utente ─────────────────────────────────────────── */
/* ── Banner licenza ─────────────────────────────────────────────────────── */
.licenza-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    padding: 9px 20px;
    border-bottom: 2px solid transparent;
}
.licenza-bar svg {
    flex-shrink: 0;
}
.licenza-bar--danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fca5a5;
}
.licenza-bar--warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fcd34d;
}

.impersonation-bar {
    background: #7c3aed;
    color: #fff;
    font-size: 13px;
    padding: 0;
    border-bottom: 2px solid #5b21b6;
}
.impersonation-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 20px;
    flex-wrap: wrap;
}
.impersonation-bar__info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.impersonation-bar__info svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.9;
}
.impersonation-bar__original {
    opacity: 0.8;
    font-size: 12px;
}
.impersonation-bar__form {
    margin: 0;
}
.impersonation-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius, 6px);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.impersonation-bar__btn:hover {
    background: rgba(255, 255, 255, 0.25);
}
.impersonation-bar__btn svg {
    width: 13px;
    height: 13px;
}

/* ── Scroll-to-top button ───────────────────────────────────────────────────── */
.scroll-top-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 900;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--blu);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.25s,
        transform 0.25s,
        background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
}
.scroll-top-btn:hover {
    background: var(--blu-scuro);
}

/* ── Toast errori validazione (layout globale) ────────────────────────────────
   Stessa posizione/stile dei toast di conferma (.crud-toast in crud.css):
   overlay fisso in alto a destra, non più un banner a piena larghezza.       */
.layout-validation-errors {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    z-index: 9999;
    min-width: 260px;
    max-width: 380px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius, 8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    animation: crud-toast-in 0.25s ease;
}
.layout-validation-errors__inner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
}
.layout-validation-errors__inner > svg {
    flex-shrink: 0;
    color: #dc2626;
    margin-top: 2px;
}
.layout-validation-errors__inner > div {
    flex: 1;
    font-size: 13px;
    color: #7f1d1d;
}
.layout-validation-errors__inner strong {
    display: block;
    margin-bottom: 0.25rem;
    color: #991b1b;
}
.layout-validation-errors__inner ul {
    margin: 0;
    padding-left: 1.25rem;
}
.layout-validation-errors__inner li {
    margin-bottom: 0.15rem;
}
.layout-validation-errors__close {
    background: none;
    border: none;
    cursor: pointer;
    color: #991b1b;
    padding: 2px;
    flex-shrink: 0;
    opacity: 0.7;
    display: flex;
}
.layout-validation-errors__close:hover {
    opacity: 1;
}

/* ── Accessibilità — testo solo per screen reader ─────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Box errore SIS — stile identico al vecchio sistema (error.php) ──────── */
.sis-errore {
    text-align: center;
    padding: 2.5rem 1.5rem 2rem;
    background: #ffffff;
    border: 1px solid var(--bordo, #ddd1ea);
    border-radius: 8px;
}
.sis-errore__shrug {
    font-size: 8rem;
    color: var(--blu-scuro);
    margin-bottom: 1rem;
    font-family: monospace;
    transform: rotate(-2deg);
}
.sis-errore__text {
    font-size: 4rem;
    font-weight: 700;
    color: var(--arancio, #c0392b);
    letter-spacing: 0.04em;
    margin-bottom: 0.6rem;
}
.sis-errore__desc {
    font-size: 1.6rem;
    color: var(--blu, #2980b9);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}
.sis-errore__code {
    display: inline-block;

    font-size: 2rem;
    font-weight: bold;
    color: var(--rosso, #c0392b);
    letter-spacing: 0.04em;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--blu-scuro);
    padding-bottom: 12px;
    margin-bottom: 22px;
    border-bottom: 2px solid var(--blu);
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-area .section-title {
    margin: 24px 28px;
}
.section-title i {
    font-size: 24px;
    color: var(--arancio);
}

.section-title svg {
    width: 24px;
    height: 24px;
    color: var(--arancio);
}

/* ── Chip icona+etichetta nella modal Legenda (grafici) ───────────────────── */
.guida-report-tab-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--tab-mini-color, var(--tab-color-default));
}
.guida-report-tab-mini i {
    font-size: 18px;
}
.guida-report-tab-mini em {
    font-style: normal;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.guida-report-tab-mini[data-color="primary"] { --tab-mini-color: var(--tab-color-primary); }
.guida-report-tab-mini[data-color="blue"] { --tab-mini-color: var(--tab-color-blue); }
.guida-report-tab-mini[data-color="dark"] { --tab-mini-color: var(--tab-color-dark); }
.guida-report-tab-mini[data-color="grey"] { --tab-mini-color: var(--tab-color-grey); }
.guida-report-tab-mini[data-color="orange"] { --tab-mini-color: var(--tab-color-orange); }
.guida-report-tab-mini[data-color="yellow"] { --tab-mini-color: var(--tab-color-yellow); }
.guida-report-tab-mini[data-color="danger"] { --tab-mini-color: var(--tab-color-danger); }
.guida-report-tab-mini[data-color="red"] { --tab-mini-color: var(--tab-color-red); }
.guida-report-tab-mini[data-color="pink"] { --tab-mini-color: var(--tab-color-pink); }
.guida-report-tab-mini[data-color="purple"] { --tab-mini-color: var(--tab-color-purple); }
.guida-report-tab-mini[data-color="brown"] { --tab-mini-color: var(--tab-color-brown); }

.questionario-sezione-badge {
    color: #fff;
    font-weight: 700;
    text-align: center;
    background: var(--sezione-color, var(--tab-color-default));
}

/* ── Tabella stile "guida-table" per la modal Legenda (grafici) ───────────── */
table.legenda-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 13px;
    border: 1px solid var(--bordo);
    border-radius: var(--radius);
    overflow: hidden;
}
table.legenda-table th,
table.legenda-table td {
    padding: 8px 14px;
    text-align: left;
    border-bottom: 1px solid var(--bordo);
    vertical-align: middle;
}
table.legenda-table thead th {
    background: var(--sfondo);
    color: var(--testo-sec);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
table.legenda-table tbody tr:last-child td {
    border-bottom: none;
}
table.legenda-table tbody tr:hover td {
    background: var(--sfondo);
}
table.legenda-table td.legenda-table-icon-cell {
    white-space: nowrap;
    width: 1%;
}
table.legenda-table td.legenda-table-icon-cell > svg,
table.legenda-table td.legenda-table-icon-cell > i {
    color: var(--blu);
    margin-right: 8px;
    vertical-align: middle;
}
table.legenda-table .badge {
    display: inline-block;
    min-width: 28px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    text-align: center;
}
table.legenda-table .badge.bg-success { background: var(--verde, #1b7d05); }
table.legenda-table .badge.bg-warning { background: var(--arancio, #ffb600); }
table.legenda-table .badge.bg-danger { background: var(--rosso, #ff1f00); }
table.legenda-table .badge.bg-secondary { background: #8c5e30; }
table.legenda-table .badge.bg-muted { background: #6e7f8d; }

/* .ctrl-stat-* / .ctrl-stats-grid → definite in crud.css (usate da <x-stat-card>) */

/* ─── UTILITY — spaziatura, display, colore ────────────────────
   Da usare al posto di style="" inline. Non duplicare: se qui
   manca un pattern nuovo, aggiungerlo con lo stesso schema. */
.text-danger { color: var(--rosso); }
.text-muted { color: var(--grigio-medio, #6c757d); }
.text-end { text-align: right; }
.text-warning-strong { color: var(--arancio); }
.d-none { display: none !important; }
.d-inline { display: inline; }
.d-flex { display: flex; }
.gap-2 { gap: 8px; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
#storia-chart { width: 100%; height: 360px; }
.sidenav-crealink-wrap { display: none; }
.sidenav-crealink-wrap--visible { display: block; }
.ml-auto { margin-left: auto; }
.m-0 { margin: 0; }
.m-3 { margin: 16px; }
.p-0 { padding: 0; }
.py-2 { padding-top: 12px; padding-bottom: 12px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 16px; }
.ml-1 { margin-left: 8px; }
.list-plain { margin: 0; padding-left: 1rem; }

/* ─── QWASER — marchio e header ente ─────────────────────────── */
.site-header .wm-name .acc,
.footer-main .wm-name .acc {
    color: var(--arancio);
}
.logo-icon--qwaser {
    width: 52px;
    height: 52px;
    background: transparent;
}
.header-ente {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border: 1px solid var(--bordo);
    border-radius: 999px;
    background: var(--blu-chiaro);
    color: var(--blu-scuro);
    font-weight: 600;
    font-size: 14px;
    max-width: 50%;
}
.header-ente__logo {
    height: 28px;
    width: auto;
}
.header-ente__nome {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 768px) {
    .header-ente {
        display: none;
    }
}

/* Logo Valmon 2026 nel footer (SVG con contorno bianco, leggibile su sfondo scuro) */
.valmon-logo-img {
    display: block;
    width: 220px;
    max-width: 100%;
    height: auto;
}

/* ── Correzioni mobile (dopo le regole tablet, che altrimenti prevalgono) ──── */
@media (max-width: 768px) {
    .footer-main {
        grid-template-columns: minmax(0, 1fr);
    }
    .footer-col,
    .footer-brand {
        min-width: 0;
    }
    .utility-bar__inner {
        padding: 0 12px;
        gap: 8px;
    }
    .utility-bar__right {
        min-width: 0;
        margin-left: auto;
        gap: 6px;
    }
    /* Su telefono restano lingua, dimensione testo e menu utente: i link legali sono nel footer */
    .utility-bar__right > a,
    .utility-bar__right > .utility-sep,
    .user-menu__name {
        display: none;
    }
    .breadcrumb-bar {
        padding: 0 8px;
        gap: 8px;
    }
    .breadcrumb {
        min-width: 0;
        flex-wrap: wrap;
        row-gap: 2px;
    }
    .breadcrumb-actions {
        flex-shrink: 0;
    }
    .guida-btn {
        font-size: 0;
        gap: 0;
        padding: 6px 8px;
    }
    .guida-btn svg {
        width: 16px;
        height: 16px;
    }
}
