@extends('layouts.app') @section('title', $title ?? 'Report') @section('content')

{{ $title }}

@if (!empty($subtitle))
{{ $subtitle }}
@endif
{{-- Common filter bar --}}
@if (in_array($report, ['premium-collection','premium-due','utilization','department-utilization','high-utilizers','pool-performance']))
@endif @if ($report === 'premium-collection' || $report === 'premium-due')
@endif
{{-- Results --}}
@if (empty($columns) || empty($rows))
No data for the selected filters.
@else
@foreach ($columns as $col) @endforeach @foreach ($rows as $row) @foreach ($columns as $key => $label) @php $field = is_string($key) ? $key : strtolower(str_replace(' ', '_', $label)); $val = is_array($row) ? ($row[$field] ?? '—') : ($row->$field ?? '—'); @endphp @endforeach @endforeach @if (!empty($totals)) @foreach ($columns as $key => $label) @php $field = is_string($key) ? $key : strtolower(str_replace(' ', '_', $label)); @endphp @endforeach @endif
{{ $col }}
{{ is_numeric($val) ? number_format($val, str_contains((string) $val, '.') ? 2 : 0) : $val }}
{{ $totals[$field] ?? '' }}
@endif
@if (!empty($notes))
{{ $notes }}
@endif
@endsection