<link rel="stylesheet" href="/public/assets/css/cda-v4-9-parameters.css">

<section class="capacity-summary">
<article class="capacity-kpi available">
<span>Places restantes</span>
<strong><?= (int)($capacitySummary['places_restantes']??0) ?></strong>
<small>Sur les groupes à capacité définie</small>
</article>

<article class="capacity-kpi warning">
<span>Presque complets</span>
<strong><?= (int)($capacitySummary['nb_presque_complets']??0) ?></strong>
<small>80 % ou plus de remplissage</small>
</article>

<article class="capacity-kpi full">
<span>Groupes complets</span>
<strong><?= (int)($capacitySummary['nb_complets']??0) ?></strong>
<small>Liste d’attente à surveiller</small>
</article>
</section>

<section class="card">
<header class="card-header">
<div><span>Capacités</span><h3>Places restantes par cours</h3></div>
<a href="/public/groupes">Voir tous les groupes</a>
</header>

<div class="capacity-list">
<?php foreach($capacityGroups as $group): ?>
<article>
<div>
<strong><?= htmlspecialchars((string)$group['atelier_libelle']) ?></strong>
<span><?= htmlspecialchars((string)$group['groupe_libelle']) ?></span>
</div>
<div class="capacity-bar">
<i style="width:<?= min(100,(float)$group['taux_remplissage']) ?>%"></i>
</div>
<div class="capacity-number">
<strong><?= (int)$group['places_restantes'] ?></strong>
<span>place(s)</span>
</div>
</article>
<?php endforeach; ?>
</div>
</section>
