/* print.css: Regole definitive per forzare la stampa orizzontale e centrata */
@media print {

    /* Nascondi elementi non stampabili */
    header, aside, footer, #searchInput, .print-button, nav {
        display: none !important;
    }

    /* Resetta il layout generale */
    body {
        background-color: #fff !important;
        color: #000 !important;
        display: block !important;
        font-size: 11pt;
        margin: 0.5cm; /* Aggiunge un margine intorno alla pagina stampata */
    }

    .container, main, .table-container {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    /* FORZA LA TABELLA A COMPORTARSI COME UNA TABELLA REALE */
    table {
        display: table !important; 
        width: 100% !important; /* Occupa tutta la larghezza disponibile */
        border-collapse: collapse !important;
        margin-top: 1rem !important;
        /* Rimuoviamo il centraggio con margin: auto, usiamo width: 100% per coprire la pagina */
    }
    
    /* Forza righe, thead, tbody a comportarsi come normali righe di tabella */
    thead, tbody, tr {
        display: table-row-group !important;
    }
    
    /* Forza le celle a comportarsi come normali celle di tabella */
    th, td {
        display: table-cell !important;
        text-align: left !important;
        border: 1px solid #000 !important;
        padding: 8px !important;
        background-color: #fff !important;
        color: #000 !important;
        padding-left: 8px !important;
        position: static !important; 
    }

    /* IMPOSTAZIONE LARGHEZZE DELLE COLONNE PER RENDERLE UNIFORMI */
    /* Abbiamo 6 colonne: ID, Nome, Email, Ruolo */
    
    th:nth-child(1), td:nth-child(1) { width: 50'% !important; }/* Comune */
    th:nth-child(2), td:nth-child(2) { width: 10% !important; } /* Provincia */
    th:nth-child(3), td:nth-child(3) { width: 10% !important; } /* Cap */
    th:nth-child(4), td:nth-child(4) { width: 10% !important; } /* Visita1 */
 	th:nth-child(5), td:nth-child(5) { width: 10% !important; } /* Visita2 */
  	th:nth-child(6), td:nth-child(6) { width: 10% !important; } /* Visita3 */
    /* Rimuovi completamente gli pseudo-elementi data-label */
    td:before {
        content: none !important;
    }

    /* Stile intestazioni */
    thead th {
        background-color: #f2f2f2 !important;
        font-weight: bold !important;
    }
    
    /* Impostazioni di interruzione pagina */
    tbody tr {
        page-break-inside: avoid !important;
    }
}