/* ═══════════════════════════════════════
   PROFILE PAGE — استایل استاندارد شده
   (استخراج‌شده از resources/views/app/profile.blade.php)
═══════════════════════════════════════ */

/* ═══════════════════════════════════════
   CSS VARIABLES — DESIGN SYSTEM
═══════════════════════════════════════ */
:root {
  --bg-page:           #000000;
  --text-primary:      #ffffff;
  --text-secondary:    #ffffff;
  --icon:              #ffffff;
  --bg-card:           #3F3F3F;
  --bg-affiliate:      #0d2818;
  --border-affiliate:  #1a5c32;
  --green:             #cffd00;
  --accent:            #a07af5;
  --red:               #f05c5c;
  --border-subtle:     #222230;
  --bg-surface:        #111116;
}
html.light {
  --bg-page:           #ffffff;
  --text-primary:      #000000;
  --text-secondary:    #000000;
  --icon:              #000000;
  --bg-card:           #E5E5E5;
  --bg-affiliate:      #e8f8ee;
  --border-affiliate:  #a8e6be;
  --green:             #cffd00;
  --border-subtle:     #e0e0e0;
  --bg-surface:        #f5f5f5;
}


/* ═══════════════════════════════════════
   FONT — YekanBakh کل صفحه
═══════════════════════════════════════ */
.profile-page,
.profile-page * {
  font-family: 'YekanBakh', 'IRANSansXFaNum', sans-serif !important;
}

/* ═══════════════════════════════════════
   BASE — بک‌گراند شب/روز کامل
═══════════════════════════════════════ */
html, body { overflow-x: hidden; background: var(--bg-page) !important; color: var(--text-primary) !important; }

.profile-page {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-page);
  min-height: 100vh;
  padding-bottom: 120px;
}

/* ═══════════════════════════════════════
   UTILITY: show/hide by breakpoint
═══════════════════════════════════════ */
.show-desktop { display: none !important; }
.hide-desktop { display: flex; }

/* hero-left-group — موبایل پنهان */
.hero-left-group { display: none; }

/* stats-desktop — داخل hero-left-group */
.stats-desktop {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  direction: rtl;
  width: 100%;
}

/* ═══════════════════════════════════════
   HERO SECTION — mobile: stack centered
═══════════════════════════════════════ */
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 16px;
  gap: 12px;
}

/* ═══════════════════════════════════════
   AVATAR
═══════════════════════════════════════ */
.avatar-wrap { flex-shrink: 0; }

.avatar-ring {
  width: 100px; height: 100px;
  border-radius: 50%;
  padding: 3px;
  background: var(--green);
}
.avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  padding: 2px;
  background: var(--bg-page);
}
.avatar-img--placeholder {
  object-fit: contain !important;
  padding: 22%;
  box-sizing: border-box;
  background: var(--bg-page);
  opacity: .55;
}
.sm-avatar-wrap .avatar-img--placeholder { padding: 20%; }

.avatar-img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* ═══════════════════════════════════════
   HERO RIGHT GROUP
═══════════════════════════════════════ */
/* موبایل: ستون (آواتار بالا، اطلاعات پایین) */
.hero-right-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
}

/* ═══════════════════════════════════════
   PROFILE INFO — موبایل: وسط‌چین
═══════════════════════════════════════ */
.profile-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.profile-phone {
  font-size: 15.7px;
  color: rgba(168,196,168,1);
  margin: 0;
  letter-spacing: 0.5px;
}
html.light .profile-phone { color: #5a7a5a; }

/* بج پلن */
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(207,253,0,0.12);
  border: 1px solid rgba(207,253,0,0.3);
  border-radius: 8px;
  padding: 4px 10px;
}
.plan-badge span {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}

/* ═══════════════════════════════════════
   آمار ۴ تایی
═══════════════════════════════════════ */
.stats-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 100%;
  max-width: 360px;
}

.stat-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
}

