<?php $r=$report; ?>
<style>
.secmon{display:grid;gap:18px}.secmon-hero,.secmon-card{background:#fff;border:1px solid #dbe3f0;border-radius:18px;padding:22px}.secmon-hero{display:flex;justify-content:space-between;align-items:center;background:#17365f;color:#fff}.secmon-score{font-size:42px;font-weight:800}.secmon-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}.secmon-ok{color:#08783e}.secmon-ko{color:#b42318}.secmon-list{margin:0;padding:0;list-style:none}.secmon-list li{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid #edf1f7}.secmon-back{display:inline-block;margin-bottom:12px;font-weight:700}
</style>
<a class="secmon-back" href="/public/administration/securite">← Sécurité & autorisations</a>
<div class="secmon">
<section class="secmon-hero"><div><small>SECURITY-NATIVE-015</small><h2>Supervision de la sécurité</h2><p>État du socle, événements et alertes des dernières 24 heures.</p></div><div class="secmon-score"><?= (int)$r['score'] ?>/100</div></section>
<div class="secmon-grid">
<article class="secmon-card"><h3>Événements 24 h</h3><strong><?= (int)$r['events_24h'] ?></strong></article>
<article class="secmon-card"><h3>Alertes 24 h</h3><strong><?= (int)$r['alerts_24h'] ?></strong></article>
<article class="secmon-card"><h3>Dernière analyse</h3><strong><?= htmlspecialchars($r['generated_at']) ?></strong></article>
</div>
<div class="secmon-grid">
<article class="secmon-card"><h3>Contrôles du socle</h3><ul class="secmon-list"><?php foreach($r['checks'] as $name=>$ok): ?><li><span><?= htmlspecialchars(str_replace('_',' ',ucfirst($name))) ?></span><b class="<?= $ok?'secmon-ok':'secmon-ko' ?>"><?= $ok?'OK':'À corriger' ?></b></li><?php endforeach; ?></ul></article>
<article class="secmon-card"><h3>Sévérités</h3><ul class="secmon-list"><?php foreach($r['severity'] as $name=>$count): ?><li><span><?= htmlspecialchars(ucfirst($name)) ?></span><b><?= (int)$count ?></b></li><?php endforeach; ?></ul></article>
<article class="secmon-card"><h3>Événements fréquents</h3><ul class="secmon-list"><?php if(!$r['top_events']): ?><li>Aucun événement récent</li><?php endif; ?><?php foreach($r['top_events'] as $name=>$count): ?><li><span><?= htmlspecialchars($name) ?></span><b><?= (int)$count ?></b></li><?php endforeach; ?></ul></article>
</div>
</div>
