/* ============================================
   ریزوبین — Design System
   Brand: ریزوبین | فونت: Vazirmatn | RTL
   ============================================ */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
  /* OKLch tokens — bound verbatim from brand-spec.md */
  --bg: oklch(98% 0.005 280);
  --surface: oklch(100% 0 0);
  --fg: oklch(22% 0.02 280);
  --muted: oklch(50% 0.01 280);
  --border: oklch(92% 0.005 280);
  --accent: oklch(58% 0.21 280);
  --accent-soft: oklch(72% 0.15 280);
  --success: oklch(60% 0.16 150);
  --warn: oklch(78% 0.16 75);
  /* متن هشدار روی زمینهٔ هشدار: --warn فقط برای زمینه/حاشیه است (کنتراست ۱٫۸۷). */
  --warn-text: oklch(42% 0.10 65);
  --danger: oklch(63% 0.22 25);

  /* RGB shadows derived for rgba usage */
  --accent-rgb: 109, 93, 251;
  --fg-rgb: 31, 41, 55;
  --success-rgb: 34, 160, 107;
  --warn-rgb: 245, 158, 11;
  --danger-rgb: 229, 72, 77;
  --shadow-rgb: 15, 23, 42;

  /* Spacing & radii */
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-full: 999px;

  /* Type */
  /* فونت‌های ایموجی رنگی باید قبل از Segoe UI بیان، وگرنه Segoe UI سمبل‌ها رو تک‌رنگ می‌گیره */
  --font-fa: 'Vazirmatn', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-display: clamp(28px, 4vw, 40px);
  --fs-h1: clamp(24px, 3vw, 32px);
  --fs-h2: 20px;
  --fs-h3: 18px;
  --fs-body: 15px;
  --fs-sm: 13px;
  --fs-xs: 12px;

  /* Shadow (very soft) */
  --shadow-card: 0 1px 2px rgba(var(--shadow-rgb), 0.04), 0 1px 3px rgba(var(--shadow-rgb), 0.04);
  --shadow-pop: 0 4px 12px rgba(var(--shadow-rgb), 0.06), 0 2px 4px rgba(var(--shadow-rgb), 0.04);
  --shadow-modal: 0 12px 32px rgba(var(--shadow-rgb), 0.12), 0 4px 8px rgba(var(--shadow-rgb), 0.06);

  /* Layout */
  --sidebar-w: 248px;
  --bottom-nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-fa);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

body { min-height: 100vh; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: oklch(from var(--accent) calc(L - 0.08) C H); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: var(--fs-body);
  color: var(--fg);
}

/* ============== Typography Helpers ============== */
.num {
  font-feature-settings: "tnum" 1, "lnum" 1;
  direction: ltr;
  display: inline-block;
  unicode-bidi: isolate;
}

.eyebrow {
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-h1); line-height: 1.2; }
h2 { font-size: var(--fs-h2); line-height: 1.3; }
h3 { font-size: var(--fs-h3); line-height: 1.4; }

.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }

/* ============== Buttons ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: var(--r-md);
  font-size: var(--fs-body);
  font-weight: 500;
  letter-spacing: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.05s;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: oklch(from var(--accent) calc(L - 0.08) C H); }
.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: oklch(from var(--border) calc(L - 0.1) C H);
  background: oklch(from var(--surface) calc(L - 0.02) C H);
}

.btn-ghost {
  background: transparent;
  color: var(--fg);
  height: 40px;
  padding: 0 12px;
}
.btn-ghost:hover { background: oklch(from var(--bg) calc(L - 0.03) C H); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: oklch(from var(--danger) calc(L - 0.06) C H); }

.btn-sm { height: 36px; padding: 0 14px; font-size: var(--fs-sm); }
.btn-lg { height: 52px; padding: 0 22px; font-size: 16px; }
.btn-block { width: 100%; }

/* ============== Cards ============== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

.card-pad { padding: 20px; }
.card-pad-sm { padding: 14px 16px; }

/* ============== Forms ============== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--fg);
}
.field-hint {
  font-size: var(--fs-xs);
  color: var(--muted);
}

.input, .select, .textarea {
  height: 46px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--fg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.input:hover, .select:hover, .textarea:hover { border-color: oklch(from var(--border) calc(L - 0.12) C H); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}
.input::placeholder { color: oklch(from var(--muted) calc(L + 0.15) C H); }
.textarea { padding: 12px 14px; height: auto; min-height: 80px; resize: vertical; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 38px;
}

/* Inline input with suffix/prefix unit */
.input-group {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  height: 46px;
}
.input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}
.input-group .input { border: none; box-shadow: none; flex: 1; height: 100%; }
.input-group .addon {
  padding: 0 12px;
  font-size: var(--fs-sm);
  color: var(--muted);
  background: oklch(from var(--bg) calc(L - 0.02) C H);
  border-right: 1px solid var(--border);
  height: 100%;
  display: flex;
  align-items: center;
}

/* RTL: input-group addon on the right (start) */
[dir="rtl"] .input-group .addon {
  border-right: none;
  border-left: 1px solid var(--border);
}