.stat-sep {
  width: 1px;
  height: 28px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.stat-number {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-number--plan {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

.stat-label {
  font-size: 11px;
  color: rgba(168,196,168,1);
  white-space: nowrap;
}
html.light .stat-label { color: #5a7a5a; }

/* ═══════════════════════════════════════
   دکمه‌های اکشن — راست به چپ: تنظیمات | پشتیبانی | خرید اشتراک
═══════════════════════════════════════ */
.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  direction: rtl;
  width: 100%;
  max-width: 400px;
  margin-top: 6px;
}

/* کارت‌ دکمه (پشتیبانی + تنظیمات) */
.btn-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: none;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  padding: 11px 14px;
  transition: opacity 0.15s;
}
.btn-card:active { opacity: 0.8; }

/* دکمه آیکون مربع (تنظیمات) */
.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  flex-shrink: 0;
}

/* دکمه پشتیبانی */
.btn-support {
  flex: 1.2;
  font-size: 13.65px;
}


/* دکمه خرید اشتراک */
.btn-subscribe {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 10px;
  border: none;
  background: var(--green);
  color: #000000;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
html.light .btn-subscribe { color: #ffffff; }
.btn-subscribe:active { opacity: 0.85; }

.subscribe-badge {
  background: #e91e8c;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

/* باکس نمایش توکن — همان خمیدگی و ارتفاع دکمه خرید اشتراک،
   عدد سمت چپ و آیکون سمت راست. فقط نسخه دسکتاپ. */
.btn-token-box {
  flex-shrink: 0;
  display: none;            /* پیش‌فرض مخفی — فقط دسکتاپ نمایش داده می‌شود */
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;      /* همانند .btn-subscribe */
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  white-space: nowrap;
  transition: opacity 0.15s, border-color 0.15s;
}
.btn-token-box .btn-token-number {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  font-feature-settings: "tnum";
}
.btn-token-box .btn-token-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}
.btn-token-box:hover { opacity: 0.85; }

/* ═══════════════════════════════════════
   SETTINGS DROPDOWN
═══════════════════════════════════════ */
.settings-wrap {
  position: relative;
  flex-shrink: 0;
}

.settings-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 270px;
  background: #111116;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  z-index: 300;
  overflow: hidden;
  transform-origin: top right;
  animation: menuIn 0.18s ease forwards;
}
html.light .settings-menu {
  background: #ffffff;
  border-color: #e0e0e0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

@keyframes menuIn {
  from { transform: scale(0.9) translateY(-6px); opacity: 0; }
  to   { transform: scale(1) translateY(0);      opacity: 1; }
}

.sm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sm-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.sm-avatar-wrap {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.sm-avatar-img { width: 100%; height: 100%; object-fit: cover; }

.sm-name {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sm-phone {
  margin: 2px 0 0;
  font-size: 11px;
  color: rgba(168,196,168,1);
}
html.light .sm-phone { color: #5a7a5a; }

.sm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  direction: rtl;
  text-align: right;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s;
}
.sm-item:last-child { border-bottom: none; }
.sm-item:hover { background: rgba(255,255,255,0.05); }
html.light .sm-item:hover { background: rgba(0,0,0,0.04); }

.sm-item--danger {
  color: var(--red);
}

/* theme toggle داخل منو */
.theme-toggle-btn {
  background: transparent; border: none; cursor: pointer;
  padding: 0; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.theme-toggle-track {
  display: flex; align-items: center;
  width: 46px; height: 26px; border-radius: 99px;
  background: #1a1a2e; border: 1px solid rgba(255,255,255,0.12);
  position: relative; transition: background 0.3s, border-color 0.3s;
}
html.light .theme-toggle-track { background: #e8f0fe; border-color: rgba(0,0,0,0.1); }
.theme-toggle-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  position: absolute; left: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), background 0.3s;
}
html.light .theme-toggle-thumb { transform: translateX(20px); background: #f59e0b; }
.theme-icon-moon { color: #1a1a2e; display: block; }
.theme-icon-sun  { color: #ffffff; display: none; }
html.light .theme-icon-moon { display: none !important; }
html.light .theme-icon-sun  { display: block !important; }

/* ═══════════════════════════════════════
   PROMO SECTION (همکاری در فروش بنر)
═══════════════════════════════════════ */
.promo-section { padding: 0 16px; margin-top: 14px; }

.promo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  direction: rtl;
  background: #687f00; /* سبز اصلی هدر (#cffd00) با ۵۰٪ تیره‌تر */
  border: 1px solid var(--border-affiliate);
  border-radius: 12px;
  padding: 12px 14px;
}
.promo-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  margin: 0;
}
.promo-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  color: #000000;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
html.light .promo-btn { color: #ffffff; }

/* ═══════════════════════════════════════
   TABS SECTION
═══════════════════════════════════════ */
.tabs-section { margin-top: 20px; }

.profile-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-tab {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  color: var(--text-primary);
  transition: color 0.2s;
}
html.light .profile-tab { color: var(--text-primary); }

.profile-tab::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--green);
  opacity: 0;
  transition: opacity 0.2s;
}
.profile-tab.active::after { opacity: 1; }

/* آیکون تصویری — همیشه سفید */
.tab-icon {
  filter: brightness(0) invert(1);
  transition: filter 0.2s, transform 0.15s;
}
.profile-tab.active .tab-icon {
  filter: brightness(0) invert(1);
  transform: scale(1.05);
}
html.light .tab-icon { filter: brightness(0) invert(0); }
html.light .profile-tab.active .tab-icon { filter: brightness(0) invert(0); }

/* آیکون SVG inline — همیشه سفید */
.tab-icon--svg {
  filter: none !important;
  color: var(--text-primary);
  transition: color 0.2s, transform 0.15s;
}
.profile-tab.active .tab-icon--svg {
  color: var(--text-primary);
  transform: scale(1.05);
}
html.light .tab-icon--svg { color: var(--text-primary); }

/* متن تب — موبایل پنهان، دسکتاپ نمایش */
.tab-label {
  display: none;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ═══════════════════════════════════════
   PANELS
═══════════════════════════════════════ */
.profile-panel { width: 100%; }

/* گرید ۳ ستونه */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

/* سیو ۲ ستونه */
.panel-saved {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.grid-cell {
  aspect-ratio: 4/5;
  overflow: hidden;
  position: relative;
  background: var(--bg-surface);
  border-radius: 3px;
}
.grid-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.grid-cell--clickable {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  padding: 0;
  margin: 0;
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: block;
  transition: opacity .15s ease;
}
.grid-cell--clickable:hover,
.grid-cell--clickable:focus-visible { opacity: .9; }
.grid-cell--clickable:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }

.grid-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  text-align: center;
}
.grid-empty p { color: var(--text2, #a8c4a8); font-size: 13px; margin: 0; }
.btn-empty-cta {
  display: inline-block;
  margin-top: 4px;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--green, #cffd00);
  color: #000000;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s ease;
}
html.light .btn-empty-cta { color: #ffffff; }
.btn-empty-cta:hover { opacity: .9; }

.cell-badge {
  position: absolute; top: 6px; right: 6px;
  color: #ffffff; font-size: 11px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.65);
}
.saved-badge {
  position: absolute; top: 7px; left: 7px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

/* ═══════════════════════════════════════
   PANEL: فایل‌ها
═══════════════════════════════════════ */
.storage-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.storage-header {
  display: flex; justify-content: space-between; margin-bottom: 8px; direction: rtl;
}
.storage-title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.storage-used  { font-size: 11px; color: rgba(168,196,168,1); }
html.light .storage-used { color: #5a7a5a; }
.storage-bar {
  width: 100%; height: 6px;
  background: var(--border-subtle);
  border-radius: 99px; overflow: hidden;
}
.storage-fill {
  height: 100%;
  background: linear-gradient(to left, var(--green), #08a045);
  border-radius: 99px;
}
.storage-footer {
  display: flex; justify-content: space-between;
  margin-top: 6px; direction: rtl;
  font-size: 10px; color: rgba(168,196,168,1);
}
html.light .storage-footer { color: #5a7a5a; }
.storage-free { color: rgba(255,255,255,0.3); }
html.light .storage-free { color: rgba(0,0,0,0.25); }

.files-sub-tabs {
  display: flex; gap: 6px; margin-bottom: 14px;
}
.files-sub-tab {
  flex: 1; padding: 9px 8px; border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: rgba(255,255,255,0.4);
  font-size: 13px; font-weight: 400; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
html.light .files-sub-tab { color: rgba(0,0,0,0.35); }
.files-sub-tab.active {
  border-color: var(--green);
  background: rgba(207,253,0,0.1);
  color: var(--green);
  font-weight: 700;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin: 0 -16px;
  width: calc(100% + 32px);
}
.files-cell {
  aspect-ratio: 4/5;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-surface);
  position: relative;
}

/* ═══════════════════════════════════════
   PANEL: همکاری در فروش
═══════════════════════════════════════ */
.referral-program{width:100%;min-width:0;padding:18px;display:grid;gap:20px;scroll-margin-top:84px;box-sizing:border-box}
.referral-program>section,.referral-program>div{width:100%;min-width:0;box-sizing:border-box}
.referral-program-hero{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:22px;border:1px solid var(--border-affiliate);border-radius:18px;background:var(--bg-affiliate)}
.referral-program-hero:before{content:"";position:absolute;width:230px;height:230px;border-radius:50%;left:-90px;top:-120px;background:rgba(207,253,0,.08);pointer-events:none}
.referral-program-copy{position:relative;z-index:1;max-width:680px}
.referral-program-kicker{display:inline-flex;align-items:center;gap:7px;margin-bottom:8px;font-size:10px;font-weight:800;color:var(--green)}
.referral-program-copy h2{margin:0 0 5px;font-size:22px;font-weight:900;color:var(--text-primary)}
.referral-program-lead{margin:0 0 9px;font-size:14px;font-weight:800;color:var(--text-primary)}
.referral-program-description{margin:0;font-size:12px;line-height:2;color:rgba(255,255,255,.66)}
html.light .referral-program-description{color:rgba(0,0,0,.62)}
.referral-reward-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-top:16px}
.referral-reward-summary span{min-height:52px;display:flex;align-items:center;justify-content:center;gap:6px;padding:9px 11px;border:1px solid var(--border-affiliate);border-radius:10px;background:rgba(0,0,0,.13);font-size:10px;line-height:1.7;text-align:center;color:var(--text-primary)}
html.light .referral-reward-summary span{background:rgba(255,255,255,.55)}
.referral-reward-summary i{color:var(--green)}
.referral-program-visual{position:relative;width:150px;height:130px;flex:0 0 150px}
.referral-visual-orbit{position:absolute;inset:18px;border:1px dashed var(--border-affiliate);border-radius:50%;display:flex;align-items:center;justify-content:center;color:var(--green);font-size:22px}
.referral-visual-person,.referral-visual-gift{position:absolute;width:42px;height:42px;border:1px solid var(--border-affiliate);border-radius:13px;display:flex;align-items:center;justify-content:center;background:var(--bg-page);color:var(--text-primary);box-shadow:0 8px 24px rgba(0,0,0,.18)}
.referral-visual-person.is-first{right:0;top:6px}.referral-visual-person.is-second{left:0;bottom:6px}.referral-visual-gift{right:10px;bottom:0;color:var(--green)}
.referral-program-notice{display:flex;align-items:flex-start;gap:9px;padding:12px 14px;border:1px solid rgba(240,92,92,.35);border-radius:12px;background:rgba(240,92,92,.08);color:var(--red);font-size:11px;line-height:1.8}
.referral-dashboard-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.referral-user-stat{min-width:0;padding:14px;border:1px solid var(--border-subtle);border-radius:14px;background:var(--bg-surface);display:grid;grid-template-columns:auto 1fr;column-gap:9px;align-items:center}
.referral-user-stat>span{grid-row:1/3;width:36px;height:36px;border-radius:11px;background:rgba(207,253,0,.09);color:var(--green);display:flex;align-items:center;justify-content:center}
.referral-user-stat strong{font-size:19px;line-height:1;color:var(--text-primary)}
.referral-user-stat small{margin-top:5px;font-size:9.5px;color:rgba(168,196,168,1)}
html.light .referral-user-stat small{color:#5a7a5a}
.referral-user-stat.is-highlight{border-color:var(--border-affiliate);background:var(--bg-affiliate)}
.referral-link-card,.referral-how-card,.referral-invites-card{padding:16px;border:1px solid var(--border-subtle);border-radius:16px;background:var(--bg-surface)}
.referral-link-card.is-disabled{opacity:.68}
.referral-section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.referral-section-heading>div{display:grid;gap:3px}
.referral-section-heading span{font-size:13px;font-weight:900;color:var(--text-primary)}
.referral-section-heading small{font-size:9.5px;line-height:1.7;color:rgba(168,196,168,1)}
html.light .referral-section-heading small{color:#5a7a5a}
.referral-section-heading>b{display:inline-flex;align-items:center;gap:5px;padding:6px 8px;border-radius:8px;background:rgba(160,122,245,.1);color:var(--accent);font-size:9px;white-space:nowrap}
.referral-code-row{display:flex;align-items:center;gap:8px;min-width:0;margin-bottom:10px;padding:9px 11px;border:1px solid var(--border-subtle);border-radius:10px;background:var(--bg-page)}
.referral-code-row>span{font-size:10px;font-weight:800;color:var(--text-secondary)}
.referral-code-row code{padding:4px 8px;border-radius:7px;background:var(--bg-surface);color:var(--green);font-size:10px;font-weight:900}
.referral-code-row small{min-width:0;font-size:9px;color:var(--text-secondary)}
.referral-link-box{display:flex;align-items:center;gap:7px;padding:6px;border:1px solid var(--border-subtle);border-radius:12px;background:var(--bg-page)}
.referral-link-box input{flex:1;min-width:0;border:0;outline:0;background:transparent;color:var(--text-primary);font-size:11.5px;padding:0 8px;direction:ltr;text-align:left}
.referral-link-box button{height:38px;display:inline-flex;align-items:center;gap:6px;border:0;border-radius:9px;padding:0 13px;background:var(--green);color:#000;font-size:10.5px;font-weight:900;cursor:pointer;white-space:nowrap}
html.light .referral-link-box button{color:#000}
.referral-link-box button:disabled{cursor:not-allowed;opacity:.45}
.referral-copy-feedback{min-height:17px;margin:4px 2px -5px;font-size:9.5px;color:var(--green)}
.referral-steps{display:grid;grid-template-columns:1fr auto 1fr auto 1fr;gap:10px;align-items:center}
.referral-steps>article{display:flex;align-items:flex-start;gap:9px;min-width:0}
.referral-steps>article>b{width:28px;height:28px;flex:0 0 28px;border-radius:9px;display:flex;align-items:center;justify-content:center;background:rgba(207,253,0,.1);border:1px solid var(--border-affiliate);color:var(--green);font-size:12px}
.referral-steps article div{display:grid;gap:3px}.referral-steps article strong{font-size:11px;color:var(--text-primary)}.referral-steps article p{margin:0;font-size:9.5px;line-height:1.8;color:rgba(168,196,168,1)}
html.light .referral-steps article p{color:#5a7a5a}
.referral-steps>i{font-size:9px;color:var(--border-affiliate)}
.referral-invite-list{display:grid}
.referral-invite-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid var(--border-subtle)}
.referral-invite-row:last-child{border-bottom:0}
.referral-invite-user{display:flex;align-items:center;gap:9px;min-width:0}
.referral-invite-user>span{width:34px;height:34px;flex:0 0 34px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--bg-page);border:1px solid var(--border-subtle);color:var(--text-primary);font-size:12px;font-weight:900}
.referral-invite-user>div{display:grid;gap:3px;min-width:0}.referral-invite-user strong{font-size:11px;color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.referral-invite-user small{font-size:9px;color:rgba(168,196,168,1)}
html.light .referral-invite-user small{color:#5a7a5a}
.referral-invite-state{display:flex;align-items:center;gap:5px;font-size:9.5px;font-weight:700;white-space:nowrap}.referral-invite-state b{padding-right:5px;border-right:1px solid currentColor}.referral-invite-state.is-paid,.referral-invite-state.is-qualified{color:#32c66b}.referral-invite-state.is-review,.referral-invite-state.is-waiting{color:#f4a340}.referral-invite-state.is-rejected{color:var(--red)}
.referral-invites-empty{padding:28px 12px;text-align:center;display:grid;justify-items:center;gap:7px;color:rgba(168,196,168,1)}
.referral-invites-empty>i{width:42px;height:42px;border-radius:13px;display:flex!important;align-items:center;justify-content:center;background:var(--bg-page);color:var(--green)}.referral-invites-empty strong{font-size:12px;color:var(--text-primary)}.referral-invites-empty p{margin:0;font-size:10px}
.referral-guest-card{padding:32px 18px;border:1px solid var(--border-subtle);border-radius:16px;background:var(--bg-surface);text-align:center;display:grid;justify-items:center;gap:8px}.referral-guest-card>div{width:52px;height:52px;border-radius:16px;background:rgba(207,253,0,.1);color:var(--green);display:flex;align-items:center;justify-content:center}.referral-guest-card h3{margin:2px 0 0;font-size:15px;color:var(--text-primary)}.referral-guest-card p{max-width:480px;margin:0;font-size:11px;line-height:1.9;color:rgba(168,196,168,1)}.referral-guest-card a{margin-top:5px;padding:10px 18px;border-radius:10px;background:var(--green);color:#000;text-decoration:none;font-size:11px;font-weight:900}

@media(max-width:767px){.referral-program{padding:12px;gap:14px}.referral-program-hero{padding:18px}.referral-program-copy h2{font-size:19px}.referral-program-visual{display:none}.referral-dashboard-grid{grid-template-columns:1fr 1fr}.referral-steps{grid-template-columns:1fr;gap:12px}.referral-steps>i{display:none}.referral-link-card,.referral-how-card,.referral-invites-card{padding:14px}.referral-code-row{align-items:flex-start;flex-wrap:wrap}.referral-code-row small{width:100%}.referral-invite-row{align-items:flex-start;flex-direction:column}.referral-invite-state{padding-right:43px}.referral-section-heading{align-items:flex-start;flex-direction:column}}
@media(max-width:390px){.referral-dashboard-grid{grid-template-columns:1fr}.referral-user-stat{padding:12px}.referral-link-box{align-items:stretch;flex-direction:column}.referral-link-box input{height:36px;width:100%}.referral-link-box button{justify-content:center}.referral-reward-summary{display:grid}.referral-reward-summary span{width:100%}}

/* ═══════════════════════════════════════
   ICON FILTER (شب/روز)
═══════════════════════════════════════ */
.icon-filter { filter: brightness(0) invert(1); transition: filter 0.2s; }
html.light .icon-filter { filter: brightness(0) invert(0); }

.profile-page i[class*="fa-"] {
  font-family: "Font Awesome 6 Free" !important;
  font-weight: 900 !important;
  display: inline-block;
}
.profile-page i.fa-brands{font-family:"Font Awesome 6 Brands"!important;font-weight:400!important}
.profile-page i.fa-regular{font-weight:400!important}

/* ═══════════════════════════════════════
   SMALL TABLET — 640px+
   لایوت دو ستونه فعال میشه
═══════════════════════════════════════ */
@media (min-width: 640px) {

  /* utility */
  .show-desktop { display: inline-flex !important; }
  .hide-desktop { display: none !important; }

  .profile-page {
    max-width: 1100px;
    padding-bottom: 40px;
  }

  /* hero: flex-row RTL
     - اول در DOM = راست = hero-right-group (آواتار + اطلاعات)
     - دوم در DOM = چپ = hero-left-group (آمار + بنر)
  */
  .profile-hero {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 28px 36px 22px 0;
    margin-top: 0;
    position: static;
    z-index: auto;
    gap: 20px;
  }

  /* گروه راست: آواتار + اطلاعات کنار هم */
  .hero-right-group {
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-width: 0;
  }

  /* آواتار کوچک‌تبلت */
  .avatar-ring { width: 106px; height: 106px; }

  /* اطلاعات: راست‌چین (RTL start) */
  .profile-info {
    flex: 1;
    min-width: 0;
    align-items: flex-start;
    text-align: right;
    padding-top: 0;
  }

  .name-row { justify-content: flex-start; }
  .profile-name { font-size: 17px; }
  .profile-phone { padding-right: 10px; font-size: 13px; }

  /* پلن رایگان در tablet/desktop حذف */
  .plan-badge { display: none !important; }

  /* دکمه‌های اکشن — دسکتاپ: فلکس با نسبت‌های قبلی (فقط موبایل گرید هم‌عرض است) */
  .action-row {
    display: flex;
    max-width: 340px;
    width: 100%;
    margin-top: 4px;
  }

  /* بنر موبایل — پنهان (داخل hero-left-group هست) */
  .promo-section { display: none; }

  /* ستون چپ: آمار + بنر */
  .hero-left-group {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    width: 248px;
    gap: 12px;
    align-items: stretch;
    padding-top: 0;
  }

  /* آمار: هم‌عرض بنر */
  .stats-desktop { width: 100% !important; box-sizing: border-box; }
  .hero-left-group .promo-banner { width: 100%; box-sizing: border-box; }
  .stats-desktop .stat-col { flex: 1; padding: 0 1px; }
  .stats-desktop .stat-sep { height: 20px; }

  /* ستون آمار موبایل — پنهان */
  .stats-row { display: none !important; }

  /* تب‌ها */
  .tab-label { display: inline; }
  .tabs-section  { margin-top: 20px; }
  .profile-tabs  { padding: 0 36px; justify-content: flex-start; }
  .profile-tab   { flex: none; height: 44px; gap: 6px; padding: 0 14px; }

  .panel-grid  { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .panel-saved { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .files-grid  { grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 0; width: 100%; }
}

/* ═══════════════════════════════════════
   LARGE TABLET — 768px+
   نزدیک به desktop، فاصله‌ها استاندارد
═══════════════════════════════════════ */
@media (min-width: 768px) {
  .profile-page  { max-width: 1100px; }

  .profile-hero  { padding: 36px 44px 26px 0; gap: 26px; }

  .hero-right-group { gap: 18px; }
  .avatar-ring  { width: 118px; height: 118px; }
  .profile-info { flex: 0 0 auto; min-width: 200px; }
  .profile-name { font-size: 19px; }
  .profile-phone { font-size: 14.5px; padding-right: 12px; }

  .hero-left-group { width: 276px; gap: 13px; }

  .stats-desktop .stat-col { padding: 0 2px; }
  .stats-desktop .stat-sep { height: 22px; }

  .action-row { max-width: 360px; }

  .tabs-section  { margin-top: 22px; }
  .profile-tabs  { padding: 0 44px; }
  .profile-tab   { height: 46px; padding: 0 16px; }

  .panel-grid  { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .panel-saved { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .files-grid  { grid-template-columns: repeat(4, 1fr); gap: 6px; }
}

/* ═══════════════════════════════════════
   DESKTOP — 1024px+
═══════════════════════════════════════ */
@media (min-width: 1024px) {
  .profile-page { max-width: 1200px; padding: 0 0 60px; }
  .profile-hero { padding: 44px 56px 32px 0; gap: 40px; }

  .avatar-ring  { width: 136px; height: 136px; }
  .hero-right-group { gap: 24px; }
  .profile-info { min-width: 260px; }
  .profile-name { font-size: 24px; }
  .profile-phone { font-size: 15.7px; }

  /* آمار +۱سانت عریض‌تر (هر طرف +۰.۵سانت ≈ ۱۹px → جمع ۳۸px) */
  .hero-left-group { width: 358px; padding-top: 0; }

  /* بنر همکاری ۱mm پایین‌تر — هم‌تراز لبه پایین دکمه خرید اشتراک */
  .hero-left-group .promo-banner { margin-top: 4px; }

  .action-row { max-width: 380px; }

  .tabs-section  { margin-top: 28px; }
  .promo-section { padding: 0 56px; }
  .profile-tabs  { padding: 0 56px; }
  .profile-tab   { height: 48px; padding: 0 18px; }

  .panel-grid  { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .panel-saved { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .files-grid  { grid-template-columns: repeat(5, 1fr); gap: 8px; }
}

/* ═══════════════════════════════════════
   LARGE DESKTOP — 1280px+
═══════════════════════════════════════ */
@media (min-width: 1280px) {
  .profile-page  { max-width: 1320px; padding: 0 0 60px; }
  .profile-hero  { padding: 48px 72px 36px 0; }
  .hero-left-group { width: 378px; }
  .promo-section { padding: 0 64px; }
  .profile-tabs  { padding: 0 72px; }
  .panel-grid    { grid-template-columns: repeat(6, 1fr); }
  .files-grid    { grid-template-columns: repeat(6, 1fr); }
}

/* ═══════════════════════════════════════
   مودال پیش‌نمایش عکس گرید پروفایل
═══════════════════════════════════════ */
.grid-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.grid-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
}

.grid-preview-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: gridPreviewIn 0.2s cubic-bezier(0.22,1,0.36,1);
}

@keyframes gridPreviewIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.grid-preview-close {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: background-color .15s ease;
}
.grid-preview-close:hover { background: rgba(0,0,0,0.7); }

.grid-preview-img-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 55vh;
}
.grid-preview-img-wrap img {
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  display: block;
}

.grid-preview-actions {
  display: flex;
  gap: 10px;
}
.grid-preview-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.grid-preview-btn:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.grid-preview-date {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.grid-preview-product-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  transition: border-color .15s ease, background-color .15s ease;
}
.grid-preview-product-link:hover {
  border-color: var(--green);
  background: rgba(207,253,0,0.08);
}
.grid-preview-product-link i:first-child { color: var(--green); font-size: 13px; }
.grid-preview-product-link span { flex: 1; color: var(--text-secondary); }
.grid-preview-product-link span b { color: var(--text-primary); font-weight: 700; }
.grid-preview-product-arrow { font-size: 11px; color: var(--text-secondary); }

.grid-preview-product-link.is-disabled {
  opacity: .5;
  pointer-events: none;
}
