@extends('layouts.app') @push('styles') @endpush @section('content')

{{ app()->getLocale() == 'ar' ? 'تحليل أداء الأسطول' : 'Fleet Analytics' }}

{{ app()->getLocale() == 'ar' ? 'مركز القرارات الذكي' : 'Smart Decision Center' }}

{{ app()->getLocale() == 'ar' ? 'بناءً على تحليل الفترة الحالية والمقارنة السابقة' : 'Based on current period vs previous comparison' }}
@foreach([ ['label' => 'نمو الإيرادات', 'en' => 'Revenue Growth', 'key' => 'revenue_growth', 'format' => 'currency'], ['label' => 'معدل الإشغال', 'en' => 'Occupancy Rate', 'key' => 'occupancy_rate', 'format' => 'percent'], ['label' => 'صافي الربح', 'en' => 'Net Profit', 'key' => 'net_profit', 'format' => 'currency'], ['label' => 'ربح كل سيارة', 'en' => 'Avg Profit/Car', 'key' => 'avg_profit_per_car', 'format' => 'currency'] ] as $kpi) @php $data = $decisionCenter['kpis'][$kpi['key']]; @endphp
{{ app()->getLocale() == 'ar' ? $kpi['label'] : $kpi['en'] }}
{{ $kpi['format'] == 'currency' ? number_format($data['value'], 0) . ' SAR' : round($data['value'], 1) . '%' }}
{{ $data['percent'] >= 0 ? '↑' : '↓' }} {{ abs($data['percent']) }}% (vs prev)
@endforeach
@foreach($decisionCenter['alerts'] as $alert)

{{ $alert['title'] }}

{{ $alert['count'] }}

{{ $alert['description'] }}

{{ app()->getLocale() == 'ar' ? 'عرض التفاصيل' : 'View Details' }}
@endforeach
{{ app()->getLocale() == 'ar' ? 'مؤشر صحة الأسطول' : 'Fleet Health Score' }}
{{ $decisionCenter['health_score'] }}%
@if($decisionCenter['health_score'] >= 80) ممتاز @elseif($decisionCenter['health_score'] >= 60) متوسط @else يحتاج تدخل @endif

{{ app()->getLocale() == 'ar' ? 'توصيات ذكية' : 'Smart Recommendations' }}

    @foreach($decisionCenter['recommendations'] as $rec)
  • {{ $rec }}
  • @endforeach
{{ app()->getLocale() == 'ar' ? 'متوسط الإشغال' : 'Avg Occupancy' }}
{{ $analytics['summary']['avg_occupancy_rate'] }}%
{{ app()->getLocale() == 'ar' ? 'السيارات النشطة' : 'Active Cars' }}
{{ $analytics['summary']['active_cars'] }}
{{ app()->getLocale() == 'ar' ? 'السيارات الواقفة' : 'Idle Cars' }}
{{ $analytics['summary']['idle_cars'] }}
{{ app()->getLocale() == 'ar' ? 'الربح التشغيلي' : 'Operating Profit' }}
{{ number_format($analytics['summary']['total_profit'], 0) }} SAR
{{ app()->getLocale() == 'ar' ? 'إجمالي الإهلاك' : 'Total Depreciation' }}
{{ number_format($analytics['summary']['total_depreciation'], 0) }} SAR
{{ app()->getLocale() == 'ar' ? 'الربح المحاسبي' : 'Accounting Profit' }}
{{ number_format($analytics['summary']['total_profit_after_depreciation'], 0) }} SAR
{{ app()->getLocale() == 'ar' ? 'متوسط ROI المحاسبي' : 'Avg Accounting ROI' }}
{{ $analytics['summary']['avg_accounting_roi'] }}%
@if($analytics['summary']['best_car'] && $analytics['summary']['worst_car'])

🏆 {{ app()->getLocale() == 'ar' ? 'أفضل سيارة ربحاً' : 'Best Profitable Car' }}

{{ $analytics['summary']['best_car']['title'] }}
{{ $analytics['summary']['best_car']['plate_number'] }}
{{ app()->getLocale() == 'ar' ? 'الربح:' : 'Profit:' }} {{ number_format($analytics['summary']['best_car']['profit'], 2) }} SAR
{{ app()->getLocale() == 'ar' ? 'الإشغال:' : 'Occupancy:' }} {{ $analytics['summary']['best_car']['occupancy_rate'] }}%
{{ app()->getLocale() == 'ar' ? 'الحالة:' : 'Status:' }} {{ $analytics['summary']['best_car']['occupancy_status'] }}

📉 {{ app()->getLocale() == 'ar' ? 'أسوأ سيارة ربحاً' : 'Worst Profitable Car' }}

{{ $analytics['summary']['worst_car']['title'] }}
{{ $analytics['summary']['worst_car']['plate_number'] }}
{{ app()->getLocale() == 'ar' ? 'الربح:' : 'Profit:' }} {{ number_format($analytics['summary']['worst_car']['profit'], 2) }} SAR
{{ app()->getLocale() == 'ar' ? 'الإشغال:' : 'Occupancy:' }} {{ $analytics['summary']['worst_car']['occupancy_rate'] }}%
{{ app()->getLocale() == 'ar' ? 'الحالة:' : 'Status:' }} {{ $analytics['summary']['worst_car']['occupancy_status'] }}
@endif

