<div class="row g-4"><div class="col-md-8"><label class="form-label fw-semibold">Department Name *</label><div class="input-group"><span class="input-group-text"><i class="feather-grid"></i></span><input name="name" required maxlength="255" value="{{ old('name',$department->name??'') }}" class="form-control @error('name') is-invalid @enderror" placeholder="e.g. Sales Operations"></div>@error('name')<div class="invalid-feedback d-block">{{ $message }}</div>@enderror</div><div class="col-md-4"><label class="form-label fw-semibold">Code</label><div class="input-group"><span class="input-group-text"><i class="feather-hash"></i></span><input name="code" maxlength="50" value="{{ old('code',$department->code??'') }}" class="form-control" placeholder="SALES-OPS"></div></div><div class="col-md-6"><label class="form-label fw-semibold">Department Manager</label><div class="input-group"><span class="input-group-text"><i class="feather-user-check"></i></span><select name="manager_user_id" class="form-select"><option value="">Select manager</option>@foreach($users as $user)<option value="{{ $user->id }}" @selected((int)old('manager_user_id',$department->manager_user_id??0)===$user->id)>{{ $user->name }} · {{ $user->email }}</option>@endforeach</select></div></div><div class="col-md-6"><label class="form-label fw-semibold">Status *</label><div class="input-group"><span class="input-group-text"><i class="feather-toggle-right"></i></span><select name="status" required class="form-select"><option value="active" @selected(old('status',$department->status??'active')==='active')>Active</option><option value="inactive" @selected(old('status',$department->status??'active')==='inactive')>Inactive</option></select></div></div><div class="col-12"><label class="form-label fw-semibold">Description</label><div class="input-group"><span class="input-group-text"><i class="feather-align-left"></i></span><textarea name="description" maxlength="2000" rows="4" class="form-control">{{ old('description',$department->description??'') }}</textarea></div></div></div>
