<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>{{ $quotationTitle ?? 'Quotation' }} {{ $quotation->quote_number }}</title>
    <style>
        @page { margin: 12mm 14mm; }
        * { box-sizing: border-box; }
        body {
            font-family: DejaVu Sans, sans-serif;
            font-size: 11pt;
            color: #111827;
            margin: 0;
            padding: 0;
            line-height: 1.4;
            -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
        }
        .billing-invoice-doc { width: 100%; position: relative; color: #111827; }
        .billing-invoice-doc__layout-table { width: 100%; border-collapse: collapse; }
        .billing-invoice-doc__layout-table td { vertical-align: top; padding: 0; }
        .billing-invoice-doc--pdf .billing-invoice-doc__header {
            margin-bottom: 14px;
            padding-bottom: 10px;
            border-bottom: 1px solid #e2e8f0;
        }
        .billing-invoice-doc--pdf .billing-invoice-doc__logo {
            max-width: 120px;
            max-height: 84px;
            width: 120px;
            height: auto;
            margin-bottom: 6px;
            display: block;
        }
        .billing-invoice-doc__company-name {
            font-size: 14pt;
            font-weight: bold;
            color: #0f172a;
            margin: 0 0 3px;
            line-height: 1.2;
        }
        .billing-invoice-doc__meta {
            font-size: 9.5pt;
            color: #374151;
            margin: 0;
            padding: 0;
            line-height: 1.15;
        }
        .billing-invoice-doc__company .billing-invoice-doc__meta {
            line-height: 1.15;
        }
        .billing-invoice-doc__title-block { text-align: right; }
        .billing-invoice-doc__doc-title {
            font-size: 13pt;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #0f172a;
            margin: 0 0 2px;
            text-align: right;
        }
        .billing-invoice-doc__doc-number {
            font-size: 10.5pt;
            font-weight: bold;
            text-align: right;
            margin: 0 0 2px;
            color: #111827;
        }
        .billing-invoice-doc__copy-label {
            font-size: 8.5pt;
            color: #475569;
            text-align: right;
            margin: 0 0 6px;
        }
        .billing-invoice-doc__amount-due {
            background: #3577f1;
            color: #fff;
            font-weight: bold;
            font-size: 9pt;
            padding: 5px 10px;
            border-radius: 4px;
            text-align: center;
            display: inline-block;
            margin-bottom: 6px;
        }
        .billing-invoice-doc__dates {
            width: auto;
            margin-left: auto;
            font-size: 9.5pt;
            border-collapse: separate;
            border-spacing: 14px 2px;
        }
        .billing-invoice-doc__dates td {
            padding: 0;
            vertical-align: baseline;
        }
        .billing-invoice-doc__dates-label {
            color: #374151;
            font-weight: 600;
            text-align: right;
            white-space: nowrap;
            width: 1%;
        }
        .billing-invoice-doc__dates-gap {
            width: 18px;
            min-width: 18px;
            padding: 0;
            font-size: 1pt;
            line-height: 1pt;
        }
        .billing-invoice-doc__dates-value {
            font-weight: 600;
            text-align: right;
            white-space: nowrap;
            color: #111827;
        }
        .billing-invoice-doc__addresses { margin-bottom: 14px; line-height: 1.15; }
        .billing-invoice-doc__addresses td { padding-right: 12px; }
        .billing-invoice-doc__section-label {
            font-size: 8.5pt;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #1e293b;
            margin: 0 0 4px;
        }
        .billing-invoice-doc__party-name {
            font-weight: bold;
            font-size: 10.5pt;
            color: #0f172a;
            margin: 0 0 2px;
            line-height: 1.2;
        }
        .billing-invoice-doc__addresses p {
            color: #111827;
            font-size: 9.5pt;
            margin: 0;
            padding: 0;
            line-height: 1.15;
        }
        .billing-invoice-doc__addresses .billing-invoice-doc__meta {
            line-height: 1.15;
            margin: 0;
        }
        .billing-invoice-doc__items {
            width: 100%;
            border-collapse: collapse;
            margin: 12px 0;
            font-size: 9.5pt;
        }
        .billing-invoice-doc__items th {
            background: #334155;
            color: #ffffff;
            font-size: 8pt;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            padding: 7px 5px;
            border: 1px solid #1e293b;
            border-bottom: 2px solid #0f172a;
        }
        .billing-invoice-doc__items td {
            padding: 6px 5px;
            border: 1px solid #cbd5e1;
            vertical-align: top;
            color: #111827;
        }
        .billing-invoice-doc__items .col-no { width: 28px; text-align: center; }
        .billing-invoice-doc__items td.num { text-align: center; font-weight: 500; }
        .billing-invoice-doc__items td.num.amount { text-align: right; font-weight: bold; }
        .billing-invoice-doc__items .item-name { font-weight: bold; display: block; color: #0f172a; font-size: 9.5pt; }
        .billing-invoice-doc__items .item-desc { font-size: 8.5pt; color: #374151; display: block; }
        .billing-invoice-doc__items .tax-pct { font-size: 7.5pt; color: #475569; display: block; font-weight: 500; }
        .billing-invoice-doc__bottom { margin-top: 8px; }
        .billing-invoice-doc__bottom td { padding-right: 10px; }
        .billing-invoice-doc__bank {
            background: #f8fafc;
            border: 1px solid #cbd5e1;
            padding: 8px 10px;
            margin-bottom: 10px;
            font-size: 9pt;
            color: #111827;
        }
        .billing-invoice-doc__bank-title,
        .billing-invoice-doc__terms-title {
            font-size: 8.5pt;
            font-weight: bold;
            text-transform: uppercase;
            color: #1e293b;
            margin: 0 0 4px;
        }
        .billing-invoice-doc__bank p,
        .billing-invoice-doc__terms p { margin: 0 0 2px; font-size: 9pt; color: #111827; }
        .billing-invoice-doc__bank--side { margin-top: 0; margin-bottom: 10px; }
        .billing-invoice-doc__bank-table { width: 100%; max-width: 320px; font-size: 9pt; border-collapse: collapse; }
        .billing-invoice-doc__bank-table td { padding: 2px 0; border: 0; vertical-align: top; }
        .billing-invoice-doc__bank-label { font-weight: bold; color: #334155; padding-right: 6px; white-space: nowrap; }
        .billing-invoice-doc__items .col-qty-uom { width: 64px; text-align: center; }
        .billing-invoice-doc__totals { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
        .billing-invoice-doc__totals td {
            padding: 4px 5px;
            border-bottom: 1px solid #e2e8f0;
            color: #111827;
        }
        .billing-invoice-doc__totals td:first-child { font-weight: 600; color: #1e293b; }
        .billing-invoice-doc__totals td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
        .billing-invoice-doc__totals .text-minus { color: #dc3545; }
        .billing-invoice-doc__totals .total-row td {
            background: #e8faf6;
            color: #0f172a;
            font-weight: bold;
            font-size: 10.5pt;
            border-top: 2px solid #0ab39c;
            border-bottom: none;
        }
        .billing-invoice-doc__totals .due-row td {
            font-weight: bold;
            color: #1d4ed8;
        }
        .billing-invoice-doc__words {
            font-size: 9pt;
            color: #374151;
            margin: 8px 0 12px;
            line-height: 1.4;
        }
        .billing-invoice-doc__words strong { color: #111827; }
        .billing-invoice-doc__signatures { margin-top: 10px; }
        .billing-invoice-doc__signature { text-align: center; padding-left: 12px; }
        .billing-invoice-doc__signature-img { width: 180px; height: 118px; display: block; margin: 0 auto 4px; }
        .billing-invoice-doc__signature-line { border-top: 1px solid #94a3b8; width: 160px; margin: 28px auto 4px; }
        .billing-invoice-doc__signature p { font-size: 8.5pt; color: #374151; margin: 0; font-weight: 500; }
    </style>
</head>
<body>
@include('admin.quotations.partials._document', [
    'layout' => 'a4',
    'forPdf' => true,
    'documentCopyLabel' => $documentCopyLabel ?? 'Original Copy',
    'logoPath' => $logoPath ?? null,
    'signaturePath' => $signaturePath ?? null,
    'quotationTitle' => $quotationTitle ?? null,
])
</body>
</html>
