/* Chez Smash — interface privée de gestion (mobile d'abord). Direction artistique : maquette « Livraison en cours ». */
:root {
  --bg: #07090d; --panel: #141a22; --card: #1e2530; --card2: #252d39; --line: #343d4a; --line2: #4a5361;
  --text: #fff; --muted: #a9b2bf; --yellow: #f6c62f; --yellow2: #e0ad12; --orange: #ff8a4c; --orange-bg: #3b1d14;
  --green: #22c55e; --green-bg: #0f2a1a; --red: #ff6b6b; --red-bg: #33141a; --blue: #7aa7ff; --blue-bg: #13213d;
  --r: 22px; --r-sm: 14px; --safe-b: env(safe-area-inset-bottom, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--yellow); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

.g-offline { position: sticky; top: 0; z-index: 50; padding: 10px 16px; background: var(--red-bg); color: #ffd0d0; font-weight: 700; font-size: 14px; text-align: center; }
.g-top { max-width: 640px; margin: 0 auto; padding: 20px 20px 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.g-kicker { margin: 0 0 4px; color: var(--yellow); font-weight: 800; font-size: 14px; letter-spacing: .02em; text-transform: uppercase; }
.g-title { margin: 0; font-size: clamp(26px, 8vw, 34px); line-height: 1.1; font-weight: 800; letter-spacing: -.01em; }
.g-top__ico svg { width: 40px; height: 40px; color: var(--yellow); }

.g-tabs { position: sticky; top: 0; z-index: 20; display: flex; gap: 8px; overflow-x: auto; max-width: 640px; margin: 0 auto; padding: 10px 16px; background: linear-gradient(var(--bg) 80%, transparent); scrollbar-width: none; }
.g-tabs::-webkit-scrollbar { display: none; }
.g-tab { flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line2); background: transparent; font-weight: 700; font-size: 15px; white-space: nowrap; }
.g-tab[aria-selected="true"] { background: var(--yellow); border-color: var(--yellow); color: #111; }
.g-tab .g-count { display: inline-block; min-width: 22px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.g-tab[aria-selected="true"] .g-count { background: #111; color: var(--yellow); }

.g-main { max-width: 640px; margin: 0 auto; padding: 6px 16px calc(40px + var(--safe-b)); outline: none; }
.g-panel { background: var(--panel); border-radius: 28px; padding: 18px; margin: 0 0 16px; }
.g-h2 { margin: 18px 4px 10px; font-size: 19px; font-weight: 800; }
.g-sub { color: var(--muted); font-size: 14px; margin: 0; }
.g-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.g-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.g-chips::-webkit-scrollbar { display: none; }
.g-chip { flex: none; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-weight: 700; font-size: 14px; }
.g-chip[aria-pressed="true"] { border-color: var(--yellow); color: var(--yellow); }
.g-empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.g-sync { color: var(--muted); font-size: 13px; text-align: center; margin: 10px 0 0; }
.g-sync b { color: var(--red); }

/* Carte commande (maquette « Livraison en cours ») */
.g-order { background: var(--card); border-radius: var(--r); padding: 20px 20px 18px; margin: 0 0 14px; }
.g-order.is-new { box-shadow: 0 0 0 2px var(--yellow); animation: g-pulse 1.6s ease 2; }
@keyframes g-pulse { 50% { box-shadow: 0 0 0 6px rgba(246, 198, 47, .25); } }
.g-order__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.g-order__num { margin: 0; font-size: 22px; font-weight: 800; }
.g-order__client { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.g-badge { flex: none; display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.g-badge--encaisser { background: var(--orange-bg); color: var(--orange); }
.g-badge--nouvelle { background: var(--blue-bg); color: var(--blue); }
.g-badge--preparation { background: #2b2410; color: var(--yellow); }
.g-badge--prete { background: #1d2b12; color: #b5e36b; }
.g-badge--en_livraison { background: var(--orange-bg); color: var(--orange); }
.g-badge--probleme { background: var(--red-bg); color: var(--red); }
.g-badge--encaissee { background: var(--green-bg); color: var(--green); }
.g-badge--annulee { background: #23262c; color: var(--muted); }
.g-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.g-meta a { color: var(--text); text-decoration: none; font-weight: 700; }
.g-amount { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 0; }
.g-amount span { font-size: 19px; }
.g-amount strong { font-size: clamp(30px, 10vw, 40px); font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.g-pay { color: var(--muted); font-size: 14px; margin: 2px 0 0; text-align: right; }
.g-divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }
.g-member { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 18px; }
.g-member svg { flex: none; width: 34px; height: 34px; color: var(--yellow); margin-top: 2px; }
.g-member strong { display: block; font-size: 19px; }
.g-member span { color: #d3d9e1; font-size: 15px; }
.g-reward { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 8px; background: #2b2410; color: var(--yellow); font-weight: 700; font-size: 13px; }
.g-problem { margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--red-bg); color: #ffd0d0; font-size: 14px; }
.g-lines { list-style: none; margin: 14px 0 0; padding: 0; font-size: 15px; }
.g-lines li { padding: 6px 0; border-top: 1px solid var(--line); }
.g-lines li:first-child { border-top: 0; }
.g-lines small { display: block; color: var(--muted); }
.g-lines .is-free { color: var(--yellow); font-weight: 800; }
details.g-details summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: 14px; margin-top: 12px; list-style: none; }
details.g-details summary::before { content: "▸ "; }
details.g-details[open] summary::before { content: "▾ "; }

.g-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; padding: 0 18px; border-radius: var(--r-sm); border: 0; background: var(--yellow); color: #111; font-weight: 800; font-size: 19px; transition: transform .1s; text-decoration: none; }
.g-btn:active { transform: scale(.98); }
.g-btn svg { width: 24px; height: 24px; }
.g-btn--ghost { background: transparent; border: 1.5px solid var(--line2); color: var(--text); font-weight: 600; }
.g-btn--quiet { background: var(--card2); color: var(--text); font-weight: 700; min-height: 50px; font-size: 16px; }
.g-btn--danger { background: var(--red-bg); color: var(--red); }
.g-btn[disabled] { opacity: .5; pointer-events: none; }
.g-btn.is-busy { opacity: .7; pointer-events: none; }
.g-stack { display: grid; gap: 12px; }
.g-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
.g-steps button { min-height: 46px; border-radius: 12px; border: 1px solid var(--line2); background: transparent; font-weight: 700; font-size: 14px; color: var(--muted); }
.g-steps button[aria-pressed="true"] { background: var(--card2); border-color: var(--yellow); color: var(--yellow); }

/* Feuille (confirmations) */
.g-sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.g-sheet__scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .65); }
.g-sheet__panel { position: relative; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: var(--panel); border-radius: 26px 26px 0 0; padding: 22px 20px calc(22px + var(--safe-b)); animation: g-up .2s ease; }
@keyframes g-up { from { transform: translateY(30px); opacity: .6; } }
.g-sheet h2 { margin: 0 0 6px; font-size: 22px; }
.g-field { display: block; margin: 14px 0 0; }
.g-field > span { display: block; margin: 0 0 6px; color: var(--muted); font-size: 14px; font-weight: 700; }
.g-input, .g-select, .g-textarea { width: 100%; min-height: 52px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line2); background: #0e1319; font-size: 17px; }
.g-input--big { font-size: 28px; font-weight: 800; text-align: right; }
.g-textarea { min-height: 80px; resize: vertical; }
.g-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 0; }
.g-choice--list { grid-template-columns: 1fr; }
.g-choice label { position: relative; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line2); background: #0e1319; font-weight: 700; }
.g-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.g-choice label:has(input:checked) { border-color: var(--yellow); color: var(--yellow); background: #1b1709; }
.g-choice label:has(input:focus-visible) { outline: 3px solid var(--yellow); outline-offset: 2px; }
.g-note { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: #1b1709; color: #ffe9a8; font-size: 14px; }
.g-err { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--red-bg); color: #ffd0d0; font-weight: 700; font-size: 14px; }
.g-sheet .g-stack { margin-top: 18px; }

.g-toast { position: fixed; left: 50%; bottom: calc(20px + var(--safe-b)); z-index: 70; transform: translateX(-50%); width: calc(100% - 32px); max-width: 560px; padding: 14px 16px; border-radius: 14px; background: #fff; color: #111; font-weight: 700; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.g-toast.is-ok { background: var(--green); color: #04130a; }
.g-toast.is-err { background: #ffe1e1; color: #5a0d0d; }

/* Tableaux simples (caisse, membres, journal) */
.g-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.g-kpi { background: var(--card); border-radius: 16px; padding: 14px; }
.g-kpi b { display: block; font-size: 24px; font-weight: 800; }
.g-kpi span { color: var(--muted); font-size: 13px; }
.g-list { list-style: none; margin: 0; padding: 0; }
.g-list li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 4px; border-top: 1px solid var(--line); font-size: 15px; }
.g-list li:first-child { border-top: 0; }
.g-list small { display: block; color: var(--muted); font-size: 13px; }
.g-list .g-right { text-align: right; white-space: nowrap; font-weight: 700; }
.g-pos { color: var(--green); } .g-neg { color: var(--red); }
.g-search { display: flex; gap: 8px; margin: 0 0 12px; }
.g-search .g-input { flex: 1; }
.g-search .g-btn { width: auto; min-height: 52px; font-size: 16px; }
.g-reward-row { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.g-reward-row img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: #222; }
.g-switch { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-weight: 700; }
.g-switch input { width: 24px; height: 24px; accent-color: var(--yellow); }
.g-legal { color: var(--muted); font-size: 12.5px; line-height: 1.4; margin: 14px 4px 0; }

@media (min-width: 700px) { .g-kpis { grid-template-columns: repeat(4, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.g-fr { float: right; }
.g-mb { margin: 0 0 12px; }
.g-mt { margin-top: 12px; }
.g-mt8 { margin-top: 8px; }
.g-click { cursor: pointer; }
.g-center { justify-content: center; }
[data-add] { margin-top: 8px; }
@media (max-width: 360px) { .g-amount { flex-wrap: wrap; } .g-amount span { flex: 1 1 100%; } .g-amount strong { margin-left: auto; } .g-steps button { font-size: 13px; } }
