<!DOCTYPE html>
<html>
<head>
    <title>Laporan Data Pindah</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 Pindah</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>Tanggal Pindah</th>
            <th>Alamat Sebelumnya</th>
            <th>Alasan</th>
        </tr>
        </thead>
        <tbody>
        @foreach($records as $record)
            <tr>
                <td>{{ $record->penduduk->nama ?? '-' }}</td>
                <td>{{ $record->penduduk->nik ?? '-' }}</td>
                <td>{{ Carbon\Carbon::parse($record->tanggal_pindah)->translatedFormat('d F Y') }}</td>
                <td>{{ $record->alamat_sebelumnya }}</td>
                <td>{{ $record->alasan }}</td>
            </tr>
        @endforeach
        </tbody>
    </table>
</body>
</html>