:root {
  --brand: #c2410c;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e5e4;
  --bg: #fafaf9;
  --card: #ffffff;
  --ok: #15803d;
  --warn: #b45309;
  --err: #b91c1c;
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; }
small, .muted { color: var(--muted); }
.wrap { max-width: 460px; margin: 0 auto; padding: 20px 16px 40px; }
.wide { max-width: 1040px; margin: 0 auto; padding: 20px 16px 60px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stack > * + * { margin-top: 14px; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url], select, textarea {
  width: 100%; font: inherit; padding: 12px 14px; border: 1px solid #d6d3d1; border-radius: 12px; background: #fff;
}
textarea { min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--brand); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; border: 0; border-radius: 12px; padding: 13px 18px;
  background: var(--brand); color: #fff; cursor: pointer; text-decoration: none;
}
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ok { background: var(--ok); }
.btn.big { font-size: 1.15rem; padding: 18px; }
.btn:disabled { opacity: .5; cursor: default; }
.alert { padding: 12px 14px; border-radius: 12px; font-weight: 550; }
.alert.err { background: #fef2f2; color: var(--err); }
.alert.ok { background: #f0fdf4; color: var(--ok); }
.alert.warn { background: #fffbeb; color: var(--warn); }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrapr { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Carte client ---------- */
.brandbar { background: var(--brand); color: #fff; padding: 22px 18px 64px; text-align: center; }
.brandbar img.logo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #fff; display: block; margin: 0 auto 10px; }
.brandbar .initial { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; margin: 0 auto 10px; font-size: 1.8rem; font-weight: 700; }
.brandbar h1 { margin: 0; font-size: 1.4rem; }
.brandbar p { margin: 4px 0 0; opacity: .9; }
.lift { margin-top: -48px; }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 6px 0 4px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #d6d3d1; display: grid; place-items: center; font-size: 1.2rem; color: #d6d3d1; }
.stamp.on { border: 0; background: var(--brand); color: #fff; animation: pop .35s ease; }
.stamp.gift { border-style: solid; border-color: var(--brand); color: var(--brand); }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.bar { height: 14px; background: #f5f5f4; border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; background: var(--brand); border-radius: 99px; transition: width .6s ease; }
.bignum { font-size: 2.6rem; font-weight: 750; letter-spacing: -0.02em; }
.reward-ready { background: var(--brand); color: #fff; border-radius: 12px; padding: 14px; text-align: center; font-weight: 700; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .85; } }
.qrbox { text-align: center; }
.qrbox svg { width: 210px; height: 210px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 1.3rem; letter-spacing: .2em; font-weight: 700; }
.news { border-left: 4px solid var(--brand); }
.langs { text-align: center; font-size: .85rem; }
.langs a { margin: 0 6px; color: var(--muted); text-decoration: none; }
.langs a.on { color: var(--ink); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 99px; font-weight: 600; z-index: 10; }
.footer { text-align: center; font-size: .78rem; color: var(--muted); margin-top: 22px; }

/* ---------- Espace restaurateur ---------- */
.topnav { background: #fff; border-bottom: 1px solid var(--line); }
.topnav .wide { padding-top: 12px; padding-bottom: 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.topnav .logo { font-weight: 800; color: var(--ink); text-decoration: none; font-size: 1.15rem; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 600; }
.tabs a.on { background: #f5f5f4; color: var(--ink); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi .v { font-size: 1.8rem; font-weight: 750; }
.kpi .l { color: var(--muted); font-size: .85rem; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.chart .b { width: 100%; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 2px; }
.chart .x { font-size: .7rem; color: var(--muted); margin-top: 4px; }
.chart .n { font-size: .7rem; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; background: #f5f5f4; font-size: .78rem; font-weight: 600; }
.pill.go { background: #ffedd5; color: #9a3412; }

/* ---------- Scan ---------- */
#reader { width: 100%; border-radius: var(--radius); overflow: hidden; background: #000; }
#reader video { border-radius: var(--radius); }
.cust { text-align: center; }
.cust .name { font-size: 1.6rem; font-weight: 750; }
.qty { display: flex; align-items: center; justify-content: center; gap: 16px; }
.qty button { width: 52px; height: 52px; border-radius: 50%; font-size: 1.6rem; }
.qty .n { font-size: 2rem; font-weight: 750; min-width: 40px; text-align: center; }

/* ---------- Affiche ---------- */
.poster { width: 190mm; min-height: 270mm; margin: 0 auto; text-align: center; padding: 18mm 14mm; border: 10px solid var(--brand); border-radius: 18px; background: #fff; }
.poster h1 { font-size: 34pt; margin: 0 0 4mm; }
.poster .qr svg { width: 105mm; height: 105mm; }
.poster .langs4 { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; margin-top: 8mm; font-size: 13pt; }
.poster .reward { font-size: 18pt; font-weight: 700; color: var(--brand); margin: 3mm 0 6mm; }
@media print {
  .noprint { display: none !important; }
  body { background: #fff; }
  .poster { border-width: 8px; }
}
