{{-- 1. Greeting Banner --}}

أهلاً بك مجدداً، {{ auth()->user()->name }}! 👋

إليك نظرة شاملة على أداء نظام محادثات واتساب وإحصائيات العمل اليوم.

{{ now()->translatedFormat('l, d F Y') }}
{{-- 2. KPI Stats Grid --}}

محادثات مفتوحة

{{ $openCount }}

محادثات قيد المتابعة والرد

محادثات معلّقة

{{ $pendingCount }}

تحتاج إلى متابعة لاحقة

مغلقة اليوم

{{ $closedCount }}

تم إنجازها وإغلاقها اليوم

موظفون نشطون

{{ $activeAgentsCount }}

متاحون لاستقبال التكليفات
{{-- 3. Two-Column Activity & Action Feed --}}
{{-- Right Column (Recent Active Chats) --}}

آخر المحادثات النشطة

عرض الكل
@forelse ($recentConversations as $conv)
{{ mb_substr($conv->contact->profile_name ?: 'W', 0, 1) }}

{{ $conv->contact->profile_name ?: $conv->contact->wa_id }}

رقم: {{ $conv->contact->wa_id }}

@if ($conv->latestMessage)

@if ($conv->latestMessage->direction === 'out') أنت: @endif {{ $conv->latestMessage->body }}

@else

لا توجد رسائل بعد

@endif
{{ $conv->last_message_at ? $conv->last_message_at->diffForHumans() : '—' }}
@if ($conv->status === 'open') مفتوحة @elseif ($conv->status === 'pending') معلّقة @else مغلقة @endif
فتح الشات
@empty

لا توجد محادثات نشطة حالياً

@endforelse
{{-- Left Column (Active Agents & Quick Actions) --}}

فريق العمل المتاح

@forelse ($activeAgents as $agent)
{{ mb_substr($agent->name, 0, 1) }}

{{ $agent->name }}

{{ $agent->team ? $agent->team->name : 'مستقل' }}

أجنت
@empty

لا يوجد موظفون نشطون حالياً

@endforelse