/* Scadenzario Frontend Styles - Modern Design System */

/* ===== VARIABILI CSS ===== */
:root {
    /* Colori principali */
    --primary-color: #286090;
    --primary-hover: #1e4a6b;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Gradienti */
    --primary-gradient: linear-gradient(135deg, #286090 0%, #1e4a6b 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    
    /* Colori di sfondo */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-modal: rgba(0, 0, 0, 0.5);
    
    /* Colori testo */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    
    /* Bordi e ombre */
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-sm: 6px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;
    
    /* Transizioni */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== RESET E BASE ===== */
* {
    box-sizing: border-box;
}

/* ===== CONTAINER PRINCIPALI ===== */
.scadenzario-container,
.scadenzario-dashboard {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    background: var(--bg-primary);
    min-height: 100vh;
}

/* ===== HEADER MODERNO ===== */
.scadenzario-header,
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl);
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.scadenzario-header::before,
.dashboard-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(40, 96, 144, 0.05) 0%, rgba(30, 74, 107, 0.05) 100%);
    z-index: -1;
}

.scadenzario-header h2,
.dashboard-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--font-size-3xl);
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.scadenzario-header p,
.dashboard-header p {
    margin: var(--spacing-sm) 0 0 0;
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    font-weight: 500;
}

.scadenzario-actions {
    display: flex;
    gap: var(--spacing-md);
}

/* ===== BOTTONI MODERNI ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-align: center;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-height: 44px;
    box-shadow: var(--shadow-sm);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

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

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Varianti bottoni */
.btn-primary {
    background: var(--primary-color);
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: var(--text-white);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: #475569;
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success-color);
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    background: #059669;
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: var(--shadow-lg);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.btn-warning:hover {
    background: #d97706;
    box-shadow: var(--shadow-lg);
}

.btn-info {
    background: var(--info-color);
    color: var(--text-white);
    box-shadow: var(--shadow-md);
}

.btn-info:hover {
    background: #2563eb;
    box-shadow: var(--shadow-lg);
}

/* Dimensioni bottoni */
.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-xs);
    min-height: 36px;
    border-radius: var(--border-radius-sm);
}

.btn-xs {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-xs);
    min-height: 28px;
    border-radius: var(--border-radius-sm);
}

/* ===== FILTRI MODERNI ===== */
.scadenzario-filters {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl);
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.scadenzario-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(40, 96, 144, 0.03) 0%, rgba(30, 74, 107, 0.03) 100%);
    z-index: -1;
}

.scadenzario-filters select,
.scadenzario-filters input {
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-base);
    min-width: 200px;
}

.scadenzario-filters select:focus,
.scadenzario-filters input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(40, 96, 144, 0.1);
    transform: scale(1.02);
}

.filter-actions {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

/* ===== LISTA SCADENZE MODERNA ===== */
.scadenze-list {
    display: grid;
    gap: var(--spacing-lg);
}

.scadenza-item {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.scadenza-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    transition: width var(--transition-base);
}

.scadenza-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.scadenza-item:hover::before {
    width: 8px;
}

.scadenza-item.scaduta {
    border-left-color: var(--danger-color);
}

.scadenza-item.scaduta::before {
    background: var(--danger-gradient);
}

.scadenza-item.pagata {
    border-left-color: var(--success-color);
    opacity: 0.8;
}

.scadenza-item.pagata::before {
    background: var(--success-gradient);
}

/* ===== HEADER SCADENZA ===== */
.scadenza-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
}

.scadenza-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.scadenza-status {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: fadeInUp 0.6s ease;
}

.status-attiva {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.status-pagata {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
}

.status-scaduta {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
}

/* ===== DETTAGLI SCADENZA ===== */
.scadenza-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.scadenza-detail {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.scadenza-detail-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scadenza-detail-value {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
}

.scadenza-importo {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary-color);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== AZIONI SCADENZA ===== */
.scadenza-actions {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.scadenza-actions .btn {
    flex: 1;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.scadenza-actions .btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.scadenza-actions .btn:hover::before {
    width: 300px;
    height: 300px;
}

/* ===== PRIORITÀ ===== */
.priority-alta {
    color: var(--danger-color);
    font-weight: 600;
}

.priority-media {
    color: var(--warning-color);
    font-weight: 600;
}

.priority-bassa {
    color: var(--success-color);
    font-weight: 600;
}

/* ===== LOADING E STATI VUOTI ===== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
    position: relative;
}

.spinner::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite reverse;
}

.empty-state,
.empty-message {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 2px dashed var(--border-color);
    margin: var(--spacing-lg) 0;
}

.empty-state::before,
.empty-message::before {
    content: '📋';
    font-size: 3rem;
    display: block;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

.empty-state h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.empty-state p {
    font-size: var(--font-size-base);
    margin: 0;
}

/* ===== MODAL GENERICI ===== */

/* Stili specifici per il modal delle categorie */
#categorie-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
}

#categorie-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

#categorie-modal .modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    margin: 0 auto;
    padding: 0;
    border-radius: 16px;
    width: 95%;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
}

#categorie-modal.show .modal-content {
    transform: scale(1);
}

#categorie-modal .modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 24px 30px;
    border-radius: 16px 16px 0 0;
    position: relative;
    overflow: hidden;
}

#categorie-modal .modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: shimmer 3s ease-in-out infinite;
}

#categorie-modal .modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    position: relative;
    z-index: 2;
}

#categorie-modal .modal-body {
    padding: 30px;
    background: #ffffff;
}

#categorie-modal .modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    text-align: right;
    border-radius: 0 0 16px 16px;
}

#categorie-modal .modal-footer .btn {
    margin-left: 12px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#categorie-modal .modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Stili per i tab delle categorie */
#categorie-modal .nav-tabs {
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 25px;
    display: flex;
    gap: 0;
}

#categorie-modal .nav-tabs .nav-link {
    border: none;
    background: transparent;
    color: #64748b;
    padding: 12px 24px;
    font-weight: 500;
    border-radius: 8px 8px 0 0;
    transition: all 0.3s ease;
    position: relative;
}