/* ============== Badges ============== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 500;
  background: oklch(from var(--bg) calc(L - 0.02) C H);
  color: var(--muted);
}
.badge-success { background: rgba(var(--success-rgb), 0.10); color: var(--success); }
.badge-warn { background: rgba(var(--warn-rgb), 0.10); color: var(--warn); }
.badge-danger { background: rgba(var(--danger-rgb), 0.10); color: var(--danger); }
.badge-accent { background: rgba(var(--accent-rgb), 0.10); color: var(--accent); }
.badge-accent-soft { background: rgba(var(--accent-rgb), 0.06); color: var(--accent); border: 1px dashed rgba(var(--accent-rgb), 0.35); }
/* ===== وارنینگِ افقیِ «نیاز به بازنگری قیمت» (داشبورد + لیست محصولات) ===== */
.warn-box {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; padding: 14px 18px; margin-bottom: 14px;
  border: 1px solid var(--warn); border-radius: var(--r-lg);
  background: rgba(var(--warn-rgb), 0.12); color: var(--warn-text);
}
.warn-box-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.warn-box-copy strong { font-size: 15px; font-weight: 700; }
.warn-box-copy span { font-size: 13px; line-height: 1.8; opacity: 0.92; }
.warn-box form { flex: 0 0 auto; }

.badge-dot { padding-right: 18px; position: relative; }

.badge-dot::before {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============== Layout: App Shell ============== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* RTL: first grid track sits at the RIGHT edge → sidebar stays on the right */

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

[dir="rtl"] .sidebar { border-left: none; border-right: 1px solid var(--border); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.brand-logo {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
}
.brand-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-section-label {
  font-size: var(--fs-xs);
  color: var(--muted);
  padding: 14px 12px 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s;
}
.nav-item:hover { background: oklch(from var(--bg) calc(L - 0.03) C H); }
.nav-item.active {
  background: rgba(var(--accent-rgb), 0.10);
  color: var(--accent);
}
.nav-item svg { flex-shrink: 0; }

.main { padding: 28px 32px 80px; min-width: 0; }

/* Top bar inside main */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
}
.topbar h1 { font-size: var(--fs-h1); }
.topbar-actions { display: flex; gap: 8px; }

/* Page header */
.page-head {
  margin-bottom: 24px;
}
.page-head h1 { margin-bottom: 4px; }
.page-head .sub { color: var(--muted); font-size: var(--fs-sm); }

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: var(--surface);
  align-items: center;
  justify-content: space-between;
  z-index: 50; /* stay above scrolled content; below drawer(100)/overlay(99)/modal(1000) */
}

/* ============== Mobile / Bottom Nav ============== */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 16px 16px calc(var(--bottom-nav-h) + 24px); }
  .bottom-nav { display: flex; }
  .desktop-only { display: none; }
  .card { overflow-x: auto; }
  .table { min-width: 100%; }
  .input { font-size: 16px; } /* prevent iOS zoom */
  h1 { font-size: 22px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}

/* Tablet: narrower sidebar so content gets room */
@media (min-width: 901px) and (max-width: 1100px) {
  :root { --sidebar-w: 68px; }
  .sidebar .nav-item span { display: none; }
  .sidebar .brand div:last-child { display: none; }
  .sidebar .nav-item { justify-content: center; }
}

/* ============== Bottom nav items ============== */
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  padding: 6px 0;
  border-radius: var(--r-md);
}
.bn-item.active { color: var(--accent); }
.bn-item svg { width: 22px; height: 22px; }

/* ============== Mobile Header (top bar for mobile) ============== */
.mobile-top {
  display: none;
  padding: 6px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
/* نام کسب‌وکار در نوار موبایل: یک خط، کوتاه‌شده با «…» تا چیدمان به هم نریزد */
.mobile-top-name { font-size: 14px; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .mobile-top { display: flex; }
}

/* ============== Stat Cards (Dashboard) ============== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .stats { grid-template-columns: 1fr 1fr; } }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: space-between; /* ارتفاع یکسان: زیرنویس‌ها پایین کارت می‌مانند */
  box-shadow: var(--shadow-card);
}
.stat-label {
  font-size: var(--fs-xs);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.stat-foot {
  font-size: var(--fs-xs);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-up { color: var(--success); }
.stat-down { color: var(--danger); }

/* ============== Lists ============== */
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: oklch(from var(--bg) calc(L - 0.02) C H); }

/* ============== Two-column main ============== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ============== Modal / Drawer ============== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(var(--fg-rgb), 0.4);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade 0.15s;
}
.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  animation: pop 0.2s;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-body { padding: 20px; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--muted);
}
.icon-btn:hover { background: oklch(from var(--bg) calc(L - 0.04) C H); color: var(--fg); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Mobile nav drawer — slides in from the RIGHT (same side as sidebar) */
.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(320px, 86vw);
  background: var(--surface);
  box-shadow: var(--shadow-modal);
  z-index: 100;
  display: none;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.drawer.open { transform: translateX(0); }
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.45); z-index: 99; }
[dir="rtl"] .drawer { right: 0; left: auto; }
.drawer-head { padding: 10px 12px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.drawer-body { padding: 10px; flex: 1; overflow-y: auto; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.drawer .nav-item { display: flex; }

/* ============== Toast ============== */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--fg);
  color: white;
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  z-index: 200;
  box-shadow: var(--shadow-pop);
  animation: pop 0.2s;
}
[dir="rtl"] .toast { left: auto; right: 50%; transform: translateX(50%); }
@media (min-width: 901px) {
  .toast { bottom: 24px; }
}

