@extends('admin.layouts.app') @section('title', 'Enhanced Dashboard') @section('breadcrumb') @endsection @section('page-header')

{{ __('Dashboard') }}

{{ __('Welcome back') }}, {{ Auth::guard('admin')->user()->name }}! 👋

@endsection @section('content') {{-- System Alerts --}} @if(isset($alerts) && count($alerts) > 0)
@foreach($alerts as $alert) @endforeach
@endif {{-- Main Statistics Cards --}}
{{-- Revenue Card --}}

{{ number_format($stats['total_revenue'] ?? 0, 2) }}

{{ __('Total Revenue (SAR)') }}

{{ __('Today') }}: {{ number_format($stats['today_revenue'] ?? 0, 2) }} SAR
{{ number_format(abs($stats['revenue_growth'] ?? 0), 1) }}% {{ __('from last month') }}
{{-- Orders Card --}}

{{ $stats['total_orders'] ?? 0 }}

{{ __('Total Orders') }}

{{ __('Pending') }}: {{ $stats['pending_orders'] ?? 0 }} | {{ __('Today') }}: {{ $stats['today_orders'] ?? 0 }}
{{ number_format(abs($stats['orders_growth'] ?? 0), 1) }}% {{ __('from last month') }}
{{-- Products Card --}}

{{ $stats['total_products'] ?? 0 }}

{{ __('Total Products') }}

{{ $stats['active_products'] ?? 0 }} {{ __('active') }} | {{ $stats['inactive_products'] ?? 0 }} {{ __('inactive') }}
{{-- Customers Card --}}

{{ $stats['total_users'] ?? 0 }}

{{ __('Total Customers') }}

{{ __('Categories') }}: {{ $stats['total_categories'] ?? 0 }}
{{ __('Growing steadily') }}
{{-- Performance Metrics Row --}} @if(isset($performanceMetrics))

{{ number_format($performanceMetrics['conversion_rate'], 1) }}%

{{ __('Conversion Rate') }}

{{ number_format($performanceMetrics['average_order_value'], 2) }}

{{ __('Avg Order Value (SAR)') }}

{{ $performanceMetrics['repeat_customers'] }}

{{ __('Repeat Customers') }}

{{ $stats['low_stock_products'] ?? 0 }}

{{ __('Low Stock Items') }}

@endif
{{-- Sales Analytics Chart --}}
{{ __('Sales Analytics') }}
{{-- Popular Products --}}
{{ __('Popular Products') }}
@if(isset($popularProducts) && count($popularProducts) > 0) @foreach($popularProducts as $product) @endforeach @else

{{ __('No sales data available') }}

@endif
{{-- Recent Orders --}}
{{ __('Recent Orders') }}
{{ __('View All') }}
@if(isset($recentOrders) && count($recentOrders) > 0)
@foreach($recentOrders as $order) @endforeach
{{ __('Order') }} {{ __('Customer') }} {{ __('Amount') }} {{ __('Status') }} {{ __('Date') }}
{{ $order->order_number }} {{ $order->customer_name }} {{ number_format($order->total_amount, 2) }} SAR {{ ucfirst($order->status) }} {{ $order->created_at->diffForHumans() }}
@else

{{ __('No recent orders') }}

@endif
{{-- Quick Actions --}}
{{ __('Quick Actions') }}

{{ __('System Status') }}
{{ __('Environment') }} {{ ucfirst(app()->environment()) }}
{{ __('Debug Mode') }} {{ config('app.debug') ? __('Enabled') : __('Disabled') }}
@endsection @push('styles') @endpush @push('scripts') @endpush