/* ── Tokens identité dashboard ───────────────────────────── */
:root {
  --blue:      #018ffa;
  --blue-dk:   #0075d1;
  --blue-50:   #e8f4ff;
  --blue-100:  #bfdfff;
  --gold:      #feb019;
  --navy:      #0f172a;
  --text:      #0f172a;
  --text-2:    #374151;
  --text-3:    #64748b;
  --text-4:    #94a3b8;
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --border:    #e2e8f0;
  --border-lt: #f1f5f9;
  --r:         12px;
  --r-sm:      8px;
  --sh-sm:     0 2px 6px rgba(0,0,0,.07);
  --sh:        0 4px 12px rgba(0,0,0,.09);
  --tr:        .18s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── Conteneur principal ─────────────────────────────────── */
.full-container {
  display: flex;
  flex-direction: column;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto 0 0;
  gap: 20px;
}

/* ── Top container → Hero banner ─────────────────────────── */
.top-container {
  background: linear-gradient(135deg, #013a6b 0%, #0163b8 55%, #018ffa 100%);
  border-radius: var(--r);
  padding: 24px 28px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.top-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(254,176,25,.15) 0%, transparent 60%);
  pointer-events: none;
}

.top-container h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: -.02em;
  position: relative;
}
.top-container h3 {
  font-size: .9rem;
  color: rgba(255,255,255,.72);
  font-weight: 400;
  margin-bottom: 20px;
  position: relative;
}

/* ── KPI cells ───────────────────────────────────────────── */
.cells-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
}
.cell {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.22);
  border-bottom: 3px solid var(--gold);
  border-radius: var(--r-sm);
  padding: 14px 20px;
  flex: 1;
  min-width: 150px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: background var(--tr);
}
.cell:hover { background: rgba(255,255,255,.22); }

.cell-title {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.75);
  margin-bottom: 6px;
}
.cell-content {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}

/* ── Zone centrale gauche / droite ───────────────────────── */
.detail-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
}

/* ── Panneau gauche ──────────────────────────────────────── */
.left-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  padding: 20px;
  flex: 0 0 auto;
  min-width: 290px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Liste des supports ──────────────────────────────────── */
.list_supports { display: flex; flex-direction: column; }
.ls-name  { flex: 1; min-width: 0; }
.ls-ratio { color: var(--text-2); font-weight: 600; font-size: .82rem;
            font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }

/* ── Sélecteur de portefeuille (banner) ──────────────────── */
.banner-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 1;
}
.banner-switcher-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.8);
  white-space: nowrap;
}
.supports-buttons-form { display: flex; }
.supports-button {
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--tr), border-color var(--tr);
}
.supports-button:hover {
  background: rgba(0,0,0,.4);
  border-color: rgba(255,255,255,.7);
}
.supports-button:active { background: rgba(0,0,0,.5); }

/* ── Panneau droit (graphique) ───────────────────────────── */
.right-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  padding: 20px;
  position: relative;
}

#chart {
  width: 100%;
  flex: 1;
  min-height: 320px;
  max-height: 500px;
}
#chart .u-title {
  font-size: 14px;
  text-align: left;
  color: var(--text);
}

/* ── Tooltip ─────────────────────────────────────────────── */
.tt {
  position: absolute;
  pointer-events: none;
  font: 600 12px/1.5 system-ui, sans-serif;
  color: #fff;
  background: var(--navy);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  box-shadow: var(--sh);
  display: none;
  z-index: 100;
  min-width: 120px;
}
.tt-color {
  --couleur: var(--blue);
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--couleur);
}
.tt-title { margin-bottom: 4px; white-space: nowrap; color: rgba(255,255,255,.65); font-size: .72rem; }
.tt-line  { display: flex; align-items: center; gap: 6px; }
.tt-label { font-weight: 400; white-space: nowrap; }
.tt-value { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ── Bottom container ────────────────────────────────────── */
.bottom-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  padding: 28px;
  text-align: center;
}
.bottom-container h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}
.bottom-container ul {
  list-style: none;
  padding: 0;
  margin: 0 auto 24px;
  width: fit-content;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bottom-container ul li {
  font-size: .9rem;
  color: var(--text-2);
  padding-left: 22px;
  position: relative;
}
.bottom-container ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 700;
}
.bottom-container .inscription {
  padding: 11px 28px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--tr), transform var(--tr);
}
.bottom-container .inscription:hover { background: var(--blue-dk); transform: translateY(-1px); }
.bottom-container .inscription:active { transform: scale(0.98); }

/* ════════════════════════════════════════════════════════════════
   MODULE DE CONTRIBUTION
════════════════════════════════════════════════════════════════ */
.contrib-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  padding: 20px 24px;
}

.contrib-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  margin-bottom: 14px;
}
.contrib-title svg { opacity: 0.6; }

.contrib-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.72rem;
  color: var(--text-3);
  flex-wrap: wrap;
}
.contrib-legend-item { display: flex; align-items: center; gap: 5px; }
.contrib-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.contrib-dot-weight { background: #94a3b8; }
.contrib-dot-perf   { background: var(--blue); }
.contrib-dot-pp     { background: var(--gold); }

.contrib-list { display: flex; flex-direction: column; gap: 2px; }

.contrib-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 4px;
  border-radius: var(--r-sm);
  transition: background var(--tr);
}
.contrib-row:hover { background: var(--border-lt); }

