@csrf
<div class="row g-3">
    <div class="col-md-6"><label class="form-label">Student Name <span class="text-danger">*</span></label>
        <input type="text" name="student_name" value="{{ old('student_name', $admission->student_name) }}" class="form-control @error('student_name') is-invalid @enderror" required>
        @error('student_name')<div class="invalid-feedback">{{ $message }}</div>@enderror</div>
    <div class="col-md-3"><label class="form-label">Gender</label>
        <select name="gender" class="form-select text-capitalize">
            @foreach(['male','female','other'] as $g)<option value="{{ $g }}" @selected(old('gender',$admission->gender)===$g)>{{ ucfirst($g) }}</option>@endforeach
        </select></div>
    <div class="col-md-3"><label class="form-label">Date of Birth</label>
        <input type="date" name="date_of_birth" value="{{ old('date_of_birth', optional($admission->date_of_birth)->format('Y-m-d')) }}" class="form-control"></div>
    <div class="col-md-6"><label class="form-label">Parent Name</label>
        <input type="text" name="parent_name" value="{{ old('parent_name', $admission->parent_name) }}" class="form-control"></div>
    <div class="col-md-3"><label class="form-label">Contact <span class="text-danger">*</span></label>
        <input type="text" name="contact" value="{{ old('contact', $admission->contact) }}" class="form-control @error('contact') is-invalid @enderror" required>
        @error('contact')<div class="invalid-feedback">{{ $message }}</div>@enderror</div>
    <div class="col-md-3"><label class="form-label">Email</label>
        <input type="email" name="email" value="{{ old('email', $admission->email) }}" class="form-control"></div>
    <div class="col-md-4"><label class="form-label">Class Applied</label>
        <select name="class_id" class="form-select">
            <option value="">—</option>
            @foreach($classes as $class)<option value="{{ $class->id }}" @selected(old('class_id',$admission->class_id)==$class->id)>{{ $class->name }}</option>@endforeach
        </select></div>
    <div class="col-md-3"><label class="form-label">Test Date</label>
        <input type="date" name="test_date" value="{{ old('test_date', optional($admission->test_date)->format('Y-m-d')) }}" class="form-control"></div>
    <div class="col-md-2"><label class="form-label">Test Marks</label>
        <input type="number" step="0.01" name="test_marks" value="{{ old('test_marks', $admission->test_marks) }}" class="form-control"></div>
    <div class="col-md-3"><label class="form-label">Test Status</label>
        <select name="test_status" class="form-select text-capitalize">
            @foreach(['pending','passed','failed','not_required'] as $t)<option value="{{ $t }}" @selected(old('test_status',$admission->test_status ?? 'pending')===$t)>{{ str_replace('_',' ',$t) }}</option>@endforeach
        </select></div>
    <div class="col-12"><label class="form-label">Notes</label>
        <textarea name="notes" rows="2" class="form-control">{{ old('notes', $admission->notes) }}</textarea></div>
</div>
<div class="mt-3 d-flex gap-2">
    <button class="btn btn-primary"><i class="bi bi-check-lg me-1"></i>{{ $submitLabel ?? 'Save' }}</button>
    <a href="{{ route('admissions.index') }}" class="btn btn-light border">Cancel</a>
</div>
