<?php $e=static fn($v)=>htmlspecialchars((string)$v,ENT_QUOTES,'UTF-8');$a=$assessment;$b=$business; ?>
<!doctype html><html><head><meta charset="utf-8"><style>@page{margin:30px 35px}body{font-family:DejaVu Sans,sans-serif;font-size:10.5px;line-height:1.5;color:#20252b}h1{font-size:22px;margin:0}.logo{max-width:120px;max-height:55px;margin-bottom:7px}h2{font-size:14px;margin:18px 0 6px;border-bottom:1px solid #cfd4dc;padding-bottom:5px}.header{border-bottom:2px solid #176b5b;padding-bottom:15px}.meta{margin-top:8px;color:#667085}.patient{display:flex;gap:20px;margin:18px 0}.box{flex:1;border:1px solid #d9dee5;padding:10px}.label{font-size:9px;text-transform:uppercase;color:#667085}.section{margin-top:10px}.approved{display:inline-block;padding:4px 8px;border:1px solid #555;font-size:9px;font-weight:bold;text-transform:uppercase}.footer{margin-top:30px;border-top:1px solid #ddd;padding-top:8px;font-size:8.5px;color:#667085;text-align:center}</style></head><body><div class="header"><?php if(!empty($b['logo'])): ?><img class="logo" src="<?= $e($b['logo']) ?>" alt="Logo"><br><?php endif; ?><h1><?= $e($b['name']) ?></h1><div><?= $e($b['tagline']) ?></div><div class="meta"><?= $e($a['assessment_reference']) ?> · <?= $e($a['assessment_date']) ?> · Approved</div></div><div class="patient"><div class="box"><div class="label">Patient</div><strong><?= $e($a['first_name'].' '.$a['last_name']) ?></strong><br><?= $e($a['patient_reference']) ?></div><div class="box"><div class="label">Therapist</div><strong><?= $e($a['therapist_name']) ?></strong><br><?= $e($a['service_name']??'Assessment') ?> · <span class="approved">Approved</span></div></div><?php $sections=[['reason_for_referral','Reason for Referral'],['background','Background'],['observations','Observations'],['clinical_findings','Clinical Findings'],['goals','Goals'],['recommendations','Recommendations'],['additional_notes','Additional Notes']];foreach($sections as [$k,$label]):if(trim((string)($a[$k]??''))!==''): ?><div class="section"><h2><?= $e($label) ?></h2><?= nl2br($e($a[$k])) ?></div><?php endif;endforeach; ?><div class="footer">Official approved assessment · <?= $e($b['name']) ?></div></body></html>