/* ── DA commune — SaaS épuré sombre ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #101114;
  --surface: #17181d;
  --surface2: #1d1f26;
  --border: rgba(255,255,255,.07);
  --border-strong: rgba(255,255,255,.14);
  --text: #ececf1;
  --muted: #8b8e98;
  --accent: #e8643c;
  --green: #4ade80;
  --yellow: #eab308;
  --red: #f87171;
}
html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
  font-feature-settings: 'tnum';
}
a { color: var(--accent); text-decoration: none; }

/* ── Navigation ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(16,17,20,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  height: 52px;
  display: flex; align-items: center; gap: 4px;
  padding: 0 32px;
}
.nav a {
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  padding: 6px 14px; border-radius: 8px; transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); background: rgba(255,255,255,.06); }
.nav-status {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.nav-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }

.main { max-width: 1440px; margin: 0 auto; padding: 20px 32px 80px; }

/* ── Switch de vue (segmented) ── */
.seg { display: inline-flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  font-size: 12.5px; font-weight: 500; padding: 5px 14px; border-radius: 7px;
  font-family: inherit; transition: color .15s, background .15s;
}
.seg button.active { background: var(--surface); color: var(--text); }

.empty {
  text-align: center; color: var(--muted); font-size: 13.5px;
  padding: 36px 20px; border: 1px dashed var(--border-strong); border-radius: 12px;
}
.empty b { color: var(--text); }

/* ── Cartes & métriques ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 16px;
}
.card h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 13px; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
}
.metric .label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.metric .value { font-size: 22px; font-weight: 600; letter-spacing: -.3px; }
.metric .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.metric .hint.up { color: var(--green); }
.metric .hint.down { color: var(--red); }

/* ── Héros (Aperçu) ── */
.hero {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 30px 32px; margin-bottom: 16px;
}
.hero .kicker { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 10px; }
.hero .amount { font-size: 44px; font-weight: 700; letter-spacing: -1.5px; line-height: 1.05; }
.hero .amount .unit { font-size: 26px; font-weight: 600; color: var(--muted); }
.hero .mode { font-size: 14px; font-weight: 600; margin-top: 8px; }
.hero .mode.boost { color: var(--green); }
.hero .mode.normal { color: var(--yellow); }
.hero .mode.low { color: var(--muted); }
.hero .points { margin-top: 16px; display: flex; flex-direction: column; gap: 7px; }
.hero .points div { font-size: 13.5px; color: var(--muted); }
.hero .points b { color: var(--text); font-weight: 600; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; line-height: 1.6;
}
.badge.boost  { background: rgba(74,222,128,.12); color: var(--green); }
.badge.normal { background: rgba(234,179,8,.12); color: var(--yellow); }
.badge.low    { background: rgba(139,142,152,.14); color: var(--muted); }
.badge.accent { background: rgba(232,100,60,.12); color: var(--accent); }

/* ── Tableaux ── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: .6px; font-weight: 500;
  padding: 8px 10px; border-bottom: 1px solid var(--border-strong);
}
td { padding: 9px 10px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }
td.num { white-space: nowrap; }
.pos { color: var(--green); }
.neg { color: var(--red); }

.table-scroll { max-height: 460px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.table-scroll th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.table-scroll td:first-child, .table-scroll th:first-child { padding-left: 16px; white-space: nowrap; }

.chart-wrap { position: relative; height: 240px; }

/* ── Jauge réserve ── */
.gauge { height: 10px; background: var(--surface2); border-radius: 6px; overflow: hidden; margin: 10px 0 6px; }
.gauge .fill { height: 100%; background: var(--accent); border-radius: 6px; transition: width .4s; }

/* ── Zone verrouillée ── */
.locked {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px dashed var(--border-strong);
  border-radius: 14px; padding: 18px 22px; margin-bottom: 16px;
}
.locked .ico { font-size: 20px; color: var(--muted); }
.locked .body { flex: 1; }
.locked .body .t { font-size: 13.5px; font-weight: 600; }
.locked .body .d { font-size: 12.5px; color: var(--muted); }
.locked button {
  background: transparent; border: 1px solid var(--border-strong); color: var(--muted);
  border-radius: 8px; padding: 7px 14px; font-size: 12.5px; cursor: not-allowed;
}

/* ── Blocs repliables ── */
details.fold { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 16px; }
details.fold > summary {
  list-style: none; cursor: pointer; padding: 18px 24px;
  font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .chev { margin-left: auto; color: var(--muted); transition: transform .2s; font-weight: 400; }
details.fold[open] > summary .chev { transform: rotate(90deg); }
details.fold > .fold-body { padding: 0 24px 22px; }

.note {
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; margin-top: 20px;
}

@media (max-width: 960px) {
  .nav { padding: 0 16px; }
  .main { padding: 14px 16px 60px; }
}

.loading { text-align: center; color: var(--muted); padding: 70px 0; font-size: 14px; }
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--surface2); border-top-color: var(--accent);
  border-radius: 50%; margin: 0 auto 14px; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.err { color: var(--red); text-align: center; padding: 40px 0; }
