html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.form-control:focus {
  box-shadow: none;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "Si è verificato un errore."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* --- DARK MODE TECNICA (Stile Industriale Premium) --- */
[data-bs-theme="dark"] {
    --bs-body-bg: #14161a; /* Sfondo principale grigio siderale molto scuro */
    --bs-body-color: #e9ecef; /* Testo grigio chiaro, mai bianco puro */
}

    /* Adattamento delle card e degli sfondi bianchi */
    [data-bs-theme="dark"] .bg-white,
    [data-bs-theme="dark"] .card {
        background-color: #1d2127 !important; /* Grigio-Blu Navy per le superfici rialzate */
        color: #e9ecef !important;
    }

    [data-bs-theme="dark"] .bg-light {
        background-color: #14161a !important;
    }

    /* Adattamento di testi scuri e bordi */
    [data-bs-theme="dark"] .text-dark {
        color: #f8f9fa !important;
    }

    /* Preserva testo scuro leggibile su superfici solide chiare (giallo e azzurro) in Dark Mode */
    [data-bs-theme="dark"] .bg-warning:not(.bg-opacity-10):not(.bg-opacity-15):not(.bg-opacity-25):not(.bg-opacity-50).text-dark,
    [data-bs-theme="dark"] .bg-warning:not(.bg-opacity-10):not(.bg-opacity-15):not(.bg-opacity-25):not(.bg-opacity-50) .text-dark,
    [data-bs-theme="dark"] .btn-warning.text-dark,
    [data-bs-theme="dark"] .btn-warning .text-dark,
    [data-bs-theme="dark"] .btn-outline-warning.text-dark:not(.bg-white):hover,
    [data-bs-theme="dark"] .btn-outline-warning.text-dark:not(.bg-white):active,
    [data-bs-theme="dark"] .btn-outline-warning.text-dark:not(.bg-white).active,
    [data-bs-theme="dark"] .btn-outline-warning.text-dark:not(.bg-white).show,
    [data-bs-theme="dark"] .bg-info:not(.bg-opacity-10):not(.bg-opacity-15):not(.bg-opacity-25):not(.bg-opacity-50).text-dark,
    [data-bs-theme="dark"] .bg-info:not(.bg-opacity-10):not(.bg-opacity-15):not(.bg-opacity-25):not(.bg-opacity-50) .text-dark,
    [data-bs-theme="dark"] .btn-info.text-dark,
    [data-bs-theme="dark"] .btn-info .text-dark,
    [data-bs-theme="dark"] .btn-outline-info.text-dark:not(.bg-white):hover,
    [data-bs-theme="dark"] .btn-outline-info.text-dark:not(.bg-white):active,
    [data-bs-theme="dark"] .btn-outline-info.text-dark:not(.bg-white).active,
    [data-bs-theme="dark"] .btn-outline-info.text-dark:not(.bg-white).show {
        color: #1a1d20 !important;
    }

    [data-bs-theme="dark"] .bg-warning:not(.bg-opacity-10):not(.bg-opacity-15):not(.bg-opacity-25):not(.bg-opacity-50) .btn-close,
    [data-bs-theme="dark"] .bg-info:not(.bg-opacity-10):not(.bg-opacity-15):not(.bg-opacity-25):not(.bg-opacity-50) .btn-close {
        filter: none;
    }

    [data-bs-theme="dark"] .text-muted {
        color: #8b949e !important;
    }

    [data-bs-theme="dark"] .border,
    [data-bs-theme="dark"] .border-top,
    [data-bs-theme="dark"] .border-end {
        border-color: #30363d !important;
    }

    /* Stili per le Tabelle in Dark Mode */
    [data-bs-theme="dark"] .table {
        --bs-table-bg: transparent;
        --bs-table-color: #e9ecef;
        --bs-table-border-color: #30363d;
        --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
    }

    [data-bs-theme="dark"] .table-light {
        --bs-table-color: #e9ecef;
        --bs-table-bg: #252a31;
        --bs-table-border-color: #30363d;
        --bs-table-striped-bg: #2c323a;
        --bs-table-striped-color: #e9ecef;
        --bs-table-active-bg: #323842;
        --bs-table-active-color: #e9ecef;
        --bs-table-hover-bg: #2f353e;
        --bs-table-hover-color: #e9ecef;
        color: var(--bs-table-color);
        border-color: var(--bs-table-border-color);
    }

    [data-bs-theme="dark"] .table-warning {
        --bs-table-color: #e9ecef;
        --bs-table-bg: #2e2612;
        --bs-table-border-color: #66521a;
        --bs-table-striped-bg: #362d16;
        --bs-table-striped-color: #e9ecef;
        --bs-table-active-bg: #3e3319;
        --bs-table-active-color: #f8f9fa;
        --bs-table-hover-bg: #352c15;
        --bs-table-hover-color: #f8f9fa;
        color: var(--bs-table-color);
        border-color: var(--bs-table-border-color);
    }

    /* Aggiustamento degli input e form */
    [data-bs-theme="dark"] .form-control,
    [data-bs-theme="dark"] .form-select {
        background-color: #14161a;
        border-color: #30363d;
        color: #e9ecef;
    }

        [data-bs-theme="dark"] .form-control:focus,
        [data-bs-theme="dark"] .form-select:focus {
            background-color: #1d2127;
            border-color: #495057;
            color: #fff;
        }

/* --- ANIMAZIONI TOAST NOTIFICATIONS --- */
@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- SLOT ICONE/BADGE E PULSANTE SIDEBAR CONDIVISI --- */
.sidebar .sidebar-toggle-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    text-decoration: none;
    outline: none !important;
    box-shadow: none !important;
}

.sidebar .sidebar-toggle-btn .bi {
    margin-right: 0 !important;
    width: auto;
    height: auto;
    top: 0;
}

.sidebar .nav-icon-slot {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
    overflow: visible;
}

.sidebar .nav-icon-slot .bi {
    margin-right: 0 !important;
    width: auto;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar .nav-compact-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
    pointer-events: none;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 24px;
    padding: 0.35em 0.5em;
    line-height: 1;
}

