<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>{{ $title }}</title></head>
<body style="font-family:DejaVu Sans,Helvetica,Arial,sans-serif;font-size:10px;color:#111;">
<table style="width:100%;border-bottom:3px solid #b45309;margin-bottom:10px;"><tr>
<td><div style="font-size:18px;font-weight:bold;">NOWILLS SQC ERP</div>
<div style="color:#555;">Stone Quarry &amp; Construction &middot; Accra, Ghana</div></td>
<td style="text-align:right;"><div style="font-size:15px;font-weight:bold;">{{ $title }}</div>
<div style="color:#555;">{{ $from }} to {{ $to }}</div></td>
</tr></table>
<table style="width:100%;border-collapse:collapse;">
<thead><tr style="background:#1f2937;color:#fff;">
@foreach(array_keys($columns) as $label)<th style="padding:5px 6px;text-align:left;font-size:9px;">{{ $label }}</th>@endforeach
</tr></thead>
<tbody>
@foreach($rows as $ri => $row)
<tr style="background:{{ $ri % 2 ? '#f8fafc' : '#fff' }};">
@foreach(array_values((array) $row) as $ci => $cell)
<td style="padding:4px 6px;border-bottom:1px solid #e5e7eb;{{ (array_values($columns)[$ci] ?? '') === 'r' ? 'text-align:right;' : '' }}">{{ strip_tags((string) $cell) }}</td>
@endforeach
</tr>
@endforeach
</tbody>
</table>
@if(!empty($totals))
<div style="margin-top:8px;font-size:10px;color:#333;">Totals shown for: {{ implode(', ', (array) $totals) }} &middot; {{ count($rows) }} row(s)</div>
@else
<div style="margin-top:8px;font-size:10px;color:#333;">{{ count($rows) }} row(s)</div>
@endif
<div style="margin-top:14px;font-size:8px;color:#888;">Generated {{ now()->format('d M Y H:i') }} by {{ auth()->user()->name ?? 'system' }} &middot; Nowills SQC ERP</div>
</body></html>
