.badge-regime[data-regime="AGRESSIF"],
#regime-badge.agressif {
  background: rgba(255, 183, 0, 0.15);
  color: #ffb700;
  border: 1px solid rgba(255, 183, 0, 0.45);
  animation: pulse-agressif 1.8s ease-in-out infinite;
}

@keyframes pulse-agressif {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 183, 0, 0.4); }
  50%       { box-shadow: 0 0 0 5px rgba(255, 183, 0, 0); }
}

/* ADDITIONS v2 — API Polling Dashboard SPOT */

.futures-overlay-wrap { position:relative;border-radius:15px;overflow:hidden;margin-bottom:20px; }
.amf-overlay { position:absolute;inset:0;backdrop-filter:blur(5px);background:rgba(5,3,12,.72);display:flex;justify-content:center;align-items:center;z-index:10;font-size:.95rem;font-weight:600;color:var(--text-muted);text-align:center;padding:20px 28px;line-height:1.6; }
.history-nav { display:flex;align-items:center;gap:12px;margin-bottom:18px; }
.history-nav strong { font-size:1.05rem;color:var(--text-main); }
.form-footer { margin-top:20px;display:flex;justify-content:flex-end; }
.page h1 { display:flex;align-items:center;gap:10px;font-size:1rem;color:var(--text-muted);margin-bottom:16px;margin-top:20px;text-transform:uppercase;letter-spacing:.06em; }
.page h1:first-child { margin-top:0; }