/* --- SIDEBAR COMPATTA E FLUIDA (Solo Desktop) --- */
@media (min-width: 768px) {
    .sidebar {
        overflow-x: hidden !important;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .sidebar::-webkit-scrollbar {
        display: none;
    }

    .page .sidebar .sidebar-header {
        padding-inline: 1rem;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .page .sidebar .sidebar-brand {
        display: block;
        margin-right: 0 !important;
        padding: 0;
        white-space: nowrap;
        overflow: hidden;
        max-width: 120px;
        opacity: 1;
    }

    .page.sidebar-compact .sidebar {
        width: 70px !important;
    }

    .page.sidebar-compact .sidebar .sidebar-brand {
        max-width: 0;
        opacity: 0;
        pointer-events: none;
    }

    .page .sidebar .nav-item .nav-link {
        justify-content: flex-start;
        padding-left: 1rem;
        padding-right: 0.75rem;
        gap: 14px;
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .sidebar .nav-item .nav-link > .bi {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar .nav-text {
        opacity: 1;
        max-width: 180px;
        overflow: hidden;
        white-space: nowrap;
    }

    .sidebar .nav-expanded-badge {
        opacity: 1;
        max-width: 60px;
        overflow: hidden;
    }

    .page .sidebar .nav-section-header {
        height: 1.9rem;
        padding: 0.85rem 1rem 0.15rem 2rem;
        overflow: hidden;
    }

    .page .sidebar .nav-section-divider {
        display: block;
        position: absolute;
        left: 50%;
        top: 50%;
        width: 28px;
        height: 1px;
        background-color: rgba(255, 255, 255, 0.18);
        border-radius: 1px;
        opacity: 0;
        transform: translate(-50%, -50%) scaleX(0.2);
        pointer-events: none;
    }

    .page.sidebar-compact .sidebar .nav-item .nav-link {
        justify-content: flex-start !important;
        padding-left: 9px !important;
        padding-right: 9px !important;
        gap: 0 !important;
    }

    .page.sidebar-compact .sidebar .nav-item .nav-link > .bi {
        margin-right: 0 !important;
        font-size: 1.3rem;
    }

    .page.sidebar-compact .sidebar .nav-icon-slot {
        margin-right: 0 !important;
    }

    .page.sidebar-compact .sidebar .nav-icon-slot:not(.has-compact-badge) .nav-slot-icon {
        font-size: 1.3rem;
    }

    .page.sidebar-compact .sidebar .nav-icon-slot.has-compact-badge .nav-slot-icon {
        opacity: 0;
    }

    .page.sidebar-compact .sidebar .nav-icon-slot.has-compact-badge .nav-compact-badge {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    .page.sidebar-compact .sidebar .nav-text {
        opacity: 0 !important;
        max-width: 0 !important;
        margin-left: 0 !important;
        pointer-events: none;
    }

    .page.sidebar-compact .sidebar .nav-expanded-badge {
        opacity: 0 !important;
        max-width: 0 !important;
        padding-inline: 0 !important;
        margin-left: 0 !important;
        pointer-events: none;
    }

    .page.sidebar-compact .submenu-container {
        padding-left: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-left: none !important;
    }

    .page.sidebar-compact .sidebar .nav-section-header {
        height: 0.85rem !important;
        padding: 0.35rem 0 !important;
    }

    .page.sidebar-compact .sidebar .nav-section-divider {
        opacity: 1;
        transform: translate(-50%, -50%) scaleX(1);
    }

    @media (prefers-reduced-motion: no-preference) {
        .sidebar {
            transition: width 0.36s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .page .sidebar .sidebar-brand {
            transition: max-width 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
        }

        .page .sidebar .nav-item .nav-link {
            transition: padding 0.36s cubic-bezier(0.22, 1, 0.36, 1), gap 0.36s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.15s ease, color 0.15s ease;
        }

        .sidebar .nav-item .nav-link > .bi,
        .sidebar .nav-icon-slot {
            transition: margin-right 0.36s cubic-bezier(0.22, 1, 0.36, 1), font-size 0.36s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .sidebar .nav-slot-icon {
            transition: opacity 0.2s ease, font-size 0.36s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .sidebar .nav-compact-badge {
            transition: opacity 0.2s ease 0.06s, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.06s;
        }

        .sidebar .nav-text {
            transition: opacity 0.2s ease, max-width 0.36s cubic-bezier(0.22, 1, 0.36, 1), margin-left 0.36s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .sidebar .nav-expanded-badge {
            transition: opacity 0.2s ease, max-width 0.36s cubic-bezier(0.22, 1, 0.36, 1), padding-inline 0.36s cubic-bezier(0.22, 1, 0.36, 1), margin-left 0.36s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .page .sidebar .nav-section-header {
            transition: height 0.36s cubic-bezier(0.22, 1, 0.36, 1), padding 0.36s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .page .sidebar .nav-section-divider {
            transition: opacity 0.2s ease 0.06s, transform 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.06s;
        }
    }
}

/* Evita il bordo blu di selezione sul pulsante hamburger quando viene cliccato */
.btn-link:focus {
    box-shadow: none !important;
}

/* ==========================================================================
   ADATTAMENTO TEMA SCURO (DARK MODE) PER BOTTONI E BARRE DI RICERCA
   ========================================================================== */

[data-bs-theme="dark"] .btn-light {
    background-color: #2b3035 !important;
    border-color: #495057 !important;
    color: #e9ecef !important;
}

    /* Modifica i colori delle icone per renderli leggibili sul fondo scuro */
    [data-bs-theme="dark"] .btn-light.text-primary {
        color: #6ea8fe !important; /* Azzurro pastello ottimizzato per il buio */
    }

    [data-bs-theme="dark"] .btn-light.text-danger {
        color: #ea868f !important; /* Rosso tenue per non affaticare la vista */
    }

/* Sistema il pulsante Scan e l'icona della lente nella barra di ricerca */
[data-bs-theme="dark"] .input-group .bg-white {
    background-color: #2b3035 !important;
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .input-group .input-group-text.bg-white .bi-search {
    color: #adb5bd !important;
}

/* ==========================================================================
   ADATTAMENTO TEMA SCURO (DARK MODE) PER INPUT E COMBO BOX
   ========================================================================== */

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #2b3035 !important; /* Grigio scuro leggermente più chiaro dello sfondo principale */
    border: 1px solid #495057 !important; /* Bordo grigio medio per definire il campo */
    color: #e9ecef !important; /* Testo chiaro */
}

    /* Effetto di focus migliorato per capire dove stai scrivendo */
    [data-bs-theme="dark"] .form-control:focus,
    [data-bs-theme="dark"] .form-select:focus {
        background-color: #343a40 !important;
        border-color: #495057 !important; /* Nessun bordo azzurro al focus */
        box-shadow: none !important;
        outline: none !important;
    }

/* Assicura che le freccette delle tendine (select) siano visibili */
[data-bs-theme="dark"] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23adb5bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
}

/* Correzione specifica per le schede in background chiaro (il modulo) */
[data-bs-theme="dark"] .bg-light {
    background-color: #212529 !important; /* Scura anche il corpo del modulo */
}

/* Uniforma il contenitore operatori al tema scuro */
[data-bs-theme="dark"] .bg-white.border-0.shadow-sm.rounded-3 {
    background-color: #2b3035 !important; /* Stesso grigio scuro degli input */
    border: 1px solid #495057 !important; /* Bordo coerente con gli input */
    color: #e9ecef !important; /* Testo chiaro */
}

/* Assicura che le label degli operatori siano ben leggibili */
[data-bs-theme="dark"] .form-check-label {
    color: #dee2e6 !important;
}

/* --- BOTTONE COMMESSE (Blu) --- */
.btn-commesse {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
}

/* --- BOTTONE ODL (Viola) --- */
.btn-odl {
    background-color: #6f42c1 !important;
    border-color: #6f42c1 !important;
    color: white !important;
}

/* --- BOTTONE UTENTI (Bianco/Nero) --- */
.btn-utenti {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    color: #212529 !important;
}

/* Adattamento Dark Mode */
[data-bs-theme="dark"] .btn-utenti {
    background-color: #2b3035 !important;
    border-color: #495057 !important;
    color: #f8f9fa !important;
}

/* Riduzione dimensioni caratteri per tutto il sistema di input e bottoni */
.form-control,
.form-select,
.btn,
.input-group-text {
    font-size: 0.85rem !important;
}

/* Adattamento specifico per le Text Area (Lavori e Note) */
textarea.form-control {
    font-size: 0.85rem !important;
}

/* Riduzione font anche per le label sovrastanti i campi */
.form-label {
    font-size: 0.75rem !important;
}

/* Correggi il colore di sfondo e del testo nel box di riconnessione */
[data-bs-theme="dark"] #components-reconnect-modal {
    background-color: #212529 !important; /* Grigio scuro */
    color: #e9ecef !important; /* Testo chiaro */
    border: 1px solid #495057 !important;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

    /* Assicura che anche il testo del messaggio sia leggibile */
    [data-bs-theme="dark"] #components-reconnect-modal h5,
    [data-bs-theme="dark"] #components-reconnect-modal p {
        color: #f8f9fa !important;
    }

.page {
    position: relative;
    display: flex;
    flex-direction: row;
}

@media (max-width: 767.98px) {
    .page {
        flex-direction: column !important;
    }

    .sidebar {
        width: 100% !important;
        position: relative !important;
        height: auto !important;
        z-index: 1050;
        background-color: #1d2127 !important;
        /* LA MAGIA: Permette alla tendina di "uscire" dalla barra senza essere tagliata */
        overflow: visible !important;
    }

        /* Il menu a tendina fluttuante */
        .sidebar .collapse.show {
            position: absolute;
            top: 100%;
            left: 0;
            width: 100%;
            background-color: #1d2127 !important;
            box-shadow: 0 10px 15px rgba(0,0,0,0.5);
            z-index: 1050;
            max-height: 80vh;
            overflow-y: auto;
        }

        .page .sidebar .nav-scrollable {
            position: absolute;
            top: 100%;
            left: 0;
            width: 100%;
            background-color: #1d2127 !important;
            box-shadow: 0 10px 15px rgba(0,0,0,0.5);
            z-index: 1050;
            max-height: min(80vh, calc(100svh - 3.5rem));
            overflow-y: auto; /* La tendina può scorrere internamente se ci sono tanti bottoni */
            display: none;
            opacity: 0;
            translate: 0 -12px;
            pointer-events: none;
            transition:
                display 0.3s,
                opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                translate 0.3s cubic-bezier(0.22, 1, 0.36, 1);
            transition-behavior: allow-discrete;
        }

        .page .sidebar .nav-scrollable.mobile-menu-open {
            display: block;
            opacity: 1;
            translate: 0 0;
            pointer-events: auto;
        }

        @starting-style {
            .page .sidebar .nav-scrollable.mobile-menu-open {
                opacity: 0;
                translate: 0 -12px;
            }
        }

        /* Fallback per browser che non supportano la transizione discreta di display (es. Firefox) */
        .page .sidebar .nav-scrollable[data-closing] {
            display: block;
            opacity: 0;
            translate: 0 -12px;
            pointer-events: none;
        }

        @media (prefers-reduced-motion: reduce) {
            .page .sidebar .nav-scrollable {
                translate: none;
                transition-duration: 0.1s;
            }

            @starting-style {
                .page .sidebar .nav-scrollable.mobile-menu-open {
                    translate: none;
                }
            }

            .page .sidebar .nav-scrollable[data-closing] {
                translate: none;
            }
        }
}

html, body {
    overflow-x: hidden;
    width: 100%;
    height: 100%
}

/* Nasconde l'icona del calendario nativa del browser (Chrome, Edge, Safari) */
input[type="date"]::-webkit-calendar-picker-indicator {
    display: none !important;
    appearance: none;
}

/* 1. Assicurati che il contenitore principale occupi almeno tutta l'altezza dello schermo */
.page {
    position: relative;
    display: flex;
    flex-direction: row;
    min-height: 100vh; /* Forza il contenitore ad essere alto almeno quanto lo schermo */
}

/* 2. Modifica la Sidebar per farla restare fissa (sticky) solo su Desktop */
@media (min-width: 768px) {
    .sidebar {
        flex-shrink: 0 !important;
        width: 250px;
        /* Queste tre righe risolvono il problema del bianco che finisce */
        position: sticky;
        top: 0;
        height: 100vh;
        overflow: hidden; /* Lo scorrimento interno è gestito da .nav-scrollable */
    }

    /* 3. Se la sidebar è contratta, manteniamo lo sticky */
    .sidebar-compact .sidebar {
        width: 70px !important;
    }
}

/* 4. Protezione dell'area principale */
main {
    flex: 1;
    min-width: 0;
}

/* Definisci il colore di sfondo della sidebar */
.sidebar {
    background-color: #ffffff; /* O il colore che usi per il tuo menu */
}

/* Se usi la Dark Mode, dobbiamo coprire anche quella */
[data-bs-theme="dark"] .sidebar {
    background-color: #14161a; /* Deve corrispondere al tuo --bs-body-bg */
}

/* --- OTTIMIZZAZIONE GLOBALE PER LA STAMPA / PDF --- */
@media print {
    html, body {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
    }

    .page {
        display: block !important;
        height: auto !important;
        min-height: auto !important;
        position: static !important;
    }

    .sidebar,
    .top-row {
        display: none !important;
    }

    main {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
}

/* --- UTILITY PURPLE (ODL, GRUPPI TELEGRAM, AVATAR UTENTE) --- */
:root {
    --bs-purple: #6f42c1;
    --bs-purple-rgb: 111, 66, 193;
}

.text-purple {
    color: #6f42c1 !important;
}

.border-purple {
    --bs-border-opacity: 1;
    border-color: rgba(111, 66, 193, var(--bs-border-opacity)) !important;
}

.border-purple.border-opacity-25 {
    border-color: rgba(111, 66, 193, 0.25) !important;
}

.bg-purple {
    --bs-bg-opacity: 1;
    background-color: rgba(111, 66, 193, var(--bs-bg-opacity)) !important;
}

.bg-purple.bg-opacity-10 {
    background-color: rgba(111, 66, 193, 0.1) !important;
}

.bg-purple-subtle {
    background-color: rgba(111, 66, 193, 0.1) !important;
    color: #6f42c1 !important;
}

/* --- SCROLL MARGIN PER I FORM SUPERIORI --- */
#form-container,
#form-ore,
#form-commessa,
#form-utente,
#boxModificaVoce {
    scroll-margin-top: 80px;
}

/* Rimuove l'evidenziazione blu sulle caselle a discesa al focus/selezione */
.form-select:focus,
.form-select:focus-visible,
.form-select:active {
    box-shadow: none !important;
    outline: none !important;
    border-color: rgba(108, 117, 125, 0.35) !important;
}




/* --- DIFFERENZIAZIONE INPUT ORARI: MOBILE (TOUCH) VS PC (MOUSE / TASTIERA) --- */
@media (max-width: 767.98px), (pointer: coarse) {
    input[type="time"] {
        cursor: pointer !important;
    }
    input[type="time"]::-webkit-calendar-picker-indicator {
        display: none !important;
        -webkit-appearance: none !important;
    }
}

@media (min-width: 768px) and (pointer: fine) {
    input[type="time"] {
        cursor: text !important;
    }
    input[type="time"]::-webkit-calendar-picker-indicator {
        display: block !important;
        cursor: pointer !important;
        opacity: 0.6;
        margin-right: 4px;
        transition: opacity 0.15s ease-in-out;
    }
    input[type="time"]::-webkit-calendar-picker-indicator:hover {
        opacity: 1;
    }
    [data-bs-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator {
        filter: invert(0.8);
    }
}


/* Rimuove il bordo evidenziato (focus ring / outline) quando un pulsante o tab viene premuto/selezionato in tutto il sito */
@media (max-width: 767.98px), (pointer: coarse) {
    input[type="datetime-local"] {
        cursor: pointer !important;
    }
    input[type="datetime-local"]::-webkit-calendar-picker-indicator {
        display: none !important;
        -webkit-appearance: none !important;
    }
}

@media (min-width: 768px) and (pointer: fine) {
    input[type="datetime-local"] {
        cursor: text !important;
    }
    input[type="datetime-local"]::-webkit-calendar-picker-indicator {
        display: block !important;
        cursor: pointer !important;
        opacity: 0.6;
        margin-right: 4px;
        transition: opacity 0.15s ease-in-out;
    }
    input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
        opacity: 1;
    }
    [data-bs-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
        filter: invert(0.8);
    }
}

:root,
[data-bs-theme="dark"] {
    --bs-focus-ring-width: 0px;
    --bs-focus-ring-opacity: 0;
    --bs-focus-ring-color: transparent;
}

/* Rimuove il bordo blu evidenziato e il focus ring (outline / box-shadow) da caselle, pulsanti e tab al click o selezione */
a:focus,
a:focus-visible,
button:focus,
button:focus-visible,
button:active,
.btn:focus,
.btn:focus-visible,
.btn:active,
.btn:active:focus,
.btn.active,
.btn.show,
.btn:first-child:active,
:not(.btn-check) + .btn:active,
.btn-check:focus + .btn,
.btn-check:focus-visible + .btn,
.btn-check:checked + .btn:focus,
.btn-check:checked + .btn:focus-visible,
.btn-close:focus,
.btn-close:focus-visible,
.btn-close:active,
.nav-link:focus,
.nav-link:focus-visible,
.nav-link:active,
.nav-tabs .nav-link,
.nav-tabs .nav-link.active,
.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus,
.page-link:focus,
.page-link:focus-visible,
.page-link:active,
.accordion-button:focus,
.accordion-button:focus-visible,
.dropdown-item:focus,
.dropdown-item:focus-visible,
.list-group-item-action:focus,
.list-group-item-action:focus-visible,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
.form-control:focus,
.form-control:focus-visible,
.form-control:active,
.form-control-plaintext:focus,
.form-control-plaintext:focus-visible,
.form-select:focus,
.form-select:focus-visible,
.form-select:active,
.form-check-input:focus,
.form-check-input:focus-visible,
.form-check-input:active,
.form-range:focus,
.form-range:focus-visible,
[role="button"]:focus,
[role="button"]:focus-visible,
[role="tab"]:focus,
[role="tab"]:focus-visible,
[tabindex]:focus,
[tabindex]:focus-visible {
    box-shadow: none !important;
    outline: none !important;
}

.form-range:focus::-webkit-slider-thumb,
.form-range:focus-visible::-webkit-slider-thumb,
.form-range:focus::-moz-range-thumb,
.form-range:focus-visible::-moz-range-thumb {
    box-shadow: none !important;
    outline: none !important;
}

.form-control:not(.is-valid):not(.is-invalid):not(.border-success):not(.border-danger):not(.border-warning):not(.border-secondary):not(.border-secondary-subtle):not(.border-0):focus,
.form-control:not(.is-valid):not(.is-invalid):not(.border-success):not(.border-danger):not(.border-warning):not(.border-secondary):not(.border-secondary-subtle):not(.border-0):focus-visible,
.form-select:not(.is-valid):not(.is-invalid):not(.border-success):not(.border-danger):not(.border-warning):not(.border-secondary):not(.border-secondary-subtle):not(.border-0):focus,
.form-select:not(.is-valid):not(.is-invalid):not(.border-success):not(.border-danger):not(.border-warning):not(.border-secondary):not(.border-secondary-subtle):not(.border-0):focus-visible,
.form-select:not(.is-valid):not(.is-invalid):not(.border-success):not(.border-danger):not(.border-warning):not(.border-secondary):not(.border-secondary-subtle):not(.border-0):active {
    border-color: var(--bs-border-color) !important;
}

.form-check-input:not(:checked):not(.darker-border-checkbox):not(.is-valid):not(.is-invalid):not(.border-success):not(.border-danger):focus,
.form-check-input:not(:checked):not(.darker-border-checkbox):not(.is-valid):not(.is-invalid):not(.border-success):not(.border-danger):focus-visible {
    border-color: var(--bs-border-color) !important;
}

.form-check-input.darker-border-checkbox:not(:checked):focus,
.form-check-input.darker-border-checkbox:not(:checked):focus-visible {
    border-color: #929292 !important;
}

.nav-tabs .nav-link,
.nav-tabs .nav-link.active,
.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus {
    border-color: transparent !important;
}

/* --- BARRA DI AVANZAMENTO UPLOAD NATIVA (<progress>) --- */
progress.sitelog-upload-progress {
    appearance: none;
    border: 0 solid;
    overflow: clip;
    display: block;
    inline-size: 100%;
    block-size: 8px;
    --progress-bar-radius: 999px;
    --progress-bar-track: #e9ecef;
    --progress-bar-fill: #0d6efd;
    --progress-stripe-duration: 1s;
    border-radius: var(--progress-bar-radius);
    background: var(--progress-bar-track);
    box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.08);
}

[data-bs-theme="dark"] progress.sitelog-upload-progress {
    --progress-bar-track: #2b3038;
}

@media (prefers-reduced-motion: reduce) {
    progress.sitelog-upload-progress {
        --progress-stripe-duration: 10s;
    }
}

progress.sitelog-upload-progress::-webkit-progress-bar {
    background: transparent;
}

progress.sitelog-upload-progress::-webkit-progress-value {
    background-color: var(--progress-bar-fill);
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    border-radius: var(--progress-bar-radius);
    transition: inline-size 0.15s ease;
    animation: sitelog-progress-stripes var(--progress-stripe-duration) linear infinite;
}

progress.sitelog-upload-progress::-moz-progress-bar {
    background-color: var(--progress-bar-fill);
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    border-radius: var(--progress-bar-radius);
    transition: inline-size 0.15s ease;
    animation: sitelog-progress-stripes var(--progress-stripe-duration) linear infinite;
}

@keyframes sitelog-progress-stripes {
    from { background-position: 1rem 0; }
    to { background-position: 0 0; }
}

.sitelog-toast-item {
    animation: slide-in-right 0.3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .sitelog-toast-item {
        animation: none;
    }
}

/* Campo ricerca compatto su desktop (resta 100% su mobile) */
@media (min-width: 576px) {
    .sitelog-search-compact {
        max-width: 310px;
    }
}

/* Angoli superiori arrotondati per gli header delle tabelle nelle card rounded-4 */
.card.rounded-4 > .table-responsive:first-child,
.card.rounded-4 > .table-wrapper:first-child,
.card.rounded-4 > .task-table-wrapper:first-child {
    border-top-left-radius: var(--bs-border-radius-xl, 1rem);
    border-top-right-radius: var(--bs-border-radius-xl, 1rem);
}

.card.rounded-4 > .table-responsive:first-child > .table > thead > tr:first-child > th:first-child,
.card.rounded-4 > .table-wrapper:first-child > .table > thead > tr:first-child > th:first-child,
.card.rounded-4 > .task-table-wrapper:first-child > .table > thead > tr:first-child > th:first-child,
.card.rounded-4 > .table:first-child > thead > tr:first-child > th:first-child,
.table-responsive.rounded-4 > .table > thead > tr:first-child > th:first-child {
    border-top-left-radius: var(--bs-border-radius-xl, 1rem);
}

.card.rounded-4 > .table-responsive:first-child > .table > thead > tr:first-child > th:last-child,
.card.rounded-4 > .table-wrapper:first-child > .table > thead > tr:first-child > th:last-child,
.card.rounded-4 > .task-table-wrapper:first-child > .table > thead > tr:first-child > th:last-child,
.card.rounded-4 > .table:first-child > thead > tr:first-child > th:last-child,
.table-responsive.rounded-4 > .table > thead > tr:first-child > th:last-child {
    border-top-right-radius: var(--bs-border-radius-xl, 1rem);
}

/* Badge e pannelli dedicati per "Richiesta modifiche/ricambi" */
.badge-prio-modifiche {
    background-color: #0f766e !important;
    color: #ffffff !important;
}

.modifiche-ricambi-panel {
    background-color: #f0fdfa;
    border: 1px solid #99f6e4;
    border-left: 4px solid #0f766e;
    color: #134e4a;
}

[data-bs-theme="dark"] .modifiche-ricambi-panel {
    background-color: rgba(15, 118, 110, 0.14) !important;
    border-color: rgba(94, 234, 212, 0.35) !important;
    border-left: 4px solid #14b8a6 !important;
    color: #ccfbf1 !important;
}

@media (min-width: 992px) {
    .prio-modifiche-divider {
        border-right: 1px dashed rgba(15, 118, 110, 0.4);
        padding-right: 0.85rem;
    }
}

@media (max-width: 991.98px) {
    .prio-modifiche-divider {
        border-bottom: 1px dashed rgba(15, 118, 110, 0.35);
        padding-bottom: 0.75rem;
    }
}

.ticket-presidio-card {
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f0fa 100%);
    border: 1px solid rgba(13, 110, 253, 0.16) !important;
}

[data-bs-theme="dark"] .ticket-presidio-card {
    background: linear-gradient(135deg, #1b2436 0%, #1d273b 100%) !important;
    border: 1px solid rgba(110, 168, 254, 0.22) !important;
}

/* --- KPI E DASHBOARD CARD CONDIVISE (Stile Centro Operativo, Light e Dark Mode) --- */
.dash-card {
    border: 1px solid rgba(0, 0, 0, 0.09);
    border-radius: 1rem;
    background-color: #ffffff;
    color: #212529;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

[data-bs-theme="dark"] .dash-card {
    background-color: #1d2127 !important;
    border-color: #30363d !important;
    color: #e9ecef !important;
}

.dash-card-clickable {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.dash-card-clickable:hover {
    border-color: #0d6efd !important;
    transform: translateY(-2px);
    box-shadow: 0 0.35rem 0.85rem rgba(13, 110, 253, 0.12) !important;
    color: inherit;
}

[data-bs-theme="dark"] .dash-card-clickable:hover {
    border-color: #6ea8fe !important;
    box-shadow: 0 0.35rem 0.85rem rgba(0, 0, 0, 0.35) !important;
    color: #e9ecef !important;
}

.dash-card.dash-card-selected-primary {
    border-color: rgba(13, 110, 253, 0.7) !important;
    background-color: rgba(13, 110, 253, 0.04) !important;
}
[data-bs-theme="dark"] .dash-card.dash-card-selected-primary {
    border-color: #6ea8fe !important;
    background-color: rgba(13, 110, 253, 0.12) !important;
}

.dash-card.dash-card-selected-purple {
    border-color: rgba(111, 66, 193, 0.7) !important;
    background-color: rgba(111, 66, 193, 0.04) !important;
}
[data-bs-theme="dark"] .dash-card.dash-card-selected-purple {
    border-color: #c29ffa !important;
    background-color: rgba(111, 66, 193, 0.14) !important;
}

.dash-card.dash-card-selected-success {
    border-color: rgba(25, 135, 84, 0.7) !important;
    background-color: rgba(25, 135, 84, 0.04) !important;
}
[data-bs-theme="dark"] .dash-card.dash-card-selected-success {
    border-color: #75b798 !important;
    background-color: rgba(25, 135, 84, 0.12) !important;
}

.dash-card.dash-card-selected-danger {
    border-color: rgba(220, 53, 69, 0.7) !important;
    background-color: rgba(220, 53, 69, 0.04) !important;
}
[data-bs-theme="dark"] .dash-card.dash-card-selected-danger {
    border-color: #ea868f !important;
    background-color: rgba(220, 53, 69, 0.12) !important;
}

.dash-card.dash-card-selected-info {
    border-color: rgba(13, 202, 240, 0.75) !important;
    background-color: rgba(13, 202, 240, 0.05) !important;
}
[data-bs-theme="dark"] .dash-card.dash-card-selected-info {
    border-color: #6edff6 !important;
    background-color: rgba(13, 202, 240, 0.12) !important;
}

.dash-card.dash-card-selected-warning {
    border-color: rgba(255, 193, 7, 0.85) !important;
    background-color: rgba(255, 193, 7, 0.06) !important;
}
[data-bs-theme="dark"] .dash-card.dash-card-selected-warning {
    border-color: #ffda6a !important;
    background-color: rgba(255, 193, 7, 0.12) !important;
}

.dash-card.dash-card-selected-secondary {
    border-color: rgba(108, 117, 125, 0.7) !important;
    background-color: rgba(108, 117, 125, 0.05) !important;
}
[data-bs-theme="dark"] .dash-card.dash-card-selected-secondary {
    border-color: #adb5bd !important;
    background-color: rgba(108, 117, 125, 0.14) !important;
}

.dash-kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 0.6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.dash-soft-primary {
    background-color: rgba(13, 110, 253, 0.12) !important;
    color: #0a58ca !important;
}
[data-bs-theme="dark"] .dash-soft-primary {
    background-color: rgba(13, 110, 253, 0.24) !important;
    color: #6ea8fe !important;
}

.dash-soft-purple {
    background-color: rgba(111, 66, 193, 0.14) !important;
    color: #59359a !important;
}
[data-bs-theme="dark"] .dash-soft-purple {
    background-color: rgba(111, 66, 193, 0.28) !important;
    color: #c29ffa !important;
}

.dash-soft-success {
    background-color: rgba(25, 135, 84, 0.14) !important;
    color: #146c43 !important;
}
[data-bs-theme="dark"] .dash-soft-success {
    background-color: rgba(25, 135, 84, 0.26) !important;
    color: #75b798 !important;
}

.dash-soft-warning {
    background-color: rgba(255, 193, 7, 0.22) !important;
    color: #997404 !important;
}
[data-bs-theme="dark"] .dash-soft-warning {
    background-color: rgba(255, 193, 7, 0.22) !important;
    color: #ffda6a !important;
}

.dash-soft-danger {
    background-color: rgba(220, 53, 69, 0.14) !important;
    color: #b02a37 !important;
}
[data-bs-theme="dark"] .dash-soft-danger {
    background-color: rgba(220, 53, 69, 0.26) !important;
    color: #ea868f !important;
}

.dash-soft-info {
    background-color: rgba(13, 202, 240, 0.18) !important;
    color: #087990 !important;
}
[data-bs-theme="dark"] .dash-soft-info {
    background-color: rgba(13, 202, 240, 0.24) !important;
    color: #6edff6 !important;
}

.dash-soft-secondary {
    background-color: rgba(108, 117, 125, 0.14) !important;
    color: #495057 !important;
}
[data-bs-theme="dark"] .dash-soft-secondary {
    background-color: rgba(108, 117, 125, 0.26) !important;
    color: #adb5bd !important;
}

/* Mantiene contrasto e leggibilità su pulsanti outline con sfondo .bg-body (!important) in hover/active */
.btn.bg-body:not(.border-0):hover,
.btn.bg-body:not(.border-0):active,
.btn.bg-body:not(.border-0).show {
    background-color: var(--bs-secondary-bg) !important;
    border-color: var(--bs-border-color) !important;
    color: var(--bs-emphasis-color) !important;
}

/* Protezione safe-area laterale per dispositivi mobile con notch in orientamento orizzontale (viewport-fit=cover) */
@media (max-width: 991.98px) {
    .top-row {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
    }

    article.content {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
    }
}

/* --- ICONA INFO (TOGGLETIP) E POPOVER INFORMATIVO --- */
.sitelog-info-trigger {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    --interest-delay-start: 0.15s;
    interest-delay-start: var(--interest-delay-start);
    --interest-delay-end: 0.2s;
    interest-delay-end: var(--interest-delay-end);
}

.sitelog-info-trigger:focus,
.sitelog-info-trigger:focus-visible,
.sitelog-info-trigger:active {
    outline: none !important;
    box-shadow: none !important;
}

.sitelog-info-trigger-warning {
    background-color: rgba(var(--bs-warning-rgb), 0.22);
    border: 1px solid rgba(var(--bs-warning-rgb), 0.55);
    color: var(--bs-warning-text-emphasis);
}

.sitelog-info-trigger-warning:hover,
.sitelog-info-trigger-warning:is(:interest-source, .interest-source),
.sitelog-info-trigger-warning[aria-expanded="true"] {
    background-color: rgba(var(--bs-warning-rgb), 0.38);
    border-color: rgba(var(--bs-warning-rgb), 0.8);
    color: var(--bs-warning-text-emphasis);
}

[data-bs-theme="dark"] .sitelog-info-trigger-warning {
    background-color: rgba(255, 193, 7, 0.18);
    border-color: rgba(255, 218, 106, 0.45);
    color: #ffda6a;
}

[data-bs-theme="dark"] .sitelog-info-trigger-warning:hover,
[data-bs-theme="dark"] .sitelog-info-trigger-warning:is(:interest-source, .interest-source),
[data-bs-theme="dark"] .sitelog-info-trigger-warning[aria-expanded="true"] {
    background-color: rgba(255, 193, 7, 0.32);
    border-color: rgba(255, 218, 106, 0.75);
    color: #ffe69c;
}

.sitelog-info-trigger-info {
    background-color: rgba(var(--bs-info-rgb), 0.16);
    border: 1px solid rgba(var(--bs-info-rgb), 0.45);
    color: var(--bs-info-text-emphasis);
}

.sitelog-info-trigger-info:hover,
.sitelog-info-trigger-info:is(:interest-source, .interest-source),
.sitelog-info-trigger-info[aria-expanded="true"] {
    background-color: rgba(var(--bs-info-rgb), 0.28);
    border-color: rgba(var(--bs-info-rgb), 0.75);
    color: var(--bs-info-text-emphasis);
}

[data-bs-theme="dark"] .sitelog-info-trigger-info {
    background-color: rgba(13, 202, 240, 0.16);
    border-color: rgba(110, 223, 246, 0.42);
    color: #6edff6;
}

[data-bs-theme="dark"] .sitelog-info-trigger-info:hover,
[data-bs-theme="dark"] .sitelog-info-trigger-info:is(:interest-source, .interest-source),
[data-bs-theme="dark"] .sitelog-info-trigger-info[aria-expanded="true"] {
    background-color: rgba(13, 202, 240, 0.28);
    border-color: rgba(110, 223, 246, 0.75);
    color: #9eeaf9;
}

.sitelog-info-trigger-on-dark {
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.32);
    color: rgba(255, 255, 255, 0.88);
}

.sitelog-info-trigger-on-dark:hover,
.sitelog-info-trigger-on-dark:is(:interest-source, .interest-source),
.sitelog-info-trigger-on-dark[aria-expanded="true"] {
    background-color: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
}

[popover].sitelog-info-popover {
    max-width: min(360px, calc(100vw - 2rem));
    padding: 0.75rem 0.9rem;
    border-radius: 0.75rem;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.16);
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    white-space: normal;
}

[popover].sitelog-info-popover:is(:popover-open, .\:popover-open) {
    display: block;
}

[data-bs-theme="dark"] [popover].sitelog-info-popover {
    background-color: #1d2127;
    border-color: #30363d;
    box-shadow: 0 0.65rem 1.5rem rgba(0, 0, 0, 0.45);
}

@supports (position-area: block-end) {
    [popover].sitelog-info-popover {
        inset: auto;
        margin: 0;
        margin-block-start: 0.35rem;
        position-area: block-end span-inline-end;
        position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
    }
}

/* Popover azioni riga nelle tabelle e card */
[popover].sitelog-actions-popover {
    min-width: 205px;
    max-width: min(270px, 92vw);
}

[popover].sitelog-actions-popover:is(:popover-open, .\:popover-open) {
    display: block;
}

[data-bs-theme="dark"] [popover].sitelog-actions-popover {
    background-color: #1d2127 !important;
    border-color: #30363d !important;
    box-shadow: 0 0.65rem 1.5rem rgba(0, 0, 0, 0.45) !important;
}

@supports (position-area: block-end) {
    [popover].sitelog-actions-popover {
        inset: auto;
        margin: 0;
        margin-block-start: 4px;
        position-area: block-end span-inline-start;
        position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
    }
}

.sitelog-popover-action-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sitelog-popover-action-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    min-height: 38px;
    padding: 0.45rem 0.75rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    font-size: 0.88rem;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.sitelog-popover-action-item:hover {
    background-color: var(--bs-tertiary-bg);
}

.sitelog-popover-action-item.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

/* --- HUB IMPOSTAZIONI UNIFICATE --- */
.settings-group-card {
    position: relative;
    padding: 0.9rem 1.05rem;
    outline: none !important;
}

.settings-group-card:focus,
.settings-group-card:focus-visible,
.settings-group-card:active {
    outline: none !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.settings-subnav {
    display: flex;
    align-items: stretch;
    gap: 0.25rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: inline proximity;
    border-bottom: 1px solid var(--bs-border-color);
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
}

.settings-subnav-link {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: 40px;
    padding: 0.5rem 0.95rem 0.6rem;
    border: 0;
    border-radius: 0.5rem 0.5rem 0 0;
    background-color: transparent;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    position: relative;
    transition: background-color 0.15s ease, color 0.15s ease;
    outline: none !important;
    box-shadow: none !important;
}

.settings-subnav-link:hover {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-emphasis-color);
}

.settings-subnav-link:focus,
.settings-subnav-link:focus-visible,
.settings-subnav-link:active {
    outline: none !important;
    box-shadow: none !important;
}

.settings-subnav-link[aria-current="page"] {
    background-color: transparent;
    color: #0a58ca;
}

.settings-subnav-link[aria-current="page"] .settings-subnav-icon {
    color: currentColor;
}

.settings-subnav-link[aria-current="page"]::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    border-block-end: 3px solid currentColor;
    border-radius: 3px 3px 0 0;
}

[data-bs-theme="dark"] .settings-subnav {
    border-bottom-color: #30363d;
}

[data-bs-theme="dark"] .settings-subnav-link {
    color: #9aa4b2;
}

[data-bs-theme="dark"] .settings-subnav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #f8f9fa;
}

[data-bs-theme="dark"] .settings-subnav-link[aria-current="page"] {
    background-color: transparent;
    color: #6ea8fe;
}

@media (forced-colors: active) {
    .settings-group-card[aria-current="location"] {
        border: 2px solid Highlight !important;
    }

    .settings-subnav-link[aria-current="page"] {
        border: 2px solid Highlight !important;
        text-decoration: underline;
    }
}

.settings-search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1035;
    max-height: 360px;
    overflow-y: auto;
    border-radius: 1rem;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 0.75rem 1.75rem rgba(0, 0, 0, 0.16);
}

[data-bs-theme="dark"] .settings-search-dropdown {
    background-color: #1d2127;
    border-color: #30363d;
    box-shadow: 0 0.75rem 1.75rem rgba(0, 0, 0, 0.45);
}

.settings-search-result {
    border: 0;
    background: transparent;
    color: var(--bs-body-color);
    text-align: left;
    width: 100%;
    padding: 0.65rem 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-decoration: none;
    transition: background-color 0.12s ease;
    outline: none !important;
    box-shadow: none !important;
}

.settings-search-result:hover {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-emphasis-color);
}

/* --- SELETTORE MODALITA SINCRONIZZAZIONE E-SOLVER --- */
.sync-mode-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
    position: relative;
}

.sync-mode-legend {
    display: block;
    float: none;
    width: auto;
    padding: 0;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--bs-secondary-color);
}

.sync-mode-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem;
    min-height: 38px;
    border-radius: 0.75rem;
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .sync-mode-group {
    background-color: #14161a;
    border-color: #30363d;
}

.sync-mode-radio {
    position: absolute !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: nowrap !important;
}

.sync-mode-radio:focus,
.sync-mode-radio:focus-visible,
.sync-mode-option:focus,
.sync-mode-option:focus-visible,
.sync-mode-option:active {
    outline: none !important;
    box-shadow: none !important;
}

.sync-mode-option {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 32px;
    padding: 0.3rem 0.72rem;
    border-radius: 0.55rem;
    border: 1px solid transparent;
    font-size: 0.835rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--bs-secondary-color);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sync-mode-option:hover {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-emphasis-color);
}

.sync-mode-radio:focus-visible + .sync-mode-option {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-emphasis-color);
}

