@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #f5f6fb;
  --bg-soft: #eceefa;
  --panel: #ffffff;
  --panel-alt: #fafaff;
  --border: #e6e8f4;
  --text: #171a2e;
  --text-dim: #6a7086;
  --text-faint: #9aa0b4;

  --primary: #6d5ef8;
  --primary-dark: #4f3ee0;
  --primary-light: #efecff;
  --accent: #14b8a6;
  --accent-light: #dcfaf5;

  --green: #16a673;
  --green-light: #dcfaee;
  --red: #ef4a5f;
  --red-light: #ffe7ea;
  --amber: #f5a524;
  --amber-light: #fff3dd;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(23, 26, 46, 0.05);
  --shadow: 0 6px 24px rgba(30, 34, 70, 0.08);
  --shadow-lg: 0 16px 40px rgba(30, 34, 70, 0.14);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1020;
    --bg-soft: #161933;
    --panel: #191c33;
    --panel-alt: #14162a;
    --border: #2b2f4d;
    --text: #eef0fb;
    --text-dim: #9ba1c2;
    --text-faint: #6d7396;
    --primary: #8a7bff;
    --primary-dark: #6d5ef8;
    --primary-light: #262a4d;
    --accent: #2dd4bf;
    --accent-light: #123833;
    --green: #34d399;
    --green-light: #113a2c;
    --red: #f87171;
    --red-light: #3a1420;
    --amber: #fbbf24;
    --amber-light: #3a2a0d;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1020;
  --bg-soft: #161933;
  --panel: #191c33;
  --panel-alt: #14162a;
  --border: #2b2f4d;
  --text: #eef0fb;
  --text-dim: #9ba1c2;
  --text-faint: #6d7396;
  --primary: #8a7bff;
  --primary-dark: #6d5ef8;
  --primary-light: #262a4d;
  --accent: #2dd4bf;
  --accent-light: #123833;
  --green: #34d399;
  --green-light: #113a2c;
  --red: #f87171;
  --red-light: #3a1420;
  --amber: #fbbf24;
  --amber-light: #3a2a0d;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* ---------- Fond animé (blobs en dégradé) ---------- */

.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.32;
  will-change: transform;
}
.blob-1 { width: 46vw; height: 46vw; top: -14vw; left: -10vw; background: radial-gradient(circle, var(--primary), transparent 70%); animation: blobFloat1 26s ease-in-out infinite; }
.blob-2 { width: 40vw; height: 40vw; top: 20vh; right: -14vw; background: radial-gradient(circle, var(--accent), transparent 70%); animation: blobFloat2 32s ease-in-out infinite; }
.blob-3 { width: 34vw; height: 34vw; bottom: -12vw; left: 20vw; background: radial-gradient(circle, var(--amber), transparent 70%); animation: blobFloat3 22s ease-in-out infinite; opacity: 0.2; }

@keyframes blobFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vw, 8vh) scale(1.15); }
}
@keyframes blobFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-7vw, 6vh) scale(1.1); }
}
@keyframes blobFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4vw, -6vh) scale(1.2); }
}

.app { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .blob { animation: none !important; }
}

/* ---------- Ticker tape façon Bourse ---------- */

.ticker-tape {
  background: var(--text);
  color: var(--bg);
  overflow: hidden;
  white-space: nowrap;
  position: sticky;
  top: 65px;
  z-index: 35;
  border-bottom: 1px solid var(--border);
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  animation: tickerScroll 55s linear infinite;
  padding: 6px 0;
}
.ticker-tape:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border-right: 1px solid rgba(128,128,128,0.25);
}
.ticker-item .ti-symbol { opacity: 0.65; font-weight: 600; }
.ticker-item .ti-up { color: #34d399; }
.ticker-item .ti-down { color: #f87171; }

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ---------- Tilt 3D ---------- */

.tilt-card { transform-style: preserve-3d; transition: transform 0.12s ease-out, box-shadow 0.2s ease; will-change: transform; }

/* ---------- Flash de prix ---------- */

@keyframes flashUp {
  0% { background: var(--green-light); }
  100% { background: transparent; }
}
@keyframes flashDown {
  0% { background: var(--red-light); }
  100% { background: transparent; }
}
.flash-up { animation: flashUp 1s ease-out; border-radius: var(--radius-sm); }
.flash-down { animation: flashDown 1s ease-out; border-radius: var(--radius-sm); }

/* ---------- Mascotte ---------- */

.mascot-float { animation: mascotFloat 3.2s ease-in-out infinite; transform-origin: center; }
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}
.mascot-corner {
  position: absolute;
  top: -10px;
  right: 14px;
  width: 76px;
  height: 76px;
  opacity: 0.9;
  pointer-events: none;
}

/* ---------- Transition de page ---------- */

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-enter { animation: pageEnter 0.35s ease; }

/* ---------- Confettis ---------- */

#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.25s ease, color 0.25s ease;
}

