/*
    The print stylesheet, linked from App.razor with media="print" so it never affects the screen.

    A report has to print as a document: the title, the range and the rows, and none of the
    application around them. Legacy got this from the RDLC viewer, which rendered a report as its own
    page; here the report is a Blazor screen inside the app shell, so the shell is what has to go.

    Everything below is layout removal. Nothing here changes what the report says.
*/

@page {
    margin: 12mm;
}

/* The app shell: Radzen's header and sidebar, the error banner, and the reconnect overlay. */
.rz-header,
.rz-sidebar,
#blazor-error-ui,
#components-reconnect-modal {
    display: none !important;
}

/* The report screen's own chrome - the picker, the date range and the buttons. */
.report-toolbar {
    display: none !important;
}

/*
    Radzen positions the body beside the sidebar and below the header with margins on .rz-body. With
    both gone, those margins are a blank strip down the left of every printed page.
*/
.rz-layout,
.rz-body {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
}

.rz-body > div {
    padding: 0 !important;
}

/*
    Grid chrome that means nothing on paper: the pager, the grouping panel, the expand buttons on the
    group rows and the sort arrows.
*/
.report-grid .rz-paginator,
.report-grid .rz-group-header,
.report-grid .rz-group-row .rz-button,
.report-grid .rz-sortable-column-icon {
    display: none !important;
}

/*
    Borders print far heavier than they render, and a report is mostly lines. Hairlines instead, and
    a grey band on the group and total rows so subtotals stay findable in black and white.
*/
.report-grid .rz-data-grid,
.report-grid table,
.report-grid th,
.report-grid td {
    border-color: #999 !important;
    box-shadow: none !important;
}

/*
    The group rows and the subtotal rows. A subtotal row carries no class of its own in Radzen 11 -
    its cells are the ones holding .rz-column-footer, which is also what the grand total's cells
    carry, so one selector bands both.
*/
.report-grid .rz-group-row td,
.report-grid tr:has(> td > .rz-column-footer) td {
    background: #eee !important;
    font-weight: 600;
}

/* A group's rows should not be split across a page break where it can be helped. */
.report-grid tr {
    page-break-inside: avoid;
}

.report-grid thead {
    display: table-header-group;
}

/*
    The month pivots. Two things have to change on paper.

    The grid scrolls sideways on screen, because a year is thirteen columns; a scroll container prints
    whatever happened to be scrolled into view and clips the rest, so on paper it has to overflow
    visibly and let the print engine deal with the width.

    And thirteen columns of two stacked figures do not fit a portrait page at screen size, so the type
    comes down. Small, but the alternative is a column of last year's figures falling off the edge -
    and a comparison report missing the thing it compares against is worse than a small font.
*/
.report-pivot .rz-data-grid {
    overflow: visible !important;
}

.report-pivot table {
    font-size: 7.5pt;
}

/*
    Last year's figure is dimmed on screen so this year's reads first. Dimmed grey at 7.5pt on paper is
    close to not printed at all, and it is half the report, so it goes back to full ink and stays
    distinguishable by size alone.
*/
.report-pivot .pivot-prior {
    opacity: 1 !important;
}

.report-pivot .pivot-cell-empty {
    opacity: 0.75 !important;
}

/* Ink. The screen theme is light-on-dark for some users; paper is not. */
body,
.report-grid,
.report-grid td,
.report-grid th,
.report-heading {
    color: #000 !important;
    background: #fff !important;
}
