/* ==========================================================================
   Tapigo — Charte « Chic & Élégant »
   Fond sable #FBF9F5 · Cormorant Garamond + Manrope · boutons noirs mats
   ========================================================================== */

:root {
  --sand: #FBF9F5;
  --sand-2: #F4F0E8;
  --sand-3: #ECE6DA;
  --card: #FFFFFF;
  --line: #E6DFD2;
  --ink: #171615;
  --ink-2: #4F4B45;
  --muted: #8B857B;
  --matte: #1D1C1A;
  --matte-hover: #2E2C29;
  --gold: #A6895A;
  --gold-soft: #F1E9DA;
  --ok: #4D7A5B;
  --ok-soft: #E6EFE7;
  --warn: #B9822F;
  --warn-soft: #F7EDDC;
  --danger: #A9503D;
  --danger-soft: #F6E4DF;
  --info: #4B6584;
  --info-soft: #E5EBF2;

  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow-1: 0 1px 2px rgba(23, 22, 21, .04), 0 4px 16px rgba(23, 22, 21, .05);
  --shadow-2: 0 10px 40px rgba(23, 22, 21, .14);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: .005em; line-height: 1.15; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}

/* ---------------- Boutons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: 15px; letter-spacing: .01em;
  transition: background .2s var(--ease), transform .15s var(--ease), opacity .2s, border-color .2s;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--matte); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.btn--primary:hover:not(:disabled) { background: var(--matte-hover); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-2); }
.btn--soft { background: var(--sand-2); color: var(--ink); }
.btn--soft:hover { background: var(--sand-3); }
.btn--danger { background: transparent; color: var(--danger); border-color: var(--danger-soft); }
.btn--danger:hover { background: var(--danger-soft); }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn--apple { background: #000; color: #fff; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  transition: background .2s, border-color .2s;
}
.icon-btn:hover { border-color: var(--ink-2); }
.icon-btn svg { width: 18px; height: 18px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Logo ---------------- */
.logo {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: var(--matte); color: var(--sand);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 24px; font-weight: 600; font-style: italic;
}

/* ---------------- Badges & chips ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: var(--sand-2); color: var(--ink-2); white-space: nowrap;
}
.badge--gold { background: var(--gold-soft); color: #7C6338; }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: #8C5F1C; }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--info { background: var(--info-soft); color: var(--info); }
.badge--dark { background: var(--matte); color: #fff; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 16px; margin: 0 -16px; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; scroll-snap-align: start;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  transition: all .2s var(--ease);
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--matte); border-color: var(--matte); color: #fff; }
.chip--tag { padding: 6px 12px; font-size: 13px; font-weight: 500; }
.chip--tag[aria-pressed="true"] { background: var(--gold-soft); border-color: var(--gold); color: #6C552E; }

/* ---------------- Formulaires ---------------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .field input, .field textarea, .field select {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--card); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 76px; resize: vertical; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(23,22,21,.06);
}
.field .help { font-size: 12px; color: var(--muted); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 600; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track { width: 42px; height: 24px; border-radius: 999px; background: var(--sand-3); position: relative; transition: background .2s; flex: none; }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s var(--ease); }
.switch input:checked + .switch__track { background: var(--ok); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------------- Stepper ---------------- */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.stepper button { width: 40px; height: 40px; border: 0; background: none; font-size: 18px; border-radius: 50%; }
.stepper button:hover { background: var(--sand-2); }
.stepper output { min-width: 26px; text-align: center; font-weight: 700; }
.stepper--sm button { width: 32px; height: 32px; font-size: 16px; }

/* ---------------- Image avec repli emoji ---------------- */
.media { position: relative; background: linear-gradient(135deg, var(--sand-2), var(--sand-3)); overflow: hidden; }
.media img { width: 100%; height: 100%; object-fit: cover; transition: opacity .4s; }
.media.is-broken img { opacity: 0; }
.media::after {
  content: attr(data-emoji); position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 34px; opacity: 0; transition: opacity .3s; pointer-events: none;
}
.media.is-broken::after, .media:not(:has(img))::after { opacity: 1; }

/* ---------------- Toast ---------------- */
.toast-stack { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-md);
  background: var(--matte); color: #fff; box-shadow: var(--shadow-2);
  font-size: 14px; animation: toastIn .35s var(--ease);
}
.toast strong { font-weight: 700; }
.toast.is-leaving { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px) scale(.98); } }

/* ==========================================================================
   INTERFACE CLIENT
   ========================================================================== */
.client { padding-bottom: calc(160px + var(--safe-b)); }
.c-wrap { max-width: 680px; margin: 0 auto; padding: 0 16px; }

.c-header { padding: 20px 0 12px; }
.c-header__row { display: flex; align-items: center; gap: 12px; }
.c-header__name { flex: 1; min-width: 0; }
.c-header h1 { font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-header p { font-size: 13px; color: var(--muted); }

.table-badge {
  flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 64px; padding: 6px 12px; border-radius: 14px;
  background: var(--matte); color: #fff; line-height: 1.1;
}
.table-badge small { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; opacity: .7; }
.table-badge b { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.table-badge--missing { background: var(--sand-2); color: var(--ink-2); }
button.table-badge { border: 0; font: inherit; cursor: pointer; transition: transform .15s var(--ease); }
button.table-badge:active { transform: scale(.96); }
.table-badge--missing { box-shadow: inset 0 0 0 1.5px var(--gold); }
.table-input { height: 84px; text-align: center; font-family: var(--serif); font-size: 48px; font-weight: 600; letter-spacing: .08em; border-radius: var(--r-md); }
#tableErr { margin-top: 10px; }

.c-welcome { margin-top: 18px; padding: 16px 18px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); display: flex; gap: 14px; align-items: center; }
.c-welcome svg { flex: none; width: 28px; height: 28px; color: var(--gold); }
.c-welcome p { font-size: 13px; color: var(--ink-2); }
.c-welcome strong { color: var(--ink); }

.c-toolbar {
  position: sticky; top: 0; z-index: 20;
  padding: 12px 0 10px;
  background: rgba(251, 249, 245, .9);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.c-toolbar.is-stuck { border-bottom-color: var(--line); }
.c-toolbar .chips + .chips { margin-top: 8px; }

.search { position: relative; display: block; margin-bottom: 10px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search input {
  width: 100%; height: 46px; padding: 0 40px 0 42px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); outline: none;
}
.search input:focus { border-color: var(--ink-2); }
.search__clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--muted); }

.c-section { padding-top: 26px; scroll-margin-top: 150px; }
.c-section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.c-section h2 { font-size: 30px; }
.c-section__count { font-size: 12px; color: var(--muted); }

