/* ============================================================
   Dashboard trading — thème sombre
   Fond #0b1220, texte clair, accents bleu/vert
   ============================================================ */

:root {
  --bg:        #0b1220;   /* fond principal */
  --bg-card:   #121a2e;   /* fond des cartes */
  --bg-row:    #1a2438;   /* lignes au survol */
  --border:    #24304a;   /* bordures discrètes */
  --text:      #e6ecf5;   /* texte clair */
  --text-dim:  #8a97ad;   /* texte secondaire */
  --blue:      #3b82f6;   /* accent bleu */
  --green:     #22c55e;   /* accent vert (gain / live) */
  --red:       #ef4444;   /* perte */
  --amber:     #f59e0b;   /* alerte / nouveau */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  min-height: 100vh;
}

/* ---- En-tête ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.status { display: flex; align-items: center; gap: 12px; }
.clock { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: 13px; }
.last-update { color: var(--text-dim); font-size: 12px; }

/* Spinner discret */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Grille de cartes ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  padding: 16px 20px;
  max-width: 1600px;
  margin: 0 auto;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 15px; font-weight: 600; }
.badge {
  background: var(--bg-row);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.card-body {
  padding: 6px 0;
  max-height: 60vh;
  overflow-y: auto;
}

/* ---- Lignes (items) ---- */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(36,48,74,.5);
  gap: 12px;
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--bg-row); }

.row-main { min-width: 0; flex: 1; }
.row-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.row-right { text-align: right; white-space: nowrap; }

/* Scores en direct */
.score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.live-tag {
  display: inline-block;
  background: rgba(34,197,94,.15);
  color: var(--green);
  border: 1px solid rgba(34,197,94,.4);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 6px;
}

/* Marchés — cote / prix */
.price {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--blue);
}
.new-tag {
  display: inline-block;
  background: rgba(245,158,11,.15);
  color: var(--amber);
  border: 1px solid rgba(245,158,11,.4);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
}

/* Positions — gain / perte */
.pnl-pos { color: var(--green); font-weight: 700; }
.pnl-neg { color: var(--red); font-weight: 700; }

/* États vides / erreurs */
.empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}
.error {
  padding: 16px;
  text-align: center;
  color: var(--red);
  font-size: 13px;
}

.footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  padding: 16px;
}

/* Scrollbar discrète */
.card-body::-webkit-scrollbar { width: 8px; }
.card-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.card-body::-webkit-scrollbar-track { background: transparent; }
