/* =====================================================================
   Najdat Al-Sayarat - Design system
   تم شب (پیش‌فرض، زمینه #000) و روز؛ RTL/LTR با خصوصیات منطقی CSS
   ===================================================================== */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #0e0e0e;
  --surface-2: #161616;
  --surface-3: #1f1f1f;
  --border: #262626;
  --text: #f4f4f2;
  --text-muted: #a1a1a1;
  --link: #00748f;
  --link-hover: #1592ad;
  --gold: #ffd23f;          /* متن و آیکون طلایی روی زمینه‌ی تیره */
  --gold-strong: #f5b800;   /* طلایی پررنگ (شروع گرادیان) */
  --yellow: #fff563;        /* زرد روشن (پایان گرادیان) */
  --gold-ink: #1a1300;      /* متن روی دکمه‌ی طلایی */
  --gold-soft: rgba(255, 210, 63, .15);
  --gold-gradient: linear-gradient(135deg, var(--gold-strong), var(--yellow));
  --danger: #f05252;
  --danger-soft: rgba(240, 82, 82, .14);
  --success: #31c48d;
  --success-soft: rgba(49, 196, 141, .14);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, .14);
  --info: #3fa9f5;
  --info-soft: rgba(63, 169, 245, .14);
  --sidebar-bg: #0a0a0a;
  --sidebar-text: #d4d4d4;
  --shadow: 0 1px 2px rgba(0, 0, 0, .6);
  --radius: 14px;
  --radius-sm: 10px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f9fbff;
  --surface: #ffffff;
  --surface-2: #f8f8f6;
  --surface-3: #efefeb;
  --border: #e4e4df;
  --text: #141414;
  --text-muted: #5f5f5a;
  --link: #00748f;
  --link-hover: #005a6f;
  --gold: #8f6a00;          /* طلایی تیره برای متن روی زمینه‌ی روشن (کنتراست کافی) */
  --gold-strong: #f5b800;
  --yellow: #fff563;
  --gold-ink: #1a1300;
  --gold-soft: rgba(245, 184, 0, .16);
  --gold-gradient: linear-gradient(135deg, var(--gold-strong), var(--yellow));
  --danger: #c81e1e;
  --danger-soft: rgba(200, 30, 30, .1);
  --success: #057a55;
  --success-soft: rgba(5, 122, 85, .1);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, .1);
  --info: #1c64f2;
  --info-soft: rgba(28, 100, 242, .1);
  --sidebar-bg: #111111;
  --sidebar-text: #d4d4d4;
  --shadow: 0 1px 3px rgba(20, 20, 20, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.3; }
h1 { font-size: clamp(1.5rem, 4vw, 2.3rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--text-muted); }
.small { font-size: .75rem; }
.ltr { direction: ltr; unicode-bidi: embed; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* FocusOnNavigate بعد از هر ناوبری فوکوس را روی h1 می‌گذارد (برای صفحه‌خوان)؛ کادر آن نمایش داده نشود */
[tabindex="-1"]:focus, [tabindex="-1"]:focus-visible { outline: none; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--gold); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--gold-gradient); color: var(--gold-ink); border-color: transparent; }
.btn-primary:hover { filter: brightness(1.06); color: var(--gold-ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .75rem; }
.btn-block { width: 100%; }
.icon-btn { width: 42px; padding: 0; }
/* دکمه‌ی تم: در تم تیره خورشید (رفتن به روشن)، در تم روشن ماه */
[data-theme="dark"] .ti-moon, html:not([data-theme="dark"]) .ti-sun { display: none; }

/* فیلد رمز با دکمه‌ی نمایش (چشم) */
.pw-field { position: relative; }
.pw-field > .input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center;
          border: 0; border-radius: 8px; background: transparent; color: var(--text-muted); cursor: pointer; }
.pw-eye:hover { color: var(--text); background: var(--surface-3); }
.pw-field .pw-hide, .pw-field.shown .pw-show { display: none; }
.pw-field.shown .pw-hide { display: block; }

/* Safari: آیکون SVG داخل دکمه‌ی flex جمع نشود */
svg { flex-shrink: 0; }
.btn svg, .icon-btn svg { min-width: 1em; }

/* ---------------- Forms ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: .8rem; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit;
}
.textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); outline: none; }
.input.otp { font-size: 1.5rem; letter-spacing: .6em; text-align: center; direction: ltr; }
.validation-message, .error-text { color: var(--danger); font-size: .75rem; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

/* ---------------- Cards / alerts / badges ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning); }
.alert-info { background: var(--info-soft); color: var(--info); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .68rem; font-weight: 600; background: var(--surface-3); color: var(--text-muted); white-space: nowrap; }
.badge-gold { background: var(--gold-soft); color: var(--gold); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }
.empty { text-align: center; padding: 40px 16px; color: var(--text-muted); }

/* ---------------- Site header (الهام از sooq-cars) ---------------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.site-header .header-bar { display: flex; align-items: center; gap: 14px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1rem; }
.brand img { height: 42px; width: auto; border-radius: 8px; background: #fff; padding: 2px; }
.site-nav { display: flex; gap: 4px; margin-inline-start: 12px; }
.site-nav a { color: var(--text-muted); padding: 8px 12px; border-radius: 999px; font-weight: 600; }
.site-nav a:hover, .site-nav a.active { color: var(--text); background: var(--surface-2); }
.header-tools { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; cursor: pointer; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu .menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 170px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.lang-menu .menu a, .lang-menu .menu span { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.lang-menu .menu a:hover { background: var(--surface-2); }
.lang-menu .menu .disabled { color: var(--text-muted); opacity: .45; cursor: not-allowed; }
.lang-menu .menu .current { color: var(--gold); }
.lang-menu .menu .more { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 10px; color: var(--link); font-weight: 600; justify-content: space-between; align-items: center; }
[dir="rtl"] .lang-menu .menu .more .flip { transform: scaleX(-1); }

/* موقعیت جغرافیایی در یک فیلد */
.loc-input { display: flex; flex-direction: column; gap: 4px; }
.loc-row { display: flex; gap: 6px; }
.loc-row > .input { flex: 1 1 auto; min-width: 0; }
.loc-row > .btn { flex: 0 0 auto; }

/* هشدار تغییرات در انتظار تأیید */
.nav-alert { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: #fff;
             font-size: .68rem; font-weight: 800; margin-inline-start: auto; line-height: 1; }
.dash-bottom .nav-alert { position: absolute; top: 2px; margin: 0; width: 16px; height: 16px; font-size: .65rem; transform: translateX(10px); }
[dir="rtl"] .dash-bottom .nav-alert { transform: translateX(-10px); }
.dash-bottom a { position: relative; }
.warn-ico { color: var(--warning); display: inline-flex; vertical-align: middle; margin-inline-start: 4px; }

/* فهرست کاربران: آکاردیون و زیرمجموعه */
.acc-toggle { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; padding: 2px; display: inline-grid; place-items: center; border-radius: 6px; }
.acc-toggle:hover { background: var(--surface-3); color: var(--text); }
.acc-toggle svg { transition: transform .15s; }
.acc-toggle.open svg { transform: rotate(90deg); }
[dir="rtl"] .acc-toggle svg { transform: scaleX(-1); }
[dir="rtl"] .acc-toggle.open svg { transform: rotate(90deg); }
tr.acc-row > td { background: var(--surface-2); padding: 12px 16px; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.acc-grid h4 { margin: 0 0 6px; font-size: .8rem; color: var(--text-muted); }
.acc-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: .78rem; }
.acc-list li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--border); padding-bottom: 4px; }
/* درخت معرفی‌شده‌ها: تورفتگی با عمق، عکس پروفایل و تعداد زیرمجموعه کنار فلش */
tr.sub-user { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .tree-mark { color: var(--text-muted); }
[dir="rtl"] .user-cell .tree-mark { transform: scaleX(-1); display: inline-block; }
.avatar { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--gold); font-weight: 800; font-size: .8rem; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.acc-toggle .acc-count { font-size: .65rem; font-weight: 700; margin-inline-start: 2px; color: var(--text-muted); }
.acc-toggle { grid-auto-flow: column; gap: 2px; }
.btn.btn-ghost.active { background: var(--gold-soft); color: var(--gold); }
.date2 .sub { display: block; font-size: .65rem; color: var(--text-muted); }
.count-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); font-size: .7rem; white-space: nowrap; }

