@php // Los conteos ahora vienen centralizados desde el controlador en la variable $kpis $recurrenciasCount = $kpis['recurrencias'] ?? 0; $hoyCount = $kpis['hoy'] ?? 0; $entregadosHoyCount = $kpis['entregado'] ?? 0; $atrasadosCount = $kpis['atrasado'] ?? 0; $agendadosCount = $kpis['agendado'] ?? 0; $topStats = [ 'total' => ['label' => 'Total Histórico', 'count' => $kpis['total'] ?? 0, 'color' => 'slate', 'gradient' => 'from-slate-500 to-slate-700', 'icon' => 'M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10', 'action' => true], 'recurrencias' => ['label' => 'Recurrencias', 'count' => $recurrenciasCount, 'color' => 'indigo', 'gradient' => 'from-indigo-500 to-indigo-700', 'icon' => 'M13 10V3L4 14h7v7l9-11h-7z', 'action' => 'hub'], 'hoy' => ['label' => 'Pedidos Hoy', 'count' => $hoyCount, 'color' => 'blue', 'gradient' => 'from-blue-500 to-blue-700', 'icon' => 'M12 8v4l3 3', 'action' => true], 'entregado' => ['label' => 'Entregados Hoy', 'count' => $entregadosHoyCount, 'color' => 'emerald', 'gradient' => 'from-emerald-500 to-emerald-700', 'icon' => 'M9 12l2 2 4-4', 'action' => true], 'agendado' => ['label' => 'Agendados', 'count' => $agendadosCount, 'color' => 'violet', 'gradient' => 'from-violet-500 to-violet-700', 'icon' => 'M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z', 'action' => true], 'atrasado' => ['label' => 'Atrasados', 'count' => $atrasadosCount, 'color' => 'rose', 'gradient' => 'from-rose-500 to-rose-700', 'icon' => 'M12 8v4l3 3', 'action' => true], ]; $statusStats = [ 'borrador' => ['label' => 'Borradores', 'color' => 'slate', 'icon' => 'M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z'], 'atencion_requerida' => ['label' => 'Atención', 'color' => 'rose', 'icon' => 'M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z'], 'pendiente' => ['label' => 'Sin Confirmar', 'color' => 'indigo', 'icon' => 'M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z'], 'confirmado' => ['label' => 'Confirmados', 'color' => 'blue', 'icon' => 'M5 13l4 4L19 7'], 'en_empaque' => ['label' => 'En Empaque', 'color' => 'amber', 'icon' => 'M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4'], 'en_ruta' => ['label' => 'En Ruta', 'color' => 'orange', 'icon' => 'M9 17a2 2 0 11-4 0 2 2 0 014 0zM19 17a2 2 0 11-4 0 2 2 0 014 0z'], 'cancelado' => ['label' => 'Cancelados', 'color' => 'rose', 'icon' => 'M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636'], ]; @endphp
@foreach($topStats as $key => $stat) @php $colors = [ 'slate' => ['text' => 'text-slate-600', 'bg' => 'bg-slate-50', 'icon' => 'text-slate-500'], 'indigo' => ['text' => 'text-indigo-600', 'bg' => 'bg-indigo-50', 'icon' => 'text-indigo-500'], 'emerald' => ['text' => 'text-emerald-600', 'bg' => 'bg-emerald-50', 'icon' => 'text-emerald-500'], 'violet' => ['text' => 'text-violet-600', 'bg' => 'bg-violet-50', 'icon' => 'text-violet-500'], 'rose' => ['text' => 'text-rose-600', 'bg' => 'bg-rose-50', 'icon' => 'text-rose-500'], 'blue' => ['text' => 'text-blue-600', 'bg' => 'bg-blue-50', 'icon' => 'text-blue-500'], 'amber' => ['text' => 'text-amber-600', 'bg' => 'bg-amber-50', 'icon' => 'text-amber-500'], 'orange' => ['text' => 'text-orange-600', 'bg' => 'bg-orange-50', 'icon' => 'text-orange-500'], ]; $c = $colors[$stat['color']] ?? $colors['slate']; // Estilo especial para atrasados para resaltarlo $isAtrasado = ($key === 'atrasado'); @endphp

{{ $stat['label'] }}

@endforeach
@foreach($statusStats as $key => $stat) @php $c = $colors[$stat['color']] ?? $colors['slate']; @endphp

{{ $stat['label'] }}

@endforeach