<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>NGBVD Case Report</title>
    <style>
        body{font-family:Arial,sans-serif;color:#111827;margin:0;background:#f8fafc}.report{max-width:1000px;margin:24px auto;background:#fff;padding:34px;border:1px solid #e5e7eb}.brand{display:flex;align-items:center;gap:18px;border-bottom:5px solid #fdb209;padding-bottom:14px}.brand img{height:72px}.brand h1{font-size:22px;margin:0}.brand p{margin:4px 0;color:#64748b}.section{margin-top:22px;border:1px solid #e5e7eb;border-radius:12px;padding:16px}.section h2{font-size:18px;margin:0 0 12px}.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px 18px}.item label{font-weight:700;color:#475569}.table{width:100%;border-collapse:collapse}.table th,.table td{border-bottom:1px solid #e5e7eb;padding:8px;text-align:left}.actions{margin:20px auto;max-width:1000px;text-align:right}.btn{background:#111827;color:white;padding:10px 16px;border-radius:10px;text-decoration:none;display:inline-block}@media print{.actions{display:none}.report{margin:0;border:0}body{background:#fff}}
    </style>
</head>
<body>
<div class="actions"><a href="#" onclick="window.print();return false;" class="btn">Export / Print PDF</a></div>
<main class="report">
    <div class="brand">
        <img src="{{ asset('/assets/img/Coat_of_arms_of_Uganda.png') }}" alt="Uganda Coat of Arms">
        <div><h1>Republic of Uganda<br>Ministry of Gender, Labour and Social Development</h1><p>National Gender Based Violence Database - Case Report</p></div>
    </div>
    <section class="section"><h2>Survivor / Reporter Summary</h2><div class="grid">
        <div class="item"><label>Reference</label><br>{{ $victim->survivor_code ?: $victim->crb_number }}</div>
        <div class="item"><label>Interview Date</label><br>{{ $victim->interview_date }}</div>
        <div class="item"><label>District</label><br>{{ $victim->districtid }}</div>
        <div class="item"><label>Sex</label><br>{{ $victim->gender }}</div>
        <div class="item"><label>Reporter Phone</label><br>{{ $victim->reporter_phone }}</div>
        <div class="item"><label>Reporter Email</label><br>{{ $victim->reporter_email }}</div>
    </div></section>
    <section class="section"><h2>Incidents</h2><table class="table"><thead><tr><th>Date</th><th>Incident</th><th>Notes</th></tr></thead><tbody>@foreach($incidents as $row)<tr><td>{{ $row->incident_date }}</td><td>{{ $row->incident_name }}</td><td>{{ $row->notes }}</td></tr>@endforeach</tbody></table></section>
    <section class="section"><h2>Perpetrators</h2><table class="table"><thead><tr><th>Sex</th><th>Age</th><th>Relationship</th><th>Notes</th></tr></thead><tbody>@foreach($perpetrators as $row)<tr><td>{{ $row->gender }}</td><td>{{ $row->agegroup }}</td><td>{{ $row->relation }}</td><td>{{ $row->notes }}</td></tr>@endforeach</tbody></table></section>
    <section class="section"><h2>Witnesses</h2><table class="table"><thead><tr><th>Name</th><th>Sex</th><th>Age</th><th>Relationship</th></tr></thead><tbody>@foreach($witnesses as $row)<tr><td>{{ $row->name }}</td><td>{{ $row->gender }}</td><td>{{ $row->agegroup }}</td><td>{{ $row->relation }}</td></tr>@endforeach</tbody></table></section>
    <section class="section"><h2>Actions / Services</h2><table class="table"><thead><tr><th>Date</th><th>Reported To</th><th>Referred To</th><th>Services</th><th>Notes</th></tr></thead><tbody>@foreach($actions as $row)<tr><td>{{ $row->report_date }}</td><td>{{ $row->reported_to }}</td><td>{{ $row->refferedto }}</td><td>{{ $row->services }}</td><td>{{ $row->notes }}</td></tr>@endforeach</tbody></table></section>
    <section class="section"><h2>Case Status History</h2><table class="table"><thead><tr><th>Date</th><th>Status</th><th>Pending Point</th><th>Details</th></tr></thead><tbody>@foreach($statuses as $row)<tr><td>{{ $row->date_logged }}</td><td>{{ $row->status_name ?? $row->incident_status }}</td><td>{{ $row->pending_point_name ?? '-' }}</td><td>{{ $row->details }}</td></tr>@endforeach</tbody></table></section>
</main>
</body>
</html>
