/* =========================================================
   NOVA — Page-specific blocks that don't belong in the
   generic component library (used on 1-2 pages only).
   ========================================================= */

/* ---- Multi-step form (transfer.html) ---- */
.step-bar { display: flex; align-items: center; margin-bottom: var(--space-7); max-width: 520px; }
.step-bar__item { display: flex; align-items: center; gap: var(--space-2); }
.step-bar__line { flex: 1; height: 2px; background: var(--border-hairline); margin: 0 var(--space-2); }
.step-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-muted);
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--border-hairline);
  flex-shrink: 0;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.step-bar__label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.step-bar__item.is-active .step-dot { background: var(--brand-500); color: #fff; border-color: var(--brand-500); }
.step-bar__item.is-active .step-bar__label { color: var(--text-primary); }
.step-bar__item.is-done .step-dot { background: var(--status-good); color: #fff; border-color: var(--status-good); }
.step-bar__item.is-done .step-bar__label { color: var(--text-secondary); }

[data-step] { display: none; }
[data-step].is-active { display: block; animation: step-in var(--dur-base) var(--ease-out); }
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.summary-row { display: flex; justify-content: space-between; padding: var(--space-3) 0; border-bottom: 1px solid var(--border-hairline); font-size: 13.5px; }
.summary-row:last-child { border-bottom: none; }
.summary-row dt { color: var(--text-muted); }
.summary-row dd { font-weight: 600; }

/* ---- Appearance / theme picker (settings.html) ---- */
.theme-tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); max-width: 480px; }
.theme-tile {
  border: 1.5px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.theme-tile:hover { border-color: var(--border-strong); }
.theme-tile.is-selected { border-color: var(--brand-400); }
.theme-tile__preview { height: 64px; border-radius: 8px; margin-bottom: var(--space-3); }
.theme-tile__preview.is-dark { background: linear-gradient(160deg, #1b1b22, #0a0a0d); }
.theme-tile__preview.is-light { background: linear-gradient(160deg, #ffffff, #eeeeeb); border: 1px solid #e4e4e0; }
.theme-tile__preview.is-system { background: linear-gradient(90deg, #1b1b22 50%, #ffffff 50%); }
.theme-tile span { font-size: 12.5px; font-weight: 600; }

/* ---- Sessions / devices (settings.html) ---- */
.session-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border-hairline); }
.session-row:last-child { border-bottom: none; }
.session-icon { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--surface-3); display: grid; place-items: center; flex-shrink: 0; }
.session-icon svg { width: 18px; height: 18px; }

/* ---- Settings row (label left, control right) ---- */
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) 0; border-bottom: 1px solid var(--border-hairline); }
.settings-row:last-child { border-bottom: none; }
.settings-row__label { font-size: 13.5px; font-weight: 600; }
.settings-row__hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- 404 / error shell ---- */
.error-shell {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: var(--space-4);
  padding: var(--space-6);
}
.error-code {
  font-size: 104px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(155deg, var(--brand-400), var(--accent-400));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.error-shell__icon {
  width: 64px; height: 64px; border-radius: var(--radius-lg);
  background: var(--surface-1); border: 1px solid var(--border-hairline);
  display: grid; place-items: center; color: var(--brand-400);
}
.error-shell__icon svg { width: 28px; height: 28px; }

/* ---- Card limit meters (cards.html / card-details.html) ---- */
.card-limit-row { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: var(--space-2); }
.card-limit-row .text-muted { color: var(--text-muted); }

/* ---- Spend-by-category bars (dashboard.html) ---- */
.spend-bar-row { display: flex; align-items: center; gap: var(--space-3); }
.spend-bar-row + .spend-bar-row { margin-top: var(--space-3); }
.spend-bar-row__label { width: 96px; flex-shrink: 0; font-size: 12.5px; color: var(--text-secondary); }
.spend-bar-row__track { flex: 1; height: 8px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
.spend-bar-row__fill { height: 100%; border-radius: var(--radius-pill); }
.spend-bar-row__value { width: 64px; flex-shrink: 0; text-align: right; font-size: 12.5px; font-weight: 600; }

/* ---- Quick actions grid (dashboard.html) ---- */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  padding: var(--space-4) var(--space-2);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  font-size: 11.5px; font-weight: 600; text-align: center; color: var(--text-secondary);
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.quick-action:hover { border-color: var(--brand-400); color: var(--text-primary); }
.quick-action__icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-3); display: grid; place-items: center;
  color: var(--brand-400);
}
.quick-action__icon svg { width: 18px; height: 18px; }

/* ---- Balance hero (dashboard.php) ---- */
.balance-hero {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  color: #fff;
}
.balance-hero__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.balance-hero__greeting { font-size: 15px; opacity: 0.85; font-weight: 600; }
.balance-hero__account { font-family: var(--font-mono); font-size: 12.5px; opacity: 0.7; margin-top: 4px; }
.balance-hero__badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,0.16);
}
.balance-hero__badge.is-warning { background: rgba(255,196,61,0.3); }
.balance-hero__badge svg { width: 12px; height: 12px; }
.balance-hero__value { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; margin-top: var(--space-4); }
.balance-hero__sub { font-size: 13px; opacity: 0.8; margin-top: var(--space-2); }
.balance-hero__actions { display: flex; gap: var(--space-3); margin-top: auto; padding-top: var(--space-6); flex-wrap: wrap; }
.balance-hero__actions .btn {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
}
.balance-hero__actions .btn:hover { background: rgba(255,255,255,0.22); }
.balance-hero__actions .btn-solid { background: #fff; color: var(--brand-700); border-color: #fff; }
.balance-hero__actions .btn-solid:hover { filter: brightness(0.96); }

/* La rangée solde + courbe s'étire pour que les deux blocs fassent la même hauteur */
.dashboard-grid--stretch { align-items: stretch; }
.dashboard-grid--stretch > .balance-hero,
.dashboard-grid--stretch > .balance-chart-panel { display: flex; flex-direction: column; }
.balance-chart-panel__chart { flex: 1; min-height: 220px; }

/* ---- Chat / messagerie ---- */
.chat-thread {
  height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-2);
}
.chat-bubble-row { display: flex; }
.chat-bubble-row.is-mine { justify-content: flex-end; }
.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.45;
}
.chat-bubble-row.is-mine .chat-bubble {
  background: linear-gradient(155deg, var(--brand-400), var(--brand-600));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble-row:not(.is-mine) .chat-bubble { border-bottom-left-radius: 4px; }
.chat-bubble__time { font-size: 10.5px; opacity: 0.65; margin-top: 4px; }
.chat-input-row { display: flex; gap: var(--space-3); align-items: flex-end; }
.chat-input-row textarea { flex: 1; resize: none; }
.chat-input-row .btn { height: 48px; width: 48px; padding: 0; flex-shrink: 0; }
.chat-empty { text-align: center; padding: var(--space-7) 0; color: var(--text-muted); font-size: 13.5px; }
.messages-layout { display: grid; grid-template-columns: 320px 1fr; gap: var(--space-5); align-items: start; }
@media (max-width: 960px) {
  .messages-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .theme-tile-grid { grid-template-columns: 1fr; }
  .error-code { font-size: 72px; }
  .balance-hero__value { font-size: 32px; }
}
