<?php
/**
 * KPI Chips partial
 * $kpis = [
 *   ['label'=>'Total','value'=>123,'icon'=>'fa-solid fa-layer-group','tone'=>'primary'],
 * ]
 * tone: primary|success|warning|danger|info|dark
 */
?>
<?php if (!empty($kpis) && is_array($kpis)): ?>
  <div class="d-flex flex-wrap gap-2 mb-3">
    <?php foreach ($kpis as $k): ?>
      <?php $tone = (string)($k['tone'] ?? 'primary'); ?>
      <div class="ec-pill" style="display:flex;align-items:center;gap:.5rem;">
        <?php if (!empty($k['icon'])): ?><i class="<?= e((string)$k['icon']) ?>"></i><?php endif; ?>
        <span><?= e((string)($k['label'] ?? '')) ?>:</span>
        <span style="font-weight:900;"><?= e((string)($k['value'] ?? '0')) ?></span>
      </div>
    <?php endforeach; ?>
  </div>
<?php endif; ?>
