/* ============================================================
   reftrack — Shared partner UI kit

   Components every partner page uses: page heading, panels,
   metric cards, toolbars, data tables, badges, pagination.
   Loaded globally after style.css, before any page-specific
   sheet. Every value comes from tokens.css — no raw hex.

   Page-specific pieces (tier hero, leaderboard, performance
   chart) stay in dashboard.css.
   ============================================================ */

/* Any class that sets `display` outranks the UA [hidden] rule, which
   silently keeps "hidden" elements painted. One global guard so every
   component below can use the attribute and have it mean something. */
[hidden] { display: none !important; }

/* ── Page heading ──────────────────────────────────────────────
   Icon tile + title + one line of context, replacing the bare
   h2/p so every page announces itself the same way.            */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.page-head__main { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.page-head__icon {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--radius);
  color: var(--brand);
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
}
.page-head__icon svg { width: 20px; height: 20px; }
.page-head__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  color: var(--text-strong);
  line-height: 1.25;
}
.page-head__sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}
.page-head__actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

/* ── Panel ─────────────────────────────────────────────────────
   The card shell. Moved here from dashboard.css so every page
   gets it, not just the dashboard.                             */

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.panel + .panel { margin-top: var(--space-4); }
.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) 0;
}
.panel__titlewrap { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.panel__title {
  font-size: 15px;
  font-weight: var(--weight-bold);
  color: var(--text-strong);
  line-height: 1.3;
}
.panel__sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.panel__icon {
  width: 30px; height: 30px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--brand);
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
}
.panel__icon svg { width: 15px; height: 15px; }
.panel__body { padding: var(--space-4); }
.panel__foot {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* A select that reads as a chip rather than a browser control. */
.panel__select,
.ui-select {
  appearance: none;
  padding: 6px 26px 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: var(--weight-medium);
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-size: 5px 5px, 5px 5px;
  background-position: 10px 13px, 15px 13px;
  background-repeat: no-repeat;
}
[dir="rtl"] .panel__select,
[dir="rtl"] .ui-select { padding: 6px 10px 6px 26px; }
.panel__select:focus,
.ui-select:focus { outline: 2px solid var(--brand-line); outline-offset: 1px; }

/* ── Metric cards ──────────────────────────────────────────── */

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

.metric {
  --tint: var(--brand);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-4) 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.metric[data-tint="brand"]   { --tint: var(--brand);   }
.metric[data-tint="success"] { --tint: var(--success); }
.metric[data-tint="info"]    { --tint: var(--info);    }
.metric[data-tint="warning"] { --tint: var(--warning); }
.metric[data-tint="danger"]  { --tint: var(--danger);  }

.metric__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.metric__label { font-size: 12px; font-weight: var(--weight-medium); color: var(--text-muted); }
.metric__value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  color: var(--text-strong);
  line-height: 1.2;
  margin-top: var(--space-1);
  font-variant-numeric: tabular-nums;
}
.metric__icon {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--radius);
  color: var(--tint);
  background: color-mix(in srgb, var(--tint) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tint) 34%, transparent);
}
.metric__icon svg { width: 19px; height: 19px; }

.metric__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-3);
  min-height: 18px;
}
.metric__since { font-size: 11.5px; color: var(--text-muted); }
.metric__delta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 12px;
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
}
.metric__delta--up   { color: var(--success); }
.metric__delta--down { color: var(--danger);  }
.metric__delta--flat,
.metric__delta--none { color: var(--text-muted); }
.metric__delta svg { width: 11px; height: 11px; }

.metric__spark { height: 40px; margin-top: var(--space-2); }
.metric__spark svg { display: block; width: 100%; height: 40px; }

