.document-report-root {
    min-height: 100vh;
    padding: 1rem;
    background: #f1f3f5;
    font-size: 9px !important;
}

.document-report-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
    width: min(210mm, 100%);
    margin: 0 auto 1rem;
}

.document-report-share-dialog {
    box-sizing: border-box;
    width: min(32rem, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    padding: 1.25rem;
    border: 1px solid #d9dfe3;
    border-radius: 6px;
    color: #20252b;
    background: #fff;
    overflow: auto;
}

.document-report-share-dialog::backdrop {
    background: rgb(0 0 0 / 35%);
}

.document-report-share-dialog h2 {
    font-size: 1.125rem;
}

.document-report-share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.document-report-share-actions .btn {
    white-space: normal;
    overflow-wrap: anywhere;
}

.document-report-sheet {
    box-sizing: border-box;
    width: min(210mm, 100%);
    min-height: 297mm;
    margin: 0 auto;
    padding: 16mm;
    color: #20252b;
    background: #fff;
    box-shadow: 0 2px 14px rgb(31 41 55 / 12%);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10px !important;
}

.document-report-company {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #234b62;
}

.site-report-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}

.site-report-brand .site-report-company-logo {
    flex: 0 0 auto;
    max-width: 40mm;
    max-height: 24mm;
}

.document-report-company-details .site-report-company-name {
    min-width: 0;
    margin: 0;
    font-size: 16px !important;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.document-report-company-details .site-report-document-name {
    margin: .5rem 0 0;
}

.document-report-logo {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.document-report-company > .document-report-logo {
    grid-column: 1 / -1;
}

.document-report-company-details h1,.document-report-company-details h2,
.document-report-title h2 {
    margin: 0 0 .4rem;
    font-size: 12px !important;
    font-weight: 700;
}

.document-report-title {
    text-align: right;
    white-space: nowrap;
}

.document-report-title h2 {
    color: #234b62;
    text-transform: uppercase;
}

.document-report-customer {
    margin: 1rem 0;
    padding: .75rem 0;
    border-bottom: 1px solid #cbd3d9;
}

.document-report-customer h3 {
    margin: 0 0 .4rem;
    color: #234b62;
    font-size: 12px !important;
    text-transform: uppercase;
}

.document-report-lines {
    width: 100%;
    border-collapse: collapse;
}

.document-report-lines th,
.document-report-lines td {
    padding: .45rem .35rem;
    border-bottom: 1px solid #d9dfe3;
    vertical-align: top;
}

.document-report-lines th {
    color: #fff;
    background: #234b62;
    font-weight: 600;
    text-align: left;
}

.document-report-lines .number {
    text-align: right;
    white-space: nowrap;
}

.document-report-totals {
    width: min(82mm, 100%);
    margin: 1rem 0 0 auto;
}

.document-report-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .4rem 0;
    border-bottom: 1px solid #d9dfe3;
}

.document-report-totals .grand-total {
    color: #17384b;
    border-bottom: 2px solid #234b62;
    font-size: 12px !important;
}

.document-report-sheet.report-pdf-mode {
    width: 210mm;
    min-width: 0;
    min-height: 0;
    padding: 16mm;
    box-shadow: none;
}

.export-invoice-sheet {
    font-size: 10px !important;
    overflow-wrap: anywhere;
}

.export-invoice-header,
.export-invoice-parties {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6mm;
    border-bottom: 1px solid #cbd3d9;
    padding-bottom: 4mm;
    margin-bottom: 4mm;
}

.export-invoice-header {
    border-bottom: 2px solid #234b62;
}

.export-invoice-sheet h1,
.export-invoice-sheet h2 {
    margin: 2mm 0;
    font-size: 16px;
    font-weight: 700;
}

.export-invoice-sheet h2,
.export-invoice-sheet h3 {
    text-transform: uppercase;
    color: #234b62;
}

.export-invoice-sheet h3 {
    margin: 0 0 2mm;
    font-size: 11px;
}

.export-invoice-identification h2 {
    text-align: right;
}

.export-invoice-details {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 1mm 3mm;
    margin: 0;
}

.export-invoice-details dt,
.export-invoice-details dd {
    margin: 0;
    min-width: 0;
}

.export-invoice-lines {
    table-layout: fixed;
}

.export-invoice-lines th,
.export-invoice-lines td {
    padding: 2mm 1mm;
}

.export-invoice-lines th:first-child { width: 5%; }
.export-invoice-lines th:nth-child(2) { width: 30%; }
.export-invoice-lines th:nth-child(3) { width: 12%; }
.export-invoice-lines th:nth-child(4) { width: 8%; }
.export-invoice-lines th:nth-child(5) { width: 7%; }
.export-invoice-lines th:nth-child(6) { width: 13%; }
.export-invoice-lines th:nth-child(7) { width: 8%; }
.export-invoice-lines th:nth-child(8) { width: 17%; }

.export-invoice-lines .number {
    white-space: normal;
    overflow-wrap: anywhere;
}

.export-invoice-secondary { color: #59636c; }

.export-invoice-section {
    margin-top: 4mm;
    padding-top: 3mm;
    border-top: 1px solid #cbd3d9;
}

.export-invoice-shipment,
.export-invoice-bank {
    margin-top: 2mm;
    break-inside: avoid;
}

.export-invoice-note { white-space: pre-wrap; }
.export-invoice-footer { margin-top: 6mm; }
.export-invoice-signature {
    width: 65mm;
    max-width: 100%;
    margin: 15mm 0 0 auto;
    padding-top: 2mm;
    border-top: 1px solid #59636c;
    text-align: center;
    break-inside: avoid;
}

.account-statement-sheet .document-report-company-details,
.account-statement-sheet .document-report-title {
    width: auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.account-statement-sheet .document-report-title {
    max-width: 52mm;
    white-space: normal;
}

.account-statement-sheet .document-report-lines {
    table-layout: fixed;
}

.account-statement-sheet .document-report-lines th,
.account-statement-sheet .document-report-lines td {
    padding: .35rem .2rem;
    overflow-wrap: anywhere;
    white-space: normal;
}

@media (max-width: 720px) {
    .document-report-root {
        padding: .5rem;
        overflow-x: auto;
    }

    .document-report-sheet {
        min-width: 760px;
        padding: 1rem;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    body.report-print-mode * {
        visibility: hidden !important;
    }

    body.report-print-mode .document-report-root {
        min-height: 0;
        padding: 0;
        background: none;
    }

    body.report-print-mode .document-report-sheet,
    body.report-print-mode .document-report-sheet * {
        visibility: visible !important;
    }

    body.report-print-mode .document-report-sheet {
        position: absolute;
        inset: 0 auto auto 0;
        width: 210mm;
        min-width: 0;
        min-height: 0;
        margin: 0;
        padding: 16mm;
        box-shadow: none;
    }

    body.report-print-mode .document-report-toolbar {
        display: none !important;
    }

    body.report-print-mode .document-report-lines tr,
    body.report-print-mode .document-report-totals {
        break-inside: avoid;
    }
}