/* ────────── DESIGN SYSTEM — Galettes
   Extrait des maquettes Claude Design
   (Galettes.html + Admin.html)
   ────────── */

:root {
  /* warm paper palette */
  --bg:         #F7EFE0;
  --bg-2:       #FBF5EA;
  --surface:    #FFFFFF;
  --ink:        #1C140B;
  --ink-2:      #5A4A3A;
  --muted:      #8A7560;
  --muted-2:    #BBA690;
  --line:       #EFE7DB;
  --line-2:     #D6CAB6;

  --accent:      oklch(0.72 0.15 55);
  --accent-deep: oklch(0.55 0.16 50);
  --accent-soft: oklch(0.95 0.05 75);
  --accent-ink:  #2A1A06;

  --ok:        oklch(0.55 0.11 150);
  --ok-soft:   oklch(0.95 0.03 150);
  --warn:      oklch(0.55 0.13 60);
  --warn-soft: oklch(0.95 0.04 75);
  --danger:      oklch(0.55 0.18 25);
  --danger-soft: oklch(0.95 0.04 25);
  --info:      oklch(0.45 0.14 255);
  --info-soft: oklch(0.95 0.03 240);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --f-display: "Instrument Serif", "Playfair Display", Georgia, serif;
  --f-body:    "Inter", -apple-system, system-ui, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, monospace;

  --shadow-sm: 0 1px 2px rgba(28,20,11,0.04), 0 2px 8px rgba(28,20,11,0.04);
  --shadow-md: 0 4px 14px rgba(28,20,11,0.08);
  --shadow-lg: 0 24px 60px rgba(28,20,11,0.16);
}

/* ────────── BASE ────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: transparent; border: 0; padding: 0; }
img, svg, video { display: block; max-width: 100%; }

/* ────────── SHELL / LAYOUT ────────── */
.app {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 120px;
  position: relative;
}
.app--wide { max-width: 1080px; padding-bottom: 60px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  padding: 14px 20px;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.topbar--admin { padding: 12px 18px; gap: 8px; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); padding: 4px 6px; border-radius: 8px;
}
.brand:hover { background: var(--line); }
.brand-mark { width: 32px; height: 32px; flex: 0 0 32px; }
.topbar--admin .brand-mark { width: 28px; height: 28px; flex: 0 0 28px; }
.brand-name {
  font-family: var(--f-display);
  font-size: 22px; font-weight: 400; letter-spacing: -0.01em;
}
.topbar--admin .brand-name { font-size: 20px; }

