@extends('layouts.app') @section('content')

{{ app()->getLocale() == 'ar' ? 'لوحة التحكم الرئيسية' : 'Main Dashboard' }}

{{ app()->getLocale() == 'ar' ? 'نظرة شاملة على أداء المكتب والأسطول' : 'Comprehensive view of office performance & fleet' }}

{{ now()->translatedFormat('d M Y') }}
@php $has_alerts = $document_alerts['expired'] > 0 || $document_alerts['expiring_soon'] > 0 || $insurance_alerts['expired'] > 0 || $insurance_alerts['expiring_soon'] > 0 || $rental_alerts['overdue'] > 0 || $expense_alerts['high_expenses'] > 0 || $maintenance_alerts['due'] > 0; @endphp @if($has_alerts)
@if($document_alerts['expired'] > 0 || $document_alerts['expiring_soon'] > 0)
📄 {{ app()->getLocale() == 'ar' ? 'الاستمارة والفحص' : 'Docs & Inspection' }}
@if($document_alerts['expired'] > 0)
• {{ $document_alerts['expired'] }} {{ app()->getLocale() == 'ar' ? 'منتهية' : 'Expired' }}
@endif @if($document_alerts['expiring_soon'] > 0)
• {{ $document_alerts['expiring_soon'] }} {{ app()->getLocale() == 'ar' ? 'تنتهي قريباً' : 'Expiring Soon' }}
@endif
@endif @if($insurance_alerts['expired'] > 0 || $insurance_alerts['expiring_soon'] > 0)
🛡️ {{ app()->getLocale() == 'ar' ? 'تأمين المركبات' : 'Vehicle Insurance' }}
@if($insurance_alerts['expired'] > 0)
• {{ $insurance_alerts['expired'] }} {{ app()->getLocale() == 'ar' ? 'منتهي' : 'Expired' }}
@endif @if($insurance_alerts['expiring_soon'] > 0)
• {{ $insurance_alerts['expiring_soon'] }} {{ app()->getLocale() == 'ar' ? 'ينتهي خلال شهر' : 'Expires in 30 days' }}
@endif
@endif @if($maintenance_alerts['due'] > 0)
🔧 {{ app()->getLocale() == 'ar' ? 'صيانة مستحقة' : 'Maintenance Due' }}
{{ $maintenance_alerts['due'] }}
{{ app()->getLocale() == 'ar' ? 'سيارات تجاوزت موعد الصيانة' : 'Exceeded mileage limit' }}
@endif @if($rental_alerts['overdue'] > 0)
🔑 {{ app()->getLocale() == 'ar' ? 'عقود متأخرة' : 'Overdue Rentals' }}
{{ $rental_alerts['overdue'] }}
{{ app()->getLocale() == 'ar' ? 'تجاوزت تاريخ التسليم' : 'Past return date' }}
@endif @if($expense_alerts['high_expenses'] > 0)
⚠️ {{ app()->getLocale() == 'ar' ? 'مصاريف مرتفعة' : 'High Expenses' }}
{{ $expense_alerts['high_expenses'] }}
{{ app()->getLocale() == 'ar' ? 'مصاريف تتجاوز 5000 ' . $defaultCurrency->symbol_ar : 'Exceeding 5000 ' . $defaultCurrency->code }}
@endif
@endif

🚗 {{ app()->getLocale() == 'ar' ? 'تحليل حالة الأسطول' : 'Fleet Status' }}

{{ $stats['total_cars'] }} {{ app()->getLocale() == 'ar' ? 'إجمالي السيارات' : 'Total Cars' }}

📄 {{ app()->getLocale() == 'ar' ? 'تحليل حالة الوثائق' : 'Documents Status' }}

