/* ==========================================================================
   MenuCraft admin panel — design system
   Fixed dark theme; the per-venue theming lives in menu.css instead.
   ========================================================================== */

:root {
  /* palette */
  --bg:         #0a0b10;
  --bg-2:       #0e1018;
  --surface:    #14161f;
  --surface-2:  #1a1d28;
  --surface-3:  #212533;
  --line:       #262a38;
  --line-soft:  #1d2130;

  --text:       #f2f4f9;
  --text-2:     #a8afc4;
  --text-3:     #6f778e;

  --brand:      #f0b23f;
  --brand-2:    #ff8a5b;
  --brand-ink:  #241a06;
  --accent:     #7c8cff;
  --ok:         #38d39f;
  --warn:       #f5a623;
  --danger:     #ff5d6c;

  /* shape */
  --r-sm: 10px;
  --r:    16px;
  --r-lg: 22px;
  --r-xl: 30px;

  --sh-1: 0 1px 2px rgb(0 0 0 / .3);
  --sh-2: 0 8px 24px rgb(0 0 0 / .32);
  --sh-3: 0 20px 60px rgb(0 0 0 / .45);
  --glow: 0 0 0 1px rgb(240 178 63 / .28), 0 12px 40px rgb(240 178 63 / .14);

  --ease: cubic-bezier(.32, .72, 0, 1);
  --fast: 160ms var(--ease);
  --med:  280ms var(--ease);

  --sidebar-w: 268px;

  --font-fa: "Vazirmatn", "Vazir", "IRANSans", Tahoma, "Segoe UI", sans-serif;
  --font-en: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-fa);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-ltr { font-family: var(--font-en); line-height: 1.65; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem); }
h2 { font-size: clamp(1.1rem, .95rem + .6vw, 1.4rem); }
h3 { font-size: 1.02rem; }
p  { margin: 0; }

.muted { color: var(--text-2); font-size: .92rem; }
code { font-family: var(--font-mono); font-size: .88em; }

::selection { background: rgb(240 178 63 / .28); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: fixed; inset-inline-start: -9999px; top: 12px; z-index: 200;
  background: var(--brand); color: var(--brand-ink);
  padding: 10px 18px; border-radius: var(--r-sm); font-weight: 700;
}
.skip-link:focus { inset-inline-start: 12px; }

/* ==========================================================================
   Layout shell
   ========================================================================== */

.shell { display: flex; min-height: 100dvh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-inline-end: 1px solid var(--line-soft);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  z-index: 60;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 0; }

