/* ============================================================
   webir.ir — استایل اصلی | دارک/لایت تم
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

/* ──────────────────── تم روشن ──────────────────── */
:root {
  --bg:          #f1f5f9;
  --surface:     #ffffff;
  --surface2:    #f8fafc;
  --border:      #e2e8f0;
  --text:        #0f172a;
  --text-muted:  #64748b;
  --primary:     #0ea5e9;
  --primary-d:   #0284c7;
  --primary-bg:  #e0f2fe;
  --success:     #22c55e;
  --success-bg:  #dcfce7;
  --warning:     #f59e0b;
  --warning-bg:  #fef3c7;
  --danger:      #ef4444;
  --danger-bg:   #fee2e2;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.12);
  --radius:      12px;
  --radius-sm:   8px;
  --sidebar-w:   260px;
}

/* ──────────────────── تم تیره ──────────────────── */
[data-theme="dark"] {
  --bg:          #0f172a;
  --surface:     #1e293b;
  --surface2:    #162033;
  --border:      #334155;
  --text:        #f1f5f9;
  --text-muted:  #94a3b8;
  --primary:     #38bdf8;
  --primary-d:   #0ea5e9;
  --primary-bg:  #0c3550;
  --success:     #4ade80;
  --success-bg:  #052e16;
  --warning:     #fbbf24;
  --warning-bg:  #451a03;
  --danger:      #f87171;
  --danger-bg:   #450a0a;
  --shadow:      0 1px 3px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.5);
}

/* ──────────────────── ریست ──────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background .25s, color .25s;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }
img { max-width: 100%; display: block; }

/* ──────────────────── لایوت داشبورد ──────────────────── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* ──────────────────── سایدبار ──────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: transform .3s ease, background .25s;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-mark {
  width: 38px; height: 38px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
}
.sidebar-logo .logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.sidebar-logo .logo-text span {
  color: var(--primary);
}

.sidebar-user {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-user .avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--primary);
  font-size: 1rem;
  overflow: hidden;
}
.sidebar-user .user-info { flex: 1; min-width: 0; }
.sidebar-user .user-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .user-email { font-size: .75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-nav { padding: 12px 12px; flex: 1; }
.nav-section { margin-bottom: 8px; }
.nav-section-title { font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; padding: 8px 8px 4px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  transition: all .18s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: right;
}
.nav-link:hover { background: var(--border); color: var(--text); }
.nav-link.active { background: var(--primary-bg); color: var(--primary); }
.nav-link svg { flex-shrink: 0; }
.nav-link .badge {
  margin-right: auto;
  background: var(--danger);
  color: #fff;
  border-radius: 20px;
  font-size: .65rem;
  padding: 1px 7px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ──────────────────── محتوای اصلی ──────────────────── */
.main-content {
  flex: 1;
  margin-right: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 1rem; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.page-content { padding: 28px 24px; flex: 1; }

/* ──────────────────── کارت‌ها ──────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 1rem; font-weight: 700; }
.card-body { padding: 22px; }

/* استت کارت‌ها */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon.blue  { background: var(--primary-bg); color: var(--primary); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.amber { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red   { background: var(--danger-bg);  color: var(--danger); }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-bottom: 4px; }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1; }

/* ──────────────────── فرم‌ها ──────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.form-label .req { color: var(--danger); margin-right: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  transition: border-color .18s, box-shadow .18s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: 5px; }
.form-section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 24px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* گروه شبکه اجتماعی */
.social-input-group { display: flex; align-items: center; gap: 10px; }
.social-icon { width: 38px; height: 38px; border-radius: 8px; background: var(--border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1rem; }

/* آپلود لوگو */
.logo-upload { display: flex; align-items: center; gap: 16px; }
.logo-preview { width: 80px; height: 80px; border-radius: var(--radius-sm); border: 2px dashed var(--border); object-fit: cover; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.8rem; overflow: hidden; background: var(--bg); }
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ──────────────────── دکمه‌ها ──────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .18s;
  line-height: 1;
  white-space: nowrap;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-d); }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-outline  { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--border); }
