* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    line-height: 1.4;
    overflow-x: auto;
}

/* Stili Login */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    margin-bottom: 20px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
}

.login-header h1 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.login-header p {
    color: #718096;
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #2d3748;
    font-weight: 600;
    font-size: 0.9rem;
}

.login-form label i {
    margin-right: 8px;
    color: #667eea;
}

.login-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    font-size: 0.9rem;
}

.loading {
    text-align: center;
    color: #667eea;
    margin-top: 15px;
    font-size: 0.9rem;
}

.login-footer {
    color: white;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Stili Dashboard */
.container {
    width: 100%;
    padding: 10px;
    min-width: 1000px;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#currentUser {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.period-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.period-navigation button {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
}

.period-navigation button:hover {
    background: #5a67d8;
}

.current-month-btn {
    background: #48bb78 !important;
}

.current-month-btn:hover {
    background: #38a169 !important;
}

#currentPeriod {
    font-weight: 600;
    font-size: 15px;
    color: #2d3748;
    min-width: 140px;
    text-align: center;
    margin: 0 5px;
}

.filters, .actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

select, input[type="text"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    min-width: 150px;
}

/* Stile speciale per il filtro giorno */
.day-filter {
    min-width: 120px;
    background: #f0f9ff;
    border: 2px solid #0ea5e9;
    color: #0c4a6e;
    font-weight: 600;
}

button {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
}

button:hover {
    background: #5a67d8;
}

.legend {
    display: flex;
    gap: 20px;
    background: white;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

/* Info filtro attivo */
.filter-info {
    background: #dbeafe;
    color: #1e40af;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
    margin-bottom: 15px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.status-dot.future { 
    background-color: #e2e8f0; 
    border: 2px solid #a0aec0; 
    box-sizing: border-box;
}

.status-dot.success { 
    background-color: #48bb78; 
}

.status-dot.error { 
    background-color: #f56565; 
}

.status-dot.warning { 
   /* background-color: #ed8936; Giallo quasi arancione*/
   /* background-color: #ffff00;   Giallo puro */
    background-color: #bb9fff;  /* #ffda53; #eab308;    Giallo senape caldo */
}

/* Layout della tabella con freeze panes */
.dashboard-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    height: calc(95vh - 230px);
    position: relative;
    overflow: hidden;
}

.table-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    position: relative;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 1000px;
}

/* Stili base per celle */
th, td {
    padding: 6px 4px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    line-height: 1.3;
    position: relative;
    vertical-align: middle;
}

/* Header principale */
th {
    background: #f8f9fa;
    font-weight: 600;
    border-right: 1px solid #d1d5db;
    z-index: 20;
    font-size: 12px;
}

th:last-child,
td:last-child {
    border-right: none;
}

/* Colonne fisse a sinistra */
.actions-col { 
    width: 70px;      /* Aumentato da 60px a 70px per ospitare meglio i pulsanti più grandi */
    min-width: 70px;
    max-width: 70px;
    text-align: center;
    background-color: #fafafa;
    border-right: 2px solid #d1d5db;
    position: sticky;
    left: 0;
    z-index: 15;
    font-size: 11px;
}

.sede-col { 
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    text-align: left;
    background-color: #fafafa;
    position: sticky;
    left: 70px;      /* Aggiornato da 60px a 70px */
    z-index: 15;
    font-size: 12px;
    font-weight: 500;
}

.evento-col { 
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    text-align: left;
    background-color: #fafafa;
    position: sticky;
    left: 150px;     /* Aggiornato da 140px a 150px */
    z-index: 15;
    font-size: 12px;
    font-weight: 500;
}

.freq-col { 
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    background-color: #fafafa;
    border-right: 2px solid #d1d5db;
    position: sticky;
    left: 250px;     /* Aggiornato da 240px a 250px */
    z-index: 15;
    font-size: 11px;
    text-align: left;
}

.cell-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
    padding: 2px;
}

thead th.actions-col,
thead th.sede-col,
thead th.evento-col,
thead th.freq-col {
    position: sticky;
    top: 0;
    z-index: 25;
    font-size: 12px;
    font-weight: 600;
}

thead th.day-col {
    position: sticky;
    top: 0;
    z-index: 20;
    font-size: 10px;
}

