<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Invoice — <?php echo e($invoice->invoice_number); ?></title>
    <style>
        body { font-family: DejaVu Sans, sans-serif; font-size: 11px; color: #111; margin: 24px; }
        .header { text-align: center; border-bottom: 3px solid #1e3a5f; padding-bottom: 12px; margin-bottom: 20px; }
        .header h1 { font-size: 20px; margin: 0; color: #1e3a5f; }
        .header p { margin: 4px 0 0; color: #555; }
        .meta { margin-bottom: 16px; }
        .meta-row { margin-bottom: 4px; }
        table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
        th, td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; }
        th { background: #1e3a5f; color: #fff; }
        .text-right { text-align: right; }
        .totals { margin-top: 12px; }
        .totals td { border: none; padding: 4px 8px; }
    </style>
</head>
<body>
    <div class="header">
        <h1><?php echo e($schoolName); ?></h1>
        <p>Invoice</p>
    </div>

    <div class="meta">
        <div class="meta-row"><strong>Invoice No:</strong> <?php echo e($invoice->invoice_number); ?></div>
        <div class="meta-row"><strong>Student:</strong> <?php echo e($invoice->student?->full_name); ?></div>
        <div class="meta-row"><strong>Issue Date:</strong> <?php echo e(optional($invoice->issue_date)->format('d M Y')); ?></div>
        <div class="meta-row"><strong>Due Date:</strong> <?php echo e(optional($invoice->due_date)->format('d M Y') ?? '—'); ?></div>
        <div class="meta-row"><strong>Status:</strong> <?php echo e(ucfirst($invoice->status)); ?></div>
    </div>

    <table>
        <thead>
            <tr>
                <th>Description</th>
                <th class="text-right">Qty</th>
                <th class="text-right">Unit Price</th>
                <th class="text-right">Total</th>
            </tr>
        </thead>
        <tbody>
            <?php $__currentLoopData = $invoice->lines; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $line): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td><?php echo e($line->description); ?></td>
                    <td class="text-right"><?php echo e($line->quantity); ?></td>
                    <td class="text-right"><?php echo e(number_format($line->unit_price, 2)); ?></td>
                    <td class="text-right"><?php echo e(number_format($line->line_total, 2)); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </tbody>
    </table>

    <table class="totals" style="width: 280px; margin-left: auto;">
        <tr><td class="text-right">Subtotal:</td><td class="text-right"><?php echo e(number_format($invoice->subtotal, 2)); ?></td></tr>
        <tr><td class="text-right">Tax:</td><td class="text-right"><?php echo e(number_format($invoice->tax_amount, 2)); ?></td></tr>
        <tr><td class="text-right"><strong>Total:</strong></td><td class="text-right"><strong><?php echo e(number_format($invoice->total_amount, 2)); ?></strong></td></tr>
        <tr><td class="text-right">Amount Paid:</td><td class="text-right"><?php echo e(number_format($invoice->amount_paid, 2)); ?></td></tr>
        <tr><td class="text-right"><strong>Balance Due:</strong></td><td class="text-right"><strong><?php echo e(number_format($invoice->balance_due, 2)); ?></strong></td></tr>
    </table>

    <?php if($invoice->notes): ?>
        <p style="margin-top: 16px; color: #555;"><strong>Notes:</strong> <?php echo e($invoice->notes); ?></p>
    <?php endif; ?>
</body>
</html>
<?php /**PATH C:\laragon\www\southend\resources\views\exports\invoice.blade.php ENDPATH**/ ?>