<div class="d-flex justify-content-between align-items-center mb-3"><h4 class="mb-0"><i class="fas fa-user-tie me-2"></i><?=e($coach['first_name_en'].' '.$coach['last_name_en'])?></h4>
<div><?php if(auth_can('sports.manage')):?><a href="/sports/coaches/<?=$coach['id']?>/edit" class="btn btn-warning btn-sm"><i class="fas fa-edit me-1"></i>Edit</a><?php endif;?> <a href="/sports/coaches" class="btn btn-secondary btn-sm">Back</a></div></div>
<div class="row g-3">
<div class="col-md-4"><div class="card"><div class="card-body text-center">
<?php if($coach['photo_path']):?><img src="/<?=e($coach['photo_path'])?>" class="rounded-circle mb-3" style="width:120px;height:120px;object-fit:cover"><?php else:?><i class="fas fa-user-circle fa-5x text-muted mb-3"></i><?php endif;?>
<h5><?=e($coach['first_name_en'].' '.$coach['last_name_en'])?></h5>
<p class="text-muted"><?=e($coach['first_name_ar']??'')?> <?=e($coach['last_name_ar']??'')?></p>
<?=status_badge($coach['status'])?>
<table class="table table-sm text-start mt-3"><tr><th>Code</th><td><?=e($coach['coach_code'])?></td></tr><tr><th>Phone</th><td><?=e($coach['phone']??'')?></td></tr><tr><th>Email</th><td><?=e($coach['email']??'')?></td></tr><tr><th>Experience</th><td><?=$coach['experience_years']??'N/A'?> years</td></tr><tr><th>Hourly Rate</th><td><?=$coach['hourly_rate']?format_money($coach['hourly_rate']):'N/A'?></td></tr></table>
</div></div></div>
<div class="col-md-8">
<ul class="nav nav-tabs"><li class="nav-item"><a class="nav-link active" data-bs-toggle="tab" href="#tab-classes">Classes (<?=count($classes)?>)</a></li><li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#tab-certs">Certifications (<?=count($certifications)?>)</a></li></ul>
<div class="tab-content border border-top-0 p-3">
<div class="tab-pane fade show active" id="tab-classes">
<?php if(empty($classes)):?><p class="text-muted">No classes assigned</p><?php else:?>
<table class="table table-sm"><thead><tr><th>Code</th><th>Name</th><th>Sport</th><th>Status</th></tr></thead><tbody>
<?php foreach($classes as $cl):?><tr><td><?=e($cl['class_code'])?></td><td><a href="/sports/classes/<?=$cl['id']?>"><?=e($cl['name_en'])?></a></td><td><?=e($cl['sport_name']??'')?></td><td><?=status_badge($cl['status'])?></td></tr><?php endforeach;?>
</tbody></table><?php endif;?>
</div>
<div class="tab-pane fade" id="tab-certs">
<?php if(empty($certifications)):?><p class="text-muted">No certifications</p><?php else:?>
<table class="table table-sm"><thead><tr><th>Certification</th><th>Issuing Body</th><th>Date</th><th>Expiry</th><th>Verified</th></tr></thead><tbody>
<?php foreach($certifications as $cert):?><tr><td><?=e($cert['certification_name'])?></td><td><?=e($cert['issuing_body']??'')?></td><td><?=format_date($cert['issue_date'])?></td><td><?=format_date($cert['expiry_date'])?></td><td><?=$cert['is_verified']?'<i class="fas fa-check text-success"></i>':'<i class="fas fa-times text-muted"></i>'?></td></tr><?php endforeach;?>
</tbody></table><?php endif;?>
</div></div></div></div>