:root {
  --bg: #f6f4f1;              /* warm off-white */
  --bg-2: #efeae3;            /* subtle warm tint for gradients */
  --card: #ffffff;
  --ink: #1b1815;            /* warm near-black */
  --ink-soft: #44403b;
  --muted: #8a847c;          /* warm muted gray */
  --line: #eae6df;           /* warm hairline */
  --accent: #e11d2a;          /* primary red */
  --accent-dark: #b3141f;
  --accent-soft: #fbeaec;
  --gold: #b08a52;            /* refined accent for the classic-cafe feel */
  --header: #1b1815;          /* warm dark header */
  --invert-bg: #1b1815;       /* dark surfaces (toast, tracker, badges) — flips in dark mode */
  --invert-ink: #ffffff;
  --ok: #1f9d55;
  --warn: #d9822b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(28, 25, 22, 0.04), 0 6px 20px rgba(28, 25, 22, 0.05);
  --shadow-lg: 0 4px 12px rgba(28, 25, 22, 0.08), 0 18px 48px rgba(28, 25, 22, 0.12);
  --font-display: "Vazirmatn", system-ui, "Segoe UI", Tahoma, sans-serif;
  --font-body: "Vazirmatn", system-ui, "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 700; }
.muted { color: var(--muted); font-size: 0.85rem; }
.center { text-align: center; }
.big-emoji { font-size: 3rem; }
a { color: inherit; }
img { display: block; }
::selection { background: var(--accent-soft); color: var(--accent-dark); }

/* ---------- Line-icon system ---------- */
.ic { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex-shrink: 0; }
.icon-btn .ic { width: 18px; height: 18px; }
.view-toggle button .ic { width: 18px; height: 18px; vertical-align: middle; }
.lb-close .ic { width: 20px; height: 20px; }
.big-icon { display: flex; justify-content: center; margin-bottom: 6px; }
.big-icon svg { width: 58px; height: 58px; stroke: var(--accent); stroke-width: 1.4; }
.big-icon.ok svg { stroke: var(--ok); }
.m-item .ic { width: 19px; height: 19px; }
.m-burger .ic { width: 20px; height: 20px; }
.m-sound .ic, #mLogout .ic { width: 15px; height: 15px; }

/* ---------- Offline / connection banner ---------- */
.net-banner {
  background: #fff4f4;
  color: var(--accent-dark);
  border-bottom: 1px solid #f3cdce;
  padding: 10px 16px;
  font-size: 0.85rem;
  text-align: center;
}
.net-banner[hidden] { display: none; }

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--header);
  color: #fff;
  box-shadow: var(--shadow);
}
.app-header h1 { font-size: 1.05rem; }
.app-header .muted { color: #c9ced4; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { font-size: 1.6rem; }

/* Customer header: white, centered logo & name, red underline */
/* Customer header is not sticky: it scrolls away with the content */
.app-header.centered {
  position: relative;
  flex-direction: column;
  gap: 2px;
  text-align: center;
  background:
    radial-gradient(130% 150% at 50% -50%, var(--accent-soft) 0%, transparent 42%),
    linear-gradient(180deg, var(--card) 0%, var(--bg) 100%);
  color: var(--ink);
  padding: 28px 18px 22px;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.app-header.centered::after {
  content: ''; width: 72px; height: 1px; margin: 15px auto 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.app-header.centered .logo { font-size: 2.2rem; line-height: 1; }
.app-header.centered .logo img {
  width: 60px; height: 60px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 4px var(--card), 0 0 0 5px var(--line), 0 8px 22px rgba(28, 25, 22, 0.16);
}
.app-header.centered h1 {
  font-family: var(--font-display); font-size: 1.6rem; margin: 12px 0 0;
  font-weight: 800;
  position: relative; display: inline-block; padding: 0 8px; max-width: 80%;
}
.app-header.centered h1::before, .app-header.centered h1::after {
  content: ''; position: absolute; top: 56%; width: 22px; height: 1px;
}
.app-header.centered h1::before { right: 100%; background: linear-gradient(90deg, transparent, var(--muted)); }
.app-header.centered h1::after { left: 100%; background: linear-gradient(90deg, var(--muted), transparent); }
.app-header.centered .tagline {
  font-size: 0.92rem; color: var(--muted); margin-top: 7px;
}
.app-header.centered .table-label {
  display: inline-block; margin-top: 11px; color: var(--muted); font-weight: 600;
  font-size: 0.78rem; background: var(--bg-2); padding: 4px 14px; border-radius: 999px;
}

/* Header with cover (banner) image — configurable from the manager dashboard */
.app-header.centered.has-cover {
  background-size: cover; background-position: center; color: #fff;
  border-bottom: none; padding: 42px 18px 34px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
  position: relative;
}
.app-header.centered.has-cover::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15), rgba(0,0,0,0.45));
}
.app-header.centered.has-cover > * { position: relative; z-index: 1; }
.app-header.centered.has-cover::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.85), transparent); }
.app-header.centered.has-cover h1,
.app-header.centered.has-cover .logo,
.app-header.centered.has-cover .table-label,
.app-header.centered.has-cover .tagline { color: #fff; }
.app-header.centered.has-cover h1::before { background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6)); }
.app-header.centered.has-cover h1::after { background: linear-gradient(90deg, rgba(255,255,255,0.6), transparent); }
.app-header.centered.has-cover .table-label { background: rgba(255,255,255,0.16); }
.app-header.centered.has-cover .logo img { box-shadow: 0 0 0 3px rgba(255,255,255,0.85); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 13px 18px;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn:hover { border-color: #ddd7cd; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.block { display: block; width: 100%; margin-top: 10px; text-align: center; }
.btn.primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(225, 29, 42, 0.25);
}
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); box-shadow: 0 6px 18px rgba(225, 29, 42, 0.32); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { color: var(--ink); border-color: transparent; }
.btn.small { padding: 8px 13px; font-size: 0.82rem; border-radius: 9px; }
.btn.danger { color: var(--accent); border-color: #f0cdd0; }
.btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.icon-btn {
  appearance: none; border: none;
  background: rgba(255, 255, 255, 0.14); color: inherit;
  width: 40px; height: 40px; border-radius: 50%; font-size: 1.05rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Categories: chips (desktop) + dropdown (mobile) ---------- */
/* Category bar: tab bar with a red active tab and a down arrow (desktop) */
.cat-nav { position: sticky; top: 0; z-index: 15; background: rgba(246, 244, 241, 0.86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); padding: 12px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.view-toggle { flex-shrink: 0; display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.view-toggle button { border: none; background: transparent; padding: 9px 12px; cursor: pointer; font-size: 1rem; color: var(--muted); line-height: 1; transition: all 0.15s ease; }
.view-toggle button:hover { color: var(--ink); }
.view-toggle button.active { background: var(--accent); color: #fff; }
.categories { display: inline-flex; margin: 0 auto; vertical-align: middle; background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); padding: 4px; gap: 2px; }
.categories::-webkit-scrollbar { display: none; }
.chip {
  position: relative; white-space: nowrap; border: none;
  background: transparent; color: var(--ink-soft); padding: 9px 22px; font-size: 0.9rem; font-weight: 600;
  border-radius: 999px; cursor: pointer; transition: color 0.18s ease, background 0.18s ease;
}
.chip:hover { color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; box-shadow: 0 3px 10px rgba(225, 29, 42, 0.28); }
.cat-select {
  display: none; width: 100%; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); color: var(--ink); font: inherit;
  font-weight: 600; box-shadow: var(--shadow);
}
@media (max-width: 700px) {
  .cat-nav { top: 0; }
  .categories { display: none; }
  .cat-select { display: block; flex: 1; }
}

/* ---------- Menu / product cards ---------- */
.menu { padding: 8px 16px 120px; max-width: 1200px; margin: 0 auto; }
.cat-section { scroll-margin-top: 78px; }
.cat-title {
  text-align: center; font-family: var(--font-display); font-size: 1.7rem; font-weight: 800;
  margin: 34px 0 22px; color: var(--ink);
}
.cat-title .u { display: block; width: 54px; height: 2px; background: var(--accent); border-radius: 2px; margin: 12px auto 0; }

.card-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 560px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 820px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .card-grid { grid-template-columns: repeat(4, 1fr); } }

/* نمای کاروسل: کشیدن چپ/راست بین کارت‌ها (شبیه اینستاگرام)؛ کارت بعدی سرک می‌کشد */
.scroll-row {
  display: flex; gap: 14px; align-items: stretch;
  overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  padding: 4px 2px 16px; scroll-padding-inline: 2px;
  scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row .product-card { flex: 0 0 80%; max-width: 340px; scroll-snap-align: start; }
@media (min-width: 560px) { .scroll-row .product-card { flex-basis: 44%; } }
@media (min-width: 820px) { .scroll-row .product-card { flex-basis: 30%; } }
@media (min-width: 1100px) { .scroll-row .product-card { flex-basis: 23%; max-width: 300px; } }

.product-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #e2dcd2; }

.product-img {
  /* Large, tall image so the whole product is visible */
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  background: linear-gradient(135deg, #efeae3, #e2d8cc);
  cursor: zoom-in;
}
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.product-card:hover .product-img img { transform: scale(1.05); }
.product-img .ph { display: none; }
.product-img.no-img { cursor: default; }
.product-img.no-img .ph {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 2.8rem; opacity: 0.55; filter: grayscale(0.2);
}
/* Card corner ribbon (sale) — top/right */
.card-ribbon { position: absolute; top: 0; inset-inline-end: 0; width: 92px; height: 92px; overflow: hidden; z-index: 3; pointer-events: none; }
.card-ribbon span {
  position: absolute; width: 140px; text-align: center; padding: 5px 0;
  font-size: 0.68rem; font-weight: 800; color: #fff;
  background: var(--accent); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transform: rotate(-45deg); top: 18px; inset-inline-end: -36px;
}
.card-ribbon.stars span { letter-spacing: 2px; font-size: 0.66rem; }

/* Category badge — top/left of the image */
.cat-badge {
  position: absolute; top: 8px; inset-inline-start: 8px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18); display: flex; align-items: center; justify-content: center; font-size: 1rem;
}

/* Share button — small ghost icon on a row above the price/add line */
.share-row { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.share-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.share-btn .ic { width: 16px; height: 16px; }

/* Faint product-photo watermark (cafe name) */
.img-wm {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 0 10%; font-family: var(--font-display); font-weight: 700;
  font-size: 1.25rem; line-height: 1.2; color: #fff; opacity: 0.22;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); transform: rotate(-20deg);
}
.img-wm:empty { display: none; }

.product-body { display: flex; flex-direction: column; flex: 1; padding: 16px 16px 16px; }
.product-name {
  font-family: var(--font-display); font-size: 1.12rem; margin: 0 0 6px;
  text-align: right; font-weight: 700; line-height: 1.35;
}
.ingredients { margin: 0 0 16px; font-size: 0.83rem; color: var(--muted); flex: 1; text-align: right; line-height: 1.7; }
.product-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 13px; border-top: 1px solid var(--line);
}
.price-badge {
  background: transparent; color: var(--accent); font-weight: 800; font-size: 1.05rem;
  padding: 0; border-radius: 0; white-space: nowrap;
}
.price-badge s { opacity: 0.7; font-weight: 600; margin-inline-end: 6px; color: var(--muted); font-size: 0.82rem; }

/* Add button (red square with +) and quantity stepper */
.add-btn {
  width: 40px; height: 40px; border: none; color: #fff;
  background: var(--accent); border-radius: 12px; font-size: 1.4rem; line-height: 1; font-weight: 700;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(225, 29, 42, 0.28);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.add-btn:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 5px 14px rgba(225, 29, 42, 0.34); }
.add-btn:active { transform: translateY(0) scale(0.95); }
.stepper { display: inline-flex; align-items: center; gap: 10px; background: var(--accent-soft); border-radius: 12px; padding: 3px; }
.stepper button {
  width: 34px; height: 34px; border-radius: 10px; border: none; background: var(--accent);
  color: #fff; font-size: 1.2rem; cursor: pointer; transition: background 0.15s ease;
}
.stepper button:hover { background: var(--accent-dark); }
.stepper span { min-width: 18px; text-align: center; font-weight: 800; color: var(--accent-dark); }

/* ---------- List view ---------- */
.list-wrap { display: flex; flex-direction: column; gap: 10px; max-width: 760px; margin: 0 auto; }
.list-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.list-item:hover { border-color: #e2dcd2; box-shadow: var(--shadow-lg); }
.list-head { display: flex; align-items: center; gap: 10px; padding: 15px 16px; cursor: pointer; }
.list-name { flex: 1; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; text-align: right; }
.list-price { color: var(--accent); font-weight: 800; white-space: nowrap; font-size: 1.02rem; }
.list-price s { color: var(--muted); font-weight: 600; margin-inline-end: 5px; font-size: 0.82rem; }
.list-share { border: none; background: transparent; cursor: pointer; padding: 2px 4px; line-height: 1; color: var(--muted); display: inline-flex; align-items: center; }
.list-share:hover { color: var(--accent); }
.list-share .ic { width: 18px; height: 18px; }
.list-chevron { color: var(--accent); font-size: 1.05rem; transition: transform 0.2s ease; display: inline-block; }
.list-item:not(.open) .list-chevron { animation: chevHint 1.4s ease-in-out infinite; }
.list-item.open .list-chevron { transform: rotate(180deg); color: var(--muted); }
@keyframes chevHint { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .list-item:not(.open) .list-chevron { animation: none; } }
.list-body { display: none; padding: 0 14px 14px; }
.list-item.open .list-body { display: block; }
.list-img { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #efeae3, #e2d8cc); display: flex; align-items: center; justify-content: center; font-size: 3rem; margin-bottom: 10px; cursor: zoom-in; }
.list-img img { width: 100%; height: 100%; object-fit: cover; }
.list-desc { color: var(--muted); font-size: 0.85rem; margin-bottom: 12px; }
.list-add { display: flex; justify-content: flex-start; }

/* ---------- Lightbox (image zoom) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.85); padding: 24px; cursor: zoom-out; animation: fade 0.15s ease;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: var(--shadow-lg); }
.lightbox .lb-close {
  position: absolute; top: 16px; inset-inline-end: 16px; background: rgba(255, 255, 255, 0.15);
  color: #fff; border: none; width: 44px; height: 44px; border-radius: 50%; font-size: 1.4rem; cursor: pointer;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Order status tracker ---------- */
/* Order status — now an inline item inside the bottom bar (see below) */
.order-tracker {
  flex: 1 0 auto; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--invert-bg); color: var(--invert-ink); border: none; border-radius: 14px;
  padding: 13px 12px; font: inherit; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow-lg); white-space: nowrap; overflow: hidden;
  transition: transform 0.12s ease;
}
.order-tracker:active { transform: translateY(1px); }
.order-tracker[hidden] { display: none; }
.order-tracker .ic { width: 17px; height: 17px; flex-shrink: 0; }
.order-tracker .ot-status { background: var(--accent); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; }
.order-tracker.ready .ot-status { background: var(--ok); }

/* ---------- Bottom bar: requests + cart + order status, one row ---------- */
.bottom-bar { position: fixed; bottom: 14px; inset-inline: 14px; z-index: 25; display: flex; gap: 8px; max-width: 1170px; margin: 0 auto; }
.req-btn {
  flex: 0 0 auto; display: flex; align-items: center; gap: 6px; background: var(--card); color: var(--ink);
  border: 1px solid var(--line); padding: 13px 15px; border-radius: 14px; font: inherit; font-weight: 700;
  box-shadow: var(--shadow-lg); cursor: pointer; white-space: nowrap; transition: transform 0.12s ease, border-color 0.2s ease;
}
.req-btn:hover { border-color: var(--accent); color: var(--accent); }
.req-btn:active { transform: translateY(1px); }
.cart-btn {
  flex: 2 1 auto; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--accent); color: #fff; border: none; padding: 13px 16px; border-radius: 14px;
  font: inherit; font-weight: 700; box-shadow: 0 6px 20px rgba(225, 29, 42, 0.32); cursor: pointer;
  white-space: nowrap; overflow: hidden; transition: transform 0.12s ease, background 0.2s ease;
}
.cart-btn:hover { background: var(--accent-dark); }
.cart-btn:active { transform: translateY(1px); }
.cart-total { background: rgba(255, 255, 255, 0.2); padding: 4px 10px; border-radius: 8px; flex-shrink: 0; }
@media (max-width: 470px) {
  .bottom-bar.with-order { gap: 6px; }
  .bottom-bar.with-order .bb-label { display: none; }
  .bottom-bar.with-order .req-btn,
  .bottom-bar.with-order .cart-btn,
  .bottom-bar.with-order .order-tracker { padding-inline: 11px; }
  .bottom-bar.with-order .cart-total { padding: 3px 7px; }
  .bottom-bar.with-order .order-tracker .ot-status { font-size: 0.74rem; padding: 3px 8px; }
}

/* ---------- Bottom sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 18, 16, 0.5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade 0.2s ease; }
.sheet[hidden] { display: none; }
.sheet-card { width: 100%; max-width: 520px; background: var(--card); border-radius: 26px 26px 0 0; padding: 22px 20px 30px; max-height: 86vh; overflow-y: auto; box-shadow: 0 -10px 40px rgba(20, 18, 16, 0.18); animation: rise 0.26s cubic-bezier(0.2, 0.7, 0.2, 1); }
.sheet-card::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: -6px auto 12px; }
@keyframes rise { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.sheet-head .icon-btn { background: var(--bg); color: var(--ink); }

.quick-reqs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip-btn { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }

.cart-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
textarea { width: 100%; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; resize: vertical; min-height: 60px; background: var(--card); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
input[type="text"], input[type="password"], input[type="number"], input[type="tel"], input[type="url"] { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 12px; font: inherit; background: var(--card); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
#phoneInput { text-align: center; letter-spacing: 2px; font-size: 1.1rem; margin: 12px 0; direction: ltr; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cart-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; font-size: 1.05rem; }

/* Bill: list of the table's unpaid orders in the customer invoice sheet */
.bill-list { margin: 4px 0 2px; }
.bill-list:empty { display: none; }
.bill-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.bill-row:last-child { border-bottom: none; }
.bill-row-main { min-width: 0; }
.bill-row-main b { font-weight: 800; margin-inline-end: 6px; }
.bill-row strong { white-space: nowrap; color: var(--accent); }

.card-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--bg); border-radius: 10px; padding: 10px 12px; font-size: 1.1rem; letter-spacing: 1px; direction: ltr; }
.status-pill { display: inline-block; padding: 7px 16px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; margin: 8px 0 16px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 92px; inset-inline: 0; margin: auto; width: fit-content; max-width: 90%; z-index: 80; background: var(--invert-bg); color: var(--invert-ink); padding: 11px 20px; border-radius: 999px; font-size: 0.9rem; box-shadow: var(--shadow-lg); }
.toast[hidden] { display: none; }

