/**
 * پنل کاربری — پورت‌شده از دموی user-panel/assets/css/style.css.
 *
 * چیدمان دمو دست‌نخورده مانده و فقط رنگ‌ها به توکن‌های قالب سلامت نگاشته
 * شده‌اند (بخش :root پایین). عمداً کپی شده نه بازنویسی، تا اگر دمو به‌روز
 * شد بشود دوباره پورت کرد و تفاوت‌ها را دید.
 *
 * این شیت فقط روی /panel/ بار می‌شود و آنجا شیت‌های فرانت سایت از صف خارج
 * می‌شوند؛ پس ریست سراسری‌اش (* و body) با بقیه صفحات تداخل ندارد.
 *
 * @package Salamat
 */

:root {
  /* پالت پنل — نگاشته به توکن‌های قالب سلامت.
     خنثی‌ها (bg/text/gray/border/light) از قبل با طرح سلامت یکی بودند؛
     فقط رنگ اصلی از نارنجی فاما به سبزآبی سلامت عوض شده و قاب تیره هم
     به‌جای سرمه‌ای، یک سبزآبی خیلی تیره است تا با بقیه سایت هم‌خانواده بماند. */
  --primary: var(--sl-teal, #00897b);
  --primary-soft: var(--sl-teal-soft, #e6f3f2);
  --primary-600: var(--sl-teal-600, #00796b);
  --accent: var(--sl-orange, #f97316);
  --accent-soft: #fff1e6;
  --dark: #082a25;
  --dark-2: #0d3a33;
  --bg: var(--sl-bg-soft, #f9fafc);
  --text: var(--sl-ink, #040404);
  --gray: var(--sl-muted, #828282);
  --border: var(--sl-border, #ededed);
  /* قاب کنترل‌های فرم — کنتراست ۳ به ۱ روی سفید (توضیح در theme.css) */
  --field-line: var(--sl-field-line, #949494);
  --light: var(--sl-line, #f3f3f3);
  --purple: #2b1d9a;
  --purple-soft: #eae8f5;
  --green: #009966;
  --green-soft: #f0f9f6;
  --yellow: #f5a70d;
  --yellow-soft: #fefaf0;
  --red: #f83636;
  --red-soft: #fff3f3;
  --badge-red: #ed1944;
  --dot-gray: #d8d8d8;
  --blue: #1d63d1;
  --blue-soft: #eaf1fd;

  --sidebar-w: 275px;
  --gap: 16px;
  --radius: 12px;
  --content-max: 1600px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100%;
  font-family: var(--sl-font, 'Yekan Bakh FaNum', Tahoma, sans-serif);
  background: var(--dark);
  direction: rtl;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
input, textarea, select { font-family: inherit; border: 0; outline: none; background: transparent; }
img { display: block; max-width: 100%; }
svg { display: block; flex: none; }

/* ==========================================================================
   قاب اصلی — سایدبار + محتوا
   ========================================================================== */
.page {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  background: var(--dark);
}

/* ---------- سایدبار ---------- */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  flex: none;
  align-self: flex-start;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(0,0,0,.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
body.nav-open .sidebar-overlay { opacity: 1; visibility: visible; }
body.nav-open { overflow: hidden; }

/* ---------- لوگو ---------- */
.box-logo {
  flex: none;
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: linear-gradient(to left, rgba(255,255,255,.04), rgba(255,255,255,.01));
}
.logo-badge { width: 48px; height: 48px; flex: none; }
.logo-badge svg { width: 100%; height: 100%; }
.logo-data { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.logo-title { color: #fff; font-size: 20px; font-weight: 800; line-height: 24px; }
.logo-sub { color: #fff; font-size: 12px; font-weight: 400; line-height: 16px; }
.logo-data--dark .logo-title, .logo-data--dark .logo-sub { color: var(--text); }

/* ---------- منوی سایدبار ---------- */
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}
.sidebar-btn {
  min-height: 48px;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: #fff;
  font-size: 16px; font-weight: 400; line-height: 24px;
  transition: background .18s ease;
}
.sidebar-btn span { flex: 1; }
.sidebar-btn:hover { background: rgba(255,255,255,.07); }
.sidebar-btn.active { background: var(--primary); }
.sidebar-btn.active:hover { background: var(--primary); }
.sidebar-sep {
  height: 1px;
  flex: none;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.16) 50%, rgba(255,255,255,0) 100%);
}

/* ---------- ناحیه اصلی ---------- */
.main {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  /* فقط لبه‌ی مجاور سایدبار گرد است، لبه‌ی بیرونی صاف می‌ماند */
  border-radius: 0 20px 20px 0;
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
/* محتوا روی نمایشگرهای عریض بیش از حد کشیده نشود */
.main > * {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
}

/* ---------- هدر ---------- */
.topbar {
  position: relative;
  z-index: 20;
  flex: none;
  min-height: 80px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex; flex-direction: row-reverse;
  justify-content: space-between; align-items: center;
  gap: 16px;
  padding: 16px;
}
.topbar-user { display: flex; align-items: center; gap: 12px; direction: ltr; }
.user-chip {
  direction: rtl;
  height: 48px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-meta { display: flex; flex-direction: column; text-align: right; }
.user-name { color: var(--text); font-size: 12px; font-weight: 600; line-height: 16px; white-space: nowrap; }
.user-phone { color: var(--gray); font-size: 12px; font-weight: 400; line-height: 16px; }
.user-chip .chev { color: var(--gray); }
.vsep {
  width: 1px; height: 40px; flex: none;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.08) 50%, rgba(0,0,0,0) 100%);
}
.icon-btn {
  position: relative;
  width: 48px; height: 48px; flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
}
.icon-btn .dot {
  position: absolute; top: 0; left: 40px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
}
.topbar-menu { display: flex; align-items: center; gap: 40px; }
.topbar-menu a { color: var(--gray); font-size: 16px; font-weight: 400; line-height: 24px; white-space: nowrap; transition: color .18s ease; }
.topbar-menu a:hover { color: var(--primary); }

/* ---------- دکمه همبرگر (موبایل/تبلت) ---------- */
.menu-btn {
  display: none;
  width: 48px; height: 48px; flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  align-items: center; justify-content: center;
  color: var(--text);
}

/* ---------- سربرگ صفحه ---------- */
.page-head {
  flex: none;
  display: flex; flex-direction: column; gap: 8px;
  padding: 0 4px;
}
.page-title { color: var(--text); font-size: 24px; font-weight: 800; line-height: 32px; }
.breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 12px; line-height: 16px;
}
.bc-item { display: flex; align-items: center; gap: 7px; color: var(--text); font-weight: 400; }
.bc-item svg { color: var(--gray); }
.bc-arrow { color: var(--gray); }
.bc-current { color: var(--text); font-weight: 600; }

/* ---------- بدنه محتوا ---------- */
.content {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  align-content: start;
}
.content > * { grid-column: 1 / -1; min-width: 0; }
.content > .panel { grid-column: auto; }

/* ==========================================================================
   داشبورد — کارت‌های آماری
   ========================================================================== */
.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--gap);
}
.card-number {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  overflow: hidden;
}
.cn-decor {
  position: absolute;
  left: 45%; top: -75px;
  width: 167.7px; height: 163.4px;
  background: var(--primary-soft);
  border-radius: 20px;
  opacity: .3;
  pointer-events: none;
}
.cn-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; }
.cn-icon { width: 24px; height: 24px; flex: none; color: var(--gray); }
.cn-data { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cn-title { color: var(--text); font-size: 14px; font-weight: 600; line-height: 20px; }
.cn-value { min-height: 24px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cn-num { color: var(--primary); font-size: 16px; font-weight: 600; line-height: 24px; }
.cn-unit { color: var(--gray); font-size: 10px; font-weight: 400; line-height: 24px; letter-spacing: -.2px; }
.cn-foot { position: relative; margin-top: 8px; min-height: 24px; }
.cn-caption { color: var(--gray); font-size: 12px; font-weight: 400; line-height: 24px; letter-spacing: -.24px; }
.cn-foot--link { display: flex; justify-content: space-between; align-items: center; }
.cn-foot--link svg { color: var(--primary); }
.cn-link { color: var(--primary); font-size: 12px; font-weight: 600; line-height: 24px; letter-spacing: -.24px; }

/* ---------- پیام اطلاع‌رسانی ---------- */
.alert-panel {
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 16px;
  padding: 16px;
}
.alert-panel--purple { background: var(--purple-soft); border: 1px solid var(--purple-soft); }
.alert-panel--purple .alert-icon { background: var(--purple); }
.alert-panel--orange { background: var(--primary-soft); border: 1px solid var(--primary-soft); }
.alert-panel--orange .alert-icon { background: var(--accent); }
.alert-panel--green { background: var(--green-soft); border: 1px solid var(--green-soft); }
.alert-panel--green .alert-icon { background: var(--green); }
.alert-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex: none;
}
.alert-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.alert-title { color: var(--text); font-size: 16px; font-weight: 600; line-height: 24px; }
.alert-text { color: var(--gray); font-size: 12px; font-weight: 400; line-height: 20px; }

/* ---------- پنل‌ها ---------- */
.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding-top: 15px;
  overflow: hidden;
}
.panel-head {
  flex: none;
  min-height: 40px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px;
  padding: 0 0 0 16px;
}
.ph-title { display: flex; align-items: center; gap: 16px; min-height: 24px; }
.ph-bar { width: 2px; height: 20px; flex: none; background: var(--primary); border-radius: 8px 0 0 8px; }
.ph-title span:last-child { color: var(--text); font-size: 16px; font-weight: 600; line-height: 24px; }
.ph-more {
  display: flex; flex-direction: row-reverse; align-items: center; gap: 8px;
  margin-top: 4px;
  color: var(--gray);
  font-size: 14px; font-weight: 600; line-height: 20px;
  white-space: nowrap;
}
.ph-more:hover { color: var(--primary); }
.panel-body {
  flex: 1;
  margin: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--gap);
  align-content: start;
}

/* ---------- کارت مطلب (بلاگ) ---------- */
.blog-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 3px 12px rgba(0,0,0,.1);
  padding: 12px;
  display: flex; flex-direction: column;
}
.blog-img { position: relative; aspect-ratio: 245 / 170; }
.blog-img img { width: 100%; height: 100%; border-radius: var(--radius); object-fit: cover; }
.date-badge {
  position: absolute; right: 10px; top: 10px;
  width: 70px; height: 70px;
  background: rgba(255,255,255,.4);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 10px;
  box-shadow: 0 15px 30px rgba(0,0,0,.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.db-day { color: var(--text); font-size: 24px; font-weight: 400; line-height: 22px; }
.db-month { color: var(--text); font-size: 13px; font-weight: 400; line-height: 22px; margin-top: 5px; }
.blog-title { margin-top: 12px; color: var(--text); font-size: 16px; font-weight: 600; line-height: 24px; }
.blog-excerpt { margin-top: 12px; flex: 1; color: var(--gray); font-size: 14px; font-weight: 400; line-height: 20px; text-align: justify; }
.blog-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--dot-gray); display: flex; justify-content: flex-end; }
.blog-more { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; font-weight: 400; line-height: 20px; }
.blog-more svg { color: var(--gray); }

/* ---------- کارت محصول ---------- */
.shop-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 0 15px rgba(0,0,0,.08);
  padding: 16px;
  display: flex; flex-direction: column; align-items: stretch; gap: 16px;
}
.discount-badge {
  position: absolute; left: 16px; top: 16px;
  width: 36px; height: 36px;
  background: var(--badge-red);
  border-radius: 100px;
  color: #fff; font-size: 12px; font-weight: 400; line-height: 16px;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.fav-btn {
  position: absolute; right: 16px; top: 16px;
  width: 30px; height: 30px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  z-index: 1;
}
.shop-img { width: 100%; aspect-ratio: 1; }
.shop-img img { width: 100%; height: 100%; object-fit: contain; }
.shop-title { flex: 1; color: var(--text); font-size: 16px; font-weight: 600; line-height: 24px; }
.shop-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; direction: ltr; }
.price-col { direction: rtl; display: flex; flex-direction: column; gap: 4px; }
.price-row { display: flex; align-items: flex-start; gap: 4px; }
.price-new { color: var(--text); font-size: 16px; font-weight: 700; line-height: 18px; }
.price-unit { color: var(--text); font-size: 14px; font-weight: 300; line-height: 18px; }
.price-old { color: var(--gray); font-size: 16px; font-weight: 400; line-height: 16px; text-decoration: line-through; }
.cart-btn {
  width: 48px; height: 48px; flex: none;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}

/* ---------- اسلایدر ---------- */
.panel .slider-dots {
  order: 3;
  display: flex; gap: 4px; align-items: center; justify-content: center;
  direction: ltr;
  padding-bottom: 16px;
}
.sd { width: 10px; height: 10px; border-radius: 100px; background: var(--dot-gray); }
.sd--active { width: 20px; background: var(--primary); }
.panel .slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 3px 12px rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  z-index: 2;
}
.panel .slider-arrow--start { right: 4px; }
.panel .slider-arrow--end { left: 4px; }

/* ---------- پاپ‌آورها ---------- */
.popover {
  position: absolute;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  z-index: 30;
  overflow: hidden;
}
.popover--profile { left: 16px; width: 160px; }
.popover--notif { left: 200px; width: 266px; max-width: calc(100% - 32px); }
.pop-btn { color: var(--text) !important; border-radius: 0 !important; }
.popover--profile .pop-btn:first-child { border-bottom: 1px solid var(--border); }
.pop-ic { color: var(--gray); display: flex; }
.notif-head {
  min-height: 48px;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 16px; line-height: 24px;
}
.notif-item { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.notif-item--line { border-bottom: 1px solid var(--border); }
.ni-head { display: flex; flex-direction: column; gap: 4px; }
.ni-title { color: var(--text); font-size: 16px; font-weight: 400; line-height: 24px; }
.ni-date { color: var(--gray); font-size: 12px; line-height: 16px; }
.ni-text { color: var(--gray); font-size: 12px; line-height: 16px; }

/* ==========================================================================
   صفحه‌های جدولی و فرم‌ها
   ========================================================================== */
.sheet {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.sheet--pad { gap: 16px; align-items: stretch; }

/* ---------- فیلترها ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.filters > * { flex: 1 1 220px; }

/* ---------- فرم ---------- */
.form-input { display: flex; flex-direction: column; gap: 8px; flex: 1 1 220px; min-width: 0; }
.form-input > label { color: var(--text); font-size: 16px; font-weight: 600; line-height: 24px; }
.form-group {
  min-height: 48px;
  background: #fff;
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  transition: border-color .18s ease;
}
.form-group:focus-within { border-color: var(--primary); }
.form-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}
.form-group input, .form-group select {
  flex: 1;
  color: var(--text);
  font-size: 14px; font-weight: 600; line-height: 24px;
  text-align: right;
  min-width: 0;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--gray); font-weight: 400; }
.fi-icon { width: 20px; height: 20px; color: var(--gray); flex: none; }
.form-group--area { min-height: 127px; align-items: flex-start; }
.form-group--area textarea {
  flex: 1; min-height: 100px; resize: vertical;
  color: var(--text); font-size: 14px; font-weight: 600; line-height: 24px;
  text-align: right;
}
.form-row { display: flex; flex-wrap: wrap; gap: 16px; }
.form-hint { color: var(--gray); font-size: 12px; line-height: 18px; }

/* ---------- دکمه‌ها ---------- */
.btn {
  min-height: 48px;
  border-radius: 16px;
  display: inline-flex; direction: ltr;
  align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  font-size: 16px; font-weight: 400; line-height: 24px;
  flex: none;
  transition: filter .18s ease, background .18s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-ghost { color: var(--primary); }
.btn--center { align-self: center; }
.btn--block { width: 100%; }
.sheet--pad > .btn { align-self: flex-end; }
.btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 32px;
  padding: 4px 20px;
  border: 1px solid var(--purple);
  border-radius: var(--radius);
  color: var(--purple);
  font-size: 15px; font-weight: 400; line-height: 24px;
  white-space: nowrap;
}
.btn-outline--primary { border-color: var(--primary); color: var(--primary); }

/* ---------- جدول ---------- */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; min-width: 760px; border-collapse: collapse; }
.table th {
  height: 48px;
  background: var(--light);
  padding: 12px;
  text-align: right;
  color: var(--text);
  font-size: 15px; font-weight: 700; line-height: 24px;
  white-space: nowrap;
}
.table th:first-child { border-radius: 0 8px 8px 0; }
.table th:last-child { border-radius: 8px 0 0 8px; }
.table td {
  height: 56px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  color: var(--gray);
  font-size: 15px; font-weight: 400; line-height: 24px;
  background: #fff;
}
.table--orders th, .table--orders td { width: 20%; }
.table--downloads th, .table--downloads td { width: 33.333%; }
.table--vieworder th, .table--vieworder td { width: 50%; }
td.col-links .btn-outline { margin-bottom: 4px; }
td.col-links .btn-outline + .btn-outline { margin-right: 10px; }

/* ---------- برچسب وضعیت ---------- */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 100px; min-height: 24px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px; font-weight: 400; line-height: 16px;
  white-space: nowrap;
}
.badge--purple { background: var(--purple-soft); color: var(--purple); }
.badge--green  { background: var(--green-soft);  color: var(--green); }
.badge--yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge--red    { background: var(--red-soft);    color: var(--red); }
.badge--orange { background: var(--accent-soft); color: var(--accent); }
.badge--blue   { background: var(--blue-soft);   color: var(--blue); }
.badge--gray   { background: var(--light);       color: var(--gray); }

/* ---------- صفحه‌بندی ---------- */
.pagination {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center;
  margin-top: 24px;
  direction: ltr;
}
.pg {
  width: 40px; height: 40px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 0 20px rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  font-size: 18px; font-weight: 400;
}
.pg--active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 0 30px rgba(0,0,0,.1); }

