.document-print-wrapper {
    background: #f4f6f8;
}

.document-print-shell {
    --document-accent: #145a55;
    background: #fff;
    color: #36393d;
    display: flex;
    flex-direction: column;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    margin: 0 auto;
    min-height: 297mm;
    /* Top bar (8mm) + content padding + bottom bar (8mm) */
    padding: 34mm 14mm 30mm;
    position: relative;
    width: 210mm;
}

.document-print-shell::before,
.document-print-shell::after {
    background: var(--document-accent);
    content: "";
    height: 8mm;
    left: 0;
    position: absolute;
    right: 0;
}

.document-print-shell::before {
    top: 0;
}

.document-print-shell::after {
    bottom: 0;
}

.document-header {
    align-items: flex-start;
    display: flex;
    gap: 32px;
    justify-content: space-between;
}

.document-logo {
    max-height: 92px;
    max-width: 320px;
    object-fit: contain;
}

.document-title {
    color: var(--document-accent);
    text-align: right;
}

.document-title h1 {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: 0;
    margin: 4px 0 14px;
    text-transform: uppercase;
}

.document-title p {
    color: #33383d;
    font-size: 16px;
    margin: 2px 0;
}

.document-contact-strip {
    margin-top: 32px;
}

.document-contact-strip p,
.document-party p,
.document-footer p {
    margin: 4px 0;
}

.document-rule {
    border: 0;
    border-top: 1px solid #d8dde1;
    margin: 22px 0 18px;
}

.document-parties {
    display: grid;
    gap: 42px;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    margin-bottom: 42px;
}

.document-party h2 {
    color: var(--document-accent);
    font-size: 17px;
    font-weight: 500;
    margin: 0 0 8px;
}

.document-party-name {
    font-size: 18px;
    font-weight: 500;
}

.document-muted {
    color: #687079;
}

.document-address {
    white-space: pre-line;
}

.document-table {
    border-collapse: collapse;
    margin-top: 8px;
    table-layout: fixed;
    width: 100%;
}

.document-table th {
    background: var(--document-accent);
    border: 1px solid rgba(255, 255, 255, .35);
    color: #fff;
    font-weight: 500;
    padding: 13px 12px;
}

.document-table td {
    border: 1px solid #e5e8eb;
    padding: 13px 12px;
    vertical-align: top;
}

.document-table tbody tr:nth-child(even) td {
    background: #fafbfc;
}

.document-table .document-number {
    text-align: center;
    width: 48px;
}

.document-table .document-qty {
    text-align: center;
    width: 78px;
}

.document-table .document-money {
    text-align: right;
    width: 132px;
}

.document-item-title {
    display: block;
    font-weight: 500;
}

.document-item-note {
    color: #687079;
    display: block;
    font-size: 13px;
    margin-top: 3px;
}

.document-total-label {
    color: #33383d;
    font-weight: 500;
    text-align: right;
}

.document-total-value {
    text-align: right;
}

.document-total-strong td {
    border-top: 2px solid var(--document-accent);
    color: var(--document-accent);
    font-size: 16px;
    font-weight: 600;
}

.document-meta-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-top: 28px;
}

.document-meta-panel {
    border: 1px solid #dfe4e8;
    padding: 16px 18px;
}

.document-meta-panel h3 {
    color: var(--document-accent);
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 10px;
    text-transform: uppercase;
}

/* Spacer pushes footer to the bottom of the page in flex layout */
.document-footer-spacer {
    flex: 1;
}

.document-footer {
    color: var(--document-accent);
    margin-top: 24px;
    padding-top: 12px;
    text-align: center;
}

/* ── VueHtmlToPaper popup window ────────────────────────────
   The popup body contains ONLY the document-print-shell directly.
   Do NOT hide anything — everything in the popup IS the document.
   Just ensure A4 sizing, no browser margins, and colour printing.
─────────────────────────────────────────────────────────── */
@page {
    size: A4 portrait;
    margin: 0;
}

body {
    margin: 0;
    padding: 0;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

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

    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .document-print-shell {
        box-shadow: none !important;
        margin: 0 !important;
    }

    /* Colour backgrounds and text must print */
    .document-print-shell::before,
    .document-print-shell::after,
    .document-table th {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Avoid splitting a product row across two pages */
    .document-table tr {
        page-break-inside: avoid;
    }
}