h1, h2, h3, .brand-title, .nav-pill, .stat-value, .signal-verdict {
  font-family: "Manrope", "Inter", sans-serif;
}

a { color: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

.app { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  font-size: 22px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: var(--shadow-sm);
}
.brand-title { font-weight: 800; font-size: 17px; line-height: 1.2; letter-spacing: -0.2px; }
.brand-sub { font-size: 11.5px; color: var(--text-dim); }

.nav-pills {
  display: flex;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.nav-pill {
  border: none;
  background: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-pill:hover { color: var(--text); }
.nav-pill.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }

.search-wrap { position: relative; flex: 1; max-width: 380px; min-width: 180px; }
#search {
  width: 100%;
  padding: 9px 14px 9px 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239aa0b4' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E") no-repeat 12px center;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease;
}
#search:focus { border-color: var(--primary); background-color: var(--panel); }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  padding: 6px;
}
.search-result-item {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-radius: var(--radius-sm);
}
.search-result-item:hover { background: var(--primary-light); }
.search-result-item .muted { color: var(--text-dim); }

.icon-btn {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}
.icon-btn:hover { transform: translateY(-1px) scale(1.04); background: var(--primary-light); }

/* ---------- Layout ---------- */

.layout { display: flex; flex: 1; min-width: 0; }

.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 65px);
  position: sticky;
  top: 65px;
}

.tabs { display: flex; border-bottom: 1px solid var(--border); padding: 8px 8px 0; gap: 2px; flex-wrap: wrap; }
.tab {
  flex: 1;
  min-width: 60px;
  padding: 9px 6px;
  background: none;
  border: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--text); background: var(--bg-soft); }
.tab.active { color: var(--primary); background: var(--primary-light); }

.add-pair { padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.add-pair-row { display: flex; gap: 6px; }
#add-pair-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  outline: none;
  text-transform: uppercase;
}
#add-pair-input:focus { border-color: var(--primary); }
#add-pair-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
#add-pair-btn:hover { background: var(--primary-dark); }
#add-pair-btn:disabled { opacity: 0.6; cursor: default; }
.add-pair-hint { font-size: 10.5px; color: var(--text-dim); margin-top: 7px; line-height: 1.4; }
.add-pair-msg { font-size: 11.5px; margin-top: 6px; min-height: 14px; font-weight: 600; }
.add-pair-msg.error { color: var(--red); }
.add-pair-msg.success { color: var(--green); }

.watch-item-remove {
  border: none;
  background: none;
  color: var(--text-faint);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  flex-shrink: 0;
}
.watch-item-remove:hover { color: var(--red); background: var(--red-light); }

.watchlist { overflow-y: auto; flex: 1; }

.watch-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  gap: 8px;
  transition: background 0.12s ease;
}
.watch-item:hover { background: var(--bg-soft); }
.watch-item.active { background: var(--primary-light); border-left: 3px solid var(--primary); padding-left: 13px; }
.watch-item .wi-left { min-width: 0; }
.watch-item .wi-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.watch-item .wi-symbol { font-size: 11px; color: var(--text-dim); }
.watch-item .wi-right { text-align: right; flex-shrink: 0; }
.watch-item .wi-price { font-size: 13px; font-weight: 700; }
.watch-item .wi-change { font-size: 11px; font-weight: 600; }

.badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.badge.buy-strong { background: var(--green-light); color: var(--green); }
.badge.buy { background: var(--green-light); color: var(--green); opacity: 0.85; }
.badge.neutral { background: var(--bg-soft); color: var(--text-dim); }
.badge.sell { background: var(--red-light); color: var(--red); opacity: 0.85; }
.badge.sell-strong { background: var(--red-light); color: var(--red); }

.up { color: var(--green); }
.down { color: var(--red); }