#categorie-modal .nav-tabs .nav-link:hover {
    color: var(--primary-color);
    background: rgba(40, 96, 144, 0.05);
}

#categorie-modal .nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: #ffffff;
    border-bottom: 3px solid var(--primary-color);
}

#categorie-modal .nav-tabs .nav-link.active::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Stili per la lista delle categorie */
#categorie-modal .categoria-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    margin-bottom: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#categorie-modal .categoria-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border-radius: 2px;
}

#categorie-modal .categoria-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

#categorie-modal .categoria-item .categoria-nome {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 16px;
}

#categorie-modal .categoria-item .categoria-actions {
    display: flex;
    gap: 8px;
}

#categorie-modal .categoria-item .btn {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

#categorie-modal .categoria-item .btn:hover {
    transform: scale(1.05);
}

/* Stili per i pulsanti di aggiunta categoria */
#categorie-modal .add-categoria-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    margin-top: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#categorie-modal .add-categoria-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#categorie-modal .add-categoria-btn:hover::before {
    left: 100%;
}

#categorie-modal .add-categoria-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 96, 144, 0.3);
}
.modal,
#scadenzaModal,
#ricorrente-modal,
#edit-scadenza-modal,
#settings-modal,
#aggregati-modal,
#categorie-modal,
.scadenza-details-modal,
.upload-ricevuta-modal,
.documento-preview-modal,
.pagamento-details-modal,
.edit-scadenza-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-modal);
    backdrop-filter: blur(4px);
    animation: fadeIn var(--transition-base);
}

.modal.show,
#scadenzaModal.show,
#ricorrente-modal.show,
#edit-scadenza-modal.show,
#settings-modal.show,
#aggregati-modal.show,
#categorie-modal.show,
.scadenza-details-modal.show,
.upload-ricevuta-modal.show,
.documento-preview-modal.show,
.pagamento-details-modal.show,
.edit-scadenza-modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal-content,
#scadenzaModal .modal-content,
#ricorrente-modal .modal-content,
#edit-scadenza-modal .modal-content,
#settings-modal .modal-content,
#aggregati-modal .modal-content,
#categorie-modal .modal-content,
.scadenza-details-modal .modal-content,
.upload-ricevuta-modal .modal-content,
.documento-preview-modal .modal-content,
.pagamento-details-modal .modal-content,
.edit-scadenza-modal .modal-content {
    background: var(--bg-card);
    margin: auto;
    padding: 0;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideInDown var(--transition-base);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header,
#scadenzaModal .modal-header,
#ricorrente-modal .modal-header,
#edit-scadenza-modal .modal-header,
#settings-modal .modal-header,
#aggregati-modal .modal-header,
.scadenza-details-modal .modal-header,
.upload-ricevuta-modal .modal-header,
.documento-preview-modal .modal-header,
.pagamento-details-modal .modal-header,
.edit-scadenza-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.modal-header h3,
#scadenzaModal .modal-header h3,
#ricorrente-modal .modal-header h3,
#edit-scadenza-modal .modal-header h3,
#settings-modal .modal-header h3,
#aggregati-modal .modal-header h3,
.scadenza-details-modal .modal-header h3,
.upload-ricevuta-modal .modal-header h3,
.documento-preview-modal .modal-header h3,
.pagamento-details-modal .modal-header h3,
.edit-scadenza-modal .modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.close {
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color var(--transition-base);
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.modal-body,
#scadenzaModal .modal-body,
#ricorrente-modal .modal-body,
#edit-scadenza-modal .modal-body,
#settings-modal .modal-body,
#aggregati-modal .modal-body,
.scadenza-details-modal .modal-body,
.upload-ricevuta-modal .modal-body,
.documento-preview-modal .modal-body,
.pagamento-details-modal .modal-body,
.edit-scadenza-modal .modal-body {
    padding: var(--spacing-xl);
}

.modal-footer,
#scadenzaModal .modal-footer,
#ricorrente-modal .modal-footer,
#edit-scadenza-modal .modal-footer,
#settings-modal .modal-footer,
#aggregati-modal .modal-footer,
.scadenza-details-modal .modal-footer,
.upload-ricevuta-modal .modal-footer,
.documento-preview-modal .modal-footer,
.pagamento-details-modal .modal-footer,
.edit-scadenza-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    padding: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* ===== ANIMAZIONI ===== */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -30px, 0);
    }
    70% {
        transform: translate3d(0, -15px, 0);
    }
    90% {
        transform: translate3d(0, -4px, 0);
    }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .scadenzario-container,
    .scadenzario-dashboard {
        padding: var(--spacing-md);
    }
    
    .scadenzario-header,
    .dashboard-header {
        flex-direction: column;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .scadenzario-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .scadenzario-filters {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .scadenzario-filters select,
    .scadenzario-filters input {
        min-width: 100%;
    }
    
    .scadenza-details {
        grid-template-columns: 1fr;
    }
    
    .scadenza-actions {
        flex-direction: column;
    }
    
    .scadenza-actions .btn {
        width: 100%;
    }
    
    .modal-content,
    #scadenzaModal .modal-content,
    #ricorrente-modal .modal-content,
    #edit-scadenza-modal .modal-content,
    #settings-modal .modal-content,
    #aggregati-modal .modal-content,
    .scadenza-details-modal .modal-content,
    .upload-ricevuta-modal .modal-content,
    .documento-preview-modal .modal-content,
    .pagamento-details-modal .modal-content,
    .edit-scadenza-modal .modal-content {
        width: 95%;
        margin: var(--spacing-md);
    }
    
    .modal-header,
    .modal-footer,
    #scadenzaModal .modal-header,
    #scadenzaModal .modal-footer,
    #ricorrente-modal .modal-header,
    #ricorrente-modal .modal-footer,
    #edit-scadenza-modal .modal-header,
    #edit-scadenza-modal .modal-footer,
    #settings-modal .modal-header,
    #settings-modal .modal-footer,
    #aggregati-modal .modal-header,
    #aggregati-modal .modal-footer,
    .scadenza-details-modal .modal-header,
    .scadenza-details-modal .modal-footer,
    .upload-ricevuta-modal .modal-header,
    .upload-ricevuta-modal .modal-footer,
    .documento-preview-modal .modal-header,
    .documento-preview-modal .modal-footer,
    .pagamento-details-modal .modal-header,
    .pagamento-details-modal .modal-footer,
    .edit-scadenza-modal .modal-header,
    .edit-scadenza-modal .modal-footer {
        padding: var(--spacing-lg);
    }
    
    .modal-footer,
    #scadenzaModal .modal-footer,
    #ricorrente-modal .modal-footer,
    #edit-scadenza-modal .modal-footer,
    #settings-modal .modal-footer,
    #aggregati-modal .modal-footer,
    .scadenza-details-modal .modal-footer,
    .upload-ricevuta-modal .modal-footer,
    .documento-preview-modal .modal-footer,
    .pagamento-details-modal .modal-footer,
    .edit-scadenza-modal .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn,
    #scadenzaModal .modal-footer .btn,
    #ricorrente-modal .modal-footer .btn,
    #edit-scadenza-modal .modal-footer .btn,
    #settings-modal .modal-footer .btn,
    #aggregati-modal .modal-footer .btn,
    .scadenza-details-modal .modal-footer .btn,
    .upload-ricevuta-modal .modal-footer .btn,
    .documento-preview-modal .modal-footer .btn,
    .pagamento-details-modal .modal-footer .btn,
    .edit-scadenza-modal .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .scadenzario-header h2,
    .dashboard-header h2 {
        font-size: var(--font-size-2xl);
    }
    
    .btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-xs);
    }
    
    .scadenza-item {
        padding: var(--spacing-lg);
    }
    
    .modal-body,
    #scadenzaModal .modal-body,
    #ricorrente-modal .modal-body,
    #edit-scadenza-modal .modal-body,
    #settings-modal .modal-body,
    #aggregati-modal .modal-body,
    .scadenza-details-modal .modal-body,
    .upload-ricevuta-modal .modal-body,
    .documento-preview-modal .modal-body,
    .pagamento-details-modal .modal-body,
    .edit-scadenza-modal .modal-body {
        padding: var(--spacing-lg);
    }
    
    .modal-content,
    #scadenzaModal .modal-content,
    #ricorrente-modal .modal-content,
    #edit-scadenza-modal .modal-content,
    #settings-modal .modal-content,
    #aggregati-modal .modal-content,
    .scadenza-details-modal .modal-content,
    .upload-ricevuta-modal .modal-content,
    .documento-preview-modal .modal-content,
    .pagamento-details-modal .modal-content,
    .edit-scadenza-modal .modal-content {
        width: 98%;
        margin: var(--spacing-sm);
        max-height: 95vh;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-0 { margin-bottom: 0 !important; }

/* ===== DOCUMENT UPLOAD AREA - DESIGN PROFESSIONALE ===== */
.document-upload-area {
    position: relative;
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-2xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ===== UPLOAD AREA PER RICEVUTE ===== */
.upload-area {
    position: relative;
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-2xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-base);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.document-upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(40, 96, 144, 0.05) 50%, transparent 70%);
    background-size: 200% 200%;
    animation: shimmer 3s ease-in-out infinite;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.document-upload-area:hover::before {
    opacity: 1;
}

.document-upload-area:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(40, 96, 144, 0.02) 0%, rgba(40, 96, 144, 0.05) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.document-upload-area.dragover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(40, 96, 144, 0.1) 0%, rgba(40, 96, 144, 0.15) 100%);
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