.sync-mode-radio:checked + .sync-mode-option-nuovi {
    background-color: rgba(25, 135, 84, 0.14);
    border-color: rgba(25, 135, 84, 0.45);
    color: #146c43;
}

[data-bs-theme="dark"] .sync-mode-radio:checked + .sync-mode-option-nuovi {
    background-color: rgba(25, 135, 84, 0.26);
    border-color: rgba(117, 183, 152, 0.55);
    color: #75b798;
}

.sync-mode-radio:checked + .sync-mode-option-aggiornamenti {
    background-color: rgba(255, 193, 7, 0.24);
    border-color: rgba(204, 154, 6, 0.55);
    color: #7a5c00;
}

[data-bs-theme="dark"] .sync-mode-radio:checked + .sync-mode-option-aggiornamenti {
    background-color: rgba(255, 193, 7, 0.22);
    border-color: rgba(255, 218, 106, 0.55);
    color: #ffda6a;
}

.sync-mode-radio:checked + .sync-mode-option-entrambi {
    background-color: rgba(13, 110, 253, 0.12);
    border-color: rgba(13, 110, 253, 0.45);
    color: #0a58ca;
}

[data-bs-theme="dark"] .sync-mode-radio:checked + .sync-mode-option-entrambi {
    background-color: rgba(13, 110, 253, 0.24);
    border-color: rgba(110, 168, 254, 0.55);
    color: #6ea8fe;
}

