{{-- System Status --}}
@if(app()->isDownForMaintenance()) {{ __('Maintenance Mode') }} @else {{ __('System Online') }} @endif
{{-- Flash success / error are rendered by the admin layout itself (components/layouts/admin.blade.php ~line 682). Removed the duplicate blocks here so admins don't see TWO identical toasts every time they save. --}} {{-- Vertical sidebar tab layout. The old horizontal flex-wrap bar wrapped onto two rows once we got past ~10 tabs and looked cluttered; this is the standard Stripe / GitHub settings shape with a sticky left rail. Tabs are grouped to give the eye scanning anchors instead of a flat 14-item list. --}} @php $tabGroups = [ __('Platform') => [ ['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' => 'frontend', 'label' => __('Frontend'), 'icon' => 'M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25'], ['id' => 'custom_code', 'label' => __('Custom Code'), 'icon' => 'M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4'], ], __('Communication') => [ ['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' => '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' => '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'], ], __('Billing') => [ ['id' => 'company', 'label' => __('Company'), 'icon' => 'M3 21V7a2 2 0 012-2h2V3h10v2h2a2 2 0 012 2v14M3 21h18M9 9h.01M9 13h.01M9 17h.01M13 9h.01M13 13h.01M13 17h.01'], ['id' => 'tax', 'label' => __('Tax / VAT'), 'icon' => 'M9 7h6m-6 4h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'], ], __('Security & Access') => [ ['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'], ['id' => 'legal', 'label' => __('GDPR / Legal'), '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'], ], __('Infrastructure') => [ ['id' => 'storage', 'label' => __('Storage / CDN'), 'icon' => 'M4 7v10c0 2 1.5 3 3.5 3h9c2 0 3.5-1 3.5-3V7M4 7c0-2 1.5-3 3.5-3h9c2 0 3.5 1 3.5 3M4 7h16M12 11v6m-3-3l3 3 3-3'], ['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'], ], ]; $s = fn(string $key, string $default = '') => \App\Models\SystemSetting::get($key, $default); @endphp {{-- Flex layout instead of CSS grid with arbitrary track sizes. The previous `grid-cols-[260px_1fr]` arbitrary value wasn't being picked up by Tailwind's scanner, so the grid collapsed to single-column and the sidebar took the full width — making the panel look like a giant stacked menu above the content. Standard flex utilities are guaranteed to be in the generated CSS and produce the side-by-side layout we want. --}}
{{-- Vertical tab rail. Fixed-width on desktop (w-64 = 256px), full-width when stacked on mobile. `sticky top-4` keeps it visible as the long settings forms scroll past. --}} {{-- Right column: tab content. flex-1 takes the remaining width; min-w-0 stops wide form rows (long select options, monospace API keys) from blowing the column out and forcing horizontal page scroll. --}}
{{-- ══════════════════════════════════════════════════════════════ TAB 1: GENERAL SETTINGS ══════════════════════════════════════════════════════════════ --}}
@csrf

{{ __('General Settings') }}

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

{{-- Default left blank on purpose. The previous default was the literal "MailTrixy", which sellers who skimmed the install wizard accidentally persisted to system_settings.site_name on first save — leaking the source product name into the chat widget's "Powered by" footer and every notification email. Empty default forces the seller to type their own brand; WhiteLabel::brandName() then hides the credit entirely until they do. --}}

{{ __('Add or remove languages in Admin → Languages.') }}

{{ __('Add or remove currencies in Admin → Currencies.') }}

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

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

{{-- Font picker. Choice is loaded into every layout's via Google Fonts. Empty / unrecognized value falls back to the default 'Outfit'. --}}

{{ __('Applied site-wide (frontend, admin, user dashboard). Loaded from Google Fonts.') }}

{{ __('Semicolon-separated weights, e.g. 400;500;700. Fewer = faster page loads.') }}

{{-- ══════════════════════════════════════════════════════════════ 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.', ])
{{-- Facebook --}} @include('admin.settings._integration', [ 'id' => 'facebook', 'title' => __('Facebook (OAuth)'), 'enabled_key' => 'integration_facebook_enabled', 'fields' => [ ['name' => 'facebook_client_id', 'label' => __('App ID'), 'type' => 'text', 'placeholder' => __('Facebook App ID')], ['name' => 'facebook_client_secret', 'label' => __('App Secret'), 'type' => 'password', 'placeholder' => __('Enter app secret')], ], 'help' => __('Create at') . ' Facebook for Developers. ' . __('Set the OAuth redirect URI to:') . ' ' . url('/auth/facebook/callback') . '', ])
{{-- 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') }}

{{ __('Optional override URLs. When set, the public Terms / Privacy / Refund links redirect to your own page (e.g. WordPress, static HTML). When left blank, the built-in CMS page renders instead.') }}

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

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

{{ __('Linked from login footer and billing pages.') }}

{{-- ══════════════════════════════════════════════════════════════ 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') }}

{{-- Defaults to the current Site Name OR blank. The previous default was the literal source product name "MailTrixy", which leaked into every "Add to Home Screen" prompt for any reseller who skipped this field. --}}

{{ __('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