{{ array_sum($doc_stats) }} {{ app()->getLocale() == 'ar' ? 'إجمالي الوثائق' : 'Total Docs' }}
{{ app()->getLocale() == 'ar' ? 'صافي أرباح اليوم' : 'Net Profit Today' }}
{{ number_format($stats['profit_today'], 0) }} {{ app()->getLocale() == 'ar' ? $defaultCurrency->symbol_ar : $defaultCurrency->code }}
{{ app()->getLocale() == 'ar' ? 'إجمالي المحصل اليوم مطروحاً منه كافة المصروفات التشغيلية' : 'Total daily revenue minus all operational expenses' }}
{{ app()->getLocale() == 'ar' ? 'الأسطول المتاح' : 'Available Fleet' }}
{{ $stats['unrented_cars'] }}
{{ app()->getLocale() == 'ar' ? 'السيارات الجاهزة للتأجير الفوري وغير المرتبطة بعقود نشطة حالياً' : 'Vehicles ready for immediate rental and not linked to any active contracts' }}
{{ app()->getLocale() == 'ar' ? 'نسبة الإشغال' : 'Occupancy Rate' }}
{{ $stats['occupancy_rate'] }}%
{{ app()->getLocale() == 'ar' ? 'النسبة المئوية للسيارات المؤجرة من إجمالي أسطول المكتب الفعلي' : 'Percentage of rented vehicles relative to the total active office fleet' }}
{{ app()->getLocale() == 'ar' ? 'السيارات المعطلة' : 'In Maintenance' }}
{{ $stats['maintenance_cars'] }}
{{ app()->getLocale() == 'ar' ? 'السيارات المتوقفة تماماً بسبب أعطال فنية أو صيانة دورية مجدولة' : 'Vehicles completely out of service due to technical faults or maintenance' }}
{{ app()->getLocale() == 'ar' ? 'العقود المتأخرة' : 'Overdue Rentals' }}
{{ $rental_alerts['overdue'] }}
{{ app()->getLocale() == 'ar' ? 'عقود نشطة تجاوزت تاريخ التسليم المحدد ولم يتم إغلاقها بعد' : 'Active contracts that exceeded return date and have not been closed' }}
{{ app()->getLocale() == 'ar' ? 'الوثائق المنتهية' : 'Expired Docs' }}
{{ $document_alerts['expired'] }}
{{ app()->getLocale() == 'ar' ? 'وثائق مركبات (استمارة/فحص) منتهية الصلاحية وتتطلب تجديداً' : 'Vehicle documents (Registration/Inspection) that are expired' }}

{{ app()->getLocale() == 'ar' ? 'أحدث الاستفسارات' : 'Recent Inquiries' }}

{{ app()->getLocale() == 'ar' ? 'عرض الكل' : 'View All' }}
@forelse($latest_inquiries as $inquiry)
{{ $inquiry->customer->name }} {{ $inquiry->created_at->diffForHumans() }}
{{ app()->getLocale() == 'ar' ? 'سيارة' : 'Car' }}: {{ $inquiry->car->title }}
{{ $inquiry->status }}
@empty
{{ app()->getLocale() == 'ar' ? 'لا توجد استفسارات جديدة.' : 'No new inquiries found.' }}
@endforelse

📊 {{ app()->getLocale() == 'ar' ? 'توزيع الماركات' : 'Brands Distribution' }}

@if($brands_distribution->sum('cars_count') == 0)
{{ app()->getLocale() == 'ar' ? 'لا توجد بيانات' : 'No data' }}
@endif

🔍 {{ app()->getLocale() == 'ar' ? 'أكثر الماركات استفساراً' : 'Top Inquiries' }}

@if($inquiries_by_brand->sum('count') == 0)
{{ app()->getLocale() == 'ar' ? 'لا توجد بيانات' : 'No data' }}
@endif

⭐ {{ app()->getLocale() == 'ar' ? 'أداء الماركات' : 'Brand Performance' }}

@if($performance_by_brand->sum('count') == 0)
{{ app()->getLocale() == 'ar' ? 'لا توجد بيانات' : 'No data' }}
@endif
@push('scripts') @endpush @endsection