/* Colori del brand AG Formazione */
:root {
    --ag-primary: #1e4d87;  /* Blu del logo */
    --ag-secondary: #c93437;  /* Rosso del logo */
    --ag-light: #f5f9ff;  /* Azzurro chiaro per sfondi */
    --ag-gray: #f0f2f5;  /* Grigio chiaro */
    --ag-dark: #343a40;  /* Grigio scuro */
}

/* Stili per i grafici */
.chart-wrapper {
    position: relative;
    margin: 20px 0;
    height: 400px;
    max-width: 100%;
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Stili specifici per canvas dei grafici */
.chart-wrapper canvas {
    background-color: white !important;
    border-radius: 4px;
}

/* Regole responsive per i grafici */
@media (max-width: 768px) {
    .chart-wrapper {
        height: 300px;
        margin: 10px 0;
        padding: 10px;
    }
}

@media (max-width: 576px) {
    .chart-wrapper {
        height: 250px;
        margin: 8px 0;
        padding: 8px;
    }
}

/* Anti-flicker: Nasconde il contenuto fino al caricamento completo */
.content-loading {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.content-loaded {
    opacity: 1;
}

/* Skeleton loading per contenuti in caricamento */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* TABELLA UTENTI - DIMENSIONI BILANCIATE E LEGGIBILI */
#usersTable td, #usersTable th {
    padding: 0.5rem 0.4rem !important;
    line-height: 1.3 !important;
    font-size: 0.95rem !important;
    vertical-align: middle !important;
}

#usersTable .btn-group .btn {
    padding: 0.3rem 0.4rem !important;
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
    margin-right: 0.2rem !important;
    min-height: auto !important;
}

#usersTable .btn-group .btn:last-child {
    margin-right: 0 !important;
}

#usersTable .badge {
    font-size: 0.75rem !important;
    padding: 0.25rem 0.4rem !important;
    line-height: 1.2 !important;
}

/* Alert persistenti - non vengono nascosti automaticamente */
.alert-persistent {
    border: 2px solid #0dcaf0 !important;
    background-color: #d1ecf1 !important;
    color: #055160 !important;
    animation: gentle-pulse 3s ease-in-out infinite;
    margin-bottom: 20px !important;
    font-weight: 500;
    /* Impedisce a Bootstrap di nascondere questo alert */
    pointer-events: none;
    /* Rimuove qualsiasi capacità di chiusura */
    user-select: none;
    /* Non può essere nascosto da script esterni */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    /* Priorità massima per evitare override */
    position: relative !important;
    z-index: 9999 !important;
}

.alert-persistent strong {
    color: #003d4d !important;
}

@keyframes gentle-pulse {
    0%, 100% { 
        box-shadow: 0 2px 8px rgba(13, 202, 240, 0.2);
    }
    50% { 
        box-shadow: 0 4px 12px rgba(13, 202, 240, 0.4);
    }
}

/* Stile generale */
body {
    background-color: var(--ag-light);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sidebar contenitore */
.sidebar-container {
    background-color: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

/* Old sticky sidebar - now using fixed in newer section */

/* Stili navigazione sidebar */
.sidebar .list-group-item {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 0.75rem 1.25rem;
    transition: all 0.2s;
}

.sidebar .list-group-item.active {
    background-color: var(--ag-primary);
    border-color: var(--ag-primary);
}

.sidebar .list-group-item:hover:not(.active) {
    background-color: var(--ag-light);
    color: var(--ag-primary);
}

.sidebar .list-group-item i {
    width: 24px;
    text-align: center;
    transition: transform 0.2s;
}

.sidebar .list-group-item:hover i {
    transform: translateX(3px);
}

/* Navbar e hamburger */
.navbar-toggler {
    border: none;
    color: var(--ag-primary);
    padding: 0;
    font-size: 1.5rem;
}

/* Card e elementi UI */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s;
    margin-bottom: 30px; /* Aumentato da 15px a 30px */
    padding: 5px; /* Aggiunto padding interno */
    will-change: transform, box-shadow;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.card:hover {
    transform: translateY(-3px) translateZ(0);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.card-body {
    padding: 1rem; /* Aumentato da 0.5rem a 1rem */
}

/* Stats card con animazione speciale */
.stats-card {
    overflow: hidden;
    position: relative;
    will-change: transform;
    transform: translateZ(0);
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.7s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
}

.stats-card:hover::before {
    left: 100%;
}

/* Cerchi per icone */
.icon-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.bg-primary-light {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

.bg-success-light {
    background-color: rgba(40, 167, 69, 0.1);
}

.bg-warning-light {
    background-color: rgba(255, 193, 7, 0.1);
}

.bg-info-light {
    background-color: rgba(23, 162, 184, 0.1);
}

.bg-danger-light {
    background-color: rgba(220, 53, 69, 0.1);
}

.text-primary {
    color: var(--ag-primary) !important;
}

.text-success {
    color: #28a745 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-info {
    color: #17a2b8 !important;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
    padding: 0.5rem;
}

.card-header h5 {
    color: var(--ag-primary);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Fix per h5 su sfondi colorati - deve essere bianco */
.card-header.bg-primary h5,
.card-header.bg-dark h5,
.card-header.bg-info h5 {
    color: white !important;
}

/* Stili per card speciali */
.card.border-warning {
    border-left: 4px solid #ffc107 !important;
}

/* Pulsanti */
.btn-primary {
    background-color: var(--ag-primary);
    border-color: var(--ag-primary);
}

.btn-primary:hover {
    background-color: #173d6d; /* Versione più scura del blu principale */
    border-color: #173d6d;
}

.btn-secondary {
    background-color: var(--ag-secondary);
    border-color: var(--ag-secondary);
}

.btn-secondary:hover {
    background-color: #b02d30; /* Versione più scura del rosso */
    border-color: #b02d30;
}

/* Dropdown menu stabilizzato */
.static-dropdown {
    position: relative;
    will-change: transform;
    transform: translateZ(0);
}

.static-dropdown .dropdown-menu {
    position: absolute !important;
    z-index: 2000 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: none !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    will-change: opacity, transform !important;
    transform: translateZ(0) !important;
    transition: opacity 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    backface-visibility: hidden;
}

/* Badge e pill */
.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-danger {
    background-color: var(--ag-secondary) !important;
}

.badge.bg-warning {
    color: #212529 !important;
}

/* Tabelle */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--ag-light);
}

.table thead th {
    background-color: var(--ag-primary);
    color: white;
    border-color: #dee2e6;
}

/* Fix per il rendering del testo nelle tabelle */
table {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: 0;
}

table th, table td {
    font-weight: normal !important;
    text-shadow: none !important;
    transform: none !important;
}

/* Regole responsive complete */
@media (max-width: 768px) {
    /* Header e form filtri responsive */
    .d-flex.justify-content-lg-end.align-items-center {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px;
    }
    
    .date-filter-form {
        flex-direction: column !important;
        gap: 10px;
        width: 100% !important;
    }
    
    .date-filter-form .form-group {
        margin-bottom: 0 !important;
        margin-right: 0 !important;
        width: 100%;
    }
    
    .date-filter-form .form-control {
        width: 100% !important;
        min-width: auto !important;
    }
    
    .date-filter-form .d-flex.gap-1 {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .date-filter-form .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Cards responsive */
    .card {
        margin-bottom: 20px;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Stats cards mobile */
    .stats-card .card-body {
        padding: 1rem 0.5rem;
    }
    
    .icon-circle {
        width: 50px;
        height: 50px;
    }
    
    /* Tabelle responsive */
    .table-responsive {
        font-size: 12px;
    }
    
    /* Bottoni responsive */
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Form labels e input */
    .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
    
    .form-control {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 576px) {
    /* Container padding ridotto */
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Header titolo più piccolo */
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    /* Cards ancora più compatte */
    .card {
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .card-header {
        padding: 0.375rem 0.5rem;
    }
    
    .card-header h5 {
        font-size: 0.8rem;
    }
    
    /* Form ancora più compatto */
    .btn {
        font-size: 0.8rem;
        padding: 0.375rem 0.5rem;
    }
    
    .form-control {
        font-size: 0.8rem;
        padding: 0.375rem 0.5rem;
    }
    
    /* Alert più compatto */
    .alert {
        padding: 0.5rem;
        font-size: 0.875rem;
    }
    
    /* Modal responsive */
    .modal-dialog {
        margin: 10px;
    }
    
    .modal-body {
        padding: 1rem 0.5rem;
    }
}

/* Sidebar responsive migliorata */
@media (max-width: 991.98px) {
    .sidebar-container {
        padding-bottom: 1rem;
    }
    
    #mobileSidebar {
        background-color: white;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    
    #mobileSidebar .list-group-item {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        padding: 0.75rem 1rem;
    }
}

/* Fix overflow e scroll orizzontale */
body {
    overflow-x: hidden;
}

.container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

.row {
    margin-left: 0;
    margin-right: 0;
}

.col, [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
}

@media (min-width: 768px) {
    .col, [class*="col-"] {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Miglioramenti per DataTables responsive */
@media (max-width: 768px) {
    .dataTables_wrapper {
        font-size: 12px;
    }
    
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        margin-bottom: 10px;
    }
    
    .dataTables_wrapper .dataTables_length select,
    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        max-width: none !important;
    }
}

/* Progress steps responsive */
@media (max-width: 768px) {
    .progress-steps {
        flex-direction: column;
        gap: 15px;
    }
    
    .progress-step {
        width: 100% !important;
        margin-right: 0 !important;
    }
    
    .step-chevron {
        display: none;
    }
    
    .step-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .step-percentage {
        font-size: 1.5rem;
    }
    
    .step-label {
        font-size: 0.9rem;
    }
}

/* Fix per il rendering del testo nelle tabelle DataTables */
.dataTables_wrapper table {
    font-size: 14px !important;
    letter-spacing: 0 !important;
}

.dataTables_wrapper td, .dataTables_wrapper th {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
}

/* Ottimizzazione tabelle specifiche */
#usersTable {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

#usersTable th, #usersTable td {
    transition: background-color 0.15s linear;
    will-change: background-color;
    font-weight: normal !important;
    font-kerning: normal !important;
    text-shadow: none !important;
    font-smooth: always !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

#usersTable tbody tr {
    /* Rimozione dell'animazione di trasformazione che causa il problema di rendering */
    transition: background-color 0.2s ease;
    backface-visibility: hidden;
}

#usersTable tbody tr:hover {
    /* Effetto hover più evidente ma senza trasformazioni che causano problemi */
    background-color: rgba(30, 77, 135, 0.15) !important;
    z-index: 1;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 3px solid var(--ag-primary);
}

/* Fix specifico per il problema di rendering sgranato */
#usersTable tbody td {
    font-weight: normal !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    letter-spacing: 0 !important;
    transform: none !important;
    /* Disabilita qualsiasi trasformazione */
    perspective: none !important;
    /* Disabilita effetti 3D che possono causare sgranatura */
    text-decoration: none !important;
    /* Assicura che non ci siano decorazioni che possano interferire */
}

/* DataTables personalizzato */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--ag-primary) !important;
    color: white !important;
    border-color: var(--ag-primary) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--ag-light) !important;
    color: var(--ag-primary) !important;
}

