<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>Laporan Kunjungan #{{ $visit->id }}</title>
    <style>
        body { font-family: DejaVu Sans, sans-serif; font-size:12px }
        .header { text-align:center; margin-bottom:20px }
        .section { margin-bottom:12px }
        .photo { max-width:200px; max-height:150px; }
    </style>
 </head>
 <body>
    <div class="header">
        <h2>Laporan Kunjungan</h2>
        <div>Visit ID: {{ $visit->id }} | Tanggal: {{ $visit->visit_date->format('d/m/Y') }}</div>
    </div>

    <div class="section">
        <strong>Klien:</strong> {{ $visit->client->name }}<br>
        <strong>Teknisi:</strong> {{ $visit->technician?->name ?? '-' }}
    </div>

    <div class="section">
        <strong>Ringkasan Log:</strong>
        <ul>
        @foreach($visit->logs as $log)
            <li>[{{ $log->time }}] {{ $log->activity }}</li>
        @endforeach
        </ul>
    </div>

    <div class="section">
        <strong>Foto:</strong>
        <div>
        @foreach($visit->photos as $p)
            <div style="display:inline-block;margin:6px;text-align:center">
                <img class="photo" src="{{ storage_path('app/public/'.$p->path) }}" alt="photo">
                <div>{{ $p->type }}</div>
            </div>
        @endforeach
        </div>
    </div>

</body>
</html>