.sync-mode-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.25;
    background-color: rgba(108, 117, 125, 0.14);
    color: inherit;
}

.sync-mode-radio:checked + .sync-mode-option .sync-mode-count {
    background-color: rgba(255, 255, 255, 0.65);
}

[data-bs-theme="dark"] .sync-mode-radio:checked + .sync-mode-option .sync-mode-count {
    background-color: rgba(0, 0, 0, 0.28);
}

.sync-mode-radio:disabled + .sync-mode-option {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.sync-summary-card-excluded {
    opacity: 0.72;
    border-style: dashed !important;
}

@media (forced-colors: active) {
    .sync-mode-radio:checked + .sync-mode-option {
        border: 2px solid Highlight !important;
    }
}

/* --- WIZARD NUOVO TICKET OPERATORE (4 step, Stile 1, Light e Dark Mode) --- */
.ticket-wizard-dialog {
    max-width: min(1400px, 95vw);
    width: 95vw;
}

.ticket-wizard-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 992px) {
    .ticket-wizard-content {
        height: min(84vh, 780px);
        height: min(84dvh, 780px);
        min-height: 480px;
    }
}

.ticket-wizard-stepper-bar {
    flex-shrink: 0;
    background-color: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0.85rem 1.5rem;
}

.ticket-wizard-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
    padding: 1.35rem 1.75rem;
    background-color: var(--bs-body-bg);
}

