/* Printed report of a receipt (Blazor only, wms-receiving "Relatório da nota"): A4 portrait, black on white like the other printed documents
   (components/printing.css: 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. */
@page receiving-report {
    size: A4 portrait;
    margin: 12mm 10mm 14mm;

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

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

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

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

.receiving-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;
}

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

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

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

.receiving-report-document {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2mm 5mm;
    margin: 3mm 0;
}

.receiving-report-document .is-wide {
    grid-column: span 2;
}

.receiving-report-document dt,
.receiving-report-addresses small {
    font-size: 7pt;
    text-transform: uppercase;
}

.receiving-report-document dd {
    margin: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.receiving-report-mono {
    font-family: 'Courier New', monospace;
}

.receiving-report-addresses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6mm;
    margin-bottom: 3mm;
    break-inside: avoid;
}

.receiving-report-addresses > div {
    display: flex;
    flex-direction: column;
    gap: 1mm;
    border: 1px solid var(--print-ink);
    padding: 2mm;
}

/* The barcode and its text are centered in the box of the address; the title (the small above it) stays on the left. */
.receiving-report .code128 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5mm;
    text-align: center;
}

.receiving-report .code128 svg {
    width: 70mm;
    height: 11mm;
    fill: var(--print-ink);
}

.receiving-report .code128-text {
    font: 700 9pt 'Courier New', monospace;
}

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

.receiving-report-table {
    width: 100%;
    border-collapse: collapse;
}

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

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

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

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

.receiving-report-table .is-number {
    text-align: right;
    white-space: nowrap;
}

.receiving-report-table td small {
    display: block;
    font-size: 7.5pt;
}

.receiving-report-ean {
    width: 34mm;
}

.receiving-report .ean13 {
    display: block;
    width: 32mm;
    height: 12.5mm; /* bars of 30 modules (BarHeight): same width, about a third lower (2026-10-22, user request) */
    fill: var(--print-ink);
    font: 9px 'Courier New', monospace;
}

.receiving-report .ean13-text {
    font-family: 'Courier New', monospace;
}

.receiving-report-total {
    margin: 2mm 0 0;
    text-align: right;
    font-weight: 700;
}

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

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

/* The product code with its check digit (11161-7) never breaks at the hyphen. */
.receiving-report td.receiving-report-mono {
    white-space: nowrap;
}

/* "Recontar" (2026-10-08): the items of round 2 while the receipt is in recount, next to the description; never a quantity. */
.receiving-report-recount {
    display: inline-block;
    margin-left: 2mm;
    border: 1px solid var(--print-ink);
    padding: 0 1.5mm;
    font-size: 7pt;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Batches one per line (2026-10-22, user request). */
.receiving-report-lines {
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
}