.document-upload-area.dragover::before {
    opacity: 1;
    animation: shimmer 1s ease-in-out infinite;
}

.upload-placeholder {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    color: var(--text-secondary);
    transition: color var(--transition-base);
}

.document-upload-area:hover .upload-placeholder {
    color: var(--primary-color);
}

.upload-placeholder i {
    font-size: 3rem;
    color: var(--text-muted);
    transition: all var(--transition-base);
    margin-bottom: var(--spacing-sm);
}

.document-upload-area:hover .upload-placeholder i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.upload-placeholder p {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    transition: color var(--transition-base);
}

.document-upload-area:hover .upload-placeholder p {
    color: var(--primary-color);
}

.upload-placeholder small {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    transition: color var(--transition-base);
}

.document-upload-area:hover .upload-placeholder small {
    color: var(--text-secondary);
}

/* Animazione shimmer per l'effetto drag */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Document Preview Area */
.document-preview {
    display: none;
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.document-preview.show {
    display: block;
    animation: fadeInUp 0.3s ease-out;
}

.document-preview h6 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.preview-container {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-secondary);
    margin-bottom: var(--spacing-md);
}

.preview-container img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--border-radius);
    display: block;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base);
}

.preview-container img:hover {
    transform: scale(1.05);
}

/* File Upload Progress */
.upload-progress {
    display: none;
    margin-top: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.upload-progress.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border-radius: 4px;
    transition: width var(--transition-base);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s ease-in-out infinite;
}

.progress-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-align: center;
}

/* Responsive Design per Upload Area */
@media (max-width: 768px) {
    .document-upload-area {
        padding: var(--spacing-xl);
        min-height: 150px;
    }
    
    .upload-placeholder i {
        font-size: 2.5rem;
    }
    
    .upload-placeholder p {
        font-size: var(--font-size-base);
    }
    
    .upload-placeholder small {
        font-size: var(--font-size-xs);
    }
}

