/* ==========================================================================
   Print styles for HORECA documents (invoice, order, delivery note).
   Screen: the .print-doc blocks are hidden (documents are print-only).
   Print:  everything is hidden except the .print-doc that is being printed.
   ========================================================================== */

/* On screen, the printable document templates are hidden — the normal
   interactive page is what the admin sees. */
.print-doc {
    display: none;
}

@media print {
    /* Hide the entire app UI while printing... */
    body * {
        visibility: hidden;
    }

    /* ...then reveal only the active print document. A page sets
       .printing on the document it wants to print. */
    .print-doc.printing,
    .print-doc.printing * {
        visibility: visible;
    }

    .print-doc.printing {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 0;
        margin: 0;
        background: #fff;
        color: #000;
        font-family: "Segoe UI", Arial, sans-serif;
        font-size: 12px;
    }

    /* Avoid awkward page breaks inside table rows */
    .print-doc tr,
    .print-doc .doc-header,
    .print-doc .doc-parties {
        page-break-inside: avoid;
    }

    @page {
        size: A4;
        margin: 16mm 14mm;
    }
}

/* --------------------------------------------------------------------------
   Document layout (used only when printing, but defined outside the media
   query so the structure/spacing is consistent).
   -------------------------------------------------------------------------- */
.print-doc .doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #1b4332;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.print-doc .company-name {
    font-size: 22px;
    font-weight: 800;
    color: #1b4332;
    letter-spacing: 0.5px;
}

.print-doc .company-sub {
    font-size: 11px;
    color: #555;
    margin-top: 2px;
}

.print-doc .company-contact {
    font-size: 11px;
    color: #555;
    margin-top: 6px;
    line-height: 1.5;
}

.print-doc .doc-title-block {
    text-align: right;
}

.print-doc .doc-title {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1b4332;
}

.print-doc .doc-meta {
    font-size: 11px;
    color: #333;
    margin-top: 6px;
    line-height: 1.6;
}

.print-doc .doc-meta strong {
    color: #000;
}

.print-doc .doc-parties {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 24px;
}

.print-doc .party-block {
    font-size: 11.5px;
    line-height: 1.6;
}

.print-doc .party-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 3px;
}

.print-doc .party-name {
    font-weight: 700;
    font-size: 13px;
}

.print-doc table.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.print-doc table.doc-table th {
    background: #f0fdf4;
    border-bottom: 2px solid #1b4332;
    text-align: left;
    padding: 8px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1b4332;
}

.print-doc table.doc-table td {
    border-bottom: 1px solid #e0e0e0;
    padding: 7px 10px;
    font-size: 11.5px;
}

.print-doc table.doc-table td.num,
.print-doc table.doc-table th.num {
    text-align: right;
}

.print-doc table.doc-table tfoot td {
    border-top: 2px solid #1b4332;
    border-bottom: none;
    font-weight: 700;
    font-size: 13px;
    padding-top: 10px;
}

.print-doc .doc-total-label {
    text-align: right;
}

.print-doc .doc-footer {
    margin-top: 28px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
    font-size: 10.5px;
    color: #777;
    text-align: center;
}

.print-doc .doc-signature {
    margin-top: 42px;
    display: flex;
    justify-content: flex-end;
}

.print-doc .signature-box {
    width: 200px;
    border-top: 1px solid #333;
    text-align: center;
    padding-top: 4px;
    font-size: 11px;
    color: #333;
}
