@else
@foreach($notifications as $batchId => $batchNotifs)
@php
$batch = $batchNotifs->first()->batch;
$unread = $batchNotifs->where('read_at', null)->count();
$collapseId = 'batch-notif-' . ($batchId ?: 'general');
// Collapsed by default; open only if it's the single group, or the one
// targeted by ?lote=. Keeps the screen clear; click to expand the rest.
$isOpen = $notifications->count() === 1
|| (request('lote') && (string) $batchId === (string) request('lote'));
@endphp
@foreach($batchNotifs->sortBy('scheduled_at') as $notif)
@php $isPast = $notif->scheduled_at->isPast(); @endphp