.ticket-wizard-body::-webkit-scrollbar {
    width: 6px;
}

.ticket-wizard-body::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.55);
    border-radius: 999px;
}

.ticket-wizard-footer {
    flex-shrink: 0;
    background-color: var(--bs-tertiary-bg);
    border-top: 1px solid var(--bs-border-color);
    padding: 0.9rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (max-width: 991.98px) {
    .ticket-wizard-content {
        max-height: 92vh;
        max-height: 92dvh;
    }

    .ticket-wizard-footer {
        position: sticky;
        bottom: 0;
        z-index: 5;
    }
}

/* Stepper Stile 1: nodi connessi da barra animata */
.ticket-wizard-stepper {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.75rem;
}

.ticket-wizard-step-item {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ticket-wizard-step-item.has-connector {
    flex: 1 1 0%;
}

.ticket-wizard-step-item:last-child {
    flex: 0 0 auto;
}

.ticket-wizard-step-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.85rem 0.45rem 0.5rem;
    border-radius: 999px;
    border: 1.5px solid transparent;
    background-color: transparent;
    color: var(--bs-secondary-color);
    text-align: left;
    flex-shrink: 0;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

button.ticket-wizard-step-trigger {
    cursor: pointer;
}

button.ticket-wizard-step-trigger:hover:not(:disabled) {
    border-color: rgba(38, 176, 80, 0.45);
    background-color: #f0fdf4;
    color: var(--bs-emphasis-color);
}

[data-bs-theme="dark"] button.ticket-wizard-step-trigger:hover:not(:disabled) {
    border-color: rgba(74, 222, 128, 0.45);
    background-color: rgba(38, 176, 80, 0.16);
    color: #f8fafc;
}

button.ticket-wizard-step-trigger:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.ticket-wizard-step-trigger.is-active {
    border-color: rgba(13, 110, 253, 0.35);
    background-color: #eff6ff;
    color: var(--bs-emphasis-color);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.08);
}

[data-bs-theme="dark"] .ticket-wizard-step-trigger.is-active {
    border-color: rgba(110, 168, 254, 0.45);
    background-color: rgba(13, 110, 253, 0.20);
    color: #f8fafc;
    box-shadow: none;
}

.ticket-wizard-step-trigger.is-done {
    color: var(--bs-emphasis-color);
}

.ticket-wizard-step-trigger.is-todo {
    color: var(--bs-secondary-color);
}

.ticket-wizard-step-circle {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.84rem;
    font-weight: 700;
    flex-shrink: 0;
    background-color: var(--bs-body-bg);
    border: 1.5px solid var(--bs-border-color);
    color: var(--bs-secondary-color);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ticket-wizard-step-trigger.is-active .ticket-wizard-step-circle {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.28);
}

.ticket-wizard-step-trigger.is-done .ticket-wizard-step-circle {
    background-color: #26b050;
    border-color: #26b050;
    color: #ffffff;
}

.ticket-wizard-step-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.ticket-wizard-step-connector {
    flex: 1 1 0%;
    min-width: 18px;
    height: 3px;
    border-radius: 999px;
    background-color: var(--bs-border-color);
    overflow: hidden;
}

.ticket-wizard-step-connector-fill {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #26b050 0%, #0d6efd 100%);
    transform-origin: left center;
    transform: scaleX(0);
}

.ticket-wizard-step-connector-fill.is-filled {
    transform: scaleX(1);
}

@media (max-width: 991.98px) {
    .ticket-wizard-step-title {
        white-space: normal;
        font-size: 0.82rem;
    }
}

@media (max-width: 767.98px) {
    .ticket-wizard-stepper-bar {
        padding: 0.8rem 1rem;
    }

    .ticket-wizard-body {
        padding: 1.15rem 1rem;
    }

    .ticket-wizard-footer {
        padding: 0.85rem 1rem;
    }

    .ticket-wizard-stepper {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    .ticket-wizard-step-item.has-connector,
    .ticket-wizard-step-item:last-child {
        flex: initial;
    }

    .ticket-wizard-step-connector {
        display: none;
    }

    .ticket-wizard-step-trigger {
        width: 100%;
        min-height: 46px;
        gap: 0.55rem;
        padding: 0.5rem 0.7rem;
        border-radius: 0.85rem;
        background-color: var(--bs-body-bg);
        border-color: var(--bs-border-color);
    }

    .ticket-wizard-step-trigger.is-done {
        border-color: rgba(38, 176, 80, 0.45);
    }

    .ticket-wizard-step-circle {
        width: 26px;
        height: 26px;
        font-size: 0.78rem;
    }

    .ticket-wizard-step-title {
        font-size: 0.8rem;
    }
}

/* Pannelli, dropzone e pulsanti adattivi */
.ticket-wizard-side-panel {
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    padding: 1.15rem 1.25rem;
}

.ticket-wizard-dropzone {
    border: 1.5px dashed var(--bs-border-color);
    border-radius: 1rem;
    background-color: var(--bs-tertiary-bg);
    padding: 1.85rem 1.4rem;
    text-align: center;
}

.ticket-wizard-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 0.75rem;
    background-color: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
}

.ticket-wizard-fieldset-legend {
    float: none;
    width: auto;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin-bottom: 0.7rem;
    padding: 0;
}

.ticket-wizard-btn-secondary {
    background-color: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ticket-wizard-btn-secondary:hover,
.ticket-wizard-btn-secondary:active {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

[data-bs-theme="dark"] .ticket-wizard-btn-secondary {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
}

[data-bs-theme="dark"] .ticket-wizard-btn-secondary:hover,
[data-bs-theme="dark"] .ticket-wizard-btn-secondary:active {
    background-color: var(--bs-secondary-bg) !important;
    color: var(--bs-emphasis-color) !important;
    border-color: #6c757d !important;
}

.ticket-wizard-btn-secondary:disabled,
.ticket-wizard-btn-secondary.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.ticket-wizard-btn-submit,
.ticket-wizard-btn-submit:hover,
.ticket-wizard-btn-submit:active {
    background-color: #ffc107;
    color: #1a1d20 !important;
    border: 1px solid #eab308;
    height: 38px;
    font-size: 0.92rem;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.35);
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ticket-wizard-btn-submit:hover:not(:disabled) {
    background-color: #ffca2c !important;
    border-color: #eab308 !important;
    transform: translateY(-1px);
}

/* Griglia Reparto a card */
.ticket-wizard-reparto-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 0.85rem;
}

@media (max-width: 991.98px) {
    .ticket-wizard-reparto-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .ticket-wizard-reparto-grid {
        grid-template-columns: 1fr;
    }
}

.ticket-wizard-reparto-btn {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    min-height: 84px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 0.95rem;
    border-radius: 0.85rem;
    border: 1.5px solid var(--bs-border-color);
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-emphasis-color);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.ticket-wizard-reparto-btn:hover {
    border-color: var(--bs-secondary-color);
    background-color: var(--bs-body-bg);
    transform: translateY(-1px);
}

.ticket-wizard-reparto-btn[aria-pressed="true"] {
    border-color: #26b050 !important;
    background-color: rgba(38, 176, 80, 0.10) !important;
    color: var(--bs-emphasis-color);
}

/* Griglia Priorita a altezza uniforme */
.ticket-wizard-prio-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    align-items: stretch;
}

@media (min-width: 1400px) {
    .ticket-wizard-prio-layout {
        grid-template-columns: minmax(225px, 1.18fr) minmax(0, 3fr);
    }
}

.ticket-wizard-prio-tech-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 0.85rem;
    width: 100%;
    height: 100%;
}

