/* V2 — composants ajoutés ; s'appuie sur les variables de style.css. */
:root{--ok:#13a37a;--ok-soft:#e6f7f0;--warn:#b26b00;--warn-soft:#fff6e5;--danger:#c22c4c}
select,textarea{font:inherit;padding:12px 13px;border:1px solid #ccd5e3;border-radius:11px;background:#fff;width:100%}
textarea{resize:vertical}
.stack input[type=checkbox]{width:auto;margin-right:8px}
.check-row{display:flex;align-items:center;font-size:14px;font-weight:600}
.sub-nav{display:flex;gap:8px;flex-wrap:wrap;margin:-8px 0 26px}
.sub-nav a{padding:8px 14px;border-radius:999px;border:1px solid var(--line);background:var(--white);font-size:13px;font-weight:700}
.sub-nav a[aria-current=page]{background:var(--navy);border-color:var(--navy);color:#fff}
.sub-nav a:hover{text-decoration:none;border-color:var(--accent)}
.banner{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;background:var(--warn-soft);border:1px solid #f1d9a6;color:#6b4500;border-radius:14px;padding:14px 18px;margin-bottom:24px;font-size:14px}
.banner form{margin:0}
.badge{display:inline-block;border-radius:999px;padding:3px 9px;font-size:11px;font-weight:800;letter-spacing:.4px;background:#edf3ff;color:var(--accent)}
.badge.ok{background:var(--ok-soft);color:#0e7356}.badge.muted{background:#eef1f6;color:var(--muted)}
/* Carte client */
.digital-card .code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:2px;font-size:13px;color:#cfe0ff}
.stamps{display:grid;grid-template-columns:repeat(auto-fill,minmax(30px,1fr));gap:8px;margin:20px 0 6px;max-width:420px}
.stamps span{aspect-ratio:1;border-radius:50%;border:2px dashed #6f86b6;display:grid;place-items:center;font-size:13px;color:transparent}
.stamps span.on{background:#9de9c3;border:2px solid #9de9c3;color:#123a2a}
.reward-list{display:flex;flex-direction:column;gap:10px;margin-top:6px}
.reward-item{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:var(--white)}
.reward-item .bar{height:6px;border-radius:6px;background:#e7ecf5;margin-top:8px;overflow:hidden;width:min(220px,40vw)}
.reward-item .bar>div{height:100%;background:var(--accent)}
.reward-item.available{border-color:#b9ead1;background:#f7fdfa}
.reward-item.available .bar>div{background:var(--ok)}
.history{margin-top:22px}
.split{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);gap:22px;align-items:start}
/* Caisse : gros boutons tactiles */
.till{display:grid;gap:12px;margin:20px 0}
.till .button{min-height:64px;font-size:17px;border-radius:16px;width:100%}
.till-rewards{display:grid;gap:10px}
.till-rewards .button{width:100%}
.till-rewards .button{justify-content:space-between;padding:14px 20px}
.lookup{display:flex;gap:10px;align-items:flex-start}
.lookup input{font-family:ui-monospace,Menlo,monospace;text-transform:uppercase;letter-spacing:3px;padding:12px 13px;border:1px solid #ccd5e3;border-radius:11px;width:100%}
.lookup .button{flex:none}
details.panel{border:1px solid var(--line);border-radius:14px;background:var(--white);padding:14px 18px;margin-top:16px}
details.panel summary{cursor:pointer;font-weight:750}
/* Statistiques */
.kpi-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.kpi-grid .stat small{display:block;color:var(--muted);font-size:12px;margin-top:4px}
.chart{display:grid;grid-template-columns:repeat(8,1fr);align-items:end;gap:10px;height:190px;padding:18px 18px 0;border:1px solid var(--line);border-radius:18px;background:var(--white)}
.chart .col{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%;gap:6px;font-size:11px;color:var(--muted)}
.chart .col b{font-size:12px;color:var(--text)}
.chart .col .bar{width:100%;max-width:44px;background:var(--accent);border-radius:8px 8px 0 0;min-height:2px}
.chart-caption{font-size:12px;color:var(--muted);margin-top:8px}
.period{display:flex;gap:6px}
.table{width:100%;border-collapse:collapse;font-size:14px}
.table th,.table td{text-align:left;padding:12px 16px;border-bottom:1px solid var(--line)}
.table th{font-size:12px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.5px}
.table tr:last-child td{border-bottom:0}
.table .num{text-align:right;font-variant-numeric:tabular-nums}
.table-wrap{overflow-x:auto}
.copy-box{display:flex;gap:8px;margin:12px 0}
.copy-box input{flex:1;font-family:ui-monospace,Menlo,monospace;font-size:12px;padding:10px;border:1px solid #ccd5e3;border-radius:10px;background:#f8fafd}
.inline-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.inline-actions form{margin:0}
.button-small{min-height:34px;padding:6px 12px;font-size:13px;border-radius:9px}
.button-danger{background:#fff;color:var(--danger);border:1px solid #f2c4c0}
.restaurant-hero{padding:34px;border-radius:22px;background:linear-gradient(140deg,#1d3566,#111b34);color:#fff;box-shadow:var(--shadow)}
.restaurant-hero p{color:#c4d2ec}
.restaurant-hero .eyebrow{color:#96b8ff}
.facts{display:flex;flex-wrap:wrap;gap:8px 22px;font-size:14px;color:#dbe6fb;margin-top:12px}
.verdict{border-radius:14px;padding:16px 18px;margin:18px 0}
.verdict.ok{background:var(--ok-soft);color:#0e5a43}.verdict.ko{background:#fff0ef;color:#8c2020}
@media(max-width:900px){.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.split{grid-template-columns:minmax(0,1fr)}}
.split>*{min-width:0}
@media(max-width:720px){.chart{gap:5px;padding:12px 10px 0}.restaurant-hero{padding:24px}.lookup{flex-direction:column}.lookup .button{width:100%}}

/* V3 — Wallet */
.wallet-panel{margin-top:16px}
.wallet-buttons{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:12px}
.wallet-link{display:inline-flex;align-items:center;min-height:48px;padding:0 4px;font-weight:700;color:var(--accent);text-decoration:underline}
.wallet-link img{height:48px;width:auto;display:block}

/* V4.4.3 : paliers de récompenses (espace gérant) */
.reward-ladder{display:grid;gap:8px;margin:0;padding:0;list-style:none;counter-reset:none}
.reward-ladder li{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line,#dde3ee);border-radius:10px;background:var(--surface,#fff)}
.reward-ladder .rank{font-weight:700;min-width:2ch}.reward-ladder .meta{flex:1}.reward-ladder .meta span{display:block;font-size:13px;opacity:.75}
.reward-ladder form{display:inline}.reward-actions{display:flex;gap:6px;flex-wrap:wrap}
.prog-table{width:100%;border-collapse:collapse;font-size:14px}.prog-table th,.prog-table td{padding:6px 8px;border-bottom:1px solid var(--line,#dde3ee);text-align:left}
.reward-ladder li{flex-wrap:wrap}.reward-actions .button{padding:6px 12px;font-size:14px;min-height:0}
.reward-ladder .meta{flex:1 1 70%;min-width:0}.reward-actions{flex-basis:100%;padding-left:calc(2ch + 10px)}

/* V4.5 : campagnes, annonces, notifications */
.camp-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:18px 0}
.camp-stats .stat{padding:16px}.camp-stats .stat strong{font-size:28px}
.camp-section{margin-top:28px}.camp-library{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px}
.camp-tpl{display:flex;flex-direction:column;gap:6px;padding:14px;border:1px solid var(--line);border-radius:14px;background:#fff}
.camp-tpl .button{align-self:flex-start;margin-top:auto}
.camp-actions{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}.camp-actions form{margin:0}
.camp-send{margin-top:16px;padding:20px}.camp-edit textarea,.camp-edit select{padding:12px 13px;border:1px solid #ccd5e3;border-radius:11px;background:#fff;width:100%;font:inherit}
.camp-edit fieldset.bare{border:0;padding:0;margin:0;display:flex;flex-direction:column;gap:11px}
.camp-counts{list-style:none;padding:0;display:grid;gap:6px}
.phone-mock{background:linear-gradient(160deg,#2a3550,#0f1424);border-radius:28px;padding:22px 14px 30px;min-height:300px;color:#fff;max-width:340px}
.lock-time{text-align:center;font-size:44px;font-weight:300;margin:4px 0 18px}
.push-mock,.announce-mock{display:flex;flex-direction:column;gap:2px;background:rgba(245,245,247,.92);color:#111;border-radius:16px;padding:10px 12px;margin-bottom:10px;font-size:14px}
.push-app{font-size:11px;text-transform:uppercase;letter-spacing:.4px;color:#555}
.announce-mock{background:#fff}.announce-mock .eyebrow{margin:0}
.announce-list .announce{border-top:1px solid var(--line);padding:10px 0}.announce-list .announce:first-of-type{border-top:0}
.announce-list .announce p{margin:4px 0}
.push-panel .button{margin-top:8px}.pair-code{font-size:22px;letter-spacing:2px}
@media (max-width:700px){.camp-edit{display:block}.camp-edit .sticky-preview{margin-top:18px}}

/* V4.5.2 : choix explicite des offres (deux boutons de même poids) */
.offers-choice{display:grid;grid-template-columns:1fr;gap:10px;margin:10px 0}
.choice-cta{min-height:54px;font-size:16px;width:100%}
.offers-choice-text{margin:6px 0 2px}
.narrow-panel{max-width:560px;margin:0 auto}
@media (min-width:640px){.offers-choice{grid-template-columns:1fr 1fr}}

/* NOVORIVA-WALLET-UX-01 : bouton d'ajout au portefeuille, mobile d'abord. Les badges officiels gardent leurs proportions. */
.wallet-add{margin:16px 0;display:flex;flex-direction:column;align-items:stretch;gap:10px}
.wallet-btn{display:flex;align-items:center;justify-content:center;min-height:56px;width:100%;border-radius:14px;text-decoration:none;touch-action:manipulation}
.wallet-btn img{display:block;height:56px;width:auto;max-width:100%}
.wallet-btn:has(img){background:transparent;padding:0}
.wallet-btn:not(:has(img)){background:#000;color:#fff;font-weight:700;font-size:17px;padding:0 20px}
.wallet-btn:not(:has(img)):hover{text-decoration:none;opacity:.92}
.wallet-btn:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
.wallet-choice{display:flex;flex-direction:column;gap:10px}
.wallet-note{margin:0;font-size:14px;color:var(--muted);text-align:center}
.qr-code-line{margin:10px 0 0;text-align:center;font-size:15px}
.code-big{font-family:ui-monospace,Menlo,monospace;font-size:22px;letter-spacing:.12em}
@media (min-width:720px){.wallet-choice{flex-direction:row;justify-content:center}.wallet-btn{width:auto;min-width:260px}}

/* NOVORIVA-CARD-DESIGNER-01 : carte web — progression et cadeaux placés par zones (ordre visuel, contenu identique) */
.dc-designed{display:flex;flex-direction:column}
.dc-designed .tile-top{order:0}.dc-designed .brand-head{order:1}.dc-designed .dc-progress{order:2}.dc-designed .dc-info{order:3}.dc-designed .dc-gifts-bottom{order:4}
.dc-designed[data-progress-place="top"] .dc-progress{order:1;align-self:flex-end;text-align:right}
.dc-designed[data-progress-place="top"] .brand-head{order:2}
.dc-designed[data-progress-place="top"] .dc-progress .points strong{font-size:30px}
.dc-designed[data-progress-place="main"] .dc-progress .points strong{font-size:56px}
.dc-designed[data-progress-place="bottom"] .dc-progress{order:5;align-self:flex-end;text-align:right}
.dc-designed .stamps{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 4px;max-width:none}
.dc-designed[data-progress-place="main"] .stamps{gap:8px;margin:14px 0 6px}
.dc-designed[data-progress-place="top"] .stamps,.dc-designed[data-progress-place="bottom"] .stamps{justify-content:flex-end}
.dc-gifts{display:inline-flex;align-items:center;gap:4px;font-size:13px;font-weight:700;padding:4px 10px;border-radius:999px;background:rgba(255,255,255,.16);opacity:.75}
.dc-gifts.on{opacity:1;background:rgba(255,255,255,.28)}
.dc-designed[data-rewards-place="bottom_left"] .dc-gifts-bottom{align-self:flex-start;margin-top:10px}
.dc-designed[data-rewards-place="bottom_right"] .dc-gifts-bottom{align-self:flex-end;margin-top:10px}
.dc-designed .stamps span{width:28px;flex:none}
.dc-designed[data-progress-place="top"] .stamps span,.dc-designed[data-progress-place="bottom"] .stamps span{width:20px;border-width:2px}
.dc-designed[data-progress-place="main"] .stamps span{width:34px}

/* V4.8.1 : code-barres Code 128 — pleine largeur utile, pixels nets, fond blanc et zone de silence conservés */
.qr-panel .barcode{display:block;width:100%;max-width:460px;height:auto;margin:8px auto 0;image-rendering:pixelated;image-rendering:crisp-edges;background:#fff;border-radius:8px}

/* V4.8.2 : carte conçue — bannière intégrée et grille de zones (aucun chevauchement), identique à l'aperçu */
.dc2{padding:0;overflow:hidden;display:block}
.dc2-banner{aspect-ratio:375/144;background:#fff}
.dc2-banner img{display:block;width:100%;height:100%;object-fit:cover}
.dc2-grid{display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"tl tr" "name name" "main main" "info info" "bl br";gap:10px 12px;padding:18px 20px 20px;align-items:start}
.dc2-tl{grid-area:tl}.dc2-tr{grid-area:tr;justify-self:end;text-align:right}
.dc2-name{grid-area:name;display:flex;align-items:center;gap:12px;min-width:0}
.dc2-name .brand-name{font-size:24px;margin:0;line-height:1.15;overflow-wrap:anywhere}
.dc2-name .brand-tagline{margin:2px 0 0;font-size:13px;opacity:.85}
.dc2-name .brand-logo{width:44px;height:44px;object-fit:contain;flex:none}
.dc2-main{grid-area:main}.dc2-info{grid-area:info}.dc2-info p{margin:0}
.dc2-bl{grid-area:bl;align-self:end}.dc2-br{grid-area:br;justify-self:end;align-self:end;text-align:right}
.dc2-z:empty{display:none}
.dc2 .points{margin:0;display:flex;align-items:baseline;gap:2px}
.dc2 .points strong{font-size:30px;line-height:1}
.dc2 .points span{font-size:15px;opacity:.85}
.dc2-main .points strong{font-size:60px}.dc2-main .points span{font-size:22px}
.dc2 .stamps{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0 0;max-width:none}
.dc2 .stamps span{width:18px;flex:none;border-width:2px;font-size:10px}
.dc2-main .stamps{gap:8px;margin-top:12px}.dc2-main .stamps span{width:30px;font-size:13px}
.dc2-tr .stamps,.dc2-br .stamps{justify-content:flex-end}
.dc2-tr .points,.dc2-br .points{justify-content:flex-end}
.dc2 .progress{margin:8px 0 0;min-width:120px}
.dc2-main .progress{height:12px}
@media (max-width:420px){.dc2-grid{padding:16px}.dc2-main .points strong{font-size:52px}}

/* V4.8.3 : code-barres vectoriel pleine largeur (barres nettes à toute résolution), plein écran au toucher */
.barcode-box{display:block;width:100%;max-width:560px;margin:10px auto 0;padding:14px 0;border:0;border-radius:12px;background:#fff;cursor:zoom-in;-webkit-tap-highlight-color:transparent}
.barcode-box svg{display:block;width:100%;height:auto;aspect-ratio:auto}
.barcode-tip{margin:6px 0 0}
.barcode-full{position:fixed;inset:0;z-index:1000;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:16px;cursor:zoom-out}
.barcode-rot{display:flex;flex-direction:column;align-items:center;gap:14px}
.barcode-rot svg{width:min(94vw,1100px);height:auto}
@media (orientation:portrait){.barcode-rot{transform:rotate(90deg)}.barcode-rot svg{width:min(88vh,1100px)}}
.barcode-full small{position:absolute;bottom:14px;left:0;right:0;text-align:center}
.barcode-full p{margin:0;font:600 22px ui-monospace,Menlo,monospace;letter-spacing:.14em;color:#000}
.barcode-full small{color:#555;font-size:14px}