.brand-mark {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  font-size: 20px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--sh-2);
}

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 1.02rem; font-weight: 800; }
.brand-text span {
  font-size: .78rem; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-weight: 600; font-size: .94rem;
  transition: background var(--fast), color var(--fast), transform var(--fast);
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:active { transform: scale(.985); }

.nav-item.is-active {
  background: linear-gradient(90deg, rgb(240 178 63 / .16), rgb(240 178 63 / .04));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgb(240 178 63 / .22);
}
.nav-item.is-active .nav-ico { color: var(--brand); }

.nav-ico { width: 20px; text-align: center; color: var(--text-3); font-size: 1.05rem; }

.sidebar-foot { display: flex; flex-direction: column; gap: 10px; }

.lang-switch {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: 999px;
}
.lang-switch a {
  flex: 1; text-align: center; padding: 6px 10px;
  border-radius: 999px; font-size: .85rem; font-weight: 600;
  color: var(--text-3); transition: all var(--fast);
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a.is-active { background: var(--surface-3); color: var(--text); }

.logout-form { margin: 0; }

.content {
  flex: 1; min-width: 0;
  padding: 30px clamp(16px, 3vw, 40px) 80px;
  display: flex; flex-direction: column; gap: 26px;
}

.nav-toggle {
  display: none;
  position: fixed; top: 14px; inset-inline-start: 14px; z-index: 120;
  width: 44px; height: 44px;
  border: 1px solid var(--line); border-radius: 13px;
  background: rgb(20 22 31 / .92);
  backdrop-filter: blur(12px);
  cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; }

.sidebar-scrim {
  position: fixed; inset: 0; z-index: 55;
  background: rgb(0 0 0 / .6); backdrop-filter: blur(3px);
}

/* ==========================================================================
   Page furniture
   ========================================================================== */

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.page-head-tight { margin-bottom: 6px; }

.section-title { margin-bottom: 12px; font-size: 1.05rem; font-weight: 700; }

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: clamp(16px, 2vw, 24px);
  box-shadow: var(--sh-1);
}

.stack    { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; margin: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.field-span { grid-column: 1 / -1; }
.field-mid { display: flex; align-items: flex-end; }

.badge {
  padding: 5px 13px; border-radius: 999px;
  font-size: .8rem; font-weight: 700;
  background: var(--surface-3); color: var(--text-2);
}
.badge-ok   { background: rgb(56 211 159 / .14); color: var(--ok); }
.badge-warn { background: rgb(245 166 35 / .14); color: var(--warn); }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 700; font-size: .9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--fast), background var(--fast), box-shadow var(--fast), opacity var(--fast);
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary {
  --btn-bg: linear-gradient(135deg, var(--brand), var(--brand-2));
  --btn-fg: var(--brand-ink);
  box-shadow: var(--sh-2);
}
.btn-primary:hover { box-shadow: var(--glow); }

.btn-ghost { --btn-bg: transparent; border-color: var(--line); }
.btn-ghost:hover { --btn-bg: var(--surface-2); }

.btn-quiet { --btn-bg: var(--surface-2); border-color: var(--line-soft); }
.btn-quiet:hover { --btn-bg: var(--surface-3); }

.btn-danger { --btn-bg: transparent; --btn-fg: var(--danger); border-color: rgb(255 93 108 / .3); }
.btn-danger:hover { --btn-bg: rgb(255 93 108 / .12); }

.btn-block { width: 100%; }
.btn-lg { padding: 13px 26px; font-size: .98rem; }
.btn-sm { padding: 6px 13px; font-size: .82rem; }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.field-label {
  font-size: .84rem; font-weight: 700; color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
.field-label em { font-style: normal; font-weight: 500; color: var(--text-3); font-size: .92em; }

input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="time"], input[type="number"],
textarea, select, .input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font: inherit; font-size: .93rem;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}

input:hover, textarea:hover, select:hover { border-color: var(--line); background: var(--surface); }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgb(240 178 63 / .14);
}

textarea { resize: vertical; min-height: 68px; line-height: 1.7; }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
                    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: right 16px center, right 11px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 34px;
}
.is-rtl select { background-position: left 11px center, left 16px center; }
.is-rtl select {
  background-image: linear-gradient(135deg, transparent 50%, var(--text-3) 50%),
                    linear-gradient(45deg, var(--text-3) 50%, transparent 50%);
  padding-inline-end: 14px; padding-inline-start: 34px;
}

.input-sm { padding: 7px 10px; font-size: .86rem; }
.emoji-input { font-size: 1.3rem; text-align: center; max-width: 96px; }

.hint { color: var(--text-3); font-size: .78rem; line-height: 1.6; }

.field-error-box {
  padding: 11px 15px;
  background: rgb(255 93 108 / .1);
  border: 1px solid rgb(255 93 108 / .3);
  border-radius: var(--r-sm);
  color: #ffb4bc; font-size: .88rem; font-weight: 600;
}

/* toggles */
.toggle {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none; padding: 4px 0;
}
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-track {
  width: 42px; height: 24px; flex: none;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  position: relative;
  transition: background var(--fast), border-color var(--fast);
}
.toggle-dot {
  position: absolute; top: 2px; inset-inline-start: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-3);
  transition: transform var(--fast), background var(--fast);
}
.toggle input:checked + .toggle-track {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
}
.toggle input:checked + .toggle-track .toggle-dot {
  background: var(--brand-ink);
  transform: translateX(18px);
}
.is-rtl .toggle input:checked + .toggle-track .toggle-dot { transform: translateX(-18px); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px rgb(240 178 63 / .22); }
.toggle-text { font-size: .89rem; font-weight: 600; color: var(--text-2); }
.toggle input:checked ~ .toggle-text { color: var(--text); }

.toggle-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px;
}

