/* ==============================================================================
   Kelec Web Design System
   Red brand (#c62828) · IRANYekanX · RTL-first · Light/Dark
   Hand-written semantic CSS. There is no utility-class build step: every class
   used by the templates must be defined in this file.
   ============================================================================== */

@import url('../fonts/iranyekan/fontiran.css');

/* ─────────────────────────────────────────────────────────────────────────────
   1. Tokens
   ───────────────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  --bg: #f6f6f9;
  --surface: #ffffff;
  --surface-2: #f1f2f7;
  --surface-3: #e8e9f1;
  --border: #e3e5ee;
  --border-strong: #cfd2e0;

  --text: #1d1e2c;
  --text-2: #55586b;
  --text-3: #8a8da0;

  --primary: #c62828;
  --primary-hover: #b02020;
  --primary-press: #961a1a;
  --primary-contrast: #ffffff;
  --primary-soft: rgba(198, 40, 40, 0.08);
  --primary-soft-2: rgba(198, 40, 40, 0.14);
  --primary-line: rgba(198, 40, 40, 0.28);

  --success: #0f9d6b;
  --success-soft: rgba(15, 157, 107, 0.12);
  --warning: #b86e00;
  --warning-soft: rgba(245, 158, 11, 0.16);
  --danger: #c62828;
  --danger-soft: rgba(198, 40, 40, 0.1);

  --header-bg: rgba(246, 246, 249, 0.86);
  --footer-bg: #17161b;
  --footer-text: rgba(255, 255, 255, 0.72);
  --footer-strong: #ffffff;
  --footer-line: rgba(255, 255, 255, 0.1);
  --overlay: rgba(14, 14, 20, 0.55);

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --control-h: 44px;
  --header-h: 68px;
  --sidebar-w: 264px;
  --content-w: 1200px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0f1015;
  --surface: #171821;
  --surface-2: #1e202b;
  --surface-3: #282a38;
  --border: #292b3a;
  --border-strong: #3a3d52;

  --text: #f1f2f8;
  --text-2: #b4b7c9;
  --text-3: #7e8197;

  --primary: #ef5350;
  --primary-hover: #e53935;
  --primary-press: #d32f2f;
  --primary-contrast: #ffffff;
  --primary-soft: rgba(239, 83, 80, 0.1);
  --primary-soft-2: rgba(239, 83, 80, 0.18);
  --primary-line: rgba(239, 83, 80, 0.32);

  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.13);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);

  --header-bg: rgba(15, 16, 21, 0.86);
  --footer-bg: #0a0a0e;
  --overlay: rgba(0, 0, 0, 0.66);
}

/* ─────────────────────────────────────────────────────────────────────────────
   2. Base
   ───────────────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: 'IRANYekanX', 'IRANYekan', Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  font-feature-settings: 'ss01' 1;
  overflow-x: clip;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

body.is-locked { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}

img, svg { max-width: 100%; }
code { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: 0.85em; direction: ltr; unicode-bidi: embed; }

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

::selection { background: var(--primary-soft-2); }

[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.ltr { direction: ltr; unicode-bidi: embed; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; direction: ltr; unicode-bidi: embed; }

.icon { width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }
.lucide { flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   3. Layout primitives
   ───────────────────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-w);
  margin-inline: auto;
  padding-inline: 20px;
}
.container-narrow { max-width: 820px; }
.container-form { max-width: 720px; }

.section { padding-block: 72px; }
.section-sm { padding-block: 48px; }
.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.stack > * + * { margin-top: var(--stack, 16px); }
.stack-sm { --stack: 8px; }
.stack-lg { --stack: 28px; }

.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-wrap { flex-wrap: wrap; }
.grow { flex: 1 1 0; min-width: 0; }

.grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   4. Typography helpers
   ───────────────────────────────────────────────────────────────────────────── */