/* ==========================================================================
   پروفایل (ویرایش حساب)
   ========================================================================== */
.account-card {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; flex-direction: column; gap: 16px;
}
.tabs {
  border-bottom: 1px solid var(--light);
  display: flex; gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 16px;
  color: var(--gray);
  font-size: 16px; font-weight: 400; line-height: 24px;
  white-space: nowrap;
  flex: none;
}
.tab-btn.active {
  color: var(--primary);
  font-weight: 700;
  border-bottom: 2px solid var(--primary);
}
.avatar-upload { position: relative; width: 104px; height: 100px; align-self: center; }
.avatar-img {
  width: 100px; height: 100px;
  border: 1px solid var(--dot-gray);
  border-radius: 58px;
  object-fit: cover;
}
.avatar-cam {
  position: absolute; left: 64px; top: 60px;
  width: 40px; height: 40px;
  background: var(--primary);
  border: 1px solid var(--dot-gray);
  border-radius: 256px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.avatar-cam svg { width: 24px; height: 24px; }
.account-form { display: flex; flex-direction: column; gap: 16px; }
.gender-field { display: flex; flex-direction: column; gap: 8px; }
.gender-field > label { color: var(--text); font-size: 16px; font-weight: 600; line-height: 24px; }
.gender-opts { display: flex; flex-wrap: wrap; gap: 20px; }
.radio { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); font-size: 16px; line-height: 24px; }
.radio input { display: none; }
.radio-mark {
  width: 24px; height: 24px;
  background: #fff;
  border: 1px solid var(--field-line);
  border-radius: 20px;
  position: relative;
  flex: none;
}
.radio input:checked + .radio-mark { border-color: var(--primary); }
.radio input:checked + .radio-mark::after {
  content: '';
  position: absolute; inset: 3px;
  background: var(--primary);
  border-radius: 20px;
}