/* Dashboard stats */
.display-4 {
    color: var(--ag-primary);
    font-weight: 600;
}

/* Dashboard charts */
.dashboard-chart-container {
    min-height: 450px;
    max-height: none;
    position: relative;
}

/* Icone */
.fas, .far, .fab, .fa {
    color: var(--ag-primary);
}

/* Transizioni e animazioni */
.nav-link, .btn, .list-group-item {
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, color, background-color;
    backface-visibility: hidden;
}

/* Stile responsive per dispositivi mobili */
@media (max-width: 767.98px) {
    .card {
        margin-bottom: 15px;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
}

/* Modifiche agli alert e notifiche */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Colori per status delle misure - versione più visibile */
.status-non-iniziato { color: #6c757d; }
.status-in-corso { color: #ffc107; }
.status-chiuso { color: #28a745; }
.status-rendicontato { color: #0d6efd; }

/* Badge degli stati delle misure - colori originali più intensi */
.badge.bg-secondary {
    background-color: #6c757d !important;
    color: white !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.badge.bg-success {
    background-color: #198754 !important;
    color: white !important;
}

.badge.bg-primary {
    background-color: #0d6efd !important;
    color: white !important;
}

.badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #212529 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
    color: white !important;
}

/* Notifiche */
.notification-badge {
    transition: all 0.3s;
    transform-origin: top right;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-weight: normal !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    transform: none !important;
    perspective: none !important;
    letter-spacing: 0 !important;
    text-shadow: none !important;
}

.notification-badge.pulse {
    animation: pulse-animation 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    will-change: opacity;
    backface-visibility: hidden;
}

@keyframes pulse-animation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

.notification-item {
    border-left: 4px solid transparent;
    transition: all 0.2s cubic-bezier(0.215, 0.61, 0.355, 1);
    will-change: border-color, background-color;
    transform: translateZ(0);
}

.notification-item.unread {
    border-left-color: var(--ag-secondary);
    background-color: rgba(var(--bs-danger-rgb), 0.05);
}

.notification-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.notification-time {
    font-size: 0.8rem;
    color: #6c757d;
}

#notificationBell {
    position: relative;
    will-change: transform;
}

#notificationBell i {
    transition: all 0.3s cubic-bezier(0.215, 0.61, 0.355, 1);
    will-change: color;
    backface-visibility: hidden;
}

#notificationBell:hover i {
    color: var(--ag-secondary);
}

/* Progress bar optimization */
.progress-bar {
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: width;
    backface-visibility: hidden;
}

/* Modal fix per sovrapporre correttamente i modali */
.modal {
    z-index: 1050 !important;
}

.modal-backdrop {
    z-index: 1040 !important;
}

/* Stile specifico per il modale di eliminazione appuntamenti */
.appointment-modal {
    z-index: 1100 !important;
}

.modal-dialog-clickable {
    z-index: 1110 !important;
    position: relative !important;
}

.modal-content-clickable {
    z-index: 1120 !important;
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.modal-footer .btn,
.modal-btn,
.delete-form,
.delete-form button {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1130 !important;
    cursor: pointer !important;
}

.modal-footer form {
    display: inline-block !important;
}

/* Assicura che tutti gli elementi del modale siano cliccabili */
.appointment-modal .modal-header,
.appointment-modal .modal-body,
.appointment-modal .modal-footer,
.appointment-modal button,
.appointment-modal a,
.appointment-modal input,
.appointment-modal form {
    z-index: 1140 !important;
    position: relative !important;
}

/* Footer */
footer {
    background-color: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem 0;
    margin-top: 2rem;
}

/* Data Range Selector */
.date-filter-form {
    margin-bottom: 1rem;
}

.date-filter-form .form-group {
    margin-bottom: 0;
}

.date-filter-form .form-control {
    display: inline-block;
    width: auto;
}

/* Selettori date */
select#date {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

select#date option, select#year option {
    padding: 8px 12px;
    font-size: 14px;
    background-color: white;
    color: #333;
}

select#date option:nth-child(even), select#year option:nth-child(even) {
    background-color: var(--ag-light);
}

select#date option:hover, select#year option:hover {
    background-color: var(--ag-primary);
    color: white;
}

