<x-filament-panels::page>
    @php($selectedAudit = $this->selectedAuditRecord())
    @php($selectedAuditLink = $this->selectedAuditTargetLink())

    <x-filament::section>
        <div class="flex flex-col gap-3">
            <div class="text-lg font-semibold text-gray-900 dark:text-gray-100">
                Summary-first audit history
            </div>

            <div class="text-sm text-gray-600 dark:text-gray-300">
                Review governance, operational, and workspace-admin events in reverse chronological order without leaving the canonical Monitoring route.
            </div>

            <div class="text-sm text-gray-600 dark:text-gray-300">
                Actor, outcome, target, and readable context stay visible even when the original record changes or disappears later.
            </div>

            <div class="text-sm text-gray-600 dark:text-gray-300">
                The selected event is URL-addressable through the <span class="font-mono text-xs">event</span> query parameter. If the event is no longer visible in the current history view, the page quietly falls back to the unselected log.
            </div>
        </div>
    </x-filament::section>

    @if ($selectedAudit)
        <x-filament::section>
            @include('filament.pages.monitoring.partials.audit-log-inspect-event', [
                'selectedAudit' => $selectedAudit,
                'selectedAuditLink' => $selectedAuditLink,
            ])
        </x-filament::section>
    @endif

    {{ $this->table }}
</x-filament-panels::page>
