<table class="ti-header" width="100%" cellspacing="0" cellpadding="0">
    <tr>
        <!-- LEFT: LOGO + COMPANY NAME -->
        <td class="ti-head-left">
            <div class="ti-head-brand">
                <?php if(!empty($company['logo'])): ?>
                    <img src="../<?= $company['logo'] ?>"class="ti-head-logo" style="max-width:90px; max-height:70px; width:auto; height:auto;">
                <?php endif; ?>
                <span class="ti-head-company">
                    <?= strtoupper($company['company_name']) ?>
                </span>
            </div>
        </td>

        <!-- RIGHT: TAX INVOICE -->
        <td class="ti-head-right ti-tax-title">
            <?= ($inv['status']=='final') ? 'TAX INVOICE' : 'QUOTATION' ?>
        </td>
    </tr>

    <tr>
        <!-- COMPANY ADDRESS -->
        <td class="ti-head-address">
            <?= nl2br(htmlspecialchars($company['address'])) ?><br>
            GSTIN : <?= htmlspecialchars($company['gst_no']) ?><br>
            Ph : <?= htmlspecialchars($company['phone']) ?>
        </td>

        <!-- META -->
        <td class="ti-head-meta">
            <div class="ti-original">ORIGINAL FOR RECIPIENT</div>
            <div><b>Invoice No:</b> <?= $inv['invoice_no'] ?></div>
            <div><b>Date:</b> <?= date('d-m-Y', strtotime($inv['invoice_date'])) ?></div>
            <svg id="barcode" data-invoice="<?= $inv['invoice_no'] ?>"></svg>
        </td>
    </tr>
</table>