/* =====================================================================
   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: 15px;
  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.6rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.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: .85rem; }
.btn-block { width: 100%; }
.icon-btn { width: 42px; padding: 0; }

/* ---------------- Forms ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: .9rem; }
.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.6rem; letter-spacing: .6em; text-align: center; direction: ltr; }
.validation-message, .error-text { color: var(--danger); font-size: .85rem; }
.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: .78rem; 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: 1.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); }
.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: 1.05rem; }
.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: .8rem; 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.3rem; 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: 1rem; }

.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; 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: 2rem; }

/* ---------------- 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: .9rem; }
.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: .78rem; 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: .95rem; }
.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: .8rem; }

/* ---------------- 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: .78rem; 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.05rem; }
.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: .85rem; }
.chip-gold { background: var(--gold-soft); color: var(--gold); border-color: transparent; }
.dash-content { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.6rem; margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.kpi .k-label { color: var(--text-muted); font-size: .88rem; }
.kpi .k-value { font-size: 1.9rem; font-weight: 800; line-height: 1.2; margin: 6px 0; }
.kpi .k-sub { color: var(--text-muted); font-size: .82rem; }
.kpi.warn { background: var(--warning-soft); border-color: var(--warning); }
.bar-row { display: grid; grid-template-columns: 140px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: .9rem; }
.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); }
.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: .78rem; 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: .72rem; 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: .8rem; }

/* ---------------- 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: .72rem; color: var(--text-muted); padding: 4px 8px; }
  .mobile-nav a.active { color: var(--gold); }
  .mobile-nav .ico { font-size: 1.2rem; }
  .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; gap: 14px; }
  /* نوار بالای پنل در موبایل: یک ردیف ابزار + یک ردیف تاریخ */
  .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, .lang-menu .lbl, .user-chip .role { display: none; }
  .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: .8rem; }
  .dash-top .chips { display: contents; }
  .page-head h1 { font-size: 1.3rem; }
  .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.15rem; }
.ad-caption span { font-size: .9rem; 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) ---------------- */
#site-loader { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--bg); color: var(--text); text-align: center; transition: opacity .4s ease; }
#site-loader.sl-hide { opacity: 0; pointer-events: none; }
#site-loader .sl-en { font-size: clamp(1.5rem, 5vw, 2.2rem); font-weight: 800; letter-spacing: .02em; direction: ltr; }
#site-loader .sl-ar { font-size: clamp(1.1rem, 3.6vw, 1.5rem); color: var(--gold); font-weight: 600; }
#site-loader .sl-big { font-size: clamp(2.2rem, 9vw, 3.6rem); font-weight: 800; margin-top: 10px; background: var(--gold-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
#site-loader .sl-spin { position: absolute; bottom: calc(10vh + env(safe-area-inset-bottom)); width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--gold-soft); border-top-color: var(--gold-strong); animation: sl-spin .8s linear infinite; }
@keyframes sl-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #site-loader .sl-spin { animation-duration: 2.4s; } }

/* ---------------- ورودی موبایل با پیش‌شماره‌ی کشور ---------------- */
.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: .92rem; 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: 520px) {
  .grid-2:not(.keep) { grid-template-columns: 1fr; }
  .phone-input .phone-country { min-width: 0; max-width: 55%; }
}

/* فرم دسترسی‌ها */
.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); }