/* ==========================================================================
   مشاهده سفارش
   ========================================================================== */
.order-intro { color: var(--gray); font-size: 16px; font-weight: 400; line-height: 28px; }
.order-intro b { color: var(--text); font-weight: 700; }
.order-intro .badge { vertical-align: middle; margin: 0 4px; }
.section-title { color: #111; font-size: 20px; font-weight: 800; line-height: 24px; }
.totals-row { display: flex; flex-wrap: wrap; gap: 16px; }
.total-cell { flex: 1 1 240px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; }
.tc-label { color: var(--text); font-size: 16px; font-weight: 700; line-height: 24px; }
.tc-val { color: var(--gray); font-size: 16px; font-weight: 400; line-height: 24px; }
.tc-val--dark { color: var(--text); font-size: 14px; line-height: 20px; }
.bill-rows { display: flex; flex-direction: column; gap: 16px; }
.bill-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 50px; }
.br-label { display: flex; align-items: center; gap: 4px; color: var(--text); font-size: 16px; font-weight: 700; line-height: 24px; min-width: 140px; }
.br-label svg { color: var(--gray); }
.br-val { color: var(--text); font-size: 14px; font-weight: 400; line-height: 20px; }

/* ==========================================================================
   کیف پول
   ========================================================================== */
.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap);
}
.balance-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 100%);
  border-radius: var(--radius);
  padding: 24px;
  color: #fff;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 180px;
}
.balance-card::after {
  content: '';
  position: absolute; left: -40px; top: -60px;
  width: 190px; height: 190px;
  background: var(--primary);
  opacity: .18;
  border-radius: 32px;
  transform: rotate(18deg);
}
.bc-label { position: relative; color: rgba(255,255,255,.72); font-size: 14px; line-height: 20px; }
.bc-amount { position: relative; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.bc-amount strong { font-size: 32px; font-weight: 800; line-height: 40px; }
.bc-amount span { font-size: 14px; color: rgba(255,255,255,.72); }
.bc-actions { position: relative; margin-top: auto; display: flex; flex-wrap: wrap; gap: 12px; }
.bc-actions .btn { min-height: 40px; padding: 8px 20px; font-size: 14px; }
.bc-actions .btn-ghost { color: #fff; border: 1px solid rgba(255,255,255,.28); }

.stat-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
}
.st-icon {
  width: 48px; height: 48px; flex: none;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.st-icon--green { background: var(--green-soft); color: var(--green); }
.st-icon--red { background: var(--red-soft); color: var(--red); }
.st-icon--yellow { background: var(--yellow-soft); color: var(--yellow); }
.st-icon--blue { background: var(--blue-soft); color: var(--blue); }
.st-data { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-title { color: var(--gray); font-size: 13px; line-height: 20px; }
.st-value { color: var(--text); font-size: 18px; font-weight: 700; line-height: 26px; }
.st-value small { font-size: 12px; font-weight: 400; color: var(--gray); }

.amount-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  font-size: 14px; line-height: 20px;
  background: #fff;
  transition: all .18s ease;
}
.chip:hover, .chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.amount-in { color: var(--green); font-weight: 600; }
.amount-out { color: var(--red); font-weight: 600; }

/* ==========================================================================
   تیکتینگ
   ========================================================================== */
.sheet-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.sheet-head .btn { min-height: 42px; padding: 10px 20px; font-size: 15px; }

.ticket-subject { color: var(--text); font-weight: 600; }
.ticket-subject small { display: block; color: var(--gray); font-weight: 400; font-size: 12px; margin-top: 2px; }

.thread { display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 12px; max-width: 82%; }
.msg--me { align-self: flex-start; flex-direction: row-reverse; }
.msg--support { align-self: flex-end; }
.msg-avatar {
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: var(--light);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray);
}
.msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-bubble {
  border-radius: 16px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
}
.msg--me .msg-bubble { background: var(--primary-soft); border: 1px solid #ffe0d6; border-top-right-radius: 4px; }
.msg--support .msg-bubble { background: var(--light); border: 1px solid var(--border); border-top-left-radius: 4px; }
.msg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.msg-name { color: var(--text); font-size: 14px; font-weight: 700; line-height: 20px; }
.msg-time { color: var(--gray); font-size: 12px; line-height: 16px; }
.msg-text { color: var(--text); font-size: 14px; font-weight: 400; line-height: 26px; text-align: justify; }
.msg-file {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
}
.msg-file svg { color: var(--primary); }

.ticket-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tm-item { display: flex; flex-direction: column; gap: 4px; }
.tm-label { color: var(--gray); font-size: 12px; line-height: 18px; }
.tm-value { color: var(--text); font-size: 15px; font-weight: 600; line-height: 22px; }

.file-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 120px;
  padding: 20px;
  border: 1.5px dashed var(--dot-gray);
  border-radius: var(--radius);
  color: var(--gray);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.file-drop:hover { border-color: var(--primary); background: var(--primary-soft); }
.file-drop strong { color: var(--text); font-size: 15px; font-weight: 600; }
.file-drop span { font-size: 12px; }
.file-drop svg { color: var(--primary); }
.file-drop input { display: none; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 56px 20px;
  text-align: center;
  color: var(--gray);
}
.empty-state strong { color: var(--text); font-size: 18px; font-weight: 700; }
.empty-state svg { color: var(--dot-gray); }

/* ==========================================================================
   ورود / کد تایید
   ========================================================================== */
.login-body { background: #fff; }
.login-page {
  position: relative;
  min-height: 100vh;
  background: var(--bg);
  overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 24px;
  padding: 40px 16px;
}
.login-tint { display: none; }
.login-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .2;
  pointer-events: none;
}
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 424px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 24px;
  display: flex; flex-direction: column; gap: 24px;
}
.lc-head { align-self: center; display: flex; flex-direction: column; gap: 8px; max-width: 280px; }
.lc-head h1 { color: var(--text); font-size: 28px; font-weight: 700; line-height: 40px; text-align: center; }
.lc-head p { color: var(--gray); font-size: 16px; font-weight: 300; line-height: 24px; text-align: center; }
.login-card .form-input { flex: none; }
.login-card .btn { width: 100%; }
.login-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); font-size: 15px; font-weight: 300; line-height: 24px; }
.checkbox input { display: none; }
.check-mark {
  width: 24px; height: 24px;
  background: #fff;
  border: 1px solid var(--field-line);
  border-radius: 8px;
  flex: none;
}
.checkbox input:checked + .check-mark { background: var(--primary); border-color: var(--primary); }
.forgot { color: var(--text); font-size: 15px; font-weight: 400; line-height: 24px; }
.login-brand {
  position: relative;
  z-index: 1;
  display: flex; align-items: center; gap: 12px;
}
.otp-note { color: var(--text); font-size: 15px; font-weight: 300; line-height: 26px; }
.otp-field { display: flex; flex-direction: column; gap: 12px; }
.otp-field > label { color: var(--text); font-size: 16px; font-weight: 600; line-height: 24px; }
.otp-boxes { display: flex; gap: 12px; direction: ltr; justify-content: center; }
.otp-boxes input {
  width: 56px; height: 56px;
  max-width: 18%;
  background: #fff;
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text);
  font-size: 20px; font-weight: 600;
}
.otp-timer { color: var(--text); font-size: 14px; font-weight: 600; line-height: 20px; text-align: center; }
.otp-timer-label { color: var(--text); font-size: 14px; font-weight: 300; line-height: 20px; text-align: center; }