/* اطلاعات تکمیلی ارائه‌دهنده */
.resume-tick { display: inline-flex; align-items: center; gap: 4px; font-size: .65rem; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.resume-tick input { width: 14px; height: 14px; accent-color: var(--gold-strong); }
.img-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.img-slot { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.img-drop { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border: 1px dashed var(--border); border-radius: var(--radius-sm);
            background: var(--surface); overflow: hidden; cursor: pointer; text-align: center; padding: 4px; }
.img-drop.round { aspect-ratio: 1; border-radius: 50%; }
.img-drop img { width: 100%; height: 100%; object-fit: cover; }
.img-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
fieldset:disabled .img-drop { cursor: default; opacity: .7; }
@media (max-width: 520px) { .img-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.resume { display: flex; flex-direction: column; gap: 12px; }
.resume-head { display: flex; align-items: center; gap: 14px; }
.resume-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.resume-avatar.placeholder { display: grid; place-items: center; background: var(--surface-3); color: var(--text-muted); }
.resume-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.resume-photos figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.resume-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); }
.score-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.score-cell { font-size: .68rem; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--text-muted); white-space: nowrap; }
.score-cell.on { background: var(--success-soft); color: var(--success); font-weight: 600; }
.diff-img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; vertical-align: middle; }

/* صفحه‌ی زبان‌ها */
.lang-soon { opacity: .45; }
.lang-list { padding: 6px; display: flex; flex-direction: column; }
.lang-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.lang-row + .lang-row { border-top: 1px solid var(--border); }
.lang-row.active .lang-name { font-weight: 700; font-size: .98rem; }
.lang-row.active:hover { background: var(--surface-2); color: var(--text); }
.lang-row.current .lang-tag { color: var(--gold); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.lang-row.soon { opacity: .45; cursor: default; }
.lang-row.soon .lang-tag { font-size: .7rem; }
.lang-row .lang-go { color: var(--text-muted); }
[dir="rtl"] .lang-row .lang-go { transform: scaleX(-1); }

/* هندی: فونت دوناگری (فقط در صفحه‌های /hi بارگذاری می‌شود) */
html[lang="hi"] body {
  font-family: "IBM Plex Sans Devanagari", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
}
html[lang="hi"] body { line-height: 1.75; }
.mobile-nav { display: none; }

/* ---------------- Hero & sections ---------------- */
.hero { position: relative; padding: 56px 0 40px; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(800px 380px at 85% -10%, var(--gold-soft), transparent 70%), radial-gradient(600px 300px at 0% 100%, var(--gold-soft), transparent 70%); pointer-events: none; }
.hero .container { position: relative; }
.hero p { color: var(--text-muted); max-width: 620px; font-size: .95rem; }
.section { padding: 28px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

.service-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.service-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); transition: transform .15s, border-color .15s; }
.service-card:hover { transform: translateY(-2px); border-color: var(--gold); color: var(--text); }
.service-card .fee { font-size: .7rem; color: var(--text-muted); }
.service-card.selected { border-color: var(--gold); background: var(--gold-soft); }
.svc-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font-weight: 800; font-size: 1.2rem; overflow: hidden; flex: none; }
.svc-icon img { width: 70%; height: 70%; object-fit: contain; }
.svc-icon.sm { width: 40px; height: 40px; border-radius: 10px; font-size: .9rem; }
/* آیکون عکس‌دار: بدون زمینه‌ی زرد، عکس با اندازه‌ی کامل */
.svc-icon.has-img { background: transparent; }
.svc-icon.has-img img { width: 100%; height: 100%; object-fit: contain; }
.svc-icon.lg { width: 72px; height: 72px; border-radius: 16px; }
button.svc-icon { padding: 0; border: 0; cursor: zoom-in; font: inherit; }
button.svc-icon:hover img { transform: scale(1.05); transition: transform .15s; }
.img-preview { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .78); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.img-preview figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: default; }
.img-preview img { max-width: min(92vw, 720px); max-height: 78vh; border-radius: 14px; background: #fff; object-fit: contain; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.img-preview figcaption { color: #fff; font-weight: 700; }
.img-preview .close { position: absolute; top: 16px; inset-inline-end: 16px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.step { display: flex; gap: 12px; align-items: center; }
.step .num { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-gradient); color: var(--gold-ink); font-weight: 800; flex: none; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, var(--surface-2), var(--surface)); }

