/* ============================================================
   داشبورد | پنل مدیریت محتوا
   چیدمان: راست به چپ (RTL) | ابعاد ثابت 1345 × 600
   بدون فریم‌ورک — Pure CSS
   ============================================================ */

:root {
  --bg:            #eef1f7;
  --panel:         #ffffff;
  --border:        #e4e9f2;
  --border-soft:   #eef2f8;
  --text:          #1f2937;
  --text-2:        #4b5563;
  --muted:         #8592a3;
  --muted-2:       #9aa5b1;

  --primary:       #4f46e5;
  --primary-dark:  #4338ca;
  --primary-soft:  #eef0fe;

  --danger:        #dc2626;
  --danger-soft:   #fef2f2;
  --success:       #16a34a;
  --success-soft:  #ecfdf5;
  --warning:       #d97706;
  --warning-soft:  #fff7ed;
  --info:          #0e7490;
  --info-soft:     #ecfeff;
  --purple:        #7c3aed;
  --purple-soft:   #f5f3ff;
  --pink:          #db2777;
  --pink-soft:     #fdf2f8;
  --gold:          #eab308;
  --gold-soft:     #fefce8;

  --radius:        10px;
  --radius-sm:     8px;

  --shadow-sm:     0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md:     0 6px 18px rgba(16, 24, 40, .10);

  --font: Tahoma, "Iranian Sans", "Segoe UI", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 600px;
  overflow: hidden;
}

body {
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }


/* ============================================================
   ساختار کلی
   ============================================================ */
.page {
  width: 1345px;
  height: 600px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}


/* ============================================================
   ردیف ۱) کارت ادمین + آمار سریع (ادغام‌شده)
   ============================================================ */
.quick-stats {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 150px repeat(10, 1fr) 42px;
  gap: 5px;
  position: relative;
  z-index: 20;
}

/* ---------- کارت ادمین ---------- */
.admin-card {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  border-radius: 9px;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .18);
  overflow: hidden;
  position: relative;
}

.admin-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--purple) 100%);
}

.admin-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(79, 70, 229, .4);
  user-select: none;
}

.admin-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
}