/* ==========================================================================
   ابزارهای کمکی
   ========================================================================== */
.only-mobile { display: none; }

/* ==========================================================================
   بریک‌پوینت‌ها
   ========================================================================== */

/* دسکتاپ کوچک — پنل‌های داشبورد تک‌ستونه */
@media (max-width: 1180px) {
  .content { grid-template-columns: 1fr; }
  .content > .panel { grid-column: 1 / -1; }
  .topbar-menu { gap: 24px; }
}

/* تبلت — سایدبار کشویی */
@media (max-width: 1024px) {
  .page { display: block; }
  .sidebar {
    position: fixed;
    top: 0; right: 0;
    height: 100dvh;
    background: var(--dark);
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: -8px 0 32px rgba(0,0,0,.28);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .main {
    border-radius: 0;
    min-height: 100vh;
  }
  .menu-btn { display: flex; }
  .topbar-menu { display: none; }
}

/* موبایل بزرگ */
@media (max-width: 768px) {
  :root { --gap: 12px; }
  .topbar { min-height: 72px; padding: 12px; border-radius: var(--radius); }
  .page-title { font-size: 20px; line-height: 28px; }
  .user-meta { display: none; }
  .user-chip { padding: 6px; }
  .icon-btn { width: 42px; height: 42px; }
  .icon-btn .dot { left: 34px; }
  .menu-btn { width: 42px; height: 42px; }
  .popover--notif { left: 12px; right: 12px; width: auto; max-width: none; }
  .popover--profile { left: 12px; }
  .sheet { padding: 12px; }
  .cn-decor { display: none; }
  .alert-panel { align-items: flex-start; }
  .alert-icon { width: 44px; height: 44px; }
  .msg { max-width: 100%; }
  .balance-card { padding: 20px; }
  .bc-amount strong { font-size: 26px; line-height: 34px; }
  .sheet--pad > .btn { align-self: stretch; }
  .only-mobile { display: initial; }
}

/* موبایل کوچک */
@media (max-width: 480px) {
  .sidebar { width: 84vw; max-width: 300px; }
  .main { padding: 12px 10px; }
  .panel-body { grid-template-columns: 1fr; }
  .cards-row { grid-template-columns: 1fr; }
  .otp-boxes { gap: 8px; }
  .login-card { padding: 28px 18px; }
  .lc-head h1 { font-size: 24px; line-height: 34px; }
  .vsep { display: none; }
  .topbar-user { gap: 8px; }
  .sheet-head { flex-direction: column; align-items: stretch; }
  .sheet-head .btn { width: 100%; }
}

/* پرینت */
@media print {
  .sidebar, .sidebar-overlay, .topbar, .pagination, .menu-btn { display: none !important; }
  .main { padding: 0; background: #fff; }
  body { background: #fff; }
}

/* کاهش انیمیشن */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   افزوده‌های قالب سلامت — اجزایی که دموی فروشگاهی نداشت
   ========================================================================== */

/* ---------- ورود لازم است (میهمان) ---------- */
.guest-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--dark);
}

.guest-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 32px;
  background: #fff;
  border-radius: 20px;
  text-align: center;
}