/* Gruppi di date per anno */
select#date optgroup {
    font-weight: bold;
    padding: 8px 0;
    background-color: rgba(30, 77, 135, 0.1);
    color: var(--ag-primary);
}
/* Stili aggiuntivi per migliorare la visibilità dei grafici */
.chart-container {
    background-color: white !important;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-container canvas {
    background-color: white !important;
}

/* Stili per le tabelle con i grafici */
.table-with-charts {
    background-color: #f8f9fa;
}

.table-with-charts .chart-wrapper {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
}

/* Migliora il contrasto dei grafici a torta */
.pie-chart-container {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Stili per grafici a barre */
.bar-chart-container {
    background-color: white;
    border-left: 4px solid var(--ag-primary);
    padding: 20px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Stili per la sezione Dati Target */
.target-stat-card {
    transition: all 0.3s ease;
    transform: scale(1);
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.target-stat-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.target-stat-card .card-body {
    position: relative;
    overflow: hidden;
}

.target-stat-card .card-body::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    transition: all 0.3s ease;
    opacity: 0;
}

.target-stat-card:hover .card-body::before {
    opacity: 1;
    top: -25%;
    right: -25%;
}

.target-stat-card h3 {
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.target-stat-card .fa-2x {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Colori specifici per ciascuna card target */
.target-stat-card.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

.target-stat-card.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%) !important;
}

.target-stat-card.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%) !important;
}

.target-stat-card.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%) !important;
}

.target-stat-card.bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #6610f2 100%) !important;
}

.target-stat-card.bg-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
}

/* Responsive adjustments per la sezione Target */
@media (max-width: 1200px) {
    .target-stat-card h6 {
        font-size: 0.8rem;
    }
    
    .target-stat-card h3 {
        font-size: 1.8rem;
    }
    
    .target-stat-card .fa-2x {
        font-size: 1.5em;
    }
}

@media (max-width: 768px) {
    .target-stat-card {
        margin-bottom: 1rem;
    }
    
    .target-stat-card h6 {
        font-size: 0.75rem;
    }
    
    .target-stat-card h3 {
        font-size: 1.5rem;
    }
}

/* Animazioni per i numeri delle statistiche target */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.target-stat-card h3 {
    animation: countUp 0.8s ease-out;
}

/* Filtro date per la sezione target */
.target-stat-card + .target-stat-card {
    margin-left: 0;
}

/* Miglioramenti per il form di filtro nella sezione target */
.card-header .form-control-sm {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.9);
}

.card-header .form-control-sm:focus {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    background-color: white;
}

/* Stili personalizzati per i tooltip delle card dati target */
.tooltip {
    font-size: 0.875rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.tooltip .tooltip-inner {
    background-color: rgba(33, 37, 41, 0.95);
    color: #ffffff;
    border-radius: 6px;
    padding: 8px 12px;
    max-width: 250px;
    text-align: left;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip .tooltip-arrow {
    border-top-color: rgba(33, 37, 41, 0.95) !important;
}

/* Effetto hover migliorato per le card con tooltip */
.target-stat-card[data-bs-toggle="tooltip"] {
    cursor: help;
    transition: all 0.3s ease;
}

.target-stat-card[data-bs-toggle="tooltip"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Indicatore visivo per card con tooltip */

/* ================================
   STILI PER AGGIORNAMENTO DINAMICO CARD ORE ROBUSTE
   ================================ */

/* Stati di loading per le card ore */
.target-stat-card.loading-state {
    transform: scale(0.98);
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.3);
    border: 2px solid rgba(0, 123, 255, 0.2);
}

.target-stat-card.loading-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(0, 123, 255, 0.8), transparent);
    animation: loading-pulse 1.5s infinite;
}

/* Stati di successo per le card ore */
.target-stat-card.success-state {
    transform: scale(1.02);
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.4);
    border: 2px solid rgba(40, 167, 69, 0.3);
}

.target-stat-card.success-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(40, 167, 69, 0.8);
    animation: success-flash 0.6s ease-out;
}

/* Stati di errore per le card ore */
.target-stat-card.error-state {
    transform: scale(0.98);
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.4);
    border: 2px solid rgba(220, 53, 69, 0.3);
    animation: error-shake 0.6s ease-in-out;
}

.target-stat-card.error-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(220, 53, 69, 0.8);
    animation: error-pulse 1s ease-in-out 3;
}

