@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');
@import url('../PA33FrontEndBlazor.styles.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Previeni scroll orizzontale */
    overflow-y: auto; /* Permetti scroll verticale naturale */
}

/* ========================================
   LAYOUT BOOTSTRAP ITALIA PA NATIVO
   ======================================== */

/* Page wrapper principale - Layout PA naturale */
.page.pa-layout-wrapper {
    /* Nessuna altezza forzata - scroll naturale */
}

/* Main container - contenuto fluido */
.pa-main-container {
    padding: 0;
    /* Nessuna min-height forzata */
}

/* ✅ CONTROLLI GRIGLIA PROFESSIONALI - Bootstrap Italia PA */
.schedegeneriche-grid-controls {
    background: var(--bs-light, #f8f9fa);
    border-radius: var(--bs-border-radius-lg, 0.5rem);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
}

/* Input groups uniformi */
.schedegeneriche-grid-controls .input-group-text {
    background-color: var(--bs-primary-100, #e6f3ff);
    border-color: var(--bs-primary-300, #99ccff);
    color: var(--bs-primary, #0066cc);
}

/* Form labels professionali */
.schedegeneriche-grid-controls .form-label {
    font-weight: 600;
    color: var(--bs-gray-700, #495057);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Help text ottimizzato */
.schedegeneriche-grid-controls .form-text {
    font-size: 0.8rem;
    margin-top: 0.25rem;
    color: var(--bs-gray-600, #6c757d);
}

/* Controlli compatti responsive */
.schedegeneriche-grid-controls .d-flex {
    gap: 1rem;
}

@media (max-width: 767.98px) {
    .schedegeneriche-grid-controls .d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }
}

/* Button CSV elegante */
.schedegeneriche-grid-controls .btn-outline-primary {
    border-color: var(--bs-primary, #0066cc);
    color: var(--bs-primary, #0066cc);
    font-weight: 500;
    white-space: nowrap;
}

.schedegeneriche-grid-controls .btn-outline-primary:hover {
    background-color: var(--bs-primary, #0066cc);
    border-color: var(--bs-primary, #0066cc);
    color: var(--bs-white, #ffffff);
}

/* Form controls ottimizzati */
.schedegeneriche-grid-controls .form-control,
.schedegeneriche-grid-controls .form-select {
    border-color: var(--bs-border-color, #dee2e6);
}

.schedegeneriche-grid-controls .form-control:focus,
.schedegeneriche-grid-controls .form-select:focus {
    border-color: var(--bs-primary, #0066cc);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Ottimizzazione visiva campo data - mantiene accessibilità */
.schedegeneriche-grid-controls input[type="date"] {
    text-align: center;
    font-family: var(--bs-font-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);
    letter-spacing: 0.5px;
}

.schedegeneriche-grid-controls input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.5);
    cursor: pointer;
}

/* ✅ STILI ORDINAMENTO TABELLE - WCAG 2.1 AA Conforme */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease-in-out;
    position: relative;
}

.sortable:hover {
    background-color: var(--bs-primary-100, rgba(0, 102, 204, 0.1)) !important;
}

.sortable:focus {
    outline: 2px solid var(--bs-primary, #0066cc) !important;
    outline-offset: -2px;
}

/* Indicatori di ordinamento accessibili */
.sort-indicator {
    opacity: 0.8;
}

/* Header ordinabili con colori Bootstrap Italia PA forzati */
.table-responsive-payment thead.table-primary th.sortable:hover {
    background-color: var(--bs-primary-800, #004f99) !important;
    color: white !important;
}

.table-responsive-payment thead.table-primary th.sortable:focus {
    background-color: var(--bs-primary, #0066cc) !important;
    color: white !important;
    outline: 2px solid var(--bs-warning, #ffc107) !important;
    outline-offset: -2px;
}

/* Icone bianche anche negli stati hover/focus */
.table-responsive-payment thead.table-primary th.sortable:hover svg.icon,
.table-responsive-payment thead.table-primary th.sortable:hover .icon,
.table-responsive-payment thead.table-primary th.sortable:focus svg.icon,
.table-responsive-payment thead.table-primary th.sortable:focus .icon {
    fill: white !important;
    color: white !important;
}

/* ⚡ Template personalizzati - Forza container gdlr-core al 100% della larghezza */
.custom-template .gdlr-core-container,
.gdlr-core-container {
    max-width: 100% !important;
    width: 100% !important;
}

/* Row standard Bootstrap */
.pa-main-container .row {
    margin: 0;
}

/* Footer naturale in fondo al contenuto */
.it-footer {
    margin-top: 3rem; /* Spazio maggiore sopra il footer */
    position: relative;
    width: 100%;
}

/* ========================================
   BOOTSTRAP ITALIA IT-LIST UFFICIALE
   ======================================== */

/* ✅ COMPONENTE IT-LIST - Segue ESATTAMENTE la documentazione ufficiale */
.it-list-wrapper {
    background-color: var(--bs-white, #ffffff);
    border-radius: var(--bs-border-radius, 0.375rem);
    box-shadow: 0 2px 10px 0 rgba(0, 102, 204, 0.08);
    overflow: hidden;
}

.it-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.it-list .list-item {
    border-bottom: 1px solid var(--bs-gray-200, #e9ecef);
    padding: 1rem;
    position: relative;
    display: flex;
    align-items: flex-start;
    background-color: var(--bs-white, #ffffff);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    text-decoration: none !important;
}

.it-list .list-item:last-child {
    border-bottom: none;
}

.it-list .list-item:hover {
    background-color: var(--bs-primary-100, #f0f8ff);
    text-decoration: none !important;
}

.it-list .list-item:focus {
    background-color: var(--bs-primary-100, #f0f8ff);
    outline: 2px solid var(--bs-primary, #0066cc);
    outline-offset: -2px;
    text-decoration: none !important;
}

/* Left icon - Avatar/Icona principale */
.it-list .it-left-icon {
    flex-shrink: 0;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--bs-border-radius, 0.375rem);
    background-color: var(--bs-primary-100, #f0f8ff);
}

.it-list .it-left-icon .icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Right icon - Azioni */
.it-list .it-right-icon {
    flex-shrink: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
}

/* Text wrapper */
.it-list .it-item-text-wrapper {
    flex: 1;
    min-width: 0; /* Per permettere text truncation */
}

/* Category/Tag */
.it-list .it-category {
    color: var(--bs-primary, #0066cc);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
}

/* Main text */
.it-list .it-item-text {
    color: var(--bs-gray-900, #17324d);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

/* Notes/Additional info */
.it-list .it-item-note {
    color: var(--bs-gray-600, #6c757d);
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
}

.it-list .it-item-note:last-child {
    margin-bottom: 0;
}

/* Responsive - Mobile ottimizzato */
@media (max-width: 767.98px) {
    .it-list .list-item {
        padding: 0.875rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .it-list .it-left-icon {
        margin-right: 0;
        margin-bottom: 0.75rem;
        align-self: flex-start;
    }
    
    .it-list .it-right-icon {
        margin-left: 0;
        margin-top: 0.75rem;
        align-self: stretch;
    }
    
    .it-list .it-right-icon .btn {
        width: 100%;
        justify-content: center;
    }
    
    .it-list .it-item-text-wrapper {
        width: 100%;
    }
}

/* Empty state styling */
.it-list-wrapper .text-center {
    padding: 3rem 1.5rem;
}

.it-list-wrapper .text-center .icon-xl {
    width: 4rem;
    height: 4rem;
    opacity: 0.6;
}

/* ========================================
   BGC2024 GRID COMPONENTS - BOOTSTRAP ITALIA PA
   ======================================== */

/* Container sezioni BGC2024 */
.bgc2024-grid-section {
    background: var(--bs-body-bg, #fff);
    border-radius: var(--bs-border-radius, 0.375rem);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* Controlli filtri BGC2024 */
.bgc2024-grid-controls {
    padding: 1.5rem;
    background: var(--bs-light, #f8f9fa);
    border-radius: var(--bs-border-radius, 0.375rem) var(--bs-border-radius, 0.375rem) 0 0;
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

/* Tabella BGC2024 */
.bgc2024-table-container {
    padding: 0;
}

.bgc2024-table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.bgc2024-table th {
    border-bottom: 2px solid var(--bs-primary, #0066cc);
    background-color: var(--bs-primary, #0066cc) !important;
    color: white;
    font-weight: 600;
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
}

.bgc2024-table td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    border-color: var(--bs-border-color, #dee2e6);
}

.bgc2024-table tbody tr:hover {
    background-color: var(--bs-primary-bg-subtle, rgba(0, 102, 204, 0.05));
}

/* Colonne responsivo BGC2024 */
.bgc2024-col-data {
    width: 120px;
    min-width: 120px;
}

.bgc2024-col-tipo {
    width: 25%;
    min-width: 150px;
}

.bgc2024-col-atto {
    width: auto; /* Colonna principale - prende spazio restante */
    min-width: 200px;
}

.bgc2024-col-actions {
    width: 180px;
    min-width: 180px;
}

/* Hide colonne su mobile */
@media (max-width: 767.98px) {
    .bgc2024-col-tipo {
        display: none;
    }
    
    .bgc2024-col-data {
        width: 100px;
        min-width: 100px;
        font-size: 0.8rem;
    }
    
    .bgc2024-col-actions {
        width: 150px;
        min-width: 150px;
    }
}

@media (max-width: 575.98px) {
    .bgc2024-col-data {
        width: 80px;
        min-width: 80px;
        font-size: 0.75rem;
    }
    
    .bgc2024-col-actions {
        width: 130px;
        min-width: 130px;
    }
    
    .bgc2024-col-actions .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Pulsanti azioni BGC2024 */
.bgc2024-table .btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--bs-border-radius-sm, 0.25rem);
}

.bgc2024-table .btn .icon {
    width: 14px;
    height: 14px;
}

/* Stati loading BGC2024 */
.bgc2024-grid-section .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2rem;
    color: var(--bs-primary, #0066cc);
}

/* Form controls BGC2024 */
.bgc2024-grid-controls .form-label {
    font-size: 0.9rem;
    color: var(--bs-dark, #212529);
    margin-bottom: 0.25rem;
}

.bgc2024-grid-controls .form-control,
.bgc2024-grid-controls .form-select {
    font-size: 0.9rem;
    border-color: var(--bs-border-color, #ced4da);
}

.bgc2024-grid-controls .form-control:focus,
.bgc2024-grid-controls .form-select:focus {
    border-color: var(--bs-primary, #0066cc);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.15);
}

/* Help text BGC2024 */
.bgc2024-grid-controls .form-text {
    font-size: 0.8rem;
}

/* Paginazione BGC2024 */
.bgc2024-grid-section .pagination {
    margin-bottom: 0;
}

.bgc2024-grid-section .pagination .page-link {
    color: var(--bs-primary, #0066cc);
    border-color: var(--bs-border-color, #dee2e6);
}

.bgc2024-grid-section .pagination .page-link:hover {
    background-color: var(--bs-primary-bg-subtle, rgba(0, 102, 204, 0.1));
}

.bgc2024-grid-section .pagination .page-item.active .page-link {
    background-color: var(--bs-primary, #0066cc);
    border-color: var(--bs-primary, #0066cc);
}

/* Responsive stacking pulsanti azioni */
@media (max-width: 991.98px) {
    .bgc2024-col-actions .d-flex {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
}

/* BGC2024 Tabs Bootstrap Italia */
.bgc2024-tabs-container {
    margin-top: 1.5rem;
}

.bgc2024-tabs-container .nav-tabs {
    border-bottom: 2px solid var(--bs-primary, #0066cc);
}

.bgc2024-tabs-container .nav-link {
    color: var(--bs-dark, #212529);
    border: 1px solid transparent;
    border-radius: var(--bs-border-radius, 0.375rem) var(--bs-border-radius, 0.375rem) 0 0;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.bgc2024-tabs-container .nav-link:hover {
    border-color: var(--bs-border-color, #dee2e6);
    background-color: var(--bs-light, #f8f9fa);
}

.bgc2024-tabs-container .nav-link.active {
    color: var(--bs-primary, #0066cc);
    background-color: var(--bs-white, #fff);
    border-color: var(--bs-primary, #0066cc) var(--bs-primary, #0066cc) var(--bs-white, #fff);
    border-bottom: 2px solid var(--bs-white, #fff);
    margin-bottom: -2px;
}

.bgc2024-tabs-container .nav-link .icon {
    width: 18px;
    height: 18px;
}

.bgc2024-tabs-container .tab-content {
    padding: 1.5rem;
    background: var(--bs-white, #fff);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-top: none;
    border-radius: 0 0 var(--bs-border-radius, 0.375rem) var(--bs-border-radius, 0.375rem);
}

/* Responsive tabs BGC2024 */
@media (max-width: 767.98px) {
    .bgc2024-tabs-container .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .bgc2024-tabs-container .nav-link .icon {
        width: 16px;
        height: 16px;
    }
    
    .bgc2024-tabs-container .tab-content {
        padding: 1rem;
    }
}

/* ========================================
   SIDEBAR BOOTSTRAP ITALIA PA
   ======================================== */

/* Sidebar principale */
.pa-sidebar {
    background-color: var(--bs-white);
    border-right: 1px solid var(--bs-gray-200);
    padding: 1.5rem 1rem;
    /* ⚡ Larghezza massima ottimizzata per evitare spazio eccessivo */
    max-width: 300px;
    /* ⚡ Desktop Performance: Faster transition + GPU acceleration */
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform; /* GPU acceleration */
    backface-visibility: hidden; /* Previene flickering */
}

/* Sidebar espansa */
.pa-sidebar.expand {
    transform: translateX(0);
    opacity: 1;
}

/* Sidebar collassata */
.pa-sidebar.collapse {
    transform: translateX(-100%);
    opacity: 0;
    width: 0 !important;
    padding: 0;
    border: none;
}

/* Sidebar nascosta (quando non mostrata in layout) */
.pa-sidebar-hidden {
    display: none;
}

/* Content area principale */
.pa-content {
    padding: 2rem 1.5rem;
    background-color: var(--bs-gray-50, #f8f9fa);
    /* Nessuna min-height - scroll naturale */
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    /* Sidebar mobile sempre off-canvas */
    .pa-sidebar.mobile-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        z-index: 1050 !important;
        transform: translateX(-100%) !important;
        width: 280px !important;
        background-color: var(--bs-white) !important;
        border-right: 1px solid var(--bs-gray-200) !important;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1) !important;
        overflow-y: auto !important;
        /* ⚡ Mobile optimized transition */
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        will-change: transform;
        padding: 0 !important; /* Rimuoviamo padding per gestire header separato */
        display: block !important;
        visibility: visible !important;
    }
    
    /* Header del menu mobile con pulsante di chiusura */
    .mobile-menu-header {
        position: sticky !important;
        top: 0 !important;
        background-color: var(--bs-white) !important;
        border-bottom: 1px solid var(--bs-gray-200) !important;
        padding: 1rem 1.5rem !important;
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        z-index: 10 !important;
    }
    
    /* Pulsante di chiusura mobile */
    .mobile-close-button {
        background: none !important;
        border: none !important;
        padding: 0.5rem !important;
        color: var(--bs-gray-600) !important;
        cursor: pointer !important;
        border-radius: var(--bs-border-radius) !important;
        transition: all 0.2s ease !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
    
    .mobile-close-button:hover,
    .mobile-close-button:focus {
        background-color: var(--bs-gray-100) !important;
        color: var(--bs-dark) !important;
        outline: 2px solid var(--bs-primary) !important;
        outline-offset: 2px !important;
    }
    
    .mobile-close-button:active {
        background-color: var(--bs-gray-200) !important;
        transform: scale(0.95) !important;
    }
    
    /* Contenuto del menu con padding ripristinato */
    .pa-sidebar .filter-panel,
    .pa-sidebar .accessible-tree {
        padding: 0 1.5rem !important;
    }
    
    .pa-sidebar .filter-panel {
        padding-top: 1rem !important;
    }
    
    .pa-sidebar .accessible-tree {
        padding-bottom: 1.5rem !important;
    }
    
    /* Fallback per qualsiasi sidebar su mobile */
    .pa-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        z-index: 1050 !important;
        transform: translateX(-100%) !important;
        width: 280px !important;
        background-color: var(--bs-white) !important;
        border-right: 1px solid var(--bs-gray-200) !important;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1) !important;
        overflow-y: auto !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        padding: 1.5rem 1rem !important;
        display: block !important;
        visibility: visible !important;
    }
    
    /* Stile super-specifico per expand */
    .pa-sidebar.expand {
        transform: translateX(0) !important;
    }
    
    /* Stile super-specifico per collapse */
    .pa-sidebar.collapse {
        transform: translateX(-100%) !important;
    }
    
    /* Anche più specifico con il selettore completo */
    aside.pa-sidebar.expand {
        transform: translateX(0) !important;
    }
    
    aside.pa-sidebar.collapse {
        transform: translateX(-100%) !important;
    }
    
    .pa-content {
        padding: 1.5rem 1rem;
    }
}

/* ===== OVERLAY MOBILE MENU ===== */

/* Overlay per chiusura menu mobile tramite tap outside */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040; /* Sotto sidebar ma sopra contenuto */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Overlay visibile */
.mobile-menu-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Prevent body scroll quando menu mobile è aperto */
body.mobile-menu-open {
    overflow: hidden;
    height: 100vh;
}

/* Desktop: nascondi sempre overlay */
@media (min-width: 992px) {
    .mobile-menu-overlay {
        display: none !important;
    }
    
    body.mobile-menu-open {
        overflow: auto;
        height: auto;
    }
    
    /* Nascondi header mobile su desktop */
    .mobile-menu-header {
        display: none !important;
    }
    
    /* ⚡ Desktop sidebar management - Performance optimized */
    .pa-sidebar.desktop-sidebar {
        position: relative;
        width: auto;
        height: auto;
        z-index: auto;
        box-shadow: none;
        border-right: 1px solid var(--bs-gray-200);
        background-color: var(--bs-white);
        padding: 1.5rem 1rem;
        /* Fast desktop transition - no display changes */
        transition: transform 0.1s ease-out, opacity 0.1s ease-out;
        will-change: transform, opacity;
    }
    
    /* ⚡ Disable transitions on tree elements during sidebar animation */
    .pa-sidebar.desktop-sidebar:not(.expand):not(.collapse) * {
        transition: none !important;
        animation: none !important;
    }
    
    .pa-sidebar.desktop-sidebar.collapse {
        /* Transform instead of display:none for performance */
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none; /* Disable interactions */
    }
    
    .pa-sidebar.desktop-sidebar.expand {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 575.98px) {
    .pa-content {
        padding: 1rem 0.75rem;
    }
}

/* Mobile Overlay quando sidebar è aperta */
.pa-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1030;
    transition: opacity 0.3s ease;
}

.pa-sidebar-overlay.show {
    display: block;
    opacity: 1;
}

@media (max-width: 991.98px) {
    .pa-sidebar.expand ~ .pa-sidebar-overlay {
        display: block;
        opacity: 1;
    }
}


.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--bs-success);
}

.invalid {
    outline: 1px solid var(--bs-danger);
}

.validation-message {
    color: var(--bs-danger);
}

#blazor-error-ui {
    background: var(--bs-warning);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}


/*---------------------------*/

.it-list-wrapper .list-item {
    height: 100%;
}



.sidebar {
    background-color: var(--bs-white) !important;
}
.app-sidebar {
    padding-bottom: 60px !important;
}

/* Stati sidebar per accessibilità */
.sidebar.collapse {
    width: 60px !important; /* Larghezza minimizzata */
    overflow: hidden;
    transition: width 0.3s ease;
}

.sidebar.expand {
    width: auto !important; /* Larghezza completa */
    transition: width 0.3s ease;
}

/* Hide text in collapsed state, keep icons visible */
.sidebar.collapse .tree-node-text,
.sidebar.collapse .filter-panel input,
.sidebar.collapse .tree-controls {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.sidebar.expand .tree-node-text,
.sidebar.expand .filter-panel input,
.sidebar.expand .tree-controls {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease 0.1s; /* Slight delay for smoother UX */
}

.breadcrumb-container .breadcrumb .breadcrumb-item.active a {
    pointer-events: inherit;
}


/* ========================================
   ACCESSIBILITÀ WCAG 2.1 AA
   ======================================== */

/* Screen reader only content */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip link per navigazione rapida */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    z-index: 9999;
    color: var(--bs-white);
    background-color: var(--bs-black);
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
}

.skip-link:focus {
    top: 0;
}


/* Indicatori per espansione nodi */
.expand-indicator {
    color: var(--bs-primary);
    font-weight: bold;
    margin-right: 6px;
    display: inline-block;
    width: 12px;
    text-align: center;
}

.leaf-indicator {
    color: var(--bs-gray-600);
    margin-right: 6px;
    display: inline-block;
    width: 12px;
    text-align: center;
}

/* Focus migliorato per nodi custom */
.sidebar span[role="button"]:focus,
.sidebar span[role="link"]:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 1px;
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-radius: 2px;
}

/* Stili hover per nodi custom */
.sidebar span[role="button"]:hover,
.sidebar span[role="link"]:hover {
    background-color: var(--bs-gray-100);
    border-radius: 2px;
    cursor: pointer;
}

/* ========================================
   TREE NATIVO ACCESSIBILE - Bootstrap Italia
   ======================================== */

/* Variabili Bootstrap Italia 2.15.1 - Palette Ufficiale PA Italiana */
:root {
    /* Colori primari PA italiana ufficiali */
    --bs-primary: #0066cc;
    --bs-primary-rgb: 0, 102, 204;
    --bs-primary-100: #e6f0ff;
    --bs-primary-200: #cce0ff;
    --bs-primary-300: #99ccff;
    --bs-primary-400: #4d9fff;
    --bs-primary-500: #0066cc;
    --bs-primary-600: #0052a3;
    --bs-primary-700: #003d7a;
    --bs-primary-800: #002952;
    --bs-primary-900: #001429;
    
    /* Colori di stato PA conformi */
    --bs-success: #008758;
    --bs-success-rgb: 0, 135, 88;
    --bs-info: #5bc0de;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    
    /* Scala grigi PA ufficiale */
    --bs-white: #ffffff;
    --bs-gray-50: #f8f9fa;
    --bs-gray-100: #f1f3f4;
    --bs-gray-200: #e9ecef;
    --bs-gray-300: #dee2e6;
    --bs-gray-400: #ced4da;
    --bs-gray-500: #adb5bd;
    --bs-gray-600: #6c757d;
    --bs-gray-700: #495057;
    --bs-gray-800: #343a40;
    --bs-gray-900: #212529;
    --bs-black: #000000;
    
    /* Testi PA conformi WCAG */
    --bs-body-color: #17324d;
    --bs-body-bg: #ffffff;
    --bs-text-muted: #5a6772;
    --bs-text-white: #ffffff;
    --bs-border-color: #dee2e6;
    
    /* Focus WCAG 2.1 AA compliant */
    --bs-focus-ring-color: rgba(var(--bs-primary-rgb), 0.25);
    --bs-focus-ring-width: 0.25rem;
    --bs-focus-ring-opacity: 1;
    
    /* Componenti Tree PA */
    --tree-hover-bg: var(--bs-primary-100);
    --tree-selected-bg: var(--bs-primary);
    --tree-selected-hover-bg: var(--bs-primary-700);
    --tree-text-color: var(--bs-body-color);
    --tree-muted-color: var(--bs-text-muted);
}

/* ========================================
   HEADER SEMPLIFICATO PA - Bootstrap Italia
   ======================================== */

/* Header semplice e pulito */
.simple-header {
    background-color: var(--bs-white);
    border-bottom: 1px solid var(--bs-gray-200);
}

.simple-header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin-bottom: 0;
}

.simple-header-title a {
    color: var(--bs-body-color);
    transition: color 0.2s ease;
}

.simple-header-title a:hover {
    color: var(--bs-primary);
}

.simple-header-subtitle {
    font-size: 1rem;
    color: var(--bs-text-muted);
}

/* Intro semplice */
.simple-intro {
    background-color: var(--bs-gray-50);
    border-bottom: 1px solid var(--bs-gray-200);
}

.simple-intro-content p {
    font-size: 0.95rem;
    max-width: 800px;
    margin: 0 auto;
}

/* Titolo principale semplice */
.simple-main-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--bs-body-color);
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bs-primary-200);
}

/* Responsive per header semplice */
@media (max-width: 767.98px) {
    .simple-header-title {
        font-size: 1.25rem;
    }
    
    .simple-header-subtitle {
        font-size: 0.9rem;
    }
    
    .simple-main-title {
        font-size: 1.5rem;
    }
}

/* ========================================
   BREADCRUMB NAVIGATION PA - Bootstrap Italia
   ======================================== */

/* Breadcrumb Navigation PA Conforme */
.breadcrumb-navigation-wrapper {
    background-color: var(--bs-gray-50);
    border-bottom: 1px solid var(--bs-gray-200);
    padding: 0.75rem 0;
}

.pa-breadcrumb {
    margin-bottom: 0;
    background-color: transparent;
    padding: 0.5rem 0;
}

.pa-breadcrumb .breadcrumb-item {
    color: var(--bs-text-muted);
    font-size: 0.9rem;
}

.pa-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: var(--bs-breadcrumb-divider, ">");
    color: var(--bs-text-muted);
    margin: 0 0.5rem;
}

/* Home link con icona PA */
.breadcrumb-home-link {
    color: var(--bs-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    transition: color 0.15s ease-in-out;
}

.breadcrumb-home-link:hover {
    color: var(--bs-primary-600);
    text-decoration: underline;
}

.breadcrumb-home-link .icon {
    color: var(--bs-primary);
}

/* Link intermedi breadcrumb */
.breadcrumb-item-link {
    color: var(--bs-text-muted);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

.breadcrumb-item-link:hover {
    color: var(--bs-primary);
    text-decoration: underline;
}

/* Elemento corrente breadcrumb */
.breadcrumb-current {
    color: var(--bs-body-color);
    font-weight: 500;
}

/* Breadcrumb attivo WCAG 2.1 AA */
.pa-breadcrumb .breadcrumb-item.active {
    color: var(--bs-body-color);
    font-weight: 500;
}

.pa-breadcrumb .breadcrumb-item.active .breadcrumb-current {
    color: inherit;
}

/* Responsive breadcrumb per mobile */
@media (max-width: 767.98px) {
    .breadcrumb-navigation-wrapper {
        padding: 0.5rem 0;
    }
    
    .pa-breadcrumb {
        padding: 0.25rem 0;
        flex-wrap: wrap;
    }
    
    .pa-breadcrumb .breadcrumb-item {
        font-size: 0.85rem;
    }
    
    .breadcrumb-home-link .icon {
        width: 1rem !important;
        height: 1rem !important;
    }
}

/* High contrast mode per accessibilità */
@media (prefers-contrast: high) {
    .breadcrumb-navigation-wrapper {
        border-bottom-width: 2px;
        border-bottom-color: ButtonText;
    }
    
    .breadcrumb-home-link {
        color: Highlight !important;
    }
    
    .breadcrumb-item-link {
        color: ButtonText !important;
    }
    
    .breadcrumb-current {
        color: ButtonText !important;
        font-weight: 700;
    }
}

/* ========================================
   RICERCA AVANZATA MODERNA - Bootstrap Italia
   ======================================== */

/* Variabili per ricerca avanzata moderna */
:root {
    --search-card-shadow: 0 2px 12px rgba(0, 102, 204, 0.08);
    --search-card-shadow-hover: 0 4px 20px rgba(0, 102, 204, 0.12);
    --search-focus-color: var(--bs-primary, #0066cc);
    --search-focus-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
    --search-border-radius: 0.75rem;
    --search-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --search-gradient: linear-gradient(135deg, var(--bs-primary, #0066cc) 0%, var(--bs-primary-600, #0052a3) 100%);
    --search-input-bg: var(--bs-gray-50, #f8f9fa);
    --search-input-border: var(--bs-gray-300, #dee2e6);
}

/* Container Card Moderno */
.search-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border: 1px solid var(--bs-gray-200, #e9ecef);
    border-radius: var(--search-border-radius);
    box-shadow: var(--search-card-shadow);
    padding: 2rem;
    transition: var(--search-transition);
    position: relative;
    overflow: hidden;
}

.search-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--search-gradient);
}

.search-card:hover {
    box-shadow: var(--search-card-shadow-hover);
    transform: translateY(-2px);
}

/* Header moderno */
.search-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bs-gray-100, #f8f9fa);
}

.search-header .icon {
    margin-right: 0.75rem;
    color: var(--bs-primary);
    filter: drop-shadow(0 2px 4px rgba(0, 102, 204, 0.15));
}

.search-header h3 {
    margin: 0;
    color: var(--tree-text-color);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.search-subtitle {
    color: var(--tree-muted-color);
    font-size: 0.95rem;
    margin-top: 0.25rem;
    font-weight: 400;
}

/* Form Group moderno con allineamento perfetto */
.search-form-group {
    position: relative;
    margin-bottom: 1.75rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Allineamento verticale per elementi in riga */
.search-form-group-aligned {
    align-items: stretch;
    justify-content: flex-end;
}

/* Button wrapper centrato - Nuovo layout elegante */
.search-button-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Button centrato conforme Bootstrap Italia */
.search-form-button-centered {
    /* Dimensioni ottimali senza full-width */
    padding: 0.875rem 2rem;
    min-width: 180px;
    
    /* Typography conforme Bootstrap Italia */
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    
    /* Visual enhancement */
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.2);
    transition: all 0.15s ease-in-out;
    
    /* Bootstrap Italia gestisce automaticamente layout per .btn-icon */
}

.search-form-button-centered:hover {
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
    transform: translateY(-1px);
}

/* Le icone Bootstrap Italia nei pulsanti btn-icon sono gestite automaticamente */

/* === ACCESSIBILITÀ CONTROLLI DATA - KEYBOARD NAVIGATION === */

/* Focus indicators migliorati per controlli data */
.dxbl-dateedit.keyboard-focused,
.dxbl-dateedit:focus-within {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    border-radius: 0.375rem;
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Pulsante dropdown con focus keyboard */
.dxbl-dateedit .dxbl-editor-button:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 1px;
    background-color: var(--bs-primary-100);
}

/* Stati del calendario dropdown */
.dxbl-dateedit[aria-expanded="true"] {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Miglioramenti per screen reader */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Indicatori di accessibilità per controlli con icone */
.search-input-group .dxbl-dateedit.keyboard-focused .input-icon-left {
    color: var(--bs-primary);
    transform: scale(1.1);
    transition: all 0.2s ease;
}

/* Hover states per i controlli data */
.search-input-group .dxbl-dateedit:hover .input-icon-left {
    color: var(--bs-primary-600);
}

/* Miglioramenti responsive per controlli data */
@media (max-width: 767.98px) {
    .dxbl-dateedit.keyboard-focused {
        outline-width: 3px; /* Outline più spesso su mobile per migliore visibilità */
    }
    
    .dxbl-dateedit .dxbl-editor-button {
        min-width: 44px; /* Touch target size per WCAG */
        min-height: 44px;
    }
}

/* Supporto modalità High Contrast */
@media (prefers-contrast: high) {
    .dxbl-dateedit.keyboard-focused {
        outline: 3px solid;
        outline-color: Highlight;
    }
    
    .dxbl-dateedit .dxbl-editor-button:focus {
        outline: 2px solid;
        outline-color: Highlight;
        background: Highlight;
        color: HighlightText;
    }
}

/* Riduzione movimento per accessibilità */
@media (prefers-reduced-motion: reduce) {
    .dxbl-dateedit,
    .search-input-group * {
        transition: none !important;
        animation: none !important;
    }
}

/* === MENU SECTION STYLES - BOOTSTRAP ITALIA COMPLIANT === */

/* Contenitore principale del menu */
.menu-content-section {
    padding: 0 0 2rem 0;
    background-color: var(--bs-gray-50, #f8f9fa);
}

/* Lista degli elementi del menu */
.menu-items-wrapper {
    margin-bottom: 2rem;
}

.menu-items-wrapper .it-list-wrapper {
    background-color: var(--bs-white, #ffffff);
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

/* Elementi della lista */
.menu-items-wrapper .it-list .list-item {
    padding: 1rem 1.25rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
    border: 1px solid var(--bs-gray-200, #e5e5e5);
    margin-bottom: 0.75rem;
    background-color: var(--bs-white, #ffffff);
    text-decoration: none !important;
    display: flex;
    align-items: center;
    min-height: 4rem;
}

/* ⚡ RIMOZIONE SOTTOLINEATURE LINK LISTE - Design pulito Bootstrap Italia */
.it-list .list-item,
.it-list .list-item:link,
.it-list .list-item:visited,
.it-list .list-item:active,
.it-list .list-item:hover {
    text-decoration: none !important;
}

/* ⚡ FOCUS rimane visibile per accessibilità WCAG 2.1 AA */
.it-list .list-item:focus {
    text-decoration: none !important;
    /* Focus outline gestito da regole esistenti più sotto */
}

/* ⚡ TEMPLATE PERSONALIZZATI - Layout con Header semplificato ma senza Footer */
.custom-template {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.custom-template .pa-main-container.custom-layout {
    flex: 1;
    padding-top: 1rem;
}

/* ⚡ Header semplificato - Solo barra con burger */
.simplified-header {
    background-color: var(--bs-white);
    border-bottom: 1px solid var(--bs-gray-300);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 1000;
}

.simplified-header .it-nav-wrapper {
    padding: 0.75rem 0;
    min-height: auto;
}

.simplified-header .navbar {
    padding: 0;
}

.simplified-header .custom-navbar-toggler {
    background: none;
    border: 2px solid var(--bs-primary, #0066cc);
    border-radius: 0.375rem;
    padding: 0.5rem;
    color: var(--bs-primary, #0066cc);
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

.simplified-header .custom-navbar-toggler:hover,
.simplified-header .custom-navbar-toggler:focus {
    background-color: var(--bs-primary, #0066cc);
    color: var(--bs-white);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
    outline: none;
}

.simplified-header .custom-navbar-toggler .icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* ⚡ REGIONECALABRIA - Layout standard con header ma senza footer */
/* REGIONECALABRIA usa layout standard Bootstrap (menu a sinistra, content a destra) */
.custom-template.regionecalabria .row {
    display: flex;
    flex-wrap: wrap;
}

/* ⚡ Back to top posizionato senza footer */
.custom-template .back-to-top {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1040;
}

.menu-items-wrapper .it-list .list-item:hover {
    background-color: var(--bs-primary-100, #e6f3ff);
    border-color: var(--bs-primary-300, #7db8ff);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

.menu-items-wrapper .it-list .list-item:hover .it-rounded-icon {
    /* Bootstrap Italia: Sfondo hover più scuro come homepage */
    background: var(--bs-primary-600);
    border-color: var(--bs-gray-400);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 
                0 12px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.menu-items-wrapper .it-list .list-item:hover .it-rounded-icon .icon {
    /* Icone restano bianche su hover per contrasto */
    color: var(--bs-white) !important;
    fill: var(--bs-white) !important;
    stroke: var(--bs-white) !important;
}

.menu-items-wrapper .it-list .list-item:focus {
    outline: 2px solid var(--bs-primary, #0066cc);
    outline-offset: 2px;
    background-color: var(--bs-primary-100, #e6f3ff);
}

.menu-items-wrapper .it-list .list-item:focus-within .it-rounded-icon {
    /* WCAG 2.1 AA: Focus ring standard come homepage */
    outline: 2px solid var(--bs-focus-ring-color);
    outline-offset: 2px;
    border-color: var(--bs-primary);
    background: var(--bs-primary-700);
    box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

.menu-items-wrapper .it-list .list-item:focus-within .it-rounded-icon .icon {
    /* Icone bianche su sfondo scuro per contrasto ottimale */
    color: var(--bs-white) !important;
    fill: var(--bs-white) !important;
    stroke: var(--bs-white) !important;
}

/* Icone degli elementi - Allineate alla homepage */
.menu-items-wrapper .it-rounded-icon {
    /* Bootstrap Italia: Sfondo primario PA come homepage */
    background: var(--bs-primary);
    
    /* Bootstrap Italia: Bordo neutro sottile conforme */
    border: 2px solid var(--bs-gray-300);
    
    /* Dimensioni allineate alla homepage */
    min-width: 3.5rem;
    min-height: 3.5rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    
    /* Layout centrato con protezione shrinking */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 1rem;
    
    /* Bootstrap Italia: Ombra standard per componenti PA */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 
                0 8px 16px rgba(0, 0, 0, 0.1);
    
    /* Transizione standard Bootstrap Italia */
    transition: all 0.15s ease-in-out;
}

.menu-items-wrapper .it-rounded-icon .icon {
    /* Bootstrap Italia: Icone bianche su sfondo primario (come homepage) */
    color: var(--bs-white) !important;
    fill: var(--bs-white) !important;
    stroke: var(--bs-white) !important;
    
    /* Dimensioni stabili allineate alla homepage */
    width: 1.5rem !important;
    height: 1.5rem !important;
    min-width: 1.5rem;
    min-height: 1.5rem;
    flex-shrink: 0;
    
    /* Mantieni proporzioni originali */
    object-fit: contain;
}

/* Area del testo */
.menu-items-wrapper .it-right-zone {
    flex: 1;
    min-width: 0;
}

.menu-items-wrapper .it-right-zone .text {
    font-weight: 500;
    font-size: 1rem;
    color: var(--bs-body-color, #17324d);
    line-height: 1.4;
    word-wrap: break-word;
}

/* Sezione ricerca */
.search-section {
    padding: 1.5rem 0;
    border-top: 1px solid var(--bs-gray-200, #e5e5e5);
    background-color: var(--bs-white, #ffffff);
}

/* Loading states per menu */
.loading-container {
    background-color: var(--bs-gray-50, #f8f9fa);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spinner Bootstrap Italia per menu */
.progress-spinner {
    border: 3px solid var(--bs-gray-300, #dee2e6);
    border-top: 3px solid var(--bs-primary, #0066cc);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: inline-block;
}

.progress-spinner.progress-spinner-active {
    animation: spin 1s linear infinite;
}

.progress-spinner.size-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design per menu - Allineato alla homepage */
@media (max-width: 767.98px) {
    .menu-content-section {
        padding: 1rem 0;
    }
    
    .menu-items-wrapper .it-list .list-item {
        padding: 0.75rem 1rem;
        min-height: 3.5rem;
    }
    
    .menu-items-wrapper .it-rounded-icon {
        /* Dimensioni ridotte ma allineate alla homepage */
        min-width: 3rem;
        min-height: 3rem;
        width: 3rem;
        height: 3rem;
        margin-right: 0.75rem;
    }
    
    .menu-items-wrapper .it-rounded-icon .icon {
        /* Icone proporzionalmente ridotte come homepage */
        width: 1.25rem !important;
        height: 1.25rem !important;
        min-width: 1.25rem;
        min-height: 1.25rem;
    }
    
    .menu-items-wrapper .it-right-zone .text {
        font-size: 0.9rem;
    }
}

/* Accessibilità migliorata per menu */
@media (prefers-reduced-motion: reduce) {
    .menu-items-wrapper .it-list .list-item {
        transition: none;
    }
    
    .menu-items-wrapper .it-list .list-item:hover {
        transform: none;
    }
    
    .progress-spinner.progress-spinner-active {
        animation: none;
        border-top-color: var(--bs-success, #198754);
    }
}

/* High contrast mode per menu */
@media (prefers-contrast: high) {
    .menu-items-wrapper .it-list .list-item {
        border-width: 2px;
    }
    
    .menu-items-wrapper .it-list .list-item:focus {
        outline-width: 3px;
    }
}

/* === BACK TO TOP - BOOTSTRAP ITALIA STANDARD === */
/* Bootstrap Italia gestisce automaticamente gli stili del back-to-top */
/* Sovrascriviamo solo le proprietà necessarie per il nostro layout */

.back-to-top {
    /* Posizionamento fisso in basso a destra */
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    z-index: 1050 !important;
}

/* Responsive positioning */
@media (max-width: 767.98px) {
    .back-to-top {
        bottom: 1.5rem !important;
        right: 1.5rem !important;
    }
}

@media (max-width: 575.98px) {
    .back-to-top {
        bottom: 1rem !important;
        right: 1rem !important;
    }
}

/* === MENU SEARCH STYLES - BOOTSTRAP ITALIA === */

/* Stili specifici per Menu/Filtro */
.menu-search-card {
    background-color: var(--bs-white, #ffffff);
    border: 1px solid var(--bs-gray-200, #e5e5e5);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.menu-search-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bs-gray-200, #e5e5e5);
}

.menu-search-header h3 {
    margin-bottom: 0.5rem;
    color: var(--bs-body-color, #17324d);
    font-size: 1.25rem;
    font-weight: 600;
}

.menu-search-subtitle {
    color: var(--bs-text-muted, #6c757d);
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.4;
}

.menu-search-form-group {
    margin-bottom: 1rem;
}

.menu-search-form-group .form-label {
    font-weight: 500;
    color: var(--bs-body-color, #17324d);
    margin-bottom: 0.5rem;
}

.menu-search-button-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.menu-search-form-button {
    padding: 0.75rem 2rem;
    min-width: 140px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.2);
    transition: all 0.15s ease-in-out;
}

.menu-search-form-button:hover {
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
    transform: translateY(-1px);
}

/* Risultati ricerca Menu */
.menu-search-results {
    margin-top: 2rem;
}

.menu-search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bs-primary, #0066cc);
}

.menu-search-results-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    color: var(--bs-primary, #0066cc);
    font-size: 1.25rem;
    font-weight: 600;
}

.menu-search-results-count {
    color: var(--bs-text-muted, #6c757d);
    font-size: 0.95rem;
    margin-bottom: 0;
}

.menu-search-grid-controls {
    background-color: var(--bs-gray-50, #f8f9fa);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.menu-search-results-table-container {
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.menu-search-results-table {
    margin-bottom: 0;
}

.menu-search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: var(--bs-gray-50, #f8f9fa);
    border-radius: 0.375rem;
    margin-top: 1rem;
}

.menu-search-loading-text {
    font-weight: 500;
    color: var(--bs-primary, #0066cc);
    margin-bottom: 0.5rem;
}

.spinner-modern {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--bs-gray-300, #dee2e6);
    border-top: 3px solid var(--bs-primary, #0066cc);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* Responsive per Menu/Filtro */
@media (max-width: 767.98px) {
    .menu-search-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .menu-search-header {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .menu-search-form-button {
        padding: 0.625rem 1.5rem;
        min-width: 120px;
    }
    
    .menu-search-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .menu-search-grid-controls {
        padding: 0.75rem;
    }
    
    .menu-search-grid-controls .row {
        --bs-gutter-x: 0.75rem;
    }
}

/* === SEARCH ACCORDION STYLES - BOOTSTRAP ITALIA === */

/* Accordion ricerca nella homepage */
.search-section .accordion-button {
    color: var(--bs-body-color, #17324d);
    font-size: 1.125rem;
    box-shadow: none;
}

.search-section .accordion-button:focus {
    border-color: var(--bs-primary, #0066cc);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.search-section .accordion-button:not(.collapsed) {
    background-color: transparent;
    color: var(--bs-primary, #0066cc);
}

/* Ripristina l'icona Bootstrap originale con stile personalizzato */
.search-section .accordion-button::after {
    background-size: 1rem;
    color: var(--bs-primary, #0066cc);
}

/* Responsive accordion ricerca */
@media (max-width: 767.98px) {
    .search-section .accordion-button {
        font-size: 1rem;
        padding: 0.75rem 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    .search-input-group .dxbl-dateedit .input-icon-left,
    .dxbl-dateedit .dxbl-editor-button {
        transition: none;
    }
    
    .search-input-group .dxbl-dateedit.keyboard-focused .input-icon-left {
        transform: none;
    }
}

.search-form-group .form-label {
    font-weight: 600;
    color: var(--tree-text-color);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    transition: var(--search-transition);
}

/* Input Groups con icone - Layout corretto */
.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

/* Icona posizionata PRIMA dell'input per layout corretto - Migliorata leggibilità */
.search-input-group .input-icon-left {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-primary); /* Colore primario per maggiore visibilità */
    z-index: 10; /* Z-index alto per evitare sovrapposizioni */
    transition: var(--search-transition);
    pointer-events: none;
    width: 1.25rem; /* Dimensione maggiore per migliore leggibilità */
    height: 1.25rem;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 102, 204, 0.2)); /* Ombra sottile per contrasto */
}

/* Stili per i campi con icona a sinistra */
.search-input-group .input-with-icon-left,
.search-input-group input[type="date"].input-with-icon-left,
.search-input-group .form-select.input-with-icon-left {
    padding-left: 3.25rem !important; /* Spazio sufficiente per icona + margin */
}

/* Stili base per tutti i form controls - Touch-friendly dimensions */
.search-input-group .form-control,
.search-input-group .input-with-icon-left,
.search-input-group input[type="date"],
.search-input-group .form-select {
    border: 2px solid var(--search-input-border);
    border-radius: 0.5rem;
    background-color: var(--search-input-bg);
    transition: var(--search-transition);
    font-size: 0.95rem;
    min-height: 3rem; /* 48px - Touch-friendly standard */
    width: 100%;
}

/* Stili specifici per input date HTML5 */
.search-input-group input[type="date"] {
    color: var(--tree-text-color);
    font-family: inherit;
}

.search-input-group input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    right: 1rem;
    color: var(--bs-primary);
    cursor: pointer;
    filter: none;
}

.search-input-group input[type="date"]:focus::-webkit-calendar-picker-indicator {
    color: var(--search-focus-color);
}

/* Focus states corretti */
.search-input-group .form-control:focus,
.search-input-group .input-with-icon-left:focus-within,
.search-input-group input[type="date"]:focus,
.search-input-group .form-select:focus {
    border-color: var(--search-focus-color) !important;
    box-shadow: var(--search-focus-shadow) !important;
    background-color: #fff;
    outline: none;
}

/* Animazione icona su focus - selettore corretto */
.search-input-group:focus-within .input-icon-left,
.search-input-group .input-with-icon-left:focus-within ~ .input-icon-left {
    color: var(--search-focus-color);
    transform: translateY(-50%) scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(0, 102, 204, 0.4));
}

/* Hover effect per icona */
.search-input-group:hover .input-icon-left {
    color: var(--bs-primary-600, #0052a3);
    transform: translateY(-50%) scale(1.05);
    filter: drop-shadow(0 1px 3px rgba(0, 102, 204, 0.3));
    transition: var(--search-transition);
}

/* Z-index per icone */
.search-input-group .input-icon-left {
    z-index: 15 !important;
}

/* Help text moderno */
.search-help-text {
    font-size: 0.8rem;
    color: var(--tree-muted-color);
    margin-top: 0.375rem;
    font-style: italic;
    opacity: 0.85;
}

/* Button Bootstrap Italia Standard - Form di Ricerca */
.search-form-button.btn-primary {
    /* Utilizzare colori Bootstrap Italia nativi */
    background-color: var(--bs-primary, #0066cc);
    border-color: var(--bs-primary, #0066cc);
    border-radius: var(--bs-border-radius, 0.375rem);
    
    /* Typography conforme al design system */
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    
    /* Spacing standard Bootstrap Italia */
    padding: 0.75rem 1.5rem;
    
    /* Shadow sottile conforme al design system */
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.15);
    
    /* Transizione standard Bootstrap */
    transition: all 0.15s ease-in-out;
    
    /* Dimensioni touch-friendly */
    min-height: 3rem; /* 48px */
}

.search-form-button.btn-primary:hover {
    /* Hover conforme Bootstrap Italia */
    background-color: var(--bs-primary-600, #0052a3);
    border-color: var(--bs-primary-600, #0052a3);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.2);
    
    /* NO transform - mantiene consistenza design system */
    transform: none;
}

.search-form-button.btn-primary:focus,
.search-form-button.btn-primary:focus-visible {
    /* Focus conforme WCAG e Bootstrap Italia */
    background-color: var(--bs-primary-600, #0052a3);
    border-color: var(--bs-primary-600, #0052a3);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
    outline: none;
}

.search-form-button.btn-primary:active {
    /* Active state Bootstrap Italia */
    background-color: var(--bs-primary-700, #004080);
    border-color: var(--bs-primary-700, #004080);
    box-shadow: 0 1px 2px rgba(0, 102, 204, 0.2);
    transform: none;
}

/* Loading State Moderno */
.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed var(--bs-primary-200, #cce7ff);
}

.search-loading .spinner-modern {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--bs-primary-100, #e6f3ff);
    border-top: 3px solid var(--bs-primary);
    border-radius: 50%;
    animation: spin-modern 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin-right: 0.75rem;
}

@keyframes spin-modern {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

.search-loading-text {
    font-weight: 600;
    color: var(--tree-text-color);
}

/* Sezione Risultati Moderna */
.search-results {
    margin-top: 2rem;
    width: 100%;
    max-width: 100%;
    overflow-x: auto; /* Scroll orizzontale su schermi piccoli se necessario */
}

.search-results-header {
    background: linear-gradient(135deg, var(--bs-success-100, #d1e7dd) 0%, var(--bs-info-100, #cff4fc) 100%);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--bs-success-200, #a3cfbb);
    position: relative;
    overflow: hidden;
}

.search-results-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--bs-success), var(--bs-info));
}

.search-results-header h3 {
    color: var(--tree-text-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.search-results-header .icon {
    margin-right: 0.5rem;
    color: var(--bs-success);
}

.search-results-count {
    color: var(--tree-muted-color);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Grid risultati nativa Bootstrap Italia - Larghezza 100% */
.search-results-table-container {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: var(--search-card-shadow);
    border: 1px solid var(--bs-gray-200, #e9ecef);
    width: 100% !important;
    max-width: 100% !important;
}

.search-results-table {
    margin-bottom: 0;
    width: 100% !important;
    table-layout: fixed; /* Forza il rispetto delle larghezze definite */
}

/* Gestione celle per layout fisso e testi lunghi */
.search-date-cell {
    vertical-align: top;
    padding: 1rem 0.75rem;
    width: 20%; /* Larghezza fissa per data */
}

.search-content-cell {
    vertical-align: top;
    padding: 1rem 0.75rem;
    max-width: 0; /* Forza rispetto table-layout fixed */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    width: 60%; /* Larghezza fissa per contenuto */
}

.search-action-cell {
    vertical-align: middle;
    padding: 1rem 0.75rem;
    width: 150px; /* Larghezza fissa minima per mantenere pulsanti visibili */
    min-width: 150px;
    max-width: 150px;
    white-space: nowrap;
}

/* Gestione contenuti lunghi all'interno delle celle */
.search-result-content {
    width: 100%;
    overflow: hidden;
}

.search-result-description,
.search-result-additional {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.5;
    /* Per URL e testi molto lunghi senza spazi */
    overflow-wrap: anywhere;
}

/* Stile per URL lunghi e testi che si spezzano */
.search-result-description a,
.search-result-additional a {
    word-break: break-all;
    color: var(--bs-primary);
    text-decoration: none;
}

.search-result-description a:hover,
.search-result-additional a:hover {
    text-decoration: underline;
}

/* Pulsante azioni sempre visibile e centrato */
.search-detail-button {
    white-space: nowrap;
    min-width: auto;
    padding: 0.375rem 0.75rem;
}

.search-results-table thead th {
    background: linear-gradient(135deg, var(--bs-primary-100, #e6f3ff) 0%, var(--bs-primary-200, #cce7ff) 100%);
    border-bottom: 2px solid var(--bs-primary-300, #99ccff);
    color: var(--tree-text-color);
    font-weight: 600;
    padding: 1rem 0.75rem;
    vertical-align: top;
}

.search-results-table tbody tr {
    transition: var(--search-transition);
}

.search-results-table tbody tr:hover {
    background-color: var(--bs-primary-50, #f0f8ff);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

/* Celle specifiche */
.search-date-cell {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--bs-gray-700);
    white-space: nowrap;
    vertical-align: top;
    padding: 1rem 0.75rem;
}

.search-content-cell {
    vertical-align: top;
    padding: 1rem 0.75rem;
}

.search-action-cell {
    vertical-align: middle;
    padding: 1rem 0.75rem;
}

/* Controlli griglia */
.search-grid-controls {
    background: var(--bs-gray-50);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid var(--bs-gray-200);
}

/* Paginazione Bootstrap Italia */
.pagination .page-link {
    color: var(--bs-primary);
    border-color: var(--bs-gray-300);
    transition: var(--search-transition);
}

.pagination .page-link:hover {
    color: var(--bs-primary-700);
    background-color: var(--bs-primary-100);
    border-color: var(--bs-primary-300);
}

.pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.pagination .page-item.disabled .page-link {
    color: var(--bs-gray-500);
    background-color: var(--bs-gray-100);
    border-color: var(--bs-gray-300);
}

/* Responsive per tablet - ottimizza larghezze senza nascondere colonne */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .search-action-cell {
        width: 130px;
        min-width: 130px;
        max-width: 130px;
    }
    
    .search-detail-button {
        font-size: 0.875rem;
        padding: 0.25rem 0.5rem;
    }
    
    .search-detail-button span {
        display: none; /* Mostra solo icona su tablet per risparmiare spazio */
    }
}

/* Responsive per tabella nativa */
@media (max-width: 767.98px) {
    .search-results-table {
        font-size: 0.875rem;
    }
    
    .search-results-table thead th,
    .search-results-table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .search-grid-controls {
        padding: 0.75rem;
    }
    
    .search-grid-controls .row {
        --bs-gutter-x: 0.5rem;
    }
    
    .search-grid-controls .col-md-6 {
        margin-bottom: 0.5rem;
    }
    
    /* Nasconde colonna data su mobile molto piccolo */
    .search-results-table .search-date-cell {
        display: none;
    }
    
    .search-results-table th:first-child {
        display: none;
    }
    
    /* Adatta larghezze colonne per mobile */
    .search-content-cell {
        width: 70% !important;
    }
    
    .search-action-cell {
        width: 30% !important;
        min-width: 120px;
        max-width: 120px;
    }
}

@media (max-width: 575.98px) {
    .pagination {
        justify-content: center !important;
        flex-wrap: wrap;
    }
    
    .pagination .page-item {
        margin: 0.125rem;
    }
}

.search-results-grid .dxbl-grid-header {
    background: linear-gradient(135deg, var(--bs-gray-100, #f8f9fa) 0%, var(--bs-gray-200, #e9ecef) 100%);
    border-bottom: 2px solid var(--bs-primary-200, #cce7ff);
}

.search-results-grid .dxbl-grid-header-cell {
    font-weight: 600;
    color: var(--tree-text-color);
    padding: 1rem 0.75rem;
    border-right: 1px solid var(--bs-gray-300, #dee2e6);
}

.search-results-grid .dxbl-grid-row:hover {
    background-color: var(--bs-primary-50, #f0f8ff);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.search-results-grid .btn-primary {
    background: var(--search-gradient);
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--search-transition);
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.2);
}

.search-results-grid .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

/* CSS per layout delle celle risultati */
.search-result-content {
    padding: 0.5rem 0;
    line-height: 1.5;
}

/* Formattazione colonna data pubblicazione */
.search-results-grid [data-column-name="DATAPUBBLICAZIONE"] .dxbl-grid-cell {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--bs-gray-700);
    white-space: nowrap;
}
.search-result-section {
    display: flex;
    align-items: center;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
}
.search-result-section .icon {
    flex-shrink: 0;
    color: var(--bs-primary);
}
.search-result-description {
    font-size: 0.9rem;
    color: var(--tree-text-color);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}
.search-result-additional {
    font-size: 0.825rem;
    line-height: 1.3;
}
/* Pulsante dettagli conforme Bootstrap Italia .btn-sm */
.search-detail-button {
    /* Bootstrap Italia .btn-sm gestisce automaticamente dimensioni e spacing */
    font-weight: 500;
}
.search-detail-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
}
.search-detail-button:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Miglioramenti UX per celle risultati */
.search-result-content:hover .search-result-section .icon {
    color: var(--bs-primary-600);
    transform: scale(1.1);
    transition: all 0.2s ease;
}
.search-result-description {
    cursor: text;
    transition: color 0.2s ease;
}
.search-results-grid .dxbl-grid-row:hover .search-result-description {
    color: var(--bs-primary-700);
}

/* Breakpoint Intermedio - Tablet Large (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .search-input-group .form-control,
    .search-input-group .dxbl-editor,
    .search-input-group .input-with-icon-left {
        min-height: 3.125rem; /* 50px */
        font-size: 0.975rem;
    }
    
    .search-form-group {
        margin-bottom: 1.625rem;
    }
}

/* Tablet Standard (768px - 991px) */  
@media (min-width: 768px) and (max-width: 991.98px) {
    .search-card {
        padding: 1.5rem;
        margin: 0 -0.5rem;
        border-radius: 0.5rem;
    }
    
    .search-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: center;
        padding-bottom: 1.5rem;
    }
    
    .search-header .icon {
        margin-bottom: 0.5rem;
        align-self: center;
    }
    
    .search-form-group {
        margin-bottom: 1.5rem;
    }
    
    .search-input-group .form-control,
    .search-input-group .dxbl-editor,
    .search-input-group .input-with-icon-left {
        min-height: 3.25rem; /* 52px - Tablet touch-friendly */
        font-size: 1rem;
    }
    
    .search-form-button-centered {
        padding: 1rem 2.5rem;
        font-size: 1rem;
        min-height: 3.25rem; /* 52px - Tablet touch-friendly */
        min-width: 200px;
    }
    
    .search-button-wrapper {
        margin-top: 1.25rem;
    }
}

/* Mobile (≤767px) */
@media (max-width: 767.98px) {
    .search-card {
        padding: 1.25rem;
        margin: 0 -0.5rem;
        border-radius: 0.5rem;
    }
    
    /* Grid risultati responsive per mobile */
    .search-results-grid .dxbl-grid-cell {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .search-results-grid .dxbl-grid-header-cell {
        padding: 1rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Ottimizzazione colonne su tablet e mobile - Proporzioni 100% */
    .search-results-grid [data-column-name="DATAPUBBLICAZIONE"] {
        min-width: 140px !important;
        width: 18% !important;
    }
    
    .search-results-grid [data-column-name="Dettagli"] {
        width: 64% !important;
        min-width: 250px !important;
    }
    
    .search-results-grid [data-column-name="buttonDettagli"] {
        min-width: 120px !important;
        width: 18% !important;
    }
    
    .search-result-content {
        padding: 0.375rem 0;
    }
    
    .search-result-section {
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }
    
    .search-result-description {
        font-size: 0.825rem;
    }
    
    .search-result-additional {
        font-size: 0.75rem;
    }
    
    .search-detail-button {
        /* Bootstrap Italia .btn-sm si adatta automaticamente, aggiungiamo solo touch-friendly */
        min-height: 2.5rem; /* Touch-friendly per mobile */
    }
    
    .search-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-bottom: 1.5rem;
    }
    
    .search-header .icon {
        margin-bottom: 0.75rem;
    }
    
    .search-form-group {
        margin-bottom: 1.25rem;
    }
    
    .search-input-group .form-control,
    .search-input-group .dxbl-editor,
    .search-input-group .input-with-icon-left {
        min-height: 3.5rem; /* 56px - Mobile touch-friendly */
        font-size: 1.1rem;
        border-radius: 0.75rem;
    }
    
    .search-form-button-centered {
        min-height: 3.5rem; /* 56px - Mobile touch-friendly */
        font-size: 1.1rem;
        padding: 1.125rem 2.5rem;
        border-radius: 0.75rem;
        min-width: 220px;
    }
    
    .search-button-wrapper {
        margin-top: 1rem;
    }
    
    /* Form groups stack naturally on mobile */
    .search-form-group-aligned {
        align-items: stretch;
        justify-content: stretch;
    }
}

/* Mobile Small (≤575px) - Full width layout */
@media (max-width: 575.98px) {
    .search-card {
        padding: 1rem;
        margin: 0 -0.75rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    /* Button centrato per mobile small - dimensioni ottimizzate */
    .search-form-button-centered {
        min-height: 3.75rem; /* 60px - Ottimale per mobile small */
        font-size: 1.05rem;
        padding: 1.25rem 2rem;
        border-radius: 0.5rem;
        min-width: 200px;
        max-width: calc(100vw - 4rem); /* Responsive width con margini */
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .search-button-wrapper {
        margin-top: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    /* Grid risultati ottimizzata per mobile small */
    .search-results-grid .dxbl-grid-cell {
        padding: 0.5rem 0.375rem;
        font-size: 0.8rem;
    }
    
    .search-results-grid .dxbl-grid-header-cell {
        padding: 0.75rem 0.375rem;
        font-size: 0.75rem;
    }
    
    /* Ottimizzazione colonne per schermi molto piccoli - Full width */
    .search-results-grid [data-column-name="DATAPUBBLICAZIONE"] {
        min-width: 110px !important;
        width: 20% !important;
    }
    
    .search-results-grid [data-column-name="Dettagli"] {
        width: 60% !important;
        min-width: 200px !important;
    }
    
    .search-results-grid [data-column-name="buttonDettagli"] {
        min-width: 100px !important;
        width: 20% !important;
    }
    
    /* Nascondere la colonna data su schermi extra piccoli per massimizzare spazio */
    @media (max-width: 480px) {
        .search-results-grid [data-column-name="DATAPUBBLICAZIONE"] {
            display: none !important;
        }
        
        .search-results-grid [data-column-name="Dettagli"] {
            width: 75% !important;
            min-width: 180px !important;
        }
        
        .search-results-grid [data-column-name="buttonDettagli"] {
            min-width: 90px !important;
            width: 25% !important;
        }
    }
    
    .search-result-content {
        padding: 0.25rem 0;
    }
    
    .search-result-section {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
    }
    
    .search-result-description {
        font-size: 0.775rem;
        line-height: 1.3;
    }
    
    .search-result-additional {
        font-size: 0.7rem;
    }
    
    .search-detail-button {
        /* Bootstrap Italia .btn-sm con ottimizzazione mobile small */
        min-height: 2.75rem; /* Touch-friendly ottimale per schermi piccoli */
    }
    
    /* Icone responsive per mobile small */
    .search-input-group .input-icon-left {
        left: 1.25rem;
        width: 1.125rem;
        height: 1.125rem;
    }
    
    /* Padding aumentato per mobile small touch-friendly */
    .search-input-group .input-with-icon-left,
    .search-input-group .input-with-icon-left .dxbl-editor,
    .search-input-group .input-with-icon-left .dxbl-textbox,
    .search-input-group .input-with-icon-left .dxbl-combobox,
    .search-input-group .input-with-icon-left .dxbl-dateedit {
        padding-left: 4rem !important;
    }
    
    .search-input-group .dxbl-editor .dxbl-edit-area,
    .search-input-group .dxbl-textbox .dxbl-edit-area,
    .search-input-group .dxbl-combobox .dxbl-edit-area,
    .search-input-group .dxbl-dateedit .dxbl-edit-area {
        padding-left: 4rem !important;
    }
    
    .search-input-group .dxbl-editor input,
    .search-input-group .dxbl-textbox input,
    .search-input-group .dxbl-combobox input,
    .search-input-group .dxbl-dateedit input {
        padding-left: 4rem !important;
    }
    
    /* Override dimensions for mobile small */
    .search-input-group .form-control,
    .search-input-group .dxbl-editor,
    .search-input-group .input-with-icon-left {
        min-height: 3.75rem; /* 60px - Extra touch-friendly */
        font-size: 1.125rem;
        border-radius: 0.875rem;
    }
    
    .search-form-button.btn-primary {
        min-height: 3.75rem; /* 60px - Extra touch-friendly */
        font-size: 1.125rem;
        padding: 1.25rem 1.5rem;
        border-radius: 0.875rem;
    }
    
    .search-results-header {
        padding: 1rem;
        border-radius: 0.5rem;
    }
    
    .search-results-grid {
        border-radius: 0.5rem;
    }
    
    /* Form groups even more compact on small mobile */
    .search-form-group {
        margin-bottom: 1rem;
    }
}

/* Supporto modalità scura */
@media (prefers-color-scheme: dark) {
    .search-card {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        border-color: #404040;
    }
    
    .search-input-group .form-control,
    .search-input-group .dxbl-editor {
        background-color: #2d2d2d;
        border-color: #404040;
        color: #e9ecef;
    }
    
    .search-results-header {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        border-color: #404040;
    }
}

/* Movimento ridotto per accessibilità */
@media (prefers-reduced-motion: reduce) {
    .search-card,
    .search-button,
    .search-input-group .form-control,
    .search-input-group .dxbl-editor,
    .search-results-grid .dxbl-grid-row {
        transition: none;
    }
    
    .search-card:hover {
        transform: none;
    }
    
    .search-button:hover {
        transform: none;
    }
    
    .spinner-modern {
        animation: none;
    }
}

/* Loading overlay */
.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--bs-gray-600);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073e6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filtro e controlli espansione */
.filter-panel {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

/* Controlli espansione accessibili */
.tree-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tree-controls .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.tree-controls .btn:focus {
    outline: 2px solid var(--bs-warning);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.25);
}

.tree-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tree-controls .btn[aria-pressed="true"] {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

/* Simboli nei pulsanti con dimensioni accessibili */
.tree-controls .btn span[aria-hidden] {
    font-weight: bold;
    margin-right: 0.25rem;
    font-size: 0.875rem;
}

/* Tree container */
.accessible-tree {
    padding: 0.5rem 0;
    outline: none;
}

.accessible-tree:focus {
    outline: 2px solid var(--bs-primary);
    outline-offset: -2px;
}

/* Tree Node Base - usa Bootstrap Italia nativo */
.tree-node {
    display: block;
    position: relative;
    cursor: pointer;
    border-radius: 0.375rem; /* Bootstrap standard */
    margin: 1px 0;
    padding: 0;
    border: 1px solid transparent;
    color: var(--tree-text-color);
    background-color: transparent;
    transition: all 0.15s ease-in-out; /* Bootstrap standard */
}

/* Reset inheritance per figli */
.tree-node * {
    color: inherit;
    background-color: inherit;
}

/* Stati base per tutti i nodi */
.tree-node,
.tree-node.selected .tree-children .tree-node {
    background-color: transparent;
    color: var(--tree-text-color);
    border-color: transparent;
}

/* Hover per nodi non selezionati */
.tree-node:not(.selected):hover,
.tree-node.selected .tree-children .tree-node:hover {
    background-color: var(--tree-hover-bg) !important;
    color: var(--bs-primary) !important;
    border-color: var(--bs-primary-200, rgba(0, 102, 204, 0.3)) !important;
}

/* Focus per nodi non selezionati */
.tree-node:not(.selected):focus,
.tree-node.selected .tree-children .tree-node:focus {
    outline: 2px solid var(--bs-warning) !important;
    outline-offset: 2px;
    background-color: var(--bs-warning-100, #fff3cd) !important;
    color: var(--bs-warning-800, #664d03) !important;
}

/* Solo il nodo DIRETTAMENTE selezionato */
.tree-node.selected:not(.tree-node.selected .tree-children .tree-node) {
    background-color: var(--tree-selected-bg) !important;
    color: white !important;
    border-color: var(--bs-primary-700, #004080) !important;
}

.tree-node.selected:not(.tree-node.selected .tree-children .tree-node):hover {
    background-color: var(--tree-selected-hover-bg) !important;
    color: white !important;
    border-color: var(--bs-primary-800, #003366) !important;
}

/* === ICONE AGGIORNATE BOOTSTRAP ITALIA === */

/* Contenuto del nodo */
.tree-node-content {
    display: flex;
    align-items: flex-start;
    padding: 0.4rem 0.5rem;
    min-height: 2rem;
    gap: 0.25rem;
}

/* Indentazione */
.tree-indent {
    display: inline-block;
    flex-shrink: 0;
}

/* Icone espansione - Bootstrap Italia nativo */
.tree-expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem; /* 24px in rem */
    height: 1.5rem;
    margin-right: 0.25rem;
    margin-top: 0.125rem; /* Allinea con prima riga testo */
    cursor: pointer;
    color: var(--bs-primary);
    font-weight: 600;
    border-radius: 0.25rem;
    flex-shrink: 0;
    transition: all 0.15s ease-in-out;
    border: 1px solid transparent;
    background-color: transparent;
}

/* Default per tutte le frecce */
.tree-expand-icon,
.tree-node.selected .tree-children .tree-expand-icon {
    color: var(--bs-primary) !important;
    background-color: transparent !important;
    border-color: transparent !important;
}

/* Hover per frecce su nodi non selezionati */
.tree-expand-icon:hover,
.tree-node.selected .tree-children .tree-expand-icon:hover {
    background-color: var(--bs-primary-100, #e6f3ff) !important;
    border-color: var(--bs-primary-300, #99ccff) !important;
    color: var(--bs-primary-700, #004080) !important;
    transform: scale(1.05);
}

/* Focus per frecce */
.tree-expand-icon:focus {
    outline: 2px solid var(--bs-warning) !important;
    outline-offset: 2px;
}

/* Solo per frecce del nodo direttamente selezionato */
.tree-node.selected:not(.tree-node.selected .tree-children .tree-node) > .tree-node-content .tree-expand-icon {
    color: rgba(255, 255, 255, 0.9) !important;
}

.tree-node.selected:not(.tree-node.selected .tree-children .tree-node) > .tree-node-content .tree-expand-icon:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: white !important;
}

.tree-leaf-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.25rem;
    margin-top: 0.125rem; /* Allinea con prima riga testo */
    color: var(--tree-muted-color);
    flex-shrink: 0;
}

/* Default per tutte le icone leaf */
.tree-leaf-icon,
.tree-node.selected .tree-children .tree-leaf-icon {
    color: var(--tree-muted-color) !important;
}

/* Solo per icone leaf del nodo direttamente selezionato */
.tree-node.selected:not(.tree-node.selected .tree-children .tree-node) > .tree-node-content .tree-leaf-icon {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Testo del nodo - Override forzato per evitare conflitti CSS */
.accessible-tree .tree-node-text {
    flex: 1 !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    text-overflow: unset !important;
    overflow: visible !important;
    line-height: 1.3 !important;
}

/* Override aggiuntivo per possibili classi Bootstrap conflittuali */
.accessible-tree .tree-node-text.text-truncate,
.accessible-tree .tree-node-text.text-nowrap {
    white-space: normal !important;
    text-overflow: unset !important;
    overflow: visible !important;
}

/* Figli - ora sono fuori dal parent DOM per evitare event bubbling */
.tree-children {
    padding-left: 1rem; /* Indentazione per figli */
    margin-left: 0;
}

/* Livelli di indentazione */
.tree-node.level-0 .tree-node-content { padding-left: 0.5rem; }
.tree-node.level-1 .tree-node-content { padding-left: 1rem; }
.tree-node.level-2 .tree-node-content { padding-left: 1.5rem; }
.tree-node.level-3 .tree-node-content { padding-left: 2rem; }
.tree-node.level-4 .tree-node-content { padding-left: 2.5rem; }

/* Evidenziazione risultati di ricerca */
.tree-node.search-match .tree-node-text {
    background-color: var(--bs-warning-100, #fff3cd);
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* Ottimizzazioni responsive per testo multi-riga */
@media (max-width: 767.98px) {
    .accessible-tree .tree-node-content {
        padding: 0.3rem 0.4rem;
        gap: 0.2rem;
    }
    
    .accessible-tree .tree-node-text {
        line-height: 1.25 !important;
        font-size: 0.9rem !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        text-overflow: unset !important;
        overflow: visible !important;
    }
    
    .accessible-tree .tree-expand-icon,
    .accessible-tree .tree-leaf-icon {
        width: 1.25rem;
        height: 1.25rem;
        margin-top: 0.1rem;
    }
}

/* Tablet sizing */
@media (min-width: 768px) and (max-width: 991.98px) {
    .accessible-tree .tree-node-text {
        line-height: 1.35 !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        text-overflow: unset !important;
        overflow: visible !important;
    }
}

/* Alto contrasto - lascia che Bootstrap Italia gestisca */
@media (prefers-contrast: high) {
    .tree-node:focus {
        outline-width: 3px !important;
    }
    
    .tree-expand-icon:focus {
        outline-width: 3px !important;
    }
}


/* Movimento ridotto - Bootstrap Italia gestisce già le transizioni */
@media (prefers-reduced-motion: reduce) {
    .loading-spinner {
        animation: none;
        border-top-color: transparent;
    }
}

/* ============================================================================
   CONTATORE VISITE - Bootstrap Italia PA Conforme
   ============================================================================ */

/* Container principale del contatore */
.contatore-visite-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

/* Badge del contatore */
.contatore-visite-badge {
    display: inline-flex;
    align-items: center;
    background: var(--bs-primary, #0066cc);
    color: var(--bs-white, #ffffff);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
    transition: all 0.2s ease;
    min-height: 2.25rem;
    white-space: nowrap;
}

/* Hover effect */
.contatore-visite-badge:hover {
    background: var(--bs-primary-600, #0056b3);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
    transform: translateY(-1px);
}

/* Testo descrittivo */
.contatore-visite-text {
    margin-right: 0.375rem;
    opacity: 0.9;
}

/* Numero delle visite */
.contatore-visite-number {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.025em;
}

/* Responsive design */
@media (max-width: 767.98px) {
    .contatore-visite-badge {
        font-size: 0.8125rem;
        padding: 0.4375rem 0.875rem;
        min-height: 2rem;
    }
    
    .contatore-visite-number {
        font-size: 0.8125rem;
    }
    
    .contatore-visite-badge .icon {
        width: 0.875rem;
        height: 0.875rem;
    }
}

/* Alto contrasto */
@media (prefers-contrast: high) {
    .contatore-visite-badge {
        border: 2px solid var(--bs-white, #ffffff);
        box-shadow: 0 0 0 2px var(--bs-primary, #0066cc);
    }
    
    .contatore-visite-badge:hover {
        border-color: var(--bs-primary-600, #0056b3);
        box-shadow: 0 0 0 2px var(--bs-primary-600, #0056b3);
    }
}

/* Movimento ridotto */
@media (prefers-reduced-motion: reduce) {
    .contatore-visite-badge {
        transition: none;
    }
    
    .contatore-visite-badge:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .contatore-visite-container {
        display: none;
    }
}

/* Grid responsivo */
@media (max-width: 767.98px) {
    .dxbl-grid-header-cell {
        font-size: 0.8rem;
    }
}

.dxbl-grid .dropdown-item {
    padding: 0.25rem 0.75rem;
    display: flex;
    align-items: center;
}

/* Badge responsive nelle celle */
@media (max-width: 575.98px) {
    .dxbl-grid .badge {
        font-size: 0.6rem !important;
        padding: 0.15rem 0.4rem;
    }
}

/* Ottimizzazione scroll orizzontale per mobile */
@media (max-width: 767.98px) {
    .dxbl-grid-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Stili per le celle con informazioni multiple su mobile */
.dxbl-grid .mobile-cell-info {
    line-height: 1.3;
}

.dxbl-grid .mobile-cell-info small {
    display: block;
    margin-top: 0.125rem;
    opacity: 0.8;
}

/* Touch-friendly per dispositivi mobili */
@media (max-width: 767.98px) {
    .dxbl-grid .btn,
    .dxbl-grid .dropdown-toggle {
        min-height: 36px;
        min-width: 36px;
        touch-action: manipulation;
    }
    
    .dxbl-grid .dropdown-menu {
        min-width: 160px;
    }
}

/* Stili specifici per colonna informazioni unificate su mobile */
@media (max-width: 991.98px) {
    .dxbl-grid-cell .d-flex.flex-column {
        gap: 0;
    }
    
    .dxbl-grid-cell .border-top {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-color: #e9ecef !important;
    }
    
    .dxbl-grid-cell small {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .dxbl-grid-cell .badge {
        font-size: 0.65rem !important;
        padding: 0.125rem 0.3rem;
        line-height: 1;
    }
    
    /* Nascondi colonne Data, CIG e Tipologia su mobile con selettori multipli */
    .dxbl-grid .dxbl-grid-header-cell:nth-child(2),
    .dxbl-grid .dxbl-grid-cell:nth-child(2),
    .dxbl-grid .dxbl-grid-header-cell:nth-child(3), 
    .dxbl-grid .dxbl-grid-cell:nth-child(3),
    .dxbl-grid .dxbl-grid-header-cell:nth-child(4),
    .dxbl-grid .dxbl-grid-cell:nth-child(4),
    .dxbl-grid-header-cell:nth-child(2),
    .dxbl-grid-cell:nth-child(2),
    .dxbl-grid-header-cell:nth-child(3), 
    .dxbl-grid-cell:nth-child(3),
    .dxbl-grid-header-cell:nth-child(4),
    .dxbl-grid-cell:nth-child(4) {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
    }
}

/* ===== STILI CARD MOBILE PER RISULTATI RICERCA ===== */

/* Card risultati per mobile - Design Bootstrap Italia nativo */
.search-result-card {
    border: 1px solid var(--bs-gray-200, #e9ecef);
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.search-result-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.search-result-card .card-body {
    padding: 1.25rem;
}

.search-result-card .search-result-section {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.search-result-card .search-result-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--bs-body-color, #17324d);
}

.search-result-card .search-result-additional {
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Pulsante full-width mobile-friendly */
.search-result-card .btn {
    font-weight: 600;
    min-height: 48px; /* Touch target WCAG compliant */
    border-radius: 0.5rem;
}

/* Data e sezione header mobile */
.search-result-card .d-flex {
    gap: 0.75rem;
}

/* Responsive adjustments per card mobile */
@media (max-width: 575.98px) {
    .search-result-card .card-body {
        padding: 1rem;
    }
    
    .search-result-card .btn {
        min-height: 52px; /* Più touch-friendly su schermi molto piccoli */
        font-size: 1rem;
    }
    
    .search-result-card .search-result-description {
        font-size: 0.9rem;
    }
}

/* ===== STILI SPINNER BOOTSTRAP ITALIA PER INDEX ===== */

/* Spinner per caricamento contatori nella Index */
.it-list .progress-spinner {
    display: inline-block;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.it-list .progress-spinner.size-sm {
    width: 1rem;
    height: 1rem;
}

/* Assicura che lo spinner sia visibile e ben posizionato */
.it-right-zone .progress-spinner {
    margin: 0 0.25rem;
}

/* Stati di caricamento ottimizzati */
.loading-text {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Colore spinner conforme Bootstrap Italia */
.progress-spinner::before {
    border-color: var(--bs-primary) transparent var(--bs-primary) transparent;
}

/* ===== STILI INDEX PA TEMPLATE ISTITUZIONALE ===== */

.it-header-center-wrapper {
    padding: 1rem 0;
}

.it-header-center-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Brand/Logo Ente */
.it-brand-wrapper a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 1rem;
}

.it-brand-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-600, #0052a3) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 12px rgba(0, 102, 204, 0.25);
}

.it-brand-icon .icon {
    color: var(--bs-white);
    font-size: 1.75rem;
}


.it-brand-text .brand-ente-name {
    color: var(--bs-body-color);
    font-weight: 700;
    font-size: 1.5rem;
    margin: 0;
    line-height: 1.2;
}

.it-brand-text .brand-section-name {
    color: var(--bs-primary);
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
    line-height: 1.3;
}

/* Area Info Ente */
.it-header-center-content-wrapper .it-right-zone {
    text-align: right;
    color: var(--bs-text-muted);
    font-size: 0.9rem;
}

.it-header-center-content-wrapper .it-right-zone .fw-semibold {
    color: var(--bs-primary);
    font-size: 1rem;
}

/* Breadcrumb PA Standard */
.breadcrumb-container {
    background: var(--bs-gray-50, #f8f9fa);
    border-bottom: 1px solid var(--bs-gray-200, #e9ecef);
    padding: 0.75rem 0;
}

.breadcrumb {
    margin: 0;
    padding: 0;
    background: transparent;
}

/* CSS BGC2024 specifico rimosso - utilizzando breadcrumb standard PA */

.breadcrumb-item a {
    color: var(--bs-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.breadcrumb-item a:hover {
    color: var(--bs-primary-600, #0052a3);
    text-decoration: underline;
}

.breadcrumb-item.active span {
    color: var(--bs-body-color);
    font-weight: 500;
}

/* Hero Section PA Template */
.it-hero-wrapper {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-600, #0052a3) 100%);
    position: relative;
    overflow: hidden;
}

.it-hero-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.it-hero-text-wrapper {
    position: relative;
    z-index: 2;
}

.hero-title {
    color: var(--bs-white);
    font-weight: 700;
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.25rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.hero-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .it-header-center-content-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .it-brand-wrapper a {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .it-brand-text .brand-ente-name {
        font-size: 1.25rem;
    }
    
    .it-header-center-content-wrapper .it-right-zone {
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
}

/* ===== INDEX HEADER HERO SECTION PA ===== */

/* Header principale della pagina index - Design sobrio PA */
.index-header {
    background: var(--bs-gray-50, #f8f9fa);
    color: var(--bs-body-color);
    padding: 3rem 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--bs-gray-200, #e9ecef);
    border-radius: 0.5rem;
    text-align: center;
}

/* Titolo principale sobrio PA */
.index-header h1 {
    color: var(--bs-body-color);
    font-weight: 700;
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

/* Container descrizione PA */
.index-description {
    color: var(--bs-text-muted, #6c757d);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
}

.index-description p {
    margin-bottom: 1.25rem;
}

.index-description b {
    color: var(--bs-body-color);
    font-weight: 600;
}

/* Sezione principale conformità PA */
.index-main {
    padding: 2rem 0;
    background: var(--bs-white);
}

/* Sezione ricerca */
.search-section {
    background: var(--bs-gray-50);
    border-bottom: 1px solid var(--bs-gray-200);
    padding: 1rem 0;
}

/* Sezione intro trasparenza */
.transparency-intro {
    padding: 2rem 1.5rem;
    border: 2px solid var(--bs-gray-200);
    border-radius: 12px;
    background: var(--bs-white);
    box-shadow: 0 4px 16px rgba(0, 102, 204, 0.08);
    margin-bottom: 2rem;
}

.main-title {
    color: var(--bs-body-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.main-title .icon {
    color: var(--bs-primary);
    margin-right: 0.75rem;
    filter: drop-shadow(0 2px 4px rgba(0, 102, 204, 0.15));
}

.main-title a {
    color: var(--bs-body-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.main-title a:hover {
    color: var(--bs-primary);
    text-decoration: underline;
}

/* Sezione elenco trasparenza */
.transparency-sections {
    margin-bottom: 2rem;
}

.sections-title {
    color: var(--bs-body-color);
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Sezione loading */
.loading-section {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Lista sezioni Template PA */
.it-list-wrapper {
    margin-top: 1.5rem;
}

.it-list .list-item {
    border: 2px solid var(--bs-gray-200);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: var(--bs-white);
    margin-bottom: 1rem;
    min-height: 120px;
    padding: 1.25rem;
}

/* Icone Index - Migliorata leggibilità */
.index-document-icon,
.index-category-icon {
    /* Bootstrap Italia: Sfondo primario PA per massimo contrasto */
    background: var(--bs-primary);
    
    /* Bootstrap Italia: Bordo neutro sottile conforme */
    border: 2px solid var(--bs-gray-300);
    
    /* Dimensioni flessibili ma stabili */
    min-width: 3.5rem;
    min-height: 3.5rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    
    /* Layout centrato standard con protezione shrinking */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 1rem;
    
    /* Bootstrap Italia: Ombra standard per componenti PA */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 
                0 8px 16px rgba(0, 0, 0, 0.1);
    
    /* Transizione standard Bootstrap Italia */
    transition: all 0.15s ease-in-out;
}

.index-document-icon .icon,
.index-category-icon .icon {
    /* Bootstrap Italia: Icone bianche su sfondo primario (contrasto 4.5:1) */
    color: var(--bs-white) !important;
    
    /* Bootstrap Italia: Dimensioni icone stabili (24px) */
    width: 1.5rem !important;
    height: 1.5rem !important;
    min-width: 1.5rem;
    min-height: 1.5rem;
    flex-shrink: 0;
    
    /* Bootstrap Italia: NO filter per icone standard */
    filter: none;
    
    /* Mantieni proporzioni originali */
    object-fit: contain;
}

/* Bootstrap Italia: Fill/stroke bianco su sfondo primario */
.index-document-icon .icon {
    fill: var(--bs-white) !important;
    stroke: var(--bs-white) !important;
}

.index-category-icon .icon {
    fill: var(--bs-white) !important;
    stroke: var(--bs-white) !important;
}

/* Bootstrap Italia: Hover effects conformi */
.it-list .list-item:hover .index-document-icon,
.it-list .list-item:hover .index-category-icon {
    /* Bootstrap Italia: Sfondo hover più scuro */
    background: var(--bs-primary-600);
    
    /* Bootstrap Italia: Bordo più definito */
    border-color: var(--bs-gray-400);
    
    /* Bootstrap Italia: Ombra più marcata standard */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 
                0 12px 24px rgba(0, 0, 0, 0.15);
    
    /* Bootstrap Italia: Transform leggero */
    transform: translateY(-1px);
}

/* Bootstrap Italia: Icone restano bianche su hover per contrasto */
.it-list .list-item:hover .index-document-icon .icon,
.it-list .list-item:hover .index-category-icon .icon {
    color: var(--bs-white) !important;
    fill: var(--bs-white) !important;
    stroke: var(--bs-white) !important;
}

/* WCAG 2.1 AA: Focus indicators conformi Bootstrap Italia */
.it-list .list-item:focus-within .index-document-icon,
.it-list .list-item:focus-within .index-category-icon {
    /* WCAG 2.1 AA: Focus ring standard (contrasto 3:1 minimo) */
    outline: 2px solid var(--bs-focus-ring-color);
    outline-offset: 2px;
    
    /* Bootstrap Italia: Bordo focus primario */
    border-color: var(--bs-primary);
    
    /* Bootstrap Italia: Sfondo rimane primario per contrasto icone */
    background: var(--bs-primary-700);
    
    /* Bootstrap Italia: Box shadow focus */
    box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

/* WCAG 2.1 AA: Icone bianche su sfondo scuro per contrasto ottimale */
.it-list .list-item:focus-within .index-document-icon .icon,
.it-list .list-item:focus-within .index-category-icon .icon {
    color: var(--bs-white) !important;
    fill: var(--bs-white) !important;
    stroke: var(--bs-white) !important;
}

/* Icone Header e Accordion - Migliorata leggibilità */
.header-pa-icon {
    color: var(--bs-primary) !important;
    filter: drop-shadow(0 2px 4px rgba(0, 102, 204, 0.25));
    transition: all 0.3s ease;
}

.search-accordion-icon {
    color: var(--bs-primary) !important;
    filter: drop-shadow(0 1px 2px rgba(0, 102, 204, 0.2));
    transition: all 0.3s ease;
}

/* Hover states per icone header */
.index-main h2 a:hover .header-pa-icon {
    color: var(--bs-primary-600, #0052a3) !important;
    filter: drop-shadow(0 3px 6px rgba(0, 102, 204, 0.35));
    transform: scale(1.05);
}

.accordion-button:hover .search-accordion-icon,
.accordion-button:focus .search-accordion-icon {
    color: var(--bs-primary-600, #0052a3) !important;
    filter: drop-shadow(0 2px 4px rgba(0, 102, 204, 0.3));
    transform: scale(1.1);
}

.accordion-button:not(.collapsed) .search-accordion-icon {
    color: var(--bs-primary-700, #004085) !important;
    filter: drop-shadow(0 2px 4px rgba(0, 102, 204, 0.4));
}

.it-list .list-item:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 4px 16px rgba(0, 102, 204, 0.12);
    transform: translateY(-2px);
}

.it-list .list-item:focus {
    outline: 3px solid var(--bs-primary);
    outline-offset: 2px;
    border-color: var(--bs-primary);
}

/* Icone sezioni PA */
.it-rounded-icon {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-600) 100%);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.it-rounded-icon .icon {
    color: var(--bs-white);
    font-size: 1.5rem;
}

/* Testo sezioni PA */
.it-right-zone .text {
    color: var(--bs-body-color);
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.4;
}

/* Contatori documenti PA */
.it-right-zone .text [aria-label*="documenti"] {
    color: var(--bs-text-muted);
    font-weight: 400;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* Footer informativo Template PA */
.index-footer {
    background: var(--bs-gray-50);
    border: 1px solid var(--bs-gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 3rem;
}

.index-footer h6 {
    color: var(--bs-body-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.index-footer span {
    color: var(--bs-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ===== RESPONSIVE DESIGN MOBILE-FIRST TEMPLATE PA ===== */

/* Mobile Small (320px - 575px) */
@media (max-width: 575.98px) {
    .index-header {
        padding: 2rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .index-header h1 {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }
    
    .index-description {
        font-size: 1rem;
        max-width: 100%;
    }
    
    .index-main {
        padding: 1.5rem 1rem;
        margin: 0 1rem;
    }
    
    .it-list .list-item {
        min-height: 100px;
        padding: 1rem;
    }
    
    .it-rounded-icon {
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
    }
    
    .it-rounded-icon .icon {
        font-size: 1.25rem;
    }
    
    .it-right-zone .text {
        font-size: 0.95rem;
    }
    
    .index-footer {
        margin: 2rem 1rem 1rem;
        padding: 1.25rem;
    }
}

/* Mobile Large (576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .index-header {
        padding: 2.5rem 1rem;
    }
    
    .index-header h1 {
        font-size: 2rem;
    }
    
    .index-description {
        font-size: 1.05rem;
        max-width: 100%;
    }
    
    .it-list .list-item {
        min-height: 110px;
    }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .index-header {
        padding: 2.75rem 1.5rem;
    }
    
    .index-header h1 {
        font-size: 2.25rem;
    }
    
    .index-description {
        font-size: 1.125rem;
    }
    
    .index-main {
        padding: 1.75rem 1.25rem;
    }
}

/* Accessibilità migliorata - Focus states conformi WCAG 2.1 AA */
@media (prefers-reduced-motion: no-preference) {
    .it-list .list-item,
    .index-main h2 a,
    .it-rounded-icon {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* ⚡ Caricamento Asincrono Progressivo - Performance Optimization (2025-01-30) */

/* Results summary */
.results-summary {
    border-left: 3px solid var(--bs-primary);
}

/* Progress bar con animazione gradiente */
.progress-bar.bg-info {
    background: linear-gradient(90deg, 
        var(--bs-info, #17a2b8) 0%, 
        var(--bs-primary, #0066cc) 50%, 
        var(--bs-info, #17a2b8) 100%);
    background-size: 200% 100%;
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Badge loading con icona rotante */
.badge.bg-info svg.icon {
    animation: rotateLoading 1.5s linear infinite;
}

@keyframes rotateLoading {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Background loading status - accessibile e non invasivo */
.results-summary small {
    font-size: 0.8rem;
    line-height: 1.3;
    opacity: 0.85;
}

/* Progress bar responsive height */
@media (max-width: 575.98px) {
    .results-summary .progress {
        height: 4px !important; /* Più visibile su mobile */
    }
}

/* Supporto riduzione movimento per accessibilità */
@media (prefers-reduced-motion: reduce) {
    .progress-bar.bg-info,
    .badge.bg-info svg.icon {
        animation: none;
    }
    
    .progress-bar.bg-info {
        background: var(--bs-info, #17a2b8);
    }
}

@media (prefers-reduced-motion: reduce) {
    .it-list .list-item,
    .index-main h2 a,
    .it-rounded-icon {
        transition: none;
    }
    
    .it-list .list-item:hover {
        transform: none;
    }
}

/* High contrast mode per accessibilità */
@media (prefers-contrast: high) {
    .index-header {
        border-bottom-width: 4px;
    }
    
    .it-list .list-item {
        border-width: 3px;
    }
    
    .it-list .list-item:focus {
        outline-width: 4px;
    }
    
    /* Icone Index - Supporto High Contrast */
    .index-document-icon,
    .index-category-icon {
        background: ButtonFace !important;
        border: 3px solid ButtonText !important;
        box-shadow: none !important;
    }
    
    .index-document-icon .icon,
    .index-category-icon .icon {
        color: ButtonText !important;
        fill: ButtonText !important;
        stroke: ButtonText !important;
        filter: none !important;
    }
    
    /* Hover in high contrast */
    .it-list .list-item:hover .index-document-icon,
    .it-list .list-item:hover .index-category-icon {
        background: Highlight !important;
        border-color: HighlightText !important;
    }
    
    .it-list .list-item:hover .index-document-icon .icon,
    .it-list .list-item:hover .index-category-icon .icon {
        color: HighlightText !important;
        fill: HighlightText !important;
        stroke: HighlightText !important;
    }
    
    /* Focus in high contrast */
    .it-list .list-item:focus-within .index-document-icon,
    .it-list .list-item:focus-within .index-category-icon {
        outline: 3px solid !important;
        background: HighlightText !important;
        border-color: Highlight !important;
    }
    
    .it-list .list-item:focus-within .index-document-icon .icon,
    .it-list .list-item:focus-within .index-category-icon .icon {
        color: Highlight !important;
        fill: Highlight !important;
        stroke: Highlight !important;
    }
}

/* Responsive adjustments per icone sezioni */
@media (max-width: 575.98px) {
    .index-document-icon,
    .index-category-icon {
        /* Dimensioni leggermente ridotte su mobile ma stabili */
        min-width: 3rem;
        min-height: 3rem;
        width: 3rem;
        height: 3rem;
        margin-bottom: 0.75rem;
        margin-right: 0.75rem;
    }
    
    .index-document-icon .icon,
    .index-category-icon .icon {
        /* Icone proporzionalmente ridotte su mobile */
        width: 1.25rem !important;
        height: 1.25rem !important;
        min-width: 1.25rem;
        min-height: 1.25rem;
    }
}

/* Menu Page Components - Bootstrap Italia Compliance */

/* Loading Container Bootstrap Italia */
.loading-container {
    background-color: var(--bs-gray-50, #f8f9fa);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--bs-border-radius, 0.375rem);
}

/* Menu Content Section Bootstrap Italia */
.menu-content-section {
    background-color: var(--bs-white, #ffffff);
    padding: 2rem 0;
    border-radius: var(--bs-border-radius-lg, 0.5rem);
}

.menu-items-wrapper {
    margin-bottom: 2rem;
}

/* Menu Item Links - Accessibilità migliorata */
.menu-document-link,
.menu-category-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: var(--bs-white, #ffffff);
    border: 2px solid var(--bs-gray-200, #dee2e6);
    border-radius: var(--bs-border-radius, 0.375rem);
    text-decoration: none;
    color: var(--bs-body-color, #212529);
    transition: all 0.15s ease-in-out;
    margin-bottom: 0.75rem;
    min-height: 60px;
}

.menu-document-link:hover,
.menu-category-link:hover {
    background-color: var(--bs-primary-100, #e6f3ff);
    border-color: var(--bs-primary, #0066cc);
    color: var(--bs-primary, #0066cc);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.15);
}

.menu-document-link:focus,
.menu-category-link:focus {
    outline: 3px solid var(--bs-primary, #0066cc);
    outline-offset: 2px;
    background-color: var(--bs-primary-100, #e6f3ff);
    border-color: var(--bs-primary, #0066cc);
    box-shadow: 0 0 0 0.25rem rgba(0, 102, 204, 0.25);
}

/* Icon containers per documenti e categorie */
.menu-document-icon,
.menu-category-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
    transition: all 0.15s ease-in-out;
}

.menu-document-icon {
    background-color: var(--bs-success-100, #d1e7dd);
    color: var(--bs-success, #198754);
}

.menu-category-icon {
    background-color: var(--bs-info-100, #cff4fc);
    color: var(--bs-info, #0dcaf0);
}

.menu-document-link:hover .menu-document-icon,
.menu-document-link:focus .menu-document-icon {
    background-color: var(--bs-success, #198754);
    color: var(--bs-white, #ffffff);
    transform: scale(1.1);
}

.menu-category-link:hover .menu-category-icon,
.menu-category-link:focus .menu-category-icon {
    background-color: var(--bs-info, #0dcaf0);
    color: var(--bs-white, #ffffff);
    transform: scale(1.1);
}

/* Text styling per voci menu */
.menu-item-text {
    font-weight: 500;
    line-height: 1.4;
    flex-grow: 1;
}

.menu-counter {
    font-weight: 600;
    color: var(--bs-primary, #0066cc);
    white-space: nowrap;
}

/* Search Section in Menu */
.search-section {
    background-color: var(--bs-gray-50, #f8f9fa);
    border-top: 1px solid var(--bs-gray-200, #dee2e6);
    border-radius: var(--bs-border-radius, 0.375rem);
    padding: 1.5rem 0;
}

/* Progress Spinner per caricamento */
.progress-spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--bs-gray-300, #adb5bd);
    border-top: 2px solid var(--bs-primary, #0066cc);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.progress-spinner.size-sm {
    width: 1rem;
    height: 1rem;
    border-width: 1.5px;
}

.progress-spinner-active {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Optimization per Menu */
@media (max-width: 767.98px) {
    .menu-content-section {
        padding: 1rem 0;
    }
    
    .menu-document-link,
    .menu-category-link {
        padding: 0.75rem;
        min-height: 48px;
        font-size: 0.9rem;
    }
    
    .menu-document-icon,
    .menu-category-icon {
        width: 2.5rem;
        height: 2.5rem;
        margin-right: 0.75rem;
    }
    
    .menu-item-text {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .menu-counter {
        font-size: 0.85rem;
    }
}

/* Touch-friendly per dispositivi mobili */
@media (max-width: 479.98px) {
    .menu-document-link,
    .menu-category-link {
        min-height: 52px;
        padding: 1rem 0.75rem;
    }
    
    .menu-document-icon,
    .menu-category-icon {
        width: 2.25rem;
        height: 2.25rem;
    }
}

/* High Contrast Mode per accessibilità */
@media (prefers-contrast: high) {
    .menu-document-link,
    .menu-category-link {
        border-width: 3px;
        border-color: var(--bs-dark, #212529);
    }
    
    .menu-document-link:focus,
    .menu-category-link:focus {
        outline-width: 4px;
        outline-color: HighlightText;
        background-color: Highlight;
        color: HighlightText;
    }
}

/* Reduced Motion per accessibilità */
@media (prefers-reduced-motion: reduce) {
    .menu-document-link,
    .menu-category-link,
    .menu-document-icon,
    .menu-category-icon {
        transition: none;
    }
    
    .menu-document-link:hover,
    .menu-category-link:hover {
        transform: none;
    }
    
    .progress-spinner-active {
        animation: none;
        border-top-color: var(--bs-primary, #0066cc);
    }
}

/* ========================================
   IntroAccordion Component - Bootstrap Italia PA Conforme
   ======================================== */

/* Sezione intro principale */
.intro-section {
    background: var(--bs-white);
    border-bottom: 1px solid var(--bs-border-color-translucent, #dee2e6);
    margin-bottom: 2rem;
}

.intro-header {
    margin-bottom: 1.5rem;
}

.intro-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--bs-primary, #0066cc);
    line-height: 1.3;
    border-bottom: 3px solid var(--bs-primary-100, #e6f3ff) !important;
    padding-bottom: 1rem !important;
    margin-bottom: 0;
}

/* Contenuto introduttivo */
.intro-content {
    background: var(--bs-light, #f8f9fa);
    border-left: 4px solid var(--bs-primary, #0066cc);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.5rem;
}

.intro-text {
    color: var(--bs-body-color, #17324d);
    font-size: 1rem;
    line-height: 1.6;
}

.intro-text p {
    margin-bottom: 1rem;
}

.intro-text p:last-child {
    margin-bottom: 0;
}

/* Accordion Riferimenti Normativi */
.intro-accordion-section {
    margin-top: 1.5rem;
}

.intro-accordion-button {
    color: var(--bs-primary, #0066cc) !important;
    font-size: 1.1rem;
    font-weight: 600 !important;
    text-decoration: none;
    padding-left: 0 !important;
    padding-right: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.intro-accordion-button:hover {
    color: var(--bs-primary-600, #0052a3) !important;
    border-bottom-color: var(--bs-primary-200, #b3d9ff);
    background: transparent !important;
}

.intro-accordion-button:focus {
    color: var(--bs-primary-700, #004085) !important;
    border-bottom-color: var(--bs-primary, #0066cc);
    background: transparent !important;
    box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color) !important;
    outline: 0;
}

.intro-accordion-button:not(.collapsed) {
    color: var(--bs-primary-700, #004085) !important;
    border-bottom-color: var(--bs-primary, #0066cc);
    background: transparent !important;
}

/* Icona accordion */
.intro-accordion-button .icon {
    color: var(--bs-primary, #0066cc);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.intro-accordion-button:hover .icon {
    color: var(--bs-primary-600, #0052a3);
    transform: scale(1.1);
}

.intro-accordion-button:focus .icon {
    color: var(--bs-primary-700, #004085);
}

.intro-accordion-button:not(.collapsed) .icon {
    color: var(--bs-primary-700, #004085);
}

/* Contenuto riferimenti */
.intro-references-content {
    background: var(--bs-gray-50, #f8f9fa);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    padding: 1.5rem;
    color: var(--bs-body-color, #17324d);
    font-size: 0.95rem;
    line-height: 1.6;
}

.intro-references-content:focus {
    outline: 2px solid var(--bs-focus-ring-color);
    outline-offset: 2px;
}

.intro-references-content p {
    margin-bottom: 1rem;
}

.intro-references-content p:last-child {
    margin-bottom: 0;
}

.intro-references-content ul,
.intro-references-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.intro-references-content li {
    margin-bottom: 0.5rem;
}

.intro-references-content a {
    color: var(--bs-primary, #0066cc);
    text-decoration: underline;
}

.intro-references-content a:hover {
    color: var(--bs-primary-600, #0052a3);
    text-decoration: none;
}

/* Responsive design */
@media (max-width: 767.98px) {
    .intro-title {
        font-size: 1.75rem;
    }
    
    .intro-content {
        padding: 1rem;
        border-radius: 0 6px 6px 0;
    }
    
    .intro-references-content {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .intro-accordion-button {
        font-size: 1rem;
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .intro-title {
        border-bottom-color: var(--bs-dark, #212529) !important;
    }
    
    .intro-content {
        border-left-color: var(--bs-dark, #212529);
        background: var(--bs-white, #ffffff);
        border: 2px solid var(--bs-dark, #212529);
    }
    
    .intro-accordion-button {
        color: var(--bs-dark, #212529) !important;
        border-bottom-width: 3px;
    }
    
    .intro-references-content {
        border-color: var(--bs-dark, #212529);
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .intro-accordion-button,
    .intro-accordion-button .icon {
        transition: none;
    }
    
    .intro-accordion-button:hover .icon {
        transform: none;
    }
}

/* ========================================
   SchedeGeneriche Components - Bootstrap Italia PA Conforme
   ======================================== */

/* Sezione tabs principale */
.schedegeneriche-tabs-section {
    background: var(--bs-white);
    padding: 2rem 0;
}

/* Nav tabs personalizzati Bootstrap Italia */
.schedegeneriche-nav-tabs {
    border-bottom: 2px solid var(--bs-border-color, #dee2e6);
    margin-bottom: 0;
    padding-left: 0;
}

.schedegeneriche-nav-tabs .nav-item {
    margin-bottom: -2px;
}

.schedegeneriche-nav-link {
    border: 2px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    color: var(--bs-body-color, #17324d);
    font-weight: 600;
    font-size: 1rem;
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
    background: var(--bs-gray-100, #f8f9fa);
    margin-right: 0.25rem;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.schedegeneriche-nav-link:hover {
    color: var(--bs-primary, #0066cc);
    background: var(--bs-primary-100, #e6f3ff);
    border-color: var(--bs-primary-200, #b3d9ff);
    text-decoration: none;
}

.schedegeneriche-nav-link:focus {
    color: var(--bs-primary-700, #004085);
    background: var(--bs-primary-100, #e6f3ff);
    border-color: var(--bs-primary, #0066cc);
    box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
    outline: 0;
    text-decoration: none;
}

.schedegeneriche-nav-link.active {
    color: var(--bs-primary, #0066cc);
    background: var(--bs-white);
    border-color: var(--bs-border-color, #dee2e6) var(--bs-border-color, #dee2e6) var(--bs-white);
    border-bottom-color: var(--bs-white);
}

.schedegeneriche-nav-link .icon {
    color: inherit;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* Tab content */
.schedegeneriche-tab-content {
    background: var(--bs-white);
    border: 2px solid var(--bs-border-color, #dee2e6);
    border-top: none;
    border-radius: 0 8px 8px 8px;
    min-height: 400px;
}

.schedegeneriche-tab-pane {
    padding: 2rem;
}

.schedegeneriche-tab-pane:focus {
    outline: 2px solid var(--bs-focus-ring-color);
    outline-offset: -2px;
}

/* Responsive design per tabs */
@media (max-width: 767.98px) {
    .schedegeneriche-tabs-section {
        padding: 1rem 0;
    }
    
    .schedegeneriche-nav-link {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
    
    .schedegeneriche-tab-pane {
        padding: 1rem;
    }
    
    .schedegeneriche-nav-tabs {
        flex-wrap: wrap;
    }
    
    .schedegeneriche-nav-tabs .nav-item {
        flex: 1;
        min-width: 0;
    }
    
    .schedegeneriche-nav-link {
        margin-right: 0;
        margin-bottom: 0.25rem;
        text-align: center;
        justify-content: center;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .schedegeneriche-nav-tabs {
        border-bottom-width: 3px;
        border-bottom-color: var(--bs-dark, #212529);
    }
    
    .schedegeneriche-nav-link {
        border-width: 3px;
        color: var(--bs-dark, #212529);
        background: var(--bs-white);
    }
    
    .schedegeneriche-nav-link.active {
        background: var(--bs-white);
        border-color: var(--bs-dark, #212529);
        color: var(--bs-dark, #212529);
    }
    
    .schedegeneriche-tab-content {
        border-width: 3px;
        border-color: var(--bs-dark, #212529);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .schedegeneriche-nav-link,
    .schedegeneriche-nav-link .icon {
        transition: none;
    }
}

/* ===== STILI SCHEDE GENERICHE GRID BOOTSTRAP ITALIA ===== */

/* Container principale griglia SchedeGeneriche */
.schedegeneriche-grid-section {
    background: var(--bs-white);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Loading overlay */
.schedegeneriche-loading-overlay {
    background: var(--bs-white);
    border-radius: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    border: 1px solid var(--bs-gray-200);
}

.schedegeneriche-loading-overlay .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2rem;
}

/* Controlli griglia */
.schedegeneriche-grid-controls {
    background: var(--bs-gray-50, #f8f9fa);
    border-radius: 0.5rem;
    padding: 1.25rem;
    border: 1px solid var(--bs-gray-200, #e9ecef);
}

.schedegeneriche-grid-controls .form-label {
    color: var(--bs-body-color, #17324d);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.schedegeneriche-grid-controls .input-group-text {
    background: var(--bs-white);
    border-color: var(--bs-gray-300, #ced4da);
    color: var(--bs-primary, #0066cc);
}

.schedegeneriche-grid-controls .form-control,
.schedegeneriche-grid-controls .form-select {
    border-color: var(--bs-gray-300, #ced4da);
    font-size: 0.9rem;
}

.schedegeneriche-grid-controls .form-control:focus,
.schedegeneriche-grid-controls .form-select:focus {
    border-color: var(--bs-primary, #0066cc);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.15);
}

/* Tabella desktop */
.schedegeneriche-table-container {
    /* Template Master Pattern - Stili identici a table-responsive-payment */
    overflow-x: auto;
    border-radius: var(--bs-border-radius, 0.375rem);
    box-shadow: 0 2px 4px rgba(var(--bs-primary-rgb, 0, 102, 204), 0.08);
}

.schedegeneriche-table {
    margin-bottom: 0;
    /* Template Master Pattern - No custom font-size, usa default Bootstrap */
    border-collapse: separate;
    border-spacing: 0;
}

.schedegeneriche-table thead th {
    font-weight: 600;
    /* Template Master Pattern - Allineato con table-responsive-payment */
    vertical-align: middle;
    /* Inherit font-size from Bootstrap default table sizing */
    font-size: inherit;
}

/* Template Master Pattern - Header blu scuro con testo bianco come DatiSuiPagamenti */
.schedegeneriche-table .table-primary th,
.schedegeneriche-table > thead > tr > th.table-primary,
.schedegeneriche-table thead.table-primary th {
    background-color: var(--bs-primary, #0066cc) !important;
    color: white !important;
    border: none !important;
    font-weight: 600;
    text-transform: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Forza icone bianche nell'header table-primary */
.schedegeneriche-table thead.table-primary th svg.icon,
.schedegeneriche-table thead.table-primary th .icon {
    color: white !important;
    fill: white !important;
}

.schedegeneriche-table thead.table-primary th svg.icon use,
.schedegeneriche-table thead.table-primary th .icon use {
    color: white !important;
    fill: white !important;
}

/* Stili per colonne ordinabili - Template Master Pattern */
.schedegeneriche-table thead.table-primary th.sortable:hover {
    background-color: var(--bs-primary-600, #0055aa) !important;
    transition: background-color 0.15s ease-in-out;
}

.schedegeneriche-table thead.table-primary th.sortable:focus {
    outline: 2px solid white !important;
    outline-offset: -3px;
    background-color: var(--bs-primary-700, #004499) !important;
}

/* Mantieni icone sempre bianche anche su hover/focus */
.schedegeneriche-table thead.table-primary th.sortable:hover svg.icon,
.schedegeneriche-table thead.table-primary th.sortable:hover .icon,
.schedegeneriche-table thead.table-primary th.sortable:focus svg.icon,
.schedegeneriche-table thead.table-primary th.sortable:focus .icon {
    color: white !important;
    fill: white !important;
}

.schedegeneriche-table tbody td {
    /* Template Master Pattern - No custom padding, usa default Bootstrap */
    vertical-align: middle;
    border-color: var(--bs-gray-200, #e9ecef);
}

/* Template Master Pattern - Hover effect per righe */
.schedegeneriche-table tbody tr:hover {
    background-color: var(--bs-gray-50, #f8f9fa);
    transition: background-color 0.15s ease-in-out;
}

/* Template Master Pattern - Focus per accessibilità */
.schedegeneriche-table tbody tr:focus-within {
    outline: 1px solid var(--bs-primary, #0066cc);
    outline-offset: -1px;
}

/* Colonne specifiche - Template Master Pattern */
/* Commentate per usare sizing default Bootstrap come DatiSuiPagamenti
.schedegeneriche-date-col {
    width: 150px;
    min-width: 130px;
    font-weight: 500;
}

.schedegeneriche-content-col {
    min-width: 300px;
}

.schedegeneriche-action-col {
    width: 180px;
    min-width: 160px;
}
*/

/* Contenuto documento */
.schedegeneriche-document-content {
    line-height: 1.5;
}

.schedegeneriche-info-secondary {
    color: var(--bs-text-muted, #6c757d);
    font-size: 0.85rem;
    font-style: italic;
}

.schedegeneriche-info-primary {
    color: var(--bs-body-color, #17324d);
    font-weight: 500;
}

/* Righe hover */
.schedegeneriche-result-row:hover {
    background-color: var(--bs-primary-50, #f0f8ff);
}

/* Cards mobile */
.schedegeneriche-card {
    border: 1px solid var(--bs-gray-200, #e9ecef);
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    background: var(--bs-white);
}

.schedegeneriche-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.schedegeneriche-card .card-body {
    padding: 1.25rem;
}

.schedegeneriche-card-section {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.schedegeneriche-card-section .icon {
    color: var(--bs-primary, #0066cc);
}

.schedegeneriche-card-content {
    line-height: 1.5;
}

.schedegeneriche-card-content .schedegeneriche-info-secondary {
    color: var(--bs-text-muted, #6c757d);
    font-size: 0.85rem;
    font-style: italic;
}

.schedegeneriche-card-content .schedegeneriche-info-primary {
    color: var(--bs-body-color, #17324d);
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .schedegeneriche-grid-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .schedegeneriche-grid-controls {
        padding: 1rem;
    }
    
    .schedegeneriche-grid-controls .row {
        row-gap: 1rem;
    }
}

@media (max-width: 767.98px) {
    .schedegeneriche-grid-section {
        padding: 0.75rem;
        border-radius: 0.5rem;
    }
    
    .schedegeneriche-grid-controls {
        padding: 0.75rem;
    }
    
    .schedegeneriche-grid-controls .form-label {
        font-size: 0.85rem;
    }
    
    .schedegeneriche-card .card-body {
        padding: 1rem;
    }
    
    .schedegeneriche-card-section {
        font-size: 0.85rem;
    }
}

@media (max-width: 575.98px) {
    .schedegeneriche-grid-controls .col-md-5 .d-flex {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch !important;
    }
    
    .schedegeneriche-grid-controls .text-muted {
        text-align: center !important;
        font-size: 0.8rem;
    }
    
    .schedegeneriche-card .btn {
        min-height: 48px; /* Touch target WCAG compliant */
        font-size: 1rem;
    }
}

/* Alto contrasto */
@media (prefers-contrast: high) {
    .schedegeneriche-table thead th {
        background: var(--bs-primary-200, #b3d9ff);
        color: var(--bs-primary-900, #002952);
        border-width: 2px;
    }
    
    .schedegeneriche-result-row:hover {
        background-color: var(--bs-primary-100, #e6f3ff);
        border: 2px solid var(--bs-primary, #0066cc);
    }
    
    .schedegeneriche-card:focus-within {
        outline: 3px solid var(--bs-primary, #0066cc);
        outline-offset: 2px;
    }
}

/* Movimento ridotto */
@media (prefers-reduced-motion: reduce) {
    .schedegeneriche-card {
        transition: none;
    }
    
    .schedegeneriche-card:hover {
        transform: none;
    }
    
    .schedegeneriche-loading-overlay .spinner-border {
        animation: none;
        border-top-color: transparent;
    }
}

/* ===== STILI SCHEDE GENERICHE DETAIL BOOTSTRAP ITALIA ===== */

/* Loading detail */
.schedegeneriche-detail-loading {
    background: var(--bs-white);
    border-radius: 0.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    border: 1px solid var(--bs-gray-200);
    margin-bottom: 2rem;
}

.schedegeneriche-detail-loading .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.2rem;
}

/* Header documento */
.schedegeneriche-detail-header .card-header {
    padding: 1.5rem;
    border-bottom: none;
}

.schedegeneriche-detail-header .card-header h1 {
    font-size: 1.5rem;
    line-height: 1.3;
}

/* Informazioni principali */
.schedegeneriche-detail-main-info .card-body {
    padding: 2rem;
}

.schedegeneriche-info-item {
    text-align: center;
    padding: 1rem;
    border-radius: 0.5rem;
    background: var(--bs-gray-50, #f8f9fa);
    border: 1px solid var(--bs-gray-200, #e9ecef);
    height: 100%;
    min-width: 0; /* Permette flessibilità colonne Bootstrap auto-layout */
}

.schedegeneriche-info-title {
    color: var(--bs-body-color, #17324d);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bs-primary, #0066cc);
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedegeneriche-info-content {
    color: var(--bs-body-color, #17324d);
    font-weight: 500;
    font-size: 1rem;
    margin: 0;
    line-height: 1.4;
}

/* Sezioni dettaglio */
.schedegeneriche-detail-section .card {
    border: 1px solid var(--bs-gray-200, #e9ecef);
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.schedegeneriche-detail-section .card-body {
    padding: 2rem;
}

.schedegeneriche-section-title {
    color: var(--bs-body-color, #17324d);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bs-primary, #0066cc);
    display: flex;
    align-items: center;
}

.schedegeneriche-section-content {
    color: var(--bs-body-color, #17324d);
    line-height: 1.6;
    font-size: 1rem;
}

/* Lista allegati */
.schedegeneriche-attachments-list {
    margin-top: 1.5rem;
}

.schedegeneriche-attachment-item {
    padding: 1.5rem;
    border: 1px solid var(--bs-gray-200, #e9ecef);
    border-radius: 0.5rem;
    background: var(--bs-gray-50, #f8f9fa);
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.schedegeneriche-attachment-item:hover {
    background: var(--bs-white);
    border-color: var(--bs-primary-200, #b3d9ff);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.schedegeneriche-attachment-item:last-child {
    margin-bottom: 0;
}

.schedegeneriche-attachment-icon {
    flex-shrink: 0;
}

.schedegeneriche-attachment-content {
    min-width: 0;
}

.schedegeneriche-attachment-description {
    line-height: 1.5;
    font-size: 0.95rem;
}

.schedegeneriche-attachment-description em {
    font-size: 0.85rem;
    line-height: 1.4;
}

.schedegeneriche-attachment-actions {
    flex-shrink: 0;
}

.schedegeneriche-attachment-actions .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
}

/* Navigazione */
.schedegeneriche-detail-navigation .card {
    border: 1px solid var(--bs-gray-200, #e9ecef);
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.schedegeneriche-detail-navigation .card-body {
    padding: 2rem;
}

.schedegeneriche-detail-navigation .btn {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    min-height: 48px; /* Touch target WCAG compliant */
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .schedegeneriche-detail-header .card-header,
    .schedegeneriche-detail-main-info .card-body,
    .schedegeneriche-detail-section .card-body,
    .schedegeneriche-detail-navigation .card-body {
        padding: 1.5rem;
    }
    
    .schedegeneriche-info-item {
        margin-bottom: 1rem;
    }
    
    .schedegeneriche-attachment-item {
        padding: 1.25rem;
    }
}

@media (max-width: 767.98px) {
    .schedegeneriche-detail-header .card-header,
    .schedegeneriche-detail-main-info .card-body,
    .schedegeneriche-detail-section .card-body,
    .schedegeneriche-detail-navigation .card-body {
        padding: 1rem;
    }
    
    .schedegeneriche-detail-header .card-header h1 {
        font-size: 1.25rem;
    }
    
    .schedegeneriche-info-title {
        font-size: 0.85rem;
    }
    
    .schedegeneriche-info-content {
        font-size: 0.9rem;
    }
    
    .schedegeneriche-section-title {
        font-size: 1rem;
    }
    
    .schedegeneriche-section-content {
        font-size: 0.9rem;
    }
    
    .schedegeneriche-attachment-item {
        padding: 1rem;
    }
    
    .schedegeneriche-attachment-item .d-flex {
        flex-direction: column;
        gap: 1rem;
    }
    
    .schedegeneriche-attachment-actions {
        align-self: stretch;
    }
    
    .schedegeneriche-attachment-actions .btn-group {
        width: 100%;
    }
    
    .schedegeneriche-attachment-actions .btn {
        flex: 1;
    }
}

@media (max-width: 575.98px) {
    .schedegeneriche-detail-navigation .d-flex {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch !important;
        justify-content: stretch !important;
    }
    
    .schedegeneriche-detail-navigation .btn {
        width: 100%;
        justify-content: center;
        min-height: 52px; /* Più touch-friendly su schermi molto piccoli */
    }
    
    .schedegeneriche-attachment-actions .btn-group {
        flex-direction: column;
    }
    
    .schedegeneriche-attachment-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        border-radius: 0.375rem !important;
    }
    
    .schedegeneriche-attachment-actions .btn:last-child {
        margin-bottom: 0;
    }
}

/* Alto contrasto */
@media (prefers-contrast: high) {
    .schedegeneriche-info-item {
        border-width: 2px;
        border-color: var(--bs-primary, #0066cc);
    }
    
    .schedegeneriche-info-title {
        border-bottom-width: 3px;
    }
    
    .schedegeneriche-section-title {
        border-bottom-width: 3px;
    }
    
    .schedegeneriche-attachment-item:hover {
        border-width: 2px;
        border-color: var(--bs-primary, #0066cc);
    }
    
    .schedegeneriche-detail-section .card,
    .schedegeneriche-detail-navigation .card {
        border-width: 2px;
    }
}

/* Movimento ridotto */
@media (prefers-reduced-motion: reduce) {
    .schedegeneriche-attachment-item {
        transition: none;
    }
    
    .schedegeneriche-attachment-item:hover {
        transform: none;
    }
    
    .schedegeneriche-detail-loading .spinner-border {
        animation: none;
        border-top-color: transparent;
    }
}

/* ========================================
   HEADER BOOTSTRAP ITALIA PA STANDARD
   ======================================== */

/* Header wrapper principale - STICKY per layout PA */
.it-header-wrapper {
    background: linear-gradient(135deg, 
        var(--bs-primary, #0066cc) 0%, 
        var(--bs-primary-600, #0052a3) 100%);
    color: var(--bs-white);
    border-bottom: 1px solid var(--bs-primary-700, #004085);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
    position: sticky;
    top: 0;
    z-index: 1020;
    width: 100%;
}

/* Slim Header - Barra sottile superiore */
.it-header-slim-wrapper {
    background: var(--bs-primary, #0066cc);
    color: var(--bs-white);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bs-primary-600, #0052a3);
}

.it-header-slim-wrapper-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.5rem;
}

.it-header-slim-wrapper .navbar-brand {
    color: var(--bs-white);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    margin: 0;
}

.it-header-slim-wrapper .navbar-brand:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

/* Mobile navigation toggle slim header */
.it-header-slim-wrapper .nav-mobile {
    display: flex;
    align-items: center;
}

.it-header-slim-wrapper .it-opener {
    display: flex;
    align-items: center;
    color: var(--bs-white);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.it-header-slim-wrapper .it-opener:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--bs-white);
    text-decoration: none;
}

.it-header-slim-wrapper .it-opener .icon {
    margin-left: 0.5rem;
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

.it-header-slim-wrapper .it-opener[aria-expanded="true"] .icon {
    transform: rotate(180deg);
}

/* Right zone slim header */
.it-header-slim-right-zone {
    display: flex;
    align-items: center;
}

.it-header-slim-right-menu {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 1.5rem;
}

.it-header-slim-right-menu .list-item {
    color: var(--bs-white);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.it-header-slim-right-menu .list-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--bs-white);
    text-decoration: none;
}

/* Collapsible menu mobile slim */
.it-header-slim-wrapper .link-list-wrapper {
    background: var(--bs-primary-600, #0052a3);
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.it-header-slim-wrapper .link-list {
    margin: 0;
    padding: 0.5rem;
    list-style: none;
}

.it-header-slim-wrapper .link-list .list-item {
    display: block;
    color: var(--bs-white);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.it-header-slim-wrapper .link-list .list-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--bs-white);
    text-decoration: none;
}

/* Header Centrale - Logo e info */
.it-header-center-wrapper {
    padding: 1.5rem 0;
    background: transparent; /* Eredita gradient dal wrapper principale */
    color: var(--bs-white);
}

.it-header-center-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* Brand wrapper */
.it-brand-wrapper a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 1.25rem;
}

.it-brand-wrapper a:hover {
    text-decoration: none;
}

.it-brand-wrapper .icon {
    color: var(--bs-primary, #0066cc);
    width: 3.5rem;
    height: 3.5rem;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0, 102, 204, 0.2));
}

/* Override brand per header blu */
.it-header-wrapper .it-brand-wrapper .icon {
    color: var(--bs-white);
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.2));
}

.it-brand-text {
    flex: 1;
}

.it-brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bs-body-color, #17324d);
    line-height: 1.2;
    margin: 0;
}

.it-brand-tagline {
    font-size: 1rem;
    color: var(--bs-primary, #0066cc);
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

/* Override brand text per header blu */
.it-header-wrapper .it-brand-title {
    color: var(--bs-white);
}

.it-header-wrapper .it-brand-tagline {
    color: rgba(255, 255, 255, 0.85);
}

/* Right zone - Social e ricerca */
.it-header-center-wrapper .it-right-zone {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.it-socials {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.it-socials span {
    color: var(--bs-text-muted, #6c757d);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Override social per header blu */
.it-header-wrapper .it-socials span {
    color: rgba(255, 255, 255, 0.9);
}

.it-socials ul {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 0.75rem;
}

.it-socials ul li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--bs-primary, #0066cc);
    color: var(--bs-white);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
}

.it-socials ul li a:hover {
    background: var(--bs-primary-600, #0052a3);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

/* Override social links per header blu */
.it-header-wrapper .it-socials ul li a {
    background: rgba(255, 255, 255, 0.2);
    color: var(--bs-white);
    backdrop-filter: blur(10px);
}
.it-header-wrapper .it-socials ul li a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.it-socials ul li a .icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Search wrapper */
.it-search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.it-search-wrapper span {
    color: var(--bs-text-muted, #6c757d);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Override search per header blu */
.it-header-wrapper .it-search-wrapper span {
    color: rgba(255, 255, 255, 0.9);
}

.search-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--bs-secondary, #6c757d);
    color: var(--bs-white);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.2s ease;
}

.search-link:hover {
    background: var(--bs-primary, #0066cc);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
    color: var(--bs-white);
    text-decoration: none;
}

.search-link .icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Override search link per header blu */
.it-header-wrapper .search-link {
    background: rgba(255, 255, 255, 0.2);
    color: var(--bs-white);
    backdrop-filter: blur(10px);
}

.it-header-wrapper .search-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    color: var(--bs-white);
    text-decoration: none;
}

/* Header Nav - Navigazione principale */
.it-header-navbar-wrapper {
    background: var(--bs-white);
    border-top: 1px solid var(--bs-gray-200, #e9ecef);
    padding: 0.75rem 0;
}

.it-header-navbar-wrapper.theme-light-desk {
    background: var(--bs-white);
}

.it-header-navbar-wrapper.theme-dark-mobile {
    /* Mobile theming sarà gestito con media queries */
}

/* Navbar principale */
.it-header-navbar-wrapper .navbar {
    padding: 0;
}

.custom-navbar-toggler {
    border: none;
    background: var(--bs-primary, #0066cc);
    color: var(--bs-white);
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.15s ease, transform 0.1s ease; /* Transizioni più veloci */
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1050;
    cursor: pointer; /* Migliore feedback visivo */
}

.custom-navbar-toggler:hover {
    background: var(--bs-primary-600, #0052a3);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.custom-navbar-toggler:active {
    transform: scale(0.95); /* Feedback tattile */
    transition: transform 0.1s ease;
}

.custom-navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 102, 204, 0.25);
    outline: 0;
}

.custom-navbar-toggler .icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* Navigation menu */
.navbar-collapsible {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.navbar-nav {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 2rem;
}

.navbar-nav .nav-item {
    position: relative;
}

.navbar-nav .nav-link {
    color: var(--bs-body-color, #17324d);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: var(--bs-primary, #0066cc);
    background: var(--bs-primary-100, #e6f3ff);
    text-decoration: none;
}

.navbar-nav .nav-link:focus {
    color: var(--bs-primary-700, #004085);
    background: var(--bs-primary-100, #e6f3ff);
    box-shadow: 0 0 0 0.25rem rgba(0, 102, 204, 0.25);
    outline: 0;
    text-decoration: none;
}

.navbar-nav .nav-link.active {
    color: var(--bs-primary, #0066cc);
    background: var(--bs-primary-100, #e6f3ff);
    font-weight: 700;
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: var(--bs-primary, #0066cc);
    border-radius: 1.5px;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .it-header-center-content-wrapper {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .it-brand-wrapper a {
        flex-direction: column;
        gap: 1rem;
    }
    
    .it-brand-wrapper .icon {
        width: 3rem;
        height: 3rem;
    }
    
    .it-brand-title {
        font-size: 1.25rem;
    }
    
    .it-brand-tagline {
        font-size: 0.9rem;
    }
    
    .it-header-center-wrapper .it-right-zone {
        justify-content: center;
        gap: 1rem;
    }
    
    .it-socials {
        gap: 0.75rem;
    }
    
    .it-socials ul {
        gap: 0.5rem;
    }
    
    .it-socials ul li a {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .it-socials ul li a .icon {
        width: 1rem;
        height: 1rem;
    }
    
    .it-search-wrapper .search-link {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .it-search-wrapper .search-link .icon {
        width: 1rem;
        height: 1rem;
    }
}

@media (max-width: 767.98px) {
    .it-header-slim-wrapper {
        padding: 0.375rem 0;
    }
    
    .it-header-slim-wrapper-content {
        min-height: 2rem;
    }
    
    .it-header-slim-wrapper .navbar-brand {
        font-size: 0.9rem;
    }
    
    .it-header-slim-right-menu {
        gap: 1rem;
    }
    
    .it-header-slim-right-menu .list-item {
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
    }
    
    .it-header-center-wrapper {
        padding: 1rem 0;
    }
    
    .it-brand-title {
        font-size: 1.1rem;
    }
    
    .it-brand-tagline {
        font-size: 0.85rem;
    }
    
    .it-socials span,
    .it-search-wrapper span {
        display: none;
    }
    
    .it-header-navbar-wrapper {
        padding: 0.5rem 0;
    }
    
    /* Mobile theme - dark background */
    .it-header-navbar-wrapper.theme-dark-mobile {
        background: var(--bs-primary, #0066cc);
    }
    
    .it-header-navbar-wrapper.theme-dark-mobile .custom-navbar-toggler {
        background: var(--bs-white);
        color: var(--bs-primary, #0066cc);
    }
    
    .it-header-navbar-wrapper.theme-dark-mobile .custom-navbar-toggler:hover {
        background: rgba(255, 255, 255, 0.9);
    }
    
    /* Testo bianco per nav-link su mobile dark theme */
    .it-header-navbar-wrapper.theme-dark-mobile .navbar-nav .nav-link {
        color: var(--bs-white) !important;
    }
    
    .it-header-navbar-wrapper.theme-dark-mobile .navbar-nav .nav-link:hover {
        color: var(--bs-white) !important;
        background: rgba(255, 255, 255, 0.1) !important;
    }
    
    .it-header-navbar-wrapper.theme-dark-mobile .navbar-nav .nav-link:focus {
        color: var(--bs-white) !important;
        background: rgba(255, 255, 255, 0.2) !important;
        box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25) !important;
    }
    
    .it-header-navbar-wrapper.theme-dark-mobile .navbar-nav .nav-link.active {
        color: var(--bs-white) !important;
        background: rgba(255, 255, 255, 0.15) !important;
        font-weight: 700;
    }
    
    /* Icone bianche nel nav-link mobile */
    .it-header-navbar-wrapper.theme-dark-mobile .navbar-nav .nav-link .icon {
        color: var(--bs-white) !important;
    }
}

@media (max-width: 575.98px) {
    .it-header-slim-wrapper .it-header-slim-right-zone {
        display: none;
    }
    
    .it-header-center-wrapper {
        padding: 0.75rem 0;
    }
    
    .it-header-center-content-wrapper {
        gap: 1rem;
    }
    
    .it-brand-wrapper .icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .it-brand-title {
        font-size: 1rem;
    }
    
    .it-header-center-wrapper .it-right-zone {
        gap: 0.75rem;
    }
    
    .it-socials ul li a,
    .it-search-wrapper .search-link {
        width: 2rem;
        height: 2rem;
    }
    
    .it-socials ul li a .icon,
    .it-search-wrapper .search-link .icon {
        width: 0.875rem;
        height: 0.875rem;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .it-header-wrapper {
        border-bottom: 3px solid var(--bs-dark, #212529);
    }
    
    .it-header-slim-wrapper {
        background: var(--bs-dark, #212529);
        border-bottom-color: var(--bs-white);
    }
    
    .it-socials ul li a,
    .search-link {
        border: 2px solid var(--bs-white);
    }
    
    .custom-navbar-toggler {
        border: 2px solid var(--bs-white);
    }
    
    .navbar-nav .nav-link:focus {
        outline: 3px solid var(--bs-primary, #0066cc);
        outline-offset: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .it-header-slim-wrapper .it-opener .icon,
    .it-socials ul li a,
    .search-link,
    .custom-navbar-toggler,
    .navbar-nav .nav-link {
        transition: none;
    }
    
    .it-socials ul li a:hover,
    .search-link:hover {
        transform: none;
    }
}

/* ========================================
   FOOTER BOOTSTRAP ITALIA PA STANDARD
   ======================================== */

/* Footer principale */
.it-footer {
    background: var(--bs-primary, #0066cc);
    color: var(--bs-white);
    width: 100%;
    position: relative;
    clear: both;
    z-index: 1; /* Ensure footer is above other content */
}

/* Layout PA Bootstrap Italia - Footer styling gestito dalla classe base .it-footer */

.it-footer-main {
    padding: 3rem 0 2rem;
    background: var(--bs-primary, #0066cc);
}

/* Brand nel footer */
.it-footer .it-brand-wrapper a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--bs-white);
    gap: 1rem;
}

.it-footer .it-brand-wrapper a:hover {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
}

.it-footer .it-brand-wrapper .icon {
    color: var(--bs-white);
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
}

.it-footer .it-brand-text {
    flex: 1;
}

.it-footer .it-brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--bs-white);
    line-height: 1.2;
    margin: 0;
}

.it-footer .it-brand-tagline {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin: 0;
    line-height: 1.3;
}

/* Titoli sezioni footer */
.footer-heading-title {
    color: var(--bs-white);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

/* Contenuto informativo */
.footer-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.5;
}

.footer-info p {
    margin-bottom: 1rem;
}

.footer-info p:last-child {
    margin-bottom: 0;
}

.footer-info strong {
    color: var(--bs-white);
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.footer-info a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.footer-info a:hover {
    color: var(--bs-white);
    text-decoration: underline;
}

.footer-info a .icon {
    color: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

.footer-info a:hover .icon {
    color: var(--bs-white);
}

/* Footer small prints - Link legali */
.it-footer-small-prints {
    background: var(--bs-primary-600, #0052a3);
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.it-footer-small-prints:last-child {
    border-bottom: none;
}

.it-footer-small-prints-list {
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 2rem;
}

.it-footer-small-prints-list .list-inline-item {
    margin-bottom: 0.5rem;
}

.it-footer-small-prints-list a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: all 0.2s ease;
    display: inline-block;
}

.it-footer-small-prints-list a:hover {
    color: var(--bs-white);
    text-decoration: underline;
}

/* Credits */
.it-footer-small-prints .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.85rem;
    line-height: 1.4;
}

.it-footer-small-prints .text-muted a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.it-footer-small-prints .text-muted a:hover {
    color: var(--bs-white);
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .it-footer-main {
        padding: 2.5rem 0 1.5rem;
    }
    
    .it-footer .it-brand-wrapper a {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .it-footer .it-brand-wrapper .icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .it-footer .it-brand-title {
        font-size: 1.1rem;
    }
    
    .it-footer .it-brand-tagline {
        font-size: 0.9rem;
    }
    
    .footer-heading-title {
        font-size: 1rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .footer-info {
        text-align: center;
        margin-bottom: 2rem;
    }
}

@media (max-width: 767.98px) {
    .it-footer-main {
        padding: 2rem 0 1rem;
    }
    
    .it-footer .it-brand-wrapper .icon {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .it-footer .it-brand-title {
        font-size: 1rem;
    }
    
    .it-footer .it-brand-tagline {
        font-size: 0.85rem;
    }
    
    .footer-heading-title {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    
    .footer-info {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .it-footer-small-prints {
        padding: 1.25rem 0;
    }
    
    .it-footer-small-prints-list {
        gap: 1rem;
        justify-content: center !important;
        text-align: center;
    }
    
    .it-footer-small-prints-list .list-inline-item {
        margin-bottom: 0.75rem;
    }
    
    .it-footer-small-prints .row > div {
        text-align: center !important;
        margin-bottom: 1rem;
    }
    
    .it-footer-small-prints .row > div:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 575.98px) {
    .it-footer-main {
        padding: 1.5rem 0 0.75rem;
    }
    
    .it-footer .it-brand-wrapper a {
        gap: 0.5rem;
    }
    
    .it-footer .it-brand-wrapper .icon {
        width: 2rem;
        height: 2rem;
    }
    
    .it-footer .it-brand-title {
        font-size: 0.95rem;
    }
    
    .it-footer .it-brand-tagline {
        font-size: 0.8rem;
    }
    
    .footer-heading-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .footer-info {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }
    
    .it-footer-small-prints {
        padding: 1rem 0;
    }
    
    .it-footer-small-prints-list {
        gap: 0.75rem;
    }
    
    .it-footer-small-prints-list a {
        font-size: 0.85rem;
        padding: 0.375rem 0;
    }
    
    .it-footer-small-prints .text-muted {
        font-size: 0.8rem;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .it-footer {
        background: var(--bs-dark, #212529);
        border-top: 3px solid var(--bs-white);
    }
    
    .it-footer-main {
        background: var(--bs-dark, #212529);
    }
    
    .it-footer-small-prints {
        background: var(--bs-gray-900, #1a1a1a);
        border-color: var(--bs-white);
    }
    
    .footer-heading-title {
        border-bottom-color: var(--bs-white);
    }
    
    .footer-info a:focus,
    .it-footer-small-prints-list a:focus {
        outline: 3px solid var(--bs-white);
        outline-offset: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .footer-info a,
    .it-footer-small-prints-list a,
    .it-footer-small-prints .text-muted a {
        transition: none;
    }
}

/* Print styles */
@media print {
    .it-footer {
        display: none;
    }
}

/* ⚡ PROTEZIONECIVILEREGIONEABRUZZO - Layout con header semplificato, menu a destra */
/* Menu a destra per PROTEZIONECIVILEREGIONEABRUZZO, menu aperto di default */
.custom-template.protezionecivileregioneabruzzo .pa-content,
.custom-template.protezionecivileregioneabruzzo .pa-sidebar {
    order: inherit; /* Usa order inline dal HTML (order-1, order-2) */
}

.custom-template.protezionecivileregioneabruzzo .row {
    display: flex;
    flex-wrap: wrap;
}

/* Reset mobile per PROTEZIONECIVILEREGIONEABRUZZO */
@media (max-width: 991.98px) {
    .custom-template.protezionecivileregioneabruzzo .pa-content,
    .custom-template.protezionecivileregioneabruzzo .pa-sidebar {
        order: unset !important; /* Reset order su mobile */
    }
}

/* ========================================
   BOOTSTRAP ITALIA LIST COMPONENTS - SCHEDE GENERICHE
   ======================================== */

/* ⚡ Bootstrap Italia List - Sostituzione tabelle con liste accessibili WCAG 2.1 AA */

.schedegeneriche-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius, 0.375rem);
    overflow: hidden;
}

.schedegeneriche-list-item {
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    transition: background-color 0.15s ease-in-out;
}

.schedegeneriche-list-item:last-child {
    border-bottom: none;
}

.schedegeneriche-list-item:hover {
    background-color: var(--bs-primary-100, #e3f2fd);
}

.schedegeneriche-list-item:focus-within {
    background-color: var(--bs-primary-100, #e3f2fd);
    outline: 2px solid var(--bs-primary, #0066cc);
    outline-offset: -2px;
}

/* Layout principale a tre zone */
.schedegeneriche-list-content {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    gap: 1rem;
    min-height: 80px;
}

/* Left Zone: Data e Badge (fissa) */
.schedegeneriche-left-zone {
    flex-shrink: 0;
    width: 140px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.schedegeneriche-date-primary {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--bs-primary, #0066cc);
    margin-bottom: 0.75rem;
}

.schedegeneriche-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.schedegeneriche-badges .badge {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Center Zone: Contenuto principale (espandibile) */
.schedegeneriche-center-zone {
    flex: 1;
    min-width: 0; /* Previene overflow */
}

.schedegeneriche-document-type {
    font-size: 0.75rem;
    color: var(--bs-gray-600, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
}

.schedegeneriche-document-type .icon {
    vertical-align: text-top;
}

.schedegeneriche-title {
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--bs-body-color, #17324d);
    line-height: 1.4;
}

.schedegeneriche-title .icon {
    vertical-align: text-top;
}

.schedegeneriche-info-secondary {
    font-size: 0.875rem;
    color: var(--bs-body-color, #17324d);
    line-height: 1.4;
}

.schedegeneriche-info-secondary .icon {
    vertical-align: text-top;
}

.schedegeneriche-info-primary {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-body-color, #17324d);
    display: flex;
    align-items: center;
    line-height: 1.4;
}

.schedegeneriche-info-primary .icon {
    vertical-align: text-top;
}

/* Right Zone: Azioni (fissa) */
.schedegeneriche-right-zone {
    flex-shrink: 0;
    width: 80px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* Empty State */
.schedegeneriche-empty-state {
    padding: 3rem 1rem;
    text-align: center;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius, 0.375rem);
    background-color: var(--bs-gray-50, #f8f9fa);
}

.schedegeneriche-empty-state .empty-state-content {
    max-width: 400px;
    margin: 0 auto;
}

/* Responsive Breakpoints */

/* Tablet (768px - 991px) */
@media (max-width: 991.98px) {
    .schedegeneriche-left-zone {
        width: 120px;
    }
    
    .schedegeneriche-right-zone {
        width: 70px;
    }
    
    .schedegeneriche-list-content {
        gap: 0.75rem;
    }
}

/* Mobile (fino a 767px) */
@media (max-width: 767.98px) {
    .schedegeneriche-list-content {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .schedegeneriche-left-zone {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .schedegeneriche-badges {
        margin-top: 0;
    }
    
    .schedegeneriche-center-zone {
        width: 100%;
        order: 2;
    }
    
    .schedegeneriche-right-zone {
        width: 100%;
        order: 3;
        justify-content: center;
    }
    
    .schedegeneriche-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .schedegeneriche-info-secondary {
        margin-bottom: 0.5rem;
    }
}

/* Touch-friendly per dispositivi mobili */
@media (hover: none) and (pointer: coarse) {
    .schedegeneriche-list-item {
        min-height: 60px;
    }
    
    .schedegeneriche-list-content {
        padding: 1rem;
    }
    
    .schedegeneriche-right-zone button {
        min-height: 44px;
        min-width: 44px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .schedegeneriche-list-item {
        border-width: 2px;
    }
    
    .schedegeneriche-list-item:focus-within {
        outline-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .schedegeneriche-list-item {
        transition: none;
    }
}

/* ⚡ Floating Action Buttons - Posizionamento a destra */
.schedegeneriche-floating-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    display: flex;
    gap: 0.25rem;
    flex-direction: row;
}

/* Assicuriamo che i button nel floating container siano compatti */
.schedegeneriche-floating-actions .btn {
    min-width: auto;
    padding: 0.375rem 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: var(--bs-border-radius, 0.375rem);
}

.schedegeneriche-floating-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Mobile: Stack buttons verticalmente */
@media (max-width: 575.98px) {
    .schedegeneriche-floating-actions {
        flex-direction: column;
        gap: 0.125rem;
        right: 0.5rem;
        top: 0.5rem;
    }
    
    .schedegeneriche-floating-actions .btn {
        padding: 0.25rem 0.375rem;
        font-size: 0.875rem;
    }
}

/* Print styles */
@media print {
    .schedegeneriche-list-item {
        break-inside: avoid;
        border-bottom: 1px solid #000;
    }
    
    .schedegeneriche-floating-actions {
        display: none;
    }
    
    .schedegeneriche-badges .badge {
        border: 1px solid #000;
        background: transparent !important;
        color: #000 !important;
    }
}

/* ========================================
   BOOTSTRAP ITALIA IT-LIST - DATI PAGAMENTI
   ======================================== */

/* ⚡ SOLO STILI BOOTSTRAP ITALIA UFFICIALI */
.it-list-wrapper {
    background-color: var(--bs-white, #ffffff);
    border-radius: var(--bs-border-radius, 0.375rem);
    box-shadow: 0 2px 10px 0 rgba(0, 102, 204, 0.08);
}

/* Categoria/Data in colore primario */
.it-list .it-category {
    color: var(--bs-primary, #0066cc);
    font-weight: 600;
    font-size: 0.875rem;
}

/* Titolo beneficiario */
.it-list .it-item-text {
    color: var(--bs-gray-900, #17324d);
    font-weight: 600;
    font-size: 1rem;
}

/* Note aggiuntive */
.it-list .it-item-note {
    color: var(--bs-gray-700, #5a6772);
    font-size: 0.875rem;
}

/* ⚡ LEGACY CLASSES - Mantenuto per compatibilità backward */
.badge-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Desktop: Ottimizzazioni tabella */
.dati-pagamenti-desktop tbody tr:hover {
    background-color: var(--bs-gray-50, #f8f9fa);
    transition: background-color 0.15s ease-in-out;
}

.dati-pagamenti-desktop tbody tr:focus-within {
    outline: 1px solid var(--bs-primary, #0066cc);
    outline-offset: -1px;
}

/* Hover effect per righe - Più sottile */
.table-responsive-payment tbody tr:hover {
    background-color: var(--bs-gray-50, #f8f9fa);
    transition: background-color 0.15s ease-in-out;
}

/* Focus per accessibilità */
.table-responsive-payment tbody tr:focus-within {
    outline: 1px solid var(--bs-primary, #0066cc);
    outline-offset: -1px;
}

/* Stile per importi - Più neutro */
.table-responsive-payment .text-success {
    color: var(--bs-gray-900, #212529) !important;
    font-weight: 500;
}

/* Print styles tabelle */
@media print {
    .table-responsive-payment {
        overflow: visible;
    }
    
    .table-responsive-payment .table {
        width: 100%;
        min-width: auto;
    }
    
    .schedegeneriche-grid-controls {
        display: none;
    }
    
    .pagination {
        display: none;
    }
}


/* ========================================
   TABELLA DATI PAGAMENTI ACCESSIBILE WCAG 2.1 AA
   Sostituisce Lista Bootstrap Italia per migliore accessibilità
   ======================================== */

/* Desktop: Tabella normale con styling Bootstrap Italia */
.table-responsive-payment {
    overflow-x: auto;
    border-radius: var(--bs-border-radius, 0.375rem);
    box-shadow: 0 2px 4px rgba(var(--bs-primary-rgb, 0, 102, 204), 0.08);
}

.table-responsive-payment .table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-responsive-payment .table-primary th,
.table-responsive-payment .table > thead > tr > th.table-primary,
.table-responsive-payment thead.table-primary th {
    background-color: var(--bs-primary, #0066cc) !important;
    color: white !important;
    border: none !important;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Forza icone bianche nell'header table-primary */
.table-responsive-payment thead.table-primary th svg.icon,
.table-responsive-payment thead.table-primary th .icon {
    fill: white !important;
    color: white !important;
}

.table-responsive-payment thead.table-primary th svg.icon use,
.table-responsive-payment thead.table-primary th .icon use {
    fill: white !important;
    color: white !important;
}

.table-responsive-payment .table tbody tr:hover {
    background-color: var(--bs-primary-bg-subtle, rgba(0, 102, 204, 0.05));
    transition: background-color 0.15s ease-in-out;
}

.table-responsive-payment .badge-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Mobile: Transform table into cards */
@media (max-width: 767px) {
    .table-responsive-payment {
        overflow-x: visible;
        box-shadow: none;
    }
    
    .table-responsive-payment table,
    .table-responsive-payment thead,
    .table-responsive-payment tbody,
    .table-responsive-payment th,
    .table-responsive-payment td,
    .table-responsive-payment tr {
        display: block;
    }
    
    .table-responsive-payment thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .table-responsive-payment tbody {
        display: block;
    }
    
    .table-responsive-payment tr {
        display: block;
        border: 1px solid var(--bs-border-color, #dee2e6);
        border-radius: var(--bs-border-radius, 0.375rem);
        margin-bottom: 1rem;
        padding: 1rem;
        background: var(--bs-body-bg, #fff);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    .table-responsive-payment td {
        display: block;
        border: none !important;
        text-align: left !important;
        position: relative;
        padding: 0.5rem 0 !important;
        padding-left: 35% !important;
        min-height: 2.5rem;
        display: flex;
        align-items: center;
    }
    
    .table-responsive-payment td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 0;
        top: 0.5rem;
        width: 30%;
        font-weight: 600;
        color: var(--bs-primary, #0066cc);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .table-responsive-payment td:last-child {
        border-bottom: none;
        padding-top: 1rem !important;
        justify-content: center;
        padding-left: 0 !important;
    }
    
    .table-responsive-payment td:last-child:before {
        display: none;
    }
    
    .table-responsive-payment .badge {
        display: inline-block;
        margin: 0.125rem 0.25rem 0.125rem 0;
    }
    
    .table-responsive-payment .btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
        /* Ensure button text is hidden on mobile */
    }
    
    .table-responsive-payment .btn-sm .d-none.d-md-inline,
    .table-responsive-payment .btn-sm .d-none.d-lg-inline {
        display: none !important; /* Force hide all text on mobile cards */
    }
    
    /* Mobile buttons - icon only with proper sizing */
    .table-responsive-payment .btn-sm {
        padding: 0.75rem;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Tablet: Intermediate optimizations */
@media (min-width: 576px) and (max-width: 991px) {
    .table-responsive-payment th,
    .table-responsive-payment td {
        font-size: 0.9rem;
        padding: 0.75rem 0.5rem;
    }
    
    .table-responsive-payment .btn-sm {
        padding: 0.5rem 0.75rem;
        min-height: 44px;
        font-size: 0.875rem; /* Smaller text for tablet */
    }
}

/* Enhanced button focus states for accessibility */
.table-responsive-payment .btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb, 0, 102, 204), 0.25);
    border-color: var(--bs-primary, #0066cc);
}

.table-responsive-payment .btn:hover {
    border-color: var(--bs-primary, #0066cc);
    background-color: var(--bs-primary, #0066cc);
    color: var(--bs-white, #fff);
}

/* Ensure proper button text visibility on different breakpoints */
@media (min-width: 992px) {
    .table-responsive-payment .btn-sm {
        padding: 0.375rem 0.75rem;
        min-height: auto; /* Reset min-height for desktop */
    }
}

/* Focus states for accessibility */
.table-responsive-payment .table tbody tr:focus-within {
    outline: 2px solid var(--bs-primary, #0066cc);
    outline-offset: 2px;
}

.table-responsive-payment .btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb, 0, 102, 204), 0.25);
}

/* Screen reader improvements */
.table-responsive-payment caption {
    caption-side: top;
    padding: 1rem;
    background-color: var(--bs-light, #f8f9fa);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-bottom: none;
    border-radius: var(--bs-border-radius, 0.375rem) var(--bs-border-radius, 0.375rem) 0 0;
    font-weight: 600;
    color: var(--bs-primary, #0066cc);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .table-responsive-payment .table-primary th {
        background-color: #000 !important;
        color: #fff;
        border: 2px solid #fff;
    }
    
    .table-responsive-payment .table tbody tr:hover {
        background-color: #f0f0f0;
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .table-responsive-payment .table tbody tr:hover {
        transition: none;
    }
    
    .table-responsive-payment .btn:focus {
        transition: none;
    }
}

/* ========================================
   GRIDBUTTON RESPONSIVE - PULSANTI CON TESTO
   ======================================== */

/* GridButton: Stili base per entrambi i pulsanti */
.d-flex.gap-1.justify-content-end .btn-sm {
    min-height: 44px; /* Touch-friendly size */
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--bs-border-radius-sm, 0.25rem);
}

/* Enhanced focus states for GridButton */
.d-flex.gap-1.justify-content-end .btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb, 0, 102, 204), 0.25);
    outline: none;
}

/* Hover effects conformi Bootstrap Italia */
.d-flex.gap-1.justify-content-end .btn-primary:hover {
    background-color: var(--bs-primary-600, #0052a3);
    border-color: var(--bs-primary-600, #0052a3);
}

.d-flex.gap-1.justify-content-end .btn-outline-secondary:hover {
    background-color: var(--bs-secondary, #6c757d);
    border-color: var(--bs-secondary, #6c757d);
    color: var(--bs-white, #fff);
}

/* Mobile: Hide text, show only icons */
@media (max-width: 767px) {
    .d-flex.gap-1.justify-content-end .btn-sm {
        padding: 0.75rem;
        min-width: 44px;
    }
    
    .d-flex.gap-1.justify-content-end .btn-sm .d-none.d-md-inline,
    .d-flex.gap-1.justify-content-end .btn-sm .d-none.d-lg-inline {
        display: none !important;
    }
}

/* Tablet: Show abbreviated text */
@media (min-width: 768px) and (max-width: 991px) {
    .d-flex.gap-1.justify-content-end .btn-sm {
        padding: 0.5rem 0.625rem;
        font-size: 0.8rem;
    }
}

/* Desktop: Full text visible */
@media (min-width: 992px) {
    .d-flex.gap-1.justify-content-end .btn-sm {
        padding: 0.375rem 0.75rem;
        min-height: auto;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .d-flex.gap-1.justify-content-end .btn-primary {
        background-color: #000 !important;
        border-color: #000 !important;
        color: #fff;
    }
    
    .d-flex.gap-1.justify-content-end .btn-outline-secondary {
        border-color: #000 !important;
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .d-flex.gap-1.justify-content-end .btn {
        transition: none;
    }
}

/* ========================================
   DATI PAGAMENTI - MOBILE CARDS LAYOUT
   Approccio Card per massima leggibilità mobile
   ======================================== */

/* ⚡ DATI PAGAMENTI MOBILE - DESIGN SOBRIO PA ITALIANA
   Layout minimalista e professionale conforme Bootstrap Italia */

/* Card base sobria senza fronzoli */
.dati-pagamenti-card-simple {
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: var(--bs-border-radius, 0.375rem);
    background: var(--bs-body-bg, #fff);
    margin-bottom: 1rem;
    /* NO box-shadow appariscenti, NO transform, NO transition eccessive */
}

.dati-pagamenti-card-simple:hover {
    /* Hover effect MINIMO per feedback utente senza essere appariscente */
    border-color: var(--bs-gray-400, #ced4da);
}

/* Header semplice senza gradient o colori appariscenti */
.dati-pagamenti-header-simple {
    background: var(--bs-gray-50, #f8f9fa);
    border-bottom: 1px solid var(--bs-border-color, #dee2e6);
    padding: 1rem;
    /* NO gradient, NO colori primari appariscenti */
}

.dati-pagamenti-header-simple .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--bs-gray-900, #212529);
    margin: 0;
    line-height: 1.3;
    /* Titolo sobrio senza icone colorate */
}

/* Body semplice e pulito */
.dati-pagamenti-body-simple {
    padding: 1rem;
    background: var(--bs-white, #ffffff);
    /* Layout pulito senza decorazioni */
}

.dati-pagamenti-body-simple .small {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-gray-600, #6c757d);
    /* Labels discrete e professionali */
}

/* Responsive design sobrio per mobile */
@media (max-width: 575.98px) {
    .dati-pagamenti-card-simple {
        border-radius: 0.25rem;
        margin: 0 0 1rem 0;
    }
    
    .dati-pagamenti-header-simple,
    .dati-pagamenti-body-simple {
        padding: 0.875rem;
    }
    
    .dati-pagamenti-header-simple .card-title {
        font-size: 0.95rem;
    }
}

/* Accessibilità WCAG 2.1 AA per high contrast */
@media (prefers-contrast: high) {
    .dati-pagamenti-card-simple {
        border: 2px solid var(--bs-dark, #212529);
    }
    
    .dati-pagamenti-header-simple {
        background: var(--bs-white, #ffffff);
        border-bottom: 2px solid var(--bs-dark, #212529);
    }
}

/* Reduced motion per accessibilità */
@media (prefers-reduced-motion: reduce) {
    .dati-pagamenti-card-simple {
        /* NO transition per utenti sensibili al movimento */
    }
}

/* Focus states accessibili senza effetti appariscenti */
.dati-pagamenti-card-simple:focus-within {
    outline: 2px solid var(--bs-primary, #0066cc);
    outline-offset: 1px;
    /* Focus visibile ma discreto */
}

/* Print styles per documenti ufficiali */
@media print {
    .dati-pagamenti-card-simple {
        break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 1rem;
        background: #fff !important;
    }
    
    .dati-pagamenti-header-simple {
        background: #f8f9fa !important;
        border-bottom: 1px solid #000;
    }
}

