:root {
  --bg: #0f1115;
  --surface: #171a21;
  --border: #2a2e38;
  --text: #e6e8ec;
  --text-dim: #9aa0ac;
  --accent: #4f8cff;
  --positive: #3fbf6f;
  --negative: #e5534b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.topbar .brand { font-weight: 600; color: var(--text); }
.topbar nav a { color: var(--text-dim); margin-right: 1rem; }
.topbar nav a:hover { color: var(--text); }

.container { max-width: 1000px; margin: 0 auto; padding: 1.5rem; }

h1 { font-size: 1.4rem; margin-bottom: 1rem; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 500; font-size: 0.85rem; text-transform: uppercase; }
tr:hover td { background: rgba(255,255,255,0.02); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  background: rgba(79,140,255,0.15);
  color: var(--accent);
}
.badge.statut-cloture { background: rgba(154,160,172,0.15); color: var(--text-dim); }

.btn {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.btn-danger { background: var(--negative); }

form.form-vertical { display: flex; flex-direction: column; gap: 0.9rem; max-width: 480px; }
.field label { display: block; margin-bottom: 0.3rem; color: var(--text-dim); font-size: 0.85rem; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
}
.field textarea { resize: vertical; min-height: 4rem; }
.form-actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; }

.empty-state { color: var(--text-dim); padding: 2rem 0; text-align: center; }

.text-dim { color: var(--text-dim); }
.text-right { text-align: right; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  margin-bottom: 1.5rem;
}
.stat-value { font-size: 2rem; font-weight: 600; margin-top: 0.3rem; }
.positive { color: var(--positive); }
.negative { color: var(--negative); }

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.chart-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.2rem;
}
.chart-box h2 { font-size: 1rem; margin: 0 0 0.8rem; color: var(--text-dim); font-weight: 500; }
.chart-box canvas { max-height: 260px; }

@media (max-width: 700px) {
  .charts-grid { grid-template-columns: 1fr; }
}

.horizon-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.horizon-tabs a {
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
}
.horizon-tabs a:hover { color: var(--text); text-decoration: none; }
.horizon-tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
