/* static/styles.css */

/* --- 1. CONFIGURAZIONE DESIGN SYSTEM & VARIABILI --- */
:root {
    --bg-app: #090d16;
    --bg-card: rgba(18, 26, 44, 0.45);
    --bg-card-hover: rgba(26, 38, 62, 0.6);
    --border-glass: rgba(255, 255, 255, 0.07);
    --border-glass-focus: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --color-blue: #3b82f6;
    --color-blue-glow: rgba(59, 130, 246, 0.15);
    --color-green: #10b981;
    --color-green-glow: rgba(16, 185, 129, 0.15);
    --color-red: #ef4444;
    --color-red-glow: rgba(239, 68, 68, 0.15);
    --color-purple: #8b5cf6;
    --color-purple-glow: rgba(139, 92, 246, 0.15);
    --color-warning: #f59e0b;
    --color-warning-glow: rgba(245, 158, 11, 0.15);
    
    --sidebar-width: 280px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
}

/* --- 2. RESET & SETUP DI BASE --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow-x: hidden;
    height: 100vh;
}

h1, h2, h3, h4, .brand h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* --- 3. BACKGROUND AMBIENTALE SFUMATO --- */
.ambient-glow {
    position: fixed;
    top: -10%;
    right: -10%;
    width: 60vw;
    height: 60vh;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, rgba(139, 92, 246, 0.05) 50%, rgba(0, 0, 0, 0) 100%);
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
}

/* --- 4. CONTENITORE LAYOUT PRINCIPALE --- */
.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* --- 5. SIDEBAR DESIGN (SINISTRA) --- */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 16, 30, 0.85);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 10;
    backdrop-filter: blur(20px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-wrapper {
    width: 44px;
    height: 44px;
    background: var(--color-blue-glow);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.brand h2 {
    font-size: 18px;
    line-height: 1.2;
}

.brand p {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.02);
}

.nav-item.active {
    color: #fff;
    background: var(--color-blue-glow);
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.nav-item i {
    font-size: 16px;
    width: 20px;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border-glass);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-secondary);
}

.user-profile h4 {
    font-size: 13px;
    color: var(--text-primary);
}

.user-profile p {
    font-size: 11px;
    color: var(--text-muted);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.green {
    background: var(--color-green);
    box-shadow: 0 0 8px var(--color-green);
}

/* --- 6. AREA PRINCIPALE DI CONTENUTO --- */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 32px 40px;
}

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

.content-header h1 {
    font-size: 28px;
    margin-bottom: 6px;
}

.text-muted {
    color: var(--text-secondary);
    font-size: 14px;
}

.badge-time {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-section {
    display: none;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease-out forwards;
}

.content-section.active {
    display: flex;
}

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

/* --- 7. CARDS IN STILE GLASSMORPHISM --- */
.glass {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

/* --- 8. CRUSCOTTO ANALITICO (DASHBOARD) --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.kpi-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kpi-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glass-focus);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.kpi-icon.blue { background: var(--color-blue-glow); color: var(--color-blue); }
.kpi-icon.green { background: var(--color-green-glow); color: var(--color-green); }
.kpi-icon.red { background: var(--color-red-glow); color: var(--color-red); }
.kpi-icon.purple { background: var(--color-purple-glow); color: var(--color-purple); }

.kpi-value {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.kpi-trend.positive { color: var(--color-green); }
.kpi-trend.negative { color: var(--color-red); }
.kpi-trend.neutral { color: var(--text-secondary); }

/* SEZIONE GRAFICI */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-top: 8px;
}

.chart-card {
    padding: 24px;
}

.chart-card h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.chart-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
}

/* --- 9. SCHERMATA UPLOAD DRAG & DROP --- */
.upload-zone {
    padding: 60px 40px;
    text-align: center;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--color-blue);
    background: rgba(59, 130, 246, 0.04);
}

.upload-icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--color-blue);
    margin-bottom: 8px;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.05);
}

