@php // Helper closures so the markup below stays readable. $bool = fn($k) => (bool) ($policy[$k] ?? false); $intv = fn($k) => (int) ($policy[$k] ?? 0); $strv = fn($k) => (string) ($policy[$k] ?? ''); $list = fn($k) => is_array($policy[$k] ?? null) ? implode("\n", $policy[$k]) : ''; $sevPill = function ($sev) { return match ($sev) { 'high' => [ 'bg' => 'bg-accent-coral/10 text-accent-coral border border-accent-coral/30', 'row' => 'bg-accent-coral/5', ], 'medium' => ['bg' => 'bg-accent-amber/15 text-accent-amber', 'row' => 'bg-accent-amber/5'], 'watch' => ['bg' => 'bg-paper-100 text-ink-700', 'row' => ''], default => ['bg' => 'bg-wa-bubble text-wa-deep', 'row' => ''], }; }; @endphp
{{ __('Admin') }} {{ __('Security') }}
{{ __('CMD K') }}
@csrf @method('PATCH')
{{ __('Security center') }}

{{ __('Security and') }} {{ __('compliance') }}

{{ __('Protect admin access, WhatsApp sending, devices, webhooks, and user activity. Toggles persist as') }} {{ __('security.*') }} settings — every change is logged to the audit trail.

{{ __('View audit logs') }}
{{-- ── KPI strip (always visible) ── --}}
{{ __('Security score') }}
{{ $kpis['security_score'] }}
{{ $kpis['security_score'] >= 70 ? 'strong controls active' : 'attention needed' }}
{{ __('Open risks') }}
{{ $kpis['open_risks'] }}
{{ $kpis['high_priority'] }} {{ __('high priority') }}
{{ __('Blocked attempts') }}
{{ $kpis['blocked_attempts'] }}
{{ __('last 24 hours') }}
{{ __('Campaign holds') }}
{{ $kpis['campaign_holds'] }}
{{ __('waiting review') }}
{{ __('2FA coverage') }}
{{ $kpis['tfa_coverage'] }}%
{{ $kpis['tfa_enrolled'] }}/{{ $kpis['tfa_admins_total'] }} {{ __('admins enrolled') }}
{{ __('Webhook failures') }}
{{ $kpis['webhook_failures'] }}%
{{ $kpis['webhook_failures'] > 1 ? 'review' : 'normal' }}
{{-- ── Tabs ── --}}
{{-- ── SUMMARY ── --}}
{{ __('Priority queue') }}

{{ __('Risk items to review') }}

{{ __('See all in audit log') }}
@forelse ($risks as $r) @php $p = $sevPill($r['severity']); @endphp @empty @endforelse
{{ __('Severity') }} {{ __('Signal') }} {{ __('Workspace') }} {{ __('Owner') }} {{ __('Action') }}
{{ $r['severity'] }}
{{ $r['signal'] }}
@if ($r['detail'])
{{ $r['detail'] }}
@endif
{{ $r['workspace'] }} {{ $r['owner'] }} {{ __('Inspect') }}
{{ __('All clear — no failures or warnings in the last 7 days.') }}
{{-- ── LOGIN AND MFA ── --}} {{-- ── WHATSAPP GUARDRAILS ── --}} {{-- ── ABUSE FILTERS ── --}} {{-- ── API AND WEBHOOKS ── --}} {{-- ── DEVICES ── --}} {{-- ── DANGER ZONE ── --}}
{{-- Sibling forms for danger-zone buttons. Each is triggered by a data-confirm modal (data-confirm-form attribute names the form id). --}}