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

{{ app()->getLocale() == 'ar' ? 'لوحة التحكم العامة' : 'General Dashboard' }}

{{ app()->getLocale() == 'ar' ? 'نظرة شاملة على العمليات والأسطول' : 'Comprehensive view of operations & 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 || $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
@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' ? 'إجمالي الأسطول' : 'Total Fleet' }}
{{ $stats['total_cars'] }}
{{ app()->getLocale() == 'ar' ? 'إجمالي عدد السيارات المسجلة في النظام والتابعة للفروع المحددة' : 'Total number of registered vehicles across selected branches' }}
{{ 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' ? 'آخر طلبات الاستفسار' : 'Latest Inquiries' }}

{{ app()->getLocale() == 'ar' ? 'عرض الكل' : 'View All' }} →
@foreach($latest_inquiries as $inquiry) @endforeach
{{ app()->getLocale() == 'ar' ? 'العميل' : 'Customer' }} {{ app()->getLocale() == 'ar' ? 'السيارة' : 'Vehicle' }} {{ app()->getLocale() == 'ar' ? 'الحالة' : 'Status' }} {{ app()->getLocale() == 'ar' ? 'التاريخ' : 'Date' }}
{{ $inquiry->customer->name }}
{{ $inquiry->customer->phone }}
{{ $inquiry->car->title }}
{{ $inquiry->car->plate_number }}
{{ $inquiry->status }} {{ $inquiry->created_at->format('d M Y') }}

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

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