/* ==================== STAT TILES (List Page Pattern, Sep 2026) ====================
 * Page-level summary above a list's filters — the Rate Cards mockup's four
 * cards. Summary only: a stat tile never links or filters (the status pills
 * do that) and never repeats a pill count. Omit the row on a page with no
 * genuine summary. Spec: docs/superpowers/specs/2026-09-05-list-page-pattern-design.md §5
 *
 * Prefix stat-tile, not stat-card: layouts/dashboard.css already owns
 * .stat-card globally (RCTI preview/results, dashboard Detailed Metrics).
 *
 *   <section class="stat-tiles" aria-label="Rate card summary">
 *     <div class="stat-tile">
 *       <span class="stat-tile-icon is-success" aria-hidden="true"><i class="bi bi-card-checklist"></i></span>
 *       <span class="stat-tile-body">
 *         <span class="stat-tile-label">Active cards</span>
 *         <span class="stat-tile-value">
 *           <span class="stat-tile-count">20</span>
 *           <span class="stat-tile-note">of 86 total</span>   ← or .stat-tile-chips of .chip
 *         </span>
 *       </span>
 *     </div>
 *   </section>
 * ============================================================================== */

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.stat-tile {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-4) var(--space-5);
  background: var(--pk-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

/* Soft disc + state colour. A zero count uses .is-muted so the eye lands on
 * the non-zero cards (the dashboard rule). The disc is aria-hidden — the
 * count beside it carries the meaning — so the muted glyph is exempt from
 * the 3:1 non-text target. */
.stat-tile-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  font-size: var(--text-lg);
  line-height: 1;
  background: var(--pk-gray-100);
  color: var(--pk-gray-300);
}

.stat-tile-icon.is-success { background: var(--pk-success-light); color: var(--pk-success); }
.stat-tile-icon.is-info    { background: var(--pk-info-light);    color: var(--pk-info); }
.stat-tile-icon.is-warning { background: var(--pk-warning-light); color: var(--pk-warning); }
.stat-tile-icon.is-error   { background: var(--pk-error-light);   color: var(--pk-error); }
.stat-tile-icon.is-brand   { background: color-mix(in srgb, var(--pk-orange) 10%, transparent); color: var(--pk-orange-dark); }
.stat-tile-icon.is-muted   { background: var(--pk-gray-100);      color: var(--pk-gray-300); }

.stat-tile-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-tile-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--pk-gray-600);
}

.stat-tile-value {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex-wrap: wrap;
  min-width: 0;
}

.stat-tile-count {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--pk-gray-900);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-tile-note {
  font-size: var(--text-caption);
  color: var(--pk-gray-500);
}

.stat-tile-chips {
  display: inline-flex;
  gap: var(--space-1);
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.stat-tile-chips .chip {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