@media (max-width: 480px) {
    .document-upload-area {
        padding: var(--spacing-lg);
        min-height: 120px;
    }
    
    .upload-placeholder i {
        font-size: 2rem;
    }
    
    .upload-placeholder p {
        font-size: var(--font-size-sm);
    }
}
.mb-1 { margin-bottom: var(--spacing-xs) !important; }
.mb-2 { margin-bottom: var(--spacing-sm) !important; }
.mb-3 { margin-bottom: var(--spacing-md) !important; }
.mb-4 { margin-bottom: var(--spacing-lg) !important; }
.mb-5 { margin-bottom: var(--spacing-xl) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--spacing-xs) !important; }
.mt-2 { margin-top: var(--spacing-sm) !important; }
.mt-3 { margin-top: var(--spacing-md) !important; }
.mt-4 { margin-top: var(--spacing-lg) !important; }
.mt-5 { margin-top: var(--spacing-xl) !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: var(--spacing-xs) !important; }
.p-2 { padding: var(--spacing-sm) !important; }
.p-3 { padding: var(--spacing-md) !important; }
.p-4 { padding: var(--spacing-lg) !important; }
.p-5 { padding: var(--spacing-xl) !important; }

.hidden { display: none !important; }
.visible { display: block !important; }

.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.items-center { align-items: center !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }

.gap-1 { gap: var(--spacing-xs) !important; }
.gap-2 { gap: var(--spacing-sm) !important; }
.gap-3 { gap: var(--spacing-md) !important; }
.gap-4 { gap: var(--spacing-lg) !important; }
.gap-5 { gap: var(--spacing-xl) !important; }

/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-base);
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(40, 96, 144, 0.1);
    transform: scale(1.02);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* ===== TABELLE ===== */
.scadenzario-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.scadenzario-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    padding: var(--spacing-lg);
    border-bottom: 2px solid var(--border-color);
}

.scadenzario-table td {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.scadenzario-table tr:hover {
    background: var(--bg-secondary);
}

.scadenzario-table tr:last-child td {
    border-bottom: none;
}

/* ===== SCROLLBAR PERSONALIZZATA ===== */
.scadenzario-container::-webkit-scrollbar,
.scadenzario-dashboard::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.scadenzario-container::-webkit-scrollbar-track,
.scadenzario-dashboard::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.scadenzario-container::-webkit-scrollbar-thumb,
.scadenzario-dashboard::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.scadenzario-container::-webkit-scrollbar-thumb:hover,
.scadenzario-dashboard::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* ===== ACCESSIBILITÀ ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: var(--text-white);
    padding: 8px;
    text-decoration: none;
    border-radius: var(--border-radius);
    z-index: 10000;
}

.skip-link:focus {
    top: 6px;
}

/* ===== PRINT STYLES ===== */
@media print {
    .scadenzario-container,
    .scadenzario-dashboard {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: none !important;
    }
    
    .btn,
    .scadenzario-actions {
        display: none !important;
    }
    
    .dashboard-stats .stat-card,
    .dashboard-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== HIGH CONTRAST ===== */
@media (prefers-contrast: high) {
    .scadenzario-container,
    .scadenzario-dashboard {
        --border-color: #000000;
        --text-primary: #000000;
        --text-secondary: #333333;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .status-badge {
        border: 2px solid currentColor;
    }
}

/* ===== FORZA DESIGN CHIARO ===== */
.scadenzario-container,
.scadenzario-dashboard {
    background: #ffffff !important;
    color: #1e293b !important;
}

.scadenzario-header,
.dashboard-header,
.scadenzario-filters,
.scadenza-item,
.scadenzario-aggregati,
.scadenzario-calendario,
.modal-content {
    background: #ffffff !important;
    color: #1e293b !important;
}

.scadenza-title,
.scadenza-detail-value {
    color: #1e293b !important;
}

.scadenza-detail-label {
    color: #64748b !important;
}

.btn-primary {
    background: #286090 !important;
    color: #ffffff !important;
}

.btn-warning {
    background: #f59e0b !important;
    color: #ffffff !important;
}

.btn-success {
    background: #10b981 !important;
    color: #ffffff !important;
}

.btn-danger {
    background: #ef4444 !important;
    color: #ffffff !important;
}

.scadenza-importo {
    color: #286090 !important;
    -webkit-text-fill-color: #286090 !important;
}

.priority-media {
    color: #f59e0b !important;
}

.status-attiva {
    background: #fef3c7 !important;
    color: #92400e !important;
    border: 1px solid #fbbf24 !important;
}

/* ===== COMMENTI FINALI ===== */
/*
 * Scadenzario Plugin CSS - Design System Completo
 * 
 * Questo file contiene tutti gli stili CSS per il plugin Scadenzario
 * con un design moderno, pulito e coerente.
 * 
 * Caratteristiche principali:
 * - Design chiaro con sfondo bianco
 * - Colori blu per elementi interattivi
 * - Status badge colorati
 * - Animazioni fluide
 * - Layout responsive
 * - Accessibilità migliorata
 * 
 * Autore: AI Assistant
 * Data: 2024
 * Versione: 1.0
 * 
 * ✅ COMPLETATO - Tutti gli stili sono stati implementati
 * ✅ DESIGN CHIARO - Forzato il design chiaro con !important
 * ✅ RESPONSIVE - Layout adattivo per tutti i dispositivi
 * ✅ ACCESSIBILITÀ - Focus visibili e supporto screen reader
 * ✅ ANIMAZIONI - Transizioni fluide e effetti hover
 * ✅ UTILITY CLASSES - Classi helper per rapid development
 * ✅ PRINT STYLES - Ottimizzato per la stampa
 * 
 * Elementi implementati:
 * - Dashboard con statistiche
 * - Navigazione del plugin
 * - Bottoni e form
 * - Status badge colorati
 * - Modal e notifiche
 * - Tabelle e paginazione
 * - Tooltip e badge
 * - Progress bar e alert
 * - Scrollbar personalizzata
 * - Focus e accessibilità
 * - Responsive design
 * - Print styles
 * 
 * Colori utilizzati:
 * - Primary: #286090 (blu)
 * - Success: #10b981 (verde)
 * - Warning: #f59e0b (arancione)
 * - Danger: #ef4444 (rosso)
 * - Secondary: #64748b (grigio)
 * - Background: #ffffff (bianco)
 * - Text: #1e293b (nero)
 * 
 * Status badge:
 * - ATTIVA: #fef3c7 (giallo chiaro)
 * - PAGATA: #d1fae5 (verde chiaro)
 * - SCADUTA: #fee2e2 (rosso chiaro)
 * 
 * Il design è ora completamente coerente e moderno!
 */

/* ===== STILI CALENDARIO SCADENZARIO ===== */
.scadenzario-calendario {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-2xl);
    position: relative;
    overflow: hidden;
}