.day-col { 
    width: 30px;
    min-width: 30px;
    padding: 4px 2px;
    font-size: 10px;
}

.day-col.sunday,
thead th.day-col.sunday {
    background-color: #fef7f0;
    border-left: 2px solid #fed7aa;
    border-right: 2px solid #fed7aa;
}

.day-col.today,
thead th.day-col.today {
    background-color: #e6f7ff;
    border-left: 2px solid #91caff;
    border-right: 2px solid #91caff;
}

.day-col.sunday.today,
thead th.day-col.sunday.today {
    background-color: #fff2e8;
    border-left: 2px solid #ff9c6e;
    border-right: 2px solid #ff9c6e;
}

.status-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 24px;
}

.day-header {
    font-size: 9px;
    line-height: 1.2;
}

.day-header .day-name {
    display: block;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 1px;
}

.day-header .day-date {
    display: block;
    color: #718096;
}

.day-header.sunday .day-name {
    color: #c53030;
    font-weight: 700;
}

.day-header.today .day-name {
    color: #1890ff;
    font-weight: 700;
}

.day-header.sunday.today .day-name {
    color: #ff4d4f;
    font-weight: 700;
}

.row-actions {
    display: flex;
    gap: 2px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.row-actions .btn-icon {
    width: 24px;    /* Aumentato da 18px a 24px */
    height: 24px;   /* Aumentato da 18px a 24px */
    font-size: 13px; /* Aumentato da 10px a 13px */
    margin: 0 3px;   /* Spaziatura tra pulsanti */
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.btn-edit {
    color: #3182ce;
    background: #e6f3ff;
}

.btn-edit:hover {
    background: #3182ce;
    color: white;
}

.btn-delete {
    color: #e53e3e;
    background: #fee;
}

.btn-delete:hover {
    background: #e53e3e;
    color: white;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-style: italic;
}

tbody tr {
    height: 36px;
}

tbody tr:nth-child(even) td {
    background-color: #f8fafc;
}

tbody tr:nth-child(even) td.actions-col,
tbody tr:nth-child(even) td.sede-col,
tbody tr:nth-child(even) td.evento-col,
tbody tr:nth-child(even) td.freq-col {
    background-color: #f1f5f9;
}

tbody tr:nth-child(even) td.day-col.sunday {
    background-color: #fdd6aa;
}

tbody tr:nth-child(even) td.day-col.today {
    background-color: #d4edda;
}

tbody tr:nth-child(even) td.day-col.sunday.today {
    background-color: #ffe4b5;
}

tbody tr:hover td {
    background-color: #edf2f7;
}

tbody tr:hover td.actions-col,
tbody tr:hover td.sede-col,
tbody tr:hover td.evento-col,
tbody tr:hover td.freq-col {
    background-color: #e2e8f0;
}

tbody tr:hover td.day-col.sunday {
    background-color: #fed7aa;
}

tbody tr:hover td.day-col.today {
    background-color: #bae7ff;
}

tbody tr:hover td.day-col.sunday.today {
    background-color: #ffb366;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: black;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2d3748;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group small {
    color: #666;
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

.cron-examples {
    background: #f7fafc;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.cron-examples h4 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 14px;
}

.cron-examples ul {
    list-style: none;
    padding: 0;
}

.cron-examples li {
    padding: 5px 0;
    font-size: 12px;
    color: #4a5568;
}

.cron-examples strong {
    color: #2b6cb0;
    font-family: 'Courier New', monospace;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.form-actions button {
    padding: 8px 16px;
}

/* ===== Footer applicazione con 3 colonne ===== */
.app-footer {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    padding: 6px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    margin-top: 8px;
    min-height: 38px;
    color: white;
    font-size: 13px;
}

.footer-col {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-left {
    justify-content: flex-start;
}

.footer-center {
    justify-content: center;
}

.footer-right {
    justify-content: flex-end;
}

.footer-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.footer-version {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.footer-separator {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

.record-badge {
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.footer-time {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-width: 160px;
    text-align: center;
}

/* Responsive per footer */
@media (max-width: 768px) {
    .row-actions .btn-icon {
        width: 22px;    /* Leggermente ridotto per mobile ma comunque più grande */
        height: 22px;
        font-size: 12px;
    }
    
    .actions-col {
        width: 65px;
        min-width: 65px;
        max-width: 65px;
    }
    
    .sede-col {
        left: 65px;
    }
    
    .evento-col {
        left: 145px;
    }
    
    .freq-col {
        left: 245px;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .period-navigation,
    .filters, 
    .actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .container {
        min-width: 900px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 8px;
        min-width: 800px;
    }
    
    .dashboard-wrapper {
        height: calc(100vh - 220px);
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .period-navigation {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }
    
    .legend {
        flex-direction: column;
        gap: 8px;
    }
    
    .day-col {
        width: 25px;
        min-width: 25px;
        padding: 3px 1px;
    }
    
    .day-header {
        font-size: 8px;
    }
    
    .btn-icon {
        width: 15px;
        height: 15px;
        font-size: 9px;
    }
    
    .status-dot {
        width: 16px;
        height: 16px;
    }
    
    tbody tr {
        height: 32px;
    }
    
    .sede-col, .evento-col {
        font-size: 11px;
    }
    
    .freq-col {
        font-size: 10px;
    }
    
    .login-card {
        padding: 30px;
        margin: 10px;
    }
    
    .day-filter {
        min-width: 100px;
    }
}

/* Tooltip per i pallini di stato */
.status-dot.has-tooltip {
    cursor: help;
    position: relative;
}

.status-dot.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2d3748;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Freccia del tooltip */
.status-dot.has-tooltip::before {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2d3748;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
    pointer-events: none;
}

/* Mostra tooltip al passaggio del mouse */
.status-dot.has-tooltip:hover::after,
.status-dot.has-tooltip:hover::before {
    visibility: visible;
    opacity: 1;
}

/* ===== STILI PER NAVIGAZIONE PAGINE ===== */
.page-menu {
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-menu select {
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-width: 180px;
    transition: all 0.3s;
}

.page-menu select:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.page-menu select option {
    background: white;
    color: #2d3748;
}

/* ===== STILI PER BADGE RUOLO UTENTE ===== */
.user-role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.user-role-badge.admin {
    background: #ffd700;
    color: #1a202c;
}

.user-role-badge.viewer {
    background: #90cdf4;
    color: #1a365d;
}

/* ===== PULSANTE CAMBIO PASSWORD ===== */
.change-pwd-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.change-pwd-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== MODAL CAMBIO PASSWORD OBBLIGATORIO ===== */
.forced-modal {
    z-index: 2000;
}

.forced-modal .modal-content {
    border: 3px solid #f56565;
}

.forced-modal h2 {
    color: #c53030;
    display: flex;
    align-items: center;
    gap: 10px;
}

.warning-text {
    background: #fed7d7;
    color: #c53030;
    padding: 12px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid #f56565;
}

/* ===== PAGINA DETTAGLI STATI ===== */
.details-table-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    overflow-x: auto;
    max-height: calc(100vh - 300px);
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.details-table thead {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
}

.details-table th {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    vertical-align: top;
}

.details-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
}

.details-table tbody tr:hover {
    background-color: #f7fafc;
}

/* Contenuto header con controlli */
.th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.th-controls {
    display: flex;
    gap: 6px;
}

.sort-icon, .filter-icon {
    cursor: pointer;
    color: #a0aec0;
    font-size: 12px;
    transition: color 0.3s;
}

.sort-icon:hover, .filter-icon:hover {
    color: #4a5568;
}

.sort-icon.active {
    color: #667eea;
}

/* Container input filtro */
.filter-input-container {
    padding: 8px;
    background: #edf2f7;
    border-radius: 4px;
    margin-top: 8px;
}

.filter-input-container input,
.filter-input-container select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 12px;
}

/* Badge stato */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.future {
    background: #e2e8f0;
    color: #4a5568;
}

.status-badge.success {
    background: #c6f6d5;
    color: #22543d;
}

.status-badge.error {
    background: #fed7d7;
    color: #c53030;
}

.status-badge.warning {
    background: #feebc8;
    color: #7c2d12;
}

.status-badge.unknown {
    background: #e2e8f0;
    color: #718096;
}

/* Footer tabella dettagli */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-left label {
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
}

.footer-left select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.total-rows {
    color: #4a5568;
    font-size: 13px;
}

.total-rows strong {
    color: #2d3748;
    font-weight: 700;
}

/* Paginazione */
.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination button {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #5a67d8;
}

.pagination button:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.page-info {
    color: #4a5568;
    font-size: 13px;
    font-weight: 500;
}

.page-info strong {
    color: #2d3748;
    font-weight: 700;
}

/* Celle speciali */
.loading-cell, .error-cell, .no-data-cell {
    text-align: center;
    padding: 40px;
    color: #718096;
    font-style: italic;
}

.error-cell {
    color: #c53030;
}

.error-cell i {
    margin-right: 8px;
}

/* Pulsanti azioni pagina dettagli */
.refresh-btn, .clear-filters-btn {
    background: #48bb78;
}

.refresh-btn:hover, .clear-filters-btn:hover {
    background: #38a169;
}

.export-btn {
    background: #2d9648;
}

.export-btn:hover {
    background: #237637;
}

/* Responsive per pagina dettagli */
@media (max-width: 1200px) {
    .details-table {
        font-size: 12px;
    }
    
    .details-table th,
    .details-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 768px) {
    .table-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-left, .footer-right {
        width: 100%;
        justify-content: center;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-menu select {
        min-width: 140px;
        font-size: 12px;
    }
}

/* Colonne responsive */
.details-table th:nth-child(1),
.details-table td:nth-child(1) {
    width: 60px;
}

.details-table th:nth-child(2),
.details-table td:nth-child(2) {
    min-width: 120px;
}

.details-table th:nth-child(3),
.details-table td:nth-child(3) {
    min-width: 150px;
}

.details-table th:nth-child(4),
.details-table td:nth-child(4) {
    min-width: 120px;
}

.details-table th:nth-child(5),
.details-table td:nth-child(5) {
    width: 80px;
    text-align: center;
}

.details-table th:nth-child(6),
.details-table td:nth-child(6) {
    width: 100px;
}

.details-table th:nth-child(7),
.details-table td:nth-child(7) {
    width: 120px;
    text-align: center;
}

.details-table th:nth-child(8),
.details-table td:nth-child(8) {
    min-width: 140px;
}

/* ===== LEGENDA COMPATTA ===== */
.legend-compact {
    padding: 4px 10px;
    gap: 15px;
    font-size: 12px;
    margin-bottom: 8px;
}

.status-dot-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.status-dot-small.future { 
    background-color: #e2e8f0; 
    border: 2px solid #a0aec0; 
    box-sizing: border-box;
}

.status-dot-small.success { 
    background-color: #48bb78; 
}

.status-dot-small.error { 
    background-color: #f56565; 
}

.status-dot-small.warning { 
    background-color: #bb9fff;
}

/* ===== PAGINA GESTIONE UTENTI ===== */
.users-table-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
    overflow-x: auto;
    max-height: calc(100vh - 280px);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.users-table thead {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 10;
}

.users-table th {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
}

.users-table td {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
}

.users-table tbody tr:hover {
    background-color: #f7fafc;
}

.actions-cell {
    text-align: center;
    width: 120px;
    padding: 8px;
}

.actions-cell .btn-icon {
    width: 24px;
    height: 24px;
    font-size: 13px;
    margin: 0 6px;
}

/* Badge ruolo */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.role-badge.admin {
    background: #ffd700;
    color: #1a202c;
}

.role-badge.viewer {
    background: #90cdf4;
    color: #1a365d;
}

.role-badge i {
    margin-right: 4px;
}

/* Badge attivo/non attivo */
.active-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.active-badge.active {
    background: #c6f6d5;
    color: #22543d;
}

.active-badge.inactive {
    background: #fed7d7;
    color: #c53030;
}

.active-badge i {
    margin-right: 4px;
}

/* Footer semplice */
.table-footer-simple {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.table-footer-simple .total-rows {
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
}

.table-footer-simple .total-rows strong {
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
}

/* Pulsanti azioni gestione utenti */
.add-btn {
    background: #48bb78;
}

.add-btn:hover {
    background: #38a169;
}

/* Campo obbligatorio */
.required {
    color: #f56565;
    font-weight: bold;
}

/* Responsive per tabella utenti */
@media (max-width: 1200px) {
    .users-table {
        font-size: 12px;
    }
    
    .users-table th,
    .users-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 768px) {
    .users-table-wrapper {
        max-height: calc(100vh - 250px);
    }
    
    .role-badge,
    .active-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
}
