/* Smakelo · système graphique commun au site, à l'application, au comptoir et à l'administration.
   Source : charte Smakelo (or frite, rouge sauce, brun snack, crème mayo, vert pickles), Fredoka + Inter. */
@import url('/shared/fonts/fonts.css');

:root {
  --or: #F6B21A; --or-clair: #FFD76A; --or-pale: #FFF0C2;
  --rouge: #E94B35; --rouge-fonce: #C6381F; --rouge-pale: #FDE5E0;
  --brun: #4A2E1F; --brun-doux: #7A5C4A; --brun-pale: #B9A392;
  --creme: #FFF4E1; --creme-fonce: #F7E6C8; --blanc: #FFFFFF;
  --vert: #4E9B57; --vert-fonce: #357A3E; --vert-pale: #E3F2E4;
  --anthracite: #222222; --gris: #6B6259; --trait: #EADCC6;
  --bleu: #2F6FDB; --bleu-pale: #E4EEFC;

  --fond: var(--creme); --surface: var(--blanc); --texte: var(--brun); --texte-doux: var(--brun-doux);
  --font-display: 'Fredoka', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-card: 20px; --r-field: 12px; --r-pill: 999px; --r-sm: 10px;
  --ombre: 0 8px 28px rgba(74, 46, 31, .10); --ombre-sm: 0 2px 10px rgba(74, 46, 31, .08); --ombre-lg: 0 18px 50px rgba(74, 46, 31, .18);
  --gutter: 16px; --max: 1180px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--font-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .display { font-family: var(--font-display); font-weight: 700; line-height: 1.12; margin: 0 0 .4em; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); } h2 { font-size: clamp(1.5rem, 3.4vw, 2.3rem); } h3 { font-size: 1.25rem; } h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; } a { color: var(--rouge-fonce); text-underline-offset: 3px; }