/* chips (radio / checkbox pills) */
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }

.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  font-size: .86rem; font-weight: 600; color: var(--text-2);
  transition: all var(--fast);
}
.chip:hover span { border-color: var(--text-3); color: var(--text); }
.chip input:checked + span {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent; color: var(--brand-ink);
  box-shadow: var(--sh-1);
}
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgb(240 178 63 / .22); }

/* segmented control */
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px;
}
.seg-opt { cursor: pointer; flex: 1 1 auto; }
.seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg-opt span {
  display: block; text-align: center;
  padding: 7px 14px; border-radius: 999px;
  font-size: .83rem; font-weight: 700; color: var(--text-3);
  transition: all var(--fast); white-space: nowrap;
}
.seg-opt:hover span { color: var(--text); }
.seg-opt input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: var(--sh-1); }
.seg-opt input:focus-visible + span { box-shadow: 0 0 0 2px var(--brand); }
.seg-sm .seg-opt span { padding: 5px 11px; font-size: .78rem; }

/* range */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; padding: 0;
  background: var(--surface-3);
  border: none; border-radius: 999px;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--sh-1);
  transition: transform var(--fast);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border: none; border-radius: 50%;
  background: var(--brand);
}
input[type="range"]:focus { box-shadow: 0 0 0 3px rgb(240 178 63 / .18); }

/* colour input */
.color-row { display: flex; gap: 8px; align-items: center; }
input[type="color"] {
  width: 46px; height: 40px; flex: none; padding: 3px;
  background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 7px; }
.color-hex { font-family: var(--font-mono); font-size: .82rem !important; text-transform: uppercase; }

/* ==========================================================================
   Flash & toasts
   ========================================================================== */

.flash {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 18px;
  border-radius: var(--r);
  font-weight: 600; font-size: .9rem;
  border: 1px solid var(--line);
  background: var(--surface);
  animation: slide-in var(--med);
}
.flash-success { background: rgb(56 211 159 / .1); border-color: rgb(56 211 159 / .3); color: #8ff0cd; }
.flash-error   { background: rgb(255 93 108 / .1); border-color: rgb(255 93 108 / .3); color: #ffb4bc; }
.flash-info    { background: rgb(124 140 255 / .1); border-color: rgb(124 140 255 / .3); color: #b8c1ff; }
.flash-x { background: none; border: none; font-size: 1.3rem; cursor: pointer; opacity: .6; line-height: 1; }
.flash-x:hover { opacity: 1; }

@keyframes slide-in { from { opacity: 0; transform: translateY(-8px); } }

.toast-host {
  position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  padding: 12px 20px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: var(--sh-3); font-size: .88rem; font-weight: 600;
  animation: slide-in var(--med);
}
.toast-ok  { border-color: rgb(56 211 159 / .4); color: #8ff0cd; }
.toast-err { border-color: rgb(255 93 108 / .4); color: #ffb4bc; }

/* ==========================================================================
   Dashboard
   ========================================================================== */

.link-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.link-card-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.link-card-actions { display: flex; gap: 8px; }

.menu-link {
  display: inline-block;
  padding: 8px 14px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--brand); font-family: var(--font-mono); font-size: .86rem;
  word-break: break-all;
}

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }

.stat {
  background: linear-gradient(160deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 2px;
  position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; inset-inline-end: -30px; top: -30px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgb(240 178 63 / .16), transparent 70%);
}
.stat-n { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat-l { font-size: .84rem; color: var(--text-3); font-weight: 600; }

.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }

.quick {
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  transition: transform var(--fast), border-color var(--fast), box-shadow var(--fast);
}
.quick:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: var(--sh-2); }
.quick-ico { font-size: 1.4rem; color: var(--brand); }
.quick strong { font-size: .98rem; }
.quick small { color: var(--text-3); font-size: .8rem; line-height: 1.55; }
.quick-accent { border-color: rgb(240 178 63 / .3); background: linear-gradient(160deg, rgb(240 178 63 / .07), var(--surface)); }

.empty-state { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 44px 24px; }
.empty-ico { font-size: 2.6rem; opacity: .5; }

.cat-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: 999px; font-size: .86rem;
}
.cat-chip.is-off { opacity: .45; }
.cat-chip-count { color: var(--text-3); font-size: .78rem; }

/* ==========================================================================
   Menu manager
   ========================================================================== */

.cat-list { display: flex; flex-direction: column; gap: 16px; }

.cat { padding: 0; overflow: hidden; }

.cat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(90deg, var(--surface-2), transparent);
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.cat-ico { font-size: 1.3rem; }
.cat-titles { display: flex; flex-direction: column; flex: 1; min-width: 120px; }
.cat-titles small { font-size: .78rem; }
.cat-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cat-empty { padding: 20px 18px; }

.drag { cursor: grab; color: var(--text-3); font-size: 1.1rem; user-select: none; }
.drag:active { cursor: grabbing; }

.item-list { list-style: none; margin: 0; padding: 0; }

.item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  transition: background var(--fast);
}
.item:last-child { border-bottom: none; }
.item:hover { background: var(--surface-2); }
.item.is-off { opacity: .5; }
.item.dragging { opacity: .4; background: var(--surface-3); }