.crumb-sep { color: var(--muted-2); font-size: 14px; }
.crumb {
  padding: 4px 8px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.crumb:hover { background: var(--line); color: var(--ink); }

.topbar-spacer { flex: 1; }

.top-link {
  background: transparent; padding: 8px 12px;
  border-radius: var(--r-sm); font-size: 14px; color: var(--ink-2);
  font-weight: 500; text-decoration: none;
}
.top-link:hover { background: var(--line); color: var(--ink); }
.top-link.active { background: var(--ink); color: var(--bg); }

.ghost-link {
  color: var(--muted);
  font-size: 14px; padding: 8px 10px; border-radius: 8px;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.ghost-link:hover { background: var(--line); color: var(--ink); }

.avatar-btn {
  background: var(--ink); color: #fff;
  width: 36px; height: 36px; border-radius: 18px;
  font-size: 13px; font-weight: 600;
  display: grid; place-items: center;
  text-decoration: none;
}

.container { padding: 24px 20px; }
@media (min-width: 720px) { .container { padding: 40px 32px; } }
@media (min-width: 768px) { .container--wide { padding: 36px 28px 80px; } }
@media (max-width: 380px) { .container { padding: 20px 16px; } }

/* ────────── TYPO ────────── */
.kicker {
  font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600;
}
.greeting {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(34px, 7vw, 52px); line-height: 1.02;
  letter-spacing: -0.02em; color: var(--ink);
  margin: 8px 0 0;
  text-wrap: pretty;
}
.greeting em { font-style: italic; color: var(--accent-deep); }
.greeting--sm { font-size: clamp(30px, 6vw, 42px); }
.page-title {
  font-family: var(--f-display);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 400; letter-spacing: -0.02em;
  color: var(--ink); line-height: 1.05;
  margin: 0;
}
.page-title--sm { font-size: clamp(26px, 4vw, 36px); }
.section-title {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin: 24px 4px 10px;
}
.muted { color: var(--muted); }
.hr { height: 1px; background: var(--line); border: 0; margin: 18px 0; }

/* ────────── CARDS ────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.card-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600; color: var(--ink);
  margin: 0 0 14px;
}
.card-title--lg {
  font-family: var(--f-display); font-size: 22px; font-weight: 400;
  letter-spacing: -0.01em;
}
.card-title .ico {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent-deep);
}

/* live banner */
.live-banner {
  background: linear-gradient(135deg, var(--accent-soft) 0%, #FFF9EC 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: var(--r-xl);
  padding: 22px;
  position: relative; overflow: hidden;
  margin-top: 20px;
}
.live-dot {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--accent-deep);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.live-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  100% { box-shadow: 0 0 0 14px transparent; }
}
.live-title {
  font-family: var(--f-display); font-size: clamp(24px, 4vw, 32px);
  font-weight: 400; letter-spacing: -0.02em; color: var(--accent-ink);
  margin: 10px 0 6px; line-height: 1.15;
}
.live-meta {
  font-size: 14px; color: color-mix(in srgb, var(--accent-ink) 70%, transparent);
}
.live-meta strong { color: var(--accent-ink); font-weight: 600; }

/* session-banner (admin dashboard — green ok variant) */
.session-banner {
  background: linear-gradient(135deg, var(--ok-soft), color-mix(in srgb, var(--ok-soft) 60%, #fff));
  border: 1px solid color-mix(in srgb, var(--ok) 25%, var(--line));
  border-radius: var(--r-lg);
  padding: 20px;
  margin-top: 14px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.session-banner .dot {
  width: 10px; height: 10px; border-radius: 5px;
  background: var(--ok);
  animation: pulse-ok 1.8s ease-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-ok {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); }
  100% { box-shadow: 0 0 0 14px transparent; }
}
.session-banner .info { flex: 1; min-width: 200px; }
.session-banner .k {
  font-size: 11px; font-weight: 700; color: var(--ok);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.session-banner h3 {
  font-family: var(--f-display); font-size: 24px; font-weight: 400;
  margin: 2px 0; letter-spacing: -0.01em;
}
.session-banner .meta { font-size: 13px; color: var(--ink-2); }

/* invite card */
.invite {
  background: var(--info-soft);
  border: 1px solid color-mix(in srgb, var(--info) 15%, var(--line));
  border-radius: var(--r-lg);
  padding: 16px; margin-top: 14px;
}
.invite-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; gap: 10px; flex-wrap: wrap;
}
.invite-head h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; margin: 0; color: var(--info);
}
.invite-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.invite-link .url {
  flex: 1; min-width: 220px;
  font-family: var(--f-mono); font-size: 12px; color: var(--info);
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--info) 15%, var(--line));
  border-radius: var(--r-md);
  padding: 10px 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ────────── BUTTONS ────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  border: 0; border-radius: var(--r-md);
  font-size: 15px; font-weight: 600;
  white-space: nowrap;
  transition: transform 0.06s, box-shadow 0.15s, background 0.15s, color 0.15s;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn--primary:hover { background: var(--accent-deep); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; }
.btn--ok { background: var(--ok); color: #fff; }
.btn--ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn--ghost:hover { background: var(--line); }
.btn--ghost-accent {
  background: transparent; color: var(--accent-deep);
  border: 1.5px solid var(--accent);
}
.btn--ghost-accent:hover { background: var(--accent-soft); }
.btn--danger {
  background: transparent; color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--line));
}
.btn--danger:hover { background: var(--danger-soft); }
.btn--danger-solid { background: var(--danger); color: #fff; }
.btn--danger-solid:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }
.btn--info { background: var(--info); color: #fff; }
.btn--info:hover { background: color-mix(in srgb, var(--info) 85%, #000); }
.btn--block { width: 100%; }
.btn--lg { min-height: 52px; padding: 0 20px; font-size: 16px; }
.btn--xl { min-height: 56px; font-size: 17px; }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }

/* ────────── FORM CONTROLS ────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.help { font-size: 12px; color: var(--muted); }
.input, .select-trigger {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 0 14px;
  font-size: 15px; color: var(--ink);
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input--lg { min-height: 52px; padding: 0 16px; font-size: 16px; }
.input:focus, .select-trigger:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}
select.input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' stroke='%238A7560' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}
.select-trigger {
  justify-content: space-between; text-align: left; cursor: pointer;
}
.select-trigger .placeholder { color: var(--muted-2); }
.input-row {
  display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap;
}
.input-row .input { flex: 1; min-width: 180px; }
textarea.input {
  padding: 12px 14px; min-height: 160px;
  font-family: var(--f-mono); font-size: 13px; line-height: 1.55;
  resize: vertical; background: var(--bg-2);
}

.checkbox {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}
.checkbox input {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px; flex: 0 0 22px; margin: 2px 0 0;
  border: 2px solid var(--line-2); border-radius: 6px;
  background: #fff;
  display: grid; place-items: center;
  transition: background 0.12s, border-color 0.12s;
}
.checkbox input:checked {
  background: var(--accent); border-color: var(--accent);
}
.checkbox input:checked::after {
  content: "";
  width: 6px; height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}
.checkbox-main { font-size: 15px; font-weight: 500; color: var(--ink); }
.checkbox-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* iOS-style switch */
.switch {
  width: 44px; height: 26px; border-radius: 999px; padding: 2px;
  background: var(--line-2);
  display: inline-flex; align-items: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.switch input { display: none; }
.switch .knob {
  width: 22px; height: 22px; border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.18s ease;
}
.switch input:checked ~ .knob { transform: translateX(18px); }
.switch:has(input:checked) { background: var(--accent); }

/* ────────── LOT (order line item) ────────── */
.lot {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  display: flex; gap: 14px; align-items: flex-start;
}
.lot-num {
  width: 40px; height: 40px; flex: 0 0 40px;
  background: var(--accent-soft); color: var(--accent-deep);
  border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--f-display); font-size: 20px;
}
.lot-body { flex: 1; min-width: 0; }
.lot-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.lot-name {
  font-family: var(--f-display); font-size: 20px; font-weight: 400;
  letter-spacing: -0.01em; color: var(--ink); line-height: 1.2;
}
.lot-unit { font-size: 13px; color: var(--muted); margin-top: 2px; }
.lot-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; gap: 12px;
}
.lot-total {
  font-family: var(--f-display); font-size: 20px; font-weight: 400;
  color: var(--ink); white-space: nowrap;
}
.lot-extra {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--line);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--ink-2);
  cursor: pointer;
}
.lot-extra input { width: 20px; height: 20px; accent-color: var(--accent); }

