/* Quotation Professional A4 + Invox templates (Blazor SalesQuotationDetailsPage parity) */

.invoice-paper.template-erp-a4,
.invoice-paper.template-invox,
.template-erp-a4,
.template-invox {
    width: 100%;
    max-width: 794px;
    min-height: 1123px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 0.7in 0.4in 0.7in 0.55in;
}

.template-erp-a4 { font-size: 12px; line-height: 1.45; }
.erp-a4-item-title { font-weight: 600; color: #1e293b; margin: 0 0 2px; font-size: 12px; }
.erp-a4-item-sub { font-size: 11px; color: #64748b; line-height: 1.45; margin: 0; }
.erp-a4-item-sub + .erp-a4-item-sub { margin-top: 2px; }

.erp-a4-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 12px;
    margin-bottom: 10px;
    border-bottom: 2px solid #1e293b;
}
.erp-a4-logo img { width: 120px; height: auto; max-height: 88px; object-fit: contain; display: block; }
.erp-a4-logo-placeholder {
    width: 120px; height: 88px; border: 1px solid #e2e8f0;
    display: flex; align-items: center; justify-content: center; color: #64748b; font-size: 12px;
}
.erp-a4-company-block { flex: 1; text-align: right; min-width: 0; }
.erp-a4-company-name { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: #1e293b; text-transform: uppercase; }
.erp-a4-company-meta { margin: 0; font-size: 11px; color: #64748b; line-height: 1.45; }
.erp-a4-doc-title {
    text-align: center; margin: 0 0 10px; padding: 6px 0; font-size: 18px; font-weight: 700;
    color: #1e293b; letter-spacing: 1.2px; text-transform: uppercase; border-bottom: 1px solid #e2e8f0;
}
.erp-a4-doc-info {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
    margin-bottom: 12px; padding: 10px 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px;
}
.erp-a4-doc-info-left { flex: 1; min-width: 0; text-align: left; }
.erp-a4-doc-info-right { flex: 1; min-width: 0; text-align: right; }
.erp-a4-info-row { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; row-gap: 2px; line-height: 1.4; }
.erp-a4-info-row + .erp-a4-info-row { margin-top: 5px; }
.erp-a4-doc-info-left .erp-a4-info-row { justify-content: flex-start; }
.erp-a4-doc-info-right .erp-a4-info-row { justify-content: flex-end; text-align: right; }
.erp-a4-doc-info label {
    display: inline; font-size: 11px; font-weight: 600; color: #64748b;
    text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap;
}
.erp-a4-doc-info label::after { content: ":"; margin: 0 4px 0 1px; }
.erp-a4-doc-info .erp-a4-value { display: inline; font-size: 12px; font-weight: 600; color: #1e293b; }
.erp-a4-doc-info .erp-a4-value-muted {
    display: block; flex-basis: 100%; width: 100%;
    font-size: 11px; font-weight: 400; color: #475569; line-height: 1.4;
}
.erp-a4-body { width: 100%; flex: 1 1 auto; }
.erp-a4-items-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 0 0 10px; }
.erp-a4-items-table col.erp-a4-col-sn { width: 4%; }
.erp-a4-items-table col.erp-a4-col-item { width: 58%; }
.erp-a4-items-table col.erp-a4-col-qty { width: 8%; }
.erp-a4-items-table col.erp-a4-col-rate { width: 12%; }
.erp-a4-items-table col.erp-a4-col-amt { width: 18%; }
.erp-a4-items-table thead th {
    background: #1e293b; color: #fff; padding: 8px 7px; font-size: 12px; font-weight: 600;
    border: none; border-bottom: 1px solid #334155; text-align: left;
}
.erp-a4-items-table thead th.num { text-align: right; }
.erp-a4-items-table thead th.al-center { text-align: center; }
.erp-a4-items-table tbody td {
    padding: 7px 6px; font-size: 12px; color: #334155;
    border: none; border-bottom: 1px solid #e2e8f0; vertical-align: top;
}
.erp-a4-items-table tbody tr:nth-child(even) td { background: #f8fafc; }
.erp-a4-items-table tbody td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.erp-a4-totals { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.erp-a4-totals table { width: 240px; border-collapse: collapse; }
.erp-a4-totals td { padding: 5px 8px; font-size: 11px; border-bottom: 1px solid #e2e8f0; }
.erp-a4-totals td:first-child { color: #64748b; text-align: left; }
.erp-a4-totals td:last-child {
    text-align: right; font-weight: 600; font-variant-numeric: tabular-nums;
    white-space: nowrap; unicode-bidi: isolate;
}
.erp-a4-value.erp-a4-balance-highlight { white-space: nowrap; unicode-bidi: isolate; }
.erp-a4-notes p, .erp-a4-terms p { margin: 0; white-space: pre-wrap; }
.erp-a4-totals tr.erp-a4-grand td {
    background: #f1f5f9; font-weight: 700; font-size: 13px; color: #1e293b;
    border-top: 2px solid #1e293b; border-bottom: 2px solid #1e293b; padding: 8px;
}
.erp-a4-footer { margin-top: auto; padding-top: 8px; }
.erp-a4-words { padding: 8px 10px; margin-bottom: 8px; background: #f8fafc; border: 1px solid #e2e8f0; font-size: 11px; color: #334155; }
.erp-a4-notes, .erp-a4-terms { margin-bottom: 8px; font-size: 11px; color: #475569; line-height: 1.45; }
.erp-a4-notes h5, .erp-a4-terms h5 { margin: 0 0 3px; font-size: 11px; font-weight: 700; color: #1e293b; text-transform: uppercase; }
.erp-a4-signature { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 18px; padding-top: 8px; border-top: 1px solid #e2e8f0; }
.erp-a4-signature-left { font-size: 11px; font-weight: 600; color: #1e293b; }
.erp-a4-signature-right { text-align: right; }
.erp-a4-signature-right img { max-height: 44px; margin-bottom: 4px; display: block; margin-left: auto; }
.erp-a4-signature-line { width: 150px; border-top: 1px solid #1e293b; margin: 28px 0 4px auto; }
.erp-a4-signature-right p { margin: 0; font-size: 11px; color: #64748b; }

.quotation-subject-row {
    display: flex; gap: 8px; align-items: baseline; margin: 0 0 12px;
    padding: 8px 10px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 4px;
}
.quotation-subject-label { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; white-space: nowrap; }
.quotation-subject-value { font-size: 12px; font-weight: 600; color: #1e293b; }

.template-invox { font-family: Arial, Helvetica, 'Segoe UI', sans-serif; font-size: 13px; line-height: 1.45; color: #222; background: #fff; }
.invox-main { width: 100%; flex: 1 1 auto; display: flex; flex-direction: column; }
.invox-body { flex: 1 1 auto; }
.invox-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.invox-header-left { flex: 1; min-width: 0; max-width: 58%; }
.invox-logo { width: 200px; height: auto; max-height: 115px; object-fit: contain; display: block; }
.invox-logo-placeholder { width: 200px; height: 115px; border: 1px solid #ddd; display: flex; align-items: center; justify-content: center; color: #999; font-size: 11px; }
.invox-company-name { margin: 0; font-size: 14px; font-weight: 800; text-transform: uppercase; color: #111; }
.invox-title-block { text-align: right; min-width: 240px; flex-shrink: 0; }
.invox-title { margin: 0; font-size: 42px; font-weight: 300; color: #5ab7e5; letter-spacing: 1px; line-height: 1; text-transform: uppercase; }
.invox-quote-no { margin: 14px 0 0; font-size: 14px; font-weight: 700; color: #111; }
.invox-meta { display: flex; justify-content: space-between; gap: 40px; margin: 0 0 28px; align-items: flex-start; }
.invox-meta-left { flex: 1.2; }
.invox-meta-right { flex: 0.8; text-align: right; }
.invox-meta-label { color: #555; font-size: 13px; font-weight: 400; }
.invox-meta-value { font-weight: 700; color: #111; font-size: 13px; }
.invox-meta-right .invox-meta-row { display: flex; justify-content: flex-end; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.invox-table { width: 100%; border-collapse: collapse; margin-bottom: 0; table-layout: fixed; }
.invox-table thead th { background: #3482b4 !important; color: #fff !important; padding: 11px 10px; font-size: 13px; font-weight: 600; border: none; text-align: left; }
.invox-table thead th.num { text-align: right; }
.invox-table tbody td { padding: 11px 10px; border: none; border-bottom: 1px solid #d5dee6; vertical-align: top; font-size: 12px; color: #333; }
.invox-table tbody td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.invox-table tfoot td { padding: 11px 10px; border: none; border-bottom: 1px solid #d5dee6; font-size: 13px; background: #fff; }
.invox-table tfoot tr.invox-subtotal td { font-weight: 700; border-top: 1px solid #d5dee6; }
.invox-table tfoot tr.invox-grand td.invox-grand-bar { background: #eaf2f8 !important; font-weight: 700; font-size: 14px; }
.invox-grand-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.invox-logo-block { margin-bottom: 14px; }
.invox-location-info { margin-top: 0; }
.invox-company-sub { margin: 4px 0 0; font-size: 12px; color: #555; line-height: 1.55; font-weight: 400; text-transform: none; max-width: 420px; }
.invox-doc-no { margin: 14px 0 0; font-size: 14px; font-weight: 700; color: #111; }
.invox-balance-label { margin-top: 12px; font-size: 13px; color: #555; font-weight: 400; }
.invox-balance-amount { margin-top: 2px; font-size: 22px; font-weight: 700; color: #111; }
.invox-bill-label { font-size: 13px; color: #888; margin-bottom: 4px; }
.invox-bill-name { font-size: 13px; font-weight: 700; color: #111; margin-bottom: 0; }
.invox-customer-detail { font-size: 13px; color: #333; margin-top: 4px; font-weight: 400; line-height: 1.5; }
.invox-table thead th:first-child { text-align: center; }
.invox-table tbody td:first-child { text-align: center; }
.invox-bottom-wrap { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-top: 0; }
.invox-items-total { font-size: 13px; color: #555; padding-bottom: 10px; flex-shrink: 0; }
.invox-totals-wrap { display: flex; justify-content: flex-end; flex: 1; }
.invox-totals { width: 320px; margin-left: auto; }
.invox-totals table { width: 100%; border-collapse: collapse; }
.invox-totals td { padding: 9px 10px; font-size: 13px; border: none; border-bottom: 1px solid #e8edf2; font-variant-numeric: tabular-nums; }
.invox-totals td:first-child { color: #555; text-align: left; }
.invox-totals td.num { text-align: right; white-space: nowrap; }
.invox-totals tr.invox-total-row td,
.invox-totals tr.invox-grand-row td { font-weight: 700; font-size: 14px; color: #111; border-bottom: 1px solid #d5dee6; }
.invox-totals tr.invox-payment td:last-child { color: #c0392b; font-weight: 700; }
.invox-totals tr.invox-payment td:first-child { font-weight: 600; color: #333; }
.invox-totals tr.invox-balance-due td { background: #eaf2f8 !important; font-weight: 700; font-size: 14px; color: #111; border-bottom: none; padding: 14px 10px; }
.invox-words { margin-top: 18px; font-size: 13px; color: #555; }
.invox-words em { font-style: italic; color: #444; }
.invox-footer-company { font-weight: 700; color: #444; font-size: 13px; text-transform: uppercase; margin-bottom: 4px; }
.invox-footer-line { margin: 0; }
.invox-footer-line + .invox-footer-line { margin-top: 4px; }
.invox-section { margin-top: 30px; }
.invox-section h5 { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: #555; }
.invox-section ul { margin: 0; padding-left: 0; list-style: none; }
.invox-section li { margin-bottom: 5px; color: #444; font-size: 14px; }
.invox-section li::before { content: "- "; }
.invox-footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid #bdbdbd; text-align: center; font-size: 13px; color: #777; line-height: 1.65; }

@media print {
    body.voucher-print-mode .invoice-paper.template-erp-a4,
    body.voucher-print-mode .invoice-paper.template-invox,
    body.voucher-print-mode .template-erp-a4,
    body.voucher-print-mode .template-invox,
    body.invoice-details-print .invoice-paper.template-erp-a4,
    body.invoice-details-print .invoice-paper.template-invox,
    body.invoice-details-print .template-erp-a4,
    body.invoice-details-print .template-invox {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    /* Keep content inset (do not zero padding — sales-a4-print.css sets final values) */
    body.voucher-print-mode .template-erp-a4,
    body.voucher-print-mode .template-invox,
    body.invoice-details-print .template-erp-a4,
    body.invoice-details-print .template-invox {
        padding: 0.45in 0.4in !important;
    }

    body.voucher-print-mode .invoice-paper.template-erp-a4,
    body.voucher-print-mode .invoice-paper.template-invox,
    body.invoice-details-print .invoice-paper.template-erp-a4,
    body.invoice-details-print .invoice-paper.template-invox {
        padding: 0 !important;
    }

    body.voucher-print-mode .erp-a4-footer,
    body.invoice-details-print .erp-a4-footer,
    body.voucher-print-mode .invox-footer,
    body.invoice-details-print .invox-footer {
        margin-top: 16px !important;
    }

    body.voucher-print-mode .erp-a4-body,
    body.invoice-details-print .erp-a4-body,
    body.voucher-print-mode .invox-main,
    body.invoice-details-print .invox-main,
    body.voucher-print-mode .invox-body,
    body.invoice-details-print .invox-body {
        display: block !important;
        flex: none !important;
        min-height: 0 !important;
    }
}
