@csrf
<div class="row g-3">
    <div class="col-md-4"><label class="form-label">Registration # <span class="text-danger">*</span></label>
        <input type="text" name="registration_no" value="{{ old('registration_no', $vehicle->registration_no) }}" class="form-control @error('registration_no') is-invalid @enderror" required>
        @error('registration_no')<div class="invalid-feedback">{{ $message }}</div>@enderror</div>
    <div class="col-md-4"><label class="form-label">Model</label>
        <input type="text" name="model" value="{{ old('model', $vehicle->model) }}" class="form-control"></div>
    <div class="col-md-2"><label class="form-label">Capacity</label>
        <input type="number" name="capacity" value="{{ old('capacity', $vehicle->capacity) }}" class="form-control"></div>
    <div class="col-md-2 d-flex align-items-end"><div class="form-check"><input type="checkbox" name="is_active" value="1" id="is_active" class="form-check-input" @checked(old('is_active', $vehicle->is_active ?? true))><label for="is_active" class="form-check-label">Active</label></div></div>

    <div class="col-md-4"><label class="form-label">Driver Name</label>
        <input type="text" name="driver_name" value="{{ old('driver_name', $vehicle->driver_name) }}" class="form-control"></div>
    <div class="col-md-4"><label class="form-label">Driver Phone</label>
        <input type="text" name="driver_phone" value="{{ old('driver_phone', $vehicle->driver_phone) }}" class="form-control"></div>
    <div class="col-md-4"><label class="form-label">Driver License</label>
        <input type="text" name="driver_license" value="{{ old('driver_license', $vehicle->driver_license) }}" class="form-control"></div>

    <div class="col-md-5"><label class="form-label">Assigned Route</label>
        <select name="transport_route_id" class="form-select">
            <option value="">— None —</option>
            @foreach($routes as $r)<option value="{{ $r->id }}" @selected(old('transport_route_id', $vehicle->transport_route_id)==$r->id)>{{ $r->name }}</option>@endforeach
        </select></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('vehicles.index') }}" class="btn btn-light border">Cancel</a>
</div>