img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--texte-doux); } .small { font-size: .875rem; } .tiny { font-size: .78rem; } .bold { font-weight: 700; } .center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.hl { background: linear-gradient(transparent 55%, var(--or-clair) 55%); padding-inline: .12em; border-radius: 4px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; border: 0; border-radius: var(--r-pill); padding: 13px 24px; font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none; transition: transform .15s var(--ease), box-shadow .15s, background .15s; white-space: nowrap; min-height: 48px; background: var(--creme-fonce); color: var(--brun); }
.btn:hover { transform: translateY(-1px); } .btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--rouge); color: #fff; box-shadow: 0 6px 18px rgba(233, 75, 53, .35); } .btn-primary:hover { background: var(--rouge-fonce); }
.btn-gold { background: var(--or); color: var(--brun); box-shadow: 0 6px 18px rgba(246, 178, 26, .35); } .btn-gold:hover { background: #FFC233; }
.btn-dark { background: var(--brun); color: #fff; } .btn-dark:hover { background: #3A2217; }
.btn-green { background: var(--vert); color: #fff; } .btn-green:hover { background: var(--vert-fonce); }
.btn-ghost { background: transparent; color: var(--brun); box-shadow: inset 0 0 0 2px var(--trait); } .btn-ghost:hover { background: var(--blanc); }
.btn-danger { background: var(--rouge-pale); color: var(--rouge-fonce); }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: .875rem; } .btn-lg { padding: 17px 32px; font-size: 1.1rem; min-height: 58px; } .btn-block { width: 100%; }
.btn-icon { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ''; position: absolute; width: 18px; height: 18px; border: 3px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: tourne .7s linear infinite; }
.btn-ghost.loading::after, .btn-gold.loading::after, .btn:not([class*="btn-"]).loading::after { border-color: rgba(74, 46, 31, .25); border-top-color: var(--brun); }
@keyframes tourne { to { transform: rotate(360deg); } }

/* Cartes et surfaces */
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--ombre); padding: 20px; }
.card-flat { background: var(--surface); border-radius: var(--r-card); border: 1px solid var(--trait); padding: 20px; }
.card-tight { padding: 14px; } .card-click { cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; } .card-click:hover { transform: translateY(-3px); box-shadow: var(--ombre-lg); }
.panel-title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.ribbon { display: inline-block; background: var(--brun); color: #fff; font-family: var(--font-display); font-weight: 600; padding: 8px 22px; border-radius: var(--r-pill); font-size: 1.15rem; }

/* Formulaires */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-weight: 600; font-size: .9rem; }
.field .hint { font-size: .8rem; color: var(--texte-doux); } .field .error { font-size: .8rem; color: var(--rouge-fonce); font-weight: 600; }
.input, .select, .textarea { width: 100%; background: #fff; border: 2px solid var(--trait); border-radius: var(--r-field); padding: 12px 14px; min-height: 48px; transition: border-color .15s, box-shadow .15s; }
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--or); box-shadow: 0 0 0 4px rgba(246, 178, 26, .25); }
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--rouge); }
.input-group { display: flex; gap: 8px; } .input-group > * { flex: 1; min-width: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; } .check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--rouge); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 46px; height: 28px; background: var(--brun-pale); border-radius: 99px; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: #fff; border-radius: 50%; transition: transform .2s var(--ease); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.switch input:checked + .track { background: var(--vert); } .switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--or); outline-offset: 2px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Pastilles, statuts, onglets */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--r-pill); font-size: .78rem; font-weight: 700; background: var(--creme-fonce); color: var(--brun); white-space: nowrap; }
.badge-green { background: var(--vert-pale); color: var(--vert-fonce); } .badge-red { background: var(--rouge-pale); color: var(--rouge-fonce); }
.badge-gold { background: var(--or-pale); color: #8A5A00; } .badge-blue { background: var(--bleu-pale); color: #1D4FA8; } .badge-dark { background: var(--brun); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.dot-live { animation: pulse 1.6s infinite; } @keyframes pulse { 50% { opacity: .35; } }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; } .tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: var(--surface); color: var(--brun); padding: 10px 18px; border-radius: var(--r-pill); font-weight: 600; cursor: pointer; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--trait); min-height: 42px; }
.tab[aria-selected="true"], .tab.active { background: var(--or); box-shadow: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); background: #fff; box-shadow: inset 0 0 0 1px var(--trait); font-size: .85rem; font-weight: 600; }

/* Tableaux */
.table-wrap { overflow-x: auto; border-radius: var(--r-card); background: var(--surface); box-shadow: var(--ombre-sm); }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); padding: 12px 14px; border-bottom: 2px solid var(--trait); white-space: nowrap; background: #FFFBF3; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--trait); vertical-align: middle; } .table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #FFFBF3; } .table .r { text-align: right; } .table td.actions { text-align: right; white-space: nowrap; }