.dish-list { display: grid; gap: 12px; }
.dish {
  display: grid; grid-template-columns: 1fr 112px; gap: 14px;
  padding: 14px; border-radius: var(--r-md);
  background: var(--card); border: 1px solid var(--line);
  cursor: pointer; text-align: left;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
  animation: fadeUp .45s var(--ease) both;
}
.dish:hover { box-shadow: var(--shadow-1); border-color: var(--sand-3); }
.dish:active { transform: scale(.99); }
.dish__body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dish__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dish h3 { font-size: 21px; }
.dish__desc { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dish__meta { margin-top: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.price { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.dish__tags { font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.dish__media { width: 112px; height: 112px; border-radius: 12px; position: relative; }
.dish__add {
  position: absolute; right: 6px; bottom: 6px; z-index: 1;
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: var(--matte); color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.dish__add svg { width: 16px; height: 16px; }
.dish__qty {
  position: absolute; left: 6px; top: 6px; z-index: 1;
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px;
  background: var(--gold); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 24px; margin-bottom: 6px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

/* Barre panier flottante */
.cart-bar {
  position: fixed; left: 50%; bottom: calc(16px + var(--safe-b)); z-index: 40;
  transform: translateX(-50%);
  width: min(648px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 20px; min-height: 60px;
  border: 0; border-radius: 999px;
  background: var(--matte); color: #fff; box-shadow: var(--shadow-2);
  animation: barIn .4s var(--ease);
}
.cart-bar__count { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.cart-bar__label { flex: 1; text-align: left; font-weight: 600; }
.cart-bar__total { padding: 10px 16px; border-radius: 999px; background: rgba(255,255,255,.1); font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-bar.bump { animation: bump .4s var(--ease); }
.cart-bar:not([hidden]) ~ .track-pill { bottom: calc(88px + var(--safe-b)); }
@keyframes barIn { from { transform: translate(-50%, 120%); } }
@keyframes bump { 40% { transform: translateX(-50%) scale(1.03); } }

.track-pill {
  position: fixed; left: 50%; bottom: calc(16px + var(--safe-b)); z-index: 30;
  transform: translateX(-50%); white-space: nowrap; box-shadow: var(--shadow-2);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); box-shadow: var(--shadow-1); font-size: 13px; font-weight: 600;
}
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); position: relative; }
.pulse-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); animation: ping 1.6s ease-out infinite; }
@keyframes ping { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

/* ---------------- Bottom sheet ---------------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(23, 22, 21, .42);
  animation: fadeIn .3s var(--ease);
}
.sheet-backdrop.is-closing { animation: fadeOut .28s var(--ease) forwards; }
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 101;
  width: min(680px, 100vw); max-height: 92dvh;
  transform: translateX(-50%);
  display: flex; flex-direction: column;
  background: var(--sand); border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-2); overflow: hidden; overflow: clip; /* clip : le navigateur ne peut pas faire défiler le sheet lui-même */
  animation: sheetIn .42s var(--ease);
}
.sheet.is-closing { animation: sheetOut .3s var(--ease) forwards; }
.sheet__grip { position: absolute; top: 0; left: 0; right: 0; height: 28px; z-index: 3; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet__grip::before { content: ''; width: 40px; height: 4px; border-radius: 4px; background: rgba(23,22,21,.25); }
.sheet__close { position: absolute; top: 14px; right: 14px; z-index: 3; }
.sheet__scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.sheet__head { padding: 30px 20px 4px; }
.sheet__head h2 { font-size: 30px; padding-right: 44px; }
.sheet__body { padding: 16px 20px 20px; display: grid; gap: 18px; }
.sheet__footer {
  padding: 12px 20px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line); background: var(--sand);
  display: flex; gap: 12px; align-items: center;
}
.sheet__footer .btn--primary { flex: 1; }
.sheet__media { height: 240px; }
.sheet__media::after { font-size: 64px; }
@keyframes sheetIn { from { transform: translate(-50%, 100%); } }
@keyframes sheetOut { to { transform: translate(-50%, 100%); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }

@media (min-width: 720px) {
  .sheet { bottom: 50%; border-radius: var(--r-lg); max-height: 86vh; transform: translate(-50%, 50%); animation-name: modalIn; }
  .sheet.is-closing { animation-name: modalOut; }
  .sheet__grip { display: none; }
  @keyframes modalIn { from { opacity: 0; transform: translate(-50%, calc(50% + 24px)); } }
  @keyframes modalOut { to { opacity: 0; transform: translate(-50%, calc(50% + 24px)); } }
}

/* Options produit */
.product-desc { color: var(--ink-2); }
.allergens { font-size: 12px; color: var(--muted); }
.opt-group { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.opt-group legend { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 0; margin-bottom: 8px; font-weight: 700; font-size: 15px; }
.opt-group legend small { font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.opt-group.is-required legend small { color: var(--gold); }
.opt-group.is-invalid { animation: shake .4s; }
.opt-group.is-invalid legend small { color: var(--danger); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.opt {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px; border-radius: var(--r-sm);
  background: var(--card); border: 1px solid var(--line); cursor: pointer;
  transition: border-color .2s, background .2s;
}
.opt:hover { border-color: var(--ink-2); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt__mark { width: 20px; height: 20px; flex: none; border: 1.5px solid var(--muted); border-radius: 50%; display: grid; place-items: center; transition: all .2s; }
.opt__mark--check { border-radius: 6px; }
.opt__mark::after { content: ''; width: 8px; height: 8px; border-radius: inherit; background: #fff; transform: scale(0); transition: transform .2s var(--ease); }
.opt input:checked ~ .opt__mark { background: var(--matte); border-color: var(--matte); }
.opt input:checked ~ .opt__mark::after { transform: scale(1); }
.opt:has(input:checked) { border-color: var(--matte); }
.opt input:focus-visible ~ .opt__mark { outline: 2px solid var(--ink); outline-offset: 2px; }
.opt__label { flex: 1; }
.opt__price { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Panier */
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line h4 { font-family: var(--sans); font-size: 15px; font-weight: 700; }
.cart-line__opts { font-size: 13px; color: var(--ink-2); }
.cart-line__note { font-size: 13px; color: var(--gold); font-style: italic; }
.cart-line__price { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.cart-line__actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.link-btn { border: 0; background: none; padding: 6px 0; font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.link-btn--danger { color: var(--danger); }
.line-note-input { width: 100%; margin-top: 4px; }

.totals { display: grid; gap: 6px; padding: 16px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); }
.totals__row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.totals__row--grand { font-size: 18px; font-weight: 800; color: var(--ink); padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; }

/* Paiement */
.pay-methods { display: grid; gap: 10px; }
.pay-method { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.pay-method input { position: absolute; opacity: 0; pointer-events: none; }
.pay-method:has(input:checked) { border-color: var(--matte); box-shadow: 0 0 0 1px var(--matte); }
.pay-method__icon { width: 46px; height: 32px; border-radius: 7px; display: grid; place-items: center; background: var(--sand-2); font-weight: 800; font-size: 12px; flex: none; }
.pay-method__icon--apple { background: #000; color: #fff; }
.pay-method__icon svg { width: 20px; height: 20px; }
.pay-method__text { flex: 1; }
.pay-method__text strong { display: block; font-size: 15px; }
.pay-method__text span { font-size: 12px; color: var(--muted); }
.pay-method .opt__mark { margin-left: auto; }
.pay-method input:checked ~ .opt__mark { background: var(--matte); border-color: var(--matte); }
.pay-method input:checked ~ .opt__mark::after { transform: scale(1); }
.card-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); animation: fadeUp .3s var(--ease); }
.card-form .field:first-child { grid-column: 1 / -1; }
.card-form .help { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; }
.secure { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); }
.secure svg { width: 14px; height: 14px; }

/* Allergènes, suggestions, service */
.allergens { display: grid; gap: 6px; }
.allergens > span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pairings { display: grid; gap: 8px; }
.pair { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card); text-align: left; }
.pair:hover { border-color: var(--ink-2); }
.pair:disabled { opacity: .6; }
.pair__media { width: 48px; height: 48px; border-radius: 10px; flex: none; }
.pair__media::after { font-size: 22px; }
.pair__name { flex: 1; font-weight: 700; font-size: 14px; display: grid; }
.pair__name small { font-weight: 600; color: var(--muted); }
.pair__add { width: 30px; height: 30px; border-radius: 50%; background: var(--matte); color: #fff; display: grid; place-items: center; font-size: 18px; }
.service-trigger { flex: none; width: 44px; height: 44px; }
.service-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.service-btn { display: grid; justify-items: center; gap: 6px; padding: 22px 12px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--card); text-align: center; transition: border-color .2s, transform .15s; }
.service-btn:hover { border-color: var(--ink-2); }
.service-btn:active { transform: scale(.98); }
.service-btn span { font-size: 32px; }
.service-btn strong { font-size: 15px; }
.service-btn small { font-size: 12px; color: var(--muted); min-height: 16px; }
.pause-banner { margin-top: 14px; padding: 12px 16px; border-radius: var(--r-md); background: var(--warn-soft); color: #7A5418; font-size: 13px; }
.review-cta { display: grid; gap: 10px; padding: 16px; border-radius: var(--r-md); background: var(--gold-soft); text-align: center; font-size: 14px; }

/* Suivi de commande */
.track { position: fixed; inset: 0; z-index: 90; background: var(--sand); overflow-y: auto; animation: fadeIn .35s var(--ease); }
.track__inner { max-width: 560px; margin: 0 auto; padding: 28px 20px calc(40px + var(--safe-b)); display: grid; gap: 22px; }
.track__top { display: flex; justify-content: space-between; align-items: center; }
.track__hero { text-align: center; display: grid; justify-items: center; gap: 10px; padding-top: 8px; }
.track__icon { width: 84px; height: 84px; border-radius: 50%; background: var(--matte); color: #fff; display: grid; place-items: center; }
.track__icon svg { width: 38px; height: 38px; }
.track__icon .draw { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .6s .2s var(--ease) forwards; }
.track__icon.is-cooking { background: var(--gold); }
.track__icon.is-cooking svg { animation: wobble 1.6s ease-in-out infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes wobble { 50% { transform: rotate(-8deg) scale(1.05); } }
.track__hero h2 { font-size: 34px; }
.track__hero p { color: var(--ink-2); }

.steps { list-style: none; margin: 0; padding: 20px; display: grid; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.step { position: relative; display: grid; grid-template-columns: 28px 1fr auto; gap: 14px; align-items: start; padding-bottom: 22px; }
.step:last-child { padding-bottom: 0; }
.step::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step.is-done::before { background: var(--matte); }
.step__dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); display: grid; place-items: center; position: relative; z-index: 1; transition: all .3s var(--ease); }
.step__dot svg { width: 14px; height: 14px; opacity: 0; }
.step.is-done .step__dot { background: var(--matte); border-color: var(--matte); color: #fff; }
.step.is-done .step__dot svg { opacity: 1; }
.step.is-current .step__dot { border-color: var(--matte); }
.step.is-current .step__dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--matte); animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.6); opacity: .5; } }
.step__label { font-weight: 700; padding-top: 3px; }
.step:not(.is-done):not(.is-current) .step__label { color: var(--muted); font-weight: 500; }
.step__time { font-size: 12px; color: var(--muted); padding-top: 5px; font-variant-numeric: tabular-nums; }

.recap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 18px; }
.recap .cart-line { grid-template-columns: auto 1fr auto; }
.recap .cart-line .qty { font-weight: 700; color: var(--gold); }

.order-list { display: grid; gap: 10px; }
.order-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); text-align: left; }

/* ==========================================================================
   DASHBOARD RESTAURATEUR
   ========================================================================== */
.kds { min-height: 100vh; display: flex; flex-direction: column; }

.k-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px; background: rgba(251,249,245,.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.k-brand { display: flex; align-items: center; gap: 12px; }
.k-brand h1 { font-size: 22px; }
.k-brand p { font-size: 12px; color: var(--muted); }
.k-tabs { display: inline-flex; padding: 4px; background: var(--sand-2); border-radius: 999px; }
.k-tab { border: 0; background: none; padding: 8px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-2); display: inline-flex; gap: 8px; align-items: center; }
.k-tab[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-1); }
.k-tab .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; }
.k-top__spacer { flex: 1; }
.k-top__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.k-clock { font-family: var(--serif); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sound-btn[aria-pressed="false"] { color: var(--muted); }
.sound-btn[aria-pressed="true"] { background: var(--matte); color: #fff; border-color: var(--matte); }

.k-main { flex: 1; padding: 18px 20px 40px; }

.k-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.k-stat { padding: 14px 16px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); }
.k-stat span { font-size: 12px; color: var(--muted); font-weight: 600; }
.k-stat b { display: block; font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }

.k-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--matte); color: #fff; }

.board { display: grid; grid-template-columns: repeat(4, minmax(270px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.col { background: var(--sand-2); border-radius: var(--r-lg); padding: 12px; min-height: 240px; scroll-snap-align: start; }
.col__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; }
.col__head h2 { font-size: 22px; display: flex; align-items: center; gap: 8px; }
.col__dot { width: 9px; height: 9px; border-radius: 50%; }
.col__list { display: grid; gap: 12px; }
.col__empty { padding: 26px 12px; text-align: center; font-size: 13px; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--r-md); }

.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.table-group { background: var(--sand-2); border-radius: var(--r-lg); padding: 12px; display: grid; gap: 12px; }
.table-group__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 0; }
.table-group__head h2 { font-size: 26px; }

.ticket {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; box-shadow: var(--shadow-1);
  animation: fadeUp .35s var(--ease);
  border-top: 4px solid var(--st, var(--line));
}
.ticket.is-new { animation: ticketIn .5s var(--ease), glow 1.6s ease-in-out .5s infinite; }
@keyframes ticketIn { from { opacity: 0; transform: scale(.94) translateY(-10px); } }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(169, 80, 61, .22), var(--shadow-1); } }
.ticket__head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px dashed var(--line); }
.ticket__table { width: 52px; height: 52px; border-radius: 12px; background: var(--matte); color: #fff; display: grid; place-items: center; text-align: center; line-height: 1; flex: none; }
.ticket__table small { display: block; font-size: 8px; letter-spacing: .16em; text-transform: uppercase; opacity: .7; }
.ticket__table b { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.ticket__meta { flex: 1; min-width: 0; }
.ticket__meta strong { display: block; font-size: 15px; }
.ticket__meta span { font-size: 12px; color: var(--muted); }
.timer { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--sand-2); }
.timer--warn { background: var(--warn-soft); color: #8C5F1C; }
.timer--late { background: var(--danger-soft); color: var(--danger); }
.ticket__lines { list-style: none; margin: 0; padding: 10px 14px; display: grid; gap: 8px; }
.ticket__line { display: grid; grid-template-columns: 30px 1fr; gap: 6px; }
.ticket__line.is-other { opacity: .35; }
.ticket__line .q { font-weight: 800; font-size: 16px; }
.ticket__line .n { font-weight: 700; font-size: 15px; }
.ticket__line .o { font-size: 13px; color: var(--ink-2); }
.ticket__line .note { font-size: 13px; font-weight: 700; color: var(--danger); }
.ticket__note { margin: 0 14px 10px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 600; }
.ticket__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px 10px; font-size: 13px; }
.ticket__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 14px 14px; border-top: 1px solid var(--line); }
.st-btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 4px; font-size: 12px; font-weight: 700; color: var(--ink-2); transition: all .15s; line-height: 1.2; }
.st-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.st-btn.is-next { background: var(--matte); border-color: var(--matte); color: #fff; }
.st-btn.is-active { background: var(--sand-2); border-color: var(--sand-3); color: var(--muted); cursor: default; }
.st-btn.is-past { opacity: .5; }
.st-validate { grid-column: 1 / -1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--ok); background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 9px 4px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; transition: all .15s; }
.st-validate:hover { background: var(--ok); color: #fff; }

.k-history { margin-top: 18px; }
.k-history summary { cursor: pointer; font-weight: 700; padding: 10px 0; color: var(--ink-2); }
.k-history table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); border-radius: var(--r-md); overflow: hidden; }
.k-history th, .k-history td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.k-history th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* Connexion restaurateur */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login__card { width: min(400px, 100%); display: grid; gap: 16px; padding: 32px 24px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1); text-align: center; }
.login__card .logo { justify-self: center; width: 56px; height: 56px; font-size: 30px; }
.login__card h1 { font-size: 34px; }
.login__card .field { text-align: left; }
.login__error { padding: 10px 12px; border-radius: var(--r-sm); background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 600; text-align: left; }

