@extends('admin.layout.master') @section('css') @endsection @section('content') {{-- ══════════════════════════════════════════════════════════════ Hero / Welcome Banner ══════════════════════════════════════════════════════════════ --}}

{{ __('admin.welcome') }}, {{ auth('admin')->user()->name }}

{{ __('routes.main_page') }}

{{ now()->locale(app()->getLocale())->translatedFormat('l، d F Y') }}

@if(($kpis['pending_providers'] ?? 0) > 0) @haspermission('admin.providers.index') {{ $kpis['pending_providers'] }} {{ __('admin.pending_providers') }} @endhaspermission @endif @if(($kpis['pending_settlements'] ?? 0) > 0) @haspermission('admin.settlements.index') {{ $kpis['pending_settlements'] }} {{ __('admin.pending_settlements') }} @endhaspermission @endif
{{-- ══════════════════════════════════════════════════════════════ Today KPI cards ══════════════════════════════════════════════════════════════ --}}

{{ __('admin.today') }}

{{-- Clients --}}
@haspermission('admin.clients.index') @endif
{{ __('admin.clients') }}
{{ number_format($kpis['total_clients'] ?? 0) }}
@if(($kpis['new_clients_today'] ?? 0) > 0) +{{ $kpis['new_clients_today'] }} {{ __('admin.today') }} @else {{ __('admin.today') }} @endif
@haspermission('admin.clients.index')
@endif
{{-- Rides today --}}
@php $ridesPct = $kpis['rides_today_change_pct'] ?? 0; @endphp @haspermission('admin.rides.index') @endif
{{ __('admin.rides_today') }}
{{ number_format($kpis['rides_today'] ?? 0) }}
@if($ridesPct > 0) +{{ $ridesPct }}% @elseif($ridesPct < 0) {{ $ridesPct }}% @else @endif {{ __('admin.vs_yesterday') }}
@haspermission('admin.rides.index')
@endif
{{-- Revenue today --}}
@php $revPct = $kpis['revenue_change_pct'] ?? 0; @endphp @haspermission('admin.rides.index') @endif
{{ __('admin.revenue_today') }}
{{ number_format($kpis['revenue_today'] ?? 0, 2) }} {{ __('admin.sar') }}
@if($revPct > 0) +{{ $revPct }}% @elseif($revPct < 0) {{ $revPct }}% @else @endif {{ __('admin.vs_yesterday') }}
@haspermission('admin.rides.index')
@endif
{{-- Active scooters --}}
@php $totalSc = $kpis['total_scooters'] ?? 0; $activeSc = $kpis['active_scooters'] ?? 0; $activeRate = $totalSc > 0 ? round(($activeSc / $totalSc) * 100) : 0; @endphp @haspermission('admin.scooters.index') @endif
{{ __('admin.active_scooters') }}
{{ $activeSc }} / {{ $totalSc }}
{{ $activeRate }}% {{ __('admin.active') }}
@haspermission('admin.scooters.index')
@endif
{{-- ══════════════════════════════════════════════════════════════ Overview / Totals row ══════════════════════════════════════════════════════════════ --}}

{{ __('admin.overview_statistics') }}

{{-- Providers --}}
{{ __('admin.providers') }}
{{ number_format($kpis['total_providers'] ?? 0) }}
@if(($kpis['pending_providers'] ?? 0) > 0) {{ $kpis['pending_providers'] }} {{ __('admin.pending') }} @endif
{{-- Total rides --}}
{{ __('admin.rides') }}
{{ number_format($kpis['total_rides'] ?? 0) }}
{{ number_format($kpis['rides_this_month'] ?? 0) }} {{ __('admin.month') }}
{{-- Total revenue --}}
{{ __('admin.total_revenue') }}
{{ number_format($kpis['total_revenue'] ?? 0, 2) }}
{{ number_format($kpis['revenue_this_month'] ?? 0, 2) }} {{ __('admin.sar') }} {{ __('admin.month') }}
{{-- Pending settlements --}}
{{ __('admin.settlements') }}
{{ $kpis['pending_settlements'] ?? 0 }}
{{ __('admin.pending') }}
{{-- ══════════════════════════════════════════════════════════════ Ride & support metrics ══════════════════════════════════════════════════════════════ --}}

{{ __('admin.additional_statistics') }}

{{ __('admin.completed_rides_today') }}
{{ number_format($kpis['completed_rides_today'] ?? 0) }}
{{ __('admin.today') }}
{{ __('admin.active_rides_now') }}
{{ number_format($kpis['active_rides'] ?? 0) }}
{{ __('admin.in_progress') }}
{{ __('admin.avg_ride_cost') }}
{{ number_format($kpis['avg_ride_cost'] ?? 0, 2) }} {{ __('admin.sar') }}
{{ __('admin.completed') }}
{{ __('admin.open_complaints') }}
{{ number_format($kpis['open_complaints'] ?? 0) }}
{{ __('admin.pending') }}
{{-- ══════════════════════════════════════════════════════════════ Quick Actions ══════════════════════════════════════════════════════════════ --}} @if(!empty($quickActions))

{{ __('admin.quick_actions') }}

@php $actionColors = ['ib-yellow', 'ib-orange', 'ib-purple', 'ib-teal']; $ai = 0; @endphp @foreach($quickActions as $action)
{{ $action['label'] }}
{{ number_format($action['count'] ?? 0) }} {{ __('admin.total_amount') }}
@if(($action['count'] ?? 0) > 0) {{ $action['count'] }} @endif
@php $ai++; @endphp @endforeach
@endif {{-- ══════════════════════════════════════════════════════════════ Charts row — monthly performance & fleet ══════════════════════════════════════════════════════════════ --}}

{{ __('admin.financial_statistics') }}

{{ __('admin.monthly_performance') }}
{{ __('admin.revenue') }} ({{ __('admin.sar') }}) {{ __('admin.rides') }}
{{ __('admin.scooter_status_chart') }}
{{-- ══════════════════════════════════════════════════════════════ Charts row — daily activity & ride status ══════════════════════════════════════════════════════════════ --}}

{{ __('admin.recent_activity') }}

{{ __('admin.daily_activity') }}
{{ __('admin.last_14_days') }}
{{ __('admin.ride_status_chart') }}
{{-- ══════════════════════════════════════════════════════════════ Charts row — user growth ══════════════════════════════════════════════════════════════ --}}

{{ __('admin.users_statistics') }}

{{ __('admin.user_growth') }}
{{ __('admin.clients') }} {{ __('admin.providers') }}
{{-- ══════════════════════════════════════════════════════════════ Legacy menu cards (only shown if non-empty) ══════════════════════════════════════════════════════════════ --}} @if(count($menus ?? []) > 0)

{{ __('admin.dashboard') }}

@foreach($menus as $key => $menu) @php $color = $colores[array_rand($colores)] @endphp

{{ $menu['count'] ?? '' }}

{{ $menu['name'] }}

@endforeach
@endif @endsection @section('js') @endsection