@media (max-width: 767.98px) {
    .ticket-wizard-prio-tech-grid {
        grid-template-columns: 1fr;
    }
}

.ticket-wizard-prio-btn {
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    min-height: 154px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.7rem;
    text-align: left;
    cursor: pointer;
    background-color: var(--bs-tertiary-bg);
    border: 1.5px solid var(--bs-border-color);
    color: var(--bs-emphasis-color);
    border-radius: 0.85rem;
    padding: 0.95rem 1rem;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

@media (max-width: 767.98px) {
    .ticket-wizard-prio-btn {
        min-height: 128px;
    }
}

.ticket-wizard-prio-btn:hover {
    transform: translateY(-1px);
}

.ticket-wizard-prio-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
}

.ticket-wizard-prio-title-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    min-width: 0;
}

.ticket-wizard-prio-title {
    min-width: 0;
    flex: 1 1 0%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ticket-wizard-prio-modifiche-icon {
    color: #0f766e;
    margin-top: -1px;
}

.ticket-wizard-prio-modifiche-title {
    color: var(--bs-emphasis-color);
    font-size: 0.9rem;
    line-height: 1.25;
}

.ticket-wizard-prio-modifiche-selected {
    background-color: #f0fdfa !important;
    border-color: #0f766e !important;
    border-width: 1.5px !important;
}

.ticket-wizard-prio-modifiche-selected .ticket-wizard-prio-modifiche-title {
    color: #0f766e !important;
}

[data-bs-theme="dark"] .ticket-wizard-prio-modifiche-icon {
    color: #5eead4;
}

[data-bs-theme="dark"] .ticket-wizard-prio-modifiche-selected {
    background-color: rgba(15, 118, 110, 0.22) !important;
    border-color: #14b8a6 !important;
}

[data-bs-theme="dark"] .ticket-wizard-prio-modifiche-selected .ticket-wizard-prio-modifiche-title,
[data-bs-theme="dark"] .ticket-wizard-prio-modifiche-selected .ticket-wizard-prio-modifiche-check {
    color: #5eead4 !important;
}

.ticket-wizard-prio-modifiche-check {
    color: #0f766e;
    margin-top: 2px;
}

@media (min-width: 1400px) {
    .ticket-wizard-prio-modifiche-divider {
        border-right: 1px dashed rgba(15, 118, 110, 0.4);
        padding-right: 0.85rem;
    }
}

@media (max-width: 1399.98px) {
    .ticket-wizard-prio-modifiche-divider {
        border-bottom: 1px dashed rgba(15, 118, 110, 0.35);
        padding-bottom: 1rem;
    }
}

/* Badge confidenza AI (Light e Dark Mode) */
.ticket-wizard-ai-badge-high {
    background-color: #eef2ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: normal !important;
    text-align: left;
    line-height: 1.25;
    max-width: 100%;
    overflow-wrap: break-word;
    border-radius: 0.65rem;
}

[data-bs-theme="dark"] .ticket-wizard-ai-badge-high {
    background-color: rgba(99, 102, 241, 0.22);
    color: #c7d2fe;
    border-color: rgba(129, 140, 248, 0.45);
}

.ticket-wizard-ai-badge-low {
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: normal !important;
    text-align: left;
    line-height: 1.25;
    max-width: 100%;
    overflow-wrap: break-word;
    border-radius: 0.65rem;
}

[data-bs-theme="dark"] .ticket-wizard-ai-badge-low {
    background-color: rgba(245, 158, 11, 0.20);
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.45);
}

