@else
@foreach ($tasks as $task)
@php
// Use the due date from the task
$effectiveDueDate = $task->due_date;
// Calculate if overdue based on the due date
$isOverdue = $effectiveDueDate &&
\Carbon\Carbon::parse($effectiveDueDate)->isPast() &&
$task->status !== 'completed';
$deadlineDays = $effectiveDueDate ? \Carbon\Carbon::now()->diffInDays(\Carbon\Carbon::parse($effectiveDueDate), false) : '';
// Get allocations for this task
$taskHoAllocations = $hoAllocations->get($task->id, collect());
$taskLocAllocations = $locAllocations->get($task->id, collect());
@endphp