/*
 * Print rules for the report screens.
 *
 * Global rather than a scoped `.razor.css` on purpose: printing a report means hiding the
 * app shell — MudBlazor's app bar, nav drawer, snackbars — and scoped CSS only ever reaches
 * the component's own markup, so it cannot touch any of them.
 *
 * Uses `visibility` rather than `display` for the hide pass. Collapsing the shell with
 * `display:none` reflows the report out of the first page's top margin, which printed a
 * blank first sheet; `visibility:hidden` leaves layout intact and only blanks the pixels,
 * and the printable block is then lifted to the page origin explicitly.
 */

/* Shown only on paper — on screen the live filter controls already say the same thing. */
.souce-print-only {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }

    .souce-printable,
    .souce-printable * {
        visibility: visible;
    }

    .souce-printable {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .souce-print-only {
        display: block !important;
    }

    /* Pager, column-chooser popovers and the drawer/app bar are chrome, not content.
       They are already invisible, but leaving them in flow pushes the table width out. */
    .mud-table-pagination,
    .mud-drawer,
    .mud-appbar,
    .mud-overlay,
    .mud-popover,
    .mud-snackbar-provider {
        display: none !important;
    }

    /* Keep the table readable in portrait and let long reports break across pages. */
    .souce-printable table {
        width: 100% !important;
        font-size: 10pt;
        border-collapse: collapse;
    }

    .souce-printable th,
    .souce-printable td {
        padding: 4px 6px !important;
        border-bottom: 1px solid #cbd5e1 !important;
    }

    .souce-printable thead {
        display: table-header-group;
    }

    .souce-printable tr {
        page-break-inside: avoid;
    }

    /* MudBlazor caps the data-grid body height for virtual scrolling; on paper that would
       clip every row past the first screenful. */
    .souce-printable .mud-table-container {
        max-height: none !important;
        overflow: visible !important;
    }
}
