/* ---------- GLOBAL ---------- */

:root {
  --bg: #0f172a;
  --card: #111827;
  --table: #1f2933;
  --border: #334155;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --green: #22c55e;
  --red: #ef4444;
}

* {
  box-sizing: border-box;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

body {
  margin: 0;
  padding: 20px;
  background: linear-gradient(180deg, #020617, var(--bg));
  color: var(--text);
}

/* ---------- TITRE ---------- */

h1 {
  text-align: center;
  margin-bottom: 25px;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- CONTROLES ---------- */

.controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 25px;
}

.controls label {
  font-size: 0.9rem;
  color: var(--muted);
}

.controls input[type="date"] {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
}

button {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: #020617;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.35);
}

/* ---------- TABLE ---------- */

table {
  width: 100%;
  max-width: 1200px;
  margin: auto;
  border-collapse: collapse;
  background: var(--table);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

th,
td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

th {
  background: #020617;
  font-weight: 600;
  color: var(--accent);
}

.TitreItem {
  text-align: left;
  font-weight: 500;
  color: var(--text);
}

/* Ligne de séparation des blocs */
tr:nth-child(6),
tr:nth-child(7) {
  border-top: 2px solid var(--accent);
}

/* Hover ligne */
tbody tr:hover td {
  background: rgba(56, 189, 248, 0.05);
}

/* ---------- VALEURS ---------- */

label {
  display: inline-block;
  min-width: 50px;
  font-weight: 500;
}

/* Couleurs dynamiques JS */
.valeur-positive {
  color: var(--red);
  font-weight: 600;
}

.valeur-negative {
  color: var(--green);
  font-weight: 600;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 900px) {
  table {
    font-size: 0.85rem;
  }

  th,
  td {
    padding: 8px 6px;
  }
}

.date-header {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.95rem;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #f8f9fa;
}

.date-header:focus {
  outline: none;
  border-color: #0077ff;
  box-shadow: 0 0 4px rgba(0,119,255,0.4);
}

.loading {
  font-size: 0.75rem;
  color: #0077ff;
  margin-top: 4px;
}

.hidden {
  display: none;
}
