/* ==========================================================================
   UberShake — style cartoon / flat, contours épais, ombres dures
   ========================================================================== */
:root {
  --cream: #FFF3DC;
  --cream-2: #FFE9C2;
  --paper: #FFFFFF;
  --ink: #24163A;
  --ink-soft: #5B4C70;
  --tomato: #FF5D5D;
  --sun: #FFC93C;
  --mint: #3DD68C;
  --sky: #47C1F5;
  --pink: #FF8FC7;
  --orange: #FF8A3D;
  --lime: #B4E33D;
  --border: 3px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --radius: 20px;
  --radius-sm: 14px;
  --font: 'Fredoka', 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
  --font-display: 'Lilita One', 'Fredoka', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--cream);
  background-image: radial-gradient(rgba(36, 22, 58, .09) 1.6px, transparent 1.7px);
  background-size: 22px 22px;
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 16px;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
img, svg { display: block; }
:focus-visible { outline: 3px dashed var(--ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: calc(14px + var(--safe-top)) 16px calc(32px + var(--safe-bottom));
}

/* ---------- Typo ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: .5px; margin: 0; line-height: 1.05; }
h2 { font-size: 26px; }
h3 { font-size: 21px; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; gap: 10px; }
.logo-text {
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--sun);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
  letter-spacing: 1px;
  line-height: 1;
}
.logo-text b { color: var(--tomato); font-weight: 400; }
.logo-sm .logo-text { font-size: 28px; text-shadow: 2px 2px 0 var(--ink); }

/* ---------- Carte / panneau ---------- */
.card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

/* ---------- Boutons ---------- */
.btn {
  --bg: var(--sun);
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px 22px;
  border: var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .5px;
  box-shadow: var(--shadow);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  text-decoration: none;
}
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { filter: grayscale(.8) opacity(.6); cursor: not-allowed; }
.btn-block { display: flex; width: 100%; }
.btn-red { --bg: var(--tomato); color: #fff; }
.btn-red, .btn-green, .btn-blue { text-shadow: 1.5px 1.5px 0 var(--ink); }
.btn-green { --bg: var(--mint); color: #fff; }
.btn-blue { --bg: var(--sky); color: #fff; }
.btn-pink { --bg: var(--pink); }
.btn-white { --bg: var(--paper); }
.btn-sm { min-height: 40px; padding: 6px 14px; font-size: 16px; box-shadow: 3px 3px 0 var(--ink); }
.btn-xs { min-height: 34px; padding: 4px 12px; font-size: 14px; box-shadow: 2px 2px 0 var(--ink); border-width: 2.5px; }
.btn.loading { pointer-events: none; }
.btn.loading::after {
  content: ''; width: 16px; height: 16px; border: 3px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; border: var(--border); background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink); display: inline-grid; place-items: center; padding: 0;
  transition: transform .08s, box-shadow .08s; touch-action: manipulation;
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- Formulaires ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; }
.input {
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 18px; /* >= 16px : évite le zoom auto d'iOS */
  font-weight: 500;
  box-shadow: inset 0 -4px 0 rgba(36, 22, 58, .08);
  outline: none;
  transition: box-shadow .15s, transform .1s;
}
.input:focus { box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
textarea.input { min-height: 74px; resize: none; }
.pin-input {
  text-align: center;
  font-family: var(--font-display);
  font-size: 40px;
  letter-spacing: 22px;
  padding-left: 38px;
  -webkit-text-security: disc;
}
.form-error {
  background: #FFE1E1; border: 2.5px solid var(--tomato); color: #9B1C1C;
  border-radius: 12px; padding: 10px 12px; font-weight: 600; margin: 0 0 14px;
  animation: shake .35s;
}

/* Interrupteur */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  flex: none; width: 62px; height: 36px; border: var(--border); border-radius: 999px; background: #E6DCCB;
  position: relative; transition: background .2s;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--paper); border: 2.5px solid var(--ink); transition: transform .2s cubic-bezier(.5, 1.8, .5, .8);
}
.switch input:checked + .track { background: var(--mint); }
.switch input:checked + .track::after { transform: translateX(26px); }
.switch input:focus-visible + .track { outline: 3px dashed var(--ink); outline-offset: 3px; }

/* ---------- Pastilles ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border: 2.5px solid var(--ink);
  border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--paper); white-space: nowrap;
}
.badge-virgin { background: var(--lime); }
.badge-out { background: var(--tomato); color: #fff; }

/* ==========================================================================
   Écran d'accueil / inscription
   ========================================================================== */
.join {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  gap: 18px;
}
.join-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.join-hero .logo { justify-content: center; }
.join-hero .logo-text { font-size: 52px; }
.join-hero .tagline { font-weight: 600; font-size: 18px; }
.hero-glasses { display: flex; justify-content: center; align-items: flex-end; gap: 0; margin: 4px 0 2px; height: 104px; }
.hero-glasses .glass { width: 72px; height: auto; margin: 0 -6px; animation: bob 2.6s ease-in-out infinite; }
.hero-glasses .glass:nth-child(2) { width: 88px; animation-delay: -.6s; z-index: 1; }
.hero-glasses .glass:nth-child(3) { animation-delay: -1.2s; }
.join .card { padding: 20px; }
.join-step-title { margin-bottom: 4px; }
.join-step-sub { margin: 0 0 16px; color: var(--ink-soft); font-weight: 500; }
.name-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 360px) { .name-row { grid-template-columns: 1fr; } }
.link-btn { background: none; border: 0; padding: 8px; font-weight: 600; text-decoration: underline; color: var(--ink-soft); }

/* ==========================================================================
   Application invité
   ========================================================================== */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me .avatar { flex: none; }
.me-hello { font-family: var(--font-display); font-size: 22px; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { font-size: 13px; color: var(--ink-soft); font-weight: 600; }

.banner {
  display: flex; align-items: center; gap: 12px; border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 16px; font-weight: 600;
}
.banner-closed { background: var(--tomato); color: #fff; }
.banner-closed strong { font-family: var(--font-display); font-weight: 400; font-size: 20px; display: block; text-shadow: 1.5px 1.5px 0 var(--ink); }
.banner-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; border: 2.5px solid var(--ink); background: var(--paper); display: grid; place-items: center; font-size: 22px; }

/* Suivi de commande */
.tracker { position: relative; overflow: hidden; margin-bottom: 18px; padding: 16px; }
.tracker-head { display: flex; gap: 14px; align-items: center; }
.tracker-head .glass { width: 74px; height: auto; flex: none; }
.tracker-title { font-family: var(--font-display); font-size: 24px; line-height: 1.05; }
.tracker-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tracker-note { font-size: 14px; color: var(--ink-soft); margin-top: 6px; font-style: italic; overflow-wrap: anywhere; }
.queue-pos {
  margin-left: auto; flex: none; text-align: center; background: var(--sun); border: var(--border);
  border-radius: 18px; padding: 6px 10px; box-shadow: 3px 3px 0 var(--ink); min-width: 70px;
}
.queue-pos b { font-family: var(--font-display); font-weight: 400; font-size: 32px; display: block; line-height: 1; }
.queue-pos span { font-size: 12px; font-weight: 700; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 16px; }
.step { text-align: center; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.step i {
  display: block; height: 14px; border: 2.5px solid var(--ink); border-radius: 999px; background: #EFE6D6; margin-bottom: 6px;
}
.step.done i { background: var(--mint); }
.step.now i {
  background: repeating-linear-gradient(-45deg, var(--sun) 0 10px, #FFE08A 10px 20px);
  background-size: 28px 28px; animation: stripes .8s linear infinite;
}
.step.now { color: var(--ink); }
.tracker-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.tracker.is-ready { background: var(--mint); }
.sound-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px;
  border-top: 2.5px dashed rgba(36, 22, 58, .2); font-size: 13px; font-weight: 700; color: var(--ink-soft);
}

/* Grille des cocktails */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 6px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 520px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.cocktail {
  position: relative;
  appearance: none;
  text-align: left;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--paper);
  padding: 0;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .1s ease, box-shadow .1s ease;
  touch-action: manipulation;
  animation: pop-in .35s cubic-bezier(.3, 1.6, .5, 1) both;
}
.cocktail:active:not(:disabled) { transform: translate(3px, 3px) rotate(-1deg); box-shadow: 1px 1px 0 var(--ink); }
.cocktail-art {
  display: grid; place-items: center; padding: 12px 8px 6px; border-bottom: var(--border);
  background: var(--tint, var(--cream-2));
  position: relative;
}
.cocktail-art::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 120%, rgba(255,255,255,.6) 0 40%, transparent 41%);
}
.cocktail-art .glass { width: 84px; height: auto; position: relative; transition: transform .2s; }
.cocktail:hover .cocktail-art .glass { transform: rotate(-4deg) scale(1.04); }
.cocktail-body { padding: 10px 12px 12px; }
.cocktail-name { font-family: var(--font-display); font-size: 19px; line-height: 1.05; display: block; }
.cocktail-desc { font-size: 13px; color: var(--ink-soft); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cocktail .tags { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
.cocktail:disabled { cursor: not-allowed; }
.cocktail.is-out .cocktail-art .glass, .cocktail.is-out .cocktail-body { opacity: .45; filter: grayscale(.9); }
.stamp {
  position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg);
  font-family: var(--font-display); font-size: 22px; color: #fff; background: var(--tomato);
  border: var(--border); padding: 2px 12px; border-radius: 10px; box-shadow: 3px 3px 0 var(--ink);
  white-space: nowrap; z-index: 2;
}

.roulette-btn { margin: 18px 0 6px; }

/* Historique */
.history { margin-top: 26px; }
.history-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.history-item {
  display: flex; align-items: center; gap: 10px; background: var(--paper); border: 2.5px solid var(--ink);
  border-radius: 14px; padding: 8px 12px;
}
.history-item .glass { width: 30px; height: auto; flex: none; }
.history-item .h-name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 2px solid var(--ink); white-space: nowrap; }
.st-pending { background: var(--sun); }
.st-preparing { background: var(--sky); color: #fff; }
.st-ready { background: var(--mint); }
.st-served { background: #E6DCCB; }
.st-cancelled { background: #fff; text-decoration: line-through; }

.footer-note { text-align: center; margin-top: 28px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }

/* ---------- Feuille du bas (commande) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(36, 22, 58, .55); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease both;
}
.sheet {
  width: 100%; max-width: 560px; background: var(--cream); border: var(--border); border-bottom: 0;
  border-radius: 28px 28px 0 0; padding: 12px 18px calc(20px + var(--safe-bottom));
  box-shadow: 0 -4px 0 var(--ink);
  animation: slide-up .32s cubic-bezier(.2, 1.3, .4, 1) both;
  max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
}
.sheet-grip { width: 54px; height: 6px; border-radius: 6px; background: var(--ink); opacity: .25; margin: 0 auto 10px; }
.sheet-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.sheet-hero .art {
  flex: none; width: 116px; height: 124px; border: var(--border); border-radius: 22px; display: grid; place-items: center;
  background: var(--tint, var(--cream-2)); box-shadow: var(--shadow);
}
.sheet-hero .glass { width: 92px; height: auto; animation: wiggle 2.4s ease-in-out infinite; }
.sheet-title { font-family: var(--font-display); font-size: 30px; line-height: 1; }
.sheet-desc { color: var(--ink-soft); margin-top: 6px; font-weight: 500; }
.option-card { background: var(--paper); border: var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 12px; }
.option-card .opt-title { font-weight: 700; }
.option-card .opt-sub { font-size: 13px; color: var(--ink-soft); }
.counter { text-align: right; font-size: 12px; color: var(--ink-soft); margin-top: 4px; font-weight: 600; }
.sheet-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 6px; }

/* ---------- Overlays plein écran ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; animation: fade .2s both;
}
.overlay-ready { background: var(--mint); background-image: repeating-conic-gradient(from 0deg at 50% 45%, rgba(255,255,255,.18) 0 10deg, transparent 10deg 20deg); }
.overlay-ready h2 { font-size: 44px; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink); }
.overlay-ready p { font-size: 20px; font-weight: 700; max-width: 320px; margin: 10px auto 24px; }
.overlay-ready .glass { width: 170px; height: auto; animation: tada 1.2s ease both, bob 2.6s 1.2s ease-in-out infinite; margin-bottom: 10px; }
.overlay-roulette { background: rgba(36, 22, 58, .78); }
.roulette-box {
  background: var(--sun); border: var(--border); border-radius: 30px; box-shadow: var(--shadow-lg);
  padding: 22px 26px 18px; width: min(320px, 100%);
}
.roulette-window {
  height: 190px; border: var(--border); border-radius: 22px; background: var(--paper); display: grid; place-items: center;
  overflow: hidden; margin: 12px 0;
}
.roulette-window .glass { width: 120px; height: auto; }
.roulette-window.tick .glass { animation: roll .1s linear; }
.roulette-name { font-family: var(--font-display); font-size: 26px; min-height: 30px; }

/* ---------- Toasts ---------- */
#toasts {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(12px + var(--safe-top)); z-index: 100;
  display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none;
}
.toast {
  background: var(--paper); border: var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 16px;
  font-weight: 700; animation: drop-in .3s cubic-bezier(.2, 1.4, .4, 1) both; transition: opacity .4s, transform .4s;
}
.toast-error { background: #FFE1E1; }
.toast-success { background: #D7F8E6; }
.toast.out { opacity: 0; transform: translateY(-10px); }

/* ---------- Confettis ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px; width: 12px; height: 16px; border: 2px solid var(--ink); border-radius: 3px;
  animation: fall linear forwards;
}

/* ---------- Connexion live ---------- */
.live-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--mint); flex: none; }
.live-dot.off { background: var(--tomato); animation: blink 1s infinite; }

/* ---------- Chargement ---------- */
.loader { min-height: 70vh; display: grid; place-items: center; }
.loader .shaker { animation: shake-it .5s ease-in-out infinite; }

/* ==========================================================================
   Admin
   ========================================================================== */
.admin .wrap { max-width: 980px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-top .right { display: flex; align-items: center; gap: 8px; }
.tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 10px; margin: 0 -4px 10px; scrollbar-width: none;
  position: sticky; top: 0; z-index: 10; background: linear-gradient(var(--cream) 80%, transparent);
  padding-top: calc(6px + var(--safe-top));
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; border: var(--border); border-radius: 999px; background: var(--paper); padding: 8px 16px; font-weight: 700;
  box-shadow: 3px 3px 0 var(--ink); display: inline-flex; gap: 6px; align-items: center; touch-action: manipulation;
}
.tab[aria-selected="true"] { background: var(--ink); color: var(--sun); }
.tab .count { background: var(--tomato); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 13px; border: 2px solid var(--ink); }
.tab[aria-selected="true"] .count { border-color: var(--sun); }

.bar-strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.bar-strip .card { padding: 10px 14px; display: flex; align-items: center; gap: 12px; flex: 1 1 260px; }
.bar-strip .switch { flex: 1; font-weight: 700; }
.kpis { display: flex; gap: 8px; }
.kpi { background: var(--paper); border: var(--border); border-radius: 16px; padding: 6px 12px; text-align: center; box-shadow: 3px 3px 0 var(--ink); }
.kpi b { font-family: var(--font-display); font-weight: 400; font-size: 26px; display: block; line-height: 1; }
.kpi span { font-size: 12px; font-weight: 700; color: var(--ink-soft); }

.queue { display: grid; gap: 12px; }
.lane-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; }
.lane-title .badge { font-size: 14px; }
.order {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  background: var(--paper); border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px;
  animation: pop-in .3s cubic-bezier(.3, 1.6, .5, 1) both;
}
.order.is-new { animation: pop-in .3s cubic-bezier(.3, 1.6, .5, 1) both, flash 1.2s 3; }
.order.st-preparing-card { background: #E3F6FF; }
.order.st-ready-card { background: #DDF9EA; }
.order-num {
  font-family: var(--font-display); font-size: 22px; width: 46px; height: 46px; border-radius: 14px; border: var(--border);
  display: grid; place-items: center; background: var(--sun);
}
.order-art { position: relative; }
.order-art .glass { width: 46px; height: auto; }
.order-main { min-width: 0; }
.order-cocktail { font-family: var(--font-display); font-size: 22px; line-height: 1.05; }
.order-who { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-top: 3px; min-width: 0; }
.order-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.order-note {
  margin-top: 6px; background: #FFF6B8; border: 2px dashed var(--ink); border-radius: 10px; padding: 4px 8px; font-weight: 600;
  font-size: 14px; overflow-wrap: anywhere;
}
.order-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.order-left { display: flex; flex-direction: column; align-items: center; gap: 6px; }
@media (max-width: 560px) {
  .order { grid-template-columns: auto 1fr; }
  .order-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .order-actions .btn { flex: 1 1 auto; }
}
.empty {
  text-align: center; padding: 26px 16px; border: 3px dashed rgba(36,22,58,.35); border-radius: var(--radius); color: var(--ink-soft); font-weight: 600;
}
.empty .glass { width: 70px; margin: 0 auto 8px; opacity: .7; }
details.done-list summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.done-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 2px dashed rgba(36,22,58,.2); }
.done-row .glass { width: 26px; height: auto; flex: none; }
.done-row .d-main { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 480px) {
  .admin-top { flex-wrap: nowrap; }
  .admin-top .logo-sm .logo-text { font-size: 22px; }
  .admin-top .logo-sm .shaker { width: 22px; height: 32px; }
  .admin-top .logo-sm .badge { display: none; }
  .admin-top .right { gap: 6px; }
  .admin-top .icon-btn { width: 40px; height: 40px; }
  .mi-tools .btn-xs { padding: 4px 10px; }
}

/* Carte (menu) admin */
.menu-list { display: grid; gap: 12px; }
.menu-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px; }
.menu-item .glass { width: 54px; height: auto; }
.menu-item .mi-name { font-family: var(--font-display); font-size: 20px; }
.menu-item .mi-desc { font-size: 13px; color: var(--ink-soft); }
.menu-item .mi-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  .menu-item { grid-template-columns: auto 1fr; }
  .menu-item .mi-tools { grid-column: 1 / -1; justify-content: flex-start; }
}
.glass-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.glass-opt { border: var(--border); border-radius: 14px; background: var(--paper); padding: 6px; display: grid; place-items: center; }
.glass-opt .glass { width: 46px; height: auto; }
.glass-opt[aria-pressed="true"] { background: var(--sun); box-shadow: 3px 3px 0 var(--ink); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: var(--border); padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--ink); }
input[type="color"].swatch { -webkit-appearance: none; appearance: none; background: none; overflow: hidden; }
input[type="color"].swatch::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].swatch::-webkit-color-swatch { border: 0; border-radius: 50%; }