/* Fenêtres, tiroirs, notifications */
.overlay { position: fixed; inset: 0; background: rgba(34, 22, 14, .55); display: grid; place-items: center; z-index: 1000; padding: 16px; animation: fondu .18s; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: 24px; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; box-shadow: var(--ombre-lg); animation: monte .25s var(--ease); }
.modal-lg { width: min(860px, 100%); } .modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; } .modal-head h3 { margin: 0; }
.modal-body { padding: 16px 20px; } .modal-foot { padding: 14px 20px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; background: linear-gradient(transparent, var(--surface) 30%); }
@media (max-width: 640px) { .overlay { place-items: end center; padding: 0; } .modal { border-radius: 24px 24px 0 0; width: 100%; max-height: 92dvh; } }
@keyframes fondu { from { opacity: 0; } } @keyframes monte { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; z-index: 2000; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { background: var(--brun); color: #fff; padding: 13px 18px; border-radius: 16px; box-shadow: var(--ombre-lg); font-weight: 600; animation: monte .25s var(--ease); display: flex; gap: 10px; align-items: center; pointer-events: auto; }
.toast.ok { background: var(--vert-fonce); } .toast.err { background: var(--rouge-fonce); }

/* États vides, chargement, alertes */
.empty { text-align: center; padding: 40px 20px; color: var(--texte-doux); } .empty img, .empty svg { width: 88px; margin: 0 auto 12px; opacity: .9; } .empty h3 { color: var(--brun); }
.skeleton { background: linear-gradient(90deg, var(--creme-fonce) 25%, #FFF8EA 50%, var(--creme-fonce) 75%); background-size: 200% 100%; animation: brille 1.2s infinite; border-radius: 12px; min-height: 18px; }
@keyframes brille { to { background-position: -200% 0; } }
.alert { border-radius: 16px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; background: var(--or-pale); color: #6B4500; font-weight: 500; }
.alert-red { background: var(--rouge-pale); color: #8E2414; } .alert-green { background: var(--vert-pale); color: #24572B; } .alert-blue { background: var(--bleu-pale); color: #1D4FA8; }
.demo-flag { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 3000; background: var(--brun); color: var(--or-clair); font-size: .72rem; font-weight: 700; padding: 3px 14px; border-radius: 0 0 10px 10px; letter-spacing: .04em; pointer-events: none; }

/* Mise en page utilitaire */
.row { display: flex; gap: 12px; align-items: center; } .row-wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 12px; } .stack-lg { display: grid; gap: 24px; } .mt { margin-top: 16px; } .mt-lg { margin-top: 32px; } .mb { margin-bottom: 16px; } .mb-0 { margin-bottom: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pattern { background-color: var(--creme); background-image: url('/shared/brand/pattern_gourmand.svg'); background-size: 420px; }
.kpi { background: var(--surface); border-radius: var(--r-card); padding: 18px; box-shadow: var(--ombre-sm); } .kpi .v { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; line-height: 1.1; } .kpi .l { font-size: .82rem; color: var(--texte-doux); font-weight: 600; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--creme); border-radius: var(--r-pill); padding: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; font-weight: 800; font-size: 1.1rem; cursor: pointer; box-shadow: var(--ombre-sm); } .stepper span { min-width: 28px; text-align: center; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
@media print { .no-print { display: none !important; } body { background: #fff; } }
.switch input:disabled + .track { opacity: .55; cursor: not-allowed; } .switch:has(input:disabled) { cursor: not-allowed; }

/* Question « caisse enregistreuse » (site, comptoir, administration) */
.sce-radios { display: grid; gap: 10px; margin: 10px 0 12px; }
.sce-radios label { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--trait); border-radius: 16px; padding: 14px 16px; cursor: pointer; background: #fff; }
.sce-radios label:has(input:checked) { border-color: var(--rouge); background: #FFF8F6; }
.sce-radios label:has(input:focus-visible) { outline: 3px solid var(--or); }
.sce-radios input { margin-top: 4px; accent-color: var(--rouge); width: 18px; height: 18px; flex: none; }
.sce-radios strong { display: block; }
.sce-radios .hint { display: block; font-size: .88rem; color: var(--brun-pale, #7a6a5d); margin-top: 2px; font-weight: 400; }
.sce-question .error { font-size: .85rem; color: var(--rouge-fonce); font-weight: 600; margin: -4px 0 10px; }
/* Choix du bipper au comptoir */
.pager-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.pager-btn { min-height: 60px; border-radius: 14px; border: 2px solid var(--trait); background: #fff; font: inherit; cursor: pointer; display: grid; place-items: center; gap: 2px; padding: 6px 2px; }
.pager-btn b { font-size: 1.35rem; line-height: 1; }
.pager-btn small { font-size: .68rem; color: var(--texte-doux, #7a6a5d); }
.pager-btn:hover:not(:disabled) { border-color: var(--rouge); background: #FFF8F6; }
.pager-btn:disabled { opacity: .45; cursor: not-allowed; background: var(--surface, #f6efe6); }
