/* influenceur — feuille de style unique. Pas de framework, pas de build. */

:root {
  --fond: #ffffff;
  --texte: #16181d;
  --attenue: #5c6370;
  --trait: #e3e6ea;
  --accent: #1f6feb;
  --entete-fond: #f6f8fa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0f1116;
    --texte: #e6e8ec;
    --attenue: #9aa3b2;
    --trait: #262b34;
    --accent: #58a6ff;
    --entete-fond: #171b22;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem 1.25rem;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- page ambassadeur ---------- */
body.accueil {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  text-align: center;
}
body.accueil h1 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.25rem);
  letter-spacing: -0.02em;
}
.sous-titre { margin: .35rem 0 0; color: var(--attenue); font-size: 1.05rem; }
.note { margin-top: 1.75rem; color: var(--attenue); font-size: .9rem; }
.etat {
  margin-top: .5rem;
  color: var(--attenue);
  font-size: .78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- page admin ---------- */
body.admin { max-width: 1100px; margin: 0 auto; }
body.admin h1 { margin: 0 0 .25rem; font-size: 1.5rem; }
.meta {
  margin: 0 0 2rem;
  color: var(--attenue);
  font-size: .8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
body.admin section { margin-bottom: 2.25rem; }
body.admin h2 {
  margin: 0 0 .6rem;
  font-size: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.compte { color: var(--attenue); font-weight: 400; font-size: .8rem; }

/* Les tables larges defilent DANS leur bloc, jamais la page entiere. */
.defile { overflow-x: auto; border: 1px solid var(--trait); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: .82rem; }
th, td {
  padding: .45rem .65rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--trait);
}
th {
  background: var(--entete-fond);
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .74rem;
  color: var(--attenue);
}
tbody tr:last-child td { border-bottom: 0; }
td.vide {
  color: var(--attenue);
  font-style: italic;
  text-align: center;
  white-space: normal;
  padding: 1.1rem;
}
footer { margin-top: 3rem; color: var(--attenue); font-size: .8rem; }

/* ---------- sprint 3 : compteur, etiquettes, jauges, actions ---------- */
.compteur {
  display: inline-flex;
  align-items: baseline;
  gap: .6rem;
  margin: .25rem 0 1.5rem;
  padding: .55rem .9rem;
  border: 1px solid var(--trait);
  border-radius: 8px;
  background: var(--entete-fond);
}
.compteur strong { font-size: 1.35rem; }
.compteur.compteur-actif { border-color: #d97706; }
.compteur .detail { color: var(--attenue); font-size: .8rem; }

.message {
  margin: 0 0 1.5rem;
  padding: .6rem .9rem;
  border-left: 3px solid var(--accent);
  background: var(--entete-fond);
  border-radius: 0 6px 6px 0;
  font-size: .88rem;
}
.aide { margin: -.25rem 0 .6rem; color: var(--attenue); font-size: .82rem; }

.etiq {
  display: inline-block;
  padding: .1rem .45rem;
  border-radius: 4px;
  font-size: .72rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid var(--trait);
}
.etiq-actif      { color: #15803d; border-color: #15803d55; }
.etiq-suspendu   { color: #b45309; border-color: #b4530955; }
.etiq-en_attente { color: var(--attenue); }
.etiq-arrete     { color: #b91c1c; border-color: #b91c1c55; }

td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.alerte, .alerte { color: #b45309; font-weight: 600; }
.ok { color: #15803d; }

.jauge {
  display: inline-block;
  width: 90px; height: 7px;
  background: var(--trait);
  border-radius: 4px;
  overflow: hidden;
  vertical-align: middle;
}
.jauge > div { height: 100%; background: var(--accent); }
.pct { margin-left: .4rem; font-size: .75rem; color: var(--attenue); }

td.actions { display: flex; gap: .35rem; }
td.actions form { display: inline; margin: 0; }
.btn {
  padding: .28rem .6rem;
  border: 1px solid var(--trait);
  border-radius: 5px;
  background: var(--fond);
  color: var(--texte);
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-ok:hover  { border-color: #15803d; color: #15803d; }
.btn-non:hover { border-color: #b91c1c; color: #b91c1c; }

/* ---------- formulaire d'ajout ---------- */
.formulaire {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
  padding: .9rem;
  border: 1px solid var(--trait);
  border-radius: 8px;
  background: var(--entete-fond);
}
.formulaire label {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .78rem;
  color: var(--attenue);
}
.formulaire input {
  padding: .35rem .5rem;
  border: 1px solid var(--trait);
  border-radius: 5px;
  background: var(--fond);
  color: var(--texte);
  font: inherit;
  font-size: .85rem;
  min-width: 12rem;
}
.formulaire input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
  padding: .1rem .3rem;
  border: 1px solid var(--trait);
  border-radius: 4px;
}
