<x-filament-panels::page>
    <div class="space-y-6">
        <div class="rounded-xl border border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-900">
            <h2 class="text-base font-semibold text-gray-950 dark:text-white">ManagedEnvironment diagnostics</h2>
            <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
                Identify common tenant configuration issues and apply safe repairs.
            </p>
        </div>

        @if ($missingOwner)
            <div class="rounded-xl border border-amber-200 bg-amber-50 p-4 text-amber-900 dark:border-amber-900/40 dark:bg-amber-950/40 dark:text-amber-100">
                <div class="font-semibold">Missing owner</div>
                <div class="mt-1 text-sm">This tenant currently has no Owner members.</div>
            </div>
        @endif

        @if ($hasDuplicateMembershipsForCurrentUser)
            <div class="rounded-xl border border-amber-200 bg-amber-50 p-4 text-amber-900 dark:border-amber-900/40 dark:bg-amber-950/40 dark:text-amber-100">
                <div class="font-semibold">Duplicate memberships</div>
                <div class="mt-1 text-sm">This tenant has duplicate membership rows for your user.</div>
            </div>
        @endif

        @if (! $missingOwner && ! $hasDuplicateMembershipsForCurrentUser)
            <div class="rounded-xl border border-gray-200 bg-white p-4 text-gray-700 dark:border-gray-800 dark:bg-gray-900 dark:text-gray-300">
                <div class="font-semibold text-gray-950 dark:text-white">All good</div>
                <div class="mt-1 text-sm">No known issues detected.</div>
            </div>
        @endif
    </div>
</x-filament-panels::page>