/* Animazioni */
@keyframes loading-pulse {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes success-flash {
    0% { opacity: 0; transform: scaleX(0); }
    50% { opacity: 1; transform: scaleX(1); }
    100% { opacity: 0; transform: scaleX(1); }
}

@keyframes error-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Posizionamento relativo per gli pseudo-elementi */
.target-stat-card {
    position: relative;
    overflow: hidden;
}

/* Loading spinner migliorato */
.target-stat-card .spinner-border-sm {
    width: 1.2rem;
    height: 1.2rem;
    border-width: 0.15em;
}

/* Stili per testo aggiornamento piccolo */
.target-stat-card small {
    font-size: 0.75rem;
    opacity: 0.8;
}
.target-stat-card[data-bs-toggle="tooltip"]::before {
    content: '\f059';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.75rem;
    opacity: 0.6;
    color: rgba(255, 255, 255, 0.8);
    transition: opacity 0.3s ease;
}

.target-stat-card[data-bs-toggle="tooltip"]:hover::before {
    opacity: 1;
}

/* Fix per dropdown nella sezione corsi */
.corso-card .dropdown-menu {
    position: absolute !important;
    z-index: 2500 !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
    border: 1px solid rgba(0, 0, 0, 0.15);
    transform: none !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
}

.corso-card .static-dropdown {
    position: relative;
    z-index: 1000;
}

/* Stili per grafici cliccabili */
.dashboard-chart-container canvas {
    cursor: pointer !important;
    transition: transform 0.2s ease;
}

.dashboard-chart-container canvas:hover {
    transform: scale(1.02);
}

/* Stili per card grafici cliccabili */
.clickable-chart {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.clickable-chart:hover {
    border-color: rgba(0, 123, 255, 0.3);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.15);
    transform: translateY(-2px);
}

.clickable-chart .card-header {
    background-color: rgba(0, 123, 255, 0.05);
    border-bottom: 1px solid rgba(0, 123, 255, 0.1);
}

.clickable-chart:hover .card-header {
    background-color: rgba(0, 123, 255, 0.1);
}

/* Stili per la barra di progresso a step */
.progress-steps-container {
    width: 100%;
    overflow: hidden;
    margin: 20px 0;
    padding: 0 10px;
}

.progress-steps {
    display: flex;
    width: 100%;
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.progress-step {
    position: relative;
    flex: 1;
    background: #fff;
    min-height: 85px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    text-align: center;
    margin-right: 6px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    cursor: default;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.progress-step.final-step {
    margin-right: 0;
}

/* Colori per ogni step con gradienti */
.progress-step.step-1 {
    background: linear-gradient(135deg, #c93437 0%, #e74c3c 100%);
}

.progress-step.step-2 {
    background: linear-gradient(135deg, #fd7e14 0%, #f39c12 100%);
}

.progress-step.step-3 {
    background: linear-gradient(135deg, #17a2b8 0%, #3498db 100%);
}

.progress-step.step-4 {
    background: linear-gradient(135deg, #28a745 0%, #2ecc71 100%);
}

/* Effetto chevron per tutti i step tranne l'ultimo */
.progress-step:not(.final-step)::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 0;
    width: 0;
    height: 0;
    border-top: 40px solid transparent;
    border-bottom: 40px solid transparent;
    border-left: 12px solid;
    z-index: 2;
}

.progress-step.step-1::after {
    border-left-color: #c93437;
}

.progress-step.step-2::after {
    border-left-color: #fd7e14;
}

.progress-step.step-3::after {
    border-left-color: #17a2b8;
}

/* Header dei step */
.step-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px;
}

.step-percentage {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
    display: block;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.95;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Effetti hover migliorati */
.progress-step:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.progress-step:hover .step-percentage {
    transform: scale(1.1);
}

.progress-step:hover .step-label {
    font-weight: 600;
}

/* Responsive design */
@media (max-width: 768px) {
    .progress-step {
        min-height: 70px;
        margin-right: 4px;
    }
    
    .progress-step:not(.final-step)::after {
        right: -8px;
        border-top: 35px solid transparent;
        border-bottom: 35px solid transparent;
        border-left: 8px solid;
    }
    
    .step-percentage {
        font-size: 1.2rem;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .progress-step {
        min-height: 60px;
        margin-right: 2px;
    }
    
    .progress-step:not(.final-step)::after {
        right: -6px;
        border-top: 30px solid transparent;
        border-bottom: 30px solid transparent;
        border-left: 6px solid;
    }
    
    .step-percentage {
        font-size: 1rem;
    }
    
    .step-label {
        font-size: 0.7rem;
    }
}

/* Stili specifici per la barra "Avviabile" - Colori identici alla barra "In Corso" */
.startable-progress .progress-step.step-1 {
    background: linear-gradient(135deg, #c93437 0%, #e74c3c 100%);
}

.startable-progress .progress-step.step-2 {
    background: linear-gradient(135deg, #fd7e14 0%, #ff922b 100%);
}

.startable-progress .progress-step.step-3 {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
}

.startable-progress .progress-step.step-4 {
    background: linear-gradient(135deg, #28a745 0%, #2ecc71 100%);
}

.startable-progress .progress-step:not(.final-step)::after {
    border-left-color: transparent;
}

.startable-progress .progress-step.step-1:not(.final-step)::after {
    border-left-color: #c93437;
}

.startable-progress .progress-step.step-2:not(.final-step)::after {
    border-left-color: #fd7e14;
}

.startable-progress .progress-step.step-3:not(.final-step)::after {
    border-left-color: #17a2b8;
}

/* ==============================================
   Select2 Custom Styles - Fix Visibility Issue
   ============================================== */

/* Base styles for Select2 container */
.select2-container--bootstrap-5 .select2-selection--single {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    color: #212529 !important;
    min-height: calc(1.5em + 0.75rem + 2px) !important;
}

/* Text inside the selection */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: #212529 !important;
    background-color: transparent !important;
    padding-left: 0.75rem !important;
    padding-right: 2rem !important;
}

/* Placeholder text */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder {
    color: #6c757d !important;
}

/* Arrow button */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
    background-color: transparent !important;
    border: none !important;
    right: 0.75rem !important;
}

/* Dropdown container */
.select2-container--bootstrap-5 .select2-dropdown {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    z-index: 9999 !important;
}

/* Dropdown options */
.select2-container--bootstrap-5 .select2-results__option {
    background-color: #ffffff !important;
    color: #212529 !important;
    padding: 0.5rem 0.75rem !important;
    border: none !important;
}

/* Highlighted option (hover) */
.select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: #0d6efd !important;
    color: #ffffff !important;
}

/* Selected option */
.select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: #e9ecef !important;
    color: #495057 !important;
}

/* Search field in dropdown */
.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    color: #212529 !important;
    padding: 0.375rem 0.75rem !important;
    border-radius: 0.375rem !important;
    margin: 0.5rem !important;
    width: calc(100% - 1rem) !important;
}

/* Focus states */
.select2-container--bootstrap-5.select2-container--focus .select2-selection--single {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field:focus {
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    outline: none !important;
}

/* Ensure visibility in card containers */
.card .select2-container--bootstrap-5 .select2-selection--single,
.modal .select2-container--bootstrap-5 .select2-selection--single {
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* Dark theme overrides (if needed) */
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option {
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* Clear button (X) */
.select2-container--bootstrap-5 .select2-selection__clear {
    background-color: transparent !important;
    border: none !important;
    color: #6c757d !important;
    font-size: 1.2em !important;
    right: 2rem !important;
}

.select2-container--bootstrap-5 .select2-selection__clear:hover {
    color: #495057 !important;
}

/* Fix for small dark elements - make them white */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow b {
    background-color: #ffffff !important;
    color: #495057 !important;
    border-color: #495057 transparent transparent transparent !important;
}

.select2-container--bootstrap-5.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #495057 transparent !important;
}

/* Additional fixes for any remaining dark elements */
.select2-container--bootstrap-5 .select2-selection--single::after,
.select2-container--bootstrap-5 .select2-selection--single::before {
    background-color: #ffffff !important;
    color: #495057 !important;
}

/* Fix dropdown arrow icon specifically */
.select2-container--bootstrap-5 .select2-selection__arrow::after {
    background-color: #ffffff !important;
    color: #495057 !important;
}

/* Make sure all small elements are visible */
.select2-container--bootstrap-5 * {
    color: #212529 !important;
}

.select2-container--bootstrap-5 .select2-selection--single,
.select2-container--bootstrap-5 .select2-selection--single * {
    background-color: #ffffff !important;
}

/* Ultra-aggressive fix for ALL Select2 elements */
.select2-container * {
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* Select2 multiple: stile per i tag e pulsante rimozione */
.select2-selection--multiple .select2-selection__choice {
    background-color: #1E4D87 !important;
    border-color: #1E4D87 !important;
    color: white !important;
}

.select2-selection--multiple .select2-selection__choice__remove {
    color: white !important;
    background-color: transparent !important;
    border-color: rgba(255,255,255,0.3) !important;
}

.select2-selection--multiple .select2-selection__choice__remove:hover {
    background-color: rgba(255,255,255,0.2) !important;
    color: white !important;
}

/* Fix per dropdown professioni - forza visibilità */
#lavoro_preferenza_1_chosen,
#lavoro_preferenza_2_chosen, 
#lavoro_preferenza_3_chosen,
.select2-container[data-select2-id*="lavoro_preferenza"] {
    z-index: 10000 !important;
}

/* Assicura overflow visibile sui container delle professioni */
*:has(> #lavoro_preferenza_1),
*:has(> #lavoro_preferenza_2),
*:has(> #lavoro_preferenza_3) {
    overflow: visible !important;
}

/* Container padre delle preferenze lavorative */
.user-form *:has(.form-select[id*="lavoro_preferenza"]) {
    overflow: visible !important;
}

/* Fix ULTRA-AGGRESSIVO per lavoro_preferenza_1 */
#lavoro_preferenza_1,
#lavoro_preferenza_2,
#lavoro_preferenza_3 {
    z-index: 9999 !important;
}

/* Forza apertura dropdown con posizione assoluta */
.select2-container[data-select2-id] .select2-dropdown {
    position: fixed !important;
    z-index: 10001 !important;
    top: auto !important;
    left: auto !important;
}

/* Assicura che ogni sezione professioni abbia overflow visibile */
[id*="Prima_Scelta"] *,
[id*="Seconda_Scelta"] *,
[id*="Terza_Scelta"] *,
*:has(#lavoro_preferenza_1),
*:has(#lavoro_preferenza_2), 
*:has(#lavoro_preferenza_3),
.mb-3:has([id*="lavoro_preferenza"]) {
    overflow: visible !important;
    position: relative !important;
    z-index: 1 !important;
}

.select2-dropdown * {
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* Specific fix for the arrow triangle */
.select2-container--bootstrap-5 .select2-selection__arrow::after,
.select2-container--bootstrap-5 .select2-selection__arrow::before,
.select2-container .select2-selection__arrow::after,
.select2-container .select2-selection__arrow::before {
    background: #ffffff !important;
    border-top-color: #6c757d !important;
    border-left-color: transparent !important;
    border-right-color: transparent !important;
    border-bottom-color: transparent !important;
}

/* Force white background on everything Select2 related */
.select2-container,
.select2-container *,
.select2-dropdown,
.select2-dropdown *,
.select2-results,
.select2-results * {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

/* Fix solo per l'icona del filtro - renderla bianca */
.btn i.fas.fa-filter {
    color: white !important;
}

.btn-primary i.fas.fa-filter {
    color: white !important;
}

/* Estetica dropdown - aggiunge frecetta per chiarezza */
.form-select,
.select2-container--bootstrap-5 .select2-selection--single,
.select2-container .select2-selection--single {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
    padding-right: 2.25rem !important;
}

/* ===== FIX DEFINITIVO PER DROPDOWN SELECT2 ===== */
/* Soluzione pulita senza conflitti CSS */

/* Z-index unico e corretto per dropdown */
.select2-dropdown {
    z-index: 10000 !important;
    position: absolute !important;
}

.select2-container--open .select2-dropdown {
    z-index: 10000 !important;
}

/* Risultati con scroll se necessario */
.select2-results__options {
    max-height: 250px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Solo per form con Select2: permetti overflow */
.user-form .card-body {
    overflow: visible !important;
}

/* Target the specific blue element */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #212529 !important;
}

/* Override any theme colors */
.select2-container--bootstrap-5.select2-container--open .select2-selection--single,
.select2-container--bootstrap-5.select2-container--focus .select2-selection--single {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-color: #86b7fe !important;
}

/* Make sure no gradients or other backgrounds leak through */
.select2-container * {
    background-image: none !important;
    background-gradient: none !important;
    box-shadow: none !important;
}

/* FIX HOVER DROPDOWN - Solo per select nativi, NON per Select2 */
.form-select:not(.select2-hidden-accessible) {
    padding: 0.5rem 2.25rem 0.5rem 0.75rem !important;
    line-height: 1.4 !important;
    background-color: #fff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem !important;
}

.form-select:not(.select2-hidden-accessible):hover {
    background-color: #f8f9fa !important;
    border-color: #adb5bd !important;
}

.form-select:not(.select2-hidden-accessible):focus {
    background-color: #fff !important;
    border-color: #86b7fe !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* FIX SELECT2 HOVER - Ripristina sfondo blu per hover */
.select2-container--bootstrap-5 .select2-results__option { 
    color: #212529 !important; 
}

.select2-container--bootstrap-5 .select2-results__option--highlighted,
.select2-container--bootstrap-5 .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--bs-primary, #0d6efd) !important;
    color: #fff !important;
}

/* FORZA tutti gli elementi interni nell'hover ad avere sfondo blu */
.select2-container--bootstrap-5 .select2-results__option--highlighted *,
.select2-container--bootstrap-5 .select2-results__option--highlighted.select2-results__option--selectable * {
    background-color: transparent !important;
    color: #fff !important;
}

/* Sicurezza extra per hover Select2 */
.select2-container--bootstrap-5 .select2-results__option:hover {
    background-color: var(--bs-primary, #0d6efd) !important;
    color: #fff !important;
}

.select2-container--bootstrap-5 .select2-results__option:hover * {
    background-color: transparent !important;
    color: #fff !important;
}

/* ========================================
   SIDEBAR PROFESSIONALE - FIXED
   ======================================== */

@media (min-width: 992px) {
    /* Sidebar fissa */
    .sidebar-container {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 16.666667%;
        height: 100vh;
        overflow-y: auto;
        padding: 1rem;
        z-index: 1000;
        background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(241, 245, 249, 0.95) 100%);
    }
    
    /* Contenuto principale spostato a destra */
    .main-content {
        margin-left: 16.666667% !important;
        width: calc(100% - 16.666667%) !important;
        max-width: calc(100% - 16.666667%) !important;
    }
}

.sidebar-container .sidebar-header,
.sidebar-container .sidebar {
    background: transparent;
}

.sidebar-container .sidebar {
    border-radius: 8px;
}

.sidebar .list-group {
    background: transparent;
}

.sidebar .list-group-item {
    background: transparent;
    border: none;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    color: #4a5568;
    font-weight: 500;
}

.sidebar .list-group-item:hover {
    background: rgba(30, 77, 135, 0.1);
    color: var(--ag-primary);
    transform: translateX(3px);
}

.sidebar .list-group-item.active {
    background: var(--ag-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(30, 77, 135, 0.3);
}

.sidebar .list-group-item.active i {
    color: white !important;
}

.sidebar .list-group-item.text-danger:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Dropdown submenu items */
.sidebar .sidebar-dropdown .collapse .list-group-item {
    font-size: 0.9rem;
    padding-left: 2rem;
    background: rgba(0, 0, 0, 0.02);
}

.sidebar .sidebar-dropdown .collapse .list-group-item:hover {
    background: rgba(30, 77, 135, 0.08);
}

.sidebar .sidebar-dropdown .collapse .list-group-item.active {
    background: var(--ag-primary);
    color: white;
}

.sidebar .sidebar-dropdown .collapse .list-group-item.active i {
    color: white !important;
}

/* User info box */
.user-info {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border: 1px solid rgba(30, 77, 135, 0.1);
}

/* Notification bell header styles */
.notification-badge-header {
    font-size: 0.65rem;
    min-width: 18px;
    padding: 3px 6px;
}

#notificationBellDesktop:hover,
#notificationBellMobileHeader:hover {
    color: var(--ag-primary) !important;
}

/* Chevron rotation for dropdowns */
.sidebar-dropdown a[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.sidebar-dropdown .fa-chevron-down {
    transition: transform 0.2s ease;
}

/* Border separator styling */
.sidebar .border-top {
    border-color: rgba(0, 0, 0, 0.08) !important;
    margin: 1rem 0 !important;
}

/* ========================================
   USER CARD - Stile professionale
   ======================================== */
.user-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(30, 77, 135, 0.1);
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: #1E4D87 !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white !important;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.user-avatar i,
.user-avatar .fas,
.user-avatar .fa-user {
    color: white !important;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-card-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.user-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    text-decoration: none;
}

.user-action-btn:hover {
    background: var(--ag-primary);
    color: white;
    transform: translateY(-2px);
}

.user-action-btn.logout-btn:hover {
    background: #dc3545;
    color: white;
}

/* ========================================
   PAGE HEADER - Stile professionale
   ======================================== */
.page-header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.page-title-section {
    flex: 1;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
}

.page-title i {
    color: var(--ag-primary);
}

.page-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-action-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-action-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    color: white;
}

.btn-action-primary {
    background: linear-gradient(135deg, var(--ag-primary) 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 77, 135, 0.3);
}

.btn-action-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 77, 135, 0.4);
    color: white;
}

/* ========================================
   FILTER CARD - Filtri professionali
   ======================================== */
.filter-card {
    background: rgba(248, 250, 252, 0.8);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 140px;
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select,
.filter-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #334155;
    background: white;
    transition: all 0.2s ease;
    min-width: 140px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--ag-primary);
    box-shadow: 0 0 0 3px rgba(30, 77, 135, 0.1);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-filter-primary {
    background: var(--ag-primary);
    color: white;
}

.btn-filter-primary:hover {
    background: #163d6b;
    color: white;
}

.btn-filter-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-filter-secondary:hover {
    background: #cbd5e1;
    color: #334155;
}

/* Responsive */
@media (max-width: 768px) {
    .page-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-actions {
        width: 100%;
    }
    
    .btn-action {
        flex: 1;
        justify-content: center;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select,
    .filter-input {
        width: 100%;
    }
    
    .filter-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .btn-filter {
        flex: 1;
        justify-content: center;
    }
}

/* =====================================================
   AMMINISTRAZIONE CORSI - STILI PROFESSIONALI
   ===================================================== */

/* Header pagina con gradiente */
.admin-corsi-header {
    background: linear-gradient(135deg, var(--ag-primary) 0%, #2d5a9e 50%, #1a3a6c 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(30, 77, 135, 0.25);
    position: relative;
    overflow: hidden;
}

.admin-corsi-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.admin-corsi-header h2 {
    margin: 0;
    font-weight: 700;
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.admin-corsi-header h2 i {
    font-size: 2rem;
    opacity: 0.9;
}

.admin-corsi-subtitle {
    margin: 0.5rem 0 0 0;
    opacity: 0.85;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

/* Tabs professionali */
.admin-tabs {
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-tabs .nav-link {
    border: none;
    border-radius: 10px;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    position: relative;
}

.admin-tabs .nav-link:hover {
    color: var(--ag-primary);
    background: rgba(30, 77, 135, 0.08);
}

.admin-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--ag-primary) 0%, #2d5a9e 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(30, 77, 135, 0.35);
}

.admin-tabs .nav-link i {
    font-size: 1.1rem;
}

/* Dashboard Cards con animazione */
.stat-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}

.stat-card .card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card p {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Icona decorativa nelle stat cards */
.stat-card-icon {
    position: absolute;
    right: 1rem;
    bottom: 0.5rem;
    font-size: 4rem;
    opacity: 0.15;
    z-index: 0;
}

/* Cards con header migliorato */
.admin-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.admin-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.admin-card .card-header {
    border-bottom: none;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.admin-card-header-primary {
    background: linear-gradient(135deg, var(--ag-primary) 0%, #2d5a9e 100%);
    color: white;
}

.admin-card-header-primary h5,
.admin-card-header-primary h5 i {
    color: white !important;
}

.admin-card-header-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.admin-card-header-info {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
}

.admin-card-header-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #1f2937;
}

.admin-card-header-dark {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
}

.admin-card-header-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    color: white;
}

.admin-card .card-header h5 {
    margin: 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tabelle professionali */
.admin-table {
    margin-bottom: 0;
}

.admin-table thead {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

.admin-table thead th {
    border: none;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

.admin-table tbody tr {
    transition: all 0.2s ease;
}

.admin-table tbody tr:hover {
    background-color: rgba(30, 77, 135, 0.05);
}

.admin-table tbody td {
    padding: 0.875rem 1.25rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}

#coursesTable .course-actions-cell {
    width: 140px;
    min-width: 140px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    white-space: nowrap;
}

#coursesTable .course-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.35rem;
    white-space: nowrap;
}

#coursesTable .course-actions .btn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Pulsanti azione nella tabella */
.btn-action-view {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    border: none;
    color: white;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-action-view:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    color: white;
}

.btn-action-edit {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    border: none;
    color: #1f2937;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-action-edit:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    color: #1f2937;
}

.btn-action-delete {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    border: none;
    color: white;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-action-delete:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    color: white;
}

/* Form nuovo corso migliorato */
.course-form-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
}

.course-form-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ag-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

/* Phase cards migliorate */
.phase-card-pro {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.phase-card-pro:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.phase-card-pro .card-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
}

.phase-card-pro .card-header strong {
    color: var(--ag-primary);
    font-size: 1rem;
}

.phase-card-pro .card-body {
    padding: 1.25rem;
}

/* Accordion profili migliorato */
.profile-accordion .accordion-item {
    border: none;
    border-radius: 12px !important;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

.profile-accordion .accordion-button {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    font-weight: 600;
    padding: 1rem 1.25rem;
    box-shadow: none;
}

.profile-accordion .accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--ag-primary) 0%, #2d5a9e 100%);
    color: white;
}

.profile-accordion .accordion-button:not(.collapsed) .badge {
    background: rgba(255,255,255,0.25) !important;
}

/* Pulsante salva professionale */
.btn-save-course {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    border: none;
    color: white;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-save-course:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.45);
    color: white;
}

/* Badge ore disponibili */
.hours-badge {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Input custom per ore */
.hours-input {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
}

.hours-input:focus {
    border-color: var(--ag-primary);
    box-shadow: 0 0 0 3px rgba(30, 77, 135, 0.15);
    outline: none;
}

/* Sezione ruoli e servizi migliorata */
.add-item-section {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    padding: 1rem;
    border: 1px dashed #cbd5e1;
}

.add-item-btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.add-item-btn i,
.btn-primary i,
.btn-success i,
.btn-primary .fas,
.btn-success .fas {
    color: white !important;
}

.add-item-btn:hover {
    transform: translateY(-1px);
}

/* Filtri dashboard migliorati */
.dashboard-filter-section {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.dashboard-filter-section .form-label {
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

.dashboard-filter-section .form-select {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.625rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dashboard-filter-section .form-select:focus {
    border-color: var(--ag-primary);
    box-shadow: 0 0 0 3px rgba(30, 77, 135, 0.15);
}

.btn-export-excel {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-export-excel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    color: white;
}

/* Animazioni di caricamento */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out forwards;
}

/* Responsive per admin corsi */
@media (max-width: 768px) {
    .admin-corsi-header {
        padding: 1.25rem;
        border-radius: 12px;
    }
    
    .admin-corsi-header h2 {
        font-size: 1.35rem;
    }
    
    .admin-tabs {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .admin-tabs .nav-link {
        justify-content: center;
        padding: 0.75rem 1rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .dashboard-filter-section {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================
   GANTT CHART STYLES
   ============================================ */

.general-rendicontazione-export {
    background: #ffffff;
    border: 1px solid #d8dee6;
    border-radius: 8px;
    overflow: hidden;
}

.general-rendicontazione-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 14px 16px;
    background: #f7f9fc;
    border-bottom: 1px solid #d8dee6;
}

.general-rendicontazione-title {
    color: #1e3a5f;
    font-size: 1rem;
    font-weight: 700;
}

.general-rendicontazione-period,
.general-rendicontazione-generated {
    color: #6c757d;
    font-size: 0.82rem;
}

.general-rendicontazione-scroll {
    overflow: auto;
    max-height: min(620px, 62vh);
    background: #ffffff;
    position: relative;
    scrollbar-gutter: stable;
}

.general-rendicontazione-empty {
    color: #6c757d;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.general-rendicontazione-table {
    width: max-content;
    min-width: 100%;
    color: #233142;
    font-size: var(--rg-table-font, 0.84rem);
}

.rg-year-row,
.rg-month-row,
.rg-data-row,
.rg-total-row {
    display: grid;
    grid-template-columns: var(--rg-course-col) repeat(var(--rg-month-count), var(--rg-month-width));
    width: max-content;
    min-width: 100%;
}

.rg-sticky-left {
    position: sticky;
    left: 0;
    z-index: 6;
}

.rg-year-row,
.rg-month-row {
    position: sticky;
    z-index: 22;
}

.rg-year-row {
    top: 0;
}

.rg-month-row {
    top: var(--rg-year-height, 38px);
    z-index: 21;
}

.rg-corner,
.rg-year-cell {
    background: #1e3a5f;
    color: #ffffff;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    min-height: var(--rg-year-height, 38px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.rg-corner {
    justify-content: flex-start;
    padding: 0 12px;
    z-index: 32;
}

.rg-month-left,
.rg-month-cell {
    background: #edf2f7;
    color: #425466;
    border-right: 1px solid #d8dee6;
    border-bottom: 1px solid #d8dee6;
    min-height: var(--rg-month-height, 34px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.58rem, var(--rg-table-font, 0.84rem), 0.76rem);
    font-weight: 700;
    text-transform: uppercase;
}

.rg-month-left {
    background: #f7f9fc;
    z-index: 31;
}

.rg-data-row {
    border-bottom: 1px solid #e7ecf2;
}

.rg-data-row:hover .rg-course-cell,
.rg-data-row:hover .rg-course-timeline {
    background-color: #f8fbff;
}

.rg-course-cell {
    background: #ffffff;
    border-right: 1px solid #d8dee6;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    box-shadow: 8px 0 12px rgba(30, 58, 95, 0.04);
}

.rg-course-cell strong {
    color: #1e3a5f;
    line-height: 1.2;
    font-size: clamp(0.72rem, var(--rg-table-font, 0.84rem), 0.84rem);
}

.rg-course-cell div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    color: #6c757d;
    font-size: clamp(0.62rem, var(--rg-table-font, 0.84rem), 0.76rem);
}

.rg-course-cell-clickable {
    cursor: pointer;
}

.rg-course-cell-clickable:hover strong,
.rg-course-cell-clickable:focus strong {
    text-decoration: underline;
}

.rg-course-cell-clickable:focus {
    outline: 2px solid #2c5282;
    outline-offset: -2px;
}

.rg-course-timeline {
    grid-column: 2 / -1;
    position: relative;
    background-color: #ffffff;
    background-image: repeating-linear-gradient(
        to right,
        transparent 0,
        transparent calc(var(--rg-month-width) - 1px),
        #edf0f4 calc(var(--rg-month-width) - 1px),
        #edf0f4 var(--rg-month-width)
    );
}

.rg-phase-bar {
    position: absolute;
    height: var(--rg-bar-height, 22px);
    border-radius: 4px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.55rem, calc(var(--rg-table-font, 0.84rem) - 0.08rem), 0.68rem);
    font-weight: 700;
    line-height: 1;
    overflow: hidden;
    padding: 0 5px;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(30, 58, 95, 0.18);
}

.rg-phase-bar.phase-1 { background: linear-gradient(135deg, #3498db, #2980b9); }
.rg-phase-bar.phase-2 { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.rg-phase-bar.phase-3 { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.rg-phase-bar.phase-4 { background: linear-gradient(135deg, #f39c12, #d68910); }
.rg-phase-bar.phase-5 { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.rg-phase-bar.phase-6 { background: linear-gradient(135deg, #1abc9c, #16a085); }
.rg-phase-bar.phase-7 { background: linear-gradient(135deg, #e67e22, #d35400); }
.rg-phase-bar.phase-8 { background: linear-gradient(135deg, #34495e, #2c3e50); }
.rg-phase-bar.phase-9 { background: linear-gradient(135deg, #fd79a8, #e84393); }
.rg-phase-bar.phase-10 { background: linear-gradient(135deg, #00cec9, #00b894); }

.rg-total-block {
    border-top: 2px solid #1e3a5f;
    bottom: 0;
    position: sticky;
    z-index: 18;
    box-shadow: 0 -8px 18px rgba(30, 58, 95, 0.08);
}

.rg-total-row {
    min-height: 46px;
}

.rg-total-label {
    background: #f7f9fc;
    border-right: 1px solid #d8dee6;
    border-bottom: 1px solid #d8dee6;
    color: #1e3a5f;
    display: flex;
    align-items: center;
    font-weight: 800;
    padding: 0 10px;
    z-index: 28;
}

.rg-total-value {
    align-items: center;
    background: #ffffff;
    border-right: 1px solid #d8dee6;
    border-bottom: 1px solid #d8dee6;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 46px;
    padding: 5px 6px;
    text-align: center;
}

.rg-total-value strong {
    color: #1e3a5f;
    font-size: clamp(0.74rem, calc(var(--rg-table-font, 0.84rem) + 0.04rem), 0.94rem);
}

.rg-total-value small {
    color: #6c757d;
    font-size: clamp(0.62rem, var(--rg-table-font, 0.84rem), 0.78rem);
    font-weight: 700;
}

.rg-grand-total .rg-total-label,
.rg-grand-total .rg-total-value {
    background: #eef6ff;
}

.rg-exporting .general-rendicontazione-scroll {
    max-height: none !important;
    overflow: visible !important;
}

.rg-exporting .rg-year-row,
.rg-exporting .rg-month-row,
.rg-exporting .rg-total-block,
.rg-exporting .rg-sticky-left {
    bottom: auto !important;
    left: auto !important;
    position: relative !important;
    top: auto !important;
}

.rg-density-compact .rg-phase-bar,
.rg-density-tight .rg-phase-bar {
    justify-content: flex-start;
}

.rg-density-tight .rg-phase-bar {
    padding: 0 3px;
}

.rg-density-tight .rg-month-cell {
    letter-spacing: 0;
}

.general-rendicontazione-report-host {
    background: #ffffff;
    left: 0;
    pointer-events: none;
    position: absolute;
    top: calc(100vh + 240px);
    width: 1180px;
    z-index: 0;
}

.general-rendicontazione-report {
    background: #ffffff;
    color: #1f2933;
    font-size: 0.82rem;
    line-height: 1.35;
    margin: 0 auto;
    max-width: 1180px;
    padding: 26px;
    width: 1180px;
}

.gr-report-header {
    align-items: flex-start;
    border-bottom: 2px solid #1e3a5f;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
}

.gr-report-eyebrow {
    color: #5f6f82;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gr-report-header h1 {
    color: #1e3a5f;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 2px 0 8px;
}

.gr-report-meta {
    color: #5f6f82;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.82rem;
}

.gr-report-badge {
    background: #eef6ff;
    border: 1px solid #c9dff7;
    border-radius: 4px;
    color: #1e3a5f;
    flex: 0 0 auto;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 7px 10px;
    text-transform: uppercase;
}

.gr-report-summary {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 18px;
}

.gr-report-metric {
    background: #f7f9fc;
    border: 1px solid #d8dee6;
    border-radius: 6px;
    break-inside: avoid;
    min-width: 0;
    padding: 10px 12px;
    page-break-inside: avoid;
}

.gr-report-metric span,
.gr-report-metric small {
    color: #5f6f82;
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
}

.gr-report-metric strong {
    color: #1e3a5f;
    display: block;
    font-size: 1.12rem;
    font-weight: 850;
    margin: 3px 0;
    white-space: nowrap;
}

.gr-report-section {
    break-inside: avoid;
    margin-top: 18px;
    page-break-inside: avoid;
}

.gr-report-section h2 {
    color: #1e3a5f;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 8px;
}

.gr-report-table {
    border-collapse: collapse;
    color: #1f2933;
    font-size: 0.74rem;
    table-layout: auto;
    width: 100%;
}

.gr-report-table thead {
    display: table-header-group;
}

.gr-report-table th {
    background: #1e3a5f;
    border: 1px solid #18304f;
    color: #ffffff;
    font-weight: 800;
    padding: 7px 8px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.gr-report-table td {
    background: #ffffff;
    border: 1px solid #d8dee6;
    hyphens: none;
    overflow-wrap: normal;
    padding: 7px 8px;
    page-break-inside: avoid;
    vertical-align: top;
    word-break: normal;
}

.gr-report-table tbody tr {
    break-inside: avoid;
    page-break-inside: avoid;
}

.gr-report-table tbody tr:nth-child(even) td {
    background: #f9fbfd;
}

.gr-report-num {
    font-variant-numeric: tabular-nums;
    text-align: right !important;
    white-space: nowrap;
}

.gr-report-nowrap {
    white-space: nowrap;
}

.gr-report-strong {
    color: #1e3a5f;
    font-weight: 850;
}

.gr-report-course-title {
    color: #1f2933;
    font-weight: 800;
    hyphens: none;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: normal;
}

.gr-report-muted {
    color: #6c757d;
    font-size: 0.68rem;
    margin-top: 2px;
}

.gr-report-course-table th:first-child,
.gr-report-course-table td:first-child {
    width: 31%;
}

.gr-report-phase-table th:first-child,
.gr-report-phase-table td:first-child {
    width: 34%;
}

.gr-report-empty {
    color: #6c757d;
    font-weight: 700;
    text-align: center;
}

.gr-report-empty-block {
    border: 1px solid #d8dee6;
    border-radius: 6px;
    padding: 28px;
}

@media print {
    .general-rendicontazione-report {
        font-size: 0.76rem;
        padding: 0;
        width: auto;
    }

    .gr-report-summary {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .gr-report-section {
        break-inside: auto;
        page-break-inside: auto;
    }

    .gr-report-table {
        font-size: 0.68rem;
    }

    .gr-report-table th,
    .gr-report-table td {
        padding: 5px 6px;
    }
}

.gantt-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
}

.gantt-chart {
    min-width: 1200px;
}

.gantt-header {
    display: flex;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.gantt-course-header {
    min-width: 250px;
    width: 250px;
    padding: 12px 15px;
    border-right: 2px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
}

.gantt-months-header {
    display: flex;
    flex: 1;
}

.gantt-month {
    flex: 1;
    min-width: 70px;
    padding: 12px 5px;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
}

.gantt-month.current-month {
    background: rgba(52, 152, 219, 0.3);
}

.gantt-body {
    background: #fff;
}

.gantt-row {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s ease;
}

.gantt-row:hover {
    background: #f8f9fa;
}

.gantt-course-name {
    min-width: 250px;
    width: 250px;
    padding: 10px 15px;
    border-right: 2px solid #e9ecef;
    background: #f8f9fa;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gantt-course-name .course-code {
    font-size: 0.75rem;
    color: #6c757d;
    display: block;
}

.gantt-timeline {
    display: flex;
    flex: 1;
    position: relative;
}

.gantt-cell {
    flex: 1;
    min-width: 70px;
    min-height: 50px;
    border-right: 1px solid #f0f0f0;
    position: relative;
}

.gantt-cell.current-month {
    background: rgba(52, 152, 219, 0.05);
}

.gantt-phase-bar {
    position: absolute;
    height: 28px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    z-index: 5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 6px;
}

.gantt-phase-bar:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.25);
    z-index: 10;
}

/* Phase colors */
.gantt-phase-bar.phase-1 { background: linear-gradient(135deg, #3498db, #2980b9); }
.gantt-phase-bar.phase-2 { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.gantt-phase-bar.phase-3 { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.gantt-phase-bar.phase-4 { background: linear-gradient(135deg, #f39c12, #d68910); }
.gantt-phase-bar.phase-5 { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.gantt-phase-bar.phase-6 { background: linear-gradient(135deg, #1abc9c, #16a085); }
.gantt-phase-bar.phase-7 { background: linear-gradient(135deg, #e67e22, #d35400); }
.gantt-phase-bar.phase-8 { background: linear-gradient(135deg, #34495e, #2c3e50); }
.gantt-phase-bar.phase-9 { background: linear-gradient(135deg, #fd79a8, #e84393); }
.gantt-phase-bar.phase-10 { background: linear-gradient(135deg, #00cec9, #00b894); }

/* Legend colors */
.gantt-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

.gantt-phase-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    display: inline-block;
}

.gantt-phase-color.phase-1 { background: linear-gradient(135deg, #3498db, #2980b9); }
.gantt-phase-color.phase-2 { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.gantt-phase-color.phase-3 { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.gantt-phase-color.phase-4 { background: linear-gradient(135deg, #f39c12, #d68910); }
.gantt-phase-color.phase-5 { background: linear-gradient(135deg, #9b59b6, #8e44ad); }
.gantt-phase-color.phase-6 { background: linear-gradient(135deg, #1abc9c, #16a085); }
.gantt-phase-color.phase-7 { background: linear-gradient(135deg, #e67e22, #d35400); }
.gantt-phase-color.phase-8 { background: linear-gradient(135deg, #34495e, #2c3e50); }
.gantt-phase-color.phase-9 { background: linear-gradient(135deg, #fd79a8, #e84393); }
.gantt-phase-color.phase-10 { background: linear-gradient(135deg, #00cec9, #00b894); }

.gantt-no-data {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.gantt-no-data i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Tooltip for phase details */
.gantt-tooltip {
    position: absolute;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.8rem;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .gantt-course-header,
    .gantt-course-name {
        min-width: 180px;
        width: 180px;
    }
    
    .gantt-month {
        min-width: 50px;
        font-size: 0.75rem;
    }
    
    .gantt-cell {
        min-width: 50px;
    }
}

/* FAQ Sidebar Sticky */
.sidebar-col {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 80px !important;
    align-self: flex-start !important;
    height: fit-content !important;
    z-index: 100;
}

.faq-index {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 80px !important;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Tabella operatori con scroll - usa height fisso, non max-height */
.operators-scroll-container {
    height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    display: block;
}

.operators-scroll-container table {
    margin-bottom: 0;
}

.operators-scroll-container thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #212529;
}

/* Piccolo scroll per tabelle ruoli e servizi */
.small-scroll-container {
    max-height: 350px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.small-scroll-container table {
    margin-bottom: 0;
}

.small-scroll-container thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Fix per Amministrazione Corsi - rimuove scroll pagina, mantiene solo scroll tabella */
.admin-corsi-page {
    overflow: hidden !important;
}

.admin-corsi-page .tab-content {
    overflow: visible !important;
}

.admin-corsi-page .tab-pane {
    overflow: visible !important;
}