/* ── Toolbar: filters on one side, actions on the other ─────── */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.toolbar__group { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

/* ── Icon button ───────────────────────────────────────────── */

.iconbtn {
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-subtle);
  cursor: pointer;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.iconbtn svg { width: 16px; height: 16px; }
.iconbtn:hover { background: var(--surface-hover); color: var(--text-strong); }
.iconbtn--sm { width: 28px; height: 28px; }
.iconbtn--sm svg { width: 14px; height: 14px; }
.iconbtn--plain { border-color: transparent; background: transparent; }

/* ── Link bar: a read-only URL with its actions ─────────────── */

.linkbar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.linkbar__field {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  /* A URL is always LTR, even on an RTL page. */
  direction: ltr;
  text-align: left;
  text-overflow: ellipsis;
}
.linkbar__field:focus { outline: 2px solid var(--brand-line); outline-offset: 1px; }

/* ── Data table ────────────────────────────────────────────────
   One table style for links, payouts, reports and articles.    */

.dtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dtable th {
  padding: 0 var(--space-3) var(--space-3);
  text-align: start;
  font-size: 11.5px;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.dtable td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable tbody tr { transition: background var(--duration) var(--ease); }
.dtable tbody tr:hover { background: var(--surface-hover); }
.dtable .num { font-variant-numeric: tabular-nums; font-weight: var(--weight-bold); color: var(--text-strong); }
.dtable .end { text-align: end; }

/* Title cell: a status dot then the label. */
.cell-title { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.cell-dot {
  width: 6px; height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--brand);
}
.cell-dot--off { background: var(--text-muted); }
.cell-name {
  font-weight: var(--weight-bold);
  color: var(--text-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* URL cell: truncated, LTR, with a copy affordance. */
.cell-url { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.cell-url__text {
  direction: ltr;
  color: var(--text-subtle);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 240px;
}
.cell-actions { display: flex; align-items: center; gap: var(--space-1); justify-content: flex-end; }

/* ── Pills / badges ────────────────────────────────────────── */

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: var(--weight-bold);
  white-space: nowrap;
  color: var(--text-subtle);
  background: var(--surface);
  border: 1px solid var(--border);
}
.pill--ok     { color: var(--success); background: var(--success-tint); border-color: color-mix(in srgb, var(--success) 34%, transparent); }
.pill--warn   { color: var(--warning); background: var(--warning-tint); border-color: color-mix(in srgb, var(--warning) 34%, transparent); }
.pill--danger { color: var(--danger);  background: var(--danger-tint);  border-color: color-mix(in srgb, var(--danger) 34%, transparent); }
.pill--brand  { color: var(--brand);   background: var(--brand-tint);   border-color: var(--brand-line); }

/* ── Segmented control ─────────────────────────────────────── */

.seg { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.seg__btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 120px;
  padding: var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-subtle);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: var(--weight-bold);
  cursor: pointer;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease),
              border-color var(--duration) var(--ease);
}
.seg__btn svg { width: 16px; height: 16px; }
.seg__btn:hover { background: var(--surface-hover); color: var(--text-strong); }
.seg__btn--active {
  color: var(--brand-bright);
  background: var(--brand-tint);
  border-color: var(--brand-line);
}

/* ── Pagination ────────────────────────────────────────────── */

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.pager__info { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pager__pages { display: flex; align-items: center; gap: var(--space-1); }
.pager__btn {
  min-width: 30px; height: 30px;
  padding: 0 8px;
  display: inline-grid; place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-subtle);
  font-family: var(--font);
  font-size: 12px;
  font-weight: var(--weight-bold);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.pager__btn:hover:not(:disabled) { background: var(--surface-hover); color: var(--text-strong); }
.pager__btn--active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager__btn:disabled { opacity: .4; cursor: not-allowed; }
.pager__size { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; color: var(--text-muted); }

/* ── Empty / loading states ────────────────────────────────── */

.state {
  display: grid;
  place-items: center;
  gap: var(--space-2);
  padding: var(--space-10) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.state__icon { color: var(--text-muted); opacity: .5; }
.state__icon svg { width: 30px; height: 30px; }
.state__title { font-weight: var(--weight-bold); color: var(--text-subtle); }
.state__hint { font-size: 12px; }

/* ── Draggable row (index page ordering) ───────────────────── */

.drow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}
.drow + .drow { margin-top: var(--space-1); }
.drow:hover { background: var(--surface-hover); border-color: var(--border); }
.drow--dragging { opacity: .5; }
.drow__handle {
  cursor: grab;
  color: var(--text-muted);
  padding: 0 2px;
  user-select: none;
  flex-shrink: 0;
}
.drow__handle svg { width: 15px; height: 15px; }
.drow__icon {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--border);
}
.drow__text { flex: 1; min-width: 0; }
.drow__title {
  font-size: 12.5px;
  font-weight: var(--weight-bold);
  color: var(--text-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drow__sub {
  font-size: 11px;
  color: var(--text-muted);
  direction: ltr;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Split layout: main column + narrower aside ───────────── */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--space-4);
  align-items: start;
}
.split__aside { display: flex; flex-direction: column; gap: var(--space-4); }
@media (max-width: 900px) { .split { grid-template-columns: minmax(0, 1fr); } }

/* Note card: an icon, a heading and a short body. */
.note__icon {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
  color: var(--brand);
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
}
.note__icon svg { width: 17px; height: 17px; }
.note__title { font-size: var(--text-base); font-weight: var(--weight-bold); color: var(--text-strong); margin-bottom: var(--space-1); }
.note__body { font-size: 12.5px; color: var(--text-muted); line-height: 1.7; }
.note__body strong { color: var(--text); }
.note__list { margin: 0; padding-inline-start: 18px; font-size: 12.5px; color: var(--text-muted); line-height: 1.9; }

/* ── Key/value list (account details) ─────────────────────── */

.kv { display: grid; gap: 0; }
.kv__row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.kv__row:last-child { border-bottom: 0; }
.kv__key { font-size: 12.5px; color: var(--text-muted); }
.kv__val { font-size: 13px; font-weight: var(--weight-bold); color: var(--text-strong); min-width: 0; overflow-wrap: anywhere; }
.kv__val code {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
}
@media (max-width: 560px) {
  .kv__row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ── Next payout ──────────────────────────────────────────── */

.nextpay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.nextpay__side { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.nextpay__icon {
  width: 52px; height: 52px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--radius);
  color: var(--brand-bright);
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
}
.nextpay__icon svg { width: 24px; height: 24px; }
.nextpay__label { font-size: 11.5px; color: var(--text-muted); }
.nextpay__date {
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  color: var(--text-strong);
  margin-top: 2px;
}
.nextpay__end { text-align: end; }
.nextpay__amount {
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  color: var(--success);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* A quiet explanatory strip under a panel's main content. */
.note-strip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.note-strip svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Full-width secondary action at the foot of a panel. */
.linkbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  margin-top: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: var(--weight-bold);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--duration) var(--ease);
}
.linkbtn:hover { background: var(--surface-hover); color: var(--text-strong); text-decoration: none; }

/* ── Field row ─────────────────────────────────────────────────
   An icon + label on the inline-start, the control filling the
   rest. Used for account details and every settings field, so a
   read-only value and an <input> line up on the same grid.     */

.frow {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3) 0;
}
.frow + .frow { border-top: 1px solid var(--border); }
.frow--top { align-items: start; }

.frow__label { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.frow__icon {
  width: 30px; height: 30px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-subtle);
  background: var(--surface);
  border: 1px solid var(--border);
}
.frow__icon svg { width: 15px; height: 15px; }
.frow__text { min-width: 0; }
.frow__name { font-size: 13px; color: var(--text); }
.frow__sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* The control column: inputs stretch, plain values sit at the start. */
.frow__control { min-width: 0; }
.frow__control > input,
.frow__control > select,
.frow__control > textarea { width: 100%; margin: 0; }
.frow__value {
  font-size: 13px;
  font-weight: var(--weight-bold);
  color: var(--text-strong);
  overflow-wrap: anywhere;
}
.frow__row { display: flex; align-items: center; gap: var(--space-2); }
.frow__row > input { flex: 1; min-width: 0; margin: 0; }

@media (max-width: 720px) {
  .frow { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
}

/* ── Avatar block ──────────────────────────────────────────── */

.avatarbox {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
  padding: var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.avatarbox__side { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.avatarbox__img,
.avatarbox__fallback {
  width: 92px; height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--brand-line);
}
.avatarbox__fallback {
  display: grid; place-items: center;
  font-size: 34px;
  font-weight: var(--weight-black);
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(140deg, var(--brand-bright), var(--brand-strong));
}
.avatarbox__main { flex: 1; min-width: 220px; }

/* ── Password field with a reveal toggle ───────────────────── */

.pwfield { position: relative; }
.pwfield > input { width: 100%; margin: 0; padding-inline-end: 40px; }
.pwfield__eye {
  position: absolute;
  inset-inline-end: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.pwfield__eye svg { width: 16px; height: 16px; }
.pwfield__eye:hover { color: var(--text-strong); background: var(--surface-hover); }

/* ── Modal ─────────────────────────────────────────────────────
   Overlay + centred card. Used for the one-time notification
   popup; the [hidden] guard at the top of this file is what
   actually keeps it closed, since .modal sets display.        */

.modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(2px);
  animation: modal-fade .18s var(--ease);
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }

.modal__card {
  width: 100%;
  max-width: 460px;
  max-height: 86vh;
  overflow-y: auto;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  animation: modal-rise .22s var(--ease);
}
@keyframes modal-rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal__icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  margin-bottom: var(--space-4);
  border-radius: var(--radius);
  color: var(--brand-bright);
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
}
.modal__icon svg { width: 22px; height: 22px; }

.modal__eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: .6px;
  color: var(--brand-bright);
}
.modal__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-black);
  color: var(--text-strong);
  line-height: 1.35;
  margin-top: 2px;
}
.modal__body {
  font-size: var(--text-sm);
  line-height: 1.8;
  color: var(--text-muted);
  margin-top: var(--space-3);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.modal__time { font-size: 11.5px; color: var(--text-subtle); margin-top: var(--space-3); }
.modal__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-5);
}
.modal__actions .btn { margin: 0; }

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 720px) {
  .page-head { flex-direction: column; align-items: stretch; }
  .cell-url__text { max-width: 130px; }
  .dtable .hide-sm { display: none; }
  .seg__btn { min-width: 0; flex-basis: calc(50% - var(--space-2)); }
}
@media (max-width: 560px) {
  .metrics { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .metric__value { font-size: 22px; }
  .pager { justify-content: center; }
}