.admin-name {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-role {
  font-size: 8.5px;
  color: rgba(255, 255, 255, .65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-logout {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 7px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}

.admin-logout:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.admin-logout:active { transform: translateY(1px); }


/* ---------- آیتم‌های آمار سریع ---------- */
.qs-item {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 46px;
  padding: 4px 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .15s, border-color .15s, background .15s;
  min-width: 0;
  overflow: hidden;
}

.qs-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: #c7cdf7;
  background: #fbfcff;
}

.qs-item.is-revenue:hover {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #6ee7b7;
}

.qs-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  font-size: 11px;
  border-radius: 6px;
  line-height: 1;
}

.qs-icon.is-post  { background: #dbeafe; color: #1d4ed8; }
.qs-icon.is-dl    { background: #fef3c7; color: #b45309; }
.qs-icon.is-paid  { background: #dcfce7; color: #166534; }
.qs-icon.is-sch   { background: #fce7f3; color: #be185d; }
.qs-icon.is-cmt   { background: #d1fae5; color: #047857; }
.qs-icon.is-view  { background: #e0e7ff; color: #4338ca; }
.qs-icon.is-money { background: #d1fae5; color: #15803d; }
.qs-icon.is-cat   { background: #e0e7ff; color: #4338ca; }
.qs-icon.is-tag   { background: #f3e8ff; color: #7e22ce; }
.qs-icon.is-img   { background: #fce7f3; color: #be185d; }
.qs-icon.is-vid   { background: #fef2f2; color: #b91c1c; }
.qs-icon.is-user  { background: #dbeafe; color: #1d4ed8; }

.qs-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.qs-val {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
   white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
  text-align: right;
}

.qs-item.is-revenue .qs-val {
  color: var(--success);
}

.qs-lbl {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ---------- دکمه افزودن سریع ---------- */
.quick-add {
  position: relative;
  width: 42px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(79, 70, 229, .28);
  transition: transform .15s, box-shadow .15s;
}

.quick-add:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, .38);
}

.quick-add:active { transform: translateY(0); }

.qa-plus {
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  transition: transform .2s;
}

.quick-add.is-open .qa-plus {
  transform: rotate(45deg);
}

.quick-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 100;
  min-width: 200px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  animation: qmFadeIn .14s ease;
  text-align: right;
}

@keyframes qmFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.qm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  border-radius: 6px;
  transition: background .12s, color .12s;
}

.qm-item:hover {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.qm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 11px;
  border-radius: 6px;
  flex: 0 0 auto;
}


/* ============================================================
   ردیف ۲) نوار تاریخ با ساعت/دقیقه/ثانیه گذشته و مانده
   ============================================================ */
.date-strip {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 220px;
  gap: 6px;
}

.date-card {
  position: relative;
  padding: 6px 12px 6px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow .15s;
}

.date-card:hover { box-shadow: var(--shadow-md); }

.date-card.is-jalali::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--purple) 100%);
}

.date-card.is-gregorian::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--info) 0%, #0891b2 100%);
}

/* ---------- سرصفحه تاریخ ---------- */
.date-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 10px;
  padding-bottom: 4px;
  margin-bottom: 5px;
  border-bottom: 1px dashed #eef2f8;
  position: relative;
}

.date-flag {
  position: absolute;
  top: -1px;
  left: 0;
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--purple) 100%);
  padding: 1px 6px;
  border-radius: 99px;
  letter-spacing: .3px;
}

.date-flag.is-gray {
  background: linear-gradient(135deg, var(--info) 0%, #0891b2 100%);
}

.date-flag.is-ts {
  background: linear-gradient(135deg, var(--gold) 0%, var(--warning) 100%);
}

.date-weekday {
  grid-column: 1;
  font-size: 11px;
  font-weight: 800;
  color: var(--primary-dark);
  white-space: nowrap;
}

.date-card.is-gregorian .date-weekday {
  color: var(--info);
  direction: ltr;
  text-align: left;
  font-family: "Segoe UI", Arial, sans-serif;
}

.date-main {
  grid-column: 2;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: "Segoe UI", Arial, sans-serif;
  direction: ltr;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.date-month-info {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  font-size: 9px;
  color: var(--muted);
  background: #f7f9fc;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  white-space: nowrap;
}

.date-month-info b {
  color: var(--text-2);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-family: "Segoe UI", Arial, sans-serif;
}

.date-month-info .dot { color: #d5dbe6; }

/* ---------- شبکه ساعت/دقیقه/ثانیه ---------- */
.date-mini-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
  border-radius: 6px;
  text-align: center;
  min-width: 0;
  transition: background .15s;
}

.mini-stat.is-pass {
  background: #f7f9fc;
  border: 1px solid var(--border-soft);
}

.mini-stat.is-remain {
  background: var(--success-soft);
  border: 1px solid #a7f3d0;
}

.mini-val {
  font-size: 12.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-family: "Segoe UI", Arial, sans-serif;
  direction: ltr;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.mini-stat.is-pass .mini-val   { color: #475569; }
.mini-stat.is-remain .mini-val { color: var(--success); }

.mini-lbl {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  max-width: 100%;
}

.mini-stat.is-remain .mini-lbl { color: #166534; }


/* ---------- کارت تایم‌استمپ ---------- */
.date-card.is-timestamp {
  background: linear-gradient(135deg, #fefce8 0%, #fff7ed 100%);
  border-color: #fde68a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  position: relative;
}

.date-card.is-timestamp::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--warning) 100%);
}

.ts-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--warning);
  font-family: "Segoe UI", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 3px;
  direction: ltr;
  line-height: 1.1;
  margin-top: 6px;
}

.ts-lbl {
  font-size: 8px;
  color: var(--muted);
  line-height: 1.1;
  margin-top: 1px;
}

.ts-iso {
  font-size: 17px;
  color: var(--text-2);
  font-family: "Segoe UI", Arial, sans-serif;
  direction: ltr;
  letter-spacing: .2px;
  margin-top: 4px;
}


/* ============================================================
   ردیف ۳) نوار KPI فروش
   ============================================================ */
.kpi-strip {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.kpi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 5px 9px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  min-height: 48px;
}

.kpi-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: #c7cdf7;
}

.kpi-card.is-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-color: var(--primary-dark);
}

.kpi-card.is-accent {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #d97706;
}

.kpi-icon {
  font-size: 11px;
  line-height: 1;
  opacity: .9;
}

.kpi-val {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: "Segoe UI", Arial, sans-serif;
  letter-spacing: -.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  direction: ltr;
  text-align: right;
}

.kpi-card.is-primary .kpi-val,
.kpi-card.is-accent .kpi-val { color: #fff; }

.kpi-lbl {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.kpi-card.is-primary .kpi-lbl,
.kpi-card.is-accent .kpi-lbl { color: rgba(255, 255, 255, .85); }

.kpi-trend {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 11px;
  font-weight: 800;
  padding: 0 5px;
  border-radius: 99px;
  font-family: "Segoe UI", Arial, sans-serif;
}

.kpi-trend.is-up {
  color: var(--success);
  background: var(--success-soft);
}

.kpi-trend.is-down {
  color: var(--danger);
  background: var(--danger-soft);
}

.kpi-card.is-primary .kpi-trend.is-up,
.kpi-card.is-accent .kpi-trend.is-up {
  color: #fff;
  background: rgba(255, 255, 255, .22);
}


/* ============================================================
   ردیف ۴) دو بخش تب‌بندی — ارتفاع بیشتر (چون نمودار فروش حذف شد)
   ============================================================ */
.tabbed-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  overflow: hidden;
}

.tabbed-card {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tabbed-head {
  flex: 0 0 auto;
  background: #fbfcfe;
  border-bottom: 1px solid var(--border-soft);
}

.tabbed-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  overflow: hidden;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1 1 0;
  min-width: 0;
  height: 26px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}

.tab-btn:hover {
  color: var(--text-2);
  background: #eef2f8;
}

.tab-btn.is-active {
  color: var(--primary-dark);
  background: #fff;
  border-color: #dcdcfb;
  box-shadow: 0 1px 3px rgba(79, 70, 229, .12);
}

.tab-btn.is-placeholder {
  opacity: .55;
  border-style: dashed;
  border-color: #e4e9f2;
}

.tab-btn.is-placeholder:hover {
  opacity: .85;
  background: #f7f9fc;
}

.tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  font-size: 9.5px;
  border-radius: 5px;
  flex: 0 0 auto;
  line-height: 1;
}

.tab-icon.is-sch     { background: #fce7f3; color: #be185d; }
.tab-icon.is-dl      { background: #fef3c7; color: #b45309; }
.tab-icon.is-cmt     { background: #d1fae5; color: #047857; }
.tab-icon.is-view    { background: #dbeafe; color: #1d4ed8; }
.tab-icon.is-sale    { background: #dcfce7; color: #166534; }
.tab-icon.is-tag     { background: #f3e8ff; color: #7e22ce; }
.tab-icon.is-star    { background: #fef9c3; color: #a16207; }
.tab-icon.is-report  { background: #e0e7ff; color: #4338ca; }
.tab-icon.is-finance { background: #d1fae5; color: #15803d; }
.tab-icon.is-ticket  { background: #fef3c7; color: #b45309; }
.tab-icon.is-survey  { background: #fce7f3; color: #be185d; }

.tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.tabbed-panels {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.tabbed-panel {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  overflow: hidden;
}

.tabbed-panel.is-active { display: flex; }


/* ============================================================
   لیست‌ها
   ============================================================ */
.dash-list {
  flex: 1 1 auto;
  min-height: 0;
  list-style: none;
  overflow-y: auto;
  padding: 6px 8px;
}

.dash-list::-webkit-scrollbar,
.tags-cloud::-webkit-scrollbar,
.best-paid-full::-webkit-scrollbar { width: 6px; }

.dash-list::-webkit-scrollbar-track,
.tags-cloud::-webkit-scrollbar-track { background: transparent; }

.dash-list::-webkit-scrollbar-thumb,
.tags-cloud::-webkit-scrollbar-thumb {
  background: #d6dce8;
  border-radius: 99px;
}

.dash-list::-webkit-scrollbar-thumb:hover,
.tags-cloud::-webkit-scrollbar-thumb:hover { background: #c2cad9; }

.dash-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 7px;
  transition: background .12s;
  cursor: pointer;
}

.dash-item:hover { background: var(--primary-soft); }

.dash-item + .dash-item {
  border-top: 1px dashed #eef2f8;
}

.item-link {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.item-rank {
  flex: 0 0 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--muted);
  background: #f1f4fa;
  border-radius: 6px;
  font-family: "Segoe UI", Arial, sans-serif;
}

.dash-item:nth-child(1) .item-rank { background: var(--gold-soft); color: #a16207; }
.dash-item:nth-child(2) .item-rank { background: #f1f5f9; color: #475569; }
.dash-item:nth-child(3) .item-rank { background: #ffedd5; color: #c2410c; }

.item-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.3;
}

.item-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta .dot { color: #d5dbe6; }

.item-value {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
  border-radius: 99px;
  font-variant-numeric: tabular-nums;
  font-family: "Segoe UI", Arial, sans-serif;
  white-space: nowrap;
}

.item-value.is-view { background: #dbeafe; color: #1d4ed8; }
.item-value.is-cmt  { background: #d1fae5; color: #047857; }
.item-value.is-dl   { background: #fef3c7; color: #b45309; }
.item-value.is-sch  { background: #fce7f3; color: #be185d; }
.item-value.is-sale { background: #dcfce7; color: #166534; }

.item-avatar {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #a5b4fc, #6366f1);
}


/* ============================================================
   ابر برچسب‌ها
   ============================================================ */
.tags-cloud {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 5px;
  padding: 10px;
  overflow-y: auto;
}

.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 11px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--purple);
  background: var(--purple-soft);
  border: 1px solid #e9d5ff;
  border-radius: 99px;
  transition: transform .12s, background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}

.tag-cloud-item:hover {
  color: #fff;
  background: var(--purple);
  border-color: var(--purple);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(124, 58, 237, .28);
}

.tag-cloud-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 15px;
  padding: 0 5px;
  font-size: 9px;
  font-weight: 800;
  color: var(--purple);
  background: #fff;
  border-radius: 99px;
  line-height: 1;
  font-family: "Segoe UI", Arial, sans-serif;
}

.tag-cloud-item:hover .tag-cloud-count {
  color: var(--purple);
  background: rgba(255, 255, 255, .95);
}

.tag-cloud-item.size-1 { font-size: 12.5px; padding: 5px 13px; color: #5b21b6; background: #ede9fe; }
.tag-cloud-item.size-2 { font-size: 11.5px; color: #6d28d9; background: #f3e8ff; }
.tag-cloud-item.size-3 { font-size: 10.5px; color: #7c3aed; background: #f5f3ff; }
.tag-cloud-item.size-4 { font-size: 9.5px;  color: #8b5cf6; background: #faf5ff; }


/* ============================================================
   بهترین فایل پولی
   ============================================================ */
.best-paid-full {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bp-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.bp-hero::before {
  content: "👑";
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: 16px;
  opacity: .85;
}

.bp-thumb {
  flex: 0 0 60px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: #fff;
  border: 2px solid #fcd34d;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(234, 179, 8, .25);
}

.bp-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bp-title {
  font-size: 13px;
  font-weight: 800;
  color: #78350f;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bp-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #92400e;
}

.bp-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  font-size: 9.5px;
  font-weight: 800;
  border-radius: 99px;
  font-family: "Segoe UI", Arial, sans-serif;
}

.bp-badge.is-price {
  color: #fff;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.bp-badge.is-sales {
  color: #166534;
  background: #dcfce7;
}

.bp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.bp-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  background: #f7f9fc;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  text-align: center;
}

.bp-stat b {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.1;
}

.bp-stat.is-rev b { color: var(--success); }
.bp-stat.is-cnt b { color: var(--purple); }

.bp-stat span {
  font-size: 9.5px;
  color: var(--muted);
}

.bp-bar-wrap { margin-top: 2px; }

.bp-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
}

.bp-bar-label b {
  color: var(--primary-dark);
  font-weight: 800;
  font-family: "Segoe UI", Arial, sans-serif;
}

.bp-bar {
  height: 8px;
  background: #eef2f8;
  border-radius: 99px;
  overflow: hidden;
}

.bp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--purple) 100%);
  border-radius: 99px;
  transition: width .4s;
}

.bp-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(217, 119, 6, .3);
  transition: transform .12s, box-shadow .15s;
}

.bp-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, .38);
}


/* ============================================================
   پنل‌های placeholder
   ============================================================ */
.placeholder-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  color: var(--muted-2);
  text-align: center;
}

.placeholder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  font-size: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f1f4fa 0%, #e0e7ff 100%);
  border: 2px dashed #c7cdf7;
}

.placeholder-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-2);
}

.placeholder-hint {
  font-size: 10.5px;
  color: var(--muted-2);
}


/* ============================================================
   ردیف ۵) نمودارهای تب‌بندی (پایین صفحه)
   ============================================================ */
.charts-tabbed {
  flex: 0 0 165px;
  height: 165px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.charts-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--border-soft);
}

.charts-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: #f1f4fa;
  border-radius: 7px;
  flex: 0 1 auto;
  min-width: 0;
}

.ct-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}

.ct-btn:hover { color: var(--text-2); }

.ct-btn.is-active {
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 1px 3px rgba(79, 70, 229, .12);
}

.ct-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 9px;
  border-radius: 4px;
  flex: 0 0 auto;
  line-height: 1;
}

.ct-icon.is-sale    { background: #d1fae5; color: #166534; }
.ct-icon.is-content { background: #dbeafe; color: #1d4ed8; }
.ct-icon.is-eng     { background: #e0e7ff; color: #4338ca; }
.ct-icon.is-future  { background: #fce7f3; color: #be185d; }

.ct-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.charts-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.chart-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
}

.cs-label { white-space: nowrap; }

.chart-select {
  height: 24px;
  padding: 0 22px 0 8px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--primary-dark);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8592a3 50%),
                    linear-gradient(135deg, #8592a3 50%, transparent 50%);
  background-position: left 8px center, left 12px center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  outline: none;
  transition: border-color .15s;
}

.chart-select:focus { border-color: var(--primary); }

.charts-summary { display: flex; gap: 5px; }

.charts-summary .cs-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-2);
  background: #f7f9fc;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}

.charts-summary .cs-item b {
  font-weight: 800;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
  font-family: "Segoe UI", Arial, sans-serif;
}

.charts-summary .cs-item.is-success b { color: var(--success); }
.charts-summary .cs-item.is-purple b  { color: var(--purple); }

.charts-body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  padding: 4px 10px 2px;
  direction: ltr;
}

.charts-body svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  direction: ltr;
}

.charts-body svg text { direction: ltr; }

.charts-legend {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 2px 10px 5px;
  font-size: 9px;
  color: var(--muted);
}

.charts-legend .lg-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.charts-legend .lg-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  display: inline-block;
}


/* ============================================================
   کلاس‌های SVG
   ============================================================ */
.chart-grid-line {
  stroke: #eef2f8;
  stroke-width: 1;
}

.chart-axis-label {
  font-size: 8px;
  fill: var(--muted-2);
  font-family: "Segoe UI", Arial, sans-serif;
}

.chart-area-rev { fill: url(#gradRev); }
.chart-area-cnt { fill: url(#gradCnt); }
.chart-area-pub { fill: url(#gradPub); }
.chart-area-dl  { fill: url(#gradDl); }
.chart-area-eng { fill: url(#gradEng); }

.chart-line-rev {
  fill: none;
  stroke: #16a34a;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-cnt {
  fill: none;
  stroke: #7c3aed;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-pub {
  fill: none;
  stroke: #1d4ed8;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-dl {
  fill: none;
  stroke: #b45309;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-paid {
  fill: none;
  stroke: #15803d;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-eng {
  fill: none;
  stroke: #4338ca;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-cmt {
  fill: none;
  stroke: #047857;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot { stroke: #fff; stroke-width: 1.3; }
.chart-dot.is-rev  { fill: #16a34a; }
.chart-dot.is-cnt  { fill: #7c3aed; }
.chart-dot.is-pub  { fill: #1d4ed8; }
.chart-dot.is-dl   { fill: #b45309; }
.chart-dot.is-paid { fill: #15803d; }
.chart-dot.is-eng  { fill: #4338ca; }
.chart-dot.is-cmt  { fill: #047857; }

.chart-future-zone {
  fill: #f8fafc;
  opacity: .55;
}

.chart-now-line {
  stroke: var(--danger);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
  opacity: .65;
}

.chart-bar {
  rx: 2;
  transition: opacity .15s;
}

.chart-bar.is-post { fill: #4f46e5; }
.chart-bar.is-file { fill: #f59e0b; }
.chart-bar.is-paid { fill: #16a34a; }

.chart-bar:hover { opacity: .8; }


/* ============================================================
   حالت خالی و فوکوس
   ============================================================ */
.list-empty {
  padding: 20px;
  text-align: center;
  font-size: 11px;
  color: var(--muted-2);
}

.kpi-card:focus-visible,
.tag-cloud-item:focus-visible,
.tab-btn:focus-visible,
.ct-btn:focus-visible,
.bp-cta:focus-visible,
.qs-item:focus-visible,
.quick-add:focus-visible,
.qm-item:focus-visible,
.chart-select:focus-visible,
.admin-logout:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}