.icon-btn {
  padding: 6px; color: var(--muted-2); border-radius: 8px;
}
.icon-btn:hover { background: var(--line); color: var(--ink); }

/* stepper */
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper button {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-deep);
  font-size: 20px; font-weight: 700;
  display: grid; place-items: center;
}
.stepper button.plus { background: var(--accent); color: #fff; }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper .qty {
  font-family: var(--f-display); font-size: 22px; color: var(--ink);
  min-width: 28px; text-align: center;
}

/* dashed "add another" */
.add-lot {
  width: 100%; min-height: 64px;
  background: transparent;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 50%, var(--line-2));
  color: var(--accent-deep);
  border-radius: var(--r-lg);
  font-size: 16px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
}
.add-lot:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ────────── STICKY TOTAL BAR ────────── */
.sticky-total {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.sticky-total-inner {
  max-width: 760px; margin: 0 auto;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 14px;
}
.sticky-total .total-lbl {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.sticky-total .total-val {
  font-family: var(--f-display); font-size: 28px;
  color: var(--ink); line-height: 1; margin-top: 2px;
}

/* ────────── HISTORY ORDER CARD ────────── */
.order-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
}
.order-card + .order-card { margin-top: 12px; }
.order-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.order-date {
  font-family: var(--f-display); font-size: 19px;
  letter-spacing: -0.01em; color: var(--ink);
  white-space: nowrap;
}
.order-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.order-item {
  display: flex; justify-content: space-between;
  font-size: 15px; color: var(--ink-2);
  gap: 8px; flex-wrap: wrap;
}
.order-item .q { color: var(--muted); }
.order-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--line);
  gap: 10px; flex-wrap: wrap;
}
.order-total {
  font-family: var(--f-display); font-size: 20px; color: var(--ink);
  white-space: nowrap;
}
.paid-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ok); font-weight: 500;
}

