<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Pathology 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' => 'pathology', 'visit' => $visit]) }}">Back</a></p>
    <h1>{{ $patient->fullName() }}</h1>
    <p class="meta">{{ $patient->patient_number }} · Visit #{{ $visit->id }} · Stage {{ $visit->specialty_stage ?? '—' }}</p>
    <h2>Request</h2>
    @if ($requestRecord)<dl><dt>Specimen</dt><dd>{{ $requestRecord->payload['specimen_type'] ?? '—' }}</dd><dt>Site</dt><dd>{{ $requestRecord->payload['site'] ?? '—' }}</dd><dt>History</dt><dd>{{ $requestRecord->payload['clinical_history'] ?? '—' }}</dd></dl>@else<p class="meta">No request recorded.</p>@endif
    <h2>Specimen</h2>
    @if ($specimen)<dl><dt>Label</dt><dd>{{ $specimen->payload['container_label'] ?? '—' }}</dd><dt>Adequacy</dt><dd>{{ $specimen->payload['adequacy'] ?? '—' }}</dd></dl>@else<p class="meta">No specimen receipt recorded.</p>@endif
    <h2>Processing</h2>
    @if ($processing)<dl><dt>Status</dt><dd>{{ $processing->payload['status'] ?? '—' }}</dd><dt>Gross</dt><dd>{{ $processing->payload['gross'] ?? '—' }}</dd></dl>@else<p class="meta">No processing recorded.</p>@endif
    <h2>Report</h2>
    @if ($report)<dl><dt>Microscopy</dt><dd>{{ $report->payload['microscopy'] ?? '—' }}</dd><dt>Diagnosis</dt><dd>{{ $report->payload['diagnosis'] ?? '—' }}</dd></dl>@else<p class="meta">No report recorded.</p>@endif
    <h2>Verification</h2>
    @if ($verification)<dl><dt>Verified</dt><dd>{{ ! empty($verification->payload['verified']) ? 'Yes' : 'No' }}</dd><dt>Outcome</dt><dd>{{ $verification->payload['outcome'] ?? '—' }}</dd></dl>@else<p class="meta">No verification recorded.</p>@endif
    <script>window.print();</script>
</body>
</html>
