:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #22c55e;
  --vert: #22c55e;
  --orange: #f59e0b;
  --rouge: #ef4444;
  --noir: #475569;
  --border: #334155;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
body.light {
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }
header.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid var(--border);
}
header.topbar h1 { font-size: 18px; margin: 0; }
nav.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--border); }
nav.tabs button {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
nav.tabs button.active { background: var(--accent); border-color: var(--accent); color: #06210f; font-weight: 600; }
main { flex: 1; padding: 20px; max-width: 1100px; width: 100%; margin: 0 auto; }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; margin-bottom: 16px;
}
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { text-align: center; }
.stat .value { font-size: 28px; font-weight: 700; }
.stat .label { color: var(--muted); font-size: 13px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--text); font-size: 14px;
}
button.primary {
  background: var(--accent); color: #06210f; border: none; padding: 10px 18px;
  border-radius: 8px; font-weight: 600; cursor: pointer; margin-top: 14px;
}
button.secondary {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; display: inline-block; }
.badge.vert, .badge.valide, .badge.actif { background: rgba(34,197,94,.15); color: var(--vert); }
.badge.orange { background: rgba(245,158,11,.15); color: var(--orange); }
.badge.rouge, .badge.annulee, .badge.refusee, .badge.suspendu, .badge.supprime { background: rgba(239,68,68,.15); color: var(--rouge); }
.badge.noir { background: rgba(71,85,105,.25); color: #cbd5e1; }
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { width: 340px; }
.error-msg { color: var(--rouge); font-size: 13px; margin-top: 8px; }
.result-panel { text-align: center; padding: 30px 10px; border-radius: 12px; margin-top: 16px; }
.result-panel.vert { background: rgba(34,197,94,.12); }
.result-panel.orange { background: rgba(245,158,11,.12); }
.result-panel.rouge { background: rgba(239,68,68,.12); }
.result-panel.noir { background: rgba(71,85,105,.2); }
.result-panel .emoji { font-size: 48px; }
.result-panel h2 { margin: 6px 0; }
#qr-reader { width: 100%; max-width: 400px; margin: 0 auto; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.toolbar > div { flex: 1; min-width: 140px; }
.hidden { display: none !important; }
.qr-display { text-align: center; }
.qr-display img { width: 260px; height: 260px; border-radius: 10px; background: #fff; padding: 10px; }
footer.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 14px; }
