/* ÑamÑam — design system (charte terre cuite / ocre / sable) */
:root {
  --brand: #8a4b24;
  --brand-dark: #6b3a1c;
  --ocre: #d98324;
  --sand: #f7f1e5;
  --sand-deep: #efe4cc;
  --ink: #4a3423;
  --muted: #9a7f66;
  --green: #2e7d4f;
  --green-soft: #e3f0e8;
  --red: #c0392b;
  --red-soft: #fdeceb;
  --indigo: #3f51b5;
  --card: #ffffff;
  --radius: 22px;
  --shadow: 0 6px 24px rgba(107, 58, 28, .08);
  --shadow-lift: 0 10px 30px rgba(107, 58, 28, .14);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--sand);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 1rem; color: var(--ink); }
a { color: var(--brand); }

#app { max-width: 1100px; margin: 0 auto; padding: 0 16px 96px; }
@media (min-width: 768px) { #app { padding-bottom: 32px; } }

/* ── Topbar ── */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 4px 10px; position: sticky; top: 0; z-index: 30;
  background: linear-gradient(var(--sand) 82%, transparent);
}
.logo-badge {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: grid; place-items: center; font-size: 22px; color: #fff;
  box-shadow: var(--shadow);
}
.topbar h1 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em; }
.topbar .sub { font-size: .78rem; color: var(--muted); font-weight: 500; }
.topbar .spacer { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--sand-deep); border-radius: 999px;
  padding: 6px 14px; font-size: .8rem; font-weight: 700; color: var(--brand);
}
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.red { background: var(--red-soft); color: var(--red); }

/* ── Nav bas (mobile) / haut (desktop) ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--sand-deep);
  display: flex; justify-content: space-around;
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: .68rem; font-weight: 700; color: var(--muted);
  padding: 4px 10px; border-radius: 12px; position: relative; min-width: 58px;
}
.bottom-nav button .ico { font-size: 1.3rem; line-height: 1; }
.bottom-nav button.active { color: var(--brand); background: var(--sand); }
.badge {
  position: absolute; top: -2px; right: 6px;
  background: var(--ocre); color: #fff; font-size: .62rem; font-weight: 800;
  min-width: 17px; height: 17px; border-radius: 999px;
  display: grid; place-items: center; padding: 0 4px;
}
@media (min-width: 768px) {
  .bottom-nav {
    position: sticky; top: 0; bottom: auto; border-top: none;
    border-bottom: 1px solid var(--sand-deep); border-radius: 0 0 18px 18px;
    justify-content: center; gap: 8px; margin: 0 -16px 8px;
  }
  .bottom-nav button { flex-direction: row; gap: 8px; font-size: .85rem; padding: 8px 16px; }
}

/* ── Cartes & sections ── */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card.hover:hover { transform: translateY(-2px) scale(1.01); box-shadow: var(--shadow-lift); }
.section-title {
  font-size: .78rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ocre); margin: 22px 0 10px;
}
.page-title { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 2px; }
.page-sub { color: var(--muted); font-size: .92rem; margin-bottom: 14px; }

