@if(session('message'))
{{ session('message') }}
@endif @if(session('error'))
{{ session('error') }}
@endif

{{ __('Email Accounts') }}

{{ __('Connect and manage your email accounts.') }}

{{-- Connected accounts --}} @forelse($accounts as $account)

{{ $account->email }}

@if($account->is_default) {{ __('Default') }} @endif

{{ $account->display_name ?? ucfirst($account->provider) }} · @if($account->isConnected()) {{ __('Connected') }} @else {{ ucfirst($account->status) }} @endif @if($account->last_synced_at) · {{ __('Last sync') }} {{ $account->last_synced_at->diffForHumans() }} @endif

@if($account->error_message)

{{ __('Connection issue') }}

@if(str_contains($account->error_message, 'OAuth') || str_contains($account->error_message, 'token')) Your email account needs to be reconnected. Click \"Reconnect\" to fix this.') }} @elseif(str_contains($account->error_message, 'IMAP') || str_contains($account->error_message, 'connection')) {{ __('We couldn\'t reach your email server. Please check your email settings and try again.') }} @else {{ __('Something went wrong with your email connection. Try reconnecting your account.') }} @endif

@endif
{{-- AI toggle --}} {{-- Reconnect button (visible when disconnected/error) --}} @if(!$account->isConnected()) @if($account->isOAuth()) @else @endif @endif {{-- Edit button --}} {{-- More actions dropdown (teleported so rounded card / tab content can't clip the menu below the fold) --}}
@empty @endforelse {{-- Provider Picker Modal --}} @if($showProviderPicker) @endif {{-- Add/Edit Account Modal --}} @if($showAddForm) @endif