<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Infusion 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' => 'infusion', 'visit' => $visit]) }}">Back</a></p>
    <h1>{{ $patient->fullName() }}</h1>
    <p class="meta">{{ $patient->patient_number }} · Visit #{{ $visit->id }} · Stage {{ $visit->specialty_stage ?? '—' }}</p>
    <h2>Assessment</h2>
    @if ($assessment)<dl><dt>Indication</dt><dd>{{ $assessment->payload['indication'] ?? '—' }}</dd><dt>Fit</dt><dd>{{ ! empty($assessment->payload['fit_for_infusion']) ? 'Yes' : 'No' }}</dd></dl>@else<p class="meta">No assessment recorded.</p>@endif
    <h2>Protocol</h2>
    @if ($protocol)<dl><dt>Medication</dt><dd>{{ $protocol->payload['medication'] ?? '—' }}</dd><dt>Dose</dt><dd>{{ $protocol->payload['dose'] ?? '—' }}</dd><dt>Rate</dt><dd>{{ $protocol->payload['rate'] ?? '—' }}</dd></dl>@else<p class="meta">No protocol recorded.</p>@endif
    <h2>Session</h2>
    @if ($session)<dl><dt>Medication</dt><dd>{{ $session->payload['medication'] ?? '—' }}</dd><dt>Start</dt><dd>{{ $session->payload['start_time'] ?? '—' }}</dd><dt>End</dt><dd>{{ $session->payload['end_time'] ?? '—' }}</dd></dl>@else<p class="meta">No session recorded.</p>@endif
    <h2>Monitoring</h2>
    @if ($monitoring)<dl><dt>Reaction</dt><dd>{{ $monitoring->payload['reaction'] ?? '—' }}</dd><dt>Outcome</dt><dd>{{ $monitoring->payload['outcome'] ?? '—' }}</dd></dl>@else<p class="meta">No monitoring recorded.</p>@endif
    <script>window.print();</script>
</body>
</html>
