@media print {

    /* Absolute reset for paper */
    @page {
        margin: 1cm;
        size: landscape;
    }

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        height: auto !important;
        width: 100% !important;
    }

    /* THE NUKE: Explicitly hide the main app container and any overlays */
    #app,
    .app-container,
    .admin-layout,
    #photoModal,
    .dashboard-container {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
        position: absolute !important;
        pointer-events: none !important;
    }

    /* Ensure Print area is the only thing standing */
    #printArea {
        display: block !important;
        visibility: visible !important;
        position: static !important;
        width: 100% !important;
        background: white !important;
        z-index: 9999999 !important;
    }

    /* Centering the report box on the paper */
    .print-main-container {
        display: block;
        width: 100%;
        background: white !important;
    }

    .report-box {
        width: 26cm;
        /* Optimized for landscape A4 (29.7cm - margins) */
        max-width: 95%;
        margin: 0 auto;
        border: 2px solid black;
        padding: 25px;
        background: white !important;
        box-sizing: border-box;
    }

    /* Print Table Defaults */
    table {
        width: 100%;
        border-collapse: collapse;
    }

    th,
    td {
        border: 1px solid black;
        padding: 6px;
    }
}

/* Hide on screen */
#printArea {
    display: none;
}