/* ========================================
   GESTIONALE CONDOMINIO - STYLESHEET
   By GIF Web Solutions
   ======================================== */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* FORZA NASCONDERE SUB-CONTENT NON ATTIVI */
#tab-admin .admin-sub-content {
    display: none !important;
}

#tab-admin .admin-sub-content.active {
    display: block !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* === LOGIN === */
.login-container {
    background: white;
    border-radius: 20px;
    padding: 50px 40px;
    max-width: 450px;
    margin: 100px auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.login-container h1 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-container .subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1rem;
}

/* === FORM === */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* === BUTTONS === */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    box-shadow: 0 5px 15px rgba(220,53,69,0.4);
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
    box-shadow: 0 5px 15px rgba(40,167,69,0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.w-100 {
    width: 100%;
}
 
 
 
/* === MAIN APP === */
.main-app {
    display: none;
}

.main-app.active {
    display: block;
}

.header {
    max-width: 1200px;        /* ← uguale al .container */
    margin: 0 auto 20px auto; /* ← centra + mantiene il margin-bottom */
    background: white;
    border-radius: 12px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    color: #667eea;
    font-size: 1.8rem;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-badge {
    background: #ffc107;
    color: #000;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
}

/* === TABS === */
.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 0;
    flex-wrap: wrap;
    
}

.tab-btn {
    flex: 1;
    min-width: 150px;
    padding: 15px 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
}
 

/* === BADGE NOTIFICHE TAB === */
.tab-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tab-badge {
    display: block;
    background: transparent;
    font-size: 0.85em;  /* ← più grande */
    font-weight: 800;   /* ← più grassetto */
    animation: badgePulse 2s infinite;
    line-height: 1;
}

.tab-btn.active .tab-badge {
    animation: none;
    opacity: 0.8;
}

@keyframes badgePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
        transform: scale(1.08);
    }
}

/* Badge colorati per tipo */
.tab-badge.badge-yellow {
    color: #ffc107;
    text-shadow: 0 0 8px rgba(255, 193, 7, 0.6);
}

.tab-badge.badge-blue {
    color: #2196f3;
    text-shadow: 0 0 8px rgba(33, 150, 243, 0.6);
}

.tab-badge.badge-green {
    color: #4caf50;
    text-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.tab-badge.badge-purple {
    color: #9c27b0;
    text-shadow: 0 0 8px rgba(156, 39, 176, 0.6);
}

.tab-badge.badge-orange {
    color: #ff9800;
    text-shadow: 0 0 8px rgba(255, 152, 0, 0.6);
}


.tab-btn:hover {
    background: rgba(255,255,255,0.3);
}

.tab-btn.active {
    background: white;
    color: #667eea;
}

.tab-content {
    display: none;
    background: white;
    border-radius: 0 8px 8px 8px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

.tab-content h3 {
    color: #666;
    margin: 30px 0 15px 0;
    font-size: 1.3rem;
}

/* === DASHBOARD STATS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #667eea;
    transition: transform 0.3s;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.stat-details {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    flex-direction: column; 
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-yellow {
    background: #fff3cd;
    color: #856404;
}

.badge-blue {
    background: #cfe2ff;
    color: #084298;
}

.badge-green {
    background: #d1e7dd;
    color: #0f5132;
}

.badge-red {
    background: #f8d7da;
    color: #721c24;
}

.badge-orange {
    background: #ffe5d0;
    color: #d67400;
}

/* === CALENDARIO === */
.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.calendar-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.4rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 15px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 700;
    color: #667eea;
    padding: 12px 5px;
    font-size: 0.85rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.calendar-day {
    min-height: 90px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 6px;
    background: white;
    position: relative;
    transition: all 0.2s;
    overflow: hidden;
}

.calendar-day:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102,126,234,0.2);
    transform: translateY(-1px);
}

.calendar-day.other-month {
    background: #f8f9fa;
    opacity: 0.4;
}