.form-grid.member-form { grid-template-columns: 1fr 150px auto; align-items: end; }

/* Appels des tables */
.requests { display: grid; gap: 10px; margin-bottom: 16px; }
.request { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--gold); box-shadow: var(--shadow-1); animation: ticketIn .4s var(--ease), glow 1.6s ease-in-out .4s infinite; }
.request--addition { border-left-color: var(--ok); }
.request__icon { font-size: 26px; }
.request__text { flex: 1; font-size: 15px; }
.request__text small { display: block; font-size: 12px; color: var(--muted); }
.table-group__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 6px 2px; font-size: 14px; flex-wrap: wrap; }

/* Pause, hors connexion */
.pause-btn.is-paused { background: var(--warn-soft); border-color: var(--warn); color: #7A5418; }
.k-offline { position: sticky; top: 0; z-index: 29; padding: 10px 20px; background: var(--danger); color: #fff; font-weight: 700; font-size: 14px; text-align: center; }

/* Catégories, photo, allergènes */
.cat-row { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 8px; align-items: center; }
.cat-row .help { white-space: nowrap; }
.cat-row .icon-btn:disabled { opacity: .35; cursor: default; }
.photo-field { display: flex; gap: 14px; align-items: center; }
.photo-field__preview { width: 96px; height: 96px; border-radius: 12px; flex: none; }
.photo-field__actions { display: grid; gap: 6px; justify-items: start; }
.check-row--sm label { padding: 6px 10px; font-size: 12px; }

/* Statistiques */
:root { --chart: #A8772B; }
.stats { max-width: 1100px; margin: 0 auto; display: grid; gap: 16px; }
.stats__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat-tile { padding: 16px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); display: grid; gap: 2px; align-content: start; }
.stat-tile span { font-size: 12px; font-weight: 700; color: var(--muted); }
.stat-tile b { font-family: var(--serif); font-size: 32px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-tile small { font-size: 12px; color: var(--ink-2); }
.stat-tiles--small .stat-tile b { font-size: 22px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-card { padding: 18px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); min-width: 0; }
.chart-card h3 { font-size: 22px; margin-bottom: 10px; }
.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart svg { display: block; overflow: visible; }
.chart-bar { fill: var(--chart); transition: opacity .15s; }
.chart:hover .chart-bar { opacity: .75; }
.chart-hit { fill: transparent; cursor: crosshair; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart-tip { position: absolute; transform: translate(-50%, -100%); padding: 8px 12px; border-radius: 10px; background: var(--matte); color: #fff; font-size: 12px; line-height: 1.4; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-2); z-index: 2; }
.chart-table { margin-top: 10px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }
.chart-table table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.chart-table th, .chart-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.top-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.top-list li { display: grid; grid-template-columns: minmax(0, 1.2fr) 1fr 128px; gap: 10px; align-items: center; font-size: 13px; }
.top-list__name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-list__bar { height: 10px; border-radius: 0 4px 4px 0; background: var(--sand-2); overflow: hidden; }
.top-list__bar span { display: block; height: 100%; background: var(--chart); border-radius: 0 4px 4px 0; }
.top-list__val { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
@media (max-width: 860px) { .stats-grid { grid-template-columns: 1fr; } }

/* Impression du ticket (80 mm) */
#printArea { display: none; }
@media print {
  @page { size: 80mm auto; margin: 4mm; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; }
  .print-ticket { width: 72mm; font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #000; }
  .print-ticket hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
  .pt-center { text-align: center; }
  .pt-big { text-align: center; font-size: 22px; font-weight: 800; margin: 4px 0; }
  .pt-line { margin: 4px 0; }
  .pt-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; }
}

.billing summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; list-style: none; }
.billing summary::-webkit-details-marker { display: none; }
.billing summary::after { content: '▾'; color: var(--muted); margin-left: auto; }
.billing[open] summary::after { content: '▴'; }

/* Stocks */
.stock-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto auto auto; gap: 14px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); }
.stock-row .editor-row__name { display: grid; gap: 4px; justify-items: start; }
.stock-row--out, .stock-row--off { background: var(--sand-2); }
.stock-row--out .editor-row__thumb, .stock-row--off .editor-row__thumb { opacity: .55; }
.stock-row--low { border-color: var(--warn); }
.qty-ctrl { display: inline-flex; align-items: center; gap: 6px; }
.qty-ctrl input { width: 72px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sand); text-align: center; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; outline: none; -moz-appearance: textfield; }
.qty-ctrl input::-webkit-outer-spin-button, .qty-ctrl input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-ctrl input:focus { border-color: var(--ink-2); background: #fff; }
.qty-ctrl .icon-btn:disabled { opacity: .35; cursor: default; }
.stock-cell { display: grid; gap: 4px; justify-items: center; }
.stock-cell__label { font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stock-cell--advice { min-width: 96px; padding: 6px 10px; border-radius: var(--r-sm); background: var(--sand); border: 1px dashed var(--line); gap: 0; }
.stock-cell--advice .stock-cell__label { color: var(--gold); }
.stock-cell--advice b { font-family: var(--serif); font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stock-cell--advice small { font-size: 11px; font-weight: 700; color: var(--muted); }
.stock-cell--advice.is-short { background: var(--warn-soft); border-color: var(--warn); }
.stock-cell--advice.is-short small { color: #8C5F1C; }
.stock-cell--advice.is-ok small { color: var(--ok); }
.stock-row__quick { display: flex; gap: 6px; }
.k-tab .count--warn { background: var(--warn); }
@media (max-width: 860px) {
  .stock-row { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .stock-row__quick, .stock-row .switch { grid-column: 2 / -1; }
  .stock-cell--advice { grid-column: 2 / -1; grid-template-columns: auto auto 1fr; justify-items: start; align-items: baseline; gap: 8px; }
}

/* Prévision IA du stock */
.forecast { display: grid; gap: 12px; padding: 18px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--gold); box-shadow: var(--shadow-1); }
.forecast__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.forecast__head .eyebrow { display: inline-flex; align-items: center; gap: 6px; color: var(--gold); }
.forecast__head h2 { font-size: 26px; }
.forecast__summary { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.forecast__alerts { margin: 0; padding: 10px 14px 10px 30px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--ink); font-size: 13px; display: grid; gap: 4px; }
.forecast__list { display: grid; gap: 6px; }
.fc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); background: var(--sand); border: 1px solid var(--line); }
.fc-row.is-done { opacity: .7; }
.fc-row__name { display: grid; gap: 2px; min-width: 0; }
.fc-row__name small { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.fc-row__qty { display: inline-flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.fc-row__qty b { font-family: var(--serif); font-size: 26px; color: var(--ink); }
.scan-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(150px, 220px) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); background: var(--sand); border: 1px solid var(--line); }
.scan-row.is-off { opacity: .6; }
.scan-row__check input { width: 18px; height: 18px; accent-color: var(--matte); }
.scan-row .badge { justify-self: start; margin-top: 4px; }
.scan-row select { min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font: inherit; font-size: 14px; color: var(--ink); }
.scan-row__qty { display: grid; grid-template-columns: auto 76px; gap: 2px 6px; align-items: center; font-weight: 700; color: var(--muted); }
.scan-row__qty input { height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font: inherit; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.scan-row__qty small { grid-column: 1 / -1; font-size: 11px; font-weight: 600; text-align: right; }
.scan .btn.is-disabled { opacity: .6; pointer-events: none; }
.forecast__ctx { display: flex; gap: 8px; flex-wrap: wrap; }
.forecast__ctx input { flex: 1 1 240px; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sand); font: inherit; font-size: 14px; outline: none; }
.forecast__ctx input:focus { border-color: var(--ink-2); background: #fff; }
@media (max-width: 860px) {
  .fc-row { grid-template-columns: minmax(0, 1fr) auto; }
  .fc-row > .btn, .fc-row > .badge { grid-column: 1 / -1; justify-self: start; }
  .scan-row { grid-template-columns: auto minmax(0, 1fr); }
  .scan-row select, .scan-row__qty { grid-column: 2; }
  .scan-row__qty { justify-content: start; }
  .scan-row__qty small { text-align: left; }
}

/* Paiement en ligne (Établissement) */
.pay-setup { display: grid; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.pay-setup h3 { font-size: 22px; }
.pay-setup p { margin: 0; font-size: 14px; }
.pay-setup .btn, .pay-setup .link-btn { justify-self: start; }

/* Prise de commande en salle */
.pad-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.pad-tables button { height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-family: var(--serif); font-size: 20px; font-weight: 600; }
.pad-tables button[aria-pressed="true"] { background: var(--matte); border-color: var(--matte); color: #fff; }
.pad-items { display: grid; gap: 6px; max-height: 42vh; overflow-y: auto; padding-right: 2px; }
.pad-item { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.pad-item.is-open { border-color: var(--ink-2); }
.pad-item__main { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 0; background: none; text-align: left; }
.pad-item__name { flex: 1; font-weight: 700; font-size: 15px; }
.pad-item__name small { font-weight: 600; font-size: 11px; color: var(--muted); }
.pad-item__price { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 14px; }
.pad-item__plus, .pad-item__qty { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex: none; }
.pad-item__plus { background: var(--sand-2); }
.pad-item__qty { background: var(--gold); color: #fff; }
.pad-opts { display: grid; gap: 10px; padding: 0 14px 14px; }
.pad-opts .opt-group legend { font-size: 13px; margin-bottom: 4px; }
.pad-ticket { display: grid; gap: 8px; padding: 14px; border-radius: var(--r-md); background: var(--sand-2); }
.pad-line { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pad-line__txt { display: grid; gap: 2px; min-width: 0; }
.pad-line__txt small { font-size: 12px; color: var(--ink-2); }
.pad-line__note { border: 0; border-bottom: 1px dashed var(--line); background: transparent; font-size: 12px; padding: 4px 0; outline: none; color: var(--danger); }
.pad-line__price { font-weight: 700; font-variant-numeric: tabular-nums; padding-top: 6px; }

/* Éditeur de menu */
.editor { max-width: 980px; margin: 0 auto; display: grid; gap: 22px; }
.editor__bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.editor__bar .search { margin: 0; flex: 1; min-width: 220px; }
.editor-cat h2 { font-size: 28px; margin-bottom: 10px; }
.editor-list { display: grid; gap: 8px; }
.editor-row {
  display: grid; grid-template-columns: 56px 1fr 120px auto auto; gap: 14px; align-items: center;
  padding: 10px 12px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line);
}
.editor-row.is-off { background: var(--sand-2); }
.editor-row.is-off .editor-row__thumb, .editor-row.is-off .editor-row__name { opacity: .55; }
.editor-row__thumb { width: 56px; height: 56px; border-radius: 10px; }
.editor-row__thumb::after { font-size: 22px; }
.editor-row__name strong { display: block; font-size: 15px; }
.editor-row__name span { font-size: 12px; color: var(--muted); }
.price-input { position: relative; }
.price-input input { width: 100%; height: 40px; padding: 0 28px 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sand); text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; outline: none; }
.price-input input:focus { border-color: var(--ink-2); background: #fff; }
.price-input::after { content: '€'; position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.editor-row__actions { display: flex; gap: 6px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check-row { display: flex; gap: 8px; flex-wrap: wrap; }
.check-row label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 600; cursor: pointer; }
.check-row label:has(input:checked) { border-color: var(--matte); background: var(--matte); color: #fff; }
.check-row input { accent-color: var(--matte); }
.optgroup-edit { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); }
.optgroup-edit .field > span { font-size: 12px; }
.optgroup-edit input, .optgroup-edit select { min-height: 40px; padding: 8px 10px; }
.og-head { display: grid; grid-template-columns: 170px 100px 1fr auto; grid-template-areas: "name name name moves" "type max req req"; gap: 8px; align-items: end; }
.og-head .og-name { grid-area: name; } .og-head .og-type { grid-area: type; } .og-head .og-max { grid-area: max; }
.og-head .og-req { grid-area: req; } .og-head .og-gmoves { grid-area: moves; align-self: end; padding-bottom: 4px; }
.og-head .og-max[hidden] { display: none; }
.og-head .switch { padding-bottom: 8px; }
.og-cols { display: grid; grid-template-columns: 1fr 96px auto; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.og-choices { display: grid; gap: 6px; }
.og-choice { display: grid; grid-template-columns: 1fr 96px auto auto auto; gap: 8px; align-items: center; }
.og-choice.is-off .og-choice__label { text-decoration: line-through; color: var(--muted); }
.og-choice__price { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.og-choice__price input { width: 100%; min-width: 0; text-align: right; }
.og-tog { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.og-tog input { width: 16px; height: 16px; min-height: 0; accent-color: var(--matte); }
.og-moves { display: inline-flex; gap: 2px; }
.icon-btn--sm { width: 32px; height: 32px; min-height: 32px; font-size: 14px; }
.icon-btn--sm svg { width: 15px; height: 15px; }
.og-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.og-add select { width: auto; min-height: 34px; cursor: pointer; }
.opt.is-off { opacity: .5; cursor: not-allowed; }
.check-row label.is-off { opacity: .5; }
@media (max-width: 640px) {
  .og-head { grid-template-columns: 1fr 90px; grid-template-areas: "name name" "type max" "req moves"; }
  .og-cols { display: none; }
  .og-choice { grid-template-columns: auto 1fr 104px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
  .og-choice .og-choice__label { grid-column: 1 / 3; }
  .og-choice .og-moves { justify-self: end; }
  .og-head .og-gmoves { justify-self: end; }
  .og-moves .icon-btn--sm { width: 30px; height: 30px; min-height: 30px; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
  .board { grid-template-columns: repeat(4, minmax(280px, 82vw)); }
}
@media (max-width: 760px) {
  .k-top { padding: 10px 16px; gap: 10px; }
  .k-clock { display: none; }
  .k-main { padding: 14px 16px 32px; }
  .k-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { margin: 0 -16px; padding: 0 16px 8px; }
  .editor-row { grid-template-columns: 48px 1fr 92px; }
  .editor-row__thumb { width: 48px; height: 48px; }
  .editor-row__toggle, .editor-row__actions { grid-column: 2 / -1; }
  .editor-row__toggle { justify-self: start; }
  .form-grid, .form-grid.member-form { grid-template-columns: 1fr; }
  .k-btn-label { display: none; }
}
@media (max-width: 380px) {
  .dish { grid-template-columns: 1fr 92px; }
  .dish__media { width: 92px; height: 92px; }
  .c-header h1 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   PAGE D'ACCUEIL DÉMO
   ========================================================================== */
.hub { max-width: 920px; margin: 0 auto; padding: 48px 16px 64px; display: grid; gap: 36px; }
.hub__hero { text-align: center; display: grid; gap: 14px; justify-items: center; }
.hub__hero h1 { font-size: clamp(36px, 7vw, 58px); }
.hub__hero p { max-width: 560px; color: var(--ink-2); }
.hub__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.hub-card { padding: 24px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); display: grid; gap: 14px; align-content: start; }
.hub-card h2 { font-size: 28px; }
.hub-card p { color: var(--ink-2); font-size: 14px; }
.nfc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.nfc-tag { aspect-ratio: 1; border-radius: 14px; border: 1px solid var(--line); background: var(--sand); display: grid; place-items: center; text-decoration: none; color: var(--ink); transition: all .2s var(--ease); }
.nfc-tag:hover { background: var(--matte); color: #fff; border-color: var(--matte); transform: translateY(-2px); }
.nfc-tag small { display: block; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; opacity: .6; text-align: center; }
.nfc-tag b { font-family: var(--serif); font-size: 26px; font-weight: 600; display: block; text-align: center; line-height: 1; }
.hub__tips { font-size: 13px; color: var(--muted); text-align: center; }
.hub__tips code { background: var(--sand-2); padding: 2px 6px; border-radius: 6px; }

/* Pourboire (paiement en ligne) */
.tip-box { display: grid; gap: 8px; margin-top: 14px; }
.tip-box__title { margin: 0; font-weight: 700; font-size: 14px; }
.tip-box .help { margin: 0; }
.tip-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.tip-chip { display: grid; gap: 2px; justify-items: center; padding: 10px 4px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); font: inherit; color: var(--ink); cursor: pointer; }
.tip-chip b { font-size: 14px; }
.tip-chip small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tip-chip.is-on { background: var(--matte); border-color: var(--matte); color: #fff; }
.tip-chip.is-on small { color: rgba(255, 255, 255, .7); }
.tip-custom { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tip-custom input { width: 110px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font: inherit; font-size: 16px; font-weight: 700; text-align: right; outline: none; }
.tip-custom input:focus { border-color: var(--ink-2); }
@media (max-width: 380px) { .tip-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.onsite-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.onsite-chips.is-missing { animation: onsite-shake .4s; }
.onsite-chips.is-missing .tip-chip { border-color: var(--danger); }
@keyframes onsite-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .onsite-chips.is-missing { animation: none; } }
.onsite-only { margin: 12px 0 0; padding: 10px 14px; border-radius: var(--r-sm); background: var(--sand-2); font-size: 14px; color: var(--ink-2); }
.onsite-set { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.onsite-set > span { font-size: 13px; font-weight: 700; color: var(--ink-2); }

/* Serveur attitré */
.track__server { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.review-ask { margin: 0 0 6px; font-size: 15px; line-height: 1.5; }
.table-server { margin-left: 10px; padding: 4px 10px; border-radius: 999px; border: 1px dashed var(--line); background: var(--card); font: inherit; font-size: 12px; font-weight: 700; color: var(--ink-2); vertical-align: middle; cursor: pointer; }
.srv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin-top: 12px; }
.srv-table { display: grid; gap: 2px; justify-items: center; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font: inherit; cursor: pointer; }
.srv-table b { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1; }
.srv-table small { font-size: 11px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-table.is-on { background: var(--matte); border-color: var(--matte); color: #fff; }
.srv-table.is-on small { color: rgba(255, 255, 255, .75); }
#srvKnown { margin: 8px 0 0; padding: 0; }
.check-line { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.4; cursor: pointer; }
.check-line input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--matte); flex: none; }
.request--pay { border-left-color: var(--info); animation: ticketIn .4s var(--ease); }
.request__actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 640px) { .request--pay { flex-wrap: wrap; } .request--pay .request__actions { width: 100%; justify-content: flex-start; } }

/* ---------- Bilan du mois ---------- */
.bilan { display: grid; gap: 16px; }
.bilan__hero { padding: 24px; border-radius: var(--r-lg); background: var(--matte); color: var(--sand); }
.bilan__hero .eyebrow { color: var(--gold); }
.bilan__hero h2 { color: #fff; font-size: 30px; margin-top: 4px; }
.bilan__big { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 16px; }
.bilan__big > div { display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .15); }
.bilan__big b { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--gold); font-variant-numeric: lining-nums tabular-nums; }
.bilan__big span { font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .8); }
.bilan__facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bilan__facts li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.bilan__facts li span { color: var(--ink-2); }
.bilan__facts li strong { text-align: right; }
@media print { .bilan__hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ---------- Dates limites (DLC / DDM) ---------- */
.dates-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.date-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line); }
.date-row--late { border-left-color: var(--danger); background: var(--danger-soft); }
.date-row--soon { border-left-color: var(--warn); background: var(--warn-soft); }
.date-row--week { border-left-color: var(--gold); }
.date-row__when { display: grid; gap: 2px; }
.date-row__when b { font-size: 15px; text-transform: capitalize; }
.date-row__when small { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.date-row--late .date-row__when small { color: var(--danger); }
.date-row__name { display: grid; gap: 4px; min-width: 0; }
.date-row__name > span { font-size: 13px; color: var(--ink-2); }
.date-row__actions { display: flex; gap: 6px; align-items: center; }
.date-quick { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .date-row { grid-template-columns: minmax(0, 1fr); }
  .date-row__actions { justify-content: flex-start; }
}
.member-station { height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font: inherit; font-size: 13px; }
.label-scan { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.label-scan .btn { cursor: pointer; }
.scan-row select[data-dated-station] { min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font: inherit; font-size: 14px; }
.qty-unit { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; }
.qty-unit select { height: 46px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font: inherit; }
.loss-reasons { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.loss-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.loss-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.loss-table td { padding: 10px; border-bottom: 1px solid var(--line); }

/* ---------- Marges et fiches techniques ---------- */
.margins { display: grid; gap: 16px; }
.margins-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.margins-head h3 { margin: 0; }
.margin-table td { vertical-align: middle; font-variant-numeric: tabular-nums; }
.margin-table td:last-child { text-align: right; white-space: nowrap; }
.margin-src { display: block; font-size: 12px; color: var(--muted); }
.margin-price { margin: 0; min-height: 46px; display: flex; align-items: center; font-weight: 600; }
.recipe-lines { display: grid; gap: 8px; margin-top: 12px; }
.recipe-line { display: grid; grid-template-columns: minmax(0, 1fr) 80px 92px 72px 40px; gap: 8px; align-items: center; }
.recipe-line select, .recipe-line input { height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font: inherit; min-width: 0; }
.recipe-line__cost { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.recipe-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.recipe-total { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; padding: 12px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); }
.recipe-total span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
.recipe-total b { font-size: 18px; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .recipe-line { grid-template-columns: 1fr 1fr 1fr 40px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .recipe-line select[data-line-ing] { grid-column: 1 / -1; }
}
.recipe-total .badge { display: inline-block; }
.recipe-opts { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.recipe-opts h3 { margin: 0 0 4px; font-size: 16px; }
.recipe-opts__group { margin: 14px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.recipe-opt { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; margin-bottom: 8px; }
.recipe-opt .recipe-lines, .recipe-opt .recipe-line { margin-top: 8px; }
.recipe-opt .recipe-add { margin-top: 8px; }
.recipe-opt__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 14px; }
.recipe-opt__head > span { color: var(--ink-2); font-size: 13px; }
.recipe-opt__cost { margin-left: auto; font-variant-numeric: tabular-nums; }
.switch small.help { display: block; font-weight: 400; }

/* ---------- Pack HACCP ---------- */
.haccp { display: grid; gap: 16px; }
.haccp-title { font-size: 22px; margin: 0 0 4px; }
.haccp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.haccp .date-list { display: grid; gap: 8px; margin-top: 10px; }
.haccp-row .date-row__when b { font-variant-numeric: tabular-nums; text-transform: none; }
.haccp-task { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.haccp-task:last-child { border-bottom: 0; }
.haccp-task strong { display: block; font-size: 14px; }
.haccp-task small { font-size: 12px; color: var(--muted); }
.haccp-task__check { width: 36px; height: 36px; border-radius: 10px; border: 2px solid var(--line); background: #fff; font-size: 18px; font-weight: 700; color: #fff; cursor: pointer; }
.haccp-task__check:hover { border-color: var(--ink-2); }
.haccp-task.is-done .haccp-task__check { background: var(--ok, #3f7d4e); border-color: var(--ok, #3f7d4e); cursor: default; }
.haccp-task.is-done strong { color: var(--ink-2); }
.haccp-alert { margin: 0 0 8px; font-weight: 700; color: var(--danger); }
.temp-input { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.temp-input input { height: 46px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font: inherit; font-size: 20px; min-width: 0; }
.temp-input .btn { height: 46px; padding: 0; font-size: 18px; }
@media (max-width: 560px) { .haccp-row { grid-template-columns: 96px minmax(0, 1fr); } .haccp-row .date-row__actions { grid-column: 1 / -1; } }

/* ---------- Commandes fournisseurs ---------- */
.order-lines { display: grid; gap: 8px; }
.order-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.order-line.is-off { opacity: .6; }
.order-line strong { display: block; }
.order-line small { display: block; font-size: 12px; color: var(--ink-2); }
.order-line .order-line__why { color: var(--muted); }
.qty-stepper { display: grid; grid-template-columns: 40px 64px 40px; gap: 4px; align-items: center; }
.qty-stepper input { height: 40px; text-align: center; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; font-weight: 700; min-width: 0; }
.qty-stepper .icon-btn { font-size: 20px; font-weight: 700; }
.order-preview { margin-top: 12px; }
.order-preview summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.order-preview pre { white-space: pre-wrap; font: 13px/1.5 inherit; font-family: inherit; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; margin-top: 8px; }
.order-send { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.order-send .btn { flex: 1 1 140px; }
.sup-products { display: grid; gap: 8px; }
.sup-product { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 120px 80px; gap: 8px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sup-product select, .sup-product input { height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font: inherit; min-width: 0; }
.sup-product input:disabled { background: var(--card); }
.sup-product__size { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sup-product__size input { width: 64px; }
@media (max-width: 720px) {
  .sup-product { grid-template-columns: 1fr 1fr; }
  .sup-product > strong { grid-column: 1 / -1; }
}

/* ---------- Anti-gaspillage ---------- */
.badge--promo { background: var(--ok-soft); color: var(--ok); }
.price--promo { color: var(--ok); }
.price-old { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dish__meta .price-old { margin-left: -4px; }
.c-section--promo { padding: 14px 14px 4px; margin: 0 -14px 8px; border-radius: var(--r-lg); background: var(--ok-soft); }
.c-section__note { margin: -4px 0 10px; font-size: 13px; color: var(--ink-2); }
.sheet-price { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.antigaspi { border-color: var(--ok); }

/* ---------- Carte multilingue ---------- */
.lang-btn { width: 40px; height: 40px; padding: 0; font-size: 20px !important; line-height: 1; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; flex: none; }
.lang-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lang-list { display: grid; gap: 8px; }
.lang-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; cursor: pointer; }
.lang-row input { width: 18px; height: 18px; }
.lang-row__name { font-weight: 700; }

/* ---------- Planning de l'équipe ---------- */
.planning { display: grid; gap: 16px; }
.pl-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.pl-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pl-nav .icon-btn { font-size: 22px; font-weight: 700; }
.pl-nav__label { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pl-nav__label strong { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.pl-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pl-grid-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.pl-grid { width: 100%; min-width: 920px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.pl-grid th, .pl-grid td { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 6px; vertical-align: top; text-align: left; }
.pl-grid thead th { background: var(--sand-2); font-weight: 700; font-size: 13px; position: sticky; top: 0; }
.pl-grid .pl-who { width: 150px; border-left: 0; position: sticky; left: 0; background: var(--card); z-index: 1; display: table-cell; }
.pl-grid thead .pl-who { background: var(--sand-2); z-index: 2; }
.pl-grid tbody .pl-who { font-weight: 400; }
.pl-grid .pl-who strong { display: block; font-size: 14px; }
.pl-grid .pl-who small { display: block; font-size: 12px; color: var(--muted); }
.pl-grid .pl-who small.pl-over { color: var(--warn); font-weight: 700; }
.pl-grid tbody .pl-who { display: table-cell; }
.pl-grid tbody .pl-who > span { display: inline-block; vertical-align: top; }
.pl-day { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.pl-day b { font-family: var(--serif); font-size: 20px; color: var(--ink); text-transform: none; }
.pl-meta { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.pl-load { display: block; height: 4px; border-radius: 4px; background: var(--sand-3); margin-top: 5px; overflow: hidden; }
.pl-load span { display: block; height: 100%; background: var(--chart); border-radius: 4px; }
.pl-grid .is-today { background: #FFFDF8; }
.pl-grid thead th.is-today { background: var(--gold-soft); }
.pl-cell { cursor: pointer; height: 64px; position: relative; }
.pl-cell:hover { background: var(--sand-2); }
.pl-add { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line); font-size: 22px; font-weight: 300; }
.pl-cell:hover .pl-add { color: var(--muted); }
.pl-shift, .pl-unav { display: block; width: 100%; text-align: left; border-radius: 10px; padding: 6px 8px; margin-bottom: 4px; font: inherit; cursor: pointer; border: 1px solid transparent; }
.pl-shift b { display: block; font-size: 13px; font-variant-numeric: tabular-nums; }
.pl-shift small { display: block; font-size: 11px; opacity: .8; }
.pl-shift--bar { background: var(--gold-soft); color: #6C552E; border-color: #E6D8BD; }
.pl-shift--salle { background: var(--info-soft); color: #33506F; border-color: #D2DDEA; }
.pl-shift--cuisine { background: var(--ok-soft); color: #2F5A3C; border-color: #CFE0D2; }
.pl-shift--plonge { background: var(--sand-3); color: var(--ink-2); border-color: var(--line); }
.pl-shift--direction { background: var(--matte); color: #fff; }
.pl-shift.is-swap { border: 2px dashed var(--warn); }
.pl-unav { background: repeating-linear-gradient(45deg, var(--danger-soft), var(--danger-soft) 6px, #fff 6px, #fff 12px); color: var(--danger); font-size: 12px; font-weight: 700; border-color: #EBC9C0; }
.pl-unav.is-pending { opacity: .75; border-style: dashed; }
.pl-foot td, .pl-foot th { background: var(--sand-2); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.pl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 5px 8px 0 0; vertical-align: top; }
.pl-dot--bar { background: var(--gold); } .pl-dot--salle { background: var(--info); } .pl-dot--cuisine { background: var(--ok); }
.pl-dot--plonge { background: var(--muted); } .pl-dot--direction { background: var(--matte); }
.pl-alerts { list-style: none; display: grid; gap: 6px; margin: 0 0 8px; padding: 0; }
.pl-alert { padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.pl-alert--warn { background: var(--warn-soft); color: #8C5F1C; }
.pl-alert--danger { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.pl-req { display: flex; gap: 6px; flex-wrap: wrap; }
.pl-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-sugg .chip { padding: 8px 12px; font-size: 13px; }
.pl-days { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-days label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; background: #fff; }
.pl-days input { width: 16px; height: 16px; }
.pl-sum { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
.pl-mine { display: grid; gap: 8px; }
.pl-mine__row { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.pl-mine__row > div { display: grid; gap: 2px; }
.pl-mine__row strong { text-transform: capitalize; }
.pl-mine__row span { font-size: 14px; color: var(--ink-2); }
.pl-clock { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.pl-clock__btn { display: grid; gap: 4px; text-align: left; padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: #fff; font: inherit; cursor: pointer; min-height: 92px; }
.pl-clock__btn strong { font-size: 18px; }
.pl-clock__btn small { font-size: 12px; color: var(--muted); }
.pl-clock__btn.is-in { border-color: var(--ok); background: var(--ok-soft); }
.pl-clock__btn.is-in small { color: #2F5A3C; font-weight: 700; }
.pl-pin { font-size: 32px !important; letter-spacing: .5em; text-align: center; height: 64px; }
.pl-punch { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.pl-punch input { height: 40px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; min-width: 0; }
@media (max-width: 640px) { .pl-punch { grid-template-columns: 1fr; } .pl-nav__label strong { font-size: 20px; } }
.pl-who__in { display: flex; align-items: flex-start; gap: 0; }
.pl-shift b { white-space: nowrap; font-size: 12px; }
.pl-send { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pl-link { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--sand-2); font: inherit; font-size: 13px; margin-top: 12px; }
.pl-notify { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.pl-notify > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.pl-notify span { font-size: 13px; color: var(--muted); }
.pl-notify .pl-send { margin-top: 6px; }

/* ---------- Page personnelle du planning ---------- */
.portal { display: grid; gap: 16px; padding-top: 20px; padding-bottom: 40px; }
.portal__head h1 { font-family: var(--serif); font-size: 38px; font-weight: 600; margin: 4px 0 12px; }
.portal__next { display: grid; gap: 2px; padding: 18px; border-radius: var(--r-lg); background: var(--matte); color: #fff; }
.portal__next span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.portal__next strong { font-size: 18px; }
.portal__next b { font-family: var(--serif); font-size: 40px; font-weight: 600; line-height: 1.1; }
.portal__next small { color: var(--sand-3); }
.portal__weeks { margin: 0; padding: 2px 0; }
.portal__days { display: grid; gap: 8px; }
.portal__day { border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; padding: 0 14px; }
.portal__day summary { list-style: none; display: flex; justify-content: space-between; gap: 10px; padding: 14px 0; cursor: pointer; }
.portal__day summary::-webkit-details-marker { display: none; }
.portal__day summary span { font-weight: 600; }
.portal__day summary b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.portal__day.is-working summary b { color: var(--ink); font-weight: 800; }
.portal__day.is-today { border-color: var(--gold); }
.portal__shift { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 0 0 10px; font-size: 14px; color: var(--ink-2); }
.portal__team { margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }
.portal__team span { font-weight: 700; color: var(--muted); }
.portal__team small { color: var(--muted); }
.portal__foot { text-align: center; }
.pl-send a { text-decoration: none; }

/* ---------------- Fidélité ---------------- */
.loy-btn { height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--gold-soft); background: var(--gold-soft); color: #7C6338; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; flex: none; white-space: nowrap; }
.loy-box { margin: 14px 0 4px; padding: 14px; border-radius: 14px; background: var(--gold-soft); color: var(--ink); }
.loy-box__title { margin: 0 0 4px; font-weight: 800; font-size: 14px; color: #7C6338; }
.loy-box .help { margin: 0 0 10px; }
.loy-rewards { display: flex; flex-wrap: wrap; gap: 8px; }
.loy-reward { display: grid; gap: 2px; text-align: left; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(124, 99, 56, .25); background: var(--card); font: inherit; color: var(--ink); cursor: pointer; max-width: 100%; }
.loy-reward b { font-size: 13px; }
.loy-reward small { font-size: 12px; color: var(--muted); }
.loy-reward.is-on { border-color: #7C6338; box-shadow: 0 0 0 2px #7C6338 inset; }
.loy-reward.is-on small { color: #7C6338; font-weight: 700; }
.loy-reward:disabled { opacity: .6; cursor: default; }
.loy-card { display: grid; gap: 4px; padding: 18px; border-radius: 18px; background: linear-gradient(135deg, #2B2A27, #4A4234); color: #F6EFE2; }
.loy-card span { font-size: 13px; opacity: .8; }
.loy-card b { font-family: 'Cormorant Garamond', serif; font-size: 38px; line-height: 1.1; }
.loy-card small { font-size: 12px; opacity: .8; }
.loy-progress { height: 6px; border-radius: 6px; background: rgba(255,255,255,.18); overflow: hidden; margin-top: 8px; }
.loy-progress span { display: block; height: 100%; background: #D9B97A; border-radius: 6px; }
.loy-h { margin: 18px 0 8px; font-size: 14px; font-weight: 800; }
.loy-list { display: grid; gap: 6px; }
.loy-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.loy-item small { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.loy-item.is-ok { border-color: #C9A86A; }
.loy-plus { color: var(--ok, #2F7D4F); font-weight: 800; }
.loy-minus { color: var(--danger); font-weight: 800; }
.loy-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.loy-rw { display: grid; grid-template-columns: 1.2fr 1.4fr 90px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.loy-rw input, .loy-rw select { width: 100%; min-width: 0; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font: inherit; font-size: 14px; color: var(--ink); }
.loy-rw__pts { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.loy-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0 4px; }
.loy-stats div { display: grid; padding: 10px; border-radius: 12px; background: var(--gold-soft); text-align: center; }
.loy-stats b { font-size: 20px; color: #7C6338; }
.loy-stats span { font-size: 11px; color: var(--muted); }
.loy-clients-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.loy-clients-head .loy-h { margin-right: auto; }
.loy-clients-head .search { max-width: 200px; }
.loy-client { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.loy-client small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .loy-rw { grid-template-columns: 1fr 80px 36px; }
  .loy-rw__item { grid-column: 1 / -1; grid-row: 2; }
  .loy-stats { grid-template-columns: repeat(2, 1fr); }
  .loy-client { grid-template-columns: 1fr auto auto; }
  .loy-client > span:nth-of-type(2), .loy-client > span:nth-of-type(3) { display: none; }
}
.loy-btn b { font-weight: 800; }
.loy-clients-head .search input { padding-left: 14px; }
@media (max-width: 480px) { .loy-btn { padding: 0 10px; } .loy-btn__u { display: none; } }
/* En-tête client : avec la pastille fidélité, la ligne passe sur deux rangées sur petit écran. */
@media (max-width: 480px) {
  .c-header__row:has(.loy-btn:not([hidden])) { flex-wrap: wrap; row-gap: 10px; }
  .c-header__row:has(.loy-btn:not([hidden])) .c-header__name { flex: 1 1 calc(100% - 140px); }
  .c-header__row:has(.loy-btn:not([hidden])) .service-trigger { margin-left: auto; }
  .c-header__row:has(.loy-btn:not([hidden])) .c-header__name ~ * { order: 2; }
  .c-header__row:has(.loy-btn:not([hidden])) .table-badge { order: 1; }
}

/* ---------------- Export comptable ---------------- */
.cp-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.cp-custom { display: flex; gap: 8px; }
.cp-custom[hidden] { display: none; }
.cp-custom .field input { height: 38px; }
.cp-period { margin: 0 0 10px; font-weight: 800; }
.cp-files { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; width: 100%; }
.cp-files .btn { flex: 1 1 auto; }
.cp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.cp-kpis div { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.cp-kpis b { font-size: 20px; }
.cp-kpis span { font-size: 12px; color: var(--muted); }
.cp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; align-items: start; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cp-table th, .cp-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.cp-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cp-table td:last-child, .cp-table th:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cp-table--days td, .cp-table--days th { text-align: right; font-variant-numeric: tabular-nums; }
.cp-table--days td:first-child, .cp-table--days th:first-child { text-align: left; }
.cp-strong td { font-weight: 800; }
.cp-sum .help { margin: 6px 0 0; }
.cp-acc { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.cp-acc summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.cp-acc__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.cp-acc__grid .field input { height: 38px; }
@media (max-width: 640px) {
  .cp-kpis { grid-template-columns: repeat(2, 1fr); }
  .cp-cols { grid-template-columns: 1fr; }
  .cp-acc__grid { grid-template-columns: 1fr 1fr; }
  .cp-files .btn { flex: 1 1 calc(50% - 4px); padding-left: 8px; padding-right: 8px; }
}
.request--gate { border-left-color: var(--gold); background: var(--gold-soft); }
.loy-privacy { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.loy-privacy summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--ink); }
.loy-privacy ul { margin: 8px 0 0 18px; display: grid; gap: 6px; line-height: 1.45; }
.loy-privacy__short { margin: 0; }
.loy-privacy__short a, .loy-privacy a { color: inherit; text-decoration: underline; }
.loy-data { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.loy-data p { margin: 0; }
.loy-data .btn { justify-self: start; }
.loy-data .link-btn { justify-self: start; }
.loy-home { margin: 16px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--gold-soft); font-size: 13px; color: #7C6338; font-weight: 600; }
.loy-client__acts { display: inline-flex; gap: 6px; align-items: center; }
.rec-code { font-size: 26px !important; letter-spacing: .4em; text-align: center; font-weight: 700; }
.loy-recover-link { margin: 0; }
