@media print {
    /* Force landscape orientation */
    @page {
        size: landscape;
        margin: 0.25in;
    }

    /* Compact font size for print */
    body {
        font-size: 10px !important;
    }

    /* Hide MudBlazor shell elements */
    .mud-appbar,
    .mud-drawer,
    .mud-drawer-overlay,
    .mud-snackbar-provider,
    .mud-overlay,
    .mud-popover-provider {
        display: none !important;
    }

    /* Reset main content padding (removes app bar offset) */
    .mud-main-content {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* Strip card and table shadows/borders */
    .mud-card,
    .mud-table {
        box-shadow: none !important;
        border: none !important;
    }

    /* Force tabular layout in print (override MudBlazor responsive breakpoint) */
    .mud-table thead {
        display: table-header-group !important;
    }
    .mud-table tr {
        display: table-row !important;
    }
    .mud-table td:not(.no-print),
    .mud-table th:not(.no-print) {
        display: table-cell !important;
    }
    /* Hide the DataLabel pseudo-element that responsive mode adds */
    .mud-table td::before {
        display: none !important;
        content: none !important;
    }

    /* Left-align column headers with cell content */
    .mud-table th {
        text-align: left !important;
    }

    /* Compact table cell padding and prevent wrapping */
    .mud-table th,
    .mud-table td,
    .mud-table .mud-table-cell {
        padding: 2px 6px !important;
        white-space: nowrap !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
    }

    /* Remove MudTable min-height and extra spacing */
    .mud-table .mud-table-container {
        min-height: 0 !important;
    }

    .mud-table .mud-table-root {
        min-height: 0 !important;
    }

    /* Prevent table rows from breaking across pages */
    tr {
        page-break-inside: avoid;
    }

    /* Hide elements marked as no-print */
    .no-print {
        display: none !important;
    }

    /* Show elements marked as print-only */
    .print-only {
        display: block !important;
    }

    /* Ensure colored text prints correctly */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Hide print-only elements on screen */
.print-only {
    display: none;
}
