/* Printed report of the shipping check (wms-reports, J11 of stage 14, Blazor only): A4 portrait, black on white like the receiving report (fixed paper colors, not theme
   tokens). Rendered in the print section of the Workspace (outside .workspace), hidden on screen by .print-area and the only thing printed while it
   exists. Each group starts on a new page, except in the grouping by route (a record only avoids breaking); a record never splits. */
@page shipcheck-report {
    size: A4 portrait;
    margin: 12mm 10mm 14mm;

    @bottom-right {
        content: counter(page) " / " counter(pages);
        font: 8pt Arial, sans-serif;
        color: var(--print-ink);
    }
}

.shipcheck-report {
    page: shipcheck-report;
    font: 8.5pt/1.3 Arial, sans-serif;
    color: var(--print-ink);
    background: var(--print-paper);
}

.shipcheck-report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8mm;
    border-bottom: 2px solid var(--print-ink);
    padding-bottom: 2mm;
}

.shipcheck-report-header small {
    font-size: 8pt;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.shipcheck-report-header h1 {
    margin: 1mm 0;
    font-size: 15pt;
    /* The global h1 of styles.css has a negative letter-spacing for the screen titles: on paper it glued the words. */
    letter-spacing: 0;
    word-spacing: normal;
}

.shipcheck-report-header p {
    margin: 0;
}

.shipcheck-report-printed {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1mm;
    text-align: right;
    font-size: 8pt;
}

.shipcheck-report-printed strong {
    border: 1px solid var(--print-ink);
    padding: .5mm 2mm;
    font-size: 9pt;
    text-transform: uppercase;
}

.shipcheck-report-totals,
.shipcheck-report-subtotals {
    margin: 2mm 0;
    font-weight: 700;
}

.shipcheck-report-notice {
    margin: 0 0 3mm;
    border: 1px solid var(--print-ink);
    padding: 2mm;
    font-weight: 700;
}

.shipcheck-report-group {
    margin-top: 4mm;
}

/* Grouping by checker, day or result: one group per page. */
.shipcheck-report-group.is-page + .shipcheck-report-group.is-page {
    break-before: page;
    page-break-before: always;
}

.shipcheck-report-group h2 {
    margin: 0;
    padding: 1mm 0;
    border-bottom: 1.5px solid var(--print-ink);
    font-size: 11pt;
    letter-spacing: 0;
    break-after: avoid;
}

.shipcheck-report-entry {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-top: 3mm;
    padding-top: 2mm;
    border-top: 1px dashed var(--print-ink);
}

.shipcheck-report-entry h3 {
    margin: 0;
    font-size: 10pt;
    letter-spacing: 0;
    break-after: avoid;
}

.shipcheck-report-facts {
    margin: 1mm 0;
}

.shipcheck-report-table {
    width: 100%;
    margin-top: 1.5mm;
    border-collapse: collapse;
}

.shipcheck-report-table thead {
    display: table-header-group;
}

.shipcheck-report-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
}

.shipcheck-report-table th,
.shipcheck-report-table td {
    border-bottom: 1px solid var(--print-ink);
    padding: .8mm 1.2mm;
    text-align: left;
    vertical-align: top;
}

.shipcheck-report-table th {
    border-top: 1px solid var(--print-ink);
    font-size: 7pt;
    text-transform: uppercase;
}

@media print {
    body:has(.print-area.shipcheck-report-print) .workspace {
        display: none !important;
    }

    .print-area.shipcheck-report-print {
        position: static !important;
    }

    /* The page behind the report is paper, not the gray of the screen (the PDF of a browser that prints the backgrounds). */
    html:has(.print-area.shipcheck-report-print),
    body:has(.print-area.shipcheck-report-print) {
        background: var(--print-paper) !important;
    }
}
