/* ================================================
   SIBHOST WHMCS THEME — Layout
   layout.css
   ================================================ */

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  color: var(--text-primary);
  background: var(--bg-root);
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ─── Sidebar ─── */
.sidebar {
  position: fixed;
  top: 0; right: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: width var(--transition-normal), transform var(--transition-normal);
}
.sidebar::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.10) 0%, transparent 70%);
  pointer-events: none; flex-shrink: 0;
}

/* لوگو */
.sidebar-logo {
  padding: var(--space-5) var(--space-5) var(--space-4);
  display: flex; align-items: center;
  gap: var(--space-3); flex-shrink: 0;
}
.sidebar-logo img { height: 36px; width: auto; max-width: 150px; object-fit: contain; }

/* Profile card */
.sidebar-profile {
  margin: 0 var(--space-3) var(--space-3);
  padding: var(--space-3) var(--space-3);
  background: rgba(6,182,212,0.05);
  border: 1px solid rgba(6,182,212,0.16);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; gap: var(--space-3);
  text-decoration: none; flex-shrink: 0;
  transition: background var(--transition-fast);
  overflow: hidden;
}
.sidebar-profile:hover { background: rgba(6,182,212,0.09); }
.sidebar-profile:hover .user-badge { color: var(--brand-cyan); }
[data-theme="light"] .sidebar-profile {
  background: rgba(37,99,235,0.04);
  border-color: rgba(37,99,235,0.14);
}
[data-theme="light"] .sidebar-profile:hover { background: rgba(37,99,235,0.07); }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-cyan));
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--font-bold); font-size: var(--text-base);
  color: #fff; flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(37,99,235,0.28);
}
.user-name {
  font-size: var(--text-sm); font-weight: var(--font-semibold);
  color: var(--text-primary); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  font-size: 10px; color: var(--text-muted); margin-top: 2px;
}
.user-badge {
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
  font-weight: 300;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0;
  transition: color var(--transition-fast);
}

/* ناوبری */
.sidebar-nav {
  flex: 1; padding: 0 var(--space-3) var(--space-2);
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: var(--border-soft) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 2px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-soft); border-radius: 2px; }

/* group label */
.nav-section-title {
  font-size: 9px; font-weight: var(--font-bold);
  letter-spacing: 0.10em; color: var(--text-muted);
  padding: var(--space-3) var(--space-2) var(--space-1);
  text-transform: uppercase;
  display: flex; align-items: center; gap: var(--space-2);
  white-space: nowrap;
}
.nav-section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border-soft);
}
.nav-divider { display: none; }

/* nav item — pill style */
.nav-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: 8px var(--space-2);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm); font-weight: var(--font-medium);
  cursor: pointer; margin-bottom: 2px;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap; overflow: hidden;
}
.nav-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.nav-item.active {
  background: rgba(37,99,235,0.15);
  color: #93C5FD;
  border-color: rgba(37,99,235,0.28);
}
[data-theme="light"] .nav-item:hover {
  background: rgba(37,99,235,0.07);
}
[data-theme="light"] .nav-item.active {
  background: rgba(37,99,235,0.10);
  color: #1D4ED8;
  border-color: rgba(37,99,235,0.22);
}
.nav-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  transition: background var(--transition-fast);
}
.nav-badge {
  margin-right: auto;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: var(--font-bold);
  padding: 1px 7px; border-radius: var(--radius-full); line-height: 1.6;
}