/* ---------------- Auth pages ---------------- */
.auth-wrap { min-height: calc(100vh - 66px - 120px); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.choice { display: flex; flex-direction: column; gap: 6px; text-align: start; padding: 22px; cursor: pointer; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font: inherit; }
.choice:hover { border-color: var(--gold); }
.choice .big { font-size: 1.9rem; }

/* ---------------- Map picker ---------------- */
.map-box { position: relative; height: 340px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.map-box .map { position: absolute; inset: 0; }
.map-pin { position: absolute; left: 50%; top: 50%; width: 34px; height: 46px; transform: translate(-50%, -100%); pointer-events: none; z-index: 2; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.map-tools { position: absolute; inset-inline-end: 10px; bottom: 10px; z-index: 3; }
.address-line { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); min-height: 44px; }

/* ---------------- Tiles (provider) ---------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.tile.added { border-color: var(--success); }
.tile-head { display: flex; gap: 10px; align-items: center; }
.tile-foot { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.table th, .table td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--text-muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td.json { max-width: 360px; font-family: ui-monospace, Consolas, monospace; font-size: .68rem; direction: ltr; text-align: left; white-space: pre-wrap; word-break: break-all; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 180px; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0 90px; color: var(--text-muted); }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.site-footer h4 { color: var(--text); font-size: .85rem; }
.site-footer a { color: var(--text-muted); display: block; padding: 2px 0; }
.site-footer a:hover { color: var(--gold); }
.store-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.store-badges span { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: .7rem; }

/* ---------------- Dashboard layout (طبق نمونه: منوی کناری تیره) ---------------- */
.dash { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.dash-sidebar { background: var(--sidebar-bg); color: var(--sidebar-text); border-inline-end: 1px solid #1d1d1d; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.dash-brand { display: flex; align-items: center; gap: 12px; padding: 18px 16px; border-bottom: 1px solid #1d1d1d; }
.dash-brand img { width: 44px; height: 44px; border-radius: 10px; background: #fff; padding: 2px; }
.dash-brand b { display: block; color: #fff; }
.dash-brand small { color: #8a8a8a; }
.dash-group { padding: 14px 16px 4px; font-size: .68rem; color: #7a7a7a; }
.dash-link { display: flex; align-items: center; gap: 12px; margin: 2px 10px; padding: 11px 14px; border-radius: 10px; color: var(--sidebar-text); font-weight: 500; }
.dash-link:hover { background: #171717; color: #fff; }
.dash-link.active { background: linear-gradient(135deg, #f5b800, #fff563); color: #1a1300; font-weight: 700; }
.dash-link .ico { width: 20px; text-align: center; opacity: .9; }
.dash-main { min-width: 0; display: flex; flex-direction: column; }
.dash-top { display: flex; align-items: center; gap: 10px; padding: 12px 22px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.dash-top .title { font-weight: 800; font-size: 1.15rem; margin: 0; line-height: 1.3; }
/* دکمه‌های صفحه (به جای page-head) */
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.page-actions.start { justify-content: flex-start; }
.page-subject { margin: 0; font-size: 1.2rem; }
.toolbar .toolbar-end { margin-inline-start: auto; }
.table th.th-action { padding-block: 6px; white-space: nowrap; }
.dash-top .chips { display: flex; gap: 8px; margin-inline-start: auto; align-items: center; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .75rem; }
.chip-gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.dash-content { padding: 16px 22px 22px; display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
/* کاشی‌های داشبورد: عنوان کم‌رنگ بالا، عدد درشت، توضیح کوچک پایین؛ کاشی هشدار با زمینه‌ی کرم و حاشیه‌ی نارنجی */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.kpi .k-label { color: var(--text-muted); font-size: .76rem; font-weight: 500; }
.kpi .k-value { font-size: 1.9rem; font-weight: 800; line-height: 1.25; margin: 6px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; white-space: nowrap; }
.kpi .k-value small { font-size: .8rem; font-weight: 600; color: var(--text-muted); letter-spacing: 0; }
.kpi .k-sub { color: var(--text-muted); font-size: .7rem; line-height: 1.6; }
.kpi .k-bar { display: block; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin: 4px 0 2px; }
.kpi .k-bar > i { display: block; height: 100%; border-radius: 6px; background: var(--success); }
.kpi.warn { background: #fffaf0; border-color: #f0b35a; }
:root[data-theme="dark"] .kpi.warn, :root:not([data-theme]) .kpi.warn { background: var(--warning-soft); border-color: var(--warning); }
.dash-card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dash-card-title h3 { margin: 0; font-size: .9rem; }
.attention { border-color: #f0b35a; padding: 0; overflow: hidden; }
.attention > .a-head { padding: 14px 18px; font-weight: 700; border-bottom: 1px solid var(--border); }
.attention > .a-body { padding: 12px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .78rem; color: var(--text-muted); }
.attention .pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; background: #fff3d6; color: #8a5300; font-weight: 700; font-size: .72rem; }
.attention .pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* پنل مدیریت فارسی: فونت وزیرمتن و اندازه‌ی کمی کوچک‌تر */
html[lang="fa"] .dash { font-family: "Vazirmatn", "IBM Plex Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif; }
.dash-content { font-size: .84rem; }
:root[data-theme="light"] .dash-main { background: #f4f6f9; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .8rem; }
.bar { height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-strong), var(--yellow)); border-radius: 999px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; flex-wrap: wrap; }
.tabs a, .tabs button { padding: 8px 14px; border-radius: 9px; color: var(--text-muted); font-weight: 600; background: none; border: 0; font: inherit; cursor: pointer; }
.tabs .active { background: var(--gold-gradient); color: var(--gold-ink); }
.tabs { flex-shrink: 0; }                 /* داخل ستون‌های flex (مودال) جمع نشود؛ در موبایل نوار زبان‌ها دیده نمی‌شد */
.modal > * { flex-shrink: 0; }
/* نقطه‌ی سبز کنار نام زبان: مقدار این زبان ثبت شده است (قابل استفاده در هر فرم چندزبانه) */
.lang-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-inline-start: 6px; vertical-align: middle; box-shadow: 0 0 0 2px var(--surface); }
.tabs .active .lang-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; }
.dash-toggle { display: none; }
#dash-menu { display: none; }
.dash-overlay { display: none; }
[dir="ltr"] .back-ico { transform: scaleX(-1); }
.page-head h1 { display: flex; align-items: center; gap: 6px; }
.log-details { font-family: ui-monospace, Consolas, monospace; font-size: .68rem; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 520px; margin: 0; direction: ltr; text-align: left; }
.dash-date { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.3; padding: 4px 12px; }
.dash-date .d-main { font-weight: 600; }
.dash-date .d-sub { font-size: .65rem; color: var(--text-muted); }
.user-chip { color: var(--gold); text-decoration: none; max-width: 260px; }
.user-chip:hover { filter: brightness(1.12); }
.user-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .role { opacity: .8; white-space: nowrap; }
.dash-top form { margin: 0; }
.dash-top .btn-sm { gap: 6px; }

/* مقایسه‌ی اطلاعات قبلی و جدید (تأیید ویرایش پروفایل) */
.diff-table td.old { color: var(--text-muted); }
.diff-table td.new { font-weight: 600; }
.diff-table tr.changed td.new { color: var(--gold); }
.diff-table tr.changed td.old { text-decoration: line-through; }
.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.badge-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); margin-inline-start: 4px; vertical-align: middle; }
.lock-note { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: .7rem; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .site-nav { display: none; }
  .mobile-nav { display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 45; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .65rem; color: var(--text-muted); padding: 4px 8px; }
  .mobile-nav a.active { color: var(--gold); }
  .mobile-nav .ico { font-size: 1.1rem; }
  .brand span { display: none; }
  .dash { grid-template-columns: 1fr; }
  .dash-sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; z-index: 70; transform: translateX(100%); transition: transform .2s; }
  [dir="ltr"] .dash-sidebar { transform: translateX(-100%); }
  #dash-menu:checked ~ .dash .dash-sidebar { transform: none; }
  #dash-menu:not(:checked) ~ .dash .dash-sidebar { visibility: hidden; transition: transform .2s, visibility 0s .2s; }
  .dash-overlay { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
  #dash-menu:checked ~ .dash .dash-overlay { opacity: 1; pointer-events: auto; }
  .dash-toggle { display: inline-flex; }
  .dash-content { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); gap: 14px; }
  .dash-toggle { width: 40px; min-height: 40px; }
  .dash-toggle svg { width: 22px; height: 22px; }
  .dash-top .refresh-btn { display: none; }
  .dash-bottom label { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .65rem; color: var(--text-muted); padding: 4px 8px; cursor: pointer; }
  .dash-bottom a, .dash-bottom label { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* نوار بالای پنل در موبایل: یک ردیف ابزار + یک ردیف تاریخ */
  .dash-top { flex-wrap: wrap; padding: 8px 10px; gap: 4px; }
  .dash-top .title { font-size: .95rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dash-top .chips { gap: 4px; flex-wrap: nowrap; margin-inline-start: 0; }
  .dash-top .icon-btn { width: 36px; min-height: 36px; }
  .dash-top .btn-sm { min-height: 34px; padding: 0 9px; }
  /* نام زبان در سایت (موبایل) نمایش داده می‌شود؛ در نوار باریک داشبورد فقط آیکون */
  .dash-top .lbl, .user-chip .role { display: none; }
  .header-tools { gap: 6px; }
  .header-tools .lang-menu > summary { padding: 0 10px; gap: 6px; }
  .user-chip { max-width: 120px; padding: 6px 9px; }
  .dash-date { order: 10; flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 8px;
               padding: 4px 8px; border-radius: 8px; background: transparent; border: 0; font-size: .7rem; }
  .dash-top .chips { display: contents; }
  .page-head h1 { font-size: 1.2rem; }
  .toolbar .input, .toolbar .select { flex: 1 1 100%; min-width: 0; width: 100%; }
  .tabs { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .tabs a, .tabs button { white-space: nowrap; padding: 7px 11px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .bar-row { grid-template-columns: 100px 1fr 34px; }
  .map-box { height: 300px; }
}

/* ---------------- Hero + اسلایدر تبلیغات ---------------- */
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1fr 1.05fr; gap: 40px; } }
.ad-slider { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); aspect-ratio: 16 / 9; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.ad-track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.ad-track::-webkit-scrollbar { display: none; }
.ad-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; color: #fff; }
.ad-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-caption { position: absolute; inset-inline: 0; bottom: 0; padding: 40px 18px 34px; display: flex; flex-direction: column; gap: 2px; background: linear-gradient(to top, rgba(0, 0, 0, .78), transparent); }
.ad-caption strong { font-size: 1.05rem; }
.ad-caption span { font-size: .8rem; opacity: .9; }
.ad-slide:hover { color: #fff; }
.ad-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; z-index: 2; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.ad-nav.prev { inset-inline-start: 10px; }
.ad-nav.next { inset-inline-end: 10px; }
.ad-nav.prev svg, [dir="rtl"] .ad-nav.next svg { transform: scaleX(-1); }
[dir="rtl"] .ad-nav.prev svg { transform: none; }
.ad-dots { position: absolute; bottom: 10px; inset-inline: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.ad-dots button { width: 8px; height: 8px; padding: 0; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .55); cursor: pointer; transition: width .2s, background .2s; }
.ad-dots button.active { width: 22px; background: var(--gold-gradient); }
@media (max-width: 899px) { .ad-nav { display: none; } .hero { padding-top: 28px; } }

/* ---------------- لودر ورود به سایت (App.razor) ---------------- */
/* وسایل خدمات خودرو پخش می‌شوند → برمی‌گردند → لوگو → صفحه (js/najdat-loader.js) */
#site-loader { position: fixed; inset: 0; z-index: 9999; overflow: hidden; cursor: pointer; color: var(--text);
  background: radial-gradient(120% 80% at 50% 45%, var(--surface) 0%, var(--bg) 100%); }
#site-loader .ld-stage { position: absolute; inset: 0; will-change: transform; }
#site-loader .ld-item { position: absolute; left: 50%; top: 50%; opacity: 0; will-change: transform, filter, opacity; }
#site-loader .ld-float { display: block; width: 100%; animation: ld-float var(--fd, 3s) ease-in-out var(--fdel, 0s) infinite alternate; }
#site-loader .ld-item svg { display: block; width: 100%; height: auto; overflow: visible;
  filter: drop-shadow(0 10px 14px rgba(20, 30, 50, .2)) drop-shadow(0 2px 3px rgba(20, 30, 50, .14)); }
#site-loader .ld-rot { animation: ld-rot 2.6s linear infinite; }
#site-loader .ld-rot-slow { animation-duration: 5s; }
@keyframes ld-rot { to { transform: rotate(360deg); } }
@keyframes ld-float { from { transform: translate3d(0, -3px, 0) rotate(-1.2deg); } to { transform: translate3d(0, 4px, 0) rotate(1.2deg); } }
#site-loader .ld-ribbon { display: inline-flex; align-items: center; gap: .5em; white-space: nowrap; font-weight: 700; line-height: 1.3;
  padding: .45em .9em .5em; border-radius: .35em; box-shadow: 0 8px 18px rgba(20, 30, 50, .2); }
#site-loader .ld-ribbon.yellow { background: var(--gold-gradient); color: #141414; }
#site-loader .ld-ribbon.navy { background: #1F3A5F; color: #fff; }
#site-loader .ld-ribbon .tag { background: #141414; color: #ffd23f; border-radius: .25em; padding: .05em .45em; font-weight: 800; direction: ltr; }
#site-loader .ld-ribbon .chev { display: inline-flex; gap: 2px; }
#site-loader .ld-ribbon .chev i { width: .5em; height: .8em; background: currentColor; opacity: .85; clip-path: polygon(0 0, 45% 0, 100% 50%, 45% 100%, 0 100%, 55% 50%); }
[dir="rtl"] #site-loader .ld-ribbon .chev { transform: scaleX(-1); }
#site-loader .ld-dot { width: 100%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 60%; box-shadow: 0 4px 8px rgba(20, 30, 50, .18); }
#site-loader .ld-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 14px; pointer-events: none; text-align: center; }
#site-loader .ld-card { width: var(--logo-size, 140px); aspect-ratio: 1; padding: 6%; border-radius: 24%; background: #fff; opacity: 0;
  box-shadow: 0 18px 40px rgba(20, 30, 50, .22), 0 0 0 4px rgba(245, 184, 0, .35); }
#site-loader .ld-card img { display: block; width: 100%; height: 100%; object-fit: contain; clip-path: inset(2%); }
#site-loader .ld-name { font-weight: 800; font-size: clamp(20px, 5.2vmin, 30px); opacity: 0; }
#site-loader .ld-name:empty { display: none; }
#site-loader .ld-tag { font-weight: 500; font-size: clamp(13px, 3.2vmin, 16px); color: var(--text-muted); opacity: 0; max-width: 86vw; }
#site-loader .ld-ring { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 3px solid var(--gold-strong); opacity: 0; pointer-events: none; }
#site-loader .ld-progress { position: absolute; left: 50%; bottom: calc(48px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: 84px; height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; opacity: 0; }
#site-loader .ld-progress i { position: absolute; inset: 0; width: 40%; border-radius: 4px; background: var(--gold-strong); animation: ld-bar 1.1s ease-in-out infinite; }
@keyframes ld-bar { from { transform: translateX(-110%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { #site-loader .ld-float, #site-loader .ld-rot { animation: none; } }

/* ---------------- ورودی موبایل با پیش‌شماره‌ی کشور ---------------- */
.phone-input { display: flex; gap: 8px; direction: ltr; }
.phone-input .phone-country { width: auto; flex: 0 0 auto; min-width: 190px; max-width: 60%; }
.phone-input .input { flex: 1 1 auto; min-width: 140px; letter-spacing: .04em; }

/* فرم‌های گروه‌بندی‌شده (اطلاعات شخصی، موبایل، حساب، موقعیت) */
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-section { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.form-section > h4 { margin: 0; font-size: .82rem; color: var(--text-muted); font-weight: 700; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-2 > .field { min-width: 0; }
.check-line { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.check-line > input { flex: 0 0 auto; margin-top: .3em; }
@media (max-width: 1100px) { .form-sections { grid-template-columns: 1fr; } }
@media (max-width: 400px) {
  .header-tools .user-chip { max-width: 92px; }
  .header-tools .icon-btn { width: 38px; }
}
@media (max-width: 520px) {
  .grid-2:not(.keep) { grid-template-columns: 1fr; }
  .phone-input .phone-country { min-width: 0; flex: 0 1 auto; max-width: 52%; }
  .phone-input .input { min-width: 0; }
  .auth-wrap { padding: 20px 12px; align-items: start; }
  .auth-card { padding: 16px; }
  .auth-card h1 { font-size: 1.2rem !important; }
}

/* فرم دسترسی‌ها */
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: start; }
.perm-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold-strong); }
.perm-table input[type=checkbox]:disabled { opacity: .35; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.phone-country option:disabled { color: var(--text-muted); }

/* ---------------- مدیریت خدمات: خلاصه، کارت‌های درختی و آمار (Admin/Services.razor) ---------------- */
.svc-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.svc-sum { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.svc-sum .k { font-size: .68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-sum b { font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.svc-sum.warn { border-color: var(--warning); background: var(--warning-soft); }
.svc-sum.gold { background: var(--gold-soft); border-color: transparent; }
.svc-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.svc-toolbar .input { flex: 1 1 220px; max-width: 360px; }
.svc-toolbar .btn-primary { margin-inline-start: auto; }
.svc-list { display: flex; flex-direction: column; gap: 14px; }
.svc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: .8rem; }
.svc-card.off, .svc-sub.off { opacity: .65; }
.svc-head { display: flex; align-items: flex-start; gap: 12px; }
.svc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.svc-title strong { font-size: .88rem; }
.svc-title .badge { font-size: .65rem; padding: 1px 8px; }
.svc-fees { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.svc-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.svc-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.svc-stats .star1 { color: var(--gold-strong); }
/* عدد جلوی عنوان در یک خط (ارتفاع کم) */
.svc-stats .st { position: relative; background: var(--surface-2); border-radius: 8px; padding: 6px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; overflow: hidden; }
.svc-stats .st > span { font-size: .68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-stats .st > b { font-size: .85rem; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 4px; white-space: nowrap; flex: none; }
.svc-stats .st.info > b { color: var(--info); }
.svc-stats .st.ok > b { color: var(--success); }
.svc-stats .st.bad > b { color: var(--danger); }
.svc-stats .st.gold { background: var(--gold-soft); }
.svc-stats .st .bar { position: absolute; inset-inline: 0; bottom: 0; display: block; height: 3px; background: var(--surface-3); overflow: hidden; }
.svc-stats .st .bar > i { display: block; height: 100%; background: var(--success); }
.svc-sub-toggle { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 700; color: var(--link); cursor: pointer; }
.svc-subs { display: flex; flex-direction: column; gap: 8px; border-inline-start: 3px solid var(--gold-soft); padding-inline-start: 12px; margin-inline-start: 18px; }
.svc-sub { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.svc-sub .svc-stats .st { background: var(--surface); }
.rot90 { transform: rotate(90deg); transition: transform .15s; }
[dir="rtl"] .svc-sub-toggle .flip { transform: scaleX(-1); }
.svc-form .fee-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.svc-form .fee-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.svc-form .fee-box strong { display: inline-flex; align-items: center; gap: 6px; }
.modal-actions { position: sticky; bottom: -18px; margin-bottom: -18px; padding: 10px 0 18px; background: var(--surface); border-top: 1px solid var(--border); z-index: 1; }
@media (max-width: 640px) {
  .svc-head { flex-wrap: wrap; }
  .svc-actions { width: 100%; justify-content: flex-start; }
  .svc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .svc-stats .st > span { font-size: .65rem; }
  .svc-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .svc-sum b { font-size: .88rem; }
  .svc-subs { margin-inline-start: 4px; padding-inline-start: 8px; }
  .svc-toolbar .input { max-width: none; }
  .svc-form .fee-boxes { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}

/* ---------------- ستاره‌های امتیاز (Stars.razor) و فرم امتیاز مشتری ---------------- */
.stars { display: inline-flex; line-height: 1; }
.stars-input .star { background: none; border: 0; padding: 2px; font-size: 1.8rem; color: var(--surface-3); cursor: pointer; transition: transform .1s, color .1s; }
.stars-input .star.on { color: var(--gold-strong); }
.stars-input .star:hover { transform: scale(1.15); }
.stars-view { position: relative; font-size: .9rem; letter-spacing: 1px; }
.stars-view.sm { font-size: .8rem; }
.stars-view .bg { color: var(--surface-3); }
.stars-view .fg { position: absolute; inset-block: 0; inset-inline-start: 0; overflow: hidden; white-space: nowrap; color: var(--gold-strong); }
.rate-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.rate-ask { background: var(--gold-soft); border-radius: var(--radius-sm); padding: 8px 12px; font-weight: 600; }

/* فرم خدمت: نمایش در سایت (با پیش‌نمایش کارت) و مدیریت نظرات */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.display-grid { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 14px; align-items: start; }
.home-preview { display: flex; flex-direction: column; gap: 6px; }
.home-preview .service-card { pointer-events: none; }
.review-admin summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.review-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.review-row.hidden { opacity: .55; }
@media (max-width: 640px) { .grid-3, .display-grid { grid-template-columns: 1fr; } .home-preview { max-width: 220px; } }

/* کارت خدمت سایت: توضیح کوتاه و حالت غیرفعال (خاکستری) */
.service-card .desc { font-size: .7rem; color: var(--text-muted); line-height: 1.5; }
.service-card.disabled { filter: grayscale(1); opacity: .55; cursor: not-allowed; }
.service-card.disabled:hover { transform: none; border-color: var(--border); }

/* کاشی نظرات مشتریان در صفحه‌ی خدمت */
.reviews { display: flex; flex-direction: column; gap: 14px; }
.reviews-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.reviews-head h2 { margin: 0; }
.reviews-avg { display: flex; align-items: center; gap: 8px; }
.reviews-avg > b { font-size: 1.7rem; line-height: 1; }
.reviews-avg .stars-view { font-size: 1.1rem; }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.review { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.review p { margin: 0; line-height: 1.7; }

/* ---------------- برش و زوم عکس (ProviderInfoEditor) و عکس قابل بزرگ‌نمایی (ZoomImage) ---------------- */
.crop-modal { z-index: 150; }
.crop-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.crop-vp { position: relative; width: min(100%, 360px); aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-sm);
  background: repeating-conic-gradient(var(--surface-3) 0 25%, var(--surface-2) 0 50%) 0 0 / 16px 16px;
  touch-action: none; cursor: grab; user-select: none; box-shadow: inset 0 0 0 2px var(--gold-strong); }
.crop-vp:active { cursor: grabbing; }
.crop-vp.round { width: min(100%, 300px); aspect-ratio: 1; border-radius: 50%; }
.crop-vp img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 10px; width: min(100%, 320px); color: var(--text-muted); }
.crop-zoom input { flex: 1; accent-color: var(--gold-strong); }
.zoom-img { padding: 0; border: 0; background: none; cursor: zoom-in; font: inherit; color: inherit; }
.zoom-img img { display: block; }

/* تعداد زیرمجموعه‌ها (سبز) جلوی نام کاربر؛ با کلیک باز/بسته می‌شود */
.sub-count { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px; border: 0;
  background: var(--success-soft); color: var(--success); font: inherit; font-size: .68rem; font-weight: 700; cursor: pointer; vertical-align: middle; }
span.sub-count { cursor: default; }
.sub-count .chev { transition: transform .15s; }
.sub-count.open .chev { transform: rotate(90deg); }
[dir="rtl"] .sub-count .chev { transform: scaleX(-1); }
[dir="rtl"] .sub-count.open .chev { transform: rotate(90deg); }
.zoom-img.avatar { cursor: zoom-in; }
.img-slots.avatar-only { grid-template-columns: minmax(0, 180px); }

/* ---------------- فرم خدمات (کاشی‌ها): آیکون | ستاره+نام | انگلیسی | زیرخدمت | وبسایت | امتیاز | ترجمه | دکمه‌ها ---------------- */
/* چیدمان کاشی بر اساس عرض خود فهرست (نه پنجره) تا با منوی کناری هم داخل صفحه بماند */
.svc-tiles { display: flex; flex-direction: column; gap: 10px; container-type: inline-size; min-width: 0; }
/* ستون‌های ثابت تا همه‌ی کاشی‌ها (اصلی و زیرخدمت) دقیقاً زیر هم باشند */
.svc-tile { display: grid; grid-template-columns: 96px minmax(150px, 1.5fr) minmax(100px, 1fr) 76px 90px 64px 64px 80px 296px;
  align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .8rem; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; }
.svc-tile > * { min-width: 0; }
.svc-tile.open { border-color: var(--gold-strong); }
.svc-tile.sub { background: #f1faf4; border-color: #cfeedd; }
:root[data-theme="dark"] .svc-tile.sub, :root:not([data-theme]) .svc-tile.sub { background: rgba(49, 196, 141, .08); border-color: rgba(49, 196, 141, .25); }
.svc-tile.sub .t-icon { padding-inline-start: 30px; }
.svc-tile.sub .t-icon .svc-icon, .svc-tile.sub .folder-ico { width: 60px; height: 60px; }
.t-parent { font-size: .65rem; line-height: 1.2; color: var(--text-muted); opacity: .85; letter-spacing: .1px; }
.t-stars { line-height: 1; }
.t-icon { display: flex; align-items: center; }
.t-icon .svc-icon { width: 70px; height: 70px; border-radius: 14px; }
.folder-ico { display: grid; place-items: center; width: 70px; height: 70px; }
.folder-ico svg { width: 64px; height: 64px; }
.t-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.t-stars .stars-view .bg { color: #d5d5d0; }
.t-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.t-title b { font-size: .88rem; }
.t-title .badge { font-size: .65rem; padding: 0 7px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.dot.off { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
.t-en { color: var(--text-muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.t-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 4px 8px; border-radius: 8px; }
.t-cell small { color: var(--text-muted); font-size: .65rem; white-space: nowrap; }
.t-cell b { font-size: .78rem; white-space: nowrap; }
.t-cell .home-1 { color: var(--success); } .t-cell .home-2 { color: var(--text-muted); } .t-cell .home-0 { color: var(--danger); }
.t-tr.bad { background: #fdecec; } .t-tr.bad b { color: #b42318; }
:root[data-theme="dark"] .t-tr.bad, :root:not([data-theme]) .t-tr.bad { background: rgba(240, 82, 82, .14); }
.t-tr.ok b { color: var(--success); }
.t-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.acc-btn.active { background: var(--gold-soft); border-color: transparent; color: var(--gold); }
.svc-acc { display: flex; flex-direction: column; gap: 8px; margin-inline-start: 18px; padding-inline-start: 12px; border-inline-start: 3px solid var(--gold-soft); }
.svc-acc.sub { margin-inline-start: 46px; border-color: #cfeedd; }
.plans { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.plan-table td, .plan-table th { font-size: .75rem; }
.t-actions .icon-btn { width: 34px; padding: 0; justify-content: center; }
/* عرض کم: ستون‌ها شکسته می‌شوند (همان چیدمان موبایل) */
@container (max-width: 1180px) {
  .svc-tile, .svc-tile.sub { display: flex; flex-wrap: wrap; }
  .t-icon { flex: 0 0 auto; }
  .t-name { flex: 1 1 200px; }
  .t-en { flex: 1 1 100%; order: 2; }
  .t-cell { flex: 1 1 calc(20% - 12px); order: 3; background: var(--surface-2); }
  .svc-tile.sub .t-cell { background: rgba(255, 255, 255, .6); }
  .t-actions { flex: 1 1 100%; order: 4; justify-content: flex-start; }
}
@media (max-width: 1100px) {
  .svc-tile, .svc-tile.sub { display: flex; flex-wrap: wrap; }
  .t-icon { flex: 0 0 auto; }
  .t-name { flex: 1 1 200px; }
  .t-en { flex: 1 1 100%; order: 2; }
  .t-cell { flex: 1 1 calc(20% - 12px); order: 3; background: var(--surface-2); }
  .svc-tile.sub .t-cell { background: rgba(255, 255, 255, .6); }
  .t-actions { flex: 1 1 100%; order: 4; justify-content: flex-start; }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) { .t-cell { flex-basis: calc(50% - 12px); } .svc-acc, .svc-acc.sub { margin-inline-start: 6px; padding-inline-start: 8px; } }

/* پلن‌ها برای خدمات‌دهنده */
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.plan-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font: inherit; color: var(--text); }
.plan-card.selected { border-color: var(--gold-strong); background: var(--gold-soft); }
.plan-card:disabled { opacity: .5; cursor: not-allowed; }
.plan-card .price { font-weight: 800; font-size: 1rem; }
.plan-inline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ---------------- آمار بالای فهرست خدمات: کپسول → کارت پوشه‌ای (الهام از sileo) ---------------- */
.sileo-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; position: relative; z-index: 5; }
.sileo { position: relative; outline: none; --sileo-bg: #141414; --sileo-fg: #f4f4f2; --sileo-muted: #9a9a96; }
.sileo-pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 6px; border-radius: 999px;
  background: var(--sileo-bg); color: var(--sileo-fg); font-size: .75rem; cursor: default; user-select: none; position: relative; z-index: 2;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .14); transition: border-radius .32s cubic-bezier(.2, .9, .3, 1.1), padding .32s; }
[dir="rtl"] .sileo-pill { padding: 0 6px 0 14px; }
.sileo-pill b { font-variant-numeric: tabular-nums; font-size: .85rem; }
.s-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; }
.s-ico.ok { background: rgba(34, 197, 94, .18); color: #4ade80; }
.s-ico.warn { background: rgba(245, 158, 11, .2); color: #fbbf24; }
.s-ico.bad { background: rgba(239, 68, 68, .2); color: #f87171; }
.s-ico.gold { background: rgba(245, 184, 0, .2); color: #ffd23f; }
/* کارت: زیر کپسول باز می‌شود و کپسول زبانه‌ی آن می‌شود */
.sileo-card { position: absolute; top: 30px; inset-inline-start: 0; min-width: 270px; max-width: 320px; padding: 18px 16px 14px;
  background: var(--sileo-bg); color: var(--sileo-fg); border-radius: 0 20px 20px 20px; box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
  transform-origin: top left; transform: scale(.35, .1); opacity: 0; filter: blur(6px); pointer-events: none;
  transition: transform .42s cubic-bezier(.2, .9, .25, 1.15), opacity .25s ease, filter .35s ease; display: flex; flex-direction: column; gap: 10px; }
[dir="rtl"] .sileo-card { border-radius: 20px 0 20px 20px; transform-origin: top right; }
.sileo:hover .sileo-card, .sileo:focus-within .sileo-card { transform: none; opacity: 1; filter: none; pointer-events: auto; }
.sileo:hover .sileo-pill, .sileo:focus-within .sileo-pill { border-radius: 19px 19px 0 0; box-shadow: none; }
.sileo:hover, .sileo:focus-within { z-index: 10; }
/* محتوای کارت کمی دیرتر ظاهر می‌شود */
.sileo-card > * { opacity: 0; transform: translateY(6px); transition: opacity .25s ease .12s, transform .3s ease .12s; }
.sileo:hover .sileo-card > *, .sileo:focus-within .sileo-card > * { opacity: 1; transform: none; }
.s-big { display: flex; align-items: baseline; gap: 8px; }
.s-big b { font-size: 1.9rem; line-height: 1; font-weight: 800; }
.s-big span { color: var(--sileo-muted); font-size: .75rem; }
.s-bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.s-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #22c55e, #4ade80); }
[dir="rtl"] .s-bar i { margin-inline-start: 0; }
.s-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .68rem; color: var(--sileo-muted); }
.s-legend .ok, .s-legend .st-Active { color: #4ade80; } .s-legend .bad, .s-legend .st-Ended { color: #f87171; }
.s-legend .st-Scheduled { color: #60a5fa; } .s-legend .st-Inactive { color: #a1a1aa; }
.s-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .72rem; }
.s-list li { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.s-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.s-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-list li b { color: var(--sileo-muted); font-weight: 600; white-space: nowrap; }
.s-list li.ok { color: #4ade80; }
@media (prefers-reduced-motion: reduce) { .sileo-card, .sileo-card > *, .sileo-pill { transition: none; } }
@media (max-width: 520px) { .sileo-card { min-width: min(260px, 78vw); } }
.dash-content > * { min-width: 0; max-width: 100%; }

/* زیرخدمت سطح ۲: تورفتگی بیشتر و سبز کمی پررنگ‌تر */
.svc-tile.sub2 { background: #e7f6ec; border-color: #bfe6cf; }
.svc-tile.sub2 .t-icon { padding-inline-start: 52px; }
.svc-tile.sub2 .t-icon .svc-icon, .svc-tile.sub2 .folder-ico { width: 46px; height: 46px; }
.svc-tile.sub2 .folder-ico svg { width: 42px; height: 42px; }
:root[data-theme="dark"] .svc-tile.sub2, :root:not([data-theme]) .svc-tile.sub2 { background: rgba(49, 196, 141, .13); }
.svc-acc.sub2 { margin-inline-start: 74px; border-color: #bfe6cf; }

/* ---------------- پلن‌ها: گزارش، وضعیت‌ها، محبوبیت، کاربران ---------------- */
.view-tabs { margin-bottom: 12px; }
.view-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.t-cell .users-on { color: var(--success); }
.s-link { align-self: flex-start; background: rgba(255, 255, 255, .1); color: var(--sileo-fg); border-color: transparent; }
.s-legend .st-EndingSoon { color: #fbbf24; } .s-legend .st-Deleted { color: #a1a1aa; }
.plan-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-chips .chip { cursor: pointer; font: inherit; font-size: .75rem; color: var(--text); }
.plan-chips .chip b { font-variant-numeric: tabular-nums; background: var(--surface); border-radius: 999px; padding: 0 7px; font-size: .68rem; }
.plan-chips .chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.plan-chips .chip.active b { background: rgba(255, 255, 255, .2); color: inherit; }
.plan-chips .chip i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip.st-Active i { background: #22c55e; } .chip.st-EndingSoon i { background: #f59e0b; } .chip.st-Scheduled i { background: #3b82f6; }
.chip.st-Ended i { background: #ef4444; } .chip.st-Inactive i { background: #a1a1aa; } .chip.st-Deleted i { background: #52525b; }
.plan-st { white-space: nowrap; }
.plan-st.st-Active { background: #dcfce7; color: #166534; } .plan-st.st-EndingSoon { background: #fef3c7; color: #92400e; }
.plan-st.st-Scheduled { background: #dbeafe; color: #1e40af; } .plan-st.st-Ended { background: #fee2e2; color: #991b1b; }
.plan-st.st-Inactive { background: #f4f4f5; color: #52525b; } .plan-st.st-Deleted { background: #e4e4e7; color: #3f3f46; text-decoration: line-through; }
.plan-table tr.row-void td { opacity: .6; }
.plan-table tr.row-void td:last-child { opacity: 1; }
.pop-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge.pop-high { background: #fde68a; color: #78350f; } .badge.pop-low { background: #f4f4f5; color: #71717a; }
.share-bar { height: 4px; border-radius: 4px; background: var(--surface-2); margin-top: 4px; min-width: 60px; overflow: hidden; }
.share-bar i { display: block; height: 100%; background: var(--gold-strong); border-radius: 4px; }
.plan-actions { display: flex; gap: 4px; align-items: center; }
.plan-actions .icon-btn { width: 32px; padding: 0; justify-content: center; }
.btn-success-soft { background: #dcfce7; color: #166534; border-color: transparent; }
.plan-report .svc-toolbar { margin: 0; }

/* فهرست کاربران: ایمیل حداکثر به پهنای نام (بقیه «…») */
.u-text { display: flex; flex-direction: column; min-width: 0; }
.u-line { white-space: nowrap; }
.u-email { display: block; width: 0; min-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: start; }
[dir="rtl"] .u-email { text-align: right; }
/* کاربر دارای معرف (زیرمجموعه): سبز کم‌رنگ */
tr.sub-user { background: #effaf3; }
tr.sub-user:hover { background: #e4f6ea; }
:root[data-theme="dark"] tr.sub-user, :root:not([data-theme]) tr.sub-user { background: rgba(49, 196, 141, .09); }

/* فرم پلن: بخش قیمت/تخفیف و تاریخ‌ها */
.plan-sub { margin: 6px 0 0; font-size: .8rem; color: var(--text-muted); font-weight: 700; }
.link-btn { background: none; border: 0; padding: 0 4px; color: var(--link); cursor: pointer; font: inherit; text-decoration: underline; }
.date-preview { direction: ltr; unicode-bidi: plaintext; }
.disc-badge { background: #fee2e2; color: #b91c1c; font-size: .65rem; padding: 0 6px; }
.badge.store-on { background: #e0f2fe; color: #075985; margin-inline-start: 4px; }

/* ---------------- فروشگاه پلن‌ها: کپسول‌های خدمت (آبی → زرد → سبز) ---------------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; position: relative; z-index: 6; min-height: 44px; }
.crumb { position: relative; --c-bg: #0dcaf0; --c-fg: #052c33; --c-soft: #e7fafe; }
.crumb-warning { --c-bg: #ffc107; --c-fg: #3d2c00; --c-soft: #fff7d6; }
.crumb-success { --c-bg: #198754; --c-fg: #fff; --c-soft: #e6f4ec; }
.crumb-sep { align-self: center; color: var(--text-muted); font-size: 1.2rem; line-height: 1; }
[dir="rtl"] .crumb-sep { transform: scaleX(-1); }
.crumb-pill { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; border: 0;
  background: var(--c-bg); color: var(--c-fg); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .12); transition: height .25s, padding .25s, font-size .25s, border-radius .25s; }
.crumb-pill .svc-icon { width: 24px; height: 24px; border-radius: 6px; flex: none; }
/* انتخاب‌شده و بسته: کپسول کوچک می‌شود */
.crumb:not(.open):not(.no-pick) .crumb-pill { height: 34px; padding: 0 12px; font-size: .8rem; }
.crumb.no-pick .crumb-pill { outline: 2px dashed rgba(0, 0, 0, .15); outline-offset: 2px; }
.crumb.open .crumb-pill { border-radius: 21px 21px 0 0; box-shadow: none; }
.crumb-list { position: absolute; top: 40px; inset-inline-start: 0; min-width: 270px; max-width: min(360px, calc(100vw - 32px)); max-height: 60vh; overflow: auto;
  padding: 8px; display: flex; flex-direction: column; gap: 2px; background: var(--c-soft); border: 2px solid var(--c-bg);
  border-radius: 0 16px 16px 16px; box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
  transform-origin: top left; transform: scale(.4, .1); opacity: 0; pointer-events: none;
  transition: transform .35s cubic-bezier(.2, .9, .25, 1.1), opacity .2s ease; }
[dir="rtl"] .crumb-list { border-radius: 16px 0 16px 16px; transform-origin: top right; }
.crumb.open .crumb-list { transform: none; opacity: 1; pointer-events: auto; }
.crumb.open { z-index: 10; }
.crumb-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: transparent; border-radius: 10px;
  cursor: pointer; font: inherit; color: #1f2937; text-align: start; }
.crumb-item .svc-icon { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.crumb-item:hover, .crumb-item:focus-visible { background: rgba(0, 0, 0, .06); outline: none; }
.crumb-item.active { background: var(--c-bg); color: var(--c-fg); }
.ci-meta { display: inline-flex; align-items: center; gap: 3px; color: inherit; opacity: .7; }
@media (prefers-reduced-motion: reduce) { .crumb-list, .crumb-pill { transition: none; } }

.cart-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); }
.store-head { padding: 4px 2px; }

/* کاشی پلن */
.store-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.store-plan { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); transition: border-color .2s, background .2s, box-shadow .2s; }
.store-plan:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, .06); }
.store-plan.in-cart { border-color: var(--gold-strong); background: var(--gold-soft); }
.store-plan.disabled { opacity: .6; }
.sp-head { display: flex; align-items: center; gap: 10px; }
.sp-ico { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.store-plan.in-cart .sp-ico { background: var(--gold-strong); color: #1a1300; }
/* سطل آشغال کنار آیکن پلن (فقط وقتی انتخاب شده) */
.sp-trash { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; border: 0; cursor: pointer;
  background: #fee2e2; color: #b91c1c; transition: background .15s, transform .15s; }
.sp-trash:hover { background: #fecaca; transform: scale(1.06); }
.sp-name { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.sp-name b { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-disc { flex: none; background: #dc2626; color: #fff; font-weight: 800; font-size: .75rem; padding: 3px 8px; border-radius: 999px; }
.sp-providers, .sp-dates { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-muted); }
.sp-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sp-price b { font-size: 1.15rem; font-weight: 800; }
.sp-price s { font-size: .8rem; }
.sp-added { background: transparent; border-color: var(--gold-strong); color: var(--gold); cursor: default; }
.store-plan .btn { align-self: stretch; justify-content: center; }

/* نوار پلن‌های انتخاب‌شده */
.store-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--surface);
  border: 1px solid var(--gold-strong); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0, 0, 0, .12); }
.sel-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sel-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: .75rem; }
[dir="rtl"] .sel-chip { padding: 3px 10px 3px 4px; }
.sel-chip button { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 0; background: #fee2e2; color: #b91c1c; cursor: pointer; }
.store-total { display: flex; flex-direction: column; align-items: flex-end; }
.store-total b { font-size: 1.1rem; }
@media (max-width: 640px) { .store-bar { flex-direction: column; align-items: stretch; } .store-total { align-items: flex-start; } }
/* موبایل: فهرست کپسول تمام‌عرض زیر ردیف کپسول‌ها تا از صفحه بیرون نزند */
@media (max-width: 640px) {
  .crumb { position: static; }
  .crumb-list { top: calc(100% + 6px); inset-inline: 0; min-width: 0; max-width: none; border-radius: 16px; }
  [dir="rtl"] .crumb-list { border-radius: 16px; }
  .crumb.open .crumb-pill { border-radius: 999px; box-shadow: 0 0 0 3px var(--c-soft), 0 0 0 5px var(--c-bg); }
}

/* ---------------- سبد خرید و خریدهای من ---------------- */
a.cart-pill { text-decoration: none; font-weight: 700; }
a.cart-pill b { background: var(--gold-strong); color: #1a1300; border-radius: 999px; padding: 0 8px; font-size: .8rem; }
.store-total .btn { margin-top: 6px; }
.cart-list { display: flex; flex-direction: column; gap: 10px; }
.cart-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.cart-row.warn { border-color: #f87171; background: #fef2f2; }
.cart-row.gone { opacity: .75; border-style: dashed; }
:root[data-theme="dark"] .cart-row.warn, :root:not([data-theme]) .cart-row.warn { background: rgba(239, 68, 68, .1); }
.cart-warn { display: flex; align-items: center; gap: 6px; color: #b91c1c; font-size: .8rem; font-weight: 600; }
.cart-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 110px; text-align: end; }
.cart-price b { font-size: 1.05rem; }
.cart-summary { position: sticky; bottom: 12px; border-color: var(--gold-strong); box-shadow: 0 12px 30px rgba(0, 0, 0, .1); }
.cart-total b { font-size: 1.2rem; }
@media (max-width: 640px) {
  .cart-row { flex-wrap: wrap; }
  .cart-price { flex-direction: row; align-items: baseline; flex-wrap: wrap; min-width: 0; flex: 1 1 auto; }
}
.order-card { display: flex; flex-direction: column; gap: 10px; }
.order-card .order-st { font-weight: 700; }
.order-Paid .order-st { background: #dcfce7; color: #166534; }
.order-Pending .order-st { background: #fef3c7; color: #92400e; }
.order-Failed { opacity: .8; }
.order-Failed .order-st { background: #fee2e2; color: #991b1b; }

/* لودر صفحه (بعد از انتخاب نوع حساب و ...) */
.page-loader { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.page-loader.show { opacity: 1; pointer-events: auto; }
.pl-card { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 36px; background: var(--surface); border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .18); }
.pl-card img { width: 84px; height: 84px; object-fit: contain; border-radius: 18px; }
.pl-spin { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--gold-soft); border-top-color: var(--gold-strong); animation: pl-rot .8s linear infinite; }
@keyframes pl-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pl-spin { animation-duration: 2.5s; } }

/* ---------------- کاشی دسته‌بندی خدمات (صفحه‌ی اصلی و صفحه‌ی خدمت) ---------------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.cat-tile { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  color: var(--text); text-decoration: none; box-shadow: 0 2px 6px rgba(15, 23, 42, .04);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
a.cat-tile:hover, a.cat-tile:focus-visible { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(15, 23, 42, .12); border-color: var(--gold-strong); color: var(--text); }
/* عکس بزرگ «فروشگاهی»: کامل دیده می‌شود (contain) روی زمینه‌ی روشن */
.cat-media { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #fffdf5 0%, #fff4cc 55%, #ffe9a3 100%); }
:root[data-theme="dark"] .cat-media, :root:not([data-theme]) .cat-media { background: radial-gradient(circle at 50% 40%, #2a2a2e 0%, #1f1d18 70%, #2a2414 100%); }
/* عکس کل فضای کاشی را پر می‌کند (بدون حاشیه‌ی زرد) */
.cat-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
a.cat-tile:hover .cat-media img { transform: scale(1.06); }
.cat-ph { font-size: 4rem; font-weight: 800; color: var(--gold); opacity: .55; }
.cat-badge { position: absolute; z-index: 1; top: 12px; inset-inline-start: 12px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  background: rgba(17, 24, 39, .78); color: #fff; font-size: .7rem; font-weight: 700; backdrop-filter: blur(4px); }
.cat-badge.soon { inset-inline-start: auto; inset-inline-end: 12px; background: #6b7280; }
.cat-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1 1 auto; }
.cat-body h3 { margin: 0; font-size: 1.05rem; }
/* توضیح حداکثر دو سطر؛ بیشتر از آن «…» */
.cat-body p { margin: 0; font-size: .8rem; color: var(--text-muted); line-height: 1.6; min-height: 3.2em; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }
.cat-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.cat-price { display: flex; flex-direction: column; line-height: 1.2; }
.cat-price small { font-size: .7rem; color: var(--text-muted); white-space: nowrap; }
.cat-price b { white-space: nowrap; }
.cat-price b { font-size: 1rem; }
.cat-cta { display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px; border-radius: 999px; background: var(--gold-soft); color: var(--gold);
  font-weight: 700; font-size: .75rem; white-space: nowrap; transition: background .2s, color .2s; }
a.cat-tile:hover .cat-cta { background: var(--gold-strong); color: #1a1300; }
[dir="rtl"] .cat-cta .flip { transform: scaleX(-1); }
.cat-tile.disabled { filter: grayscale(1); opacity: .55; cursor: not-allowed; }
@media (max-width: 520px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .cat-body { padding: 10px 12px 12px; }
  .cat-body h3 { font-size: .9rem; } .cat-foot { flex-direction: column; align-items: stretch; } .cat-cta { justify-content: center; } }
.home-preview .cat-tile { pointer-events: none; max-width: 280px; }

/* ادمین / مدیر: خرید برای خدمات‌دهنده */
.staff-buy { border-color: #93c5fd; background: #eff6ff; }
:root[data-theme="dark"] .staff-buy, :root:not([data-theme]) .staff-buy { background: rgba(59, 130, 246, .1); }
.staff-results { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow: auto; }
.staff-result { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  cursor: pointer; font: inherit; color: var(--text); text-align: start; }
.staff-result:hover { border-color: #3b82f6; }
