@extends('layouts.panel') @section('title', 'Dashboard') @section('content') @php $statusBadgeClasses = [ 'received' => 'bg-primary-subtle text-primary', 'washing' => 'bg-info-subtle text-info', 'drying' => 'bg-info-subtle text-info', 'folding' => 'bg-warning-subtle text-warning', 'bagging' => 'bg-warning-subtle text-warning', 'ready' => 'bg-success-subtle text-success', 'dispatched' => 'bg-secondary-subtle text-secondary', ]; @endphp {{-- ===== KPI Cards ===== --}}
Pedidos activos

{{ $stats['active_orders'] }}

@if (is_null($stats['active_orders_trend'])) Sin datos previos @else {{ abs($stats['active_orders_trend']) }}% vs semana pasada @endif
Kilos lavados (mes)

{{ number_format($stats['kilos_month'], 0, ',', '.') }} kg

@if (is_null($stats['kilos_trend'])) Sin datos previos @else {{ abs($stats['kilos_trend']) }}% vs mes pasado @endif
Retiros pendientes

{{ $stats['pending_pickups'] }}

@php $diff = $stats['pending_pickups_diff']; @endphp @if ($diff == 0) Sin cambios desde ayer @else {{ abs($diff) }} {{ $diff < 0 ? 'menos' : 'más' }} que ayer @endif
Ingresos (mes)

${{ number_format($stats['revenue_month'], 0, ',', '.') }}

@if (is_null($stats['revenue_trend'])) Sin datos previos @else {{ abs($stats['revenue_trend']) }}% vs mes pasado @endif
{{-- ===== Monitor operativo ===== --}}
Pendientes

{{ $monitor['pending'] }}

Recibidos, sin iniciar
En proceso

{{ $monitor['in_process'] }}

Lavando → Listo para entrega
Entregados

{{ $monitor['delivered'] }}

Histórico total
Kilos procesados (mes)

{{ number_format($monitor['kilos_processed_month'], 0, ',', '.') }} kg

Según Registro Diario
Producción diaria
Últimos 14 días · kilos lavados
Pendientes más antiguos
@forelse ($oldestPending as $order)
{{ $order->order_code }}
{{ $order->client->business_name ?: $order->client->contact_name }}
{{ $order->created_at->diffForHumans() }}
@empty

No hay pedidos pendientes.

@endforelse
{{-- ===== Charts ===== --}}
Kilos lavados por semana
Últimas 8 semanas
Pedidos por línea
Este mes
@if (array_sum($lineData) > 0)
@else

Aún no hay pedidos este mes.

@endif
Estado de pedidos
Actual
@if (array_sum($statusData) > 0)
@else

Aún no hay pedidos registrados.

@endif
Últimos pedidos
Actividad reciente
@forelse ($recentOrders as $order) @empty @endforelse
Código Cliente Línea Estado
{{ $order->order_code }} {{ $order->client ? ($order->client->business_name ?: $order->client->contact_name) : 'General' }} {{ $order->serviceLineLabel() }} {{ $order->statusLabel() }}
Aún no hay pedidos registrados.
@endsection @push('styles') @endpush @push('scripts') @endpush