<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Radiology summary · {{ $patient->fullName() }}</title>
    <style>
        body { font-family: system-ui, sans-serif; color: #0f172a; margin: 2rem; }
        h1 { font-size: 1.25rem; margin: 0 0 .25rem; }
        h2 { font-size: .95rem; margin: 1.25rem 0 .5rem; border-bottom: 1px solid #e2e8f0; padding-bottom: .25rem; }
        .meta { color: #64748b; font-size: .875rem; }
        dl { display: grid; grid-template-columns: 10rem 1fr; gap: .35rem .75rem; font-size: .875rem; }
        dt { color: #64748b; }
        dd { margin: 0; font-weight: 500; }
        @media print { .no-print { display: none; } }
    </style>
</head>
<body>
    <p class="no-print"><a href="{{ route('care.specialty.workspace', ['module' => 'radiology', 'visit' => $visit]) }}">Back</a></p>

    <h1>{{ $patient->fullName() }}</h1>
    <p class="meta">
        {{ $patient->patient_number }}
        · Visit #{{ $visit->id }}
        · Stage {{ $visit->specialty_stage ?? '—' }}
        · {{ $visit->checked_in_at?->format('d M Y H:i') ?? '—' }}
    </p>

    <h2>Request / protocol</h2>
    @if ($imagingRequest)
        <dl>
            <dt>Modality</dt><dd>{{ $imagingRequest->payload['modality'] ?? '—' }}</dd>
            <dt>Body part</dt><dd>{{ $imagingRequest->payload['body_part'] ?? '—' }}</dd>
            <dt>Urgency</dt><dd>{{ $imagingRequest->payload['urgency'] ?? '—' }}</dd>
            <dt>Contrast</dt><dd>{{ $imagingRequest->payload['contrast'] ?? '—' }}</dd>
            <dt>Clinical info</dt><dd>{{ $imagingRequest->payload['clinical_info'] ?? '—' }}</dd>
            <dt>Protocol</dt><dd>{{ $imagingRequest->payload['protocol'] ?? '—' }}</dd>
        </dl>
    @else
        <p class="meta">No imaging request recorded.</p>
    @endif

    <h2>Acquisition</h2>
    @if ($acquisition)
        <dl>
            <dt>Status</dt><dd>{{ $acquisition->payload['acquisition_status'] ?? '—' }}</dd>
            <dt>Quality</dt><dd>{{ $acquisition->payload['quality'] ?? '—' }}</dd>
            <dt>Technologist</dt><dd>{{ $acquisition->payload['technologist'] ?? '—' }}</dd>
            <dt>Notes</dt><dd>{{ $acquisition->payload['notes'] ?? '—' }}</dd>
        </dl>
    @else
        <p class="meta">No acquisition recorded.</p>
    @endif

    <h2>Findings / report</h2>
    @if ($imagingReport)
        <dl>
            <dt>Technique</dt><dd>{{ $imagingReport->payload['technique'] ?? '—' }}</dd>
            <dt>Findings</dt><dd>{{ $imagingReport->payload['findings'] ?? '—' }}</dd>
            <dt>Impression</dt><dd>{{ $imagingReport->payload['impression'] ?? '—' }}</dd>
            <dt>Recommendations</dt><dd>{{ $imagingReport->payload['recommendations'] ?? '—' }}</dd>
        </dl>
    @else
        <p class="meta">No report recorded.</p>
    @endif

    <h2>Verification</h2>
    @if ($verification)
        <dl>
            <dt>Status</dt><dd>{{ $verification->payload['verification_status'] ?? '—' }}</dd>
            <dt>Verified by</dt><dd>{{ $verification->payload['verified_by'] ?? '—' }}</dd>
            <dt>Notes</dt><dd>{{ $verification->payload['notes'] ?? '—' }}</dd>
        </dl>
    @else
        <p class="meta">No verification recorded.</p>
    @endif

    <script>window.print();</script>
</body>
</html>