.anim-bounce {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.file-requirements {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.btn {
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--color-blue);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-green {
    background: var(--color-green);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-green:hover {
    background: #059669;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

/* LOADER SPIN */
.loader-wrapper {
    padding: 80px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--color-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- 10. SUCCESS CARD --- */
.result-card {
    padding: 60px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.success-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-green-glow);
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--color-green);
    margin-bottom: 8px;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1);
}

.success-msg {
    max-width: 500px;
    color: var(--text-secondary);
}

.success-metrics {
    display: flex;
    gap: 32px;
    margin: 16px 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 16px 32px;
}

.success-metrics .metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.success-metrics .metric .lbl {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.success-metrics .metric .val {
    font-size: 16px;
    font-weight: 600;
}

.text-green { color: var(--color-green); }
.note-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* --- 11. SPLIT-SCREEN WORKSPACE (ERROR STATE) --- */
.split-screen-wrapper {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    height: calc(100vh - 170px);
}

/* PANNELLO SINISTRO (ERRORI) */
.error-panel {
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-glass);
}

.text-red { color: var(--color-red); }

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-red {
    background: var(--color-red-glow);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-red);
}

.panel-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 24px 16px 24px;
    border-bottom: 1px solid var(--border-glass);
}

.error-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.error-item {
    background: rgba(239, 68, 68, 0.02);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--border-radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.error-item:hover {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.3);
}

.error-item.active {
    background: rgba(239, 68, 68, 0.07);
    border-color: var(--color-red);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
}

.error-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
}

.error-item h4 {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.error-item p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* PANNELLO DESTRO (SMART GRID WORKSPACE) */
.grid-panel {
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
}

.tab-selector {
    display: flex;
    gap: 8px;
}

.tab-btn {
    padding: 10px 16px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--color-blue);
    background: var(--color-blue-glow);
    border-color: rgba(59, 130, 246, 0.2);
}

.section-title-bar {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.01);
    border-bottom: 1px solid var(--border-glass);
}

.section-title-bar h4 {
    font-size: 15px;
    color: var(--text-primary);
}

.section-title-bar p {
    font-size: 11px;
}

.table-scroll-container {
    flex-grow: 1;
    overflow: auto;
}

/* SMART TABELLA */
.smart-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.smart-grid th {
    background: rgba(10, 16, 30, 0.6);
    position: sticky;
    top: 0;
    padding: 14px 16px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-glass);
    backdrop-filter: blur(10px);
}

.smart-grid td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.smart-grid tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* Cella modificabile */
.smart-grid td[contenteditable="true"] {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: text;
    transition: var(--transition-smooth);
}

.smart-grid td[contenteditable="true"]:focus {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.5);
    box-shadow: inset 0 0 6px rgba(59, 130, 246, 0.2);
}

/* Cella in Errore (Pulsante) */
.smart-grid td.cell-error {
    background: rgba(239, 68, 68, 0.04) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    color: #fca5a5;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: inset 0 0 4px rgba(239, 68, 68, 0.15); }
    50% { box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.35); }
}

/* BARRA DI AZIONE SOTTO GRID */
.grid-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--border-glass);
    background: rgba(10, 16, 30, 0.4);
}

.recalc-status {
    font-size: 13px;
    font-weight: 500;
}

.status-indicator.warning { color: var(--color-warning); }
.status-indicator.success { color: var(--color-green); }

.btn-group {
    display: flex;
    gap: 12px;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none !important;
}

/* --- 12. TABELLA STORICO CARICAMENTI --- */
.history-table-card {
    padding: 0;
    overflow: hidden;
}

.card-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-glass);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.history-table th {
    background: rgba(10, 16, 30, 0.3);
    padding: 16px 32px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-glass);
}

.history-table td {
    padding: 16px 32px;
    border-bottom: 1px solid var(--border-glass);
}

.history-table tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.badge-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-status.compliant {
    background: var(--color-green-glow);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--color-green);
}

.badge-status.non-compliant {
    background: var(--color-red-glow);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--color-red);
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* --- 13. NOTIFICHE TOAST --- */
.toast-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
}