/* bottom section */
.sidebar-bottom {
  border-top: 1px solid var(--border-soft);
  padding: var(--space-2) var(--space-3) var(--space-4);
  flex-shrink: 0;
}
.sidebar-divider {
  border-top: 1px solid var(--border-soft);
  margin: var(--space-2) 0;
}
.sidebar-bottom .sidebar-profile {
  margin: 0;
  border-radius: var(--radius-md);
}
.sidebar-bottom .sidebar-profile.active {
  background: rgba(37,99,235,0.15);
  border-color: rgba(37,99,235,0.28);
}
.sidebar-bottom .sidebar-profile.active .user-name { color: #93C5FD; }
[data-theme="light"] .sidebar-bottom .sidebar-profile.active {
  background: rgba(37,99,235,0.10);
  border-color: rgba(37,99,235,0.22);
}
[data-theme="light"] .sidebar-bottom .sidebar-profile.active .user-name { color: #1D4ED8; }
.sidebar-bottom .nav-item { color: var(--text-muted); }
.sidebar-bottom .nav-item:hover { color: var(--text-secondary); }
.nav-item-logout {
  color: var(--danger) !important;
  background: rgba(239,68,68,0.07) !important;
  border: 1px solid rgba(239,68,68,0.22) !important;
  border-radius: var(--radius-md) !important;
  margin-top: var(--space-2);
}
.nav-item-logout .nav-icon { color: var(--danger) !important; }
.nav-item-logout:hover {
  color: #fff !important;
  background: rgba(239,68,68,0.82) !important;
  border-color: rgba(239,68,68,0.5) !important;
}
.nav-item-logout:hover .nav-icon { color: #fff !important; }

/* collapsible */
.sidebar-collapse-btn {
  position: absolute; top: var(--space-5); left: -13px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-surface); border: 1px solid var(--border-medium);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 11px; color: var(--text-muted);
  transition: all var(--transition-fast); z-index: 201;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.sidebar-collapse-btn:hover { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }

/* icon همیشه مخفی در حالت عادی */
.sidebar-logo-icon { display: none; }

/* mini mode */
.sidebar.mini { width: 64px; }
.sidebar.mini .sidebar-logo-full { display: none; }
.sidebar.mini .sidebar-logo-icon { display: block; }
.sidebar.mini .sidebar-logo { justify-content: center; padding: var(--space-4) var(--space-3); }
.sidebar.mini .sidebar-profile .user-name,
.sidebar.mini .sidebar-profile .user-role,
.sidebar.mini .sidebar-profile .user-badge { display: none; }
.sidebar.mini .sidebar-profile { justify-content: center; padding: var(--space-3) var(--space-2); }
.sidebar.mini .sidebar-profile > div:not(.user-avatar) { display: none; }
.sidebar.mini .nav-section-title { opacity: 0; height: 16px; pointer-events: none; }
.sidebar.mini .nav-section-title::after { display: none; }
.sidebar.mini .nav-item { justify-content: center; padding: 9px var(--space-2); }
.sidebar.mini .nav-item-logout {
  width: 36px; height: 36px;
  min-width: unset;
  padding: 0 !important;
  margin: var(--space-2) auto 0;
  border-radius: var(--radius-md) !important;
  border-width: 1px !important;
  justify-content: center;
}
.sidebar.mini .sidebar-profile {
  border: none !important;
  background: transparent !important;
  margin: 0 !important;
  padding: var(--space-2) !important;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}
.sidebar.mini .sidebar-profile:hover { background: rgba(6,182,212,0.09) !important; }
.sidebar.mini .sidebar-divider { display: none; }
.sidebar.mini .nav-label { display: none; }
.sidebar.mini .nav-badge { display: none; }

/* badge ابزارها (جدید/محدود/به‌زودی) در حالت compact به status dot تبدیل می‌شود */
.sidebar.mini .nav-item { position: relative; }
.sidebar.mini .nav-item .badge {
  position: absolute;
  top: 6px; left: 6px;
  width: 7px; height: 7px;
  min-width: 0;
  padding: 0 !important;
  font-size: 0 !important;
  line-height: 0;
  border-radius: 50%;
  overflow: hidden;
}
.sidebar.mini .nav-item .badge-success { background: var(--success) !important; }
.sidebar.mini .nav-item .badge-warning { background: var(--warning) !important; }
.sidebar.mini .sidebar-collapse-btn {
  left: -13px;
  transform: translateY(-50%) rotate(180deg);
}
.sidebar.mini + .main-wrapper { margin-right: 64px; }

/* ─── Sidebar Style Variants (sidebar_style admin setting) ─── */

/* جزیره شناور — تمام‌ارتفاع با فاصله از لبه‌ها و گوشه‌های گرد */
body.sidebar-style-island .sidebar {
  top: var(--space-4); right: var(--space-4); bottom: var(--space-4);
  height: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card), 0 16px 48px rgba(0,0,0,0.05);
}
body.sidebar-style-island .main-wrapper { margin-right: calc(var(--sidebar-width) + var(--space-4) * 2); }
body.sidebar-style-island .sidebar.mini + .main-wrapper { margin-right: calc(64px + var(--space-4) * 2); }

/* جزیره‌های مجزا — لوگو، منو و پروفایل هرکدام در کارت شیشه‌ای جدا */
body.sidebar-style-segmented .sidebar {
  top: var(--space-4); right: var(--space-4); bottom: var(--space-4);
  height: auto; gap: var(--space-3);
  background: transparent; border: none; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.sidebar-style-segmented .sidebar::before { display: none; }
body.sidebar-style-segmented .sidebar-logo,
body.sidebar-style-segmented .sidebar-nav,
body.sidebar-style-segmented .sidebar-bottom {
  background: var(--sidebar-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card), 0 16px 48px rgba(0,0,0,0.35);
}
body.sidebar-style-segmented .main-wrapper { margin-right: calc(var(--sidebar-width) + var(--space-4) * 2); }
body.sidebar-style-segmented .sidebar.mini + .main-wrapper { margin-right: calc(64px + var(--space-4) * 2); }

/* داک کوتاه — وسط‌چین عمودی با فاصله از بالا و پایین */
body.sidebar-style-dock .sidebar {
  top: 50%; bottom: auto; right: var(--space-4);
  height: min(86vh, 820px);
  transform: translateY(-50%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card), 0 16px 48px rgba(0,0,0,0.35);
}
body.sidebar-style-dock .main-wrapper { margin-right: calc(var(--sidebar-width) + var(--space-4) * 2); }
body.sidebar-style-dock .sidebar.mini + .main-wrapper { margin-right: calc(64px + var(--space-4) * 2); }

/* ─── Topbar ─── */
.topbar {
  position: sticky;
  top: 0; z-index: 100;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-7);
}
.topbar-title {
  flex: 1;
  min-width: 0;
}

/* ── Server Status Bar ── */
.ss-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}
.ss-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ss-dot-ok          { background: var(--success);           box-shadow: 0 0 8px rgba(16,185,129,0.55); }
.ss-dot-reported    { background: var(--danger);            box-shadow: 0 0 8px rgba(239,68,68,0.6); }
.ss-dot-investigating { background: var(--warning);         box-shadow: 0 0 8px rgba(245,158,11,0.6); }
.ss-dot-identified  { background: #f97316;                  box-shadow: 0 0 8px rgba(249,115,22,0.6); }
.ss-dot-monitoring  { background: var(--brand-cyan);        box-shadow: 0 0 8px rgba(6,182,212,0.55); }
.ss-dot-maintenance { background: var(--brand-blue);        box-shadow: 0 0 8px rgba(37,99,235,0.5); }

/* حالت سالم */
.ss-label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  white-space: nowrap;
}

/* حالت مشکل — دو خطی */
.ss-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
}
.ss-title {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--danger);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ss-title-ok {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--success);
  white-space: nowrap;
}
.ss-msg {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

.ss-badge {
  font-size: 10px;
  font-weight: var(--font-bold);
  color: var(--warning);
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-full);
  padding: 1px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ss-btn {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  transition: color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}
.ss-btn:hover        { color: var(--brand-cyan); border-color: var(--brand-cyan); }
.ss-btn-issue        { color: var(--danger); border-color: rgba(239,68,68,0.35); }
.ss-btn-issue:hover  { border-color: var(--danger); background: rgba(239,68,68,0.07); }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* دکمه‌های آیکونی topbar */
.btn-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  position: relative;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}
.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

