<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Receipt — <?php echo e($receipt->receipt_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; }
        .amount { font-size: 18px; font-weight: bold; text-align: center; margin: 20px 0; padding: 12px; background: #f3f4f6; }
        table { width: 100%; border-collapse: collapse; margin-top: 16px; }
        th, td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; }
        th { background: #1e3a5f; color: #fff; }
        .text-right { text-align: right; }
    </style>
</head>
<body>
    <div class="header">
        <h1><?php echo e($schoolName); ?></h1>
        <p>Official Receipt</p>
    </div>

    <div class="meta">
        <div class="meta-row"><strong>Receipt No:</strong> <?php echo e($receipt->receipt_number); ?></div>
        <div class="meta-row"><strong>Student:</strong> <?php echo e($receipt->student?->full_name); ?></div>
        <div class="meta-row"><strong>Payment Date:</strong> <?php echo e(optional($receipt->payment_date)->format('d M Y')); ?></div>
        <div class="meta-row"><strong>Payment Method:</strong> <?php echo e($receipt->payment_method ?? '—'); ?></div>
        <div class="meta-row"><strong>Reference:</strong> <?php echo e($receipt->reference ?? '—'); ?></div>
        <div class="meta-row"><strong>Received By:</strong> <?php echo e($receipt->receivedBy?->name ?? '—'); ?></div>
    </div>

    <div class="amount">Amount Received: <?php echo e(number_format($receipt->amount, 2)); ?></div>

    <?php if($receipt->paymentAllocations->isNotEmpty()): ?>
        <h3 style="font-size: 12px;">Allocated To</h3>
        <table>
            <thead>
                <tr>
                    <th>Invoice</th>
                    <th class="text-right">Amount</th>
                </tr>
            </thead>
            <tbody>
                <?php $__currentLoopData = $receipt->paymentAllocations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $allocation): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($allocation->invoice?->invoice_number ?? '—'); ?></td>
                        <td class="text-right"><?php echo e(number_format($allocation->allocated_amount, 2)); ?></td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    <?php endif; ?>

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