/* ---------- Entry gate (phone verification) and scan screen ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(120% 80% at 50% 0%, #ffffff 0%, var(--bg) 55%, var(--bg-2) 100%);
}
.gate[hidden] { display: none; }
.gate-card {
  width: 100%; max-width: 390px; background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; box-shadow: var(--shadow-lg); padding: 36px 28px; text-align: center;
}
.gate-logo { font-size: 2.8rem; line-height: 1; margin-bottom: 8px; color: var(--accent); }
.gate-logo img { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; margin: 0 auto; box-shadow: 0 4px 16px rgba(28, 25, 22, 0.14); }
.gate-card h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin: 6px 0 16px; }
.gate-card input { text-align: center; letter-spacing: 4px; font-size: 1.2rem; margin: 14px 0; direction: ltr; }
.gate-card #gateCode { letter-spacing: 10px; }
.demo-hint { margin-top: 14px; background: #fff7e6; color: #8a6d1b; border: 1px dashed #e3c878; border-radius: 10px; padding: 10px; font-size: 0.85rem; }

/* ---------- Staff dashboard ---------- */
.staff { background: #eef0f2; }
.staff-main { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; padding: 16px; align-items: start; max-width: 1300px; margin: 0 auto; }
@media (max-width: 820px) { .staff-main { grid-template-columns: 1fr; } }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border: 1px solid var(--line); }
.panel h2 { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel .count { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 9px; font-size: 0.78rem; }
.empty { color: var(--muted); text-align: center; padding: 26px 0; }
.conn-dot { font-size: 0.8rem; }

.order-card, .req-card, .fb-card { border: 1px solid var(--line); border-radius: 12px; padding: 13px; margin-top: 11px; }
.order-card.s-new { border-inline-start: 4px solid var(--accent); }
.order-card.s-preparing { border-inline-start: 4px solid var(--warn); }
.order-card.s-ready { border-inline-start: 4px solid var(--ok); }
.order-card.s-served { opacity: 0.7; }
.order-card.s-cancelled { opacity: 0.5; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.table-badge { background: var(--invert-bg); color: var(--invert-ink); border-radius: 8px; padding: 3px 11px; font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.order-items { margin: 9px 0; font-size: 0.9rem; padding-inline-start: 0; list-style: none; }
.order-items li { display: flex; justify-content: space-between; padding: 2px 0; }
.order-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 0.74rem; padding: 2px 9px; border-radius: 6px; }
.tag.waiter { background: #e7f0ff; color: #2b5fb0; }
.tag.invoice { background: #fdeedd; color: var(--warn); }
.req-note { margin-top: 7px; background: var(--bg); border-radius: 8px; padding: 7px 11px; font-size: 0.9rem; }
.receipt-link { display: inline-block; margin-top: 7px; color: var(--accent); font-weight: 700; font-size: 0.88rem; text-decoration: none; }
.receipt-thumb { width: 120px; height: 150px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); margin-top: 8px; }
.reused-warn { margin-top: 8px; background: #fff4f4; color: var(--accent-dark); border: 1px solid #f3cdce; border-radius: 9px; padding: 8px 11px; font-size: 0.82rem; font-weight: 600; }
.req-card.done { opacity: 0.45; }
.flash { animation: flash 1s ease; }
@keyframes flash { 0% { background: #fff7e0; } 100% { background: transparent; } }

/* ---------- Stars (feedback) ---------- */
.stars { display: flex; flex-direction: row-reverse; justify-content: center; gap: 6px; font-size: 2.4rem; margin: 14px 0; }
.stars input { display: none; }
.stars label { cursor: pointer; color: #d7d2cb; transition: color 0.15s; }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: #f5b301; }

.wrap { max-width: 640px; margin: 0 auto; padding: 24px 18px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; border: 1px solid var(--line); }
.card h2, .card h3 { font-family: var(--font-display); font-weight: 700; }

/* ---------- Admin settings ---------- */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 5px; }
.gateway { border: 1px solid var(--line); border-radius: 12px; padding: 15px; margin-bottom: 14px; }
.gateway.on { border-color: var(--accent); background: #fffafa; }
.gateway-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.gateway-head strong { font-size: 1rem; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; cursor: pointer; }
.section-title { margin: 20px 0 10px; font-size: 1.05rem; }

/* ---------- Manage products ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg-btn { border: none; background: var(--card); color: var(--ink); padding: 10px 22px; font: inherit; font-weight: 700; cursor: pointer; }
.seg-btn.active { background: var(--accent); color: #fff; }
.img-preview { margin-top: 10px; }
.img-preview img { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.prod-cat-title { margin: 16px 0 8px; font-weight: 800; color: var(--muted); font-size: 0.9rem; }
.prod-row { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.prod-thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: linear-gradient(135deg, #efeae3, #e2d8cc); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; flex-shrink: 0; }
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.prod-info { flex: 1; min-width: 0; }
.prod-info h4 { margin: 0; font-size: 0.98rem; }
.prod-info .muted { font-size: 0.82rem; }
.prod-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.inline-price { width: 96px !important; padding: 6px 8px !important; font-size: 0.85rem; text-align: center; }
.unavailable { opacity: 0.55; }

/* Category management */
.cat-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.cat-row-icon { font-size: 1.4rem; width: 34px; text-align: center; }
.cat-row-name { flex: 1; font-weight: 600; }
.cat-row-actions { display: flex; gap: 6px; }
.emoji-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-chip { border: 1px solid var(--line); background: var(--bg); border-radius: 9px; width: 38px; height: 38px; font-size: 1.2rem; cursor: pointer; line-height: 1; }
.emoji-chip:hover { border-color: var(--accent); }
/* آیکون عکسیِ دسته‌بندی (آپلودی به‌جای ایموجی) */
.cat-row-icon img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; vertical-align: middle; }
.cat-icon-preview img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); vertical-align: middle; }
.chip-ic { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; vertical-align: -4px; }

/* ---------- Manager dashboard (unified, with sidebar) ---------- */
.manager { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.m-side {
  position: sticky; top: 0; height: 100vh; background: var(--header); color: #fff;
  display: flex; flex-direction: column; padding: 18px 14px; gap: 6px; z-index: 30;
}
.m-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 8px; }
.m-brand .m-logo { font-size: 1.6rem; color: var(--accent); }
.m-brand b { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.m-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: right;
  border: none; background: transparent; color: #d7dbe0; font: inherit; font-weight: 600;
  padding: 12px 14px; border-radius: 10px; cursor: pointer; transition: all 0.15s ease;
}
.m-item:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.m-item.active { background: var(--accent); color: #fff; }
.m-badge { margin-inline-start: auto; background: var(--accent); color: #fff; border-radius: 999px; min-width: 21px; height: 21px; padding: 0 6px; font-size: 0.74rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--header); }
.m-badge[hidden] { display: none; }
.m-item.active .m-badge { background: #fff; color: var(--accent); }
.m-top h1 { font-size: 1.1rem; margin: 0; flex: 1; }
.m-sound { display: inline-flex; align-items: center; gap: 5px; font-size: 0.85rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.m-view { margin-top: auto; text-align: center; color: #d7dbe0; text-decoration: none; font-size: 0.85rem; padding: 12px; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 10px; }
.m-view:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.m-main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.m-top { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--card); border-bottom: 1px solid var(--line); }
.m-top h1 { font-size: 1.1rem; margin: 0; }
.m-burger { display: none; border: 1px solid var(--line); background: var(--card); width: 40px; height: 40px; border-radius: 10px; font-size: 1.2rem; cursor: pointer; }
.m-frame { flex: 1; width: 100%; border: none; background: var(--bg); }
.m-backdrop { display: none; }

@media (max-width: 800px) {
  .manager { grid-template-columns: 1fr; }
  .m-side { position: fixed; top: 0; right: 0; width: 250px; transform: translateX(100%); transition: transform 0.2s ease; }
  body.side-open .m-side { transform: none; box-shadow: var(--shadow-lg); }
  body.side-open .m-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4); z-index: 29; }
  .m-burger { display: inline-flex; align-items: center; justify-content: center; }
}

/* When a page is loaded inside the manager dashboard (iframe), hide its own header */
.embedded .app-header { display: none; }

/* ---------- QR page ---------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding: 16px; }
.qr-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-align: center; }
.qr-card img { width: 100%; max-width: 220px; margin: 0 auto; }
.toolbar { display: flex; gap: 10px; align-items: center; padding: 16px; flex-wrap: wrap; }
.toolbar input { width: 90px; }
@media print {
  .app-header, .toolbar, .net-banner { display: none; }
  .qr-card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}


/* ============ Dark mode (customer menu toggle) ============ */
html.dark {
  --bg: #16130f;
  --bg-2: #1f1a14;
  --card: #221e18;
  --ink: #f2ede5;
  --ink-soft: #d4cdc2;
  --muted: #9c9387;
  --line: #34302a;
  --accent: #f5333f;
  --accent-dark: #d22330;
  --accent-soft: #3a1c1e;
  --header: #221e18;
  --invert-bg: #322d25;
  --invert-ink: #f2ede5;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.5), 0 20px 50px rgba(0, 0, 0, 0.6);
}
html.dark .cat-nav { background: rgba(20, 17, 13, 0.86); border-bottom-color: var(--line); }
html.dark .product-img, html.dark .list-img, html.dark .prod-thumb,
html.dark .gate-logo img, html.dark .p-img { background: linear-gradient(135deg, #2a251e, #201c16); }
html.dark .gate { background: radial-gradient(120% 80% at 50% 0%, #221e18 0%, var(--bg) 60%); }
html.dark .net-banner { background: #2a1717; color: #f4b3b3; border-bottom-color: #4a2222; }
html.dark .reused-warn { background: #2a1717; color: #f4b3b3; border-color: #4a2222; }
html.dark .demo-hint { background: #2a2410; color: #e8cf8a; border-color: #564a1f; }
html.dark .status-pill { color: #ff9aa2; }
html.dark .stepper span { color: #ffb3b8; }
html.dark .stars label { color: #4a443b; }
html.dark .btn:hover { border-color: #433d34; }

/* Dark-mode toggle button (top corner of the customer header) */
.theme-toggle {
  position: absolute; top: 14px; inset-inline-end: 14px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  box-shadow: var(--shadow); transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .ic { width: 18px; height: 18px; }
.theme-toggle .ic-sun { display: none; }
html.dark .theme-toggle .ic-moon { display: none; }
html.dark .theme-toggle .ic-sun { display: inline-block; }
.app-header.centered.has-cover .theme-toggle { background: rgba(0, 0, 0, 0.35); border-color: rgba(255, 255, 255, 0.3); color: #fff; }