/* رنگ‌های کانتکستی دکمه‌های topbar (همان سیستم icon-chip) */
.btn-icon-orange { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.20); color: var(--warning); }
.btn-icon-orange:hover { background: rgba(245,158,11,0.22); border-color: rgba(245,158,11,0.32); color: var(--warning); }
.btn-icon-pink { background: rgba(236,72,153,0.12); border-color: rgba(236,72,153,0.20); color: var(--brand-pink); }
.btn-icon-pink:hover { background: rgba(236,72,153,0.22); border-color: rgba(236,72,153,0.32); color: var(--brand-pink); }
.btn-icon-purple { background: rgba(139,92,246,0.12); border-color: rgba(139,92,246,0.20); color: var(--brand-purple); }
.btn-icon-purple:hover { background: rgba(139,92,246,0.22); border-color: rgba(139,92,246,0.32); color: var(--brand-purple); }

/* نقطه اعلان */
.notif-dot {
  position: absolute;
  top: 7px; left: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand-cyan);
  box-shadow: 0 0 6px var(--brand-cyan);
}

/* ─── Topbar Style Variants (topbar_style admin setting) ─── */

/* جزیره شناور — هماهنگ با سایدبار جزیره‌ای */
body.topbar-style-island .topbar {
  margin: var(--space-4);
  top: var(--space-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card), 0 16px 48px rgba(0,0,0,0.05);
}

