{{ __('Reports and Analytics') }}

{{ __('Time range:') }}
@if(isset($chartData['months']))
{{-- Project progress chart --}}

{{ __('Project Progress (last 6 months)') }}

{{-- Inspections by type chart --}}

{{ __('Inspections by Type') }}

{{-- Projects by status chart --}}

{{ __('Projects by Status') }}

{{-- Average progress by project chart --}}

{{ __('Average Progress by Project') }}

{{-- Key metrics cards --}}
{{ __('Total Active Projects') }}
{{ \App\Models\Project::where('status', 'in_progress')->count() }}
{{ __('Inspections This Month') }}
{{ \App\Models\Inspection::whereDate('created_at', '>=', now()->startOfMonth())->count() }}
{{ __('Average Progress') }}
@php $avgProgress = \App\Models\Phase::whereNotNull('progress_percent') ->avg('progress_percent') ?? 0; @endphp {{ number_format($avgProgress, 1) }}%
{{ __('Completed Projects') }}
{{ \App\Models\Project::where('status', 'completed')->count() }}
@else

{{ __('Loading data...') }}

@endif