.calendar-day.today {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #667eea;
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.calendar-day-number {
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.calendar-day.today .calendar-day-number {
    color: #667eea;
    font-size: 1rem;
}

.calendar-event {
    background: #667eea;
    color: white;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-bottom: 3px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s;
    display: block;
}

.calendar-event:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 10;
}

.calendar-event.event-prenotazione {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.calendar-event.event-bacheca {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.calendar-event.event-bacheca-urgente {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.calendar-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.legend-color {
    width: 24px;
    height: 14px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* === GRID/CARDS === */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #667eea;
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.card.priority-alta {
    border-left-color: #dc3545;
}

.card.priority-urgente {
    border-left-color: #ff6b6b;
    background: #ffe5e5;
}

.card h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.card p {
    color: #666;
    line-height: 1.6;
    margin: 8px 0;
}

.card .meta {
    font-size: 14px;
    color: #999;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* === STATUS === */
.status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
}

.status-inviata {
    background: #fff3cd;
    color: #856404;
}

.status-presa-in-carico {
    background: #ffe5d0;
    color: #d67400;
}

.status-in-lavorazione {
    background: #cfe2ff;
    color: #084298;
}

.status-risolta {
    background: #d1e7dd;
    color: #0f5132;
}

.status-respinta {
    background: #f8d7da;
    color: #721c24;
}

/* === CATEGORIA === */
.categoria {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.categoria-vendita {
    background: #e3f2fd;
    color: #1565c0;
}

.categoria-acquisto {
    background: #f3e5f5;
    color: #6a1b9a;
}

.categoria-servizi {
    background: #e8f5e9;
    color: #2e7d32;
}

.categoria-altro {
    background: #fff3e0;
    color: #e65100;
}

/* === ALERT === */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    animation: slideIn 0.3s ease;
}

.alert.show {
    display: block;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 650px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
        display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 30px 30px 20px 30px;
    border-bottom: 2px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 10;
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    color: white;
    font-size: 1.5rem;
    margin: 0;
    padding-right: 40px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-weight: 300;
}

.modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
    border-color: rgba(255,255,255,0.5);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

.modal-body h3 {
    color: #667eea;
    font-size: 1.4rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body p {
    margin: 12px 0;
    line-height: 1.6;
    color: #444;
}

.modal-body p strong {
    color: #333;
    font-weight: 600;
    display: inline-block;
    min-width: 120px;
}

.modal-body hr {
    border: none;
    border-top: 2px solid #f0f0f0;
    margin: 20px 0;
}

.info-box {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
}

.info-box p {
    margin: 8px 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.modal-actions .btn {
    flex: 1;
}

.modal-body .status {
    display: inline-block;
    margin: 10px 0;
    font-size: 0.95rem;
}

.modal-body .categoria {
    display: inline-block;
    margin: 10px 0 15px 0;
    font-size: 0.95rem;
}
/* Alert dentro i modal */
.modal-alert-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 15px;
}

.modal-alert {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: opacity 0.3s ease;
}

.modal-alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border-left: 4px solid #28a745;
}

.modal-alert-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.modal-alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-left: 4px solid #ffc107;
}

.modal-alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* === TABLE === */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
}

table tr:hover {
    background: #f8f9fa;
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* === CHECKBOX === */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

/* === UTILITY === */
.hidden {
    display: none !important;
}

/* === MODAL LIST === */
.modal-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-list-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.modal-list-item.priority-alta {
    border-left-color: #f39c12;
}

.modal-list-item.priority-urgente {
    border-left-color: #e74c3c;
    background: #ffe5e5;
}

.modal-list-item.priority-urgente:hover {
    background: #ffd0d0;
}

.modal-list-icon {
    font-size: 1.8rem;
    min-width: 40px;
    text-align: center;
}

.modal-list-content {
    flex: 1;
}

.modal-list-title {
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
    font-size: 1rem;
}

.modal-list-meta {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.modal-list-meta .status {
    margin: 0;
    padding: 2px 8px;
    font-size: 0.75rem;
}

/* ========================================
   VISTA ADMIN - STATISTICHE MINI
   ======================================== */
.admin-stats-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    padding: 0;
}

.stat-mini {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.stat-mini:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.stat-mini.stat-total {
    border-color: #667eea;
}

.stat-mini.stat-yellow {
    border-color: #ffc107;
}

.stat-mini.stat-orange {
    border-color: #ff9800;
}

.stat-mini.stat-blue {
    border-color: #2196f3;
}

.stat-mini.stat-green {
    border-color: #4caf50;
}

.stat-mini.stat-red {
    border-color: #f44336;
}

.stat-mini-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.stat-mini-content {
    flex: 1;
}

.stat-mini-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
    margin-bottom: 5px;
}

.stat-mini-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
    margin: 0;
}

/* ========================================
   FILTRI ADMIN
   ======================================== */
.admin-filters {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}


/* ========================================
   TABELLA ADMIN
   ======================================== */
.admin-table-container {
    background: white;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.admin-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.admin-table thead th {
    padding: 18px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.admin-table tbody {
    background: white;
}

.admin-table-row {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.admin-table-row:hover {
    background: #f8f9ff;
}

.admin-table-row td {
    padding: 16px;
    vertical-align: middle;
    color: #2c3e50;
}

.admin-table-row td:first-child {
    font-weight: 700;
    color: #667eea;
    min-width: 60px;
}

.admin-table-row td:nth-child(2) {
    min-width: 140px;
    font-size: 0.85rem;
}

.admin-table-row td:nth-child(3) {
    min-width: 180px;
    font-weight: 600;
}

.admin-table-row td:nth-child(4) {
    min-width: 160px;
}

.admin-table-row td:nth-child(5) {
    min-width: 150px;
}

.admin-table-row td:nth-child(6) {
    min-width: 140px;
}

.admin-table-row td:nth-child(7) {
    min-width: 150px;
    text-align: center;
}


/* ========================================
   STATUS BADGES
   ======================================== */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-badge.status-yellow {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-orange {
    background: #ffe5d0;
    color: #d67400;
}

.status-badge.status-blue {
    background: #cce5ff;
    color: #004085;
}

.status-badge.status-green {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-red {
    background: #f8d7da;
    color: #721c24;
}

/* ========================================
   PULSANTI TABELLA
   ======================================== */
.btn-table {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-table.btn-manage {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-table.btn-manage:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
/* ========================================
   LAYOUT SEGNALAZIONI ADMIN VERTICALE
   ======================================== */
.segnalazioni-admin-layout {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 25px;
}

/* RIGA 1: Statistiche con palline colorate */
.segnalazioni-stats-row {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.segnalazioni-stats-row h3 {
    color: #667eea;
    font-size: 1.3rem;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stats-palline {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    background: #f8f9ff;
    border-radius: 10px;
    transition: all 0.3s ease;
    min-width: 180px;
    justify-content: center;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.stat-pallina {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.stat-pallina.yellow { background: #f39c12; }
.stat-pallina.orange { background: #e67e22; }
.stat-pallina.blue { background: #3498db; }
.stat-pallina.green { background: #27ae60; }
.stat-pallina.red { background: #e74c3c; }

.stat-text {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: #667eea;
    margin-left: 5px;
}

/* RIGA 2: Filtri */
.segnalazioni-filters-row {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.segnalazioni-filters-row h3 {
    color: #667eea;
    font-size: 1.3rem;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filters-container {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
    flex: 1;
}

.filter-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-group select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:hover {
    border-color: #667eea;
}

.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* RIGA 3: già gestita da .grid */

/* Responsive segnalazioni admin */
@media (max-width: 768px) {
    .stats-palline {
        flex-direction: column;
        gap: 15px;
    }
    
    .stat-item {
        width: 100%;
        min-width: auto;
    }
    
    .filters-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .filter-group {
        width: 100%;
        min-width: auto;
    }
}
/* ========================================
Stile regolament
   ======================================== */

#regolamento-content h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

#regolamento-content h4 {
    color: #444;
    margin-top: 25px;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

#regolamento-content ul {
    margin-left: 20px;
    line-height: 1.8;
}

#regolamento-content ul li {
    margin-bottom: 8px;
    color: #555;
}

#regolamento-content strong {
    color: #667eea;
    font-weight: 600;
}

/* ========================================
   ADMIN SUB-TABS - VERSIONE MIGLIORATA
   ======================================== */
.admin-sub-tabs {
    display: flex;
    gap: 12px;
    margin: 30px 0 0 0;
    border-bottom: none;
    flex-wrap: wrap;
    padding-bottom: 0;
    background: linear-gradient(135deg, rgba(102,126,234,0.05) 0%, rgba(118,75,162,0.05) 100%);
    padding: 15px 20px 0 20px;
    border-radius: 12px 12px 0 0;
}

.admin-sub-tab-btn {
    padding: 16px 28px;
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
    border-bottom: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
    position: relative;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.admin-sub-tab-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
    transition: all 0.3s ease;
}

.admin-sub-tab-btn:hover {
    color: #667eea;
    background: #f8f9ff;
    transform: translateY(-4px);
    box-shadow: 0 -4px 16px rgba(102,126,234,0.15);
    border-color: #667eea;
}

.admin-sub-tab-btn.active {
    color: #667eea;
    background: white;
    border-color: #667eea;
    border-width: 2px;
    border-bottom: none;
    box-shadow: 0 -4px 20px rgba(102,126,234,0.2);
    transform: translateY(-6px);
}

.admin-sub-tab-btn.active::before {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.admin-sub-content {
    display: none !important;
    background: white;
    border: 2px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 35px;
    margin-top: -1px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    animation: fadeInContent 0.3s ease;
}

.admin-sub-content.active {
    display: block !important;
}

.admin-sub-content h3 {
    color: #667eea;
    font-size: 1.5rem;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-sub-content h3::before {
    content: '⚙️';
    font-size: 1.8rem;
}


@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   EDITOR WYSIWYG - VERSIONE MIGLIORATA
   ======================================== */
.regolamenti-editor {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(102,126,234,0.1);
}

.regolamenti-editor .form-group {
    margin-bottom: 25px;
}

.regolamenti-editor .form-group label {
    font-size: 1rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.regolamenti-editor .form-group label::before {
    content: '📋';
    font-size: 1.2rem;
}

.regolamenti-editor select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.regolamenti-editor select:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}

.regolamenti-editor select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* Toolbar editor migliorata */
.editor-toolbar {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    border-radius: 12px 12px 0 0;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 4px 12px rgba(102,126,234,0.2);
}

.editor-btn {
    padding: 12px 16px;
    background: rgba(255,255,255,0.95) !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.2s ease;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.editor-btn:hover {
    background: white !important;
    border-color: white !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    color: #764ba2 !important;
}

.editor-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.editor-separator {
    width: 3px;
    height: 32px;
    background: rgba(255,255,255,0.4);
    margin: 0 8px;
    border-radius: 2px;
}

/* Area editor migliorata */
.editor-area {
    min-height: 500px !important;
    max-height: 650px !important;
    padding: 30px !important;
    border: 2px solid #e0e0e0 !important;
    border-top: none !important;
    border-radius: 0 0 12px 12px !important;
    background: white !important;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    box-shadow: inset 0 4px 12px rgba(0,0,0,0.05) !important;
}

.editor-area:focus {
    outline: none !important;
    border-color: #667eea !important;
    box-shadow: inset 0 4px 12px rgba(102,126,234,0.1), 0 0 0 4px rgba(102, 126, 234, 0.1) !important;
}

.editor-area h3 {
    color: #667eea !important;
    margin-top: 30px !important;
    margin-bottom: 18px !important;
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    padding-bottom: 12px !important;
    border-bottom: 3px solid #667eea !important;
}

.editor-area h4 {
    color: #555 !important;
    margin-top: 25px !important;
    margin-bottom: 15px !important;
    font-size: 1.2rem !important;
    font-weight: 600 !important;
}

.editor-area ul, .editor-area ol {
    margin-left: 35px !important;
    margin-bottom: 18px !important;
}

.editor-area li {
    margin-bottom: 12px !important;
    line-height: 1.7 !important;
}

.editor-area strong {
    color: #667eea !important;
    font-weight: 700 !important;
}

.editor-area p {
    margin-bottom: 16px !important;
}

/* Container editor */
#editor-container {
    margin-top: 25px;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulsanti salva/ripristina */
#editor-container .btn {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

#editor-container .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

/* Responsive migliorato */
@media (max-width: 768px) {
    .editor-toolbar {
        gap: 4px;
        padding: 10px;
    }
    
    .editor-btn {
        padding: 8px 12px;
        min-width: 38px;
        height: 38px;
        font-size: 13px;
    }
    
    .editor-area {
        min-height: 350px !important;
        padding: 20px !important;
    }
}

 



/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
    .admin-table {
        font-size: 0.8rem;
    }

    .admin-table thead th,
    .admin-table-row td {
        padding: 10px 8px;
        font-size: 0.75rem;
    }

    .admin-table-container {
        overflow-x: auto;
    }

    .admin-table {
        min-width: 1000px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-btn {
        border-radius: 8px;
        margin-bottom: 5px;
    }

    .tab-content {
        border-radius: 8px;
        padding: 20px;
    }

    .header {
        flex-direction: column;
        text-align: center;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .login-container {
        padding: 30px 20px;
        margin: 50px auto;
    }

    .modal-content {
        max-width: 100%;
        border-radius: 12px;
    }

    .modal-header {
        padding: 20px;
        border-radius: 12px 12px 0 0;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-actions {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .calendar-day {
        min-height: 70px;
        padding: 4px;
    }

    .calendar-day-number {
        font-size: 0.75rem;
    }

    .calendar-event {
        font-size: 0.65rem;
        padding: 2px 3px;
        margin-bottom: 2px;
    }

    .calendar-header h3 {
        font-size: 1.1rem;
    }

    .calendar-grid {
        gap: 3px;
    }

    .admin-stats-mini {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group select {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .card {
        padding: 15px;
    }

    .admin-stats-mini {
        grid-template-columns: 1fr;
    }
}
/* === CORREZIONI ADMIN === */
.admin-table thead th {
    white-space: nowrap;
}

.admin-table-row td {
    padding: 14px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.btn-table {
    font-size: 0.85rem;
    white-space: nowrap;
}

/* ========================================
   TAB DOCUMENTI - LAYOUT A LISTA
   ======================================== */

/* Griglia documenti - lista verticale */
.documenti-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

/* Card documento - layout orizzontale */
.documento-card {
    background: white;
    border-radius: 12px;
    padding: 20px 25px;
    border-left: 5px solid #667eea;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
}

.documento-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateX(5px);
}

/* Contenuto principale a sinistra */
.doc-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Titolo documento */
.doc-main-content h4 {
    color: #333;
    font-size: 1.2rem;
    margin: 0;
    font-weight: 700;
    line-height: 1.3;
}

/* Riga metadati (data, dimensione, persona) */
.doc-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    color: #999;
    align-items: center;
}

.doc-metadata-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.doc-metadata-item strong {
    color: #666;
    font-weight: 600;
}

/* Descrizione documento */
.doc-descrizione {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* Categoria badge */
.doc-categoria {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.doc-categoria.cat-regolamenti {
    background: #e3f2fd;
    color: #1565c0;
}

.doc-categoria.cat-bilanci {
    background: #f3e5f5;
    color: #6a1b9a;
}

.doc-categoria.cat-verbali {
    background: #e8f5e9;
    color: #2e7d32;
}

.doc-categoria.cat-documentazione-tecnica {
    background: #fff3e0;
    color: #e65100;
}

.doc-categoria.cat-moduli {
    background: #fce4ec;
    color: #c2185b;
}

.doc-categoria.cat-altro {
    background: #f5f5f5;
    color: #616161;
}

/* Pulsanti azione a destra */
.doc-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 160px;
}

.doc-actions .btn {
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 8px;
    white-space: nowrap;
    text-align: center;
}

.btn-download {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.btn-edit-doc {
    background: #ffc107;
    color: #000;
    border: none;
    cursor: pointer;
}

.btn-edit-doc:hover {
    background: #ffb300;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,193,7,0.4);
}

/* Empty state documenti */
.documenti-grid .empty-state {
    width: 100%;
}

/* Responsive documenti */
@media (max-width: 768px) {
    .documento-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .doc-actions {
        width: 100%;
        min-width: unset;
    }
    
    .doc-actions .btn {
        width: 100%;
    }
    
    .doc-metadata {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Animazione caricamento documenti */
@keyframes fadeInDoc {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.documento-card {
    animation: fadeInDoc 0.4s ease forwards;
}

.documento-card:nth-child(1) { animation-delay: 0.05s; }
.documento-card:nth-child(2) { animation-delay: 0.1s; }
.documento-card:nth-child(3) { animation-delay: 0.15s; }
.documento-card:nth-child(4) { animation-delay: 0.2s; }
.documento-card:nth-child(5) { animation-delay: 0.25s; }
.documento-card:nth-child(6) { animation-delay: 0.3s; }

/* ========================================
   BACKUP TAB
   ======================================== */

.backup-info-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.backup-info-item {
    background: linear-gradient(135deg, #f8f9ff 0%, #fff 100%);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.backup-info-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
}

.backup-info-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.backup-info-item strong {
    display: block;
    color: #667eea;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.backup-info-item p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.backup-manual-section {
    background: white;
    border: 2px solid #667eea;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
}

.backup-manual-section h4 {
    color: #667eea;
    margin: 0 0 15px 0;
    font-size: 1.2rem;
}

.backup-manual-section .btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.backup-list-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.backup-list-section h4 {
    color: #667eea;
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.backup-item {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
}

.backup-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateX(5px);
}

.backup-item-info {
    flex: 1;
}

.backup-item-name {
    font-weight: 700;
    color: #333;
    font-size: 1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.backup-item-meta {
    color: #666;
    font-size: 0.85rem;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.backup-item-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.backup-item-actions {
    display: flex;
    gap: 10px;
}

.backup-item-actions .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.backup-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.backup-empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* Responsive backup */
@media (max-width: 768px) {
    .backup-info-box {
        grid-template-columns: 1fr;
    }
    
    .backup-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .backup-item-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .backup-item-actions .btn {
        width: 100%;
    }
}
/* ========================================
   CALENDARIO PRENOTAZIONI
   ======================================== */

.calendario-grid {
    display: grid;
    grid-template-columns: 80px repeat(7, 1fr);
    gap: 2px;
    background: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.calendario-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 10px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.calendario-header-time {
    background: #f8f9fa;
    padding: 15px 10px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    color: #667eea;
    position: sticky;
    top: 0;
    z-index: 10;
}

.calendario-time {
    background: #f8f9fa;
    padding: 10px 8px;
    text-align: center;
    font-size: 11px;
    color: #666;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 2px solid #e0e0e0;
}

.calendario-slot {
    background: white;
    padding: 6px;
    min-height: 45px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendario-slot.disponibile {
    background: #e8f5e9;
    border-color: #4caf50;
}

.calendario-slot.disponibile:hover {
    background: #c8e6c9;
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    z-index: 5;
}

.calendario-slot.disponibile::after {
    content: '✚';
    position: absolute;
    font-size: 20px;
    color: #4caf50;
    opacity: 0;
    transition: opacity 0.2s;
}

.calendario-slot.disponibile:hover::after {
    opacity: 1;
}

.calendario-slot.occupato {
    background: #ffebee;
    border-color: #f44336;
    cursor: not-allowed;
}

.calendario-slot.occupato:hover {
    background: #ffcdd2;
}

.calendario-slot.mia-prenotazione {
    background: #fff3e0;
    border-color: #ff9800;
    cursor: pointer;
}

.calendario-slot.mia-prenotazione:hover {
    background: #ffe0b2;
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
    z-index: 5;
}

.calendario-slot.non-disponibile {
    background: #f5f5f5;
    border-color: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.5;
}

.calendario-slot-content {
    font-size: 10px;
    line-height: 1.3;
    text-align: center;
    width: 100%;
}

.calendario-slot-nome {
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendario-slot-motivo {
    color: #666;
    font-style: italic;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendario-slot-ora {
    color: #999;
    font-size: 9px;
    display: block;
    margin-top: 2px;
}

.calendario-today {
    background: #e3f2fd;
    border: 3px solid #2196f3;
}

.calendario-today.disponibile {
    background: #c8e6c9;
    border-color: #4caf50;
}

#calendarioGrid::-webkit-scrollbar {
    height: 8px;
}

#calendarioGrid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#calendarioGrid::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

#calendarioGrid::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

@media (max-width: 1200px) {
    .calendario-grid {
        grid-template-columns: 70px repeat(7, minmax(100px, 1fr));
    }
    
    .calendario-header {
        font-size: 11px;
        padding: 12px 8px;
    }
    
    .calendario-slot-content {
        font-size: 9px;
    }
}

@media (max-width: 768px) {
    .calendario-grid {
        grid-template-columns: 60px repeat(7, minmax(80px, 1fr));
    }
    
    .calendario-header {
        font-size: 10px;
        padding: 10px 5px;
    }
    
    .calendario-time {
        font-size: 10px;
        padding: 8px 5px;
    }
    
    .calendario-slot {
        min-height: 40px;
        padding: 4px;
    }
    
    .calendario-slot-content {
        font-size: 8px;
    }
}
/* ========================================
   FIX CLOSE BUTTON MODAL
   ======================================== */
.modal .close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    z-index: 100;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.modal .close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg) scale(1.1);
    border-color: white;
}

.modal-header {
    padding-right: 60px; /* Spazio per la X */
}
/* ========================================
   TOGGLE SWITCH 2FA
   ======================================== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #667eea;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* Badge 2FA nella tabella */
.badge-2fa {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.badge-2fa.enabled {
    background: #d1e7dd;
    color: #0f5132;
}

.badge-2fa.disabled {
    background: #f8d7da;
    color: #721c24;
}

.badge-2fa-method {
    background: #cfe2ff;
    color: #084298;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    margin-left: 5px;
    display: inline-block;
}

/* Bottone 2FA nella tabella */
.btn-2fa {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-2fa:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ========================================
   HEADER REFACTORED 2026
   ======================================== */
.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-left h1 {
    color: #667eea;
    font-size: 1.8rem;
    margin: 0;
}

.header-left p {
    color: #888;
    font-size: 0.9rem;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.user-role {
    background: #ffc107;
    color: #000;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: capitalize;
}

.btn-logout {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.btn-admin-toggle {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-admin-toggle:hover {
    background: #667eea;
    color: white;
}
.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #f0f0f0;
    background: white;
    border-radius: 0 0 20px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0; /* ← impedisce che venga schiacciato */
}
#stat-annunci-categorie {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#2fa-status-text {
    font-size: 1.1em;
    font-weight: bold;
    margin-left: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    min-width: 120px;
    text-align: center;
}





 
 
 
 
 
 
 .mobile-hamburger {
    display: none;
    position: fixed;
    top: 20px; right: 20px;
    z-index: z-index: 1001 !important;
    width: 56px; height: 56px;
    background: var(--primary-color, #007bff);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,123,255,0.4);
}

.mobile-nav-panel {
    display: none;
    position: fixed;
    top: 0; right: -100%;
    width: 100%; max-width: 320px;
    height: 100vh;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.2);
    transition: right 0.3s cubic-bezier(0.25,0.46,0.45,0.94);
    z-index: 999;
    padding: 0;
    overflow-y: auto;
}

.mobile-nav-panel.active {
    display: block;
    right: 0;
}

.mobile-nav-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-tabs {
    padding: 10px 0;
}

.mobile-tab-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.mobile-tab-btn:hover {
    background: #f8f9fa;
}

.mobile-logout-btn {
    margin-top: 20px;
    width: 100%;
    padding: 16px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

.mobile-nav-close {
    position: absolute;
    top: 20px; right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

/* Mobile */
@media (max-width: 768px) {
    .mobile-hamburger { display: flex; align-items: center; justify-content: center; }
  /*  .tabs { display: none; }   Nasconde tabs desktop su mobile */
}


/* Desktop */
@media (min-width: 769px) {
    .mobile-hamburger, .mobile-nav-panel { display: none !important; }
}

@media (max-width: 768px) {
  .tabs { display: none !important; }  /* Nasconde tabs desktop */
  .mobile-hamburger { display: flex !important; }
}
@media (min-width: 769px) {
  .mobile-hamburger, .mobile-nav-panel { display: none !important; }
  .tabs { display: flex !important; }
}

 /* numeri utili */
 
 .cat-items { 
    max-height: 0 !important; 
    overflow: hidden !important; 
    transition: max-height 0.4s ease !important; 
}
#lista-numeri {
    display: flex !important;
    flex-direction: column !important;
    gap: 25px;
    padding: 24px;
    max-width: 100%;
}

.cat-group {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0;
    display: block !important;
}

.cat-header.clickable { 
    cursor: pointer !important;
    background: #f8f9fa;
    padding: 18px 24px;
    font-weight: bold;
    font-size: 1.2em;
    display: flex;
    justify-content: flex-start !important;;
    align-items: center;
}
.toggle-icon { 
    transition: transform 0.3s ease;
    font-size: 0.9em;
    margin-left: 8px;
}

.cat-items { 
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.4s ease !important;
    background: #fff;
}
.cat-items.open { 
    max-height: 3000px !important;
}
.cat-header.active .toggle-icon { 
    transform: rotate(180deg) !important;
}

/* 3 CARD PER RIGA - NO SCROLLBAR */
.cards-grid { 
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    padding: 24px !important;
    overflow: visible !important;
}

.numero-card { 
    background: linear-gradient(145deg, #ffffff, #f0f4f8);
    border: 1px solid #e1e8ed;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.numero-card:hover { 
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

.numero-card h5 { 
    margin: 0 0 12px 0;
    color: #1a365d;
    font-size: 1.3em;
}
.tel { 
    font-weight: 700;
    color: #2d8548;
    font-size: 1.25em;
}
.email { 
    color: #3182ce;
    font-size: 1em;
}
.hero-group .cat-header {
    background: #f8f9fa !important;
    padding: 18px 24px !important;
    font-weight: bold !important;
    font-size: 1.2em !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 12px !important;
    color: #1a365d !important;
    border-radius: 12px 12px 0 0 !important;
}

.hero-group .cat-count {
    background: rgba(0,0,0,0.1) !important;
    color: #333 !important;
}
.tel {
    font-weight: 700;
    color: #2d8548;
    font-size: 1.1em; /* un filo più piccolo */
    word-break: break-all;
}

@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 16px !important;
        gap: 12px !important;
    }
    .numero-card {
        padding: 16px;
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: 1fr !important;
    }
}
@keyframes pulse {
    0%   { background-color: rgba(255, 59, 48, 0.15); }
    50%  { background-color: rgba(255, 59, 48, 0.4); }
    100% { background-color: rgba(255, 59, 48, 0.15); }
}
.pulsing {
    animation: pulse 1.5s infinite !important;
}


/* ricerca */
.header-search {
    flex: 1;
    max-width: 400px;
    width: auto; / 
}

.header-search input {
    width: 100%;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #ddd;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.header-search input::placeholder { color: #999; }
.header-search input:focus { background: #fff; border-color: #667eea; }

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 9999;
}

.search-group-title {
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #999;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.search-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.search-item:hover { background: #f0f4ff; }

.search-item-title { font-weight: 600; font-size: 14px; color: #333; }
.search-item-meta { font-size: 12px; color: #999; margin-top: 2px; }

.search-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* FOOTER - STILE HEADER - SPREAD COMPLETO */
.footer {
    background: white;
    border-radius: 12px;
    padding: 25px 30px;
    margin: 20px auto 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
    max-width: 1200px;
}

.footer-grid {
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 0 !important;  /* No gap tra colonne */
}

.footer-column {
    flex: 1 !important;
    padding: 0 20px !important;  /* Spazio interno colonne */
    min-width: 0 !important;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 8px;
}

.footer-column a {
    color: #667eea;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-column a:hover {
    color: #764ba2;
    transform: translateX(4px);
}

.footer-column a[href$=".pdf"]::after { content: "📄"; }
.footer-column a[target="_blank"]::after { content: "↗️"; }

.footer-copyright {
    color: #888;
    font-size: 14px;
    font-weight: 500;
    margin-top: 20px;
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

@media (max-width: 768px) {
    .footer {
        flex-direction: column;
        padding: 20px;
    }
    .footer-grid {
        flex-direction: column !important;
        gap: 15px !important;
    }
    .footer-column {
        padding: 0 10px !important;
    }
}

/* FORM FOOTER ADMIN - MIGLIORATO */
#form-add-link .form-row {
    gap: 15px;
    margin-bottom: 20px;
}

#form-add-link input,
#form-add-link select {
    padding: 14px 18px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    background: white !important;
    transition: all 0.3s ease !important;
    min-height: 50px !important;
}

#form-add-link input:focus,
#form-add-link select:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 4px rgba(102,126,234,0.1) !important;
    outline: none !important;
}

#form-add-link .form-row input {
    flex: 1;
}

#links-table {
    margin-top: 20px;
}

#links-table .btn-sm {
    padding: 8px 16px !important;
    font-size: 13px !important;
    margin: 2px;
}