.display { font-size: clamp(2rem, 4.6vw + 0.4rem, 3.6rem); line-height: 1.25; font-weight: 900; letter-spacing: -0.02em; }
.h1 { font-size: clamp(1.7rem, 2.6vw + 0.6rem, 2.5rem); line-height: 1.3; font-weight: 900; letter-spacing: -0.015em; }
.h2 { font-size: clamp(1.35rem, 1.6vw + 0.7rem, 1.9rem); line-height: 1.35; font-weight: 800; }
.h3 { font-size: 1.15rem; line-height: 1.5; font-weight: 800; }
.lead { font-size: clamp(1rem, 0.5vw + 0.9rem, 1.2rem); line-height: 1.95; color: var(--text-2); }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: 0.85rem; }
.xs { font-size: 0.75rem; }
.strong { font-weight: 800; }
.accent { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.center { text-align: center; }
.balance { text-wrap: balance; }

.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head.center { margin-inline: auto; }
.section-head .h2 { margin-top: 12px; }
.section-head .lead { margin-top: 12px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border: 1px solid var(--primary-line);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.6;
}

/* ─────────────────────────────────────────────────────────────────────────────
   5. Buttons & icon buttons
   ───────────────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-h);
  padding: 0 20px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-contrast);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.12s var(--ease);
}
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn:active { background: var(--primary-press); border-color: var(--primary-press); transform: scale(0.985); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary); }
.btn-secondary:active { background: var(--surface-3); border-color: var(--primary); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }
.btn-ghost:active { background: var(--surface-3); border-color: transparent; }

.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.8rem; border-radius: var(--radius-xs); }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 1rem; border-radius: var(--radius); }
.btn-block { display: flex; width: 100%; }

.btn .icon { transition: transform 0.18s var(--ease); }
.btn:hover .icon-nudge { transform: translateX(-3px); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--surface-2); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.88rem;
}
.link-arrow:hover { gap: 10px; }
.link-back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 0.85rem; font-weight: 700; }
.link-back:hover { color: var(--primary); }

/* Theme icon swap — driven purely by CSS */
.theme-toggle .i-sun { display: none; }
html[data-theme="dark"] .theme-toggle .i-sun { display: inline-block; }
html[data-theme="dark"] .theme-toggle .i-moon { display: none; }

/* ─────────────────────────────────────────────────────────────────────────────
   6. Cards, badges, alerts
   ───────────────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card-flat { background: var(--surface-2); }
.card-pad-lg { padding: 36px; }
.card-accent { background: var(--primary-soft); border-color: var(--primary-line); }
.card-title { font-size: 1.05rem; font-weight: 800; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.card-head .card-title { margin: 0; }

.card-link {
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), background-color 0.18s var(--ease);
}
.card-link:hover { border-color: var(--primary-line); transform: translateY(-3px); }
.card-foot { margin-top: auto; padding-top: 18px; }

.icon-tile {
  display: inline-grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  color: var(--primary);
  margin-bottom: 16px;
  flex-shrink: 0;
}
.icon-tile .icon { width: 22px; height: 22px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 2px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-primary { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary); }
.badge-success { background: var(--success-soft); border-color: transparent; color: var(--success); }
.badge-warning { background: var(--warning-soft); border-color: transparent; color: var(--warning); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); display: inline-block; flex-shrink: 0; }
.dot-success { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot-danger { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.85rem; font-weight: 700; line-height: 1.7;
}
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(15, 157, 107, 0.25); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: var(--primary-line); }
.alert-info { background: var(--surface-2); color: var(--text-2); border-color: var(--border); font-weight: 600; }
.alert .icon { margin-top: 5px; }
[x-cloak] { display: none !important; }

.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 48px 20px; gap: 6px;
}
.empty .icon-tile { width: 64px; height: 64px; border-radius: 20px; margin-bottom: 12px; }
.empty .icon-tile .icon { width: 28px; height: 28px; }
.empty p { max-width: 440px; }

.kv { display: grid; gap: 0; }
.kv-row {
  display: flex; flex-direction: column; gap: 2px;
  padding-block: 14px;
  border-bottom: 1px solid var(--border);
}
.kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-row:first-child { padding-top: 0; }
.kv-row dt { color: var(--text-3); font-size: 0.82rem; font-weight: 700; }
.kv-row dd { margin: 0; font-weight: 800; }
@media (min-width: 640px) {
  .kv-row { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 24px; }
  .kv-row dd { text-align: left; }
}

.check-list li { display: flex; align-items: flex-start; gap: 10px; color: var(--text-2); font-size: 0.9rem; }
.check-list li + li { margin-top: 10px; }
.check-list .icon { color: var(--primary); margin-top: 5px; width: 16px; height: 16px; }

/* ─────────────────────────────────────────────────────────────────────────────
   7. Forms
   ───────────────────────────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; }
.field + .field, .form-grid + .field, .field + .form-grid { margin-top: 16px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .form-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.label { font-size: 0.82rem; font-weight: 800; color: var(--text-2); }
.hint { font-size: 0.75rem; color: var(--text-3); }

.input, .select, .textarea {
  width: 100%;
  min-height: var(--control-h);
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background-color 0.15s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft-2);
}
.textarea { min-height: 130px; resize: vertical; line-height: 1.8; }
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8da0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: left 12px center;
}
.input-ltr { direction: ltr; text-align: left; }
.input-otp { direction: ltr; text-align: center; font-size: 1.5rem; font-weight: 800; letter-spacing: 0.4em; min-height: 56px; }
.input-phone { direction: ltr; text-align: center; font-size: 1.15rem; font-weight: 800; letter-spacing: 0.12em; min-height: 54px; }

/* ─────────────────────────────────────────────────────────────────────────────
   8. Tables
   ───────────────────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table th {
  padding: 12px 16px;
  text-align: right;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table-empty { text-align: center; color: var(--text-3); padding: 32px 16px !important; }
.card > .table-wrap { border: 0; border-radius: 0; margin-inline: -24px; margin-bottom: -24px; width: calc(100% + 48px); border-top: 1px solid var(--border); border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }

/* ─────────────────────────────────────────────────────────────────────────────
   9. Public header & mobile drawer
   ───────────────────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.site-header .container { height: 100%; display: flex; align-items: center; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-logo { width: 40px; height: 40px; border-radius: 11px; object-fit: contain; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-name { font-size: 1.05rem; font-weight: 900; }
.brand-tag { font-size: 0.68rem; font-weight: 700; color: var(--text-3); }
@media (max-width: 420px) { .brand-tag { display: none; } }

.site-nav { display: none; align-items: center; gap: 2px; margin-inline: auto; }
.site-nav a { padding: 8px 14px; border-radius: var(--radius-xs); color: var(--text-2); font-size: 0.88rem; font-weight: 700; white-space: nowrap; }
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }

.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.menu-btn { display: inline-grid; }

@media (min-width: 1024px) {
  .site-nav { display: flex; }
  .header-actions { margin-inline-start: 0; }
  .menu-btn { display: none; }
}
@media (max-width: 480px) { .header-actions .btn .btn-label-long { display: none; } }
@media (min-width: 481px) { .header-actions .btn .btn-label-short { display: none; } }

.drawer { position: fixed; inset: 0; z-index: 60; visibility: hidden; pointer-events: none; }
.drawer.is-open { visibility: visible; pointer-events: auto; }
.drawer-backdrop { position: absolute; inset: 0; background: var(--overlay); opacity: 0; transition: opacity 0.25s var(--ease); }
.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; bottom: 0; right: 0;
  width: min(340px, 88vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
}
.drawer.is-open .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-nav { flex: 1; overflow-y: auto; padding: 12px; display: grid; gap: 2px; align-content: start; }
.drawer-foot { padding: 16px; border-top: 1px solid var(--border); }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.92rem; font-weight: 700;
}
.nav-item .icon { color: var(--text-3); transition: color 0.15s var(--ease); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover .icon { color: var(--primary); }
.nav-item[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.nav-item[aria-current="page"] .icon { color: var(--primary); }

/* ─────────────────────────────────────────────────────────────────────────────
   10. Footer
   ───────────────────────────────────────────────────────────────────────────── */
.site-footer { margin-top: auto; background: var(--footer-bg); color: var(--footer-text); padding-top: 56px; font-size: 0.88rem; }
.footer-grid { display: grid; gap: 36px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer-brand .brand-name { color: var(--footer-strong); }
.footer-brand .brand-tag { color: rgba(255, 255, 255, 0.5); }
.footer-brand p { margin-top: 16px; line-height: 1.95; font-size: 0.84rem; max-width: 340px; }
.footer-title { color: var(--footer-strong); font-weight: 800; font-size: 0.92rem; margin-bottom: 14px; }
.footer-links { display: grid; gap: 10px; }
.footer-links a { color: var(--footer-text); }
.footer-links a:hover { color: #fff; }
.footer-contact li { display: flex; align-items: flex-start; gap: 10px; }
.footer-contact .icon { margin-top: 5px; color: rgba(255, 255, 255, 0.45); width: 16px; height: 16px; }
.footer-bottom {
  margin-top: 48px; padding-block: 20px;
  border-top: 1px solid var(--footer-line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  font-size: 0.78rem; color: rgba(255, 255, 255, 0.5);
}

/* ─────────────────────────────────────────────────────────────────────────────
   11. Home hero
   ───────────────────────────────────────────────────────────────────────────── */
.hero { position: relative; padding-block: 56px 72px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 560px; z-index: -1;
  background:
    radial-gradient(60% 70% at 85% 0%, var(--primary-soft-2), transparent 70%),
    radial-gradient(40% 50% at 10% 20%, var(--primary-soft), transparent 70%);
}
.hero-grid { display: grid; gap: 48px; align-items: center; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .hero { padding-block: 88px 104px; } .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 64px; } }

.hero-copy .display { margin-top: 20px; }
.hero-copy .display em { font-style: normal; color: var(--primary); }
.hero-copy .lead { margin-top: 20px; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); }
.hero-trust li { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 0.82rem; font-weight: 700; }
.hero-trust .icon { color: var(--primary); }

/* Topology illustration (decorative) */
.topo {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  padding: 22px;
}
.topo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.topo-title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 0.92rem; }
.topo-title .icon-tile { width: 36px; height: 36px; border-radius: 11px; margin: 0; }
.topo-title .icon-tile .icon { width: 18px; height: 18px; }
.topo-body { padding-top: 18px; display: grid; gap: 10px; }
.topo-gw {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius);
  background: var(--primary-soft); border: 1px solid var(--primary-line);
}
.topo-gw .icon { color: var(--primary); }
.topo-gw strong { display: block; font-size: 0.9rem; }
.topo-gw span { font-size: 0.75rem; color: var(--text-2); }
.topo-area { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 12px 14px; }
.topo-area-name { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 800; }
.topo-area-name .icon { color: var(--text-3); width: 16px; height: 16px; }
.topo-items { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.topo-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.75rem; font-weight: 700; color: var(--text-2);
}
.topo-item .icon { width: 14px; height: 14px; color: var(--primary); }
.topo-note { margin-top: 14px; font-size: 0.74rem; color: var(--text-3); text-align: center; }