.toast {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 16px 24px;
    color: var(--text-primary);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes slideIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-color: rgba(16, 185, 129, 0.3); }
.toast.success i { color: var(--color-green); }
.toast.error { border-color: rgba(239, 68, 68, 0.3); }
.toast.error i { color: var(--color-red); }

/* --- 14. STILI DI STAMPA PDF ISTITUZIONALE --- */
.print-only {
    display: none;
}

@media print {
    /* Nascondiamo sidebar, pulsantiera, drag-and-drop e parti superflue */
    aside, 
    nav, 
    .sidebar, 
    .btn, 
    .nav-toggle, 
    .grid-actions-bar,
    .upload-drag-area, 
    .file-requirements, 
    .error-panel,
    .tab-selector, 
    .toast-wrapper,
    .card-header p {
        display: none !important;
    }

    /* Resettiamo il background scuro per consumare meno inchiostro e rendere il foglio bianco e leggibile */
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: 'Inter', system-ui, sans-serif !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    main {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .glass {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Espone elementi visibili solo in stampa */
    .print-only {
        display: block !important;
    }

    .print-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #1e293b;
        padding-bottom: 16px;
        margin-bottom: 24px;
    }

    .print-header h1 {
        font-size: 20px;
        color: #1e293b;
        font-weight: 700;
        margin: 0;
    }

    .print-header p {
        font-size: 11px;
        color: #475569;
        margin: 4px 0 0 0;
    }

    .print-logo-area {
        text-align: right;
        font-size: 12px;
        font-weight: 600;
        color: #3b82f6;
    }

    /* Grid layout modificata per la stampa di KPI card */
    .kpi-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
        margin-bottom: 24px !important;
    }

    .kpi-card {
        flex: 1 !important;
        min-width: 140px !important;
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        padding: 12px !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        color: #0f172a !important;
    }

    .kpi-card .kpi-value {
        font-size: 20px !important;
        color: #1e293b !important;
    }

    .kpi-card h3 {
        font-size: 11px !important;
        color: #64748b !important;
    }

    /* Sezione Smart Grid e tabelle */
    .split-screen-wrapper {
        display: block !important;
        height: auto !important;
    }

    .grid-panel {
        display: block !important;
        overflow: visible !important;
    }

    .table-scroll-container {
        overflow: visible !important;
    }

    .smart-grid {
        border: 1px solid #cbd5e1 !important;
        page-break-inside: avoid;
    }

    .smart-grid th {
        background: #f1f5f9 !important;
        color: #0f172a !important;
        border-bottom: 2px solid #cbd5e1 !important;
        padding: 8px 10px !important;
        font-size: 11px !important;
    }

    .smart-grid td {
        border-bottom: 1px solid #e2e8f0 !important;
        color: #000000 !important;
        padding: 8px 10px !important;
        font-size: 11px !important;
        background: transparent !important;
    }

    /* Disabilita il bordo dashed delle celle modificabili */
    .smart-grid td[contenteditable="true"] {
        border: none !important;
        background: transparent !important;
    }

    /* Nasconde i grafici in fase di stampa se complessi, o li impagina puliti */
    .charts-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 16px !important;
        page-break-before: always;
        margin-top: 24px;
    }

    .chart-card {
        background: #f8fafc !important;
        border: 1px solid #e2e8f0 !important;
        padding: 16px !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        height: 240px !important;
    }

    /* Blocco firma istituzionale in calce */
    .print-footer-signatures {
        display: flex !important;
        justify-content: space-between;
        margin-top: 60px;
        padding-top: 20px;
        border-top: 1px dashed #cbd5e1;
        page-break-inside: avoid;
    }

    .signature-box {
        text-align: center;
        width: 45%;
    }

    .signature-box p {
        font-size: 12px;
        color: #334155;
        margin-bottom: 40px;
    }

    .signature-line {
        border-bottom: 1px solid #475569;
        width: 180px;
        margin: 0 auto 4px auto;
    }

    .signature-title {
        font-size: 10px;
        color: #64748b;
        text-transform: uppercase;
    }
}