/* pills */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  white-space: nowrap;
}
.pill--open   { background: var(--accent-soft); color: var(--accent-deep); }
.pill--done   { background: var(--ok-soft); color: var(--ok); }
.pill--ok     { background: var(--ok-soft); color: var(--ok); }
.pill--unpaid { background: var(--danger-soft); color: var(--danger); }
.pill--closed { background: var(--line); color: var(--muted); }
.pill--info   { background: var(--info-soft); color: var(--info); }
.pill--accent { background: var(--accent-soft); color: var(--accent-deep); }
.pill--warn   { background: #F5EBD9; color: #7A5A20; }

/* unpaid hero (dark) */
.unpaid {
  background: var(--ink); color: #fff;
  border-radius: var(--r-lg);
  padding: 22px;
  margin-bottom: 16px;
}
.unpaid-kicker {
  font-size: 11px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.unpaid-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 14px; margin-top: 6px; flex-wrap: wrap;
}
.unpaid-amount {
  font-family: var(--f-display); font-size: 36px; letter-spacing: -0.02em;
}
.unpaid-desc { font-size: 13px; opacity: 0.7; margin-top: 2px; }

/* ────────── PROFILE ────────── */
.profile-hero {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 8px 0 24px;
}
.avatar-lg {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--f-display); font-size: 38px;
  box-shadow: var(--shadow-md);
}
.stats, .stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 16px 0 24px;
}
.stats-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 10px;
  text-align: center;
}
.stats-row .stat {
  border-radius: var(--r-lg);
  padding: 18px 16px;
}
.stat .n {
  font-family: var(--f-display); font-size: 24px;
  letter-spacing: -0.01em; color: var(--ink); line-height: 1.05;
}
.stats-row .stat .n { font-size: 34px; letter-spacing: -0.02em; }
.stat .l {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-top: 2px; font-weight: 600;
}
.stats-row .stat .l { font-size: 12px; margin-top: 6px; font-weight: 500; }
.stat.hl { background: var(--accent-soft); border-color: transparent; }
.stat.hl .n, .stat.hl .l { color: var(--accent-deep); }
.stat.hl-ok .n { color: var(--ok); }
.stat.hl-warn .n { color: var(--danger); }

/* row card (profile-style lists) */
.row-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  text-align: left; width: 100%;
}
.row-card + .row-card { margin-top: 8px; }
.row-card.clickable { cursor: pointer; }
.row-main { flex: 1; min-width: 0; }
.row-title {
  font-size: 15px; font-weight: 500; color: var(--ink);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.row-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.row-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-deep);
  display: grid; place-items: center; flex-shrink: 0;
}

