@media print {
    /* Imposta pagina A4 */
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    /* Reset generale */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        width: 210mm;
        height: 297mm;
        font-size: 11px !important;
        margin: 0;
        padding: 0;
        background: white !important;
    }

    /* Nascondi elementi non necessari */
    .site-header,
    .copyright,
    #PrintPage,
    #reset-all,
    #anno-select,
    #comune-select,
    .select2,
    .select2-container,
    button[type="submit"],
    .btn-primary,
    .form-group,
    .reference-nota,
    .cell-editable .reset,
    nav,
    footer,
    .no-print {
        display: none !important;
    }

    /* Mostra solo il contenuto del report */
    .t3-wrapper,
    .t3-mainbody,
    .t3-content,
    .t3-component,
    .banche-dati-container {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .report-fsc-container {
        width: 100% !important;
        page-break-inside: avoid;
    }

    /* Titolo */
    h1 {
        font-size: 14px !important;
        margin: 0 0 10px 0 !important;
        padding: 0 !important;
        color: #1a365d !important;
    }

    /* Tabelle */
    .table {
        width: 100% !important;
        font-size: 10px !important;
        margin-bottom: 5px !important;
    }

    .table th,
    .table td {
        padding: 3px 5px !important;
        border: 1px solid #ddd !important;
    }

    .table th {
        background-color: #f5f5f5 !important;
        font-weight: bold;
    }

    .bg-gray {
        background-color: #f0f0f0 !important;
    }

    /* Riduci celle titolo */
    .titoloTAB {
        font-size: 11px !important;
        padding: 5px !important;
    }

    /* Nascondi form di selezione comune nella stampa */
    .titoloTAB form {
        display: none !important;
    }

    /* Mostra solo il nome del comune nel titolo */
    .titoloTAB::before {
        content: "Comune selezionato";
        display: block;
        font-weight: bold;
    }

    /* Select come testo */
    select {
        appearance: none;
        border: none !important;
        background: transparent !important;
        font-size: inherit;
    }

    /* Evita interruzioni di pagina */
    .table-responsive {
        page-break-inside: avoid;
        overflow: visible !important;
    }

    tr {
        page-break-inside: avoid;
    }

    /* Compatta tutto per stare in una pagina */
    .table-responsive:first-child {
        margin-bottom: 5px !important;
    }

    /* Rimuovi shadow e border-radius */
    * {
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    /* Link senza colore */
    a {
        color: inherit !important;
        text-decoration: none !important;
    }

    /* Contenitore principale */
    .container {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
    }

    /* Font più piccolo per celle editable */
    .cell-editable span[contenteditable] {
        font-size: 10px !important;
    }

    /* Testo italic più leggibile */
    .italic {
        font-style: italic;
        font-size: 10px !important;
    }

    /* Bold text */
    .bold {
        font-weight: bold !important;
    }

    /* Colonna con valori */
    .text-right {
        text-align: right !important;
    }

    /* Tab indent */
    .tab1 {
        padding-left: 15px !important;
    }
}
