<div style="max-width:800px;margin:0 auto;">
    <div class="text-center mb-4">
        <h3><?= e(Config::get('club_name_en', 'The Club')) ?></h3>
        <h5>Member Profile</h5>
        <hr>
    </div>
    <table class="table table-borderless">
        <tr><td><strong>Membership #:</strong></td><td><?= e($member['membership_number']) ?></td><td><strong>Status:</strong></td><td><?= ucfirst($member['status']) ?></td></tr>
        <tr><td><strong>Full Name (EN):</strong></td><td><?= e($member['full_name_en']) ?></td><td><strong>Type:</strong></td><td><?= e($member['type_name_en']) ?></td></tr>
        <tr><td><strong>National ID:</strong></td><td><?= e($member['national_id'] ?? '—') ?></td><td><strong>Gender:</strong></td><td><?= ucfirst($member['gender']) ?></td></tr>
        <tr><td><strong>Phone:</strong></td><td><?= e($member['primary_phone'] ?? '—') ?></td><td><strong>Email:</strong></td><td><?= e($member['primary_email'] ?? '—') ?></td></tr>
        <tr><td><strong>DOB:</strong></td><td><?= format_date($member['date_of_birth']) ?></td><td><strong>Join Date:</strong></td><td><?= format_date($member['join_date']) ?></td></tr>
        <tr><td><strong>Nationality:</strong></td><td><?= e($member['nationality_en'] ?? '—') ?></td><td><strong>City:</strong></td><td><?= e($member['city_en'] ?? '—') ?></td></tr>
    </table>
    <?php if (!empty($dependents)): ?>
    <h6 class="mt-4">Dependents</h6>
    <table class="table table-sm"><thead><tr><th>Name</th><th>Relationship</th><th>Gender</th><th>DOB</th></tr></thead><tbody>
    <?php foreach ($dependents as $d): ?>
    <tr><td><?= e($d['full_name_en']) ?></td><td><?= e($d['rel_type_en']) ?></td><td><?= ucfirst($d['gender']) ?></td><td><?= format_date($d['date_of_birth']) ?></td></tr>
    <?php endforeach; ?>
    </tbody></table>
    <?php endif; ?>
    <div class="text-center mt-5 small text-muted">
        <p>Printed on <?= date('Y-m-d H:i:s') ?> by <?= e(auth_user('full_name_en')) ?></p>
    </div>
</div>