/* capsule-ticker utilisée dans les modules contrib et liste */
.capsule-ticker {
  display: inline-flex;
  justify-content: center; /* centre le texte si min-width forcé par JS */
  font-weight: 700;
  font-size: 0.68rem;
  background: var(--gold);
  padding: 3px 7px;
  color: #fff;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;   /* quand utilisé comme <a> */
}
a.capsule-ticker:hover { color: var(--blue); opacity: 1; }

a.contrib-name {
  text-decoration: none;
  color: var(--text-2);
}
a.contrib-name:hover { color: var(--blue); text-decoration: none; }


.contrib-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.contrib-name {
  font-size: 0.82rem;
  color: var(--text-2);
}

.contrib-mid { flex: 1 1 0; min-width: 0; }
.contrib-bar-group { display: flex; flex-direction: column; gap: 5px; }
.contrib-bar-track {
  width: 100%;
  height: 6px;
  background: var(--border-lt);
  border-radius: 99px;
  /* pas d'overflow:hidden — permet l'affichage du tooltip */
  position: relative;
  cursor: default;
}

/* Tooltip au survol des barres */
.contrib-bar-track[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: system-ui, sans-serif;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
}
.contrib-bar-track[data-tip]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #0f172a;
  z-index: 200;
  pointer-events: none;
}

.contrib-bar { height: 100%; border-radius: 99px; transition: width 0.5s ease; }
/* Barres — perf. individuelle */
.cb-perf-pos { background: var(--blue); }
.cb-perf-neg { background: #f87171; }
/* Barres — contribution (pp) */
.cb-pp-pos   { background: var(--gold); }
.cb-pp-neg   { background: #f87171; }

/* Largeur fixe pour aligner les colonnes de chiffres */
.contrib-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  flex-shrink: 0;
  justify-content: flex-end;
}
/* Colonnes dimensionnées sur le contenu */
.contrib-weight { color: var(--text-4); white-space: nowrap; flex-shrink: 0; text-align: right; }
.contrib-val-pos { color: var(--blue); font-weight: 600; white-space: nowrap; flex-shrink: 0; text-align: right; }
.contrib-val-neg { color: #dc2626;     font-weight: 600; white-space: nowrap; flex-shrink: 0; text-align: right; }
.contrib-pp-pos  { color: var(--gold); font-weight: 700; white-space: nowrap; flex-shrink: 0; text-align: right; }
.contrib-pp-neg  { color: #dc2626;     font-weight: 700; white-space: nowrap; flex-shrink: 0; text-align: right; }

.contrib-note {
  font-size: 0.72rem;
  color: var(--text-4);
  margin-top: 12px;
  font-style: italic;
}

/* ── Détail par support ──────────────────────────────────── */
.dc-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  padding: 20px 24px;
}
.dc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-4);
  margin-bottom: 16px;
}
.dc-title svg { opacity: 0.6; }
.dc-carousel {
  position: relative;
}
.dc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-sm);
  color: var(--text-2);
  transition: background var(--tr), border-color var(--tr);
  flex-shrink: 0;
}
.dc-arrow:hover { background: var(--blue-50); border-color: var(--blue); color: var(--blue); }
.dc-arrow-left  { left: -15px; }
.dc-arrow-right { right: -15px; }
.dc-grid {
  display: flex;
  flex-direction: row;
  gap: 14px;
  overflow: hidden;
}
.dc-card {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 240px;
}
.dc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dc-nom {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  text-decoration: none !important;
}
.dc-nom:hover { color: var(--blue); text-decoration: none !important; }
.dc-sector {
  font-size: 0.72rem;
  color: var(--text-3);
  margin-top: -4px;
}
.dc-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.dc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.79rem;
}
.dc-label { color: var(--text-3); }
.dc-val   { font-weight: 500; color: var(--text); text-align: right; }
.dc-pos   { color: #16a34a; font-weight: 600; }
.dc-neg   { color: #b91c1c; font-weight: 600; }
.dc-reco-buy  { color: #16a34a; font-weight: 700; }
.dc-reco-hold { color: var(--gold); font-weight: 700; }
.dc-reco-sell { color: #b91c1c; font-weight: 700; }
.dc-note { font-size: .68rem; font-weight: 400; color: var(--text-4); margin-left: 3px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 950px) {
  .full-container { padding: 16px; gap: 16px; }
  .top-container h2 { font-size: 1.2rem; }
  .detail-container { flex-direction: column-reverse; }
  .left-container { min-width: 0; max-width: 100%; }
  .cell { min-width: 140px; }
  .cell-content { font-size: 1.1rem; }
}
@media (max-width: 640px) {
  .cell { min-width: calc(50% - 6px); }
  .cells-container { gap: 6px; }
  .contrib-left { flex: 0 0 150px; }
  .contrib-right { gap: 8px; }
  .contrib-weight { display: none; }
}

@media (max-width: 480px) {
  .contrib-left { flex: 0 0 110px; }
  .contrib-name { display: none; }
  .contrib-pp { min-width: 44px; }
}
