/* 🎨 THÈME GÉNÉRAL (style sombre TradingView) */
:root {
  --bg: #0d1117;
  --panel: #11161f;
  --panel-alt: #161b22;
  --border: #30363d;
  --text: #c9d1d9;
  --text-soft: #8b949e;
  --accent: #1f6feb;
  --radius: 8px;
  --shadow: 0 0 12px rgba(0,0,0,0.25);
}

/* Reset */
body, h1, h2, h3, p, ul {
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
}

#app {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* HEADER */
header {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}
header h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 6px;
}
#last-update {
  font-size: 14px;
  color: var(--text-soft);
}

/* PANELS */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.panel h2 {
  font-size: 20px;
  margin-bottom: 15px;
}

/* TABLE FIXED INCOME */
#rates-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
}
#rates-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--panel-alt);
  border-bottom: 1px solid var(--border);
}
#rates-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

/* NEWS LIST */
#news-list {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 5px;
}
#news-list div {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

/* GEO LIST */
#geo-list {
  list-style: none;
}
#geo-list li {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

/* TRADINGVIEW BLOCK */
.tv-block {
  /* format type TradingView 960 × 480 */
  width: 960px;          /* largeur fixe */
  max-width: 100%;       /* sécurité si écran plus petit */
  height: 480px;         /* hauteur correspondant au preview */
  margin: 8px auto;      /* centre le widget dans le panneau */

  background: #0e1523;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* le widget remplit le rectangle défini ci-dessus */
.tradingview-widget-container,
.tradingview-widget-container__widget {
  width: 100% !important;
  height: 100% !important;
}

/* ==== Palette TradingView Dark pour tout le site ==== */

/* fond global très sombre */
body {
  background-color: #050608;   /* proche du noir TradingView */
  color: #d1d4dc;
}

/* conteneur principal */
#app {
  background-color: #050608;
}

/* header */
header {
  background-color: #131722;
  border-bottom: 1px solid #2a2e39;
}

/* panneaux (Fixed Income, Macro Surprise, Géo, etc.) */
.panel {
  background-color: #131722;
  border: 1px solid #2a2e39;
}

/* titres de panneaux */
.panel h2 {
  color: #d1d4dc;
}

/* tables (bloc taux) */
table {
  background-color: #131722;
  color: #d1d4dc;
  border-collapse: collapse;
}

th {
  background-color: #1e222d;
  color: #d1d4dc;
  border-bottom: 1px solid #2a2e39;
}

td {
  border-top: 1px solid #2a2e39;
}

/* bloc TradingView dans le panneau */
.tv-block {
  background-color: #131722;
  border: 1px solid #2a2e39;
  margin-top: 8px;
  width: 960px;
  max-width: 100%;
  height: 480px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
}

/* ==== Override total : fond noir type TradingView ==== */

body,
#app {
  background-color: #0F0F0F !important;  /* même noir que le widget */
  color: #d1d4dc !important;
}

/* Panneaux (FX & Or, Indices, etc.) */
.panel {
  background-color: #0F0F0F !important;
  border: 1px solid #202020 !important;
}

/* Bloc qui contient le widget TradingView */
.tv-block {
  background-color: #0F0F0F !important;
  border: 0 !important;
  margin-top: 8px;
  margin-left: auto;
  margin-right: auto;
}

/* En-tête si tu en as un */
header {
  background-color: #0F0F0F !important;
  border-bottom: 1px solid #202020 !important;
}

#panel-calendar .tv-block {
  height: 420px;
}

/* Liens dans le bloc "News filtrées" */
#panel-news a,
#panel-news a:visited {
  color: #ffffff !important;      /* blanc forcé */
  text-decoration: none;
}

#panel-news a:hover {
  text-decoration: underline;
  color: #ffffff !important;
}

/* Header du bloc News filtrées */
.news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* Bouton "Toutes les news" */
.btn-news-archive {
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #374151;
  background-color: #111827;
  color: #f9fafb;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.btn-news-archive:hover {
  background-color: #1f2937;
  border-color: #4b5563;
}

/* Archive */
.archive-day {
  margin-bottom: 2rem;
}

.archive-list {
  list-style: none;
  padding-left: 0;
}

.archive-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #222;
}

.archive-time {
  color: #aaa;
  min-width: 4.5rem;
}

.archive-source {
  color: #ccc;
  font-weight: 500;
  margin-right: 0.5rem;
}

.archive-tag {
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* couleurs tags */
.tag-macro {
  background: rgba(0, 122, 255, 0.15);
  color: #4da3ff;
}

.tag-geo {
  background: rgba(255, 59, 48, 0.15);
  color: #ff6b6b;
}

.tag-energy {
  background: rgba(255, 149, 0, 0.15);
  color: #ffb34d;
}

.tag-markets {
  background: rgba(52, 199, 89, 0.15);
  color: #63d27a;
}

.archive-title {
  color: #fff;
  text-decoration: none;
}

.archive-title:hover {
  text-decoration: underline;
}

/* petit bouton retour */
.btn-small {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 0.4rem;
  border: 1px solid #333;
  color: #eee;
  text-decoration: none;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Barre de filtres archive (style Bloomberg) */
.archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: center;
}

.archive-filters label {
  font-size: 0.9rem;
  color: #ccc;
}

.archive-filters select {
  margin-left: 0.4rem;
  background-color: #111;
  color: #eee;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.85rem;
}

/* Barre de navigation sous le titre du terminal */
.top-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 0 20px 10px;
}