/* جزیره‌های مجزا — وضعیت سرور و دکمه‌ها در دو کارت جدا */
body.topbar-style-segmented .topbar {
  margin: var(--space-4);
  top: var(--space-4);
  padding: 0;
  gap: var(--space-3);
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.topbar-style-segmented .topbar-title,
body.topbar-style-segmented .topbar-actions {
  display: flex;
  align-items: center;
  height: 100%;
  background: var(--topbar-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card), 0 16px 48px rgba(0,0,0,0.35);
  padding: 0 var(--space-5);
}
body.topbar-style-segmented .topbar-actions { flex-shrink: 0; }

/* داک شناور — نوار کوتاه و وسط‌چین به‌شکل قرص */
body.topbar-style-dock .topbar {
  margin: var(--space-4) var(--space-10);
  top: var(--space-4);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-card), 0 16px 48px rgba(0,0,0,0.35);
}

/* ─── Notification + Email Dropdown ─── */
#notif-dropdown,
#email-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 300px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.24);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  overflow: hidden;
}
#notif-dropdown.open,
#email-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}
.notif-dropdown-header a {
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  color: var(--text-muted);
}
.notif-dropdown-header a:hover { color: var(--brand-cyan); }
.notif-dropdown-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-soft);
  text-align: center;
  font-size: var(--text-xs);
}
.notif-dropdown-footer a { color: var(--brand-cyan); }
.notif-dropdown-footer a:hover { color: var(--text-primary); }

/* چیپ موجودی */
.credit-chip {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}
.credit-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

/* ─── Main Content ─── */
.main-wrapper {
  margin-right: var(--sidebar-width);
  min-height: 100vh;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}
.main-content {
  padding: 0 var(--space-7) var(--space-10);
  flex: 1;
}

/* ─── Section ─── */
.section { margin-top: var(--space-7); }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.section-title {
  font-size: var(--text-md);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}
.section-link {
  font-size: var(--text-xs);
  color: var(--brand-cyan);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}
.section-link:hover { opacity: 0.75; }

/* ─── Grid Layouts ─── */
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--space-4); }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--space-4); }
.grid-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-5);
}

/* ─── Mobile Hamburger ─── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 0;
  align-items: center;
  flex-shrink: 0;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.hamburger:hover {
  background: var(--bg-card-hover);
  border-color: var(--brand-cyan);
}
.hamburger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}
.hamburger span:nth-child(2) { width: 13px; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .grid-sidebar { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* sidebar اصلی در موبایل مخفی — جای خود را به bottom sheet میدهد */
  .sidebar { display: none; }
  .sidebar-collapse-btn { display: none; }
  .main-wrapper,
  body.sidebar-style-island .main-wrapper,
  body.sidebar-style-segmented .main-wrapper,
  body.sidebar-style-dock .main-wrapper { margin-right: 0; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hamburger { display: flex; }
  .topbar,
  body.topbar-style-island .topbar,
  body.topbar-style-segmented .topbar,
  body.topbar-style-dock .topbar {
    margin: 0;
    top: 0;
    padding: 0 var(--space-4);
    gap: var(--space-4);
    background: var(--topbar-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: none;
    border-bottom: 1px solid var(--border-soft);
    border-radius: 0;
    box-shadow: none;
  }
  body.topbar-style-segmented .topbar-title,
  body.topbar-style-segmented .topbar-actions {
    height: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
  }

  /* topbar هم pill شود — هماهنگ با منوی موبایل، وقتی سایدبار جزیره‌ای است */
  body.sidebar-style-island .topbar,
  body.sidebar-style-segmented .topbar,
  body.sidebar-style-dock .topbar {
    margin: var(--space-3) var(--space-3) 0;
    top: var(--space-3);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-card), 0 8px 32px rgba(0,0,0,0.3);
  }

  /* پیل شناور — وقتی سایدبار روی یکی از حالت‌های جزیره‌ای (island/segmented/dock) است */
  body.sidebar-style-island .mob-sheet,
  body.sidebar-style-segmented .mob-sheet,
  body.sidebar-style-dock .mob-sheet {
    right: var(--space-4);
    left: var(--space-4);
    bottom: var(--space-4);
    height: calc(90% - var(--space-4));
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card), 0 16px 48px rgba(0,0,0,0.35);
  }

  .main-content { padding: 0 var(--space-4) var(--space-8); }
}

