@if ($events->isEmpty())
    <x-empty-state title="No upcoming events" message="School events and functions will appear here." />
@else
    <div class="table-wrap"><table><thead><tr><th>Date</th><th>Title</th><th>Type</th><th>Location</th><th>Organizer</th></tr></thead><tbody>
        @foreach ($events as $event)
            <tr>
                <td>{{ $event->starts_at->format('d M Y') }}<br><span style="color:var(--text3);font-size:12px;">{{ $event->starts_at->format('H:i') }}</span></td>
                <td><strong>{{ $event->title }}</strong>@if($event->description)<br><span style="color:var(--text2);font-size:13px;">{{ str($event->description)->limit(80) }}</span>@endif</td>
                <td>{{ ucfirst($event->event_type ?? 'event') }}</td>
                <td>{{ $event->location ?? '—' }}</td>
                <td>
                    @if ($event->organizer_type === 'student_leadership')
                        {{ $event->studentOrganizer?->full_name ?? 'Student' }}
                        @if($event->studentOrganizer?->leadership_role)<br><span style="font-size:12px;color:var(--text3);">{{ $eventsService->leadershipLabel($event->studentOrganizer->leadership_role) }}</span>@endif
                    @else
                        Administration
                    @endif
                </td>
            </tr>
        @endforeach
    </tbody></table></div>
@endif