/* Invités admin */
.guest-search { margin-bottom: 12px; }
.guest-list { display: grid; gap: 8px; }
.guest-row { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 16px; padding: 8px 10px; }
.guest-row .g-main { flex: 1; min-width: 0; }
.guest-row .g-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-row .g-sub { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.guest-row .g-tools { display: flex; gap: 6px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { padding: 14px; text-align: center; }
.stat b { font-family: var(--font-display); font-weight: 400; font-size: 38px; display: block; line-height: 1; }
.stat span { font-weight: 700; color: var(--ink-soft); font-size: 14px; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; }
.bar-row .glass { width: 34px; height: auto; }
.bar-label { display: flex; justify-content: space-between; font-weight: 700; font-size: 15px; margin-bottom: 4px; gap: 8px; }
.bar-track { height: 22px; border: 2.5px solid var(--ink); border-radius: 999px; background: #F1E8D8; overflow: hidden; }
.bar-fill { height: 100%; border-right: 2.5px solid var(--ink); border-radius: 999px; min-width: 6px; transition: width .6s cubic-bezier(.2, 1.2, .4, 1); }

/* Réglages */
.settings-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.qr-box { background: #fff; border: var(--border); border-radius: 18px; padding: 10px; width: min(260px, 100%); margin: 10px auto; }
.qr-box svg { width: 100%; height: auto; }
.qr-url { text-align: center; font-weight: 700; word-break: break-all; }
.danger { border-color: var(--tomato); }

/* Modale (admin) */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(36, 22, 58, .55); z-index: 50; display: grid; place-items: center; padding: 16px;
  animation: fade .2s both;
}
.modal { width: min(520px, 100%); max-height: 90vh; max-height: 90dvh; overflow-y: auto; animation: pop-in .3s cubic-bezier(.3, 1.5, .5, 1) both; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.dialog-backdrop { z-index: 90; }
.dialog { width: min(380px, 100%); animation: fade .15s ease both; } /* pas de zoom : les boutons sont tout de suite à leur place */
.dialog h3 { font-size: 24px; }
.dialog-msg { margin: 8px 0 0; font-weight: 500; color: var(--ink-soft); white-space: pre-line; }
.dialog .input { margin-top: 12px; }

.warn-box { background: #FFF0B3; border: var(--border); border-radius: 16px; padding: 10px 14px; font-weight: 600; margin-bottom: 14px; }

/* ---------- Animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes pop-in { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide-up { from { transform: translateY(100%); } }
@keyframes drop-in { from { transform: translateY(-30px); opacity: 0; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes shake-it { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
@keyframes stripes { to { background-position: 28px 0; } }
@keyframes tada { 0% { transform: scale(.3) rotate(-20deg); } 50% { transform: scale(1.15) rotate(8deg); } 75% { transform: scale(.95) rotate(-4deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes fall { to { transform: translate(var(--drift), 110vh) rotate(var(--spin)); } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes roll { from { transform: translateY(-30px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
@keyframes flash { 50% { background: #FFF1A8; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