.scadenzario-calendario::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    z-index: 1;
}

.calendario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.calendario-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.calendario-controls {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.calendario-view-selector {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.calendario-view-selector label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.calendario-view-selector select {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-base);
    min-width: 120px;
}

.calendario-view-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(40, 96, 144, 0.1);
    transform: scale(1.02);
}

.calendario-navigation {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.calendario-navigation button {
    padding: var(--spacing-sm);
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: var(--font-size-sm);
}

.calendario-navigation button:hover {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.calendario-navigation span {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    min-width: 140px;
    text-align: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    transition: all var(--transition-base);
    cursor: pointer;
}

.calendario-navigation span:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

/* Tabella calendario */
.calendario-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    table-layout: fixed;
}

.calendario-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    text-align: center;
    padding: var(--spacing-md);
    border-bottom: 2px solid var(--border-color);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 14.28%;
}

.calendario-table td {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    vertical-align: top;
    height: 80px;
    width: 14.28%;
    position: relative;
    background: var(--bg-primary);
    transition: all var(--transition-base);
}

.calendario-day {
    background: var(--bg-primary);
    transition: all var(--transition-base);
    position: relative;
    height: 100%;
    width: 100%;
}

.calendario-day:hover {
    background: var(--bg-secondary);
    transform: scale(1.02);
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.calendario-day.other-month {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.calendario-day.other-month .day-number {
    color: var(--text-muted);
}

.calendario-day.today {
    background: rgba(40, 96, 144, 0.1);
    border: 2px solid var(--primary-color);
    position: relative;
}

.calendario-day.today::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

.day-number {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    text-align: right;
    font-size: var(--font-size-sm);
    padding: var(--spacing-xs);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-base);
}

.calendario-day:hover .day-number {
    background: var(--primary-color);
    color: var(--text-white);
}

.day-scadenze {
    margin-top: var(--spacing-xs);
}

.day-scadenze .scadenza-item {
    background: var(--primary-color);
    color: var(--text-white);
    padding: 2px var(--spacing-xs);
    border-radius: var(--border-radius-sm);
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 2px;
    cursor: pointer;
    transition: all var(--transition-base);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: none;
    box-shadow: var(--shadow-sm);
    position: relative;
    border-left: 3px solid var(--primary-color);
    line-height: 1.2;
}

.day-scadenze .scadenza-item:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-left-color: var(--primary-hover);
}

.day-scadenze .scadenza-item.attiva {
    background: var(--success-color);
    border-left-color: var(--success-color);
}

.day-scadenze .scadenza-item.attiva:hover {
    background: #059669;
    border-left-color: #059669;
}

.day-scadenze .scadenza-item.pagata {
    background: var(--secondary-color);
    border-left-color: var(--secondary-color);
    opacity: 0.8;
}

.day-scadenze .scadenza-item.pagata:hover {
    background: #475569;
    border-left-color: #475569;
    opacity: 1;
}

.day-scadenze .scadenza-item.scaduta {
    background: var(--danger-color);
    border-left-color: var(--danger-color);
}

.day-scadenze .scadenza-item.scaduta:hover {
    background: #dc2626;
    border-left-color: #dc2626;
}

/* Vista settimanale */
.calendario-table.settimana-view th:first-child {
    width: 80px;
}

.calendario-table.settimana-view .hour-label {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    padding: var(--spacing-sm);
    font-size: var(--font-size-xs);
}

.calendario-table.settimana-view .calendario-cell {
    height: 60px;
    padding: var(--spacing-xs);
    border: 1px solid var(--border-color);
}