.stat-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
@media (min-width: 768px) { .stat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-strip > div { background: var(--surface); padding: 22px 20px; }
.stat-strip strong { display: block; font-size: 1.15rem; font-weight: 900; color: var(--text); }
.stat-strip span { font-size: 0.8rem; color: var(--text-2); }

.cta-band {
  border-radius: var(--radius-xl);
  border: 1px solid var(--primary-line);
  background: linear-gradient(135deg, var(--primary-soft-2), var(--primary-soft));
  padding: clamp(28px, 5vw, 56px);
  display: grid; gap: 24px; align-items: center;
}
@media (min-width: 900px) { .cta-band { grid-template-columns: 1fr auto; } }
.cta-band .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Page header (inner public pages) */
.page-head { padding-block: 56px 8px; }
.page-head .h1 { margin-top: 14px; }
.page-head .lead { margin-top: 14px; max-width: 720px; }

/* Process steps */
.steps { display: grid; gap: 16px; counter-reset: step; }
.step { position: relative; padding-inline-start: 56px; }
.step::before {
  counter-increment: step; content: counter(step, persian);
  position: absolute; inset-inline-start: 0; top: 0;
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--primary-line);
  color: var(--primary); font-weight: 900;
}

/* Prose */
.prose { color: var(--text-2); font-size: 1.02rem; line-height: 2.1; }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3 { color: var(--text); font-weight: 800; margin-top: 1.8em; }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

