:root {
  --bg: #f5f6fa; --carte: #fff; --texte: #1c2030; --doux: #636b80; --ligne: #e2e5ee;
  --accent: #4f46e5; --accent-txt: #fff; --danger: #b42318; --ok-bg: #e7f6ec; --ok-txt: #14642f;
  --err-bg: #fdecea; --err-txt: #a32015; --badge: #eef0fb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141c; --carte: #1b1e29; --texte: #e8eaf1; --doux: #9aa1b5; --ligne: #2c3040;
    --accent: #7c74ff; --accent-txt: #10121a; --danger: #f97066; --ok-bg: #12301e; --ok-txt: #7fdba0;
    --err-bg: #3a1714; --err-txt: #f9a39b; --badge: #262a3a;
  }
}
* { box-sizing: border-box; }
html { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--texte); line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
p { margin: 0 0 .75rem; }
code { font-size: .92em; overflow-wrap: anywhere; }

.haut { background: var(--carte); border-bottom: 1px solid var(--ligne); }
.haut-in { max-width: 1040px; margin: 0 auto; padding: .7rem 1.25rem; display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.marque { font-weight: 700; color: var(--texte); }
.nav { display: flex; gap: 1rem; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--doux); }
.nav a.actif { color: var(--accent); font-weight: 600; }
.qui { color: var(--doux); font-size: .9rem; display: flex; gap: .75rem; align-items: center; }
.qui form { margin: 0; }
main { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.etroit { max-width: 420px; margin: 3rem auto; padding: 0 1.25rem; }
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; padding: 1.25rem; margin-bottom: 1.25rem; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; padding: 1rem; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.2; }
.stat span { color: var(--doux); font-size: .9rem; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .75rem; }
input[type=text], input[type=email], input[type=password], select {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; font: inherit; font-weight: 400;
  color: var(--texte); background: var(--bg); border: 1px solid var(--ligne); border-radius: 7px;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label.case { font-weight: 400; display: flex; gap: .5rem; align-items: center; }
.btn, button { font: inherit; font-weight: 600; padding: .5rem .95rem; border-radius: 7px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-txt); cursor: pointer; display: inline-block; }
.btn:hover { text-decoration: none; }
.btn.second, button.second { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.lien { background: none; border: 0; padding: 0; color: var(--doux); font-weight: 400; }
.lien:hover { text-decoration: underline; }
.ligne-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.ligne-form label { flex: 1; min-width: 180px; margin-bottom: 0; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.actions form { margin: 0; }

.alerte { padding: .7rem 1rem; border-radius: 7px; margin-bottom: 1rem; overflow-wrap: anywhere; }
.alerte.ok { background: var(--ok-bg); color: var(--ok-txt); }
.alerte.err { background: var(--err-bg); color: var(--err-txt); }
.note { color: var(--doux); font-size: .9rem; }
.badge { background: var(--badge); border-radius: 999px; padding: .1rem .6rem; font-size: .85rem; white-space: nowrap; }
.badge.fort { background: var(--accent); color: var(--accent-txt); font-weight: 600; }
.badge.off { background: var(--err-bg); color: var(--err-txt); }

.tableau { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { text-align: left; color: var(--doux); font-weight: 600; font-size: .85rem; }
th, td { padding: .55rem .6rem; border-bottom: 1px solid var(--ligne); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td form { margin: 0; }
.boite { display: flex; flex-direction: column; gap: .75rem; }
.boite .adresse { font-weight: 600; overflow-wrap: anywhere; }
.boite button { width: 100%; }
.pied-login { margin-top: 1rem; text-align: center; font-size: .9rem; }
.qr { display: block; width: 200px; height: 200px; background: #fff; border-radius: 8px; margin: .5rem 0 1rem; }
details { margin-top: 1rem; }
summary { cursor: pointer; color: var(--danger); font-weight: 600; }
