/* =========================================================
   NIBARKA APP TELECOM — Styles
   Couleurs pilotées par variables (personnalisation boutique)
   ========================================================= */
:root {
  --primary: #0e4f47; --primary-600: #0c433c; --primary-50: #eef5f4; --primary-100: #d6e7e4; --primary-300: #7fa8a2;
  --accent: #f59e0b; --accent-50: #fef3dc;
  --bg: #f3f5f4; --surface: #ffffff; --surface-2: #f8faf9; --text: #10201d; --muted: #66756f; --line: #e3e9e7;
  --ok: #16a34a; --ok-50: #e8f7ee; --warn: #d97706; --warn-50: #fff4e0; --err: #dc2626; --err-50: #fdecec;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,32,29,.04), 0 6px 20px rgba(16,32,29,.06);
  --shadow-lg: 0 20px 50px rgba(16,32,29,.18);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --sidebar-w: 248px;
}
[data-mode=dark] {
  --bg: #0d1513; --surface: #15201d; --surface-2: #1b2724; --text: #e7efed; --muted: #92a39e; --line: #26332f;
  --ok-50: #10301d; --warn-50: #33240b; --err-50: #3a1515; --primary-50: #1a2a27; --primary-100: #22403b;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
}
[data-style=carre] { --radius: 6px; --radius-sm: 4px; }
[data-style=doux] { --radius: 24px; --radius-sm: 14px; }
[data-density=compact] .card { padding: 14px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.has-bg::before { content: ""; position: fixed; inset: 0; background-image: var(--bg-image); background-size: cover; background-position: center; opacity: .12; pointer-events: none; z-index: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
[data-mode=dark] a { color: var(--primary-300); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
.ic { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.mb { margin-bottom: 14px; } .mt { margin-top: 14px; } .mb0 { margin-bottom: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; } .row.nowrap { flex-wrap: nowrap; }
.grow { flex: 1; min-width: 0; }
.right { text-align: right; } .center { text-align: center; }
.hide { display: none !important; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.pos { color: var(--ok); } .neg { color: var(--err); } .acc { color: var(--accent); }
.strong { font-weight: 700; }

/* ---------- Boutons & champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; background: var(--surface-2); color: var(--text); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap; min-height: 42px; text-decoration: none; }
.btn:hover { filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.accent { background: var(--accent); color: #1b1300; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { background: var(--err); color: #fff; }
.btn.soft { background: var(--primary-50); color: var(--primary); }
[data-mode=dark] .btn.soft { color: var(--primary-300); }
.btn.sm { padding: 6px 10px; min-height: 34px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--muted); }
.in, input[type=text].in, select.in, textarea.in { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); min-height: 42px; outline: none; transition: border .15s, box-shadow .15s; }
.in:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
textarea.in { min-height: 80px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.check { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; }
.search .in { padding-left: 38px; }

/* ---------- Auth / onboarding ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { background: radial-gradient(1200px 600px at 0% 0%, var(--primary-300) 0%, transparent 50%), linear-gradient(150deg, var(--primary) 0%, var(--primary-600) 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side h1 { font-size: 40px; letter-spacing: -.02em; max-width: 520px; }
.auth-side p { opacity: .85; max-width: 460px; font-size: 17px; }
.auth-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.auth-badges span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); padding: 8px 12px; border-radius: 999px; font-size: 13.5px; display: inline-flex; gap: 6px; align-items: center; }
.auth-badges .ic { width: 16px; height: 16px; }
.auth-float { position: absolute; right: -40px; bottom: 90px; background: #fff; color: var(--text); border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow-lg); width: 230px; transform: rotate(-4deg); }
.auth-float b { font-size: 22px; color: var(--primary); display: block; }
.auth-main { display: grid; place-items: center; padding: 32px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 26px; margin-bottom: 6px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin: 20px 0; border: 1px solid var(--line); overflow-x: auto; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.brand-mini { font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; font-size: 18px; }
.brand-mini .logo-box { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.15); display: grid; place-items: center; }

.wizard { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; display: grid; grid-template-columns: 1.2fr .9fr; gap: 28px; align-items: start; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps i { flex: 1; height: 5px; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--primary); }
.preview-sticky { position: sticky; top: 20px; }
.theme-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.swatch { border: 2px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; background: var(--surface); text-align: center; font-size: 12.5px; font-weight: 600; }
.swatch.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.swatch .sw { height: 30px; border-radius: 8px; margin-bottom: 6px; display: flex; overflow: hidden; }
.swatch .sw i { flex: 1; }
.uploader { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.uploader .thumb { width: 72px; height: 72px; border-radius: 16px; background: var(--surface-2); border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; color: var(--muted); flex: none; }
.uploader .thumb img { width: 100%; height: 100%; object-fit: contain; }
.uploader .thumb.wide { width: 140px; }
.uploader .thumb.wide img { object-fit: cover; }
.plan-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.plan { border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer; background: var(--surface); position: relative; }
.plan.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.plan .price { font-size: 26px; font-weight: 800; color: var(--primary); margin: 6px 0; }
[data-mode=dark] .plan .price { color: var(--primary-300); }
.plan ul { padding-left: 18px; margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }
.plan .tag { position: absolute; top: -11px; right: 14px; background: var(--accent); color: #1b1300; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }

/* Aperçu téléphone (comme la maquette) */
.phone-prev { width: 270px; margin: 0 auto; background: #0b0f0e; border-radius: 38px; padding: 10px; box-shadow: var(--shadow-lg); }
.phone-prev .scr { background: var(--bg); border-radius: 30px; overflow: hidden; min-height: 470px; }
.phone-prev .hd { background: linear-gradient(160deg, var(--primary), var(--primary-600)); color: #fff; padding: 22px 18px 20px; }
.phone-prev .hd .nm { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; }
.phone-prev .hd .lg { width: 28px; height: 28px; border-radius: 8px; background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--primary); font-size: 12px; font-weight: 800; }
.phone-prev .hd .lg img { width: 100%; height: 100%; object-fit: contain; }
.phone-prev .hd .amt { font-size: 24px; font-weight: 800; margin-top: 14px; }
.phone-prev .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px; }
.phone-prev .tiles div { background: var(--surface); border-radius: 12px; padding: 10px 4px; text-align: center; font-size: 10.5px; box-shadow: var(--shadow); color: var(--text); }
.phone-prev .tiles .ic { color: var(--primary); width: 18px; height: 18px; display: block; margin: 0 auto 4px; }
[data-mode=dark] .phone-prev .tiles .ic { color: var(--primary-300); }
.phone-prev .ft { font-size: 9.5px; text-align: center; color: var(--muted); padding: 8px; }

/* ---------- Structure de l'application ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; position: relative; z-index: 1; }
.sidebar { background: linear-gradient(180deg, var(--primary) 0%, var(--primary-600) 100%); color: #fff; padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.sb-brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 20px; }
.sb-brand .lg { width: 42px; height: 42px; border-radius: 12px; background: #fff; display: grid; place-items: center; overflow: hidden; color: var(--primary); font-weight: 800; flex: none; }
.sb-brand .lg img { width: 100%; height: 100%; object-fit: contain; }
.sb-brand .nm { font-weight: 800; font-size: 17px; line-height: 1.15; letter-spacing: -.01em; word-break: break-word; }
.sb-brand .nm small { display: block; font-weight: 500; opacity: .7; font-size: 12px; letter-spacing: 0; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; color: rgba(255,255,255,.82); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.on { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav .sep { height: 1px; background: rgba(255,255,255,.12); margin: 10px 6px; }
.nav .badge { margin-left: auto; background: var(--accent); color: #1b1300; font-size: 11px; padding: 1px 7px; border-radius: 999px; font-weight: 700; }
.sb-foot { margin-top: auto; padding: 12px 8px 0; font-size: 12px; opacity: .65; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.topbar h1 { font-size: 21px; letter-spacing: -.01em; }
.topbar .mobile-brand { display: none; }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); cursor: pointer; white-space: nowrap; }
.sync-pill .ic { width: 15px; height: 15px; }
.sync-pill.on { color: var(--ok); } .sync-pill.off { color: var(--warn); background: var(--warn-50); } .sync-pill.err { color: var(--err); } .sync-pill.wait { color: var(--accent); }
.sync-pill.run .ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.content { padding: 24px 28px 40px; max-width: 1400px; width: 100%; }
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 14px; }
.banner.warn { background: var(--warn-50); color: var(--warn); }
.banner.err { background: var(--err-50); color: var(--err); }
.banner.info { background: var(--primary-50); color: var(--primary); }
[data-mode=dark] .banner.info { color: var(--primary-300); }
.banner .btn { margin-left: auto; }
.bottomnav { display: none; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; border: 1px solid var(--line); min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-h h3 { font-size: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { position: relative; }
.kpi .lbl { font-size: 13px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi .lbl .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
[data-mode=dark] .kpi .lbl .ico { color: var(--primary-300); }
.kpi .lbl .ico .ic { width: 16px; height: 16px; }
.kpi .val { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 2px; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }
.delta { font-weight: 700; font-size: 12.5px; padding: 2px 7px; border-radius: 999px; background: var(--ok-50); color: var(--ok); }
.delta.dn { background: var(--err-50); color: var(--err); }
.kpi .delta { margin-right: 4px; }
.hero { background: radial-gradient(600px 300px at 100% 0%, color-mix(in srgb, var(--accent) 25%, transparent), transparent 60%), linear-gradient(140deg, var(--primary) 0%, var(--primary-600) 100%); color: #fff; border-radius: calc(var(--radius) + 4px); padding: 24px 26px; display: grid; grid-template-columns: 1fr auto; gap: 20px; margin-bottom: 18px; position: relative; overflow: hidden; }
.hero .cover { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .18; }
.hero > * { position: relative; }
.hero .t { opacity: .85; font-weight: 600; font-size: 14px; }
.hero .big { font-size: 38px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0; }
.hero .delta { background: rgba(255,255,255,.15); color: #fff; }
.hero .delta.up { background: var(--accent); color: #1b1300; }
.quick { display: grid; grid-template-columns: repeat(4, 92px); gap: 10px; align-self: center; }
.quick button { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); color: #fff; border-radius: 14px; padding: 12px 6px; cursor: pointer; font-size: 12.5px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.quick button:hover { background: rgba(255,255,255,.2); }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.dash-grid .span2 { grid-column: span 2; }
.chart svg { width: 100%; height: 230px; display: block; }
.chart .axis { font-size: 11px; fill: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.av { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-weight: 700; font-size: 13px; flex: none; overflow: hidden; }
[data-mode=dark] .av { color: var(--primary-300); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av .ic { width: 18px; height: 18px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-50); color: var(--ok); } .pill.warn { background: var(--warn-50); color: var(--warn); } .pill.err { background: var(--err-50); color: var(--err); } .pill.pri { background: var(--primary-50); color: var(--primary); }
[data-mode=dark] .pill.pri { color: var(--primary-300); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
table.t .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty .ic { width: 42px; height: 42px; opacity: .4; margin-bottom: 8px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 200px; }

/* ---------- Point de vente ---------- */
.pos-wrap { display: grid; grid-template-columns: 1fr 400px; gap: 18px; align-items: start; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.prod { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 6px; transition: .15s; position: relative; }
.prod:hover { border-color: var(--primary); transform: translateY(-1px); }
.prod .im { height: 76px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.prod .im img { width: 100%; height: 100%; object-fit: contain; }
.prod .nm { font-weight: 600; font-size: 13.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.prod .pr { font-weight: 800; color: var(--primary); font-size: 14px; }
[data-mode=dark] .prod .pr { color: var(--primary-300); }
.prod .qt { position: absolute; top: 8px; right: 8px; }
.prod.out { opacity: .5; }
.cart { position: sticky; top: 84px; }
.cart-items { max-height: 46vh; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.ci { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ci .nm { font-weight: 600; font-size: 14px; }
.ci .qty { display: flex; align-items: center; gap: 4px; }
.ci .qty button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.ci .qty button .ic { width: 15px; height: 15px; }
.ci .qty input { width: 52px; text-align: center; padding: 4px; min-height: 30px; }
.totals { padding-top: 12px; }
.totals .row { justify-content: space-between; margin: 4px 0; }
.totals .grand { font-size: 22px; font-weight: 800; }
.pay-line { display: grid; grid-template-columns: 1fr 140px 38px; gap: 8px; margin-bottom: 8px; }
.cart-bar { display: none; }

/* ---------- Modales & toasts ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(8,18,16,.5); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal-wrap.out { opacity: 0; transition: opacity .18s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: calc(var(--radius) + 2px); width: 100%; max-width: 540px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal.wide { max-width: 860px; }
@keyframes pop { from { transform: translateY(12px) scale(.98); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 20px; overflow-y: auto; }
#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #0f1f1c; color: #fff; padding: 11px 16px; border-radius: 12px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow-lg); font-size: 14px; max-width: 92vw; animation: pop .2s; }
.toast.err .ic { color: #fca5a5; } .toast.warn .ic { color: #fcd34d; } .toast.ok .ic { color: #86efac; }
.toast.out { opacity: 0; transition: .4s; }

/* ---------- Verrouillage ---------- */
.lock { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(150deg, var(--primary), var(--primary-600)); color: #fff; padding: 20px; }
.lock-card { text-align: center; width: 100%; max-width: 320px; }
.lock .lg { width: 76px; height: 76px; border-radius: 22px; background: #fff; margin: 0 auto 14px; display: grid; place-items: center; overflow: hidden; color: var(--primary); font-weight: 800; font-size: 24px; }
.lock .lg img { width: 100%; height: 100%; object-fit: contain; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 22px 0; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); }
.pin-dots i.on { background: #fff; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.keypad button { height: 64px; border-radius: 18px; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 22px; font-weight: 600; cursor: pointer; }
.keypad button:active { background: rgba(255,255,255,.25); }

/* ---------- Paramètres ---------- */
.settings { display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; }
.set-nav button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; text-align: left; font-weight: 600; color: var(--muted); }
.set-nav button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.set-nav button .ic { width: 18px; height: 18px; }
.section-t { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 22px 0 10px; }
.section-t:first-child { margin-top: 0; }
.powered { font-size: 12px; color: var(--muted); text-align: center; margin-top: 30px; }

/* ---------- Documents imprimables ---------- */
#print-root { display: none; }
.doc { background: #fff; color: #111; font-family: var(--font); }
.doc-a4 { width: 186mm; margin: 0 auto; font-size: 12px; }
.doc-a4 .dh { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; border-bottom: 3px solid var(--primary); padding-bottom: 14px; margin-bottom: 18px; }
.doc-a4 .dh.center { flex-direction: column; align-items: center; text-align: center; }
.doc-a4 .dh.rightlogo { flex-direction: row-reverse; }
.doc-a4 .dlogo { max-width: 120px; max-height: 70px; object-fit: contain; }
.doc-a4 .shopname { font-size: 20px; font-weight: 800; color: var(--primary); }
.doc-a4 .dtitle { font-size: 22px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: #111; }
.doc-a4 .meta { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.doc-a4 .box { background: #f5f7f6; border-radius: 6px; padding: 10px 12px; min-width: 220px; }
.doc-a4 table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.doc-a4 th { background: var(--primary); color: #fff; text-align: left; padding: 7px 8px; font-size: 11px; text-transform: uppercase; }
.doc-a4 td { padding: 7px 8px; border-bottom: 1px solid #e5e7eb; }
.doc-a4 .tot { margin-left: auto; width: 280px; }
.doc-a4 .tot div { display: flex; justify-content: space-between; padding: 4px 0; }
.doc-a4 .tot .g { font-size: 16px; font-weight: 800; border-top: 2px solid #111; padding-top: 6px; margin-top: 4px; }
.doc-a4 .sign { display: flex; justify-content: space-between; margin-top: 30px; gap: 20px; }
.doc-a4 .sign img { max-height: 70px; max-width: 150px; }
.doc-a4 .foot { border-top: 1px solid #ddd; margin-top: 30px; padding-top: 8px; font-size: 10.5px; color: #555; text-align: center; }
.doc-a4 .body-text { font-size: 13px; line-height: 1.7; margin: 18px 0; white-space: pre-wrap; }
.doc-tk { font-family: "Courier New", ui-monospace, monospace; font-size: 11px; color: #000; }
.doc-tk.w58 { width: 48mm; } .doc-tk.w80 { width: 72mm; }
.doc-tk .c { text-align: center; } .doc-tk .b { font-weight: 700; }
.doc-tk hr { border: 0; border-top: 1px dashed #000; margin: 5px 0; }
.doc-tk .l { display: flex; justify-content: space-between; gap: 6px; }
.doc-tk img { max-width: 60%; max-height: 50px; display: block; margin: 0 auto 4px; filter: grayscale(1); }
.doc-preview { background: #e9eceb; padding: 20px; border-radius: 12px; overflow: auto; max-height: 60vh; }
.doc-preview .doc { box-shadow: 0 4px 16px rgba(0,0,0,.12); padding: 16px; margin: 0 auto; }
.doc-preview .doc-a4 { padding: 14mm 12mm; }

@media print {
  body > *:not(#print-root) { display: none !important; }
  body { background: #fff; }
  body.has-bg::before { display: none; }
  #print-root { display: block !important; }
  .doc { box-shadow: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .pos-wrap { grid-template-columns: 1fr 340px; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid .span2 { grid-column: auto; }
  .quick { grid-template-columns: repeat(2, 92px); }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 28px 22px; min-height: auto; }
  .auth-side h1 { font-size: 26px; }
  .auth-side p { font-size: 15px; }
  .auth-float, .auth-side .hide-m, .auth-badges, .auth-side > .tiny { display: none; }
  .auth-side { gap: 14px; }
  .wizard { grid-template-columns: 1fr; }
  .preview-sticky { position: static; order: -1; }
  .phone-prev { transform: scale(.82); transform-origin: top center; margin-bottom: -80px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { display: none; }
  .topbar .mobile-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; min-width: 0; }
  .topbar .mobile-brand .lg { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; overflow: hidden; font-size: 13px; flex: none; }
  .topbar .mobile-brand .lg img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
  .topbar .mobile-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .content { padding: 16px 14px 100px; }
  .page-title { display: block !important; font-size: 20px; margin-bottom: 14px; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 40; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 0; }
  .bottomnav a.on { color: var(--primary); }
  [data-mode=dark] .bottomnav a.on { color: var(--primary-300); }
  .bottomnav a.sell .ic { background: var(--primary); color: #fff; border-radius: 14px; width: 44px; height: 34px; padding: 7px; margin-top: -2px; }
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .hero .big { font-size: 30px; }
  .quick { grid-template-columns: repeat(4, 1fr); }
  .quick button { padding: 10px 2px; font-size: 11.5px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .val { font-size: 18px; }
  .pos-wrap { grid-template-columns: 1fr; }
  .cart { position: static; }
  .cart.collapsed { display: none; }
  .cart-bar { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 35; background: var(--primary); color: #fff; border-radius: 14px; padding: 12px 16px; align-items: center; justify-content: space-between; box-shadow: var(--shadow-lg); border: 0; font-weight: 700; cursor: pointer; }
  .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .plan-cards { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; }
  .set-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .set-nav button { white-space: nowrap; }
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { max-height: 94vh; border-radius: 20px 20px 0 0; max-width: 100% !important; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .hide-m { display: none !important; }
  #toast-root { bottom: calc(140px + env(safe-area-inset-bottom)); }
  .pay-line { grid-template-columns: 1fr 110px 38px; }
  .theme-swatches { grid-template-columns: repeat(4, 1fr); }
}
.page-title { display: none; }