.ticket-wizard-step-heading:focus {
    outline: none !important;
    box-shadow: none !important;
}

.ticket-wizard-step-pane {
    width: 100%;
}

/* Animazioni Stile 1: opt-in con prefers-reduced-motion */
@media (prefers-reduced-motion: no-preference) {
    .ticket-wizard-step-connector-fill {
        transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    }

    @keyframes ticketWizardSlideInRight {
        from {
            opacity: 0;
            transform: translate3d(28px, 0, 0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }

    @keyframes ticketWizardSlideInLeft {
        from {
            opacity: 0;
            transform: translate3d(-28px, 0, 0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }

    @keyframes ticketWizardCheckPop {
        0% {
            transform: scale(0.55);
        }
        70% {
            transform: scale(1.14);
        }
        100% {
            transform: scale(1);
        }
    }

    @keyframes ticketWizardResultsFadeIn {
        from {
            opacity: 0;
            transform: translate3d(0, 8px, 0);
        }
        to {
            opacity: 1;
            transform: translate3d(0, 0, 0);
        }
    }

    .ticket-wizard-step-enter-forward {
        animation: ticketWizardSlideInRight 0.30s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .ticket-wizard-step-enter-backward {
        animation: ticketWizardSlideInLeft 0.30s cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .ticket-wizard-step-circle.is-check-pop {
        animation: ticketWizardCheckPop 0.30s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    }

    .ticket-wizard-ai-results-enter {
        animation: ticketWizardResultsFadeIn 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ticket-wizard-step-trigger,
    .ticket-wizard-reparto-btn,
    .ticket-wizard-prio-btn,
    .ticket-wizard-btn-submit {
        transition: border-color 0.15s ease, background-color 0.15s ease;
    }

    button.ticket-wizard-step-trigger:hover:not(:disabled),
    .ticket-wizard-reparto-btn:hover,
    .ticket-wizard-prio-btn:hover,
    .ticket-wizard-btn-submit:hover:not(:disabled) {
        transform: none;
    }
}