.content { flex: 1; padding: 20px 24px 60px; min-width: 0; }

/* ---------- Tip banner ---------- */

.tip-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(120deg, var(--primary-light), var(--accent-light));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 13px;
}
.tip-banner .tip-emoji { font-size: 22px; flex-shrink: 0; }
.tip-banner .tip-label { font-weight: 800; color: var(--primary-dark); margin-right: 6px; }

/* ---------- Mood banner ---------- */

.mood-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.mood-emoji { font-size: 38px; }
.mood-text .mood-title { font-weight: 800; font-size: 16px; }
.mood-text .mood-sub { font-size: 12.5px; opacity: 0.85; margin-top: 2px; }
.mood-stats { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.mood-stat { text-align: right; }
.mood-stat .ms-val { font-weight: 800; font-size: 15px; }
.mood-stat .ms-label { font-size: 10.5px; opacity: 0.8; }

/* ---------- Asset header ---------- */

.asset-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.asset-title { display: flex; align-items: baseline; gap: 10px; }
.asset-title h1 { margin: 0; font-size: 24px; letter-spacing: -0.3px; }
.asset-symbol-tag {
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 600;
}
.asset-price-block { text-align: right; }
.asset-price { font-size: 27px; font-weight: 800; letter-spacing: -0.4px; }
.asset-change { font-size: 14px; font-weight: 700; }

/* ---------- Panels ---------- */

.panel-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}
.chart-panel { grid-column: 1; grid-row: span 2; }
.signal-panel { grid-column: 2; grid-row: span 2; }
.indicators-panel { grid-column: 1; }
.news-panel { grid-column: 2; }
.news-panel:last-of-type { grid-column: 1 / span 2; }

.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.panel-header h2 { margin: 0; font-size: 13.5px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 6px; }

.period-buttons button {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  margin-left: 4px;
  transition: all 0.15s ease;
}
.period-buttons button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.chart-container { position: relative; width: 100%; }
.chart-container-lg { height: 320px; }
.chart-container-sm { height: 160px; }
.chart-container canvas { position: absolute; top: 0; left: 0; width: 100% !important; height: 100% !important; }

/* Info tooltip */
.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 800;
  cursor: help;
  position: relative;
  font-family: "Inter", sans-serif;
}
.info-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 220px;
  background: var(--text);
  color: var(--bg);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 60;
  box-shadow: var(--shadow-lg);
}
.info-tip:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Gauge */

.gauge-wrap { margin: 6px 0 14px; }
.gauge-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--text-faint), var(--accent), var(--green));
}
.gauge-cursor {
  position: absolute;
  top: -5px;
  width: 5px;
  height: 20px;
  background: var(--text);
  border: 2px solid var(--panel);
  border-radius: 3px;
  left: 50%;
  transform: translateX(-50%);
  transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-sm);
}
.gauge-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-dim); margin-top: 6px; font-weight: 600; }

.signal-verdict { font-size: 21px; font-weight: 800; margin: 6px 0 10px; letter-spacing: -0.3px; }
.signal-verdict.buy-strong, .signal-verdict.buy { color: var(--green); }
.signal-verdict.neutral { color: var(--text-dim); }
.signal-verdict.sell, .signal-verdict.sell-strong { color: var(--red); }

.signal-reasons { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.65; color: var(--text); }
.disclaimer { font-size: 11px; color: var(--text-faint); margin-top: 14px; line-height: 1.4; }

.news-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.news-list li { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.news-list li:last-child { border-bottom: none; }
.news-list a { color: var(--text); text-decoration: none; font-weight: 700; }
.news-list a:hover { color: var(--primary); }
.news-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; }

.loading { padding: 16px; color: var(--text-dim); font-size: 13px; }

/* Skeleton loading shimmer */
.skeleton {
  background: linear-gradient(90deg, var(--bg-soft) 25%, var(--border) 37%, var(--bg-soft) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- Mon PEA page ---------- */

.pea-page { flex: 1; padding: 20px 24px 60px; max-width: 1280px; margin: 0 auto; width: 100%; }

.pea-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), #9b6bff 55%, var(--accent));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-lg);
}
.pea-hero h1 { margin: 0 0 6px; font-size: 25px; letter-spacing: -0.4px; }
.pea-hero p { margin: 0 0 18px; font-size: 13.5px; opacity: 0.9; max-width: 640px; line-height: 1.5; }

