@extends('admin.layout') @section('title', 'Dashboard') @section('content') {{-- ── STAT CARDS ── --}}
@php $statCards = [ [ 'label' => 'Total Orders', 'value' => number_format($stats['total_orders']), 'sub' => 'All time', 'icon' => 'shopping-bag', 'color' => '#10b981', 'bg' => 'rgba(16,185,129,0.12)', ], [ 'label' => 'Items Sold Today', 'value' => number_format($stats['items_sold_today']), 'sub' => $stats['today_orders'] . ' orders today', 'icon' => 'shopping-bag', 'color' => '#6366f1', 'bg' => 'rgba(99,102,241,0.12)', ], [ 'label' => 'Pending', 'value' => $stats['pending_orders'], 'sub' => 'Awaiting action', 'icon' => 'hourglass', 'color' => '#f59e0b', 'bg' => 'rgba(245,158,11,0.12)', ], [ 'label' => 'Today\'s Revenue', 'value' => '₱' . number_format($stats['today_revenue']), 'sub' => 'From delivered orders', 'icon' => 'trending-up', 'color' => '#22c55e', 'bg' => 'rgba(34,197,94,0.12)', ], [ 'label' => 'Total Revenue', 'value' => '₱' . number_format($stats['total_revenue']), 'sub' => 'All delivered orders', 'icon' => 'banknote', 'color' => '#facc15', 'bg' => 'rgba(250,204,21,0.12)', ], [ 'label' => 'Customers', 'value' => $stats['total_customers'], 'sub' => 'Registered users', 'icon' => 'users', 'color' => '#a78bfa', 'bg' => 'rgba(167,139,250,0.12)', ], [ 'label' => 'Active Riders', 'value' => $stats['active_riders'] . ' / ' . $stats['rider_users'], 'sub' => 'Online right now', 'icon' => 'bike', 'color' => '#2563eb', 'bg' => 'rgba(37,99,235,0.12)', ], [ 'label' => 'Menu Items', 'value' => $stats['total_items'], 'sub' => $stats['total_categories'] . ' categories', 'icon' => 'utensils', 'color' => '#f97316', 'bg' => 'rgba(249,115,22,0.12)', ], [ 'label' => 'Featured Items', 'value' => $stats['featured_items'], 'sub' => 'Highlighted on menu', 'icon' => 'star', 'color' => '#eab308', 'bg' => 'rgba(234,179,8,0.12)', ], [ 'label' => 'Staff', 'value' => $stats['admin_users'] + $stats['chef_users'] + $stats['rider_users'], 'sub' => $stats['chef_users'] . ' chefs · ' . $stats['rider_users'] . ' riders', 'icon' => 'shield-check', 'color' => '#dc2626', 'bg' => 'rgba(220,38,38,0.10)', ], ]; @endphp @foreach($statCards as $s)

{{ $s['label'] }}

{{ $s['value'] }}

{{ $s['sub'] }}

@endforeach
{{-- ── MIDDLE ROW ── --}}
{{-- Top Selling Items --}}

Top Selling Items Today

View orders →
@php $maxSold = collect($topItems)->max('total_sold') ?: 1; @endphp @forelse($topItems as $i => $item)
{{ $i+1 }}
{{ $item['name'] }} {{ number_format($item['total_sold']) }} sold
@empty
No sales data yet.
@endforelse
{{-- Recent Users --}}

Recent Users

View all →
@forelse($recent_users as $user) @empty @endforelse
NameEmailRoleJoined
@if($user->avatar) @else
{{ strtoupper(substr($user->name,0,1)) }}
@endif {{ $user->name }}
{{ $user->email }} {{ $user->role ?? 'user' }} {{ $user->created_at->format('M d, Y') }}
No users yet.
{{-- ── QUICK ACTIONS ── --}}

Quick Actions

@php $actions = [ ['href'=>route('admin.users'), 'icon'=>'users', 'label'=>'Manage Users', 'color'=>'#6366f1','bg'=>'rgba(99,102,241,.10)'], ['href'=>route('admin.menu-items'), 'icon'=>'utensils', 'label'=>'Menu Items', 'color'=>'#f59e0b','bg'=>'rgba(245,158,11,.10)'], ['href'=>route('admin.orders'), 'icon'=>'shopping-bag', 'label'=>'View Orders', 'color'=>'#10b981','bg'=>'rgba(16,185,129,.10)'], ['href'=>route('admin.settings'), 'icon'=>'settings-2', 'label'=>'Settings', 'color'=>'#94a3b8','bg'=>'rgba(148,163,184,.10)'], ]; @endphp @foreach($actions as $a)
{{ $a['label'] }}
@endforeach
@endsection