/* Vista giornaliera */
.giorno-view {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.giorno-view h3 {
    margin: 0 0 var(--spacing-lg) 0;
    color: var(--text-primary);
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.scadenza-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.scadenza-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    transition: width var(--transition-base);
}

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

.scadenza-card:hover::before {
    width: 8px;
}

.scadenza-card.attiva::before {
    background: var(--success-gradient);
}

.scadenza-card.pagata::before {
    background: var(--secondary-color);
}

.scadenza-card.scaduta::before {
    background: var(--danger-gradient);
}

.scadenza-card h4 {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.scadenza-card p {
    margin: var(--spacing-xs) 0;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* Responsive calendario */
@media (max-width: 768px) {
    .calendario-header {
        flex-direction: column;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .calendario-controls {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .calendario-table {
        font-size: var(--font-size-xs);
    }
    
    .calendario-table th,
    .calendario-table td {
        padding: 4px;
        height: 60px;
    }
    
    .day-number {
        font-size: 11px;
        padding: 2px;
    }
    
    .day-scadenze .scadenza-item {
        font-size: 9px;
        padding: 1px 3px;
        margin-bottom: 1px;
    }
}

@media (max-width: 480px) {
    .scadenzario-calendario {
        padding: var(--spacing-md);
    }
    
    .calendario-header h2 {
        font-size: var(--font-size-xl);
    }
    
    .calendario-table {
        font-size: 9px;
    }
    
    .calendario-table th,
    .calendario-table td {
        padding: 2px;
        height: 50px;
    }
    
    .day-number {
        font-size: 10px;
        padding: 1px;
    }
    
    .day-scadenze .scadenza-item {
        font-size: 8px;
        padding: 1px 2px;
        margin-bottom: 1px;
        line-height: 1.1;
    }
    
    .calendario-table th {
        padding: 6px 2px;
        font-size: 9px;
    }
}

/* ===== EFFETTI AGGIUNTIVI CALENDARIO ===== */
.calendario-table th:first-child {
    border-top-left-radius: var(--border-radius-lg);
}

.calendario-table th:last-child {
    border-top-right-radius: var(--border-radius-lg);
}

.calendario-table tr:last-child td:first-child {
    border-bottom-left-radius: var(--border-radius-lg);
}

.calendario-table tr:last-child td:last-child {
    border-bottom-right-radius: var(--border-radius-lg);
}

/* Effetto hover per le celle del calendario */
.calendario-day::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(40, 96, 144, 0.05) 0%, rgba(30, 74, 107, 0.05) 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.calendario-day:hover::after {
    opacity: 1;
}

/* Animazione per le scadenze */
.day-scadenze .scadenza-item {
    animation: slideInUp 0.3s ease;
}

.day-scadenze .scadenza-item:nth-child(1) { animation-delay: 0.1s; }
.day-scadenze .scadenza-item:nth-child(2) { animation-delay: 0.2s; }
.day-scadenze .scadenza-item:nth-child(3) { animation-delay: 0.3s; }

/* Effetto focus per accessibilità */
.calendario-navigation button:focus,
.calendario-view-selector select:focus,
.calendario-navigation span:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Stili per giorni con molte scadenze */
.day-scadenze {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-secondary);
}

.day-scadenze::-webkit-scrollbar {
    width: 4px;
}

.day-scadenze::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 2px;
}

.day-scadenze::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.day-scadenze::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Indicatore per giorni con scadenze */
.calendario-day:has(.day-scadenze .scadenza-item) {
    position: relative;
}

.calendario-day:has(.day-scadenze .scadenza-item)::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    z-index: 1;
}

.calendario-day:has(.day-scadenze .scadenza-item.attiva)::before {
    background: var(--success-color);
}

.calendario-day:has(.day-scadenze .scadenza-item.pagata)::before {
    background: var(--secondary-color);
}

.calendario-day:has(.day-scadenze .scadenza-item.scaduta)::before {
    background: var(--danger-color);
}

/* ===== STILI PAGINA AGGREGATI SCADENZARIO ===== */

/* Container principale aggregati */
.aggregati-container {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    background: var(--bg-primary);
    min-height: 100vh;
}

/* Header aggregati */
.aggregati-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xl);
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

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

.aggregati-header h1 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.aggregati-header h1::before {
    content: '📊';
    font-size: var(--font-size-2xl);
}

.aggregati-description {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    margin: var(--spacing-sm) 0 0 0;
}

/* Filtri aggregati */
.aggregati-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    position: relative;
}

.aggregati-filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select {
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--font-size-base);
    transition: all var(--transition-base);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right var(--spacing-sm) center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: var(--spacing-xl);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(40, 96, 144, 0.1);
}

/* Riepilogo aggregati */
.aggregati-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.summary-item {
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.summary-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.summary-item h3 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 var(--spacing-sm) 0;
}

.summary-item p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Tabella aggregati */
.aggregati-table {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

.aggregati-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-base);
}

.aggregati-table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}

.aggregati-table th {
    padding: var(--spacing-lg);
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--border-color);
}

