<div class="row justify-content-center"><div class="col-lg-8"><div class="card"><div class="card-header"><h5 class="mb-0">Edit Team</h5></div><div class="card-body">
<form method="POST" action="/sports/teams/<?=$team['id']?>" data-ajax="true"><?=csrf_field()?>
<div class="row g-3">
<div class="col-md-6"><label class="form-label">Name (EN)</label><input type="text" name="name_en" class="form-control" value="<?=e($team['name_en'])?>" required></div>
<div class="col-md-6"><label class="form-label">Name (AR)</label><input type="text" name="name_ar" class="form-control" dir="rtl" value="<?=e($team['name_ar'])?>" required></div>
<div class="col-md-4"><label class="form-label">Type</label><select name="team_type" class="form-select"><?php foreach(['club','amateur','youth','senior','women','mixed'] as $t):?><option value="<?=$t?>" <?=selected($t,$team['team_type'])?>><?=ucfirst($t)?></option><?php endforeach;?></select></div>
<div class="col-md-4"><label class="form-label">Coach</label><select name="coach_id" class="form-select"><option value="">--</option><?php foreach($coaches as $c):?><option value="<?=$c['id']?>" <?=selected($c['id'],$team['coach_id'])?>><?=e($c['name'])?></option><?php endforeach;?></select></div>
<div class="col-md-4"><label class="form-label">Max Players</label><input type="number" name="max_players" class="form-control" value="<?=$team['max_players']?>"></div>
<div class="col-md-4"><label class="form-label">Status</label><select name="status" class="form-select"><?php foreach(['active','inactive','disbanded','suspended'] as $st):?><option value="<?=$st?>" <?=selected($st,$team['status'])?>><?=ucfirst($st)?></option><?php endforeach;?></select></div>
</div><div class="mt-4 d-flex gap-2"><button type="submit" class="btn btn-primary"><i class="fas fa-save me-1"></i>Save</button><a href="/sports/teams/<?=$team['id']?>" class="btn btn-secondary">Cancel</a></div>
</form></div></div></div></div>