<?php $r=$report??[];$h=static fn($v):string=>htmlspecialchars((string)$v,ENT_QUOTES,'UTF-8'); ?>
<style>body{font-family:Arial,sans-serif;color:#1f2937}.report{max-width:1000px;margin:auto}.head{border-bottom:3px solid #244f76;padding-bottom:14px}.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.box{border:1px solid #cbd5e1;border-radius:10px;padding:14px}.big{font-size:34px;font-weight:800}table{width:100%;border-collapse:collapse;margin-top:16px}th,td{border:1px solid #cbd5e1;padding:8px;text-align:left}@media print{.no-print{display:none}}</style>
<div class="report"><button class="no-print" onclick="window.print()">Imprimer / PDF</button><div class="head"><h1>Rapport exécutif de sécurité</h1><p>AXIOM · période <?= (int)($r['days']??30) ?> jours · généré le <?= $h($r['generatedAt']??'') ?></p></div><div class="grid"><div class="box"><small>Score sécurité</small><div class="big"><?= (int)($r['securityScore']??0) ?>/100</div></div><div class="box"><small>Score conformité</small><div class="big"><?= (int)($r['comp']['score']??0) ?>/100</div></div><div class="box"><small>Incidents actifs</small><div class="big"><?= (int)($r['inc']['active']??0) ?></div></div></div><h2>Actions prioritaires</h2><ul><?php foreach(($r['actions']??[]) as $a):?><li><strong><?= $h($a['title']) ?></strong> — <?= $h($a['detail']) ?></li><?php endforeach?></ul><h2>Modules exposés</h2><table><thead><tr><th>Module</th><th>Incidents</th><th>Actifs</th><th>Risque maximal</th></tr></thead><tbody><?php foreach(($r['modules']??[]) as $m):?><tr><td><?= $h($m['module']) ?></td><td><?= (int)$m['incidents'] ?></td><td><?= (int)$m['active'] ?></td><td><?= (int)$m['max_risk'] ?>/100</td></tr><?php endforeach?></tbody></table></div>