/* ─────────────────────────────────────────────────────────────────────────────
   12. Auth page
   ───────────────────────────────────────────────────────────────────────────── */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; }
.auth-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; max-width: 1100px; width: 100%; margin-inline: auto; }
.auth-main { display: grid; place-items: center; padding: 16px 20px 40px; position: relative; }
.auth-main::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(50% 50% at 50% 0%, var(--primary-soft-2), transparent 70%);
}
.auth-card { width: 100%; max-width: 440px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.auth-brand img { width: 56px; height: 56px; border-radius: 16px; }
.auth-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-top: 24px; color: var(--text-3); font-size: 0.78rem; font-weight: 700; }
.auth-trust li { display: flex; align-items: center; gap: 6px; }
.auth-trust .icon { color: var(--success); width: 15px; height: 15px; }
.auth-foot { text-align: center; padding: 16px 20px 24px; font-size: 0.75rem; color: var(--text-3); }
.dev-hint {
  margin-top: 20px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  font-size: 0.78rem; color: var(--text-2);
}
.dev-hint .row-between + .row-between { margin-top: 6px; }

/* ─────────────────────────────────────────────────────────────────────────────
   13. App shell (customer panel + admin) — sidebar
   ───────────────────────────────────────────────────────────────────────────── */
.app { min-height: 100vh; min-height: 100dvh; display: block; }
.sidebar {
  position: fixed; top: 0; bottom: 0; right: 0; z-index: 50;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
}
.sidebar.is-open { transform: translateX(0); }
.sidebar-head { height: var(--header-h); padding-inline: 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 16px 12px; }
.sidebar-group + .sidebar-group { margin-top: 22px; }
.sidebar-label { padding: 0 14px 8px; font-size: 0.7rem; font-weight: 800; color: var(--text-3); letter-spacing: 0.02em; }
.sidebar-nav { display: grid; gap: 2px; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); display: grid; gap: 12px; flex-shrink: 0; }
.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); border: 1px solid var(--primary-line); color: var(--primary); flex-shrink: 0; }
.user-chip strong { display: block; font-size: 0.85rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip span { display: block; font-size: 0.72rem; color: var(--text-3); }

.sidebar-scrim { position: fixed; inset: 0; z-index: 45; background: var(--overlay); opacity: 0; visibility: hidden; transition: opacity 0.25s var(--ease), visibility 0.25s; }
.sidebar-scrim.is-open { opacity: 1; visibility: visible; }

.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.app-topbar {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  display: flex; align-items: center; gap: 12px; padding-inline: 20px;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--border);
}
.app-topbar-title { font-weight: 800; font-size: 0.98rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-topbar .header-actions { margin-inline-start: auto; }
.app-content { padding: 28px 20px 56px; width: 100%; max-width: 1120px; margin-inline: auto; }

@media (min-width: 1024px) {
  .app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; transform: none; z-index: 20; grid-column: 1; }
  .app-main { grid-column: 2; }
  .sidebar-scrim { display: none; }
  .sidebar-close, .app-menu-btn { display: none; }
  .app-content { padding: 36px 36px 64px; }
  .app-topbar { padding-inline: 36px; }
}