/* ============== Wizard ============== */
.wizard {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}
@media (max-width: 900px) {
  .wizard { grid-template-columns: 1fr; padding-bottom: 200px; }
}

.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  padding: 0 4px;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}
[dir="rtl"] .steps {
  margin-left: auto;
  margin-right: auto;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}
.step:hover { color: var(--fg); }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.15s;
}
.step.done .step-num {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.step.done { color: var(--success); }
.step.active .step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.step.active { color: var(--accent); }
.step-line {
  flex: 1;
  height: 1.5px;
  background: var(--border);
  margin: 0 6px;
  min-width: 16px;
}
.step.done + .step .step-line, .step.done .step-line {
  background: var(--success);
}

.step-label {
  display: inline-block;
}
@media (max-width: 700px) { .step-label { display: none; } }

/* Wizard Summary (right column) */
.summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  position: sticky;
  top: 28px;
  height: fit-content;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: var(--fs-sm);
}
.summary-row + .summary-row { border-top: 1px dashed var(--border); }
.summary-row.total {
  border-top: 2px solid var(--border);
  margin-top: 6px;
  padding-top: 12px;
  font-weight: 600;
  font-size: 15px;
  color: var(--fg);
}
.summary-label { color: var(--muted); }
.summary-value { font-weight: 600; }

.summary-divider {
  margin: 12px 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* Mobile sticky summary */
.mobile-summary {
  display: none;
}
@media (max-width: 900px) {
  .mobile-summary {
    display: block;
    position: fixed;
    bottom: var(--bottom-nav-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    z-index: 40;
    box-shadow: 0 -2px 12px rgba(var(--shadow-rgb), 0.04);
  }
  .mobile-summary .summary-row.total { font-size: 14px; padding-top: 8px; margin-top: 4px; }
  .mobile-summary .btn-block { margin-top: 10px; }
}

/* ============== Pricing Selector Cards ============== */
.choice-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
@media (max-width: 700px) { .choice-cards { grid-template-columns: 1fr; } }

.choice-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: right;
}
.choice-card:hover { border-color: oklch(from var(--accent) calc(L + 0.15) C H); }
.choice-card.selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.04);
}
.choice-title { font-weight: 600; margin-bottom: 4px; }
.choice-desc { font-size: var(--fs-xs); color: var(--muted); }

/* ============== Result Big Cards ============== */
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.result-card.primary {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.06) 0%, transparent 100%);
  border-color: rgba(var(--accent-rgb), 0.2);
}
.result-card.success {
  background: linear-gradient(180deg, rgba(var(--success-rgb), 0.06) 0%, transparent 100%);
  border-color: rgba(var(--success-rgb), 0.2);
}
.result-label { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 6px; }
.result-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--fg); }
.result-card.success .result-value { color: var(--success); }

/* ============== Table-ish (ingredient rows) ============== */
.ing-table {
  width: 100%;
  border-collapse: collapse;
}
.ing-table th, .ing-table td {
  padding: 10px 12px;
  text-align: right;
  font-size: var(--fs-sm);
}
.ing-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: var(--fs-xs);
  border-bottom: 1px solid var(--border);
}
.ing-table td { border-bottom: 1px solid var(--border); }
.ing-table tr:last-child td { border-bottom: none; }
.ing-table td.actions { text-align: left; }

/* ============== Empty state ============== */
.empty {
  text-align: center;
  padding: 56px 24px;
}
.empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  background: rgba(var(--accent-rgb), 0.08);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.empty-title { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.empty-desc { color: var(--muted); margin-bottom: 18px; font-size: var(--fs-sm); }

/* ============== Onboarding cards ============== */
.biz-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 600px) { .biz-types { grid-template-columns: repeat(2, 1fr); } }
.biz-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: var(--fs-sm);
  font-weight: 500;
}
.biz-card:hover { border-color: oklch(from var(--accent) calc(L + 0.15) C H); }
.biz-card.selected {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--accent);
}

/* ============== Filter chips ============== */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  margin-bottom: 16px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: oklch(from var(--border) calc(L - 0.12) C H); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ============== Order status flow ============== */
.status-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.status-step {
  font-size: var(--fs-xs);
  color: var(--muted);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  background: oklch(from var(--bg) calc(L - 0.02) C H);
}
.status-step.active {
  background: rgba(var(--accent-rgb), 0.10);
  color: var(--accent);
  font-weight: 600;
}
.status-step.done {
  background: rgba(var(--success-rgb), 0.10);
  color: var(--success);
  font-weight: 500;
}
.status-arrow { color: oklch(from var(--muted) calc(L + 0.15) C H); font-size: 12px; }

/* ============== Tooltip-ish info ============== */
.info-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(var(--accent-rgb), 0.06);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--fg);
  margin: 12px 0;
}
.info-line svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }

