@if($stepRecord->is_completed)
Completed
@elseif(! $canLogStepIds->contains($step->id))
Department restricted
@else
@endif
@elseif(in_array($step->id, $completedIds))
Completed
@elseif(! $eligibility['can_log_steps'])
@elseif($isInduction && ! $canLogStepIds->contains($step->id))
Department restricted
@else
{{-- Using both BS4 and BS5 data attributes for safety --}}
@endif
@endforeach
{{-- MODALS LOOP: Keep this at the bottom, just before @endsection --}}
@foreach($eligibility['can_log_steps'] ? $program->steps->filter(fn ($step) => ! $isInduction || $canLogStepIds->contains($step->id)) : collect() as $step)