.item-thumb {
  width: 52px; height: 52px; flex: none;
  border-radius: 12px; overflow: hidden;
  background: var(--surface-3);
  display: grid; place-items: center;
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-thumb i { font-style: normal; opacity: .35; }

.item-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.item-main strong { font-size: .95rem; }
.item-main small { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tag-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
.tag {
  padding: 2px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2);
  font-size: .72rem; font-weight: 600;
}

.item-price { text-align: end; font-size: .9rem; white-space: nowrap; display: flex; flex-direction: column; }
.item-price s { font-size: .78rem; }
.item-price strong { color: var(--brand); }

.item-actions { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tpl {
  display: flex; flex-direction: column; gap: 5px; align-items: flex-start;
  padding: 16px;
  background: var(--bg-2); border: 1px solid var(--line-soft);
  border-radius: var(--r);
  transition: border-color var(--fast), transform var(--fast);
}
.tpl:hover { border-color: var(--brand); transform: translateY(-2px); }
.tpl-ico { font-size: 1.5rem; }
.tpl strong { font-size: .92rem; }
.tpl small { font-size: .76rem; line-height: 1.5; flex: 1; }
.tpl button { margin-top: 6px; }

/* ==========================================================================
   Modal / dialog
   ========================================================================== */

.modal, .picker {
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: min(620px, calc(100vw - 32px));
  max-height: min(88dvh, 900px);
  box-shadow: var(--sh-3);
  overflow: hidden;
}
.modal-lg { width: min(760px, calc(100vw - 32px)); }

.modal::backdrop, .picker::backdrop {
  background: rgb(4 5 9 / .72);
  backdrop-filter: blur(6px);
}

.modal[open], .picker[open] { animation: pop var(--med); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.modal-form { display: flex; flex-direction: column; max-height: inherit; margin: 0; }

.modal-head, .picker-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
  margin: 0;
}
.modal-head strong, .picker-head strong { font-size: 1rem; }

.picker-x {
  width: 32px; height: 32px; flex: none;
  border: none; border-radius: 9px;
  background: var(--surface-3); color: var(--text-2);
  font-size: 1.2rem; line-height: 1; cursor: pointer;
  transition: all var(--fast);
}
.picker-x:hover { background: var(--danger); color: #fff; }

.modal-body {
  padding: 22px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 15px;
}

.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-2);
}

/* media picker */
.picker { width: min(720px, calc(100vw - 32px)); }
.picker-upload { padding: 18px 22px 0; }
.picker-grid {
  padding: 18px 22px 22px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px;
  overflow-y: auto; max-height: 46dvh;
}
.picker-empty { grid-column: 1 / -1; text-align: center; padding: 26px; }

.picker-item {
  aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden;
  border: 2px solid transparent; background: var(--bg-2);
  cursor: pointer; padding: 0;
  transition: border-color var(--fast), transform var(--fast);
}
.picker-item:hover { border-color: var(--brand); transform: scale(1.04); }
.picker-item img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   Uploads & media
   ========================================================================== */

.upload-form { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 30px 20px;
  border: 2px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-2);
  cursor: pointer; text-align: center;
  transition: border-color var(--fast), background var(--fast);
}
.drop:hover, .drop.is-over { border-color: var(--brand); background: rgb(240 178 63 / .05); }
.drop-ico { font-size: 1.7rem; color: var(--brand); }
.drop-text { font-weight: 700; font-size: .92rem; }
.drop small { color: var(--text-3); font-size: .78rem; }
.drop-progress { padding: 10px 0; color: var(--brand); font-weight: 600; font-size: .88rem; }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }

