<div class="container">
    <div class="text-center mb-4">
        <h2><?= e(Config::get('club_name_en', 'The Club')) ?></h2>
        <h4>Membership Application</h4>
        <p>Application #: <strong><?= e($application['application_number']) ?></strong></p>
    </div>

    <table class="table table-bordered">
        <tr><th width="30%">Full Name (EN)</th><td><?= e($application['full_name_en']) ?></td></tr>
        <tr><th>Full Name (AR)</th><td><?= e($application['full_name_ar'] ?? '-') ?></td></tr>
        <tr><th>National ID</th><td><?= e($application['national_id'] ?? '-') ?></td></tr>
        <tr><th>Date of Birth</th><td><?= $application['date_of_birth'] ? format_date($application['date_of_birth']) : '-' ?></td></tr>
        <tr><th>Gender</th><td><?= ucfirst(e($application['gender'])) ?></td></tr>
        <tr><th>Nationality</th><td><?= e($application['nationality_name_en'] ?? '-') ?></td></tr>
        <tr><th>Phone</th><td><?= e($application['primary_phone']) ?></td></tr>
        <tr><th>Email</th><td><?= e($application['email'] ?? '-') ?></td></tr>
        <tr><th>Address</th><td><?= e($application['address_line1'] ?? '-') ?></td></tr>
        <tr><th>Membership Type</th><td><?= e($application['type_name_en'] ?? '-') ?></td></tr>
        <tr><th>Status</th><td><?= ucfirst(str_replace('_', ' ', e($application['status']))) ?></td></tr>
        <tr><th>Submission Date</th><td><?= $application['submission_date'] ? format_date($application['submission_date']) : '-' ?></td></tr>
    </table>

    <?php if (!empty($sponsors)): ?>
    <h5 class="mt-4">Sponsors</h5>
    <table class="table table-bordered">
        <thead><tr><th>#</th><th>Name</th><th>Membership #</th></tr></thead>
        <tbody>
        <?php foreach ($sponsors as $s): ?>
        <tr><td><?= $s['sponsor_order'] ?></td><td><?= e($s['sponsor_name']) ?></td><td><?= e($s['membership_number']) ?></td></tr>
        <?php endforeach; ?>
        </tbody>
    </table>
    <?php endif; ?>

    <div class="row mt-5">
        <div class="col-6 text-center"><p>_________________________</p><p>Applicant Signature</p></div>
        <div class="col-6 text-center"><p>_________________________</p><p>Authorized Signature</p></div>
    </div>
</div>