/* ─── Mobile Bottom Sheet ─── */
.mob-sheet-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background .35s ease, backdrop-filter .35s ease;
}
.mob-sheet-overlay.open {
  display: block;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.mob-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0; z-index: 310;
  height: 90%;
  border-radius: 24px 24px 0 0;
  background: rgba(10,22,40,0.82);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border-top: 1px solid rgba(99,179,237,0.18);
  border-right: 1px solid rgba(99,179,237,0.08);
  border-left: 1px solid rgba(99,179,237,0.08);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .42s cubic-bezier(0.32,0.72,0,1);
  box-shadow: 0 -12px 48px rgba(0,0,0,0.4);
  overflow: hidden;
}
[data-theme="light"] .mob-sheet {
  background: rgba(240,245,255,0.90);
  border-top-color: rgba(37,99,235,0.16);
  border-right-color: rgba(37,99,235,0.08);
  border-left-color: rgba(37,99,235,0.08);
  box-shadow: 0 -12px 40px rgba(37,99,235,0.10);
}
.mob-sheet::before {
  content: ''; position: absolute;
  top: -40px; right: 30%; width: 160px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.mob-sheet.open { transform: translateY(0); }

.mob-sheet-handle {
  padding: 10px 0 2px; display: flex;
  justify-content: center; cursor: grab; flex-shrink: 0;
}
.mob-sheet-handle:active { cursor: grabbing; }
.mob-handle-pill {
  width: 36px; height: 4px; border-radius: 2px;
  background: rgba(148,163,184,0.35);
}
.mob-sheet-logo {
  padding: 4px var(--space-5) var(--space-3);
  flex-shrink: 0;
}
.mob-sheet-logo img { height: 28px; width: auto; object-fit: contain; }

.mob-sheet-profile {
  margin: 0 var(--space-3) var(--space-3);
  padding: var(--space-3); display: flex; align-items: center; gap: var(--space-3);
  background: rgba(6,182,212,0.05);
  border: 1px solid rgba(6,182,212,0.16);
  border-radius: var(--radius-lg); flex-shrink: 0;
}
[data-theme="light"] .mob-sheet-profile {
  background: rgba(37,99,235,0.04);
  border-color: rgba(37,99,235,0.14);
}

.mob-sheet-nav {
  flex: 1; overflow-y: auto; padding: 4px var(--space-3) var(--space-2);
  scrollbar-width: thin; scrollbar-color: rgba(99,179,237,0.15) transparent;
}
.mob-sheet-nav .nav-section-title { font-size: 9px; }
.mob-sheet-nav .nav-item,
.mob-sheet-bottom .nav-item {
  opacity: 0; transform: translateX(20px);
  transition: opacity .25s ease, transform .25s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.mob-sheet-nav .nav-item.sib-animated,
.mob-sheet-bottom .nav-item.sib-animated {
  opacity: 1; transform: translateX(0);
}

.mob-sheet-bottom {
  border-top: 1px solid var(--border-soft);
  padding: var(--space-2) var(--space-3) var(--space-5);
  flex-shrink: 0;
}
.mob-sheet-bottom .nav-item { color: var(--text-muted); }