<div class="row justify-content-center"><div class="col-lg-8"><div class="card"><div class="card-header"><h5 class="mb-0">New Team</h5></div><div class="card-body">
<form method="POST" action="/sports/teams" data-ajax="true"><?=csrf_field()?>
<div class="row g-3">
<div class="col-md-4"><label class="form-label">Code <span class="text-danger">*</span></label><input type="text" name="team_code" class="form-control" required><div class="invalid-feedback" data-field="team_code"></div></div>
<div class="col-md-4"><label class="form-label">Sport <span class="text-danger">*</span></label><select name="sport_id" class="form-select" required><option value="">--</option><?php foreach($sports as $s):?><option value="<?=$s['id']?>"><?=e($s['name_en'])?></option><?php endforeach;?></select></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?>"><?=ucfirst($t)?></option><?php endforeach;?></select></div>
<div class="col-md-6"><label class="form-label">Name (EN) <span class="text-danger">*</span></label><input type="text" name="name_en" class="form-control" required></div>
<div class="col-md-6"><label class="form-label">Name (AR) <span class="text-danger">*</span></label><input type="text" name="name_ar" class="form-control" dir="rtl" required></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']?>"><?=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"></div>
<div class="col-md-2"><label class="form-label">Primary Color</label><input type="color" name="color_primary" class="form-control form-control-color"></div>
<div class="col-md-2"><label class="form-label">Secondary</label><input type="color" name="color_secondary" class="form-control form-control-color"></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" class="btn btn-secondary">Cancel</a></div>
</form></div></div></div></div>