.warn-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(var(--warn-rgb), 0.08);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: oklch(from var(--warn) calc(L - 0.2) C H);
  margin: 12px 0;
}
.warn-line svg { flex-shrink: 0; margin-top: 2px; }

.danger-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(var(--danger-rgb), 0.08);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--danger);
  margin: 12px 0;
}
.danger-line svg { flex-shrink: 0; margin-top: 2px; }

/* ============== Suggestion pills (beginner pricing) ============== */
.suggest-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.suggest {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.suggest:hover { border-color: var(--accent); }
.suggest .pct { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 4px; }
.suggest .price { font-size: 16px; font-weight: 600; }

/* ============== Demo banner ============== */
.demo-banner {
  background: rgba(var(--warn-rgb), 0.08);
  border-bottom: 1px solid rgba(var(--warn-rgb), 0.2);
  color: oklch(from var(--warn) calc(L - 0.25) C H);
  padding: 8px 16px;
  font-size: var(--fs-xs);
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

/* ============== Helpers ============== */
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

/* ============== Notifications popover ============== */
.notif-pop {
  display: none;
  position: fixed;
  top: 56px;
  left: 16px;
  width: min(340px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-modal);
  z-index: 90;
  overflow: hidden;
  animation: pop 0.18s;
}
.notif-pop.open { display: block; }
.notif-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}
.notif-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  text-decoration: none;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: oklch(from var(--bg) calc(L - 0.02) C H); }
.notif-item.unread { background: rgba(var(--accent-rgb), 0.05); }
.notif-item.unread::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-right: -4px;
}
@media (min-width: 901px) {
  .notif-pop { left: auto; right: calc(var(--sidebar-w) + 16px); top: 20px; }
}

/* ============== Settings layout ============== */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row !important; overflow-x: auto; position: static !important; }
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 24px;
}
.settings-nav .nav-item { padding: 9px 12px; }

/* Switch (toggle) */
.switch {
  position: relative;
  width: 40px; height: 24px;
  border-radius: var(--r-full);
  background: oklch(from var(--border) calc(L - 0.06) C H);
  transition: background 0.15s;
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px; right: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: transform 0.15s;
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(-16px); }

/* Setting row */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .label { font-weight: 500; font-size: var(--fs-body); }
.setting-row .desc { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }

/* Day toggles (order schedule) */
.day-grid { display: grid; grid-template-columns: 1fr; gap: 0; }
.day-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.day-row:last-child { border-bottom: none; }
.day-row .day-name { width: 76px; font-weight: 500; font-size: var(--fs-sm); flex-shrink: 0; }
.day-row.off .day-time { opacity: 0.4; }
.day-time { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
.day-time .time-sep { color: var(--muted); font-size: var(--fs-xs); }
.time-input {
  height: 34px; width: 78px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 8px;
  font-family: inherit; font-size: var(--fs-sm);
  color: var(--fg);
  background: var(--surface);
  direction: ltr;
  text-align: center;
}
.time-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12); }
.time-input:disabled { background: oklch(from var(--bg) calc(L - 0.02) C H); color: var(--muted); }

/* Quantity stepper (order form) */
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  height: 46px;
  background: var(--surface);
}
.stepper button {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg);
  font-size: 20px;
  transition: background 0.15s;
}
.stepper button:hover { background: oklch(from var(--bg) calc(L - 0.03) C H); }
.stepper button:disabled { color: oklch(from var(--muted) calc(L + 0.2) C H); cursor: default; background: none; }
.stepper .qty {
  width: 56px; text-align: center;
  font-weight: 600; font-size: 16px;
  font-feature-settings: "tnum" 1;
}

/* Photo upload tiles */
.photo-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.photo-tile {
  width: 72px; height: 72px;
  border-radius: var(--r-md);
  object-fit: cover;
  border: 1px solid var(--border);
}
.photo-add {
  width: 72px; height: 72px;
  border: 1.5px dashed oklch(from var(--border) calc(L - 0.1) C H);
  border-radius: var(--r-md);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  color: var(--muted);
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  background: none;
}
.photo-add:hover { border-color: var(--accent); color: var(--accent); }
.photo-remove {
  position: absolute;
  top: -6px; left: -6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--fg);
  color: white;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-pop);
}
.photo-remove:hover { background: var(--danger); }
.photo-wrap { position: relative; }

