/* El Qaâda — interface de prise de commande. Pensée tablette d'abord, lisible pendant des heures. */
:root {
  --bg: #f4f4f6; --card: #ffffff; --card-2: #fafafb; --text: #1c1c1e; --muted: #6b6b72; --line: #e3e3e8;
  --accent: #0f6e56; --accent-ink: #ffffff; --accent-soft: #e3f2ec; --gold: #c9a04e;
  --danger: #c92a2a; --danger-soft: #fdecec; --warn: #b7791f; --ok: #2b8a3e;
  --rail: #0f2e26; --rail-ink: rgba(255, 255, 255, .72);
  --r: 14px; --r-sm: 10px; --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111214; --card: #1b1c1f; --card-2: #212226; --text: #f2f2f4; --muted: #a0a0a8; --line: #2e2f34;
    --accent: #23a07f; --accent-soft: #163b31; --danger-soft: #3a1c1c; --rail: #0b1b17; --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; -webkit-font-smoothing: antialiased; }
body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button, a, label, input, select { touch-action: manipulation; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 20px; margin: 0; }
h3 { font-size: 17px; margin: 0 0 10px; }
h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; }
.row.gap, .gap { gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.sep { height: 1px; background: var(--line); margin: 12px 0; }
.ic { flex: none; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.danger-text { color: var(--danger); }
.error-msg { color: var(--danger); background: var(--danger-soft); padding: 10px 12px; border-radius: var(--r-sm); margin: 10px 0; }
.error-msg.small { padding: 4px 8px; font-size: 12px; margin: 4px 0 0; }
.splash { display: grid; place-items: center; height: 100dvh; font-size: 22px; color: var(--muted); }

/* ---------------------------------------------------------------- boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--card); font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .12s, transform .06s; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:hover:not(:disabled) { background: var(--card-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-outline { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.big { min-height: 56px; font-size: 17px; padding: 0 20px; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn small { font-weight: 400; color: var(--muted); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--card-2); color: var(--text); }
.icon-btn.small { width: 32px; height: 32px; }
.link { background: none; border: 0; color: var(--accent); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; padding: 6px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 500; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--card); border-color: var(--text); }
.chip[style*="--s"] { border-left: 4px solid var(--s); }
.chip b { font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.big .chip { min-height: 48px; font-size: 16px; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--s, var(--muted));
  background: color-mix(in srgb, var(--s, var(--muted)) 14%, transparent); white-space: nowrap; }
.badge.ok { --s: var(--ok); } .badge.bad { --s: var(--danger); }
.tag { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; margin-left: 4px; vertical-align: 1px; }
.tag { background: var(--accent-soft); color: var(--accent); }
.tag.gift { background: #fff3d6; color: #8a5a00; } .tag.paid { background: var(--accent-soft); color: var(--accent); }
.avatar { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; font-weight: 700; background: var(--accent); }
.avatar.small { width: 28px; height: 28px; font-size: 13px; vertical-align: middle; }

/* ---------------------------------------------------------------- champs */
.field { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; font-size: 14px; color: var(--muted); }
.field input, .field select, .input, select, textarea { min-height: 44px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); padding: 8px 12px; color: var(--text); font-size: 16px; width: 100%; }
.field.inline { flex-direction: row; align-items: center; margin: 0; }
.field.inline input { width: auto; }
.input.num, input.num { width: 96px; }
textarea.input { min-height: 90px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; margin: 10px 0; min-height: 40px; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.search { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--muted); flex: 1; }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 16px; color: var(--text); }
.search.small { min-height: 44px; flex: 0 1 260px; }
.switch { position: relative; display: inline-block; width: 50px; height: 30px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 30px; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(20px); }

