{{-- System Status --}}
@if(app()->isDownForMaintenance()) {{ __('Maintenance Mode') }} @else {{ __('System Online') }} @endif
{{-- Flash success --}} @if(session('success'))
{{ session('success') }}
@endif {{-- Flash error --}} @if(session('error'))
{{ session('error') }}
@endif {{-- Tab navigation --}}
@php $tabs = [ ['id' => 'general', 'label' => __('General'), 'icon' => 'M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z'], ['id' => 'branding', 'label' => __('Branding'), 'icon' => 'M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01'], ['id' => 'email', 'label' => __('SMTP'), 'icon' => 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z'], ['id' => 'auth', 'label' => __('Authentication'), 'icon' => 'M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z'], ['id' => 'security', 'label' => __('Security'), 'icon' => 'M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z'], // AI Config tab removed — single source of truth lives at /admin/ai-providers ['id' => 'integrations', 'label' => __('Integrations'), 'icon' => 'M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z'], ['id' => 'legal', 'label' => __('GDPR'), 'icon' => 'M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z'], ['id' => 'pwa', 'label' => __('PWA'), 'icon' => 'M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z'], ['id' => 'custom_code', 'label' => __('Custom Code'), 'icon' => 'M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4'], ['id' => 'maintenance', 'label' => __('Maintenance'), 'icon' => 'M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4'], ]; @endphp @foreach($tabs as $tab) @endforeach
@php $s = fn(string $key, string $default = '') => \App\Models\SystemSetting::get($key, $default); @endphp {{-- ══════════════════════════════════════════════════════════════ TAB 1: GENERAL SETTINGS ══════════════════════════════════════════════════════════════ --}}
@csrf

{{ __('General Settings') }}

{{ __('Core platform identity and localization configuration.') }}

{{ __('Displayed in footer, error pages, and transactional emails.') }}

{{ __('Optional. Shown on contact and support pages.') }}

{{-- ══════════════════════════════════════════════════════════════ TAB 2: BRANDING ══════════════════════════════════════════════════════════════ --}}
@csrf

{{ __('Branding') }}

{{ __('Customize colors, logos, and favicon for your platform.') }}

{{-- Colors --}}

{{ __('Brand Colors') }}

@foreach([ ['name' => 'primary_color', 'label' => __('Primary Color'), 'default' => '#4F46E5'], ['name' => 'secondary_color', 'label' => __('Secondary Color'), 'default' => '#7C3AED'], ['name' => 'accent_color', 'label' => __('Accent Color'), 'default' => '#06B6D4'], ] as $color)
@endforeach
{{-- Logos --}}

{{ __('Logos & Favicon') }}

@if($s('logo_light')) Logo @else M @endif

{{ __('PNG, SVG, or JPG. Recommended: 200x60px.') }}

@if($s('logo_dark')) Logo Dark @else M @endif

{{ __('PNG, SVG, or JPG for dark backgrounds.') }}

@if($s('favicon')) Favicon @else
M
@endif

{{ __('ICO, PNG, or SVG. 32x32 or 64x64.') }}

{{-- ══════════════════════════════════════════════════════════════ TAB 3: EMAIL / SMTP ══════════════════════════════════════════════════════════════ --}}
@csrf

{{ __('Email / SMTP Configuration') }}

{{ __('Default SMTP settings for system emails (verification, notifications, password resets).') }}

{{ $s('smtp_password') ? __('Password is saved. Leave blank to keep current value.') : __('Enter your SMTP password.') }}

{{-- SMTP Test --}}
@csrf

{{ __('Test SMTP Connection') }}

{{ __('Send a test email to verify your configuration works correctly.') }}

@error('test_email')

{{ $message }}

@enderror

{{ __('Save your SMTP settings above before sending a test email.') }}

{{-- ══════════════════════════════════════════════════════════════ TAB 4: AUTHENTICATION ══════════════════════════════════════════════════════════════ --}}
@csrf

{{ __('Authentication Settings') }}

{{ __('Control how users register, verify, and access the platform.') }}

@include('admin.settings._toggle', [ 'name' => 'registration_enabled', 'label' => __('Enable Public Registration'), 'description' => __('Allow new users to create accounts on the platform'), 'value' => $s('registration_enabled', 'true'), 'color' => 'green', 'icon' => 'M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z', ]) @include('admin.settings._toggle', [ 'name' => 'social_login_enabled', 'label' => __('Enable Social Login'), 'description' => __('Allow users to sign in with Google, GitHub, or Microsoft'), 'value' => $s('social_login_enabled', 'true'), 'color' => 'blue', 'icon' => 'M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z', ]) @include('admin.settings._toggle', [ 'name' => 'require_email_verification', 'label' => __('Require Email Verification'), 'description' => __('Users must verify their email before accessing the platform'), 'value' => $s('require_email_verification', 'true'), 'color' => 'indigo', 'icon' => 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z', ])

{{ __('The plan automatically assigned to newly registered users.') }}

{{ __('Set to 0 to disable trials. Users start on the default plan immediately.') }}

{{-- ══════════════════════════════════════════════════════════════ TAB 5: SECURITY ══════════════════════════════════════════════════════════════ --}}
@csrf

{{ __('Security Settings') }}

{{ __('Configure login limits, session policies, 2FA enforcement, and CAPTCHA.') }}

@include('admin.settings._toggle', [ 'name' => 'require_2fa_admins', 'label' => __('Force 2FA for Admins'), 'description' => __('Require all admin users to enable two-factor authentication'), 'value' => $s('require_2fa_admins', 'false'), 'color' => 'violet', 'icon' => 'M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z', ])

{{ __('Number of failed attempts before account lockout.') }}

{{ __('How long the account stays locked after exceeding attempts.') }}

{{ __('Default: 120 min (2 hours). Max: 10080 min (7 days).') }}

{{ __('Minimum characters for user passwords. Recommended: 8+.') }}

{{ __('hCaptcha Configuration') }}

{{ $s('hcaptcha_secret_key') ? __('Secret saved. Leave blank to keep.') : '' }} {{ __('Get keys at') }} hcaptcha.com.

{{-- ══════════════════════════════════════════════════════════════ TAB 6: AI CONFIGURATION ══════════════════════════════════════════════════════════════ --}} {{-- AI Configuration tab removed — single source of truth lives at /admin/ai-providers (admins were getting confused by two places that configured the same thing). --}} {{-- ══════════════════════════════════════════════════════════════ TAB 7: INTEGRATIONS ══════════════════════════════════════════════════════════════ --}}
@csrf

{{ __('OAuth & Payment Credentials') }}

{{ __('Configure OAuth app credentials for social login, email providers, and payment gateways. Users connect via OAuth — they don\'t see these keys.') }}

{{-- Google --}} @include('admin.settings._integration', [ 'id' => 'google', 'title' => __('Google (OAuth, Gmail, Calendar)'), 'enabled_key' => 'integration_google_enabled', 'fields' => [ ['name' => 'google_client_id', 'label' => __('Client ID'), 'type' => 'text', 'placeholder' => 'xxxx.apps.googleusercontent.com'], ['name' => 'google_client_secret', 'label' => __('Client Secret'), 'type' => 'password', 'placeholder' => __('Enter client secret')], ], 'help' => __('Create at') . ' Google Cloud Console.', ])
{{-- Microsoft --}} @include('admin.settings._integration', [ 'id' => 'microsoft', 'title' => __('Microsoft (Outlook, OneDrive)'), 'enabled_key' => 'integration_microsoft_enabled', 'fields' => [ ['name' => 'microsoft_client_id', 'label' => __('Client ID'), 'type' => 'text', 'placeholder' => __('Azure App Client ID')], ['name' => 'microsoft_client_secret', 'label' => __('Client Secret'), 'type' => 'password', 'placeholder' => __('Enter client secret')], ], 'help' => __('Create at') . ' Azure Portal.', ])
{{-- GitHub --}} @include('admin.settings._integration', [ 'id' => 'github', 'title' => __('GitHub (OAuth)'), 'enabled_key' => 'integration_github_enabled', 'fields' => [ ['name' => 'github_client_id', 'label' => __('Client ID'), 'type' => 'text', 'placeholder' => __('GitHub OAuth App Client ID')], ['name' => 'github_client_secret', 'label' => __('Client Secret'), 'type' => 'password', 'placeholder' => __('Enter client secret')], ], 'help' => __('Create at') . ' GitHub Developer Settings.', ])
{{-- Stripe --}} @include('admin.settings._integration', [ 'id' => 'stripe', 'title' => __('Stripe (Payments)'), 'enabled_key' => 'integration_stripe_enabled', 'fields' => [ ['name' => 'stripe_key', 'label' => __('Publishable Key'), 'type' => 'text', 'placeholder' => 'pk_live_...'], ['name' => 'stripe_secret', 'label' => __('Secret Key'), 'type' => 'password', 'placeholder' => 'sk_live_...'], ['name' => 'stripe_webhook_secret', 'label' => __('Webhook Secret'), 'type' => 'password', 'placeholder' => 'whsec_...'], ], 'help' => __('Get from') . ' Stripe Dashboard.', ])
{{-- Slack --}} @include('admin.settings._integration', [ 'id' => 'slack', 'title' => __('Slack (OAuth)'), 'enabled_key' => 'integration_slack_enabled', 'fields' => [ ['name' => 'slack_client_id', 'label' => __('Client ID'), 'type' => 'text', 'placeholder' => __('Slack App Client ID')], ['name' => 'slack_client_secret', 'label' => __('Client Secret'), 'type' => 'password', 'placeholder' => __('Enter client secret')], ['name' => 'slack_signing_secret', 'label' => __('Signing Secret'), 'type' => 'password', 'placeholder' => __('Enter signing secret')], ], 'help' => __('Create at') . ' Slack API Dashboard.', ])
{{-- Salesforce --}} @include('admin.settings._integration', [ 'id' => 'salesforce', 'title' => __('Salesforce (OAuth)'), 'enabled_key' => 'integration_salesforce_enabled', 'fields' => [ ['name' => 'salesforce_client_id', 'label' => __('Consumer Key'), 'type' => 'text', 'placeholder' => __('Connected App Consumer Key')], ['name' => 'salesforce_client_secret', 'label' => __('Consumer Secret'), 'type' => 'password', 'placeholder' => __('Enter consumer secret')], ], 'help' => __('Create a Connected App in') . ' Salesforce Setup.', ])
{{-- Pusher --}} @include('admin.settings._integration', [ 'id' => 'pusher', 'title' => __('Pusher (Real-time)'), 'enabled_key' => 'integration_pusher_enabled', 'fields' => [ ['name' => 'pusher_app_id', 'label' => __('App ID'), 'type' => 'text', 'placeholder' => __('Pusher App ID')], ['name' => 'pusher_key', 'label' => __('Key'), 'type' => 'text', 'placeholder' => __('Pusher Key')], ['name' => 'pusher_secret', 'label' => __('Secret'), 'type' => 'password', 'placeholder' => __('Enter secret')], ['name' => 'pusher_cluster', 'label' => __('Cluster'), 'type' => 'text', 'placeholder' => 'us2'], ], 'help' => __('Get from') . ' Pusher Dashboard.', ]) {{-- Info box --}}

{{ __('How it works') }}

  • {!! __('OAuth credentials here enable social login (Google, Microsoft, GitHub) and email account connections') !!}
  • {!! __('Stripe credentials enable payment processing for subscriptions') !!}
  • {!! __('Pusher credentials enable real-time notifications') !!}
  • {!! __('Channel integrations (WhatsApp, SMS, Telegram) are configured by users in Settings > Channels') !!}
  • {!! __('AI API keys are configured by users in Settings > AI Configuration') !!}
{{-- ══════════════════════════════════════════════════════════════ TAB 8: LEGAL / GDPR ══════════════════════════════════════════════════════════════ --}}
@csrf

{{ __('Legal / GDPR Settings') }}

{{ __('Configure cookie consent, data export, account deletion, and legal page links.') }}

{{-- Cookie Consent --}}

{{ __('Cookie Consent') }}

@include('admin.settings._toggle', [ 'name' => 'cookie_consent_enabled', 'label' => __('Enable Cookie Banner'), 'description' => __('Show a cookie consent popup to new visitors for GDPR compliance'), 'value' => $s('cookie_consent_enabled', $s('gdpr_cookie_enabled', 'true')), 'color' => 'indigo', 'icon' => 'M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z', ])
{{-- GDPR Data Rights --}}

{{ __('Data Rights') }}

@include('admin.settings._toggle', [ 'name' => 'gdpr_data_export_enabled', 'label' => __('Enable GDPR Data Export'), 'description' => __('Allow users to download all their personal data (GDPR Article 20)'), 'value' => $s('gdpr_data_export_enabled', 'true'), 'color' => 'blue', 'icon' => 'M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4', ])
@include('admin.settings._toggle', [ 'name' => 'gdpr_account_deletion_enabled', 'label' => __('Enable Account Self-Deletion'), 'description' => __('Allow users to permanently delete their account and all associated data (GDPR Article 17)'), 'value' => $s('gdpr_account_deletion_enabled', 'true'), 'color' => 'red', 'icon' => 'M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16', ])
{{-- Legal Pages --}}

{{ __('Legal Pages') }}

{{ __('Linked from registration page and site footer.') }}

{{ __('Linked from cookie banner, registration, and footer.') }}

{{-- ══════════════════════════════════════════════════════════════ TAB: PWA (Progressive Web App) ══════════════════════════════════════════════════════════════ --}}
@csrf

{{ __('Progressive Web App (PWA)') }}

{{ __('Allow users to install your platform as a native-like app on mobile and desktop.') }}

{{-- Enable Toggle --}}

{{ __('Enable PWA') }}

{{ __('Injects manifest, service worker, and install prompt into all pages.') }}

{!! __('Requirement: PWA only works on sites served over HTTPS. If your domain does not have an SSL certificate, the install prompt will not appear.') !!}

{{-- App Identity --}}

{{ __('App Identity') }}

{{ __('Shown on the home screen and in the task switcher.') }}

{{ __('Used when space is limited (e.g., under home screen icon). Max 12 chars.') }}

{!! __('The page that opens when the installed app is launched. Use /dashboard or /.') !!}

{{-- Icons --}}

{{ __('Icons & Splash') }}

@if($s('pwa_icon')) PWA Icon @else
M
@endif

{{ __('512 x 512 px PNG recommended. Square with solid background.') }}

@if($s('pwa_splash')) Splash @else @endif

{{ __('2048 x 2732 px PNG/JPG. Shown while the app loads on Apple devices.') }}

{{-- Colors --}}

{{ __('Colors') }}

{{ __('Browser toolbar color on Android and title bar on desktop.') }}

{{ __('Splash screen background. Match your site\'s background for a seamless launch.') }}

{{-- How It Works --}}

{{ __('How It Works') }}

  1. {{ __('Enable PWA above and configure the app name, icon, and colors.') }}
  2. {!! __('The system injects a <link rel="manifest"> tag and registers a service worker on all frontend pages.') !!}
  3. {!! __('The manifest is served dynamically from /manifest.json using your saved settings.') !!}
  4. {{ __('Users will see a browser-native install prompt (Android/Chrome/Edge) or can use Share > Add to Home Screen (iOS/Safari).') }}
{{-- ══════════════════════════════════════════════════════════════ TAB: CUSTOM CODE Three textareas the admin can use to inject site-wide code: - custom_css → wrapped in