/* Field validation error */
.field-error {
  display: block;
  font-size: var(--fs-xs);
  color: var(--danger);
  margin-top: 4px;
}
.field-error.show { display: flex; align-items: center; gap: 6px; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea {
  border-color: var(--danger);
}

/* QR box */
.qr-box {
  width: 132px; height: 132px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  padding: 10px;
  background: white;
  flex-shrink: 0;
}
.qr-box svg { width: 100%; height: 100%; display: block; }

/* Link copy box */
.link-box {
  display: flex; align-items: center; gap: 8px;
  background: oklch(from var(--bg) calc(L - 0.02) C H);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px 6px 6px 6px;
  padding-right: 12px;
}
.link-box .url {
  flex: 1; min-width: 0;
  font-size: var(--fs-sm);
  color: var(--fg);
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: left;
  font-feature-settings: "tnum" 1;
}

/* ============== Public shop (customer-facing) ============== */
/* Warm, product-oriented — intentionally softer than the admin panel */
.shop-page {
  min-height: 100vh;
  background: var(--bg);
}
.shop-hero {
  position: relative;
  height: 220px;
  overflow: hidden;
}
.shop-hero img.cover {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.shop-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(var(--fg-rgb), 0.15) 0%, rgba(var(--fg-rgb), 0.55) 100%);
}
.shop-hero-content {
  position: absolute;
  right: 20px; left: 20px;
  bottom: 16px;
  z-index: 1;
  color: white;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.shop-logo {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.shop-hero-content h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 8px rgba(var(--fg-rgb), 0.4);
}
.shop-hero-content .tagline {
  font-size: var(--fs-sm);
  opacity: 0.92;
  text-shadow: 0 1px 8px rgba(var(--fg-rgb), 0.4);
}
.shop-body {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}
.shop-about {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 20px;
}
.shop-section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.shop-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 560px) { .shop-grid { grid-template-columns: repeat(3, 1fr); } }
.shop-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.shop-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.shop-card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: oklch(from var(--bg) calc(L - 0.03) C H);
}
.shop-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.shop-card-name { font-weight: 600; font-size: 14px; }
.shop-card-desc {
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}
.shop-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.shop-card-price { font-size: 14px; font-weight: 700; }
.shop-card-price .unit { font-size: 10px; font-weight: 400; color: var(--muted); margin-right: 2px; }
.shop-order-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: white;
  font-size: var(--fs-xs);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.shop-order-btn:hover { background: oklch(from var(--accent) calc(L - 0.08) C H); color: white; }
.shop-card-meta {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px;
  color: var(--muted);
}
.shop-card-meta svg { width: 13px; height: 13px; }
.shop-footer {
  text-align: center;
  padding: 24px 16px 32px;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 2;
}
.shop-footer .socials {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
.shop-footer .socials a {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: all 0.15s;
}
.shop-footer .socials a:hover { color: var(--accent); border-color: var(--accent); }

/* Order form (customer) */
.order-page {
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 110px;
}
.order-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.order-header .back {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  color: var(--fg);
  margin-right: -6px;
}
.order-header .back:hover { background: oklch(from var(--bg) calc(L - 0.03) C H); }
.order-header h1 { font-size: 16px; font-weight: 600; }
.order-body {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px;
}
.product-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}
.product-banner img {
  width: 64px; height: 64px;
  border-radius: var(--r-md);
  object-fit: cover;
  flex-shrink: 0;
}
.product-banner .name { font-weight: 600; }
.product-banner .price { font-size: var(--fs-sm); color: var(--muted); }
.product-banner .price b { color: var(--fg); }
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}
.order-sticky-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  z-index: 30;
  box-shadow: 0 -2px 12px rgba(var(--shadow-rgb), 0.05);
}
.order-sticky-bar .inner {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.order-sticky-bar .total { flex: 1; min-width: 0; }
.order-sticky-bar .total .lbl { font-size: 11px; color: var(--muted); }
.order-sticky-bar .total .val { font-size: 16px; font-weight: 700; }

/* Success page */
.success-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: var(--bg);
}
.success-icon {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(var(--success-rgb), 0.10);
  color: var(--success);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  animation: pop 0.35s;
}
.success-icon svg { width: 36px; height: 36px; }
.success-card {
  width: 100%;
  max-width: 400px;
  margin-top: 24px;
}
.success-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: var(--fs-sm);
}
.success-code + .success-code { border-top: 1px dashed var(--border); }
.success-code .k { color: var(--muted); }
.success-code .v { font-weight: 600; }
.order-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  padding: 6px 16px;
  border-radius: var(--r-full);
  font-feature-settings: "tnum" 1;
}

/* ============== Launcher ============== */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } }

.login-side {
  background: linear-gradient(135deg, oklch(from var(--accent) calc(L - 0.05) C H) 0%, var(--accent-soft) 100%);
  padding: 48px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
@media (max-width: 900px) { .login-side { display: none; } }

.login-side::before {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  top: -100px;
  left: -100px;
}
.login-side::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  bottom: -80px;
  right: 20%;
}
.login-side-content { position: relative; z-index: 1; }
.login-side .brand-logo { background: rgba(255,255,255,0.2); }
.login-side h2 { font-size: 32px; line-height: 1.25; margin-bottom: 16px; max-width: 420px; }
.login-side p { font-size: 16px; opacity: 0.85; max-width: 380px; line-height: 1.7; }
.login-side-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  position: relative;
  z-index: 1;
  margin-top: 40px;
}
.login-stat-val { font-size: 22px; font-weight: 700; }
.login-stat-lbl { font-size: var(--fs-xs); opacity: 0.8; }

.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.login-card {
  width: 100%;
  max-width: 380px;
}
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 24px; font-size: var(--fs-sm); }
.login-foot { text-align: center; margin-top: 18px; font-size: var(--fs-sm); color: var(--muted); }