/* Signal badges */
.signal-badge { display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;font-size:.72rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase; }
.signal-buy  { background:rgba(46,204,113,.15);color:#2ecc71;border:1px solid rgba(46,204,113,.35); }
.signal-sell { background:rgba(231,76,60,.15);color:#e74c3c;border:1px solid rgba(231,76,60,.35); }
.signal-wait { background:rgba(162,154,184,.1);color:var(--text-muted);border:1px solid rgba(255,255,255,.08); }
.signal-hold { background:rgba(77,163,255,.1);color:var(--accent);border:1px solid rgba(77,163,255,.25); }

/* Sym & Invested */
.sym-badge { font-family:'JetBrains Mono',monospace;font-size:.82rem;font-weight:600;color:var(--gold);letter-spacing:.04em; }
.invested-badge { display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:rgba(46,204,113,.2);color:#2ecc71;font-size:.65rem;font-weight:700;vertical-align:middle;margin-left:4px; }
.empty-row { text-align:center;color:var(--text-soft);font-style:italic;padding:20px !important; }

/* API status dot */
.api-status-dot { display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--text-soft);margin-right:6px;vertical-align:middle;transition:background .3s; }
.api-status-dot.ok    { background:var(--online);box-shadow:0 0 6px var(--online);animation:pulse-green 1.4s ease-in-out infinite; }
.api-status-dot.error { background:var(--danger);box-shadow:0 0 6px var(--danger); }

/* ── Style unifié Positions/Scan — commun SPOT/FUTURES/EQUITIES ─────────────
   Auparavant, ces classes n'existaient QUE dans un <style> injecté par
   api-dashboard-alpaca.js au runtime (donc invisibles ailleurs, et en plus
   en conflit avec .signal-badge déjà défini ci-dessus, le dernier <style>
   chargé écrasant silencieusement l'autre). Centralisées ici : une seule
   source de vérité, utilisée par les 3 renderers (spot/futures/alpaca). */
.font-bold  { font-weight: 700; }
.text-white { color: var(--text-main, #eceff1); }

.badge-side {
  display: inline-block; padding: 2px 9px; border-radius: 5px;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #fff; min-width: 52px; text-align: center;
}
.badge-buy   { background: #00c853; }
.badge-sell  { background: #ff3d00; }
.badge-wait  { background: #546e7a; }
.badge-short { background: #ff3d00; }

.badge-market {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: .68em; font-weight: 700; letter-spacing: .03em;
}
.badge-futures { background: #2d1a00; color: #ffb74d; }
.badge-spot    { background: #1a2d00; color: #aed581; }

.badge-tp {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: .7rem; font-weight: 600; background: #122b40; color: #4fc3f7;
  border: 1px solid #1f4e6e;
}
.badge-trailing {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: .65rem; font-weight: 700; background: rgba(255,183,0,.12);
  color: #ffb700; border: 1px solid rgba(255,183,0,.35); margin-left: 4px;
}
.badge-be {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: .65rem; font-weight: 700; background: rgba(46,204,113,.12);
  color: #2ecc71; border: 1px solid rgba(46,204,113,.35); margin-left: 4px;
}

.crypto-green { color: #00e676; }
.crypto-red   { color: #ff6e40; }

/* Utilitaires génériques (auparavant injectés localement par
   api-dashboard-alpaca.js, maintenant partagés) */
.text-muted  { color: var(--text-muted, #78909c); }
.text-center { text-align: center; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.py-4 { padding-top: 1rem;   padding-bottom: 1rem; }
.small { font-size: .82em; }

.badge-autotuner-changed {
  display: inline-block; padding: 2px 8px; border-radius: 8px;
  font-size: .72em; font-weight: 600; background: rgba(255,193,7,.15);
  color: #ffd54f; border: 1px solid #f9a825;
}
.badge-autotuner-stable {
  display: inline-block; padding: 2px 8px; border-radius: 8px;
  font-size: .72em; font-weight: 600; background: rgba(0,200,83,.12);
  color: #69f0ae; border: 1px solid #00c853;
}

.dot-invested {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #00e676; vertical-align: middle; margin-left: 4px;
}
.row-invested td:first-child { color: var(--accent, #4fc3f7) !important; }

/* Scan table */
#scan-table-spot { table-layout:fixed; }
#scan-table-spot th:nth-child(1),#scan-table-spot td:nth-child(1) { width:30%; }
#scan-table-spot th:nth-child(2),#scan-table-spot td:nth-child(2) { width:20%; }
#scan-table-spot th:nth-child(3),#scan-table-spot td:nth-child(3) { width:15%; }
#scan-table-spot th:nth-child(4),#scan-table-spot td:nth-child(4) { width:35%;font-family:'JetBrains Mono',monospace;font-size:.8rem;color:var(--text-muted); }

/* Positions table */
#positions-table-spot td small { display:block;font-size:.72rem;opacity:.85; }

@keyframes pulse-green { 0%,100%{opacity:1} 50%{opacity:.45} }

/* ── WebPush VAPID — Bouton notifications & Badge régime AutoTuner ─────────── */
#btn-push-subscribe {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem;
  font-size: .8rem;
}
#btn-push-subscribe svg {
  flex-shrink: 0;
  transition: stroke .2s;
}
#btn-push-subscribe.active svg {
  stroke: var(--gold, #f0b90b);
}
#btn-push-subscribe.active #push-btn-label {
  color: var(--gold, #f0b90b);
}

/* Badge régime marché AutoTuner (affiché dans le header) */
.badge-regime {
  display: inline-block;
  padding: .22rem .75rem;
  border-radius: var(--radius-pill);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.badge-regime:not(:empty) { display: inline-block; }
.badge-regime:empty { display: none; }

/* Couleurs selon le régime */
.badge-regime[data-regime="TENDANCE"],
#regime-badge.tendance {
  background: rgba(0, 200, 83, 0.12);
  color: #00c853;
  border: 1px solid rgba(0, 200, 83, 0.35);
}
.badge-regime[data-regime="RANGE"],
#regime-badge.range {
  background: rgba(33, 150, 243, 0.12);
  color: #2196f3;
  border: 1px solid rgba(33, 150, 243, 0.35);
}
.badge-regime[data-regime="CRISE"],
#regime-badge.crise {
  background: rgba(255, 23, 68, 0.12);
  color: var(--danger, #ff1744);
  border: 1px solid rgba(255, 23, 68, 0.4);
  animation: pulse-green .8s infinite;
}
