@section('title', 'Dashboard') @push('styles') @endpush

Dashboard Administrativo

Período: {{ $dateRangeOptions[$dateRange] }}

Total Pedidos

{{ number_format($stats['total_orders']) }}

@if($stats['orders_growth'] != 0) {{ abs($stats['orders_growth']) }}% vs período anterior @endif
Ventas Totales

{{ format_money($stats['total_sales']) }}

@if($stats['sales_growth'] != 0) {{ abs($stats['sales_growth']) }}% vs período anterior @endif
Nuevos Clientes

{{ number_format($stats['total_customers']) }}

En el período seleccionado
Valor Promedio

{{ format_money($stats['avg_order_value']) }}

Por pedido
Resumen de Ventas - {{ $dateRangeOptions[$dateRange] }}
{{ $dateRangeOptions[$dateRange] ?? 'Este mes' }}
Total {{ $stats['total_orders'] }} Pedidos

{{ $stats['orders_growth'] >= 0 ? '+' : '' }}{{ number_format($stats['orders_growth'], 1) }}%

vs período anterior
{{ $stats['completed_orders'] }}

Completados

{{ $stats['conversion_rate'] }}% tasa conversión
{{ $stats['pending_orders'] }}

Pendientes

Requieren atención
{{ number_format($stats['total_products']) }}

Productos

En catálogo
{{ $performance['avg_delivery_time'] }} días

Tiempo Entrega

Promedio
Pedidos Pendientes
Requieren Atención

{{ $stats['pending_orders'] }}

Pendientes

Completados
Este Período

{{ $stats['completed_orders'] }}

Finalizados

Clientes Recurrentes

{{ number_format($performance['repeat_customers'], 1) }}%

Con múltiples pedidos
Tiempo Respuesta

{{ $performance['avg_response_time'] }} min

Soporte al cliente
Tasa Cancelación

{{ number_format($performance['cancellation_rate'], 1) }}%

Pedidos cancelados
Rotación Inventario

{{ format_money($performance['inventory_turnover'], 1) }}

Veces al mes
@if($alerts->count() > 0)
Alertas
@foreach($alerts as $alert)
@endforeach
@endif
Comparación de Pedidos Entregados
Mes actual vs mes anterior
{{ $monthlyComparison['current'] }}

Mes Actual

{{ now()->format('F') }}
{{ $monthlyComparison['previous'] }}

Mes Anterior

{{ now()->subMonth()->format('F') }}
@if($monthlyComparison['change'] >= 0) @else @endif {{ $monthlyComparison['change'] >= 0 ? '+' : '' }}{{ format_money($monthlyComparison['change'], 1) }}% respecto al mes anterior
@livewire('admin.real-time-notifications')
@if($topEmployee && $topEmployee->count() > 0 && $this->canShowSection('employees'))
Empleados Destacados del Año
@foreach($topEmployee as $index => $employee)
@if($index == 0)
@elseif($index == 1)
@else
@endif
{{ $employee->name }}

{{ $employee->total_deliveries }} entregas completadas

@if($index == 0)
Oro
@elseif($index == 1)
Plata
@else
Bronce
@endif
@endforeach
@endif
@if($this->canShowSection('charts'))
Tendencia de Ventas
{{ $dateRangeOptions[$dateRange] }}
{{ $salesChart->count() }} períodos
{{ format_money($salesChart->sum('sales')) }}
Ventas Totales
{{ $salesChart->sum('orders') }}
Pedidos Totales
Métodos de Pago
{{ $paymentMethods->sum('count') }} pedidos
@if($paymentMethods->count() > 0)
@foreach($paymentMethods as $method => $data)
{{ ucfirst($method) }}
{{ $data['count'] }} pedidos
{{ format_money($data['total']) }}
@endforeach
@else

No hay datos de métodos de pago

@endif
@endif
@if($this->canShowSection('metrics'))
Indicadores de Salud del Negocio
{{ $stats['completed_orders'] }}
Pedidos Completados
{{ $stats['pending_orders'] }}
Pedidos Pendientes
{{ format_money($stats['total_sales']) }}
Ventas Totales
{{ $performance['avg_delivery_time'] }} días
Tiempo Entrega
@endif
@if($this->canShowSection('performance'))
Valor Promedio

{{ format_money($performance['avg_order_value']) }}

Por pedido
Tasa Conversión

{{ format_money($performance['conversion_rate'], 1) }}%

Pedidos completados
Stock Crítico

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

Productos ≤ 5 unidades
Sin Stock

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

Productos agotados
@endif
Pedidos Recientes
Ver Todos
@forelse($recentOrders as $order) @empty @endforelse
Pedido Cliente Estado Total Fecha
#{{ $order->codigo }}
{{ $order->user->name ?? 'N/A' }} {{ $order->estado }} {{ money($order->total_usd) }} {{ $order->created_at->format('d/m/Y') }}
No hay pedidos recientes
Productos Más Vendidos
@forelse($topProducts as $index => $product)
{{ $index + 1 }}
{{ Str::limit($product->name, 25) }}
{{ $product->total_sold }} vendidos
@empty

No hay datos de productos

@endforelse
@push('scripts') @endpush