/* ============== Launcher ============== */
.launcher {
  min-height: 100vh;
  background: var(--bg);
  padding: 48px 24px;
}
.launcher-inner { max-width: 980px; margin: 0 auto; }
.launcher h1 { font-size: 28px; margin-bottom: 8px; }
.launcher .sub { color: var(--muted); margin-bottom: 28px; }
.screen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 760px) {
  .screen-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .screen-grid { grid-template-columns: 1fr; }
}
.screen-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  text-decoration: none;
  color: var(--fg);
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.screen-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-pop); }
.screen-card .name { font-weight: 600; }
.screen-card .desc { color: var(--muted); font-size: var(--fs-sm); }

/* ============== Product Detail ============== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--fg); }
.section + .section { margin-top: 24px; }

/* Sticky sidebar product page */
.product-side {
  position: sticky;
  top: 24px;
  height: fit-content;
}

/* ============== Print / large display ============== */
@media (min-width: 1280px) {
  .main { padding: 32px 40px 80px; }
}

/* ============== Admin Dashboard ============== */
.admin-sidebar .brand-logo { background: oklch(from var(--accent) calc(L - 0.08) C H); color: white; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1100px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .admin-stats { grid-template-columns: 1fr 1fr; } }
.admin-chart-card { padding: 20px; }
.admin-chart {
  display: flex; align-items: flex-end; gap: 10px;
  height: 180px; padding-top: 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.admin-chart .bar-col {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 0;
}
.admin-chart .bar-col .bar {
  width: 100%; max-width: 36px;
  background: oklch(from var(--accent) calc(L + 0.12) C H);
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: background 0.2s;
}
.admin-chart .bar-col:hover .bar { background: var(--accent); }
.admin-chart .bar-col .lbl { font-size: 10px; color: var(--muted); }
.admin-chart .bar-col .val { font-size: 10px; font-weight: 600; }
.admin-grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-top: 20px; }
@media (max-width: 900px) { .admin-grid-2 { grid-template-columns: 1fr; } }
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-item .icon-circle {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: rgba(var(--accent-rgb), 0.08); color: var(--accent);
}
.activity-item .body { flex: 1; min-width: 0; }
.activity-item .body .title { font-weight: 500; font-size: 13px; }
.activity-item .body .desc { font-size: 11px; color: var(--muted); }
.activity-item .time { font-size: 11px; color: var(--muted); flex-shrink: 0; }

/* ============== Tables (admin) ============== */
.table-wrap { overflow-x: auto; border-radius: 14px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
table.data-table thead { background: oklch(from var(--bg) calc(L + 0.005) C H); }
table.data-table th {
  padding: 12px 14px; text-align: right; font-weight: 600;
  color: var(--muted); font-size: 11px; letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data-table td {
  padding: 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data-table tbody tr:hover { background: oklch(from var(--bg) calc(L - 0.015) C H); }
table.data-table tbody tr:last-child td { border-bottom: none; }
.cell-primary { font-weight: 600; }
.cell-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.cell-actions { display: flex; gap: 4px; }
.cell-actions .icon-btn { width: 32px; height: 32px; }

/* Mobile card list (replaces table on small screens) */
.list-cards { display: none; }
@media (max-width: 760px) {
  .table-wrap { display: none; }
  .list-cards { display: flex; flex-direction: column; gap: 10px; }
}
.list-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 14px;
  background: var(--surface);
}
.list-card .row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.list-card .row .k { color: var(--muted); font-size: 12px; }
.list-card .row .v { font-size: 13px; font-weight: 500; }
.list-card .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
.list-card .head .title { font-weight: 600; font-size: 15px; }
.list-card .actions { display: flex; gap: 6px; margin-top: 10px; }

/* ============== Toolbar (search + filters) ============== */
.toolbar {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap; margin-bottom: 16px;
}
.search-box {
  flex: 1; min-width: 220px;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 0 14px; height: 44px;
}
.search-box input {
  flex: 1; border: none; outline: none; background: transparent;
  font: inherit; color: inherit; padding: 0;
}
.search-box input::placeholder { color: oklch(from var(--muted) calc(L + 0.15) C H); }
.search-box svg { color: var(--muted); flex-shrink: 0; }
.toolbar .chips { flex-wrap: nowrap; }

/* ============== Order Link Card ============== */
.link-share-card {
  background: linear-gradient(135deg, oklch(from var(--accent) L C H / 0.04), oklch(from var(--accent-soft) L C H / 0.07));
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 14px; padding: 18px;
}
.link-share-card h3 { color: var(--accent); }
.link-share-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.qr-box {
  background: white; padding: 10px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  width: 120px; height: 120px; flex-shrink: 0;
}
.qr-box svg { width: 100%; height: 100%; display: block; }

/* ============== Pricing / Plans ============== */
.pricing-wrap { max-width: 1100px; margin: 0 auto; padding: 40px 20px 80px; }
.pricing-head { text-align: center; margin-bottom: 32px; }
.pricing-head h1 { font-size: 32px; margin-bottom: 8px; }
.pricing-head .sub { color: var(--muted); font-size: 15px; }
.plans-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  align-items: stretch;
}
@media (max-width: 880px) { .plans-grid { grid-template-columns: 1fr; } }
.plan-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; display: flex; flex-direction: column; gap: 14px;
  position: relative;
}
.plan-card.featured {
  border-color: var(--accent); border-width: 2px;
  box-shadow: 0 8px 30px rgba(var(--accent-rgb), 0.15);
}
.plan-card.featured::before {
  content: 'محبوب‌ترین'; position: absolute; top: -12px; right: 24px;
  background: var(--accent); color: white; font-size: 11px;
  padding: 4px 12px; border-radius: 999px; font-weight: 600;
}
.plan-card .plan-name { font-size: 13px; color: var(--muted); font-weight: 600; }
.plan-card .plan-price { font-size: 32px; font-weight: 700; }
.plan-card .plan-price small { font-size: 13px; font-weight: 400; color: var(--muted); margin-right: 6px; }
.plan-card .plan-desc { font-size: 13px; color: var(--muted); }
.plan-card ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; }
.plan-card ul li {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 13px;
}
.plan-card ul li svg {
  flex-shrink: 0; color: var(--success); margin-top: 2px;
}
.plan-card ul li.off svg { color: var(--muted); opacity: 0.4; }
.plan-card ul li.off { color: var(--muted); }
.plan-card .btn { margin-top: auto; }