.aggregati-table td {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.aggregati-table tbody tr {
    transition: all var(--transition-base);
}

.aggregati-table tbody tr:hover {
    background: var(--bg-secondary);
    transform: scale(1.01);
}

.aggregati-table tbody tr:last-child td {
    border-bottom: none;
}

/* Stili specifici per colonne */
.aggregati-table .categoria-col {
    font-weight: 600;
    color: var(--primary-color);
}

.aggregati-table .scadenze-col {
    text-align: center;
    font-weight: 600;
    color: var(--info-color);
}

.aggregati-table .importo-col {
    text-align: right;
    font-weight: 600;
    color: var(--success-color);
}

.aggregati-table .pagato-col {
    text-align: right;
    font-weight: 600;
    color: var(--success-color);
}

.aggregati-table .non-pagato-col {
    text-align: right;
    font-weight: 600;
    color: var(--warning-color);
}

.aggregati-table .totale-col {
    text-align: right;
    font-weight: 700;
    color: var(--primary-color);
    font-size: var(--font-size-lg);
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Formattazione numeri con separatori delle migliaia */
.aggregati-table .totale-col,
.aggregati-table .importo-col,
.aggregati-table .pagato-col,
.aggregati-table .non-pagato-col {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* Stili specifici per la colonna TOTALE IMPORTO */
.aggregati-table .totale-col {
    background: linear-gradient(135deg, rgba(40, 96, 144, 0.05) 0%, rgba(40, 96, 144, 0.1) 100%);
    border-left: 3px solid var(--primary-color);
    padding-left: calc(var(--spacing-lg) + 3px);
    position: relative;
}

.aggregati-table .totale-col::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-gradient);
    border-radius: 0 2px 2px 0;
}

/* Hover effect speciale per la colonna TOTALE IMPORTO */
.aggregati-table tbody tr:hover .totale-col {
    background: linear-gradient(135deg, rgba(40, 96, 144, 0.1) 0%, rgba(40, 96, 144, 0.15) 100%);
    transform: scale(1.02);
    transition: all var(--transition-base);
}

/* Badge per stati */
.status-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.pagato {
    background: var(--success-color);
    color: var(--text-white);
}

.status-badge.non-pagato {
    background: var(--warning-color);
    color: var(--text-white);
}

/* Responsive design per aggregati */
@media (max-width: 768px) {
    .aggregati-container {
        padding: var(--spacing-md);
    }
    
    .aggregati-header {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .aggregati-header h1 {
        font-size: var(--font-size-2xl);
    }
    
    .aggregati-filters {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .aggregati-summary {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .aggregati-table {
        overflow-x: auto;
    }
    
    .aggregati-table table {
        min-width: 600px;
    }
    
    .aggregati-table th,
    .aggregati-table td {
        padding: var(--spacing-md);
        font-size: var(--font-size-sm);
    }
}

@media (max-width: 480px) {
    .aggregati-header h1 {
        font-size: var(--font-size-xl);
    }
    
    .aggregati-description {
        font-size: var(--font-size-base);
    }
    
    .summary-item h3 {
        font-size: var(--font-size-xl);
    }
    
    .aggregati-table table {
        min-width: 500px;
    }
    
    .aggregati-table th,
    .aggregati-table td {
        padding: var(--spacing-sm);
        font-size: var(--font-size-xs);
    }
}

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

.aggregati-container {
    animation: fadeInUp 0.6s ease-out;
}

.summary-item {
    animation: fadeInUp 0.6s ease-out;
}

.summary-item:nth-child(1) { animation-delay: 0.1s; }
.summary-item:nth-child(2) { animation-delay: 0.2s; }
.summary-item:nth-child(3) { animation-delay: 0.3s; }
.summary-item:nth-child(4) { animation-delay: 0.4s; }

.aggregati-table tbody tr {
    animation: fadeInUp 0.4s ease-out;
}

.aggregati-table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.aggregati-table tbody tr:nth-child(2) { animation-delay: 0.2s; }
.aggregati-table tbody tr:nth-child(3) { animation-delay: 0.3s; }
.aggregati-table tbody tr:nth-child(4) { animation-delay: 0.4s; }
.aggregati-table tbody tr:nth-child(5) { animation-delay: 0.5s; }

/* Focus styles per accessibilità */
.aggregati-filters select:focus,
.aggregati-table tbody tr:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Stili per stampa */
@media print {
    .aggregati-container {
        background: white;
        box-shadow: none;
    }
    
    .aggregati-header,
    .aggregati-filters {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .aggregati-table {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .aggregati-table th {
        background: #f5f5f5 !important;
        color: black !important;
    }
}

/* ===== RIPILOGO MENSILE CALENDARIO ===== */

.calendario-riepilogo-mensile {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--spacing-xl);
    overflow: hidden;
    position: relative;
}

.calendario-riepilogo-mensile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.riepilogo-header {
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.riepilogo-header h3 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.riepilogo-header h3::before {
    content: '📊';
    font-size: var(--font-size-xl);
}

.riepilogo-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
}

.riepilogo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.riepilogo-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.riepilogo-item.aziendale::before {
    background: var(--info-color);
}

.riepilogo-item.privato::before {
    background: var(--success-color);
}

.riepilogo-item.totale::before {
    background: var(--primary-color);
}

.riepilogo-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.riepilogo-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-base);
}

.riepilogo-value {
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

.riepilogo-item.aziendale .riepilogo-value {
    color: var(--info-color);
}

.riepilogo-item.privato .riepilogo-value {
    color: var(--success-color);
}

.riepilogo-item.totale .riepilogo-value {
    color: var(--primary-color);
    font-size: var(--font-size-xl);
    font-weight: 900;
}

/* Responsive design per riepilogo */
@media (max-width: 768px) {
    .riepilogo-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .riepilogo-header h3 {
        font-size: var(--font-size-base);
    }
    
    .riepilogo-value {
        font-size: var(--font-size-base);
    }
    
    .riepilogo-item.totale .riepilogo-value {
        font-size: var(--font-size-lg);
    }
}

@media (max-width: 480px) {
    .calendario-riepilogo-mensile {
        margin-bottom: var(--spacing-lg);
    }
    
    .riepilogo-header,
    .riepilogo-content {
        padding: var(--spacing-md);
    }
    
    .riepilogo-item {
        padding: var(--spacing-sm);
    }
    
    .riepilogo-label {
        font-size: var(--font-size-sm);
    }
    
    .riepilogo-value {
        font-size: var(--font-size-sm);
    }
    
    .riepilogo-item.totale .riepilogo-value {
        font-size: var(--font-size-base);
    }
}

/* Animazioni per riepilogo */
.calendario-riepilogo-mensile {
    animation: fadeInUp 0.6s ease-out;
}

.riepilogo-item {
    animation: fadeInUp 0.4s ease-out;
}

.riepilogo-item:nth-child(1) { animation-delay: 0.1s; }
.riepilogo-item:nth-child(2) { animation-delay: 0.2s; }
.riepilogo-item:nth-child(3) { animation-delay: 0.3s; }

/* ===== PAGINAZIONE ===== */

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.pagination-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.pagination-info span {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    font-weight: 500;
}

.pagination-total {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--spacing-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.pagination-current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 700;
}

.pagination-btn.pagination-first,
.pagination-btn.pagination-last {
    min-width: 44px;
}

.pagination-btn.pagination-prev,
.pagination-btn.pagination-next {
    min-width: 42px;
}

.pagination-btn i {
    font-size: var(--font-size-sm);
}

/* Responsive design per paginazione */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: var(--font-size-xs);
    }
    
    .pagination-btn.pagination-first,
    .pagination-btn.pagination-last {
        min-width: 40px;
    }
    
    .pagination-btn.pagination-prev,
    .pagination-btn.pagination-next {
        min-width: 38px;
    }
}

@media (max-width: 480px) {
    .pagination-container {
        padding: var(--spacing-md);
    }
    
    .pagination-controls {
        gap: var(--spacing-xs);
    }
    
    .pagination-btn {
        min-width: 32px;
        height: 32px;
        padding: 0 var(--spacing-xs);
    }
    
    .pagination-btn.pagination-first,
    .pagination-btn.pagination-last {
        min-width: 36px;
    }
    
    .pagination-btn.pagination-prev,
    .pagination-btn.pagination-next {
        min-width: 34px;
    }
}

/* Animazioni per paginazione */
.pagination-container {
    animation: fadeInUp 0.4s ease-out;
}

.pagination-btn {
    animation: fadeInUp 0.2s ease-out;
}

.pagination-btn:nth-child(1) { animation-delay: 0.1s; }
.pagination-btn:nth-child(2) { animation-delay: 0.15s; }
.pagination-btn:nth-child(3) { animation-delay: 0.2s; }
.pagination-btn:nth-child(4) { animation-delay: 0.25s; }
.pagination-btn:nth-child(5) { animation-delay: 0.3s; }
.pagination-btn:nth-child(6) { animation-delay: 0.35s; }
.pagination-btn:nth-child(7) { animation-delay: 0.4s; }
.pagination-btn:nth-child(8) { animation-delay: 0.45s; }
.pagination-btn:nth-child(9) { animation-delay: 0.5s; }

/* ===== CORREZIONI PER CAMPO DI RICERCA E PULSANTI ===== */

/* Rimuovi il barrato dal campo di ricerca */
#search-scadenza {
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-style: none !important;
    text-decoration-color: transparent !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    pointer-events: auto !important;
    cursor: text !important;
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 2px solid var(--border-color) !important;
}

#search-scadenza:focus {
    text-decoration: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(40, 96, 144, 0.1) !important;
    outline: none !important;
}