/* ────────── DASH GRID ────────── */
.dash-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  margin-top: 18px;
}
.dash-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 14px;
  display: flex; flex-direction: column; gap: 10px;
  align-items: center; text-align: center;
  transition: transform 0.08s, border-color 0.15s, box-shadow 0.15s;
  text-decoration: none; color: inherit;
  cursor: pointer;
}
.dash-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.dash-tile .ico {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent-deep);
  display: grid; place-items: center;
}
.dash-tile .t { font-size: 14px; font-weight: 600; color: var(--ink); }
.dash-tile .badge {
  font-size: 11px; font-weight: 700; color: var(--accent-deep);
  background: var(--accent-soft);
  padding: 2px 8px; border-radius: 999px;
}
.dash-tile .badge--danger { background: var(--danger-soft); color: var(--danger); }

/* ────────── LISTS / ADMIN TABLES ────────── */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  text-align: left; width: 100%;
  text-decoration: none; color: inherit;
}
.list-item:hover { border-color: var(--line-2); background: var(--bg-2); }
.list-item .main { flex: 1; min-width: 0; }
.list-item .title {
  font-size: 15px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.list-item .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.list-item .arrow { color: var(--muted-2); font-size: 13px; }

/* row-group (joined rows) */
.row-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.row-group > * + * { border-top: 1px solid var(--line); }

/* device rows (admin user detail) */
.device {
  padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; flex-wrap: wrap;
}
.device .ua {
  font-family: var(--f-mono); font-size: 12px; color: var(--ink-2);
  line-height: 1.5; word-break: break-all;
}
.device .when { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* log rows */
.log { padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.log-top {
  display: flex; justify-content: space-between; gap: 12px;
  align-items: flex-start; flex-wrap: wrap;
}
.log-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.log-badge {
  font-family: var(--f-mono); font-size: 11px; font-weight: 500;
  color: var(--info); background: var(--info-soft);
  padding: 3px 8px; border-radius: 6px;
}
.log-badge.payment { color: var(--ok); background: var(--ok-soft); }
.log-badge.order   { color: var(--accent-deep); background: var(--accent-soft); }
.log-badge.danger  { color: var(--danger); background: var(--danger-soft); }
.log-user { font-size: 13px; font-weight: 600; color: var(--ink); }
.log-meta {
  font-size: 12px; color: var(--muted);
  font-family: var(--f-mono); text-align: right; white-space: nowrap;
}
.log-data {
  font-family: var(--f-mono); font-size: 12px; color: var(--muted);
  background: var(--bg-2);
  padding: 8px 10px; border-radius: 6px;
  overflow-x: auto; white-space: pre;
}

/* email list item */
.email-item { padding: 14px 16px; }
.email-item .h {
  display: flex; justify-content: space-between; gap: 10px;
  align-items: center; flex-wrap: wrap;
}
.email-item .subj { font-size: 14px; color: var(--muted); margin-top: 4px; }
.email-item .to { font-size: 14px; font-weight: 500; color: var(--ink); margin-top: 4px; }
.email-item details {
  margin-top: 8px; border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.email-item summary {
  font-size: 13px; color: var(--accent-deep);
  cursor: pointer; list-style: none;
}
.email-item summary::-webkit-details-marker { display: none; }
.email-item summary::before {
  content: "▸ "; display: inline-block; transition: transform 0.15s;
}
.email-item details[open] summary::before { transform: rotate(90deg); }
.email-item .body {
  font-family: var(--f-mono); font-size: 12px; color: var(--ink-2);
  background: var(--bg-2);
  padding: 12px; border-radius: 8px;
  white-space: pre-wrap; line-height: 1.5;
  margin-top: 8px;
}

.filter-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  display: grid; gap: 10px; align-items: end;
  grid-template-columns: 1fr 2fr auto;
}
@media (max-width: 560px) { .filter-bar { grid-template-columns: 1fr; } }

/* SMS preview */
.sms-preview {
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-family: var(--f-mono); font-size: 13px;
  color: var(--ink-2); line-height: 1.6;
  white-space: pre-wrap; overflow-x: auto; margin: 0;
}

/* admin order row (session detail) */
.order-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px; margin-bottom: 10px;
}
.order-user .name { font-size: 16px; font-weight: 600; color: var(--ink); }
.order-user .links {
  display: flex; gap: 8px; font-size: 13px; margin-top: 2px; flex-wrap: wrap;
}
.order-user .links button, .order-user .links a {
  color: var(--muted); text-decoration: underline; text-underline-offset: 3px;
}
.order-user .links button.danger, .order-user .links a.danger { color: var(--danger); }
.order-right {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.order-right .order-total { font-size: 22px; }
.tag-sep {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--accent-deep); font-weight: 600;
  background: var(--accent-soft);
  padding: 2px 7px; border-radius: 999px;
}

/* ────────── LOGIN ────────── */
.login-shell {
  min-height: 100vh;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at top, #FBF5EA, var(--bg));
  padding: 40px 20px;
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; margin-bottom: 24px;
}
.login-logo .title {
  font-family: var(--f-display);
  font-size: 26px; letter-spacing: -0.02em;
}

/* ────────── TABS ────────── */
.tabs {
  position: sticky; top: 64px; z-index: 25;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 16px; margin: 0 -20px;
  border-bottom: 1px solid var(--line);
  display: flex; gap: 6px; overflow-x: auto;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  color: var(--ink-2);
  padding: 8px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
  text-decoration: none;
}
.tab.active { background: var(--ink); color: var(--bg); }
.tab:hover:not(.active) { background: var(--line); }

/* ────────── RECIPE SHEET ────────── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(28,20,11,0.5);
  display: none; align-items: flex-end; justify-content: center;
}
.sheet-backdrop.open { display: flex; animation: fade-in 0.18s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  background: var(--bg-2);
  width: 100%; max-width: 560px;
  max-height: 85vh;
  border-radius: 28px 28px 0 0;
  padding: 14px 0 calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
  animation: slide-up 0.22s ease;
}
@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.sheet-grab {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--line-2);
  margin: 0 auto 12px;
}
.sheet-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 20px 12px;
}
.sheet-title {
  font-family: var(--f-display); font-size: 24px;
  letter-spacing: -0.01em; color: var(--ink);
}
.sheet-close {
  width: 34px; height: 34px; border-radius: 17px;
  background: var(--line); color: var(--ink);
  display: grid; place-items: center;
}
.sheet-search {
  margin: 0 20px 14px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.sheet-search input {
  flex: 1; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 15px;
}
.sheet-body { flex: 1; overflow-y: auto; padding: 0 20px; }
.menu-group-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin: 14px 0 8px;
}
.menu-item {
  width: 100%; text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 6px;
}
.menu-item:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 50%, #fff);
}
.menu-item-name { flex: 1; font-size: 16px; font-weight: 500; color: var(--ink); }
.menu-item-price {
  font-family: var(--f-display); font-size: 17px; color: var(--accent-deep);
}
@media (min-width: 720px) {
  .sheet-backdrop { align-items: center; }
  .sheet { max-width: 560px; border-radius: 28px; max-height: 80vh; }
  .sheet-grab { display: none; }
}

/* ────────── FLASH MESSAGES ────────── */
.flash {
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.flash--ok     { background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 25%, var(--line)); }
.flash--info   { background: var(--info-soft); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 20%, var(--line)); }
.flash--warn   { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); }
.flash--danger { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--line)); }

/* ────────── MISC ────────── */
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--stack-gap, 12px); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.grid-cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.grid-2col {
  display: grid; gap: 12px;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 560px) { .grid-2col { grid-template-columns: 1fr; } }

.text-danger { color: var(--danger); }
.text-accent { color: var(--accent-deep); }
.text-ok     { color: var(--ok); }
.text-info   { color: var(--info); }
.mono        { font-family: var(--f-mono); font-size: 13px; }

.view { display: none; }
.view.active { display: block; }
