<?php $rows=is_array($certificates??null)?$certificates:[];$generatedAt=(string)($certificationGeneratedAt??'');$h=static fn($v):string=>htmlspecialchars((string)$v,ENT_QUOTES,'UTF-8');$active=count(array_filter($rows,static fn(array $r):bool=>($r['status']??'')==='ACTIVE')); ?>
<style>
.axc{display:grid;gap:18px}.axc-hero{background:linear-gradient(135deg,#132a46,#315f86);color:#fff;border-radius:22px;padding:24px;display:flex;justify-content:space-between;gap:20px;align-items:center}.axc-card{background:#fff;border:1px solid #dbe4ef;border-radius:18px;padding:18px;box-shadow:0 10px 28px rgba(31,55,86,.06)}.axc-nav{display:flex;gap:8px;flex-wrap:wrap}.axc-btn{display:inline-flex;padding:10px 14px;border-radius:11px;border:1px solid #cbd8e6;background:#fff;color:#183b5b;text-decoration:none;font-weight:750;cursor:pointer}.axc-btn.primary{background:#235f9d;color:#fff;border-color:#235f9d}.axc-btn.danger{color:#a51d2d;border-color:#e7bdc3}.axc-form{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:12px;align-items:end}.axc-form input{width:100%;box-sizing:border-box;padding:11px;border:1px solid #cbd8e6;border-radius:10px}.axc-table-wrap{overflow:auto}.axc-table{width:100%;border-collapse:collapse;min-width:980px}.axc-table th,.axc-table td{padding:11px;border-bottom:1px solid #e5ebf2;text-align:left}.axc-table th{font-size:12px;text-transform:uppercase;color:#64748b}.axc-pill{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:12px;font-weight:850;background:#edf4fb;color:#1f5f96}.axc-score{font-size:44px;font-weight:900}.axc-muted{color:#64748b}@media(max-width:760px){.axc-hero{flex-direction:column;align-items:flex-start}.axc-form{grid-template-columns:1fr}}
</style>
<div class="axc"><nav class="axc-nav"><a class="axc-btn" href="/public/administration/plateforme/validation">Validation Center</a><a class="axc-btn" href="/public/administration/plateforme/confiance-packages">Trust Engine</a><a class="axc-btn" href="/public/administration/plateforme/compatibilite-packages">Compatibility Engine</a><a class="axc-btn" href="/public/administration/plateforme/politiques-packages">Package Policy</a></nav><section class="axc-hero"><div><small>PLATFORM-023.2.3 · AXIOM</small><h1>Certification Center</h1><p>Certification interne fondée sur la confiance, la compatibilité et l’intégrité.</p></div><div><div class="axc-score"><?= $active ?></div><strong>certificat(s) actif(s)</strong><br><small><?= $h($generatedAt) ?></small></div></section><section class="axc-card"><h2>Certifier un package</h2><form method="post" action="/public/administration/plateforme/certification-packages/certifier" class="axc-form"><input type="hidden" name="_csrf" value="<?= $h(\App\Core\Csrf::token()) ?>"><div><label for="package_id"><strong>Identifiant du package importé</strong></label><input id="package_id" name="package_id" type="number" min="1" required><small class="axc-muted">Le Trust Engine et le Compatibility Engine seront exécutés.</small></div><button class="axc-btn primary" type="submit">Évaluer et certifier</button></form></section><section class="axc-card"><h2>Certificats de package</h2><div class="axc-table-wrap"><table class="axc-table"><thead><tr><th>Date</th><th>Package</th><th>Version</th><th>Score</th><th>Décision</th><th>Statut</th><th>Certificat</th><th>Action</th></tr></thead><tbody><?php foreach($rows as $r): ?><tr><td><?= $h($r['issued_at']??'') ?></td><td><?= $h($r['package_name']??'') ?></td><td><?= $h($r['package_version']??'') ?></td><td><strong><?= (int)($r['certification_score']??0) ?>/100</strong></td><td><?= $h($r['decision']??'') ?></td><td><span class="axc-pill"><?= $h($r['status']??'') ?></span></td><td><code><?= $h(substr((string)($r['certificate_uuid']??''),0,18)) ?>…</code></td><td><?php if(($r['status']??'')==='ACTIVE'): ?><form method="post" action="/public/administration/plateforme/certification-packages/revoquer" class="axc-nav"><input type="hidden" name="_csrf" value="<?= $h(\App\Core\Csrf::token()) ?>"><input type="hidden" name="certificate_id" value="<?= (int)($r['id']??0) ?>"><input name="reason" type="text" maxlength="255" placeholder="Motif" required><button class="axc-btn danger" type="submit">Révoquer</button></form><?php else: ?>—<?php endif; ?></td></tr><?php endforeach; ?><?php if(!$rows): ?><tr><td colspan="8">Aucun certificat disponible.</td></tr><?php endif; ?></tbody></table></div></section></div>