/* ── Catégories ── */
.cat-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.cat-row::-webkit-scrollbar { display: none; }
.cat-pill {
  flex: none; padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: .88rem;
  background: #fff; color: var(--ink); box-shadow: var(--shadow);
}
.cat-pill.active { background: var(--brand); color: #fff; }

/* ── Grille produits ── */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.product-card { position: relative; padding: 0; overflow: hidden; text-align: left; }
.product-visual {
  height: 110px; display: grid; place-items: center; font-size: 52px;
  background: linear-gradient(135deg, var(--sand-deep), #f9f3e6);
}
.product-visual.g1 { background: linear-gradient(135deg,#e8c9a8,#d98324aa); }
.product-visual.g2 { background: linear-gradient(135deg,#f5d9e2,#e8a5b8aa); }
.product-visual.g3 { background: linear-gradient(135deg,#cfe6d8,#7fb99baa); }
.product-body { padding: 12px 14px 14px; }
.product-name { font-weight: 800; font-size: .95rem; }
.product-desc { font-size: .76rem; color: var(--muted); margin-top: 2px; min-height: 2.1em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-weight: 800; color: var(--brand); margin-top: 6px; }
.add-fab {
  position: absolute; right: 10px; bottom: 10px;
  width: 38px; height: 38px; border-radius: 999px;
  background: var(--ocre); color: #fff; font-size: 1.3rem; font-weight: 800;
  display: grid; place-items: center; box-shadow: var(--shadow-lift);
}
.soldout-tag {
  position: absolute; top: 10px; left: 10px;
  background: var(--red-soft); color: var(--red);
  font-size: .7rem; font-weight: 800; padding: 4px 10px; border-radius: 999px;
}

/* ── Boutons ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 18px; border-radius: 16px;
  min-height: 54px; /* <--- Ajoute cette ligne */
  font-size: 1rem; font-weight: 800;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.ocre { background: var(--ocre); color: #fff; }
.btn.ghost { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.btn.outline { background: transparent; border: 2px solid var(--brand); color: var(--brand); }
.btn.danger-ghost { background: var(--red-soft); color: var(--red); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 9px 14px; font-size: .85rem; width: auto; border-radius: 12px; }

/* ── Formulaires ── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 13px 15px; border-radius: 14px;
  border: 1.5px solid var(--sand-deep); background: #fff; outline: none;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ocre); }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 1.4rem !important; font-weight: 800; }

/* ── Panier / lignes ── */
.line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sand); }
.line:last-child { border-bottom: none; }
.line .emoji-box {
  width: 48px; height: 48px; border-radius: 14px; flex: none;
  background: var(--sand-deep); display: grid; place-items: center; font-size: 24px;
}
.line .grow { flex: 1; min-width: 0; }
.line .t { font-weight: 800; font-size: .95rem; }
.line .s { font-size: .76rem; color: var(--muted); }
.qty-ctrl { display: flex; align-items: center; gap: 10px; }
.qty-ctrl button {
  width: 32px; height: 32px; border-radius: 999px; font-size: 1.1rem; font-weight: 800;
  background: var(--sand-deep); color: var(--brand);
}
.qty-ctrl .n { font-weight: 800; min-width: 18px; text-align: center; }
.price-tag { font-weight: 800; color: var(--brand); white-space: nowrap; }

.totals { padding-top: 12px; }
.totals .row { display: flex; justify-content: space-between; padding: 4px 0; font-size: .95rem; }
.totals .row.total { font-size: 1.2rem; font-weight: 800; padding-top: 8px; }

/* ── Options / toggles ── */
.opt-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1.5px solid var(--sand-deep);
  border-radius: 14px; padding: 13px 15px; margin-bottom: 10px;
}
.opt-row .lbl { font-weight: 700; }
.opt-row .pr { color: var(--ocre); font-weight: 700; font-size: .88rem; margin-right: 12px; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--sand-deep); transition: .2s;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 999px; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: .2s;
}
.switch input:checked + .track { background: var(--ocre); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* ── Statuts commandes ── */
.status-pill { font-size: .72rem; font-weight: 800; padding: 5px 12px; border-radius: 999px; }
.st-recue          { background: #e8eaf6; color: var(--indigo); }
.st-en_preparation { background: #fdf0dd; color: var(--ocre); }
.st-prete          { background: var(--green-soft); color: var(--green); }
.st-recuperee      { background: var(--sand-deep); color: var(--muted); }
.st-annulee        { background: var(--red-soft); color: var(--red); }

/* Timeline suivi */
.timeline { padding: 8px 0 4px; }
.tl-step { display: flex; gap: 14px; position: relative; padding-bottom: 26px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step::before {
  content: ''; position: absolute; left: 17px; top: 36px; bottom: 0;
  width: 2px; background: var(--sand-deep);
}
.tl-step:last-child::before { display: none; }
.tl-dot {
  width: 36px; height: 36px; border-radius: 999px; flex: none; z-index: 1;
  display: grid; place-items: center; font-size: 15px;
  background: var(--sand-deep); color: var(--muted);
}
.tl-step.done .tl-dot { background: var(--green); color: #fff; }
.tl-step.now  .tl-dot { background: var(--ocre); color: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(217,131,36,.4); } 50% { box-shadow: 0 0 0 9px rgba(217,131,36,0); } }
.tl-step .t { font-weight: 800; }
.tl-step .s { font-size: .8rem; color: var(--muted); }

/* ── Onglets file de service ── */
.tabs { display: flex; gap: 8px; background: #fff; border-radius: 999px; padding: 6px; box-shadow: var(--shadow); margin-bottom: 16px; }
.tabs button {
  flex: 1; padding: 10px 8px; border-radius: 999px; font-weight: 800; font-size: .85rem; color: var(--muted);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tabs button.active { background: var(--brand); color: #fff; }
.tabs .count {
  background: var(--sand-deep); color: var(--brand); border-radius: 999px;
  font-size: .7rem; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px;
}
.tabs button.active .count { background: rgba(255,255,255,.25); color: #fff; }

/* Cartes commandes admin */
.order-card { border-left: 5px solid var(--indigo); padding: 0; overflow: hidden; }
.order-card.b-prep { border-left-color: var(--ocre); }
.order-card.b-prete { border-left-color: var(--green); }
.order-card .oc-body { padding: 16px 18px 10px; }
.order-card .oc-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.order-card .oc-no { font-weight: 800; font-size: 1.05rem; }
.order-card ul { list-style: none; }
.order-card li { font-size: .9rem; padding: 2px 0; color: var(--ink); }
.order-card li .opt { color: var(--muted); font-size: .78rem; }
.order-card .oc-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.oc-action { width: 100%; padding: 14px; font-weight: 800; color: #fff; font-size: .95rem; }
.oc-action.to-prep { background: var(--brand-dark); }
.oc-action.to-prete { background: var(--ocre); }
.oc-action.to-done { background: var(--green); }

/* ── Stat cards dashboard ── */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat .k { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat .v { font-size: 1.6rem; font-weight: 800; margin-top: 4px; }
.stat .v small { font-size: .9rem; color: var(--muted); font-weight: 700; }
.stat .ico { font-size: 1.4rem; margin-bottom: 6px; display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px; background: var(--sand-deep); }

/* Graph barres 7 jours */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 10px; }
.bars .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar {
  width: 100%; max-width: 54px; border-radius: 10px 10px 4px 4px; min-height: 5px;
  background: linear-gradient(180deg, var(--ocre), var(--brand));
}
.bars .bar.today { background: linear-gradient(180deg, #4caf7d, var(--green)); }
.bars .lbl { font-size: .68rem; font-weight: 800; color: var(--muted); text-transform: uppercase; }

/* ── Tables admin ── */
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; }
.tbl td { padding: 10px; border-top: 1px solid var(--sand); }

/* ── Sheet / modale ── */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(74,52,35,.45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.sheet {
  background: var(--sand); width: 100%; max-width: 560px;
  border-radius: 26px 26px 0 0; max-height: 88vh; overflow-y: auto;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  animation: slideUp .22s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: .6; } }
@media (min-width: 768px) {
  .sheet-backdrop { align-items: center; }
  .sheet { border-radius: 26px; }
}
.sheet .drag { width: 44px; height: 5px; border-radius: 999px; background: var(--sand-deep); margin: 6px auto 14px; }
.sheet-visual { height: 150px; border-radius: 20px; display: grid; place-items: center; font-size: 64px;
  background: linear-gradient(135deg, #e8c9a8, #d9832488); margin-bottom: 16px; }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-weight: 700; font-size: .9rem; opacity: 0; pointer-events: none;
  transition: .25s ease; z-index: 100; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Auth ── */
.auth-wrap { max-width: 420px; margin: 6vh auto 0; }
.auth-logo {
  width: 84px; height: 84px; border-radius: 26px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: grid; place-items: center; font-size: 42px; box-shadow: var(--shadow-lift);
}
.auth-title { text-align: center; font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.auth-sub { text-align: center; color: var(--muted); margin: 6px 0 24px; }

.empty { text-align: center; color: var(--muted); padding: 44px 16px; }
.empty .big { font-size: 46px; margin-bottom: 10px; }

.loading-center { display: grid; place-items: center; min-height: 60vh; }
.spinner {
  width: 42px; height: 42px; border-radius: 999px;
  border: 4px solid var(--sand-deep); border-top-color: var(--ocre);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.notice { background: #fdf0dd; border: 1.5px solid #f3d9ae; color: #8a5a12;
  border-radius: 14px; padding: 12px 14px; font-size: .85rem; margin-bottom: 14px; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt24{margin-top:24px}
.mb8{margin-bottom:8px}.mb12{margin-bottom:12px}.mb16{margin-bottom:16px}
.flex{display:flex;align-items:center;gap:10px}.grow{flex:1}
.center{text-align:center}

/* ══════════ PHASE 1 ══════════ */

/* ── Mode nuit — spec stricte ──
   « Fond nuit profonde #121212, texte blanc pur, cartes #1E1E1E,
     jamais de gris sur gris, jamais de couleurs flashy. » */
body, .card, .cat-pill, .btn, .field input, .field textarea, .field select,
.opt-row, .bottom-nav, .sheet, .bill-item, .tabs, .notice, .table-btn {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
[data-theme="dark"] {
  --sand: #1C1C1E;            /* fond nuit adouci (moins sombre, plus confortable) */
  --sand-deep: #3A3A3C;       /* séparations */
  --ink: #FFFFFF;             /* texte principal — blanc pur, jamais de gris pâle */
  --muted: #B8B8BD;           /* texte secondaire — contraste ≥ 4.5:1 */
  --card: #2C2C2E;            /* cartes, boutons, champs */
  --brand: #6e3c1d;           /* primaire assombri de ~20 % */
  --brand-dark: #57301a;
  --ocre: #b06a1d;            /* saturations adoucies — pas de flashy */
  --green: #2e7d4f;
  --green-soft: #003D1A;      /* badge promo : fond vert très sombre */
  --red: #FF6B6B;             /* rouge doux, jamais de rouge vif */
  --red-soft: #3D0000;        /* badge épuisé : fond rouge très sombre */
  --shadow: 0 2px 8px rgba(0,0,0,.10);
  --shadow-lift: 0 4px 14px rgba(0,0,0,.10);
}
[data-theme="dark"] body { background: var(--sand); color: var(--ink); font-weight: 500; }
[data-theme="dark"] .card, [data-theme="dark"] .cat-pill, [data-theme="dark"] .guest-chip,
[data-theme="dark"] .btn.ghost, [data-theme="dark"] .tabs,
[data-theme="dark"] .tip-row button, [data-theme="dark"] .pin-pad button { background: var(--card); color: var(--ink); }
[data-theme="dark"] .bottom-nav { background: rgba(18,18,18,.97); border-color: #2C2C2C; }
[data-theme="dark"] .bottom-nav button { color: var(--muted); }
[data-theme="dark"] .bottom-nav button.active { color: var(--ink); background: var(--card); }
[data-theme="dark"] .field input, [data-theme="dark"] .field textarea,
[data-theme="dark"] .field select, [data-theme="dark"] .opt-row,
[data-theme="dark"] .bill-item { background: var(--card); border-color: #2C2C2C; color: var(--ink); }
[data-theme="dark"] .field input::placeholder, [data-theme="dark"] .field textarea::placeholder { color: #757575; }
[data-theme="dark"] .line { border-color: #2C2C2C; }
[data-theme="dark"] .product-visual,
[data-theme="dark"] .product-visual.g1, [data-theme="dark"] .product-visual.g2,
[data-theme="dark"] .product-visual.g3 { background: #1E1E1E; }
[data-theme="dark"] .product-price, [data-theme="dark"] .price-tag { color: #FFB347; }
[data-theme="dark"] .sheet { background: var(--sand); }
[data-theme="dark"] .sheet-visual { background: #1E1E1E; }
[data-theme="dark"] .notice { background: #332200; border-color: #4a3200; color: #FFB347; }
[data-theme="dark"] .soldout-tag { background: #3D0000; color: #FF6B6B; }
[data-theme="dark"] .chip { background: #1E1E1E; color: var(--muted); }
[data-theme="dark"] .chip.green { background: #003D1A; color: #4ADE80; }
[data-theme="dark"] .chip.red { background: #3D0000; color: #FF6B6B; }
[data-theme="dark"] .st-recue { background: #1E1E2C; color: #a8b3e6; }
[data-theme="dark"] .st-en_preparation { background: #332200; color: #FFB347; }
[data-theme="dark"] .st-prete { background: #003D1A; color: #4ADE80; }
[data-theme="dark"] .st-recuperee { background: #1E1E1E; color: var(--muted); }
[data-theme="dark"] .st-annulee { background: #3D0000; color: #FF6B6B; }
[data-theme="dark"] .bill-item.sel { background: #332200; border-color: #b06a1d; }
[data-theme="dark"] .bill-item.paid { background: #003D1A; }
[data-theme="dark"] .table-btn { background: #003D1A; border-color: #2e7d4f; color: #4ADE80; }
[data-theme="dark"] .table-btn.busy { background: #3D0000; border-color: #7a2a2a; color: #FF6B6B; }
[data-theme="dark"] .table-btn.call { background: #332200; border-color: #b06a1d; color: #FFB347; }
[data-theme="dark"] .topbar { background: linear-gradient(#121212 82%, transparent); }
[data-theme="dark"] .tbl td { border-color: #2C2C2C; }
[data-theme="dark"] .bill-check { background: #1E1E1E; border-color: #2C2C2C; }

/* ══════════ MICRO-INTERACTIONS (transform/opacity uniquement) ══════════ */


/* 2. Boutons — enfoncement 100 ms, survol +10 % de luminosité */
.btn, .cat-pill, .add-fab, .table-btn, .guest-chip, .oc-action,
.kact, .pin-pad button, .tip-row button, .bottom-nav button {
  transition: transform .1s ease, filter .15s ease, background-color .2s ease,
              color .2s ease, opacity .15s ease;
  will-change: transform;
}
@media (hover: hover) {
  .btn:hover:not(:disabled), .add-fab:hover, .oc-action:hover, .kact:hover { filter: brightness(1.1); }
  .cat-pill:hover:not(.active), .guest-chip:hover:not(.active) { filter: brightness(1.05); }
}
.btn:active:not(:disabled), .cat-pill:active, .add-fab:active,
.oc-action:active, .kact:active, .pin-pad button:active,
.guest-chip:active, .table-btn:active { transform: scale(.97); filter: brightness(.9); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* 3. Cartes — survol : élévation + scale(1.02) · appui : scale(.98) */
.card { transition: transform .2s ease, box-shadow .2s ease, background-color .3s ease; }
.card.hover:active { transform: scale(.98); box-shadow: var(--shadow); }
/* apparition en fondu simple (sobre, sans mouvement) */

/* 4. Listes défilantes */
html { scroll-behavior: smooth; }
body { overscroll-behavior-y: contain; }
.cat-row, .sheet, .grid { -webkit-overflow-scrolling: touch; }
.cat-row::-webkit-scrollbar { display: none; }
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-thumb { background: rgba(0,0,0,.2); border-radius: 999px; }
[data-theme="dark"] *::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); }

/* 6. Badge panier — rebond à l'ajout (rejoué à chaque rendu du badge) */
.badge { animation: badgePop .2s ease-out; }
@keyframes badgePop {
  0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); }
}
/* pastilles de statut : transition de couleur douce */
.status-pill, .chip { transition: background-color .3s ease, color .3s ease; }

/* onglet actif : barre qui s'étire */
.cat-pill.active, .tabs button.active { position: relative; }
.bottom-nav button.active .ico { animation: badgePop .2s ease-out; }

/* 7. Champs de saisie — focus animé + erreur secouée */
.field input, .field textarea, .field select {
  transition: border-color .2s ease, box-shadow .2s ease, background-color .3s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  box-shadow: 0 0 0 3px rgba(217, 131, 36, .2);
}
.shake { animation: shakeX .3s ease-in-out; }
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  17% { transform: translateX(-4px); } 34% { transform: translateX(4px); }
  51% { transform: translateX(-4px); } 68% { transform: translateX(4px); }
  85% { transform: translateX(-2px); }
}

/* 8. Modales / bottom sheets — fond fondu 200 ms, glissement 300 ms ease-out */
.sheet-backdrop { animation: backdropIn .2s ease-out; }
@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }
.sheet { animation: sheetUp .3s ease-out; }
@keyframes sheetUp {
  from { transform: translateY(60px); opacity: .5; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* 10. Toasts — glissement + fondu (déjà en place), on précise les courbes */
#toast { transition: opacity .25s ease-out, transform .25s ease-out; }

/* 11. KDS — SEULES les nouvelles commandes glissent + flash d'attention 2 s */
.kds-card { transition: border-color .3s ease, background-color .3s ease; }
.kds-card.fresh { animation: kdsIn .3s ease-out, kdsFlash 2s ease-out; }
@keyframes kdsIn {
  from { transform: translateX(-24px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
@keyframes kdsFlash {
  0% { background-color: #4a3d12; } 100% { background-color: #241a12; }
}

/* 12. Cartes statistiques — fondu discret à l'arrivée */
#app.view-anim .stat .v { animation: fadeUp .2s ease-out; }

/* ══════════ PHASE 4 — Identité, images, aide ══════════ */

/* Fond à motif food — pro et épuré. Ton image exacte (img/pattern.png)
   est utilisée si présente, sinon le motif SVG de secours. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background-image: url("img/pattern.png"), url("img/pattern.svg");
  background-repeat: repeat; background-size: 340px, 260px;
  opacity: .05; pointer-events: none;
}
[data-theme="dark"] body::before { opacity: .04; filter: invert(1); }

/* Logo dans la barre du haut */
.logo-badge img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.logo-badge.brand { background: transparent; box-shadow: none; }
[data-theme="dark"] .logo-badge.brand { background: #2C2C2E; }

/* Signature discrète en pied de page */
.brand-sign {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 20px 0 6px; opacity: .55; font-size: .72rem; color: var(--muted);
}
.brand-sign img { height: 22px; }

/* Barre d'onglets admin : défile à la molette, et passe à la ligne sur grand écran */
@media (min-width: 900px) {
  .cat-row.wrap-lg { flex-wrap: wrap; overflow-x: visible; }
}
.cat-row { scrollbar-width: thin; }
.cat-row::-webkit-scrollbar { display: block; height: 3px; }
.cat-row::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 999px; }

/* Photos produits — standard 1:1, cover, comme les grandes apps food */
.product-visual.has-img { padding: 0; overflow: hidden; }
.product-visual img, .sheet-visual img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  animation: imgIn .3s ease-out;
}
.sheet-visual.has-img { padding: 0; overflow: hidden; }
@keyframes imgIn { from { opacity: 0; } to { opacity: 1; } }
.img-loading { background: #F3F4F6; animation: pulseImg 1.5s ease-in-out infinite; }
@keyframes pulseImg { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

/* Bouton d'aide flottant (mode d'emploi) */
.help-fab {
  position: fixed; right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 45;
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 1.15rem; font-weight: 800;
  display: grid; place-items: center; box-shadow: var(--shadow-lift);
}
@media (min-width: 768px) { .help-fab { bottom: 20px; } }
.help-tip {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.help-tip .hi { font-size: 1.3rem; flex: none; }
.help-tip b { display: block; margin-bottom: 2px; }
.help-tip p { font-size: .84rem; color: var(--muted); }
kbd {
  background: var(--sand-deep); border-radius: 6px; padding: 2px 8px;
  font-family: ui-monospace, monospace; font-size: .78rem; font-weight: 700; color: var(--brand);
}

/* Docteur Business */
.doc-biz {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(135deg, #fdf0dd, #fbe6c4);
  border-radius: var(--radius); padding: 16px 18px; margin: 12px 0;
}
[data-theme="dark"] .doc-biz { background: linear-gradient(135deg, #332200, #3a2a08); }
.doc-biz .avatar {
  width: 46px; height: 46px; border-radius: 999px; flex: none;
  background: #fff; display: grid; place-items: center; font-size: 24px; box-shadow: var(--shadow);
}
[data-theme="dark"] .doc-biz .avatar { background: #2C2C2E; }
.doc-biz .k { font-size: .7rem; font-weight: 800; letter-spacing: .1em; color: var(--ocre); text-transform: uppercase; }
.doc-biz .t { font-weight: 800; margin: 2px 0; }
.doc-biz p { font-size: .88rem; }

/* ── Guide de première utilisation (visite en bulles) ── */
.tour-ring {
  position: fixed; z-index: 90; pointer-events: none;
  border-radius: 18px; box-shadow: 0 0 0 9999px rgba(30, 20, 12, .6);
  transition: top .3s ease, left .3s ease, width .3s ease, height .3s ease;
}
.tour-bubble {
  position: fixed; z-index: 95; background: var(--card);
  border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-lift);
  animation: fadeUp .2s ease-out;
}
.tour-bubble b { display: block; margin-bottom: 4px; font-size: 1rem; }
.tour-bubble p { font-size: .88rem; color: var(--muted); }
.tour-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px;
}
.tour-actions span { font-size: .72rem; font-weight: 800; color: var(--muted); }
.tour-actions .tour-next {
  background: var(--brand); color: #fff; font-weight: 800;
  padding: 9px 16px; border-radius: 12px;
}
.tour-actions .tour-skip { color: var(--muted); font-weight: 700; font-size: .82rem; }

/* ── File de service en grille (façon SamaBiz : 3 cartes par rangée) ── */
.queue-grid {
  display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start;
}
@media (min-width: 700px) { .queue-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1050px) { .queue-grid { grid-template-columns: repeat(3, 1fr); } }

/* 13. Accessibilité — tout est instantané si l'utilisateur le demande */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Plan de salle ── */
.tables-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (min-width: 640px) { .tables-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 960px) { .tables-grid { grid-template-columns: repeat(6, 1fr); } }
.table-btn {
  border: 2.5px solid var(--green); background: var(--green-soft); color: var(--green);
  border-radius: 16px; padding: 22px 8px; font-weight: 800; font-size: 1.05rem;
  transition: transform .1s;
}
.table-btn:active { transform: scale(.96); }
.table-btn.busy { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.table-btn.call { border-color: var(--ocre); background: #fdf0dd; color: var(--ocre); animation: pulse 1.6s infinite; }
.legend { display: flex; gap: 14px; font-size: .78rem; font-weight: 700; color: var(--muted); flex-wrap: wrap; }
.legend .dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; margin-right: 4px; }

/* ── Invités (mode serveur) ── */
.guest-chip {
  padding: 8px 16px; border-radius: 999px; font-weight: 800; font-size: .85rem;
  background: #fff; color: var(--ink); box-shadow: var(--shadow);
}
.guest-chip.active { background: var(--brand); color: #fff; }
.guest-tag {
  font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  background: var(--sand-deep); color: var(--brand);
}

/* ── Partage d'addition ── */
.bill-item {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--sand-deep); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px; background: var(--card);
}
.bill-item.sel { border-color: var(--ocre); background: #fdf0dd; }
[data-theme="dark"] .bill-item.sel { background: #3a2c16; }
.bill-item.paid { opacity: .55; background: var(--green-soft); border-color: transparent; }
.bill-item.paid .nm { text-decoration: line-through; }
.bill-item.locked { opacity: .55; }
.bill-check {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  border: 2px solid var(--sand-deep); background: #fff;
  display: grid; place-items: center; font-size: 15px; color: #fff;
}
.bill-item.sel .bill-check { background: var(--ocre); border-color: var(--ocre); }
.bill-item.paid .bill-check { background: var(--green); border-color: var(--green); }
.tip-row { display: flex; gap: 8px; }
.tip-row button {
  flex: 1; padding: 11px 6px; border-radius: 12px; font-weight: 800;
  background: #fff; color: var(--ink); box-shadow: var(--shadow); font-size: .9rem;
}
.tip-row button.active { background: var(--ocre); color: #fff; }
[data-theme="dark"] .tip-row button { background: var(--card); }

/* ── KDS (écran cuisine) ── */
.kds { background: #16100b; min-height: 100vh; min-height: 100dvh; margin: 0 -16px; padding: 16px; color: #f0e5d8; }
.kds-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 700px) { .kds-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .kds-grid { grid-template-columns: repeat(3, 1fr); } }
.kds-card { background: #241a12; border-radius: 18px; overflow: hidden; border-left: 6px solid var(--indigo); }
.kds-card.prep { border-left-color: var(--ocre); }
.kds-card .kh { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 6px; }
.kds-card .kno { font-weight: 800; font-size: 1.2rem; }
.kds-card .ktime { font-weight: 800; font-size: .95rem; color: #e8c886; }
.kds-card .ktime.late { color: #ff8a75; }
.kds-card ul { list-style: none; padding: 4px 16px 12px; }
.kds-card li { padding: 4px 0; font-size: 1.02rem; }
.kds-card li .opt { color: #b39b85; font-size: .82rem; }
.kds-card .kact { width: 100%; padding: 15px; font-weight: 800; font-size: 1rem; color: #fff; }

/* ── Poste service (PIN) ── */
.staff-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .staff-grid { grid-template-columns: repeat(3, 1fr); } }
.staff-card { text-align: center; padding: 20px 10px; cursor: pointer; }
.staff-card .av {
  width: 56px; height: 56px; border-radius: 999px; margin: 0 auto 8px;
  background: var(--sand-deep); display: grid; place-items: center; font-size: 26px;
}
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 18px 0; }
.pin-dots span { width: 16px; height: 16px; border-radius: 999px; background: var(--sand-deep); }
.pin-dots span.on { background: var(--brand); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 280px; margin: 0 auto; }
.pin-pad button {
  padding: 18px; border-radius: 16px; font-size: 1.3rem; font-weight: 800;
  background: #fff; box-shadow: var(--shadow); color: var(--ink);
}
[data-theme="dark"] .pin-pad button { background: var(--card); }

/* ── Impression QR codes ── */
.qr-sheet { display: none; }
@media print {
  body * { visibility: hidden; }
  .qr-sheet, .qr-sheet * { visibility: visible; }
  .qr-sheet {
    display: grid !important; position: absolute; inset: 0;
    grid-template-columns: repeat(2, 1fr); gap: 20px; padding: 20px; background: #fff;
  }
  .qr-cell { text-align: center; border: 2px dashed #8a4b24; border-radius: 16px; padding: 18px; page-break-inside: avoid; }
  .qr-cell h3 { font-size: 22px; color: #8a4b24; margin-bottom: 4px; }
  .qr-cell .rn { font-size: 14px; color: #6b3a1c; margin-bottom: 10px; }
  .qr-cell img, .qr-cell canvas { margin: 0 auto; }
  .qr-cell .hint { font-size: 11px; color: #9a7f66; margin-top: 10px; }
}

/* Boutons staff (cuisine/caisse) — présents mais proportionnés */
.oc-action, .kact {
  min-height: 54px; font-weight: 800; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}
/* ══════════════════════════════════════════════════════════════
   SKIN « SamaBiz » — cartes blanches bordées, ombres profondes,
   pills colorées, KPI à pastilles, bordures statut épaisses.
   Surcharge propre : ne casse ni le dark mode ni les écrans.
   ══════════════════════════════════════════════════════════════ */
:root {
  --indigo: #1f3a5f;                                   /* indigo profond de la maquette */
  --line: rgba(138, 75, 36, .10);                      /* bordure brand/10 */
  --shadow: 0 4px 20px -6px rgba(138, 75, 36, .18);    /* shadow-soft */
  --shadow-lift: 0 6px 24px -10px rgba(31, 58, 95, .25);/* shadow-card */
  --radius: 16px;                                      /* rounded-2xl */
}
[data-theme="dark"] {
  --line: rgba(255, 255, 255, .08);
  --shadow: 0 2px 8px rgba(0, 0, 0, .10);
  --shadow-lift: 0 4px 14px rgba(0, 0, 0, .10);
}

/* Cartes : blanc + bordure fine + ombre carte + survol lift */
.card, .opt-row, .bill-item, .help-tip, .tabs {
  border: 1px solid var(--line);
}
.card { box-shadow: var(--shadow-lift); }
.card.hover:hover { transform: scale(1.02); box-shadow: 0 10px 30px -12px rgba(138, 75, 36, .35); }

/* Titres : brun de marque, sous-titres brun estompé */
.page-title, .topbar h1, .oc-no, .line .t, .product-name { color: var(--brand); }
[data-theme="dark"] .page-title, [data-theme="dark"] .topbar h1,
[data-theme="dark"] .oc-no, [data-theme="dark"] .line .t,
[data-theme="dark"] .product-name { color: var(--ink); }

/* Topbar : sticky + flou + bordure basse (comme le header maquette) */
.topbar {
  background: rgba(247, 241, 229, .85);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  margin: 0 -16px 6px; padding: 12px 16px 10px;
}
[data-theme="dark"] .topbar { background: rgba(28, 28, 30, .88); }

/* Pills catégories : palette multicolore de la maquette */
.cat-pill { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .06); border: 1px solid var(--line); }
.cat-pill.cat-crepes    { background: rgba(217, 131, 36, .16); color: var(--brand); }
.cat-pill.cat-jus       { background: rgba(31, 58, 95, .12);  color: var(--indigo); }
.cat-pill.cat-smoothies { background: rgba(47, 125, 79, .14); color: var(--green); }
.cat-pill.cat-autres    { background: rgba(138, 75, 36, .10); color: var(--brand); }
.cat-pill.active, .cat-pill.cat-crepes.active, .cat-pill.cat-jus.active,
.cat-pill.cat-smoothies.active, .cat-pill.cat-autres.active {
  background: var(--brand); color: #fff; box-shadow: var(--shadow);
}
[data-theme="dark"] .cat-pill.cat-crepes, [data-theme="dark"] .cat-pill.cat-jus,
[data-theme="dark"] .cat-pill.cat-smoothies, [data-theme="dark"] .cat-pill.cat-autres {
  background: var(--card); color: var(--ink);
}

/* Produits : prix en ocre, bouton + flottant façon maquette */
.product-price { color: var(--ocre); }
.product-card { border: 1px solid var(--line); }
.add-fab {
  width: 40px; height: 40px; right: 12px;
  background: var(--brand);
  box-shadow: 0 6px 24px -10px rgba(31, 58, 95, .45);
}
.add-fab:hover { background: var(--ocre); }

/* KPI dashboard : pastille d'icône colorée par carte */
.stat .ico { border-radius: 12px; }
.stats .stat:nth-child(1) .ico { background: rgba(47, 125, 79, .15); }
.stats .stat:nth-child(2) .ico { background: rgba(217, 131, 36, .15); }
.stats .stat:nth-child(3) .ico { background: rgba(31, 58, 95, .12); }
.stats .stat:nth-child(4) .ico { background: rgba(192, 57, 43, .10); }
.stats .stat:nth-child(5) .ico { background: rgba(217, 131, 36, .15); }
.stats .stat:nth-child(6) .ico { background: rgba(31, 58, 95, .12); }
.stat .v { color: var(--brand); }
[data-theme="dark"] .stat .v { color: var(--ink); }

/* Badge de tendance (graphique 7 jours) */
.trend-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .74rem; font-weight: 800; padding: 4px 11px; border-radius: 999px;
  background: rgba(138, 75, 36, .10); color: var(--brand); margin-left: 8px;
  vertical-align: middle; letter-spacing: 0;
}
.trend-chip.up { background: rgba(47, 125, 79, .14); color: var(--green); }
.trend-chip.down { background: var(--red-soft); color: var(--red); }

/* Graphique : barres arrondies dégradé ocre→brun, jour actuel vert */
.bars .bar { border-radius: 8px; }

/* Onglets file : barre segmentée blanche, actif indigo */
.tabs { border-radius: 18px; padding: 5px; }
.tabs button { border-radius: 13px; }
.tabs button.active { background: var(--indigo); }
.tabs button:nth-child(2).active { background: var(--ocre); }
.tabs button:nth-child(3).active { background: var(--green); }

/* Cartes commandes : bordure statut épaisse + libellé statut */
.order-card { border-left-width: 8px; }
.oc-action { padding: 15px; letter-spacing: .01em; }
.oc-action.to-prep { background: var(--indigo); }

/* Chips temps (⏱) : teintées selon le statut de la carte */
.order-card .chip { background: rgba(31, 58, 95, .10); color: var(--indigo); }
.order-card.b-prep .chip { background: rgba(217, 131, 36, .14); color: var(--ocre); }
.order-card.b-prete .chip { background: rgba(47, 125, 79, .14); color: var(--green); }
.order-card .chip.green { background: var(--green-soft); color: var(--green); }
.order-card .chip.red { background: var(--red-soft); color: var(--red); }

/* Docteur Business : carte blanche, avatar carré sable (Conseil du jour) */
.doc-biz {
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lift);
}
.doc-biz .avatar { border-radius: 16px; background: var(--sand-deep); width: 56px; height: 56px; font-size: 28px; box-shadow: none; }
[data-theme="dark"] .doc-biz { background: var(--card); }

/* Partage d'addition : sélection ocre, réservé indigo, payé vert */
.bill-item { border-radius: 16px; }
.bill-item.sel { border: 2px solid var(--ocre); background: rgba(217, 131, 36, .10); }
.bill-item.locked { border-color: rgba(31, 58, 95, .30); background: rgba(31, 58, 95, .08); opacity: .85; }
.bill-item.paid { background: rgba(47, 125, 79, .10); border-color: rgba(47, 125, 79, .20); }

/* Sheets : fond blanc, coins 28px (bottom sheet maquette) */
.sheet { background: var(--card); border-radius: 28px 28px 0 0; }
@media (min-width: 768px) { .sheet { border-radius: 28px; } }
[data-theme="dark"] .sheet { background: var(--card); }
.sheet .drag { background: rgba(138, 75, 36, .25); }
[data-theme="dark"] .sheet .drag { background: rgba(255, 255, 255, .25); }

/* Boutons : gros CTA arrondis, lift au survol */
.btn { border-radius: 14px; }
.btn.primary, .btn.green, .btn.ocre { box-shadow: var(--shadow-lift); }
@media (hover: hover) {
  .btn:hover:not(:disabled), .card.hover:hover, .cat-pill:hover,
  .add-fab:hover, .tip-row button:hover { transform: translateY(-1px) scale(1.02); }
}

/* Champs : focus ocre net (ring), placeholders estompés */
.field input, .field textarea, .field select { border-color: var(--line); }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--ocre); box-shadow: 0 0 0 3px rgba(217, 131, 36, .25);
}

/* Statut « reçue » : indigo profond */
.st-recue { background: rgba(31, 58, 95, .12); color: var(--indigo); }

/* Notices : ambre doux arrondi */
.notice { border-radius: 16px; }

/* Nav basse : actif = fond sable + brun */
.bottom-nav { border-top: 1px solid var(--line); }
.bottom-nav button.active { color: var(--brand); background: var(--sand); }
[data-theme="dark"] .bottom-nav button.active { color: var(--ink); background: var(--card); }

/* Plan de salle : gros boutons arrondis 16px, ombre douce */
.table-btn { border-radius: 16px; box-shadow: var(--shadow); }

/* Tip row : boutons xl comme la maquette */
.tip-row button { border-radius: 13px; border: 1px solid var(--line); }
.tip-row button.active { border-color: var(--ocre); box-shadow: var(--shadow); }

/* Libellé statut en capitales colorées (cartes file de service) */
.oc-status {
  font-size: .66rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--indigo); margin-bottom: 2px;
}
.order-card.b-prep .oc-status { color: var(--ocre); }
.order-card.b-prete .oc-status { color: var(--green); }

/* 📷 Images produits PLUS VISIBLES (disposition maquette) */
.product-visual { height: 150px; font-size: 60px; }
@media (min-width: 640px) { .product-visual { height: 170px; } }
.sheet-visual { height: 200px; font-size: 72px; }

/* ══════════ ÉCRANS CLIENT FIDÈLES À LA MAQUETTE ══════════ */

/* Accueil après scan QR (écran 7) */
.welcome-wrap { max-width: 420px; margin: 7vh auto 0; text-align: center; padding: 0 10px; }
.welcome-logo {
  width: 78px; height: 78px; border-radius: 22px; margin: 0 auto 20px;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-size: 38px; box-shadow: var(--shadow-lift); overflow: hidden;
}
.welcome-logo img { width: 100%; height: 100%; object-fit: cover; }
.welcome-title { font-size: 1.75rem; font-weight: 800; color: var(--brand); line-height: 1.15; letter-spacing: -.02em; }
[data-theme="dark"] .welcome-title { color: var(--ink); }
.welcome-sub { color: var(--muted); margin-top: 8px; font-size: .95rem; }
.welcome-cta { margin: 34px auto 0; width: 86%; }
.welcome-cta2 {
  margin: 12px auto 0; width: 86%;
  border-color: rgba(217, 131, 36, .5); color: var(--ocre); background: var(--card);
}
.welcome-link {
  display: inline-block; margin-top: 24px; font-weight: 600;
  color: var(--brand); text-decoration: underline; text-underline-offset: 4px;
}
.welcome-link:hover { color: var(--ocre); }
.welcome-foot { margin-top: 36px; font-size: .72rem; color: var(--muted); opacity: .8; }

/* Panier façon maquette (écran 10) : + brun · − sable · poubelle rouge */
.qty-ctrl button:last-child { background: var(--brand); color: #fff; }
.line-del {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--red-soft); color: var(--red);
  display: grid; place-items: center; font-size: .9rem;
}
.line-del:hover { filter: brightness(.95); }

/* ═══════════════ Caisse visuelle (posteFlash) ═══════════════ */
.cx-layout { display:flex; gap:18px; align-items:flex-start; margin-top:12px; }
.cx-main { flex:1 1 auto; min-width:0; }
.cx-cart { flex:0 0 340px; width:340px; background:var(--card); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:16px 16px 18px; position:sticky; top:12px;
  display:flex; flex-direction:column; max-height:calc(100vh - 24px); }
.cx-search { width:100%; padding:13px 16px; border-radius:16px; border:1.5px solid var(--sand-deep);
  background:var(--card); color:var(--ink); font-size:1rem; outline:none; }
.cx-search:focus { border-color:var(--ocre); }
.cx-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(148px, 1fr)); gap:12px; }
.cx-prod { position:relative; text-align:left; background:var(--card); border:1.5px solid transparent;
  border-radius:18px; box-shadow:var(--shadow); padding:12px; cursor:pointer;
  transition:transform .07s ease, border-color .15s; }
.cx-prod:hover { border-color:var(--sand-deep); }
.cx-prod:active { transform:scale(.97); }
.cx-emoji { font-size:2rem; height:66px; display:flex; align-items:center; justify-content:center;
  background:var(--sand); border-radius:12px; margin-bottom:8px; overflow:hidden; }
.cx-emoji img { width:100%; height:100%; object-fit:cover; }
.cx-nm { font-weight:800; font-size:.9rem; line-height:1.15; color:var(--ink); padding-right:26px; }
.cx-pr { color:var(--brand); font-weight:800; font-size:.9rem; margin-top:3px; }
.cx-add { position:absolute; right:10px; bottom:10px; width:30px; height:30px; border-radius:50%;
  background:var(--ocre); color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:1.05rem; box-shadow:var(--shadow); }
.cx-cart h3 { margin:0; font-weight:800; font-size:1.1rem; color:var(--ink); }
.cx-sub { color:var(--muted); font-size:.82rem; margin:2px 0 8px; }
.cx-lines { flex:1 1 auto; overflow-y:auto; min-height:60px; }
.cx-line { display:flex; align-items:center; gap:8px; padding:8px 0; border-bottom:1px solid var(--sand); }
.cx-lnm { font-weight:700; font-size:.9rem; color:var(--ink); }
.cx-lpr { font-size:.78rem; color:var(--muted); }
.cx-tot { display:flex; justify-content:space-between; align-items:center; font-weight:800;
  font-size:1.2rem; color:var(--ink); padding:10px 2px; }
.cx-empty { text-align:center; color:var(--muted); padding:22px 0; line-height:1.6; }
.cx-pays { display:grid; grid-template-columns:1fr 1fr 1fr; gap:6px; margin-top:8px; }
.cx-pay { padding:9px 4px; border-radius:12px; border:1.5px solid var(--sand-deep); background:var(--card);
  color:var(--ink); font-weight:700; font-size:.8rem; cursor:pointer; }
.cx-pay.active { border-color:var(--ocre); background:#fff7ec; color:var(--brand); box-shadow:var(--shadow); }
@media (max-width: 820px) {
  .cx-layout { flex-direction:column; }
  .cx-cart { flex:none; width:100%; position:static; max-height:none; }
}

/* ═══════════════ Division manuelle (posteSplit) ═══════════════ */
.split-tabs { display:flex; gap:8px; flex-wrap:wrap; margin:10px 0 4px; }
.split-tab { display:flex; align-items:center; gap:6px; background:var(--card); border:1.5px solid var(--sand-deep);
  border-radius:14px; padding:7px 12px; font-weight:700; color:var(--ink); cursor:pointer; font-size:.9rem; }
.split-tab.active { background:#fff7ec; border-color:var(--ocre); }
.split-tab.add { color:var(--muted); border-style:dashed; }
.split-tab b { color:var(--brand); }
.split-ini { width:26px; height:26px; border-radius:50%; color:#fff; display:inline-flex; align-items:center;
  justify-content:center; font-weight:800; font-size:.82rem; flex:none; }
.split-ini.big { width:40px; height:40px; font-size:1rem; }
.split-item { display:flex; align-items:center; gap:10px; background:var(--card); border:1px solid var(--sand-deep);
  border-radius:14px; padding:10px 12px; margin-bottom:8px; }
.split-pills { display:flex; gap:4px; flex:none; }
.split-pill { width:32px; height:32px; border-radius:9px; border:1.5px solid var(--sand-deep); background:#fff;
  color:var(--ink); font-weight:800; cursor:pointer; font-size:.85rem; }

/* ══════════════════════════════════════════════════════════════
   PLEIN ÉCRAN + RESPONSIVE MULTI-APPAREILS
   Client 📱 smartphone · Serveur 📱/tablette · Patron 💻 ordi
   ══════════════════════════════════════════════════════════════ */
#app { max-width: none; }
@media (min-width: 900px)  { #app { padding-left: 32px; padding-right: 32px; } }
@media (min-width: 1400px) { #app { padding-left: 56px; padding-right: 56px; } }
.topbar { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
@media (min-width: 900px) {
  .topbar { margin-left: -32px; margin-right: -32px; padding-left: 32px; padding-right: 32px; }
}
@media (min-width: 1400px) {
  .topbar { margin-left: -56px; margin-right: -56px; padding-left: 56px; padding-right: 56px; }
}

/* Onglets de l'espace restaurateur : TOUJOURS tous visibles.
   Ils passent à la ligne au lieu de se cacher dans un défilement. */
.cat-row.wrap-lg { flex-wrap: wrap; overflow: visible; row-gap: 8px; }
.cat-row.wrap-lg .cat-pill { font-size: .84rem; padding: 10px 15px; }
@media (max-width: 640px) {
  .cat-row.wrap-lg { gap: 6px; }
  .cat-row.wrap-lg .cat-pill { font-size: .77rem; padding: 8px 12px; }
}

/* Grand écran (patron) : les grilles exploitent toute la largeur */
@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
  .kds-grid { grid-template-columns: repeat(4, 1fr); }
  .tables-grid { grid-template-columns: repeat(8, 1fr); }
  .staff-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 1600px) {
  .grid { grid-template-columns: repeat(6, 1fr); }
}

/* Tablette serveur : cibles tactiles généreuses */
@media (min-width: 641px) and (max-width: 1100px) {
  .table-btn { padding: 26px 8px; font-size: 1.15rem; }
  .cat-pill { padding: 11px 18px; }
  .pin-pad button { padding: 20px; font-size: 1.4rem; }
}

/* ══════════ BOUTONS : tailles pro et cohérentes ══════════ */
.btn { min-height: 52px; }                                     /* action principale */
.btn.small { min-height: 40px; padding: 8px 16px; font-size: .84rem; width: auto; }
.qty-ctrl button { width: 36px; height: 36px; }                /* contrôles compacts */
.line-del { width: 36px; height: 36px; }
.add-fab { width: 42px; height: 42px; }
.oc-action, .kact { min-height: 52px; }
.help-fab { width: 46px; height: 46px; }
.flex .btn.small { flex: none; }

/* ══════════ PLAN DE SALLE (écran 13) — panneau double ══════════ */
.split-2 { display: grid; gap: 14px; }
@media (min-width: 900px) { .split-2 { grid-template-columns: 1fr 1fr; align-items: start; } }
.table-btn.sel {
  outline: 4px solid var(--brand); outline-offset: 2px;
  box-shadow: 0 8px 24px -8px rgba(138, 75, 36, .45);
}
/* pastilles d'attribution (initiales des invités) */
.assign-toggles { display: flex; gap: 4px; flex: none; }
.gchip {
  width: 30px; height: 30px; border-radius: 9px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--muted);
  font-weight: 800; font-size: .74rem; display: grid; place-items: center;
  transition: transform .1s ease, background-color .15s ease;
}
.gchip:active { transform: scale(.92); }
/* sous-additions par invité */
.subbills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .subbills { grid-template-columns: repeat(3, 1fr); } }
.subbill {
  background: var(--sand); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 10px; text-align: center;
}
.subbill .k {
  font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.subbill .v { font-weight: 800; color: var(--brand); font-size: 1.02rem; margin: 3px 0 9px; }
[data-theme="dark"] .subbill { background: var(--card); }
[data-theme="dark"] .subbill .v { color: var(--ink); }

/* ══════════ FEUILLE D'ENCAISSEMENT (multi-modes) ══════════ */
.pay-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.pay-row .lbl { flex: 1; font-weight: 700; font-size: .92rem; }
.pay-row input {
  width: 130px; padding: 11px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--card);
  text-align: right; font-weight: 800; font-size: 1rem; outline: none;
}
.pay-row input:focus { border-color: var(--ocre); box-shadow: 0 0 0 3px rgba(217,131,36,.2); }
.pay-status { text-align: center; margin-top: 6px; min-height: 34px; }

/* ══════════ ADMIN PRODUITS : grille de cartes (photo / initiale) ══════════ */
.padm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px)  { .padm-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .padm-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1400px) { .padm-grid { grid-template-columns: repeat(5, 1fr); } }
.padm { padding: 0; overflow: hidden; }
.padm.off { opacity: .55; }
.padm-visual {
  height: 110px; background: var(--sand-deep);
  display: grid; place-items: center; cursor: pointer; position: relative;
}
.padm-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.padm-ini { font-size: 2.1rem; font-weight: 800; color: var(--brand); opacity: .45; }
.padm-body { padding: 10px 12px 2px; cursor: pointer; }
.padm-name { font-weight: 800; font-size: .92rem; color: var(--brand); line-height: 1.2; }
[data-theme="dark"] .padm-name { color: var(--ink); }
.padm-meta { font-size: .7rem; color: var(--muted); margin-top: 2px; }
.padm-price { font-weight: 800; color: var(--ocre); margin-top: 4px; }
.padm-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 12px 12px;
}

/* ══════════ ADMIN TABLES : grille de tuiles ══════════ */
.tadm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px)  { .tadm-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .tadm-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1400px) { .tadm-grid { grid-template-columns: repeat(6, 1fr); } }
.tadm { text-align: center; padding: 16px 12px 14px; }
.tadm-label { font-weight: 800; font-size: 1.3rem; color: var(--brand); }
[data-theme="dark"] .tadm-label { color: var(--ink); }
.tadm-link { font-size: .6rem; color: var(--muted); margin: 6px 0 10px; word-break: break-all; }

/* Images produit : chargement flou→net (blur-up) */
.pv-img { filter: blur(12px); opacity: .55; transition: filter .45s ease, opacity .45s ease; }
.pv-img.ld { filter: none; opacity: 1; }

/* Barre d'onglets admin : bouton plier/déplier bien visible */
.cat-pill.nav-toggle { background: var(--brand); color: #fff; font-weight: 800; }
/* Panier sur petit écran : le nom + les choix passent sur leur propre ligne (plus jamais cachés par les −/+) */
@media (max-width: 460px) {
  .line { flex-wrap: wrap; row-gap: 4px; }
  .line .grow { flex-basis: calc(100% - 56px); }
  .line .qty-ctrl { margin-left: 56px; }
  .line .price-tag { margin-left: auto; }
}

/* Reçu / ticket : mise en page + impression isolée */
.rc-line { display: flex; justify-content: space-between; font-size: .85rem; padding: 2px 0; gap: 10px; }
@media print {
  body * { visibility: hidden !important; }
  .receipt-print, .receipt-print * { visibility: visible !important; }
  .receipt-print { position: absolute !important; left: 0; top: 0; width: 100%; padding: 6px 10px; }
  .no-print { display: none !important; }
}