.guest-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-block-end: 24px;
  color: var(--primary);
}

.guest-logo .logo-badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-soft);
}

.guest-logo .logo-title { font-size: 18px; font-weight: 700; color: var(--text); }
.guest-title { margin-block-end: 8px; font-size: 22px; font-weight: 700; }
.guest-text { margin-block-end: 24px; color: var(--gray); font-size: 15px; line-height: 26px; }
.guest-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.guest-hint { margin-block-start: 20px; color: var(--gray); font-size: 13px; }

/* ---------- شمارنده کنار آیتم سایدبار ---------- */
.side-count {
  margin-inline-start: auto;   /* rtl-ok: عدد به لبه چپ دکمه می‌رود — عمدی */
  min-width: 22px;
  padding: 0 6px;
  border-radius: 100px;
  background: var(--badge-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

/* ---------- ابزار بازبینی ادمین ---------- */
.side-preview { margin-block-start: auto; padding: 16px; }

.side-preview__label {
  display: block;
  margin-block-end: 8px;
  color: rgba(255, 255, 255, .5);
  font-size: 11px;
}

.side-preview__row { display: flex; gap: 6px; }

.side-preview__btn {
  flex: 1 1 0;
  padding: 6px 4px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 8px;
  color: rgba(255, 255, 255, .7);
  font-size: 12px;
  text-align: center;
}

.side-preview__btn.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- حالت خالی ---------- */
.panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
}

.panel-empty__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.panel-empty__text { color: var(--gray); font-size: 15px; line-height: 26px; max-width: 420px; }

/* ---------- جزئیات نوبت ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-block-start: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.di-label { color: var(--gray); font-size: 12px; }
.di-value { font-size: 15px; font-weight: 600; }
.di-value a { color: var(--primary); }

.detail-note {
  margin-block-start: 16px;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
}

.detail-note p { margin-block-start: 6px; font-size: 15px; line-height: 26px; }

/* ----------------------------------------- جلسه ویزیت آنلاین */

.sl-meet__hint { color: var(--muted, #828282); }

.sl-meet__actions { margin-block-start: 12px; }

/*
 * دکمه‌ی ورود پیش از باز شدن پنجره، خاموش نشان داده می‌شود نه پنهان:
 * بیمار می‌بیند که جلسه‌ای هست و فقط هنوز وقتش نرسیده.
 */
.btn.is-disabled {
  opacity: .5;
  pointer-events: none;
}

.sl-meet__form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-block-start: 12px;
}

.sl-meet__input {
  flex: 1 1 320px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line, #E4E8EC);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  font-size: 14px;
}

.sl-meet__input:focus { outline: 2px solid var(--brand, #00897B); outline-offset: 1px; }

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-block-start: 24px;
}

.inline-form { display: inline-flex; }

.btn-outline--red { border-color: var(--red); color: var(--red); }
.btn-outline--red:hover { background: var(--red-soft); }

/* ---------- کارت پزشک مورد علاقه ---------- */
.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
}

.fav-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.fav-card__top { display: flex; align-items: center; gap: 14px; }

.fav-card__photo {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}

.fav-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.fav-card__name { font-size: 16px; font-weight: 700; line-height: 24px; }
.fav-card__spec { color: var(--gray); font-size: 13px; }
.fav-card__foot { display: flex; align-items: center; gap: 10px; }
.fav-card__foot .btn { flex: 1 1 auto; }

/* ---------- گفتگوی تیکت ---------- */
.ticket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-block-start: 16px;
  padding-block-end: 16px;
  border-block-end: 1px solid var(--light);
  color: var(--gray);
  font-size: 13px;
}

.chat { display: flex; flex-direction: column; gap: 14px; margin-block-start: 20px; }

.chat-msg {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.chat-msg--me { background: var(--bg); }
.chat-msg--staff { background: var(--primary-soft); border-color: var(--primary-soft); }

.chat-msg__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block-end: 8px;
}

.chat-msg__who { font-size: 14px; font-weight: 700; }

.chat-msg__tag {
  margin-inline-start: 6px;   /* rtl-ok: بعدِ نام می‌آید، پس در rtl سمت چپ — عمدی */
  padding: 1px 8px;
  border-radius: 100px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-style: normal;
}

.chat-msg__when { color: var(--gray); font-size: 12px; }
.chat-msg__body { font-size: 15px; line-height: 28px; }
.chat-msg__body p + p { margin-block-start: 10px; }

.reply-form { margin-block-start: 24px; }
.ticket-closed { margin-block-start: 20px; color: var(--gray); font-size: 14px; }

/* ---------- فهرست اعلان‌ها ---------- */
.notice-list { display: flex; flex-direction: column; }

.notice-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border-block-end: 1px solid var(--light);
}

