/* === RESET & ROOT === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Structure */
  --adminbar-bg:  #0d1526;
  --adminbar-h:   44px;
  --sidebar-w:    224px;

  /* Sidebar */
  --sidebar-bg:            #0f172a;
  --sidebar-item:          rgba(148,163,184,0.85);
  --sidebar-hover-bg:      rgba(255,255,255,0.06);
  --sidebar-hover-text:    #e2e8f0;
  --sidebar-active:        #60a5fa;
  --sidebar-active-bg:     rgba(96,165,250,0.12);
  --sidebar-active-border: #3b82f6;
  --sidebar-sep:           rgba(255,255,255,0.07);

  /* Compat aliases */
  --sidebar-text:          rgba(148,163,184,0.85);
  --sidebar-text-active:   #fff;
  --header-h:              0px;

  /* Brand */
  --primary:        #2563eb;
  --primary-hover:  #1d4ed8;
  --primary-dark:   #1e40af;
  --primary-bg:     #eff6ff;
  --primary-100:    #dbeafe;

  /* Orange CTA */
  --orange:         #FF6B00;
  --orange-hover:   #F06200;
  --orange-active:  #E05800;
  --orange-text:    #0f172a;
  --orange-shadow:  rgba(255,107,0,0.38);

  /* Semantic */
  --success:      #10b981;
  --success-bg:   #ecfdf5;
  --warning:      #f59e0b;
  --warning-bg:   #fffbeb;
  --danger:       #ef4444;
  --danger-bg:    #fef2f2;
  --info:         #06b6d4;
  --info-bg:      #ecfeff;
  --gold:         #f97316;
  --gold-bg:      #fff7ed;

  /* Compat (WP) */
  --wp-blue:        var(--primary);
  --wp-blue-hover:  var(--primary-hover);
  --wp-blue-dark:   var(--primary-dark);

  /* Surface */
  --bg:     #f1f5f9;
  --card:   #ffffff;
  --border: #e2e8f0;
  --text:   #0f172a;
  --text-2: #334155;
  --text-3: #64748b;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.05);
  --shadow:    0 1px 3px rgba(15,23,42,0.07), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,0.08), 0 2px 4px -2px rgba(15,23,42,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,0.08), 0 4px 6px -4px rgba(15,23,42,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15,23,42,0.1), 0 8px 10px -6px rgba(15,23,42,0.04);

  /* Shape */
  --radius:     12px;
  --radius-sm:  8px;
  --radius-xs:  6px;
  --radius-lg:  16px;
  --radius-pill: 999px;

  /* Motion */
  --ease:            cubic-bezier(0.16, 1, 0.3, 1);
  --transition:      0.2s ease;
  --transition-fast: 0.12s ease;
}

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

body {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--adminbar-h);
}

a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* === TYPOGRAPHY === */
h1 { font-size: 1.375rem; font-weight: 700; color: var(--text); line-height: 1.3; }
h2 { font-size: 1.125rem; font-weight: 600; color: var(--text); }
h3 { font-size: 1rem;     font-weight: 600; color: var(--text); }
p  { color: var(--text-2); line-height: 1.6; }

/* === WP HEADING INLINE === */
.wp-heading-inline {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: inline;
  margin-left: 6px;
}

.page-title-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: .8125rem;
  background: var(--orange);
  color: var(--orange-text) !important;
  border: 1px solid #E55F00;
  border-radius: var(--radius-sm);
  font-weight: 700;
  vertical-align: middle;
  transition: background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
  margin-bottom: 2px;
}
.page-title-action:hover {
  background: var(--orange-hover);
  border-color: #D45500;
  box-shadow: 0 4px 14px var(--orange-shadow);
  transform: translateY(-1px);
  color: var(--orange-text) !important;
}

.wp-header-end {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 10px 0 20px;
  clear: both;
}

/* === WRAP — page entry animation === */
.wrap { padding: 20px 24px 28px; animation: pageIn 0.38s var(--ease) both; }

/* === UTILITIES === */
.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.justify-end   { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-6  { gap: 1.5rem; }
.mt-1   { margin-top: 0.25rem; }
.mt-2   { margin-top: 0.5rem; }
.mt-4   { margin-top: 1rem; }
.mb-1   { margin-bottom: 0.25rem; }
.mb-2   { margin-bottom: 0.5rem; }
.mb-4   { margin-bottom: 1rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* === BACK LINK === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8125rem;
  color: var(--text-3);
  margin-bottom: 1rem;
  transition: color var(--transition-fast);
}
.back-link:hover { color: var(--primary); }
.back-link svg { width: 14px; height: 14px; }

/* === NOTICE === */
.notice {
  background: #fff;
  border-right: 4px solid var(--info);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  padding: 10px 14px;
  font-size: .875rem;
  margin-bottom: 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.notice-success { border-right-color: var(--success); }
.notice-error   { border-right-color: var(--danger); }
.notice-warning { border-right-color: var(--warning); }

/* === EMPTY STATE === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 4rem 2rem;
  color: var(--text-3);
  text-align: center;
}
.empty-state svg { opacity: .3; }
.empty-state p   { font-size: .875rem; }

/* === CUSTOM SCROLLBAR === */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* === KEYFRAMES === */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes barGrow {
  from { width: 0 !important; }
  to   { /* final width set by inline style */ }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0   rgba(37,99,235,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(37,99,235,0); }
}
