<?php $c=$catalogComparison??null;$h=static fn($v):string=>htmlspecialchars((string)$v,ENT_QUOTES,'UTF-8'); ?>
<style>.cmp{display:grid;gap:14px}.cmp-hero{padding:22px;border-radius:20px;background:linear-gradient(135deg,#173b5a,#246f9d);color:#fff}.cmp-card{background:#fff;border:1px solid #dbe5ef;border-radius:16px;padding:17px}.cmp-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.cmp-table{width:100%;border-collapse:collapse}.cmp-table th,.cmp-table td{padding:11px;border-bottom:1px solid #e6edf4;text-align:left}.changed{background:#fff7ed}@media(max-width:700px){.cmp-grid{grid-template-columns:1fr}}</style>
<div class="cmp"><section class="cmp-hero"><h1>Comparaison de packages</h1><p>Écarts de version, confiance, compatibilité, certification et politique.</p><a style="color:#fff" href="/public/administration/plateforme/packages/catalogue">← Retour au catalogue</a></section><?php if($c): ?><div class="cmp-grid"><article class="cmp-card"><h2><?= $h($c['left']['package_name']) ?></h2><strong><?= $h($c['left']['version']) ?></strong></article><article class="cmp-card"><h2><?= $h($c['right']['package_name']) ?></h2><strong><?= $h($c['right']['version']) ?></strong></article></div><section class="cmp-card"><table class="cmp-table"><thead><tr><th>Critère</th><th>Package A</th><th>Package B</th></tr></thead><tbody><?php foreach($c['differences'] as $d): ?><tr class="<?= $d['changed']?'changed':'' ?>"><td><strong><?= $h($d['label']) ?></strong></td><td><?= $h($d['left']??'—') ?></td><td><?= $h($d['right']??'—') ?></td></tr><?php endforeach; ?></tbody></table></section><?php endif; ?></div>
