@extends('layouts.dashboard') @section('title', __('Security & Backups')) @section('page_title', __('Security & Backups')) @section('content') @include('partials.how-it-works', ['key' => 'admin.security'])
@include('partials.dashboard.stat-card', ['label' => __('Admins with 2FA'), 'value' => $stats['admins_2fa'] . ' / ' . $stats['admins'], 'icon' => 'bi-shield-lock', 'color' => $stats['admins_2fa'] === $stats['admins'] && $stats['admins'] ? 'success' : 'warning'])
@include('partials.dashboard.stat-card', ['label' => __('Users with 2FA'), 'value' => $stats['users_2fa'], 'icon' => 'bi-people', 'color' => 'primary'])
@include('partials.dashboard.stat-card', ['label' => __('Backups stored'), 'value' => $stats['backups'], 'icon' => 'bi-hdd-stack', 'color' => 'info', 'hint' => round($stats['backup_bytes'] / 1048576, 1) . ' MB'])
@include('partials.dashboard.stat-card', ['label' => __('GDPR requests'), 'value' => $stats['exports'] + $stats['erasures'], 'icon' => 'bi-file-earmark-person', 'color' => 'secondary', 'hint' => $stats['exports'] . ' ' . __('exports') . ' ยท ' . $stats['erasures'] . ' ' . __('erasures')])
@csrf @method('PUT')
{{ __('Security policy') }}
{{ __('Admins without 2FA are redirected to the setup page until they enable it.') }}
{{ __('Automatically hidden when APP_ENV=production.') }}
{{ __('Per email + IP, on login, 2FA and API login.') }}
{{ __('0 = unlimited. When exceeded, the oldest sessions are signed out first.') }}

@unless($zipAvailable)
{{ __('PHP zip extension not available.') }}
@endunless
{{ __('Scheduled backups need the cron entry') }} * * * * * php artisan schedule:run.
{{ __('Recent GDPR requests') }}
@forelse($requests as $r)
{{ status_label($r->type) }}{{ $r->user->name ?? 'โ€”' }} ({{ $r->user->email ?? '' }})
{{ $r->created_at->diffForHumans() }}
@empty
{{ __('No data requests yet.') }}
@endforelse
{{ __('Backups') }} {{ $backupDir }}
@csrf
@if($zipAvailable)
@csrf
@endif
@forelse($backupsList as $b) @empty @endforelse
{{ __('File') }}{{ __('Type') }}{{ __('Size') }}{{ __('Created') }}{{ __('Status') }}{{ __('Actions') }}
{{ $b->filename }} {{ strtoupper($b->type) }} {{ $b->humanSize() }} {{ $b->created_at->diffForHumans() }}
{{ $b->creator->name ?? __('Scheduler') }}
{{ status_label($b->status) }} @if($b->status === 'completed' && $b->exists())@endif
@csrf @method('DELETE')
{{ __('No backups yet. Create one now or schedule them in the policy.') }}
{{ __('Recent sign-ins (all users)') }}{{ __('Audit trail') }}
@forelse($recentLogins as $l) @empty @endforelse
{{ __('User') }}{{ __('When') }}{{ __('Device') }}{{ __('IP') }}{{ __('2FA') }}
@if($l->user)@endif
{{ $l->user->name ?? 'โ€”' }}
{{ $l->user->email ?? '' }}
{{ optional($l->logged_in_at)->diffForHumans() }} {{ $l->device ? __($l->device) : 'โ€”' }} {{ $l->ip_address }} @if($l->user?->hasTwoFactor()){{ __('On') }}@else{{ __('Off') }}@endif @if($l->user?->hasTwoFactor())
@csrf
@endif
{{ __('No sign-ins yet.') }}
@endsection