/* ---------------------------------------------------------------- connexion */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent), var(--bg); }
.login-card { width: min(560px, 100%); background: var(--card); border-radius: 22px; padding: 28px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.brand-mark, .rail-brand { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 800; letter-spacing: .02em; }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
.user-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card-2); font-weight: 600; }
.user-tile:hover { border-color: var(--accent); }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 18px 0; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots i.on { background: var(--text); border-color: var(--text); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.login-pad { max-width: 340px; margin: 0 auto; }
.padkey { min-height: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--card-2); font-size: 24px; font-weight: 600; }
.padkey:active:not(:disabled) { background: var(--line); }
.padkey.ok { background: var(--accent); color: #fff; border-color: var(--accent); font-size: 18px; }

/* ---------------------------------------------------------------- structure */
.shell { display: grid; grid-template-columns: 88px 1fr; height: 100dvh; }
.offline-bar { position: fixed; z-index: 60; top: 0; left: 0; right: 0; background: #7a4a00; color: #fff; text-align: center; padding: 6px 12px; font-size: 14px; font-weight: 600; }
.offline-bar ~ .shell { padding-top: 32px; }
.rail { background: var(--rail); color: var(--rail-ink); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; overflow-y: auto; }
.rail-brand { margin-bottom: 8px; background: var(--gold); color: #1b1b1b; }
.rail-btn { width: 72px; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 14px; background: transparent; color: inherit; font-size: 12px; font-weight: 600; }
.rail-btn:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.rail-btn.active { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.rail .avatar.small { background: var(--gold); color: #1b1b1b; }
.rail-btn.user span:last-child { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; text-align: center; padding: 6px 4px; border-radius: 10px; width: 76px; }
.net.ok { color: #7ddba7; } .net.sync { color: #ffd479; } .net.off { color: #fff; background: #a23b3b; }
.content { min-width: 0; height: 100dvh; overflow: hidden; }
.offline-bar ~ .shell .content { height: calc(100dvh - 32px); }
.page { height: 100%; overflow-y: auto; padding: 22px 26px 40px; }
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }

/* ---------------------------------------------------------------- commande */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 410px; height: 100%; }
.catalog { display: flex; flex-direction: column; min-width: 0; height: 100%; padding: 14px 16px 0; }
.catalog-top { display: flex; gap: 8px; align-items: center; min-width: 0; }
.catalog-top .search { min-width: 0; flex: 1 1 180px; }
.catalog-top > .btn { flex: none; padding: 0 12px; }
.quick-toggle.on { background: #ffe9a8; border-color: #e5c45a; color: #5a4200; }
.finder { position: relative; flex: 1 1 160px; min-width: 0; max-width: 260px; display: flex; }
.finder .search { flex: 1; }
.finder-pop { position: absolute; top: 52px; left: 0; right: 0; z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.finder-pop button { display: flex; justify-content: space-between; width: 100%; gap: 8px; padding: 12px; border: 0; background: none; text-align: left; border-bottom: 1px solid var(--line); }
.finder-pop button:hover { background: var(--card-2); }
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.cat { flex: none; min-height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; border-bottom: 4px solid var(--c); }
.cat.active { background: var(--c); color: #fff; border-color: var(--c); }
.products { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; align-content: start; padding-bottom: 20px; }
.products.compact { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.product { position: relative; display: flex; flex-direction: column; text-align: left; gap: 4px; min-height: 108px; padding: 12px 12px 10px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--card); box-shadow: var(--shadow); border-top: 5px solid var(--c); transition: transform .06s, box-shadow .12s; }
.products.compact .product { min-height: 84px; }
.product:active:not(:disabled) { transform: scale(.97); box-shadow: none; }
.product.unavailable { opacity: .5; }
.p-name { font-weight: 650; line-height: 1.2; font-size: 15.5px; }
.p-desc { font-size: 12px; color: var(--muted); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; }
.p-more { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.p-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.p-badges i { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.p-badges .off { background: var(--danger-soft); color: var(--danger); }
.p-badges .rule { background: #e6f4ea; color: #1e6b34; }
.p-badges .warn { background: #fff4d6; color: #7a5200; }
.pad-l { padding: 10px; }

.ticket-panel { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--card); border-left: 1px solid var(--line); }
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 10px 10px 8px; border-bottom: 1px solid var(--line); scrollbar-width: none; flex: none; }
.strip-chip { position: relative; flex: none; display: flex; flex-direction: column; align-items: flex-start; min-height: 46px; padding: 4px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card-2); font-weight: 600; font-size: 13px; border-left: 4px solid var(--s, var(--line)); }
.strip-chip small { font-weight: 500; color: var(--muted); }
.strip-chip.active { background: var(--text); color: var(--card); border-color: var(--text); }
.strip-chip.active small { color: inherit; opacity: .75; }
.strip-chip.new { flex-direction: row; align-items: center; gap: 4px; }
.dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: #f08c00; }
.t-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); flex: none; }
.t-title { font-size: 20px; font-weight: 750; border: 0; background: none; padding: 0; text-align: left; }
button.t-title:hover { text-decoration: underline; }
.t-lines { flex: 1; overflow-y: auto; padding: 4px 0; min-height: 0; }
.batch { padding: 4px 0; }
.batch-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 8px 16px 4px; }
.draft-batch { background: color-mix(in srgb, #f08c00 7%, transparent); border-top: 1px dashed #f0a94a; border-bottom: 1px dashed #f0a94a; }
.draft-batch .batch-head { color: #b35c00; }
.line { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 16px; cursor: pointer; }
.line:hover { background: var(--card-2); }
.line.static { cursor: default; }
.line-main { flex: 1; min-width: 0; }
.line-name { font-weight: 600; line-height: 1.25; }
.line-sub { font-size: 12.5px; color: var(--muted); }
.line-comment { font-size: 13px; color: #9c5b00; font-style: italic; }
.line-price { min-width: 72px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.line.cancelled .line-name, .line.cancelled .line-price { text-decoration: line-through; color: var(--muted); }
.line.offered .line-price { color: var(--muted); text-decoration: line-through; }
.qty-static { color: var(--muted); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); flex: none; }
.stepper button { width: 46px; height: 46px; border: 0; background: transparent; display: grid; place-items: center; }
.stepper button:active:not(:disabled) { background: var(--line); }
.stepper span { min-width: 32px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper.small button { width: 38px; height: 38px; }
.stepper.small span { min-width: 24px; }
.suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); }
.suggest .chip { min-height: 34px; font-size: 13px; background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.t-foot { border-top: 1px solid var(--line); padding: 12px; flex: none; background: var(--card); }
.totals .total { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; margin: 4px 0 10px; }
.t-actions { display: flex; gap: 8px; }
.empty { display: grid; place-items: center; text-align: center; color: var(--muted); padding: 40px 20px; gap: 12px; }
.empty.small { padding: 30px 16px; }
.mobile-ticket-bar { display: none; }

/* ---------------------------------------------------------------- fenêtres */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 14, .42); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; animation: fade .12s; }
.modal, .dialog, .sheet { min-width: 0; }
.modal-head h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--card); border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { width: min(980px, 100%); }
.modal.full { width: min(1200px, 100%); height: calc(100dvh - 32px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 22px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 22px 22px; overflow-y: auto; flex: 1; }
.dialog { width: min(480px, 100%); background: var(--card); border-radius: 20px; padding: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.dialog h3 { font-size: 19px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.choice-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.choice-list .btn { justify-content: space-between; }
.sheet-foot { display: flex; align-items: center; gap: 12px; margin-top: 18px; position: sticky; bottom: -22px; background: var(--card); padding: 12px 0 0; }
.action-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.action-list .btn { justify-content: flex-start; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.choice { min-height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--card-2); font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.choice small { font-weight: 500; color: var(--muted); }
.choice.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.choice.on small { color: inherit; }
.opt-group { margin-top: 6px; }
.opt-group h4 { display: flex; align-items: center; gap: 8px; }
.count { font-size: 13px; padding: 2px 8px; border-radius: 8px; background: var(--card-2); color: var(--text); }
.count.ok { background: var(--accent-soft); color: var(--accent); } .count.bad { background: var(--danger-soft); color: var(--danger); }
.count-list { display: flex; flex-direction: column; }
.count-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.amountpad { margin: 10px 0; }
.amount-display { font-size: 34px; font-weight: 800; text-align: center; padding: 8px; font-variant-numeric: tabular-nums; }
.amountpad .padkey { min-height: 56px; }
.amount-display.proposed { color: var(--muted); }
.toasts { position: fixed; z-index: 80; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(560px, calc(100% - 24px)); }
.toast { background: #1c1c1e; color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); font-weight: 500; animation: fade .15s; }
.toast.ok { background: #1f6f43; } .toast.error { background: #a61e1e; } .toast.warn { background: #8a5a00; }

/* ---------------------------------------------------------------- encaissement */
.pay { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; height: 100%; }
.pay-left, .pay-right { min-width: 0; }
.pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.pay-summary > div { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.pay-summary b { font-size: 20px; font-variant-numeric: tabular-nums; }
.pay-summary .due { background: var(--accent); color: #fff; border-color: var(--accent); }
.pay-summary .due b { font-size: 24px; }
.seg { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; margin: 8px 0; flex-wrap: wrap; }
.seg button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.seg.wide { margin-bottom: 18px; }
.methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.method { min-height: 92px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 16px; }
.method:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.paid-ok { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px; background: var(--accent-soft); color: var(--accent); border-radius: 16px; text-align: center; }
.paid-ok b { font-size: 20px; }
.pay-list { display: flex; flex-direction: column; }
.pay-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pay-row > span { flex: 1; }
.pay-row.refunded { color: var(--muted); }
.pay-row.refunded b { text-decoration: line-through; }
.change { text-align: center; font-size: 20px; padding: 10px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.change b { font-size: 28px; }
.change.bad { background: var(--danger-soft); color: var(--danger); }
.warn-box { background: #fff4d6; color: #6b4600; border-radius: 12px; padding: 12px; margin: 10px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.receipt { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; max-width: 340px; margin: 0 auto; background: #fff; color: #000; padding: 16px; border: 1px dashed #bbb; }
.r-center { text-align: center; } .r-big { font-size: 16px; font-weight: 700; } .r-small { font-size: 11px; margin-top: 6px; }
.r-sep { border-top: 1px dashed #999; margin: 8px 0; }
.r-line { display: flex; justify-content: space-between; gap: 10px; }

/* ---------------------------------------------------------------- tableaux de bord */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpis.small .kpi b { font-size: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi b { font-size: 26px; font-variant-numeric: tabular-nums; }
.kpi.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.kpi.accent span { color: rgba(255, 255, 255, .8); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 16px; }
.filters select { width: auto; }
.ticket-grid > * { min-width: 0; }
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tcard { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--s); border-radius: var(--r); padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.tcard .badge { --s: inherit; color: var(--s); }
.tcard:hover { border-color: color-mix(in srgb, var(--s) 50%, var(--line)); }
.tcard-foot { margin-top: 4px; }
.big-num { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--s); margin-right: 6px; vertical-align: -1px; }
.zone { margin: 18px 0 10px; color: var(--muted); }
.table-plan, .table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.plan-table, .table-tile { min-height: 116px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px; box-shadow: var(--shadow); }
.plan-table b, .table-tile b { font-size: 18px; }
.plan-table small, .table-tile small { color: var(--muted); }
.plan-table.free { border-style: dashed; }
.plan-table.busy { border-color: var(--s); background: color-mix(in srgb, var(--s) 8%, var(--card)); }
.plan-table .st { color: var(--s); font-weight: 700; }
.table-tile.busy { border-color: var(--accent); background: var(--accent-soft); }
.table-tile.takeaway { border-style: dashed; }
.table-grid .table-tile { min-height: 90px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 38%) 1fr 84px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 14px; background: var(--card-2); border-radius: 7px; overflow: hidden; }
.bar { height: 100%; background: var(--accent); border-radius: 7px; min-width: 2px; }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; padding: 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.inactive { opacity: .5; }
.detail { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv span { color: var(--muted); }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 48px 1fr; gap: 8px; padding: 6px 0 6px 12px; position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.admin-carte { display: flex; gap: 20px; align-items: flex-start; }
.cat-list { width: 250px; flex: none; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; }
.cat-item { display: flex; align-items: center; border-radius: 10px; border-left: 4px solid var(--c); background: var(--card); border-top: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cat-item > button.grow { text-align: left; border: 0; background: none; min-height: 44px; padding: 0 12px; font-weight: 600; }
.cat-item.active { background: var(--accent-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-narrow { max-width: 560px; }
.opt-edit { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; background: var(--card-2); }

/* ---------------------------------------------------------------- nouveautés v2 : impression */
.print-ind { position: relative; }
.print-ind.bad { color: #ffb4a8; }
.alert-dot { position: absolute; top: 8px; right: 14px; width: 10px; height: 10px; border-radius: 50%; background: #ff6b5b; box-shadow: 0 0 0 2px var(--rail); }
.print-btn { position: relative; }
.print-btn.has { color: var(--accent); }
.mini-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e8590c; color: #fff; font-size: 11px; font-style: normal; font-weight: 800; display: grid; place-items: center; }
.kitchen-btn { border-color: #f0a94a; background: #fff6e8; color: #8a4b00; }
.kitchen-btn b { background: #e8590c; color: #fff; border-radius: 8px; padding: 0 6px; font-size: 14px; }
.print-main { flex-direction: column; align-items: flex-start !important; gap: 2px; padding: 10px 18px; min-height: 64px; }
.print-main small { color: inherit !important; opacity: .85; font-weight: 500; }
.paper { font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace; background: #fff; color: #111; border: 1px dashed #c8c8c8; border-radius: 6px; padding: 12px 10px; margin: 10px auto;
  width: fit-content; max-width: 100%; overflow-x: auto; font-size: clamp(9px, 2.7vw, 13px); line-height: 1.35; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.pr { white-space: pre; }
.pr.b { font-weight: 800; }
.pr.s2 { font-size: 2em; line-height: 1.15; font-weight: 800; }
.pr.sh { transform: scaleY(1.6); transform-origin: top; margin-bottom: .5em; }
.print-area { display: none; }
.job-list { display: flex; flex-direction: column; gap: 8px; }
.job { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card); }
.job.error { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger) 5%, var(--card)); }
.job.cancelled { opacity: .6; }
.job-actions { margin-top: 8px; }
.badge.warn { --s: #b7791f; }
.print-state { display: flex; flex-direction: column; gap: 10px; }
.status-line { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.status-line i { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status-line.ok i { background: var(--ok); } .status-line.bad i { background: var(--danger); }
.to-print { color: #b35c00 !important; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.receipt-actions { margin-bottom: 8px; }

/* produits : photos, favoris, épuisés */
.product.with-img { padding-top: 0; overflow: hidden; }
.p-img { width: calc(100% + 24px); margin: 0 -12px 6px; height: 92px; object-fit: cover; display: block; background: var(--card-2); }
.cat.fav { display: inline-flex; align-items: center; gap: 6px; }
.soldout-list { margin-top: 6px; }
.soldout-row { display: flex; align-items: center; gap: 10px; min-height: 52px; border-bottom: 1px solid var(--line); }
.soldout-row.off span.grow { color: var(--danger); font-weight: 600; }

/* notifications avec action */
.toast { display: flex; align-items: center; gap: 12px; }
.toast.has-action { pointer-events: auto; }
.toast-btn { flex: none; border: 0; border-radius: 9px; background: rgba(255,255,255,.18); color: #fff; font-weight: 700; padding: 8px 12px; min-height: 38px; }

/* encaissement : 4 zones */
.pay { grid-template-areas: "sum methods" "detail methods" "detail list"; grid-template-rows: auto auto 1fr; align-items: start; }
.pay-sum { grid-area: sum; } .pay-detail { grid-area: detail; } .pay-methods { grid-area: methods; } .pay-list-wrap { grid-area: list; }
.due-inline { color: var(--accent); font-size: 1.15em; }

/* administration */
.admin-tabs { margin: 0 0 14px; }
.carte-admin .cats { padding: 10px 0; }
.cat small { opacity: .7; font-weight: 500; }
.cat.add { border-style: dashed; border-bottom-width: 1px; }
.cat-head { margin: 4px 0 8px; }
.cat-head h3 { margin: 0; font-size: 20px; }
.add-dish { width: 100%; margin-bottom: 10px; }
.dish-list { display: flex; flex-direction: column; gap: 8px; }
.dish { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 8px 6px 6px; box-shadow: var(--shadow); }
.dish.off { opacity: .7; }
.dish-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; padding: 4px; min-height: 56px; }
.dish-main b { display: block; line-height: 1.25; }
.dish-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dish-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; flex: none; display: block; }
.thumb.empty { opacity: .35; height: 48px; max-height: 48px; align-self: center; }
.thumb-lg { width: 120px; height: 90px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.thumb-lg.empty { display: grid; place-items: center; color: var(--muted); background: var(--card-2); }
.col { display: flex; flex-direction: column; }
.carte-tools { margin-top: 16px; }
.save-state { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.save-state.ok { color: var(--ok); } .save-state.bad { color: var(--danger); white-space: normal; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 6px 0; }
.toggle { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 600; }
.toggle small { display: block; font-weight: 400; }
.choice-edit .input.num { width: 92px; }
.list-row { min-height: 52px; border-bottom: 1px solid var(--line); }
.info-box { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, var(--text)); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; line-height: 1.45; font-size: 14.5px; }
.admin-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.admin-cols .card { margin-bottom: 14px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--line); border-radius: 14px; padding: 12px; margin: 8px 0; cursor: pointer; }
.radio-card.on { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.radio-card small { display: block; color: var(--muted); margin-top: 2px; }
.roles { display: flex; flex-direction: column; margin: 8px 0; }
.roles .check { margin: 2px 0; }
.steps { padding-left: 20px; line-height: 1.5; }
.steps li { margin-bottom: 10px; }
.steps .row { margin-top: 6px; }
.code { background: #0f2e26; color: #d8f3e8; padding: 10px 12px; border-radius: 10px; overflow-x: auto; font-size: 13px; user-select: all; }
.printer-actions { margin-top: 14px; }
code { background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; font-size: .92em; }
.warn-box.small { font-size: 13px; padding: 8px 10px; }

/* éléments propres au téléphone (masqués sur grand écran) */
.tabbar, .sheet-head-mobile, .cart-bar, .mobile-search, .filters-toggle { display: none; }

/* ---------------------------------------------------------------- feuilles (téléphone) */
.sheet-overlay { align-items: end; padding: 0; }
.sheet { width: 100%; max-width: 560px; background: var(--card); border-radius: 22px 22px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.2); animation: up .18s ease-out; max-height: 90dvh; overflow-y: auto; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
.sheet-grip { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.more-user { padding: 6px 4px 12px; border-bottom: 1px solid var(--line); }
.more-user .net { flex-direction: row; width: auto; color: var(--muted); background: var(--card-2); }
.more-user .net.off { color: #fff; background: #a23b3b; }
.more-list { display: flex; flex-direction: column; padding-top: 6px; }
.more-item { display: flex; align-items: center; gap: 14px; min-height: 60px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: 17px; font-weight: 600; padding: 0 4px; }
.more-item small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.more-item.warn small { color: var(--danger); font-weight: 600; }

/* ---------------------------------------------------------------- impression papier (navigateur) */
@media print {
  body * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }
  .print-area { display: block !important; position: absolute; left: 0; top: 0; width: 80mm; }
  .print-area .paper { border: 0; box-shadow: none; margin: 0; padding: 0; font-size: 11px; width: auto; }
  .overlay { background: none; }
}

/* ---------------------------------------------------------------- tablette portrait */
@media (max-width: 1100px) {
  .pos { grid-template-columns: minmax(0, 1fr) 360px; }
  .finder { display: none; }
  .admin-cols { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- TÉLÉPHONE : une vraie expérience mobile */
@media (max-width: 820px) {
  html, body { font-size: 16px; }
  .shell { display: block; height: 100dvh; padding-top: env(safe-area-inset-top); }
  .rail { display: none; }
  .content { height: calc(100dvh - 64px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); }
  .offline-bar ~ .shell .content { height: calc(100dvh - 64px - 32px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); }
  .hide-mobile { display: none !important; }

  /* barre de navigation inférieure fixe, boutons au pouce */
  .tabbar { display: flex; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--rail); box-shadow: 0 -2px 12px rgba(0,0,0,.18); }
  .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--rail-ink); font-size: 12px; font-weight: 700; position: relative; }
  .tab.active { color: #fff; }
  .tab.active::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
  .tab-ic { position: relative; display: grid; place-items: center; }
  .tab-badge { position: absolute; top: -6px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: #1b1b1b; font-size: 11px; font-style: normal; font-weight: 800; display: grid; place-items: center; }
  .tab-dot { position: absolute; top: -2px; right: -4px; width: 9px; height: 9px; border-radius: 50%; background: #ff6b5b; }

  /* écran Commande */
  .pos { display: block; position: relative; height: 100%; }
  .catalog { padding: 8px 10px 0; height: 100%; }
  .catalog-top { gap: 8px; }
  .catalog-top .search { min-height: 46px; }
  .quick-toggle, .soldout-btn, .finder { display: none; }
  .cats { padding: 8px 0; margin: 0 -10px; padding-left: 10px; padding-right: 10px; gap: 6px; }
  .cat { min-height: 44px; padding: 0 14px; font-size: 15px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .product { min-height: 96px; padding: 10px 10px 8px; }
  .p-name { font-size: 15px; }
  .p-img { width: calc(100% + 20px); margin: 0 -10px 6px; height: 84px; }

  /* barre panier : total toujours visible, enregistrer en un geste */
  .cart-bar { display: flex; position: absolute; z-index: 12; left: 8px; right: 8px; bottom: 8px; gap: 8px; }
  .cart-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 14px; border-radius: 16px; border: 0; background: var(--rail); color: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.25); text-align: left; }
  .cart-ic { position: relative; display: grid; place-items: center; }
  .cart-ic i { position: absolute; top: -8px; right: -10px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--gold); color: #1b1b1b; font-size: 12px; font-weight: 800; font-style: normal; display: grid; place-items: center; padding: 0 5px; }
  .cart-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
  .cart-txt b, .cart-txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cart-txt small { opacity: .75; font-size: 12.5px; }
  .cart-total { font-size: 18px; font-variant-numeric: tabular-nums; }
  .cart-save { flex: none; height: 60px; padding: 0 16px; border-radius: 16px; border: 0; background: var(--accent); color: #fff; font-weight: 800; font-size: 16px; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 8px 22px rgba(0,0,0,.25); }

  /* ticket en feuille plein écran */
  .ticket-panel { position: absolute; inset: 0; z-index: 20; height: auto; border-left: 0; transform: translateY(102%); transition: transform .22s ease-out; box-shadow: 0 -10px 30px rgba(0,0,0,.2); border-radius: 18px 18px 0 0; overflow: hidden; }
  .pos.show-ticket .ticket-panel { transform: none; }
  .sheet-head-mobile { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 0; }
  .sheet-head-mobile .sheet-grip { margin: 0; }
  .strip { padding: 8px 10px; }
  .strip-chip { min-height: 44px; }
  .t-head { padding: 10px 8px 8px 14px; }
  .t-title { font-size: 19px; }
  .line { padding: 10px 10px 10px 14px; }
  .stepper.small button { width: 42px; height: 42px; }
  .t-foot { padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
  .totals .total { font-size: 22px; margin: 2px 0 8px; }
  .t-actions .btn.big { min-height: 58px; }
  .mobile-ticket-bar { display: none !important; }

  /* pages */
  .page { padding: 12px 12px calc(28px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 10px; gap: 10px; flex-wrap: wrap; }
  h1 { font-size: 24px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi b { font-size: 20px; }
  .mobile-search { display: flex; margin-bottom: 8px; }
  .desktop-search { display: none !important; }
  .filters-toggle { display: inline-flex; margin-bottom: 8px; }
  .filters { display: none; }
  .filters.open { display: flex; }
  .ticket-grid { grid-template-columns: 1fr; gap: 10px; }
  .tcard { padding: 14px; }
  .tcard b:first-child { font-size: 18px; }
  .tcard-actions .btn { min-height: 48px; }
  .table-plan { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .plan-table { min-height: 104px; padding: 8px 4px; border-radius: 14px; }
  .plan-table b { font-size: 16px; }
  .plan-table .big-num { font-size: 16px; }
  .plan-table small { font-size: 11.5px; text-align: center; }
  .legend { gap: 10px; font-size: 12px; }
  .table-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

  /* fenêtres en plein écran, glissant du bas */
  .overlay { padding: 0; align-items: end; }
  .modal, .modal.full, .modal.wide { width: 100%; max-height: calc(100dvh - env(safe-area-inset-top) - 8px); height: auto; border-radius: 20px 20px 0 0; }
  .modal.full { height: calc(100dvh - env(safe-area-inset-top) - 8px); }
  .modal-head { padding: 12px 8px 10px 16px; }
  .modal-head h2 { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .modal-body { padding: 12px 14px calc(18px + env(safe-area-inset-bottom)); }
  .dialog { border-radius: 20px 20px 0 0; width: 100%; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .sheet-foot { bottom: calc(-18px - env(safe-area-inset-bottom)); padding-bottom: 8px; flex-wrap: wrap; }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* encaissement : reste à payer, moyens de paiement juste en dessous, puis le détail */
  .modal-body { overflow-x: hidden; }
  .pay { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "sum" "methods" "detail" "list"; gap: 6px; height: auto; }
  .pay > section { min-width: 0; }
  .pay-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 6px; }
  .pay-summary span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .seg { display: flex; width: 100%; }
  .seg button { flex: 1; padding: 0 6px; }
  .pay-summary > div { padding: 8px 10px; }
  .pay-summary b { font-size: 15px; }
  .pay-summary .due b { font-size: 20px; }
  .methods { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .method { min-height: 72px; font-size: 15px; }
  .pay-methods h4 { margin-top: 6px; }
  .amountpad .padkey { min-height: 52px; }
  .amount-display { font-size: 28px; }

  /* administration */
  .admin-carte, .admin-cols { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .tbl { font-size: 13.5px; }
  .tbl.m-compact th:nth-child(n+3):not(:last-child), .tbl.m-compact td:nth-child(n+3):not(:last-child) { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: minmax(70px, 34%) 1fr 70px; }
  .detail { grid-template-columns: 1fr; }
  .toast { font-size: 14.5px; padding: 10px 14px; }
  .toasts { bottom: auto; top: calc(8px + env(safe-area-inset-top)); }
  .ticket-kpis .kpi:nth-child(n+3) { display: none; }
  .tcard-actions { flex-wrap: wrap; }
  .tcard-actions .btn { padding: 0 12px; flex: 1 1 auto; }
}
@media (max-width: 820px) and (min-width: 560px) {
  .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .table-plan, .table-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------- V3 : imprimantes Bluetooth */
.pcard-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: var(--r); padding: 12px 12px 12px 14px; box-shadow: var(--shadow); }
.pcard.here { border-left-color: var(--ok); }
.pcard.err { border-left-color: var(--danger); }
.pcard-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.pcard-name { font-size: 18px; font-weight: 750; }
.pcard-state { margin: 8px 0 4px; }
.pcard-actions { margin-top: 8px; }
.pcard-actions .btn { min-height: 50px; }
.ok-box { display: flex; gap: 10px; align-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 12px; margin-bottom: 6px; }
.ok-box small { color: var(--muted); }
.empty-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; background: var(--card); border: 2px dashed var(--line); border-radius: var(--r); padding: 26px 16px; color: var(--muted); margin-bottom: 14px; }
.info-box.warn { background: #fff4d6; color: #6b4600; }
.radio-card.disabled { opacity: .55; cursor: not-allowed; }
.logo-prev { max-height: 60px; max-width: 200px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; }
.station-card { margin-bottom: 14px; }
.printers-page .card { margin-bottom: 14px; }
.toggle .switch { flex: none; }
