@extends('layouts.app') @section('title', __('Dashboard')) @section('page-title', __('Dashboard')) @section('content') {{-- Stats Cards --}}
@php $cards = [ ['label' => __('Total Families'), 'value' => number_format($stats['total_families'] ?? 0), 'icon' => 'M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z', 'color' => 'blue'], ['label' => __('Active Cards'), 'value' => number_format($stats['active_cards'] ?? 0), 'icon' => 'M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z', 'color' => 'green'], ['label' => __('Pending Approvals'), 'value' => number_format($stats['pending_approval'] ?? 0), 'icon' => 'M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z', 'color' => 'yellow'], ['label' => __('Open Grievances'), 'value' => number_format($stats['open_grievances'] ?? 0), 'icon' => 'M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4', 'color' => 'red'], ]; @endphp @foreach($cards as $card)

{{ $card['label'] }}

{{ $card['value'] }}

@endforeach
{{-- Quantile Distribution --}}

{{ __('Quantile Distribution') }}

@php $quantileColors = [ 'ultra_poor' => 'red', 'poor' => 'orange', 'at_risk_lower' => 'yellow', 'lower_middle' => 'blue', 'middle' => 'green', 'upper' => 'gray', ]; $quantileLabels = [ 'ultra_poor' => __('Ultra Poor'), 'poor' => __('Poor'), 'at_risk_lower' => __('At Risk (Lower)'), 'lower_middle' => __('Lower Middle'), 'middle' => __('Middle'), 'upper' => __('Upper'), ]; $totalQuantile = collect($quantileDistribution)->sum('count'); @endphp @foreach($quantileDistribution as $q) @php $pct = $totalQuantile > 0 ? round(($q->count / $totalQuantile) * 100) : 0; $color = $quantileColors[$q->quantile] ?? 'gray'; @endphp
{{ $quantileLabels[$q->quantile] ?? $q->quantile }} {{ $q->count }} ({{ $pct }}%)
@endforeach
{{-- Monthly Trend --}}

{{ __('Monthly Registration Trend') }}

@if(count($monthlyTrend) > 0)
@php $maxCount = collect($monthlyTrend)->max('count') ?: 1; @endphp @foreach($monthlyTrend as $month) @php $pct = round(($month->count / $maxCount) * 100); @endphp
{{ $month->month }}
{{ $month->count }}
@endforeach
@else

{{ __('No results found') }}

@endif
{{-- Division Summary --}}

{{ __('Division Summary') }}

@forelse($divisionSummary as $div) @empty @endforelse
{{ __('Division') }} {{ __('Total Families') }} {{ __('Active') }} {{ __('Pending') }}
{{ $div->name }} {{ number_format($div->total ?? 0) }} {{ number_format($div->active ?? 0) }} {{ number_format($div->pending ?? 0) }}
{{ __('No results found') }}
@endsection