/* ============== Checkout ============== */
.checkout-wrap { max-width: 920px; margin: 0 auto; padding: 28px 20px 80px; }
.checkout-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .checkout-grid { grid-template-columns: 1fr; } }
.checkout-summary .row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.checkout-summary .row.total { border-top: 1px dashed var(--border); padding-top: 14px; margin-top: 8px; font-size: 16px; font-weight: 700; }
.gateway-box {
  border: 1px dashed var(--border); border-radius: 12px; padding: 28px;
  text-align: center; background: var(--bg);
}
.gateway-box svg { color: var(--muted); margin-bottom: 8px; }
.gateway-box .lbl { font-size: 13px; color: var(--muted); }
.gateway-box .name { font-weight: 600; margin-top: 4px; }

/* ============== Subscription status ============== */
.sub-hero {
  background: linear-gradient(135deg, oklch(from var(--accent) L C H / 0.06), oklch(from var(--accent-soft) L C H / 0.12));
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 16px; padding: 24px; display: flex; gap: 20px; align-items: center;
  flex-wrap: wrap;
}
@media (max-width: 700px) { .sub-hero { flex-direction: column; align-items: flex-start; } }
.sub-hero .crown {
  width: 56px; height: 56px; border-radius: 14px;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
}
.sub-hero h2 { margin-bottom: 4px; }
.sub-hero .meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; }
.sub-hero .meta .item .lbl { font-size: 11px; color: var(--muted); }
.sub-hero .meta .item .val { font-weight: 600; font-size: 14px; }
.usage-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin-top: 20px;
}
.usage-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.usage-item .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.usage-item .head .lbl { font-size: 13px; }
.usage-item .head .val { font-size: 13px; font-weight: 600; }
.usage-item .bar { height: 8px; background: oklch(from var(--accent) calc(L + 0.4) C H / 0.18); border-radius: 999px; overflow: hidden; }
.usage-item .bar .fill { height: 100%; background: var(--accent); border-radius: 999px; }

