<!DOCTYPE html>
<html>
<head>
    <title>Laporan Data Kematian</title>
    <style>
        body { font-family: 'sans-serif'; }
        table { width: 100%; border-collapse: collapse; margin-top: 20px; }
        th, td { border: 1px solid #ddd; padding: 8px; text-align: left; font-size: 10px; }
        th { background-color: #f2f2f2; }
    </style>
</head>
<body>
    <h1 style="text-align: center;">Laporan Data Kematian</h1>
    <p style="text-align: center; font-size: 12px;">Periode: {{ Carbon\Carbon::parse($start_date)->translatedFormat('d F Y') }} sampai {{ Carbon\Carbon::parse($end_date)->translatedFormat('d F Y') }}</p>
    <table>
        <thead>
        <tr>
            <th>Nama</th>
            <th>NIK</th>
            <th>Penyebab</th>
            <th>Tanggal Kematian</th>
        </tr>
        </thead>
        <tbody>
        @foreach($records as $record)
            <tr>
                <td>{{ $record->penduduk->nama ?? '-' }}</td>
                <td>{{ $record->penduduk->nik ?? '-' }}</td>
                <td>{{ $record->penyebab }}</td>
                <td>{{ Carbon\Carbon::parse($record->tanggal_kematian)->translatedFormat('d F Y') }}</td>
            </tr>
        @endforeach
        </tbody>
    </table>
</body>
</html>