.media-cell {
  margin: 0; border-radius: var(--r);
  overflow: hidden; background: var(--surface);
  border: 1px solid var(--line-soft);
}
.media-cell img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.media-cell figcaption {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px;
}
.media-name {
  font-size: .76rem; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.img-pick { display: flex; flex-direction: column; gap: 8px; }
.img-pick-preview {
  width: 100%; aspect-ratio: 1 / 1; max-width: 130px;
  border-radius: var(--r); overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--line);
}
.img-pick-wide { aspect-ratio: 16 / 9; max-width: 100%; }
.img-pick-preview img { width: 100%; height: 100%; object-fit: cover; }
.img-pick-preview.is-empty::after {
  content: "🖼"; display: grid; place-items: center; height: 100%;
  opacity: .28; font-size: 1.6rem;
}
.img-pick-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ==========================================================================
   Settings extras
   ========================================================================== */

.hours { display: flex; flex-direction: column; gap: 8px; }
.hour-row {
  display: grid;
  grid-template-columns: 96px 1fr auto 1fr auto;
  align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--bg-2); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.hour-day { font-weight: 700; font-size: .86rem; }
.hour-sep { color: var(--text-3); }

.qr-row { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.qr-img { border-radius: var(--r); background: #fff; padding: 12px; }

.sticky-actions {
  position: sticky; bottom: 14px; z-index: 20;
  display: flex; justify-content: flex-end;
  padding: 10px;
  background: rgb(10 11 16 / .82);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

/* ==========================================================================
   Theme editor
   ========================================================================== */

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.editor-controls { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.sect {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.sect > summary {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 20px;
  font-weight: 700; font-size: .95rem;
  cursor: pointer; list-style: none;
  transition: background var(--fast);
}
.sect > summary::-webkit-details-marker { display: none; }
.sect > summary::after {
  content: "▾"; margin-inline-start: auto;
  color: var(--text-3); transition: transform var(--fast);
}
.sect[open] > summary::after { transform: rotate(180deg); }
.sect > summary:hover { background: var(--surface-2); }
.sect-ico { font-size: 1.05rem; }

.sect-body {
  padding: 6px 20px 20px;
  display: flex; flex-direction: column; gap: 15px;
  border-top: 1px solid var(--line-soft);
}
.sect-body.grid-2 { display: grid; }

.ctl { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ctl-label { font-size: .83rem; font-weight: 700; color: var(--text-2); }
.ctl-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ctl-out {
  font-family: var(--font-mono); font-size: .78rem;
  color: var(--brand); background: var(--bg-2);
  padding: 2px 9px; border-radius: 6px; min-width: 46px; text-align: center;
}
.ctl-seg { gap: 9px; }

.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }

.preset {
  display: flex; flex-direction: column; gap: 5px; align-items: stretch;
  padding: 12px;
  background: var(--bg-2);
  border: 2px solid var(--line-soft);
  border-radius: var(--r);
  cursor: pointer; text-align: start;
  transition: all var(--fast);
}
.preset:hover { border-color: var(--text-3); transform: translateY(-2px); }
.preset.is-active { border-color: var(--brand); box-shadow: var(--glow); }
.preset strong { font-size: .86rem; }
.preset small { font-size: .72rem; color: var(--text-3); line-height: 1.45; }

.preset-strip { display: flex; height: 26px; border-radius: 8px; overflow: hidden; }
.preset-strip i { flex: 1; }

.editor-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  position: sticky; bottom: 14px; z-index: 20;
  padding: 12px;
  background: rgb(10 11 16 / .86);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
}
.editor-actions .btn:first-child { flex: 1; }

.editor-preview {
  position: sticky; top: 22px;
  display: flex; flex-direction: column; gap: 12px;
  height: calc(100dvh - 60px);
}

.preview-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.preview-title { font-weight: 700; font-size: .9rem; }

.preview-stage {
  flex: 1; min-height: 0;
  display: grid; place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at 30% 20%, rgb(124 140 255 / .09), transparent 60%),
    var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.preview-stage iframe {
  border: none;
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--sh-3);
  transition: width var(--med), height var(--med);
  height: 100%;
}
.preview-stage[data-stage="mobile"]  iframe { width: 390px; max-width: 100%; }
.preview-stage[data-stage="tablet"]  iframe { width: 768px; max-width: 100%; }
.preview-stage[data-stage="desktop"] iframe { width: 100%; border-radius: 12px; }

/* ==========================================================================
   Auth pages
   ========================================================================== */

.auth-body { display: grid; place-items: center; padding: 40px 18px; position: relative; overflow-x: hidden; }

.auth-aurora, .land-aurora { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.auth-aurora span, .land-aurora span {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .3;
}
.auth-aurora span:nth-child(1), .land-aurora span:nth-child(1) {
  width: 460px; height: 460px; background: var(--brand);
  top: -160px; inset-inline-start: -120px;
}
.auth-aurora span:nth-child(2), .land-aurora span:nth-child(2) {
  width: 400px; height: 400px; background: var(--accent);
  bottom: -140px; inset-inline-end: -100px;
}
.auth-aurora span:nth-child(3), .land-aurora span:nth-child(3) {
  width: 320px; height: 320px; background: var(--brand-2);
  top: 45%; inset-inline-start: 55%; opacity: .16;
}

.auth-wrap {
  position: relative; z-index: 1;
  width: 100%; max-width: 460px;
  display: flex; flex-direction: column; gap: 20px; align-items: center;
}

.auth-brand { display: inline-flex; align-items: center; gap: 11px; font-size: 1.15rem; font-weight: 800; }

.auth-card {
  width: 100%;
  background: rgb(20 22 31 / .82);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(22px, 4vw, 36px);
  box-shadow: var(--sh-3);
  display: flex; flex-direction: column; gap: 14px;
}
.auth-card-wide { max-width: 560px; }
.auth-card-center { text-align: center; align-items: center; }

.auth-alt { text-align: center; font-size: .88rem; color: var(--text-2); }
.auth-alt a { color: var(--brand); font-weight: 700; }

.auth-langs { display: flex; gap: 14px; font-size: .85rem; }
.auth-langs a { color: var(--text-3); }
.auth-langs a.is-active { color: var(--brand); font-weight: 700; }

.err-code {
  font-size: 3.6rem; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* full-width auth cards need a matching wrapper */
.auth-body .auth-wrap:has(.auth-card-wide) { max-width: 560px; }

/* ==========================================================================
   Landing page
   ========================================================================== */

.landing-body { overflow-x: hidden; }

.land-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 18px clamp(16px, 4vw, 48px);
  position: sticky; top: 0; z-index: 50;
  background: rgb(10 11 16 / .8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}
.land-nav-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.land { position: relative; }

.land-hero {
  position: relative;
  display: grid; grid-template-columns: 1.05fr .95fr;
  align-items: center; gap: 40px;
  padding: clamp(46px, 7vw, 96px) clamp(16px, 4vw, 48px);
  max-width: 1240px; margin: 0 auto;
}
.land-hero-inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.land-hero h1 { font-size: clamp(1.9rem, 1.2rem + 2.8vw, 3.3rem); line-height: 1.22; }
.land-hero p { color: var(--text-2); font-size: 1.03rem; max-width: 52ch; }

.pill {
  padding: 6px 15px; border-radius: 999px;
  background: rgb(240 178 63 / .13);
  border: 1px solid rgb(240 178 63 / .28);
  color: var(--brand); font-size: .8rem; font-weight: 700;
}

.land-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.land-cta-center { justify-content: center; margin-top: 26px; }

/* phone mock */
.land-mock { position: relative; z-index: 1; display: grid; place-items: center; }
.mock-phone {
  width: 268px; aspect-ratio: 9 / 18.5;
  background: linear-gradient(165deg, #171a24, #0d0f16);
  border: 8px solid #23262f;
  border-radius: 40px;
  box-shadow: var(--sh-3);
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  overflow: hidden;
  transform: rotate(-4deg);
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 50% { transform: rotate(-4deg) translateY(-12px); } }

.mock-bar { display: flex; gap: 4px; justify-content: center; }
.mock-bar i { width: 4px; height: 4px; border-radius: 50%; background: #3a3f4e; }
.mock-cover {
  height: 74px; border-radius: 14px;
  background: linear-gradient(120deg, var(--brand), var(--brand-2), var(--accent));
}
.mock-logo {
  width: 44px; height: 44px; border-radius: 50%; margin: -32px auto 0;
  background: #2a2e3b; border: 3px solid #14161f;
}
.mock-tabs { display: flex; gap: 5px; }
.mock-tabs b { height: 17px; flex: 1; border-radius: 999px; background: #22262f; }
.mock-tabs b:first-child { background: var(--brand); }
.mock-cards { display: flex; flex-direction: column; gap: 7px; }
.mock-card { display: flex; gap: 7px; padding: 7px; background: #191c25; border-radius: 12px; }
.mock-img { width: 38px; height: 38px; border-radius: 8px; background: #262a36; flex: none; }
.mock-lines { display: flex; flex-direction: column; gap: 5px; justify-content: center; flex: 1; }
.mock-lines i { height: 6px; border-radius: 4px; background: #2c3140; }
.mock-lines i:last-child { width: 52%; background: rgb(240 178 63 / .5); }

.land-section {
  max-width: 1180px; margin: 0 auto;
  padding: clamp(36px, 5vw, 68px) clamp(16px, 4vw, 48px);
}
.land-section .section-title { text-align: center; margin-bottom: 28px; font-size: clamp(1.3rem, 1rem + 1.1vw, 1.9rem); }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feature {
  padding: 24px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column; gap: 8px;
  transition: transform var(--fast), border-color var(--fast);
}
.feature:hover { transform: translateY(-4px); border-color: rgb(240 178 63 / .34); }
.feature-ico { font-size: 1.8rem; }
.feature p { color: var(--text-2); font-size: .9rem; line-height: 1.7; }

.swatch-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.swatch-card {
  padding: 12px; background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: var(--r);
  display: flex; flex-direction: column; gap: 5px;
}
.swatch-strip { display: flex; height: 40px; border-radius: 10px; overflow: hidden; }
.swatch-strip span { flex: 1; }
.swatch-card strong { font-size: .88rem; }
.swatch-card small { font-size: .74rem; color: var(--text-3); line-height: 1.5; }

.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px;
}
.steps li {
  padding: 24px; background: var(--surface);
  border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  display: flex; flex-direction: column; gap: 8px;
}
.step-n {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--brand-ink);
}
.steps p { color: var(--text-2); font-size: .9rem; line-height: 1.7; }

.land-foot {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  padding: 34px 20px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-3); font-size: .86rem;
}
.land-foot .dot { opacity: .5; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .editor-preview { position: static; height: 620px; }
  .land-hero { grid-template-columns: 1fr; }
  .land-mock { order: -1; }
  .mock-phone { width: 220px; }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .sidebar {
    position: fixed; inset-block: 0; inset-inline-start: 0;
    transform: translateX(-102%);
    transition: transform var(--med);
    box-shadow: var(--sh-3);
  }
  .is-rtl .sidebar { transform: translateX(102%); }
  .sidebar.is-open { transform: translateX(0); }

  .content { padding-top: 70px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hour-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hour-day { grid-column: 1 / -1; }
  .hour-sep { display: none; }
}

@media (max-width: 620px) {
  .item { flex-wrap: wrap; }
  .item-main { flex-basis: calc(100% - 130px); }
  .item-actions { flex-basis: 100%; justify-content: flex-end; }
  .item-price { text-align: start; flex-direction: row; gap: 6px; align-items: baseline; }
  .page-head { flex-direction: column; align-items: stretch; }
  .toast-host { inset-inline: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
