<?php $__env->startSection('body'); ?>

<h2>You have a new invoice 📄</h2>
<p>
    <strong><?php echo e($invoice->user->business_name); ?></strong> has sent you an invoice
    for <strong>₦<?php echo e(number_format($invoice->total, 2)); ?></strong>.
    Please review the details below.
</p>


<div style="background:#f8fafc;border-radius:8px;padding:1.25rem;margin:1.25rem 0;border:1px solid #e2e8f0;">
    <div class="info-grid">
        <div class="info-item">
            <label>Invoice Number</label>
            <div class="value" style="font-family:monospace;"><?php echo e($invoice->invoice_number); ?></div>
        </div>
        <div class="info-item">
            <label>Amount Due</label>
            <div class="value" style="color:#00a651;font-size:1.1rem;">₦<?php echo e(number_format($invoice->total, 2)); ?></div>
        </div>
        <div class="info-item">
            <label>Issue Date</label>
            <div class="value"><?php echo e($invoice->issue_date->format('d/m/Y')); ?></div>
        </div>
        <div class="info-item">
            <label>Due Date</label>
            <div class="value <?php echo e(now()->gt($invoice->due_date) ? 'text-danger' : ''); ?>">
                <?php echo e($invoice->due_date->format('d/m/Y')); ?>

            </div>
        </div>
    </div>
</div>


<table class="invoice-table">
    <thead>
        <tr>
            <th>Description</th>
            <th style="text-align:right;width:60px;">Qty</th>
            <th style="text-align:right;width:110px;">Unit Price</th>
            <th style="text-align:right;width:110px;">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 style="text-align:right;"><?php echo e($item->quantity); ?></td>
            <td style="text-align:right;">₦<?php echo e(number_format($item->unit_price, 2)); ?></td>
            <td style="text-align:right;">₦<?php echo e(number_format($item->total, 2)); ?></td>
        </tr>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <tr>
            <td colspan="3" style="text-align:right;color:#64748b;font-size:0.875rem;">Subtotal</td>
            <td style="text-align:right;font-size:0.875rem;">₦<?php echo e(number_format($invoice->subtotal, 2)); ?></td>
        </tr>
        <tr>
            <td colspan="3" style="text-align:right;color:#64748b;font-size:0.875rem;">VAT (<?php echo e($invoice->vat_rate); ?>%)</td>
            <td style="text-align:right;font-size:0.875rem;">₦<?php echo e(number_format($invoice->vat_amount, 2)); ?></td>
        </tr>
        <?php if($invoice->discount > 0): ?>
        <tr>
            <td colspan="3" style="text-align:right;color:#64748b;font-size:0.875rem;">Discount</td>
            <td style="text-align:right;font-size:0.875rem;color:#dc2626;">-₦<?php echo e(number_format($invoice->discount, 2)); ?></td>
        </tr>
        <?php endif; ?>
        <tr class="total-row">
            <td colspan="3" style="text-align:right;">Total Due</td>
            <td style="text-align:right;">₦<?php echo e(number_format($invoice->total, 2)); ?></td>
        </tr>
    </tbody>
</table>

<?php if($invoice->notes): ?>
<div style="background:#f8fafc;border-radius:6px;padding:0.85rem;font-size:0.875rem;color:#64748b;margin-bottom:1rem;">
    <strong style="color:#374151;">Note:</strong> <?php echo e($invoice->notes); ?>

</div>
<?php endif; ?>


<div style="text-align:center;padding:0.5rem 0;">
    <a href="<?php echo e($invoice->public_url); ?>" class="btn-pay">
        💳 &nbsp; Pay ₦<?php echo e(number_format($invoice->total, 2)); ?> Now
    </a>
    <p style="font-size:0.78rem;color:#94a3b8;margin-top:0.5rem;">
        Or copy this link: <a href="<?php echo e($invoice->public_url); ?>" style="color:#00a651;"><?php echo e($invoice->public_url); ?></a>
    </p>
</div>


<?php if($invoice->user->bank_name): ?>
<div class="alert-box alert-success" style="margin-top:1rem;">
    <strong style="color:#15803d;">💰 Bank Transfer Option</strong><br>
    <span style="font-size:0.875rem;color:#166534;">
        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>
    </span>
</div>
<?php endif; ?>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('emails.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\Bunmi\Desktop\crud\resources\views/emails/invoice_sent.blade.php ENDPATH**/ ?>