@php($club = $club ?? null)
<div style="display:grid; grid-template-columns: repeat(2, 1fr); gap:16px;">
    <div class="form-group"><label class="form-label" for="name">Club Name</label><input class="input" id="name" name="name" value="{{ old('name', $club?->name) }}" required></div>
    <div class="form-group"><label class="form-label" for="code">Code</label><input class="input" id="code" name="code" value="{{ old('code', $club?->code) }}" required></div>
    <div class="form-group"><label class="form-label" for="category">Category</label>
        <select class="input" id="category" name="category"><option value="">—</option>@foreach($categories as $cat)<option value="{{ $cat }}" @selected(old('category', $club?->category) === $cat)>{{ ucfirst($cat) }}</option>@endforeach</select>
    </div>
    <div class="form-group"><label class="form-label" for="patron_id">Patron (Staff)</label>
        <select class="input" id="patron_id" name="patron_id"><option value="">—</option>@foreach($staffMembers as $m)<option value="{{ $m->id }}" @selected(old('patron_id', $club?->patron_id) == $m->id)>{{ $m->full_name }}</option>@endforeach</select>
    </div>
    <div class="form-group"><label class="form-label" for="academic_year_id">Academic Year</label>
        <select class="input" id="academic_year_id" name="academic_year_id"><option value="">—</option>@foreach($academicYears as $y)<option value="{{ $y->id }}" @selected(old('academic_year_id', $club?->academic_year_id) == $y->id)>{{ $y->name }}</option>@endforeach</select>
    </div>
    <div class="form-group"><label class="form-label" for="max_members">Max Members</label><input class="input" type="number" id="max_members" name="max_members" value="{{ old('max_members', $club?->max_members) }}"></div>
    <div class="form-group"><label class="form-label" for="status">Status</label>
        <select class="input" id="status" name="status">@foreach(['active','inactive'] as $s)<option value="{{ $s }}" @selected(old('status', $club?->status ?? 'active') === $s)>{{ ucfirst($s) }}</option>@endforeach</select>
    </div>
    <div class="form-group" style="display:flex;align-items:center;gap:8px;padding-top:28px;">
        <input type="checkbox" id="discussion_enabled" name="discussion_enabled" value="1" @checked(old('discussion_enabled', $club?->discussion_enabled ?? true))>
        <label for="discussion_enabled">Enable group discussions</label>
    </div>
    <div class="form-group" style="grid-column:1/-1;"><label class="form-label" for="description">Description</label><textarea class="input" id="description" name="description" rows="3">{{ old('description', $club?->description) }}</textarea></div>
</div>
