<x-filament-panels::page>
    @php($navigationContext = \App\Support\Navigation\CanonicalNavigationContext::fromRequest(request()))

    @if ($navigationContext?->backLinkLabel !== null && $navigationContext->backLinkUrl !== null)
        <x-filament::section class="mb-6">
            <div class="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between">
                <div class="text-sm text-gray-600 dark:text-gray-300">
                    Return path stays quiet while this overview remains focused on alert health and downstream drilldowns.
                </div>

                <x-filament::button tag="a" color="gray" :href="$navigationContext->backLinkUrl">
                    {{ $navigationContext->backLinkLabel }}
                </x-filament::button>
            </div>
        </x-filament::section>
    @endif

    <x-filament::section>
        <div class="flex flex-col gap-3">
            <div class="text-sm text-gray-600 dark:text-gray-300">
                Configure alert targets and rules, then review delivery history.
            </div>

            <div class="flex flex-wrap gap-3">
                @if (\App\Filament\Resources\AlertDestinationResource::canViewAny())
                    <x-filament::button tag="a" :href="\App\Filament\Resources\AlertDestinationResource::getUrl(panel: 'admin')">
                        Alert targets
                    </x-filament::button>
                @endif

                @if (\App\Filament\Resources\AlertRuleResource::canViewAny())
                    <x-filament::button tag="a" :href="\App\Filament\Resources\AlertRuleResource::getUrl(panel: 'admin')">
                        Alert rules
                    </x-filament::button>
                @endif

                @if (\App\Filament\Resources\AlertDeliveryResource::canViewAny())
                    <x-filament::button tag="a" :href="\App\Filament\Resources\AlertDeliveryResource::getUrl(panel: 'admin')">
                        Alert deliveries
                    </x-filament::button>
                @endif

                <x-filament::button tag="a" color="gray" :href="route('admin.monitoring.audit-log')">
                    Audit Log
                </x-filament::button>
            </div>
        </div>
    </x-filament::section>
</x-filament-panels::page>