.notice-item:last-child { border-block-end: 0; }
.notice-item.is-new { background: var(--primary-soft); }

.notice-item__dot {
  flex: none;
  width: 10px;
  height: 10px;
  margin-block-start: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.notice-item__dot--warn { background: var(--yellow); }
.notice-item__dot--success { background: var(--green); }
.notice-item__body { flex: 1 1 auto; min-width: 0; }
.notice-item__body .ni-text { margin-block-start: 6px; font-size: 14px; line-height: 26px; }

.notice-item__new {
  flex: none;
  padding: 2px 10px;
  border-radius: 100px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* ---------- زبانه‌های فیلتر ---------- */
.tabs--filter { flex-wrap: wrap; border-block-end: 0; }

/* ---------- نشان خاکستری ---------- */
.badge--gray { background: var(--light); color: var(--gray); }

@media (max-width: 640px) {
  .detail-grid { grid-template-columns: 1fr; }
  .fav-grid { grid-template-columns: 1fr; padding: 16px; }
}

/* ---------- پیام‌های صفحه ورود ---------- */
.login-error {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 14px;
  line-height: 24px;
  text-align: center;
}

.otp-note--ok { color: var(--green); }

.login-dev {
  padding: 12px 14px;
  border: 1px dashed var(--yellow);
  border-radius: 10px;
  background: var(--yellow-soft);
  color: #8a5c04;
  font-size: 14px;
  line-height: 24px;
  text-align: center;
}

.login-dev code {
  display: inline-block;
  margin-inline-start: 6px;   /* rtl-ok: بعدِ متن می‌آید — عمدی */
  padding: 2px 10px;
  border-radius: 6px;
  background: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 3px;
}

.login-hint,
.login-back {
  color: var(--gray);
  font-size: 13px;
  line-height: 22px;
  text-align: center;
}

.login-back { display: block; margin-block-start: 4px; }
.login-back:hover { color: var(--primary); }
.login-resend { width: 100%; }
.login-resend .btn { width: 100%; }

/* ------------------------------------------------- برنامه کاری پزشک */

.sl-sched { display: flex; flex-direction: column; gap: 24px; }

.sl-sched__block {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.sl-sched__title { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--text); }
.sl-sched__hint { margin: 0 0 14px; font-size: 13px; line-height: 24px; color: var(--gray); }
.sl-sched__block > .sl-sched__hint:last-child { margin-bottom: 0; }

/* کلید پذیرش نوبت */

.sl-sched__switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; } /* rtl-ok: محور عمودی است — یعنی بالا، نه راست */
.sl-sched__switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.sl-sched__switchbox {
  position: relative;
  flex: none;
  width: 44px;
  height: 24px;
  margin-block-start: 2px;
  border-radius: 100px;
  background: var(--border);
  transition: background-color .2s;
}

.sl-sched__switchbox::after {
  content: "";
  position: absolute;
  top: 3px;
  inset-inline-start: 3px; /* rtl-ok: دستگیره از سمت شروع، یعنی راست */
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}

.sl-sched__switch input:checked + .sl-sched__switchbox { background: var(--primary); }
.sl-sched__switch input:checked + .sl-sched__switchbox::after { transform: translateX(-20px); }
.sl-sched__switch input:focus-visible + .sl-sched__switchbox { outline: 2px solid var(--primary-600); outline-offset: 2px; }

.sl-sched__switchtext { display: flex; flex-direction: column; gap: 4px; }
.sl-sched__switchtext b { font-size: 15px; font-weight: 700; }
.sl-sched__switchtext small { font-size: 13px; line-height: 22px; color: var(--gray); }

/* روزهای هفته */

.sl-sched__days { display: flex; flex-wrap: wrap; gap: 8px; }

.sl-sched__day { cursor: pointer; }
.sl-sched__day input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.sl-sched__day span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--field-line);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray);
  transition: border-color .2s, background-color .2s, color .2s;
}