.page-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.page-title .h1 { font-size: clamp(1.5rem, 1.8vw + 0.8rem, 2rem); }
.page-title p { margin-top: 6px; }
.page-title .eyebrow { margin-bottom: 10px; }

.metric { display: flex; flex-direction: column; gap: 4px; }
.metric-label { font-size: 0.8rem; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.metric-label .icon { color: var(--primary); }
.metric-value { font-size: 2rem; font-weight: 900; line-height: 1.3; }

/* Tabs */
.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow-x: auto; margin-bottom: 24px; -webkit-overflow-scrolling: touch; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  padding: 9px 16px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2); font-size: 0.86rem; font-weight: 800; cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab[aria-selected="true"] { background: var(--primary); color: var(--primary-contrast); }

/* Area tree */
.tree { display: grid; gap: 8px; }
.tree-node {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2);
}
.tree-node .name { font-weight: 800; }

.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.list-row + .list-row { margin-top: 10px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; padding: 20px; background: var(--overlay); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal.is-open { display: flex; }
.modal-card { width: 100%; max-width: 460px; max-height: calc(100dvh - 40px); overflow-y: auto; }

/* Shop */
.price { font-size: 1.2rem; font-weight: 900; color: var(--primary); }
.price small { font-size: 0.72rem; font-weight: 700; color: var(--text-3); margin-inline-start: 4px; }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; font-size: 0.75rem; color: var(--text-3); font-weight: 700; }
.product-meta span:last-child { display: inline-flex; align-items: center; gap: 4px; }
.product-meta .icon { color: var(--success); width: 14px; height: 14px; }
.cart-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; border-bottom: 1px solid var(--border); }
.cart-line:first-child { padding-top: 0; }
.cart-line:last-child { border-bottom: 0; padding-bottom: 0; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); font-size: 0.9rem; }
.summary-row + .summary-row { margin-top: 12px; }
.summary-total { display: flex; justify-content: space-between; gap: 12px; margin-block: 16px 20px; padding-top: 16px; border-top: 1px solid var(--border); font-weight: 900; font-size: 1.1rem; }
.summary-total span:last-child { color: var(--primary); }

/* Toast */
.toast-host { position: fixed; bottom: 20px; left: 20px; z-index: 90; display: grid; gap: 8px; }
.toast { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); font-size: 0.85rem; font-weight: 700; animation: toast-in 0.25s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Utilities that templates actually use */
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.w-full { width: 100%; }
.shrink-0 { flex-shrink: 0; }
.no-wrap { white-space: nowrap; }
.inline-form { display: inline; }