📊 {{ app()->getLocale() == 'ar' ? 'الرسوم البيانية والإحصائيات' : 'Charts & Analytics' }}

📊 {{ app()->getLocale() == 'ar' ? 'توزيع نسبة الإشغال' : 'Occupancy Distribution' }}

📋 {{ app()->getLocale() == 'ar' ? 'حالة العقود' : 'Contracts Status' }}

🚗 {{ app()->getLocale() == 'ar' ? 'حالة السيارات' : 'Cars Status' }}

💰 {{ app()->getLocale() == 'ar' ? 'الإيرادات والمصاريف' : 'Revenue vs Expenses' }}

📊 {{ app()->getLocale() == 'ar' ? 'تفاصيل أداء الأسطول' : 'Fleet Performance Details' }}

@foreach($analytics['cars'] as $car) @endforeach
{{ app()->getLocale() == 'ar' ? 'السيارة' : 'Car' }} {{ app()->getLocale() == 'ar' ? 'الإشغال' : 'Occupancy' }} {{ app()->getLocale() == 'ar' ? 'الإيراد' : 'Revenue' }} {{ app()->getLocale() == 'ar' ? 'المصاريف' : 'OpEx' }} {{ app()->getLocale() == 'ar' ? 'الإهلاك' : 'Depr.' }} {{ app()->getLocale() == 'ar' ? 'الربح المحاسبي' : 'Acc. Profit' }} {{ app()->getLocale() == 'ar' ? 'القيمة الدفترية' : 'Book Value' }} {{ app()->getLocale() == 'ar' ? 'ROI' : 'ROI' }} {{ app()->getLocale() == 'ar' ? 'الحالة' : 'Status' }}
{{ $car['title'] }}
{{ $car['plate_number'] }}
{{ $car['occupancy_rate'] }}%
{{ $car['rental_days'] }} يوم
{{ number_format($car['revenue'], 0) }} {{ number_format($car['expenses'] + $car['maintenance'], 0) }} {{ number_format($car['depreciation'], 0) }} {{ number_format($car['profit_after_depreciation'], 0) }} {{ number_format($car['book_value'], 0) }} {{ $car['accounting_roi'] }}% {{ $car['investment_status']['label'] }}

📋 {{ app()->getLocale() == 'ar' ? 'تحليل العقود' : 'Contracts Analysis' }}

{{ app()->getLocale() == 'ar' ? 'إجمالي العقود' : 'Total Contracts' }}
{{ $analytics['contracts']['total'] }}
{{ app()->getLocale() == 'ar' ? 'المكتملة' : 'Completed' }}
{{ $analytics['contracts']['completed'] }}
{{ app()->getLocale() == 'ar' ? 'غير مكتملة' : 'Incomplete' }}
{{ $analytics['contracts']['incomplete'] }}
{{ app()->getLocale() == 'ar' ? 'المتأخرة' : 'Overdue' }}
{{ $analytics['contracts']['overdue'] }}
@if($analytics['customers']['overdue_count'] > 0)

⚠️ {{ app()->getLocale() == 'ar' ? 'العملاء المتأخرون' : 'Overdue Customers' }} ({{ $analytics['customers']['overdue_count'] }})

@foreach($analytics['customers']['overdue_customers'] as $customer) @endforeach
{{ app()->getLocale() == 'ar' ? 'الاسم' : 'Name' }} {{ app()->getLocale() == 'ar' ? 'الهاتف' : 'Phone' }} {{ app()->getLocale() == 'ar' ? 'المبلغ المتأخر' : 'Overdue Amount' }} {{ app()->getLocale() == 'ar' ? 'أيام التأخير' : 'Delay Days' }}
{{ $customer['name'] }} {{ $customer['phone'] }} {{ number_format($customer['overdue_amount'], 2) }} SAR {{ $customer['delay_days'] }} {{ app()->getLocale() == 'ar' ? 'يوم' : 'days' }}
@endif

🔧 {{ app()->getLocale() == 'ar' ? 'تحليل الصيانة والأسطول' : 'Maintenance & Fleet Analytics' }}

{{ app()->getLocale() == 'ar' ? 'إجمالي السيارات' : 'Total Cars' }}
{{ $analytics['maintenance']['total_cars'] }}
{{ app()->getLocale() == 'ar' ? 'السيارات المؤجرة' : 'Rented' }}
{{ $analytics['maintenance']['rented_cars'] }}
{{ app()->getLocale() == 'ar' ? 'غير المؤجرة' : 'Non-Rented' }}
{{ $analytics['maintenance']['non_rented_cars'] }}
{{ app()->getLocale() == 'ar' ? 'تحت الصيانة' : 'Maintenance' }}
{{ $analytics['maintenance']['cars_in_maintenance'] }}
📄 {{ app()->getLocale() == 'ar' ? 'تقرير مفصل' : 'Detailed Report' }}
@endsection