<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <style>
        body { font-family: DejaVu Sans, sans-serif; font-size: 12px; color: #1e293b; }
        .header { text-align: center; border-bottom: 3px solid #1a7f5a; padding-bottom: 16px; margin-bottom: 20px; }
        .header h1 { font-size: 20px; color: #1a7f5a; margin: 0; }
        .receipt-no { background: #1a7f5a; color: #fff; padding: 8px 16px; border-radius: 6px; display: inline-block; font-size: 16px; font-weight: bold; margin: 12px 0; }
        table { width: 100%; border-collapse: collapse; }
        td { padding: 10px 0; border-bottom: 1px solid #e2e8f0; }
        td:first-child { color: #64748b; font-size: 11px; text-transform: uppercase; font-weight: bold; }
        .amount { font-size: 28px; font-weight: bold; color: #1a7f5a; text-align: center; padding: 20px; }
        .footer { text-align: center; margin-top: 30px; color: #64748b; font-size: 11px; }
    </style>
</head>
<body>
<div class="header">
    <h1><?php echo e($payment->invoice->student->school->name ?? 'EduSmart High School'); ?></h1>
    <p>OFFICIAL PAYMENT RECEIPT</p>
    <div class="receipt-no"><?php echo e($payment->receipt_no); ?></div>
</div>

<table>
    <tr><td>Student Name</td><td><?php echo e($payment->invoice->student->user->name); ?></td></tr>
    <tr><td>Admission No</td><td><?php echo e($payment->invoice->student->admission_no); ?></td></tr>
    <tr><td>Term</td><td><?php echo e($payment->invoice->term->name); ?></td></tr>
    <tr><td>Payment Date</td><td><?php echo e($payment->payment_date->format('d F Y')); ?></td></tr>
    <tr><td>Payment Method</td><td><?php echo e(strtoupper($payment->method)); ?></td></tr>
    <?php if($payment->transaction_ref): ?>
    <tr><td>Transaction Ref</td><td><?php echo e($payment->transaction_ref); ?></td></tr>
    <?php endif; ?>
    <tr><td>Received By</td><td><?php echo e($payment->receivedBy?->name ?? 'System'); ?></td></tr>
    <tr><td>Invoice Total</td><td>KES <?php echo e(number_format($payment->invoice->total_amount, 2)); ?></td></tr>
    <tr><td>Total Paid</td><td>KES <?php echo e(number_format($payment->invoice->amount_paid, 2)); ?></td></tr>
    <tr><td>Balance</td><td>KES <?php echo e(number_format($payment->invoice->balance, 2)); ?></td></tr>
</table>

<div class="amount">KES <?php echo e(number_format($payment->amount, 2)); ?></div>

<div class="footer">
    <p>Generated on <?php echo e(now()->format('d F Y, H:i')); ?> &mdash; EduSmart School Management System</p>
    <p>This is a computer-generated receipt. Keep for your records.</p>
</div>
</body>
</html>
<?php /**PATH C:\xampp\htdocs\cbe\resources\views\pdf\receipt.blade.php ENDPATH**/ ?>