.sl-sched__day input:checked + span {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.sl-sched__day input:focus-visible + span { outline: 2px solid var(--primary-600); outline-offset: 2px; }

/* بازه‌های ساعتی */

.sl-sched__range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-block-start: 1px solid var(--light);
}

.sl-sched__range:first-of-type { border-block-start: 0; }

.sl-sched__rangelabel { display: flex; flex-direction: column; gap: 2px; }
.sl-sched__rangelabel b { font-size: 14px; font-weight: 700; color: var(--text); }
.sl-sched__rangelabel small { font-size: 12px; color: var(--gray); }

.sl-sched__times { display: flex; align-items: center; gap: 10px; }

.sl-sched__times label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray); }

.sl-sched__times input,
.sl-sched__times select {
  min-width: 108px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  direction: ltr;
}

.sl-sched__times input:focus,
.sl-sched__times select:focus { border-color: var(--primary); outline: none; }

/* تعطیلی موردی */

.sl-sched__dates {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--field-line);
  border-radius: 12px;
  background: var(--bg);
  font: inherit;
  font-size: 14px;
  line-height: 28px;
  color: var(--text);
  resize: vertical;
}

.sl-sched__dates:focus { border-color: var(--primary); outline: none; }

/* پیش‌نمایش تقویم بیمار — همان چیپ‌ها، ولی بدون رادیو. */
.sl-days--preview .sl-day { cursor: default; }