.pea-calc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.pea-calc-field {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  padding: 12px 14px;
  backdrop-filter: blur(6px);
}
.pea-calc-field label { display: block; font-size: 11px; font-weight: 700; opacity: 0.85; margin-bottom: 6px; }
.pea-calc-field input {
  width: 100%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  outline: none;
}
.pea-calc-field input::placeholder { color: rgba(255,255,255,0.6); }
.pea-calc-result { grid-column: 1 / -1; margin-top: 4px; }

.pea-progress-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.2);
  overflow: hidden;
  margin-top: 6px;
}
.pea-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #fff;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pea-progress-caption { font-size: 12px; margin-top: 8px; opacity: 0.9; }

.pea-countdown {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
}
.pea-countdown .pc-emoji { font-size: 20px; }

.pea-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
  align-items: start;
}

.pea-form {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 14px;
}
.pea-form input {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.pea-form input:focus { border-color: var(--primary); background: var(--panel); }
.pea-form button {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.pea-form button:hover { background: var(--primary-dark); }
.pea-form-msg { font-size: 11.5px; font-weight: 600; margin: -6px 0 12px; min-height: 14px; }
.pea-form-msg.error { color: var(--red); }
.pea-form-msg.success { color: var(--green); }

.pea-summary-row {
  display: flex;
  gap: 22px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.pea-summary-stat .ps-label { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.pea-summary-stat .ps-val { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }

table.pea-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.pea-table th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-faint);
  font-weight: 700;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
table.pea-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); }
table.pea-table tr:last-child td { border-bottom: none; }
table.pea-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pea-remove-btn {
  border: none;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 6px;
}
.pea-remove-btn:hover { color: var(--red); background: var(--red-light); }

.pea-donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pea-donut-legend { display: flex; flex-direction: column; gap: 6px; width: 100%; font-size: 12px; }
.pea-donut-legend-item { display: flex; align-items: center; gap: 8px; }
.pea-donut-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tip-card {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tip-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tip-card .tc-emoji { font-size: 20px; margin-bottom: 6px; display: block; }
.tip-card h3 { margin: 0 0 6px; font-size: 13.5px; }
.tip-card p { margin: 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }

.etf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.etf-card {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.etf-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
.etf-card .ec-name { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.etf-card .ec-symbol { font-size: 11px; color: var(--text-dim); margin-bottom: 10px; }
.etf-card .ec-price-row { display: flex; justify-content: space-between; align-items: center; }
.etf-card .ec-price { font-size: 16px; font-weight: 800; }
.etf-card .ec-change { font-size: 12px; font-weight: 700; }

.section-title { font-size: 15px; font-weight: 800; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.pea-eligibility-note {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 10px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; max-height: 260px; position: static; }
  .panel-grid { grid-template-columns: 1fr; }
  .chart-panel, .signal-panel, .indicators-panel, .news-panel, .news-panel:last-of-type { grid-column: 1; grid-row: auto; }
  .asset-price-block { text-align: left; }
  .pea-grid { grid-template-columns: 1fr; }
  .pea-form { grid-template-columns: 1fr 1fr; }
  .mood-stats { margin-left: 0; }
}

/* ---------- Auth (connexion / inscription) ---------- */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 26px;
  box-shadow: var(--shadow-lg);
}

.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 12.5px;
  padding: 8px 6px;
  border-radius: 7px;
  cursor: pointer;
}

.auth-tab.active { background: var(--primary); color: #fff; }

.auth-form { grid-template-columns: 1fr; }
.auth-form input { width: 100%; }
.auth-form button { width: 100%; }

.auth-link {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  margin-top: 14px;
  cursor: pointer;
}

.auth-link:hover { color: var(--primary); }

.auth-hint {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 14px;
}

.user-email {
  font-size: 12px;
  color: var(--text-dim);
  margin-right: 2px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Admin ---------- */

.role-badge, .status-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.role-badge.admin { background: var(--primary-light); color: var(--primary-dark); }
.role-badge.user { background: var(--panel-alt); color: var(--text-dim); }
.status-badge.active { background: var(--green-light); color: var(--green); }
.status-badge.disabled { background: var(--red-light); color: var(--red); }

.admin-action-btn {
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  margin-right: 6px;
}

.admin-action-btn:hover { border-color: var(--primary); color: var(--primary); }