#search-scadenza:hover {
    text-decoration: none !important;
    border-color: var(--primary-color) !important;
}

/* Assicurati che i pulsanti siano cliccabili */
.btn {
    cursor: pointer !important;
    pointer-events: auto !important;
    user-select: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

.btn:hover {
    cursor: pointer !important;
    transform: translateY(-1px) !important;
    box-shadow: var(--shadow-lg) !important;
}

.btn:active {
    transform: translateY(0) !important;
}

.btn:disabled {
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
}

/* Rimuovi eventuali overlay che bloccano i click */
.scadenzario-filters::after,
.scadenzario-filters::before {
    pointer-events: none !important;
}

.scadenzario-filters,
.filter-actions {
    pointer-events: auto !important;
}

/* Assicurati che i modal funzionino correttamente */
.modal {
    display: none !important;
    position: fixed !important;
    z-index: 9999 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: var(--bg-modal) !important;
    backdrop-filter: blur(4px) !important;
}

.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal .close {
    cursor: pointer !important;
    pointer-events: auto !important;
    color: var(--text-secondary) !important;
    font-size: 28px !important;
    font-weight: bold !important;
    transition: color var(--transition-base) !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
}

.modal .close:hover {
    color: var(--text-primary) !important;
    background: var(--bg-secondary) !important;
}

/* Assicurati che i pulsanti specifici funzionino */
#gestisci-categorie-button,
#aggregati-button,
#ricorrente-button,
button[onclick*="openSettingsModal"],
button[onclick*="openCategorieModal"],
.btn-secondary:contains("Impostazioni"),
.btn-warning:contains("Gestisci Categorie") {
    cursor: pointer !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
    position: relative !important;
    z-index: 1000 !important;
}

/* Forza la visibilità di tutti i pulsanti nella barra dei filtri */
.filter-actions button,
.scadenzario-filters button {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 1000 !important;
}

/* Rimuovi eventuali stili di barrato da tutti gli elementi */
* {
    text-decoration: none !important;
}

input, textarea, select {
    text-decoration: none !important;
}

/* Assicurati che i pulsanti con onclick funzionino */
button[onclick] {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Stili per pulsanti specifici menzionati nell'immagine */
.btn-primary:contains("Nuova Scadenza"),
.btn-warning:contains("Scadenza Ricorrente"),
.btn-secondary:contains("Impostazioni"),
.btn-info:contains("Aggregati") {
    cursor: pointer !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

/* ===== FINE CORREZIONI ===== */

/* Stili responsive specifici per il modal categorie */
@media (max-width: 768px) {
    #categorie-modal .modal-content {
        width: 98%;
        max-width: none;
        margin: 2% auto;
        border-radius: 12px;
    }
    
    #categorie-modal .modal-header {
        padding: 20px;
        border-radius: 12px 12px 0 0;
    }
    
    #categorie-modal .modal-header h3 {
        font-size: 20px;
    }
    
    #categorie-modal .modal-body {
        padding: 20px;
        max-height: 75vh;
        overflow-y: auto;
    }
    
    #categorie-modal .nav-tabs {
        flex-direction: column;
        border-bottom: none;
        border-right: 2px solid #e2e8f0;
        margin-bottom: 0;
        margin-right: 20px;
    }
    
    #categorie-modal .nav-tabs .nav-link {
        border-radius: 8px 0 0 8px;
        text-align: left;
        padding: 10px 16px;
    }
    
    #categorie-modal .nav-tabs .nav-link.active {
        border-bottom: none;
        border-right: 3px solid var(--primary-color);
    }
    
    #categorie-modal .nav-tabs .nav-link.active::before {
        display: none;
    }
    
    #categorie-modal .categoria-item {
        padding: 12px 16px;
        margin-bottom: 6px;
    }
    
    #categorie-modal .categoria-item .categoria-nome {
        font-size: 14px;
    }
    
    #categorie-modal .categoria-item .categoria-actions {
        gap: 4px;
    }
    
    #categorie-modal .categoria-item .btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    #categorie-modal .add-categoria-btn {
        padding: 10px 20px;
        font-size: 14px;
        margin-top: 15px;
    }
    
    #categorie-modal .modal-footer {
        padding: 15px 20px;
        border-radius: 0 0 12px 12px;
    }
}

@media (max-width: 480px) {
    #categorie-modal .modal-content {
        width: 100%;
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }
    
    #categorie-modal .modal-header {
        border-radius: 0;
        padding: 15px;
    }
    
    #categorie-modal .modal-header h3 {
        font-size: 18px;
    }
    
    #categorie-modal .modal-body {
        padding: 15px;
        max-height: calc(100vh - 120px);
    }
    
    #categorie-modal .nav-tabs {
        margin-right: 15px;
    }
    
    #categorie-modal .nav-tabs .nav-link {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    #categorie-modal .categoria-item {
        padding: 10px 12px;
        margin-bottom: 4px;
    }
    
    #categorie-modal .categoria-item .categoria-nome {
        font-size: 13px;
    }
    
    #categorie-modal .categoria-item .btn {
        padding: 3px 6px;
        font-size: 11px;
    }
    
    #categorie-modal .add-categoria-btn {
        padding: 8px 16px;
        font-size: 13px;
        margin-top: 12px;
    }
    
    #categorie-modal .modal-footer {
        padding: 12px 15px;
        border-radius: 0;
    }
}