<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
    * { margin:0; padding:0; box-sizing:border-box; }
    body { font-family: DejaVu Sans, sans-serif; font-size:11.5px; color:#374151; background:white; }
    .page { padding:38px 42px; }

    /* Top accent bar */
    .accent { height:4px; background:#00a651; border-radius:2px; margin-bottom:28px; }

    /* Header */
    .header { display:table; width:100%; margin-bottom:24px; }
    .header-left  { display:table-cell; width:58%; vertical-align:top; }
    .header-right { display:table-cell; width:42%; vertical-align:top; text-align:right; }

    .biz-name { font-size:17px; font-weight:700; color:#1e293b; margin-bottom:3px; }
    .biz-info  { font-size:10px; color:#64748b; line-height:1.65; }

    .inv-label  { font-size:9px; text-transform:uppercase; letter-spacing:2px; color:#94a3b8; margin-bottom:3px; }
    .inv-number { font-size:21px; font-weight:700; color:#1e293b; font-family:monospace; }

    /* Status */
    .status { display:inline-block; padding:3px 10px; border-radius:20px; font-size:8.5px; font-weight:700; text-transform:uppercase; letter-spacing:1px; margin-top:4px; }
    .status-paid      { background:#dcfce7; color:#15803d; }
    .status-sent      { background:#dbeafe; color:#1d4ed8; }
    .status-overdue   { background:#fee2e2; color:#b91c1c; }
    .status-draft     { background:#e2e8f0; color:#475569; }
    .status-viewed    { background:#ede9fe; color:#6d28d9; }
    .status-cancelled { background:#f1f5f9; color:#334155; }

    /* Divider */
    hr { border:none; border-top:1px solid #e2e8f0; margin:18px 0; }

    /* Bill To + Dates */
    .meta { display:table; width:100%; margin-bottom:22px; }
    .meta-left  { display:table-cell; width:55%; vertical-align:top; }
    .meta-right { display:table-cell; width:45%; vertical-align:top; }

    .sec-label  { font-size:8.5px; text-transform:uppercase; letter-spacing:1.5px; color:#94a3b8; margin-bottom:5px; }
    .client-name { font-size:12.5px; font-weight:700; color:#1e293b; margin-bottom:2px; }
    .client-info { font-size:9.5px; color:#64748b; line-height:1.65; }

    .dates-table { width:100%; }
    .dates-table td { font-size:10.5px; padding:2px 0; }
    .dates-label { color:#64748b; width:75px; }
    .dates-value { font-weight:600; color:#1e293b; }

    /* Items */
    .items { width:100%; border-collapse:collapse; margin-bottom:18px; }
    .items thead th {
        background:#f8fafc;
        padding:7px 10px;
        font-size:8.5px;
        text-transform:uppercase;
        letter-spacing:1px;
        color:#64748b;
        border-bottom:2px solid #e2e8f0;
        text-align:left;
    }
    .items thead th.r { text-align:right; }
    .items tbody td { padding:7.5px 10px; border-bottom:1px solid #f1f5f9; font-size:10.5px; }
    .items tbody td.r { text-align:right; }
    .items tbody tr:last-child td { border-bottom:none; }

    /* Totals */
    .totals { display:table; width:100%; }
    .totals-gap { display:table-cell; width:55%; }
    .totals-box { display:table-cell; width:45%; }
    .t-row { display:table; width:100%; padding:3.5px 0; font-size:10.5px; }
    .t-label { display:table-cell; color:#64748b; }
    .t-value { display:table-cell; text-align:right; }
    .t-grand { border-top:2px solid #e2e8f0; padding-top:7px; margin-top:4px; }
    .t-grand .t-label { font-size:13px; font-weight:700; color:#1e293b; }
    .t-grand .t-value { font-size:14px; font-weight:700; color:#00a651; }

    /* Notes & Bank */
    .notes-box { background:#f8fafc; border-radius:5px; padding:10px 12px; margin-top:18px; font-size:9.5px; color:#64748b; line-height:1.6; }
    .bank-box  { background:#f0fdf4; border:1px solid #bbf7d0; border-radius:5px; padding:10px 12px; margin-top:10px; font-size:9.5px; }
    .bank-title { color:#15803d; font-weight:700; margin-bottom:4px; }
    .bank-info  { color:#166534; }

    /* Footer */
    .doc-footer { margin-top:32px; padding-top:12px; border-top:1px solid #e2e8f0; display:table; width:100%; }
    .doc-footer-left  { display:table-cell; font-size:8.5px; color:#94a3b8; vertical-align:middle; }
    .doc-footer-right { display:table-cell; text-align:right; font-size:8.5px; color:#94a3b8; vertical-align:middle; }
    .doc-footer strong { color:#00a651; }
</style>
</head>
<body>
<div class="page">

    <div class="accent"></div>

    
    <div class="header">
        <div class="header-left">
            <?php if($invoice->user->logo_path): ?>
                <img src="<?php echo e(public_path('storage/' . $invoice->user->logo_path)); ?>"
                     style="max-height:48px;max-width:140px;object-fit:contain;display:block;margin-bottom:7px;">
            <?php endif; ?>
            <div class="biz-name"><?php echo e($invoice->user->business_name); ?></div>
            <div class="biz-info">
                <?php if($invoice->user->address): ?> <?php echo e($invoice->user->address); ?><br> <?php endif; ?>
                <?php if($invoice->user->phone): ?>   <?php echo e($invoice->user->phone); ?><br>   <?php endif; ?>
                <?php if($invoice->user->email): ?>   <?php echo e($invoice->user->email); ?>        <?php endif; ?>
            </div>
        </div>
        <div class="header-right">
            <div class="inv-label">Invoice</div>
            <div class="inv-number"><?php echo e($invoice->invoice_number); ?></div>
            <div>
                <span class="status status-<?php echo e($invoice->status); ?>"><?php echo e(ucfirst($invoice->status)); ?></span>
            </div>
        </div>
    </div>

    <hr>

    
    <div class="meta">
        <div class="meta-left">
            <div class="sec-label">Bill To</div>
            <div class="client-name"><?php echo e($invoice->client->display_name); ?></div>
            <div class="client-info">
                <?php if($invoice->client->email): ?>   <?php echo e($invoice->client->email); ?><br>   <?php endif; ?>
                <?php if($invoice->client->phone): ?>   <?php echo e($invoice->client->phone); ?><br>   <?php endif; ?>
                <?php if($invoice->client->address): ?> <?php echo e($invoice->client->address); ?>      <?php endif; ?>
            </div>
        </div>
        <div class="meta-right">
            <table class="dates-table">
                <tr>
                    <td class="dates-label">Issue Date:</td>
                    <td class="dates-value"><?php echo e($invoice->issue_date->format('d/m/Y')); ?></td>
                </tr>
                <tr>
                    <td class="dates-label">Due Date:</td>
                    <td class="dates-value" style="<?php echo e($invoice->isOverdue() ? 'color:#dc2626;' : ''); ?>">
                        <?php echo e($invoice->due_date->format('d/m/Y')); ?>

                    </td>
                </tr>
                <?php if($invoice->paid_at): ?>
                <tr>
                    <td class="dates-label">Paid On:</td>
                    <td class="dates-value" style="color:#15803d;"><?php echo e($invoice->paid_at->format('d/m/Y')); ?></td>
                </tr>
                <?php endif; ?>
            </table>
        </div>
    </div>

    
    <table class="items">
        <thead>
            <tr>
                <th>Description</th>
                <th class="r" style="width:55px;">Qty</th>
                <th class="r" style="width:95px;">Unit Price</th>
                <th class="r" style="width:95px;">Total</th>
            </tr>
        </thead>
        <tbody>
            <?php $__currentLoopData = $invoice->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <tr>
                <td><?php echo e($item->description); ?></td>
                <td class="r"><?php echo e($item->quantity); ?></td>
                <td class="r">₦<?php echo e(number_format($item->unit_price, 2)); ?></td>
                <td class="r" style="font-weight:500;">₦<?php echo e(number_format($item->total, 2)); ?></td>
            </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody>
    </table>

    
    <div class="totals">
        <div class="totals-gap"></div>
        <div class="totals-box">
            <div class="t-row">
                <div class="t-label">Subtotal</div>
                <div class="t-value">₦<?php echo e(number_format($invoice->subtotal, 2)); ?></div>
            </div>
            <div class="t-row">
                <div class="t-label">VAT (<?php echo e($invoice->vat_rate); ?>%)</div>
                <div class="t-value">₦<?php echo e(number_format($invoice->vat_amount, 2)); ?></div>
            </div>
            <?php if($invoice->discount > 0): ?>
            <div class="t-row">
                <div class="t-label">Discount</div>
                <div class="t-value" style="color:#dc2626;">-₦<?php echo e(number_format($invoice->discount, 2)); ?></div>
            </div>
            <?php endif; ?>
            <div class="t-row t-grand">
                <div class="t-label">Total Due</div>
                <div class="t-value">₦<?php echo e(number_format($invoice->total, 2)); ?></div>
            </div>
        </div>
    </div>

    
    <?php if($invoice->notes): ?>
    <div class="notes-box">
        <strong style="color:#374151;">Notes: </strong><?php echo e($invoice->notes); ?>

    </div>
    <?php endif; ?>

    
    <?php if($invoice->user->bank_name): ?>
    <div class="bank-box">
        <div class="bank-title">Payment Details</div>
        <div class="bank-info">
            Bank: <strong><?php echo e($invoice->user->bank_name); ?></strong> &nbsp;·&nbsp;
            Account: <strong><?php echo e($invoice->user->account_number); ?></strong> &nbsp;·&nbsp;
            Name: <strong><?php echo e($invoice->user->account_name); ?></strong>
        </div>
    </div>
    <?php endif; ?>

    
    <div class="doc-footer">
        <div class="doc-footer-left">
            Generated <?php echo e(now()->format('d/m/Y H:i')); ?> &nbsp;·&nbsp; <?php echo e($invoice->invoice_number); ?>

        </div>
        <div class="doc-footer-right">
            Powered by <strong>OlaInvoice</strong> &nbsp;·&nbsp;
            Built by Adeyemo Olamilekan
        </div>
    </div>

</div>
</body>
</html>
<?php /**PATH C:\Users\Bunmi\Desktop\crud\resources\views/invoices/pdf.blade.php ENDPATH**/ ?>