/** Fix for Chrome issue #273306 **/
@media print {
    body { 
        margin: 0; 
        padding: 14px;
        font-size: 11px; /* Adjust font size to fit content */
        line-height: 1.5;
    }
    
    body.A3.landscape { width: 420mm }
    body.A3, body.A4.landscape { width: 297mm }
    body.A4, body.A5.landscape { width: 210mm }
    body.A5                    { width: 148mm }
    body.letter, body.legal    { width: 216mm }
    body.letter.landscape       { width: 280mm }
    body.legal.landscape       { width: 357mm }
    
    div, table, h1, h2, h4, th, td {
        page-break-inside: avoid; /* Prevent elements from breaking inside */
        page-break-after: auto;
        page-break-before: auto;
    }

    .panel {
        border: none; /* Remove borders for cleaner print */
        margin: 0;
        padding: 0;
    }

    html, body {
        page-break-before: avoid !important;
        page-break-after: avoid !important;
    }

    .no-page-break,
    .table,
    .table-responsive {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
        page-break-before: avoid !important;
    }

    .table {
        display: table !important;
    }
    
    table {
        width: 100%; /* Ensure tables take up full width */
        page-break-before: avoid;
        page-break-inside: avoid;
        border-collapse: collapse;
      }
    
      tr {
        page-break-inside: avoid;
        page-break-after: auto;
      }
    
      thead {
        display: table-header-group; /* Repeat the table head on every page */
      }
    
      tfoot {
        display: table-footer-group; /* Repeat the table footer if needed */
      }
    
    table, thead, tbody, th, td{
        border: 1.5px solid #000 !important; /* Add borders for cells */    
    }
    
    th, td {
        font-size: 12px;
        padding: 5px 0 !important;
    }
    
    .no-page-break {
        page-break-before: avoid;
        page-break-inside: avoid;
        break-inside: avoid;
      }

    h1, h2, h4 {
        text-align: center; /* Center titles for better aesthetics */
        margin: 5px 0;
    }

    .noPrint {
        display: none !important; /* Hide elements not needed for printing */
    }

    .table-responsive {
        overflow: visible !important; /* Ensure table is fully visible */
    }

    /* Class teacher and signature section */
    .teacher-signature {
        display: flex;
        align-items: center;
        margin-top: 20px;
        /*border: 1px solid #111;*/
        border-radius: 2px;
    }

    .teacher-signature h4 {
        color: white;
        padding: 5px;
        margin: 0;
        flex: 1;
    }

    .teacher-signature div {
        flex: 3;
        height: 20px;
    }
}