/* ============== Subscription Expired ============== */
.expired-page {
  max-width: 480px; margin: 60px auto; padding: 0 20px; text-align: center;
}
.expired-card { background: var(--surface); border-radius: 18px; padding: 32px; box-shadow: var(--shadow-pop); }
.expired-card .icon-wrap {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(var(--warn-rgb), 0.12); color: var(--warn);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.expired-card h1 { font-size: 22px; margin-bottom: 8px; }
.expired-card p { color: var(--muted); margin-bottom: 20px; }
.expired-card .info-list {
  text-align: right; background: oklch(from var(--accent) calc(L + 0.4) C H / 0.06);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 20px;
}
.expired-card .info-list li { display: flex; gap: 8px; padding: 4px 0; font-size: 13px; }

/* ============== Custom Order form ============== */
.info-box {
  background: oklch(from var(--accent) calc(L + 0.4) C H / 0.06);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 12px; padding: 12px 14px; font-size: 13px;
  display: flex; gap: 10px; align-items: flex-start; color: oklch(from var(--accent) calc(L - 0.2) C H);
}
.info-box svg { flex-shrink: 0; margin-top: 2px; color: var(--accent); }

.upload-area {
  border: 1.5px dashed var(--border); border-radius: 12px; padding: 18px;
  text-align: center; background: var(--bg); transition: border-color 0.15s;
}
.upload-area:hover { border-color: var(--accent); }

/* ============== Tickets (chat thread) ============== */
.chat-thread {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; max-height: 480px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.chat-bubble { display: flex; gap: 10px; max-width: 80%; }
.chat-bubble.from-customer { align-self: flex-start; }
.chat-bubble.from-admin { align-self: flex-end; flex-direction: row-reverse; }
.chat-bubble .avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
}
.chat-bubble.from-customer .avatar { background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }
.chat-bubble.from-admin .avatar { background: oklch(from var(--accent) L C H); color: white; }
.chat-bubble .body { background: var(--bg); padding: 10px 14px; border-radius: 12px; }
.chat-bubble.from-admin .body { background: oklch(from var(--accent) calc(L + 0.4) C H / 0.10); }
.chat-bubble .body .meta { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.chat-bubble .body .text { font-size: 14px; line-height: 1.6; white-space: pre-line; }

.ticket-compose {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; display: flex; gap: 8px; align-items: flex-end;
  margin-top: 12px;
}
.ticket-compose .textarea {
  border: none; padding: 4px 0; min-height: 0; box-shadow: none; flex: 1;
}
.ticket-compose .textarea:focus { box-shadow: none; }

/* ============== Quote card (custom order) ============== */
.quote-card {
  border: 1.5px dashed rgba(var(--accent-rgb), 0.35);
  background: oklch(from var(--accent) calc(L + 0.4) C H / 0.05);
  border-radius: 14px; padding: 18px;
}
.quote-card .price-input {
  font-size: 24px; font-weight: 700; text-align: center;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  background: var(--surface); border-radius: 10px; padding: 12px;
  width: 100%; max-width: 280px; margin: 0 auto;
}

/* ============== Empty state ============== */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state svg { color: var(--border); margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; margin-bottom: 6px; color: var(--fg); }

/* ============== Shop dual CTA ============== */
.shop-cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 28px; }
.shop-cta { display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: 14px; text-decoration: none; color: inherit; transition: transform 0.18s, box-shadow 0.18s; }
.shop-cta:hover { transform: translateY(-2px); }
.shop-cta-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(109,93,251,0.18); }
.shop-cta-primary:hover { box-shadow: 0 10px 22px rgba(109,93,251,0.28); }
.shop-cta-primary .shop-cta-sub { color: rgba(255,255,255,0.85); }
.shop-cta-secondary { background: var(--warn-soft, rgba(245,158,11,0.14)); color: var(--fg); box-shadow: var(--shadow-card); border: 1px solid var(--warn); }
.shop-cta-secondary:hover { box-shadow: 0 6px 16px rgba(245,158,11,0.20); }
.shop-cta-secondary .shop-cta-sub { color: var(--muted); }
.shop-cta-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,0.20); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.shop-cta-secondary .shop-cta-icon { background: rgba(255,255,255,0.65); }
.shop-cta-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: right; }
.shop-cta-title { font-weight: 700; font-size: 14px; }
.shop-cta-sub { font-size: 11px; opacity: 0.85; line-height: 1.5; }
.shop-cta-arrow { flex-shrink: 0; opacity: 0.7; }
@media (max-width: 600px) {
  .shop-cta-row { grid-template-columns: 1fr; }
}
.empty-state p { font-size: 13px; margin-bottom: 16px; }

/* Admin bottom nav: same behaviour as business bottom nav, just themed via accent */
.admin-bottom { background: var(--surface); border-top-color: var(--border); }
.admin-bottom .bn-item.active { color: var(--accent); }
@media (max-width: 900px) {
  .admin-bottom { display: flex; }
}

/* ============== Responsive polish (v2) ============== */
/* Consistent vertical rhythm between form fields */
.input, .select, .textarea { margin-top: 6px; }
.btn + .btn { margin-right: 8px; }
.flex { flex-wrap: wrap; }

/* Desktop tables: keep purchase inline form compact */
.purchase-form .input { height: 36px; padding: 0 8px; font-size: 13px; margin-top: 0; }
.purchase-form .btn-sm { height: 36px; padding: 0 12px; }

/* Mobile: single-column forms, full-width controls */
@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .purchase-form { width: 100%; }
  .purchase-form .input { flex: 1 1 30%; min-width: 0; }
  .card-pad { padding: 14px; }
  .two-col { gap: 14px; }
  .list-row { padding: 12px 14px; }
}

/* Mid-size phones: purchase form stays a row */
@media (max-width: 480px) {
  .purchase-form .btn-sm { flex: 0 0 auto; }
}

/* ============== Field hint (?) badge ============== */
.hint-wrap { position: relative; display: inline-flex; align-items: center; gap: 4px; }
.hint-q {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.12); color: var(--accent);
  font-size: 11px; font-weight: 700; line-height: 16px; text-align: center;
  cursor: help; user-select: none; flex-shrink: 0;
}
.hint-tip {
  position: absolute; bottom: calc(100% + 6px); right: -8px;
  background: var(--fg); color: var(--surface);
  padding: 8px 10px; border-radius: 8px; font-size: 11px; line-height: 1.7;
  width: max-content; max-width: 240px; text-align: right;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 60;
  box-shadow: var(--shadow-modal);
}
.hint-wrap:hover .hint-tip, .hint-wrap:focus-within .hint-tip { opacity: 1; }

/* ============== Recipe card (product detail) ============== */
.recipe-list { list-style: none; margin: 0; padding: 0; counter-reset: rc; }
.recipe-list li {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.recipe-list li:last-child { border-bottom: none; }
.recipe-list li::before {
  counter-increment: rc; content: counter(rc);
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: rgba(var(--accent-rgb), 0.12); color: var(--accent);
  font-size: 11px; font-weight: 700; display: inline-flex;
  align-items: center; justify-content: center;
}