.btn-ghost    { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--border); }
.btn-sm { padding: 6px 14px; font-size: .8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-full { width: 100%; }

/* ──────────────────── بج‌ها ──────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 700;
}
.badge-pending  { background: var(--warning-bg); color: var(--warning); }
.badge-approved { background: var(--success-bg); color: var(--success); }
.badge-rejected { background: var(--danger-bg);  color: var(--danger); }

/* ──────────────────── Alert ──────────────────── */
.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: .875rem; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.alert-danger   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid var(--danger); }
.alert-warning  { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.alert-info     { background: var(--primary-bg); color: var(--primary); border: 1px solid var(--primary); }

/* ──────────────────── جداول ──────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.table { width: 100%; border-collapse: collapse; }
.table th { background: var(--surface2); padding: 11px 16px; text-align: right; font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: .875rem; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface2); }
.table .store-name { display: flex; align-items: center; gap: 10px; }
.table .store-logo { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: var(--border); }

/* ──────────────────── تغییر تم ──────────────────── */
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--border); color: var(--text); }

/* ──────────────────── صفحه Auth ──────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}
.auth-box {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-mark { width: 52px; height: 52px; background: var(--primary); border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1.4rem; margin: 0 auto 12px; }
.auth-logo h1 { font-size: 1.4rem; font-weight: 800; }
.auth-logo p { color: var(--text-muted); font-size: .85rem; margin-top: 4px; }
.auth-divider { text-align: center; color: var(--text-muted); font-size: .8rem; margin: 18px 0; position: relative; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: calc(50% - 24px); height: 1px; background: var(--border); }
.auth-divider::before { right: 0; }
.auth-divider::after  { left: 0; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .85rem; color: var(--text-muted); }

/* ──────────────────── گرید ──────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ──────────────────── خلوت ──────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state svg { margin: 0 auto 16px; opacity: .4; }
.empty-state h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }

/* ──────────────────── ریسپانسیو ──────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-right: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .auth-box { padding: 28px 20px; }
}

/* ════════════════════════════════════════════════════════════
   پنل کاربری داخل چارچوب سایت (هدر/فوتر عمومی)
   نسخه‌ی جدید: سایدبار دیگه height:100vh نداره، فقط به اندازه‌ی
   محتوای خودش بلنده — همین باعث می‌شد قبلاً روی هدر/فوتر بیفته.
   این بخش کاملاً جدا از کلاس‌بندی پنل مدیریت (mvorod) است.
   ════════════════════════════════════════════════════════════ */
.panel-wrap { padding: 28px 24px 70px; }
.panel-grid { display: grid; grid-template-columns: 264px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) {
  .panel-grid { grid-template-columns: 1fr; }
  .panel-sidebar { position: static !important; }
}

.panel-sidebar { position: sticky; top: 84px; align-self: start; }

.profile-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 18px; margin-bottom: 14px; text-align: center;
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(150deg, var(--primary-bg), var(--surface2)); color: var(--primary);
  font-weight: 800; font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px; box-shadow: 0 0 0 4px var(--surface2);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-weight: 800; font-size: .95rem; }
.profile-email { font-size: .76rem; color: var(--text-muted); margin-top: 2px; word-break: break-all; }
.profile-level {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 10px;
  background: var(--primary-bg); color: var(--primary-d);
  font-size: .74rem; font-weight: 700; padding: 4px 12px; border-radius: 20px;
}

.nav-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; }
.nav-section { margin-bottom: 4px; }
.nav-section:last-child { margin-bottom: 0; }
.nav-title { font-size: .68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; padding: 12px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px;
  font-size: .86rem; font-weight: 600; color: var(--text-muted); margin-bottom: 2px;
  transition: all .15s;
}
.nav-link svg { flex-shrink: 0; opacity: .75; }
.nav-link:hover { background: var(--surface2); color: var(--text); }
.nav-link.active { background: var(--primary-bg); color: var(--primary-d); }
.nav-link.active svg { opacity: 1; }
.nav-link .badge-mini { margin-right: auto; background: var(--primary); color: #fff; font-size: .66rem; font-weight: 800; padding: 2px 7px; border-radius: 10px; }
.nav-link .badge-mini.warn { background: var(--warning); color: #000; }
.nav-divider { height: 1px; background: var(--border); margin: 8px 4px; }

.panel-content { min-width: 0; }
.page-head-simple { margin-bottom: 20px; }
.page-head-simple h1 { font-size: 1.3rem; font-weight: 800; }

@media (max-width: 768px) {
  .panel-wrap { padding: 20px 16px 60px; }
}
