/* ============================================
   CreativeHub Platform — Main Stylesheet
   Modern, Clean, RTL/LTR Bilingual
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --primary: #6C5CE7;
  --primary-light: #a29bfe;
  --primary-dark: #5541d7;
  --primary-bg: #f0eeff;
  --secondary: #00CEC9;
  --accent: #fd79a8;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e17055;
  --info: #74b9ff;

  --bg: #F7F8FC;
  --bg-card: #ffffff;
  --bg-sidebar: #1a1a2e;
  --bg-sidebar-item: rgba(255,255,255,0.05);
  --bg-sidebar-active: rgba(108,92,231,0.3);

  --text-primary: #1a1a2e;
  --text-secondary: #636e72;
  --text-muted: #b2bec3;
  --text-white: #ffffff;
  --text-sidebar: rgba(255,255,255,0.75);
  --text-sidebar-active: #ffffff;

  --border: #e8ecf0;
  --border-light: #f1f3f5;
  --shadow-sm: 0 2px 8px rgba(108,92,231,0.06);
  --shadow-md: 0 4px 20px rgba(108,92,231,0.12);
  --shadow-lg: 0 8px 40px rgba(108,92,231,0.18);
  --shadow-xl: 0 20px 60px rgba(108,92,231,0.22);

  --sidebar-width: 260px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: all 0.4s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}
body.lang-en { font-family: 'Inter', 'Cairo', sans-serif; }
body.lang-ar { font-family: 'Cairo', 'Inter', sans-serif; }

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; outline: none; }
img { max-width: 100%; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: var(--radius-full); }

/* ============================================
   LAYOUT
   ============================================ */

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: var(--transition-slow);
  overflow: hidden;
}

html[dir="rtl"] .sidebar { left: auto; right: 0; }

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: var(--transition-slow);
}
html[dir="rtl"] .main-content { margin-left: 0; margin-right: var(--sidebar-width); }

/* ---------- Sidebar Header ---------- */
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
  box-shadow: 0 4px 15px rgba(108,92,231,0.4);
  flex-shrink: 0;
}
.logo-text { display: flex; flex-direction: column; }
.logo-name { font-size: 15px; font-weight: 700; color: white; line-height: 1.2; }
.logo-tagline { font-size: 11px; color: var(--text-sidebar); }

.sidebar-close {
  color: var(--text-sidebar);
  font-size: 16px;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: none;
  transition: var(--transition);
}
.sidebar-close:hover { color: white; background: var(--bg-sidebar-item); }

/* ---------- Sidebar Navigation ---------- */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}
.sidebar-nav::-webkit-scrollbar { width: 0; }

.nav-section { margin-bottom: 24px; }
.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 0 12px;
  margin-bottom: 8px;
  display: block;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-sidebar);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  margin-bottom: 4px;
}
.nav-item:hover {
  background: var(--bg-sidebar-item);
  color: white;
}
.nav-item.active {
  background: var(--bg-sidebar-active);
  color: white;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 50%; right: 0;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--primary-light);
  border-radius: 3px 0 0 3px;
}
html[dir="ltr"] .nav-item.active::before { right: auto; left: 0; border-radius: 0 3px 3px 0; }

.nav-item i { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item span { flex: 1; }

.badge {
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

/* ---------- Sidebar Footer ---------- */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-sidebar-item);
}
.user-mini-avatar { position: relative; flex-shrink: 0; }
.user-mini-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 9px; height: 9px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
}
html[dir="rtl"] .online-dot { right: auto; left: 1px; }
.user-mini-info { flex: 1; overflow: hidden; }
.user-mini-name { display: block; font-size: 13px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mini-role { display: block; font-size: 11px; color: var(--text-sidebar); }
.user-mini-menu { color: var(--text-sidebar); font-size: 14px; padding: 4px; transition: var(--transition); }
.user-mini-menu:hover { color: white; }

/* ---------- Sidebar Overlay ---------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  backdrop-filter: blur(3px);
}
.sidebar-overlay.active { display: block; }

/* ============================================
   TOP HEADER
   ============================================ */
.top-header {
  position: sticky; top: 0;
  height: var(--header-height);
  background: rgba(247,248,252,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 500;
  gap: 16px;
}

.header-start { display: flex; align-items: center; gap: 16px; }
.header-end { display: flex; align-items: center; gap: 10px; }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: var(--transition); }
.menu-toggle:hover { background: var(--primary-bg); }

.page-title-wrap { display: flex; flex-direction: column; }
.page-title { font-size: 18px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.page-breadcrumb { font-size: 12px; color: var(--text-secondary); }

.header-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  transition: var(--transition);
}
.header-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.1);
}
.header-search i { color: var(--text-muted); font-size: 13px; }
.header-search input {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--text-primary);
  width: 180px;
}
.header-search input::placeholder { color: var(--text-muted); }

.header-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 15px;
  transition: var(--transition);
}
.header-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  border: 2px solid var(--bg);
}
html[dir="rtl"] .notif-badge { right: auto; left: -4px; }

.currency-switch {
  display: flex;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}
.currency-btn {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}
.currency-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}
.lang-toggle:hover { border-color: var(--primary); color: var(--primary); }
.lang-toggle i { font-size: 14px; }

/* ============================================
   NOTIFICATIONS PANEL
   ============================================ */
.notif-panel {
  position: fixed;
  top: var(--header-height);
  width: 360px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 600;
  transform: translateY(-10px) scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  overflow: hidden;
}
html[dir="rtl"] .notif-panel { right: 80px; }
html[dir="ltr"] .notif-panel { right: 80px; }

.notif-panel.open {
  transform: translateY(8px) scale(1);
  opacity: 1;
  pointer-events: all;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.notif-header h3 { font-size: 15px; font-weight: 700; }
.mark-all { font-size: 12px; color: var(--primary); font-weight: 600; }
.mark-all:hover { text-decoration: underline; }

.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition);
  cursor: pointer;
}
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: rgba(108,92,231,0.03); }
.notif-item:last-child { border-bottom: none; }

.notif-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.notif-icon.green { background: rgba(0,184,148,0.12); color: var(--success); }
.notif-icon.blue { background: rgba(116,185,255,0.15); color: var(--info); }
.notif-icon.purple { background: var(--primary-bg); color: var(--primary); }
.notif-icon.orange { background: rgba(253,203,110,0.15); color: var(--warning); }
.notif-icon.red { background: rgba(225,112,85,0.12); color: var(--danger); }

.notif-body p { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 3px; }
.notif-body span { font-size: 11px; color: var(--text-muted); }

/* ============================================
   SECTIONS
   ============================================ */
.section {
  display: none;
  padding: 28px;
  animation: fadeIn 0.3s ease;
  min-height: calc(100vh - var(--header-height));
}
.section.active { display: block; }

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

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-header h2 { font-size: 22px; font-weight: 800; }
.section-header p { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* ============================================
   DASHBOARD — STATS CARDS
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -30%; right: -15%;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
html[dir="ltr"] .stat-card::after { right: auto; left: -15%; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.gradient-purple { background: linear-gradient(135deg, #6C5CE7, #a29bfe); }
.gradient-green  { background: linear-gradient(135deg, #00b894, #55efc4); }
.gradient-blue   { background: linear-gradient(135deg, #0984e3, #74b9ff); }
.gradient-orange { background: linear-gradient(135deg, #e17055, #fab1a0); }

.stat-icon {
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.22);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: white;
  flex-shrink: 0;
}
.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 12px; color: rgba(255,255,255,0.8); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 800; color: white; line-height: 1; margin-bottom: 6px; }
.stat-change { font-size: 11px; color: rgba(255,255,255,0.85); display: flex; align-items: center; gap: 4px; }
.stat-change i { font-size: 9px; }

/* ============================================
   CHARTS
   ============================================ */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
  transition: var(--transition);
}
.chart-card:hover { box-shadow: var(--shadow-md); }
.chart-card.wide { }

.chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.chart-header h3 { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.chart-header p { font-size: 12px; color: var(--text-secondary); }

.chart-actions { display: flex; gap: 6px; }
.chart-filter {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1.5px solid var(--border);
  transition: var(--transition);
}
.chart-filter.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.chart-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.chart-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-left: 8px;
}
html[dir="ltr"] .chart-legend-dot { margin-left: 0; margin-right: 8px; }
.chart-legend-label { display: flex; align-items: center; color: var(--text-secondary); }
.chart-legend-val { font-weight: 700; color: var(--text-primary); }

/* ============================================
   DASHBOARD BOTTOM
   ============================================ */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dash-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border);
}
.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dash-card-header h3 { font-size: 15px; font-weight: 700; }
.view-all {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  transition: var(--transition);
}
.view-all:hover { text-decoration: underline; }

/* Mini Campaign List */
.mini-campaign-list { display: flex; flex-direction: column; gap: 12px; }
.mini-campaign {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-md);
  transition: var(--transition);
  border: 1.5px solid transparent;
}
.mini-campaign:hover { border-color: var(--primary-light); background: var(--primary-bg); }
.mini-campaign-brand { display: flex; align-items: center; gap: 12px; }
.brand-avatar {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 15px;
  flex-shrink: 0;
}
.brand-name { display: block; font-size: 13px; font-weight: 700; }
.campaign-platform { display: block; font-size: 11px; color: var(--text-secondary); }
.campaign-platform i { margin-left: 3px; }
html[dir="ltr"] .campaign-platform i { margin-left: 0; margin-right: 3px; }
.mini-campaign-info { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
html[dir="ltr"] .mini-campaign-info { align-items: flex-start; }
.camp-budget { font-size: 13px; font-weight: 700; color: var(--text-primary); }

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.status-badge.active    { background: rgba(0,184,148,0.12); color: var(--success); }
.status-badge.pending   { background: rgba(253,203,110,0.15); color: #c7a700; }
.status-badge.completed { background: var(--primary-bg); color: var(--primary); }
.status-badge.rejected  { background: rgba(225,112,85,0.12); color: var(--danger); }

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 12px;
  background: var(--bg);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  transition: var(--transition);
  border: 1.5px solid var(--border);
}
.quick-action-btn:hover { border-color: var(--primary); background: var(--primary-bg); }
.qa-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.qa-icon.purple { background: var(--primary-bg); color: var(--primary); }
.qa-icon.green  { background: rgba(0,184,148,0.12); color: var(--success); }
.qa-icon.blue   { background: rgba(116,185,255,0.15); color: #0984e3; }
.qa-icon.orange { background: rgba(253,203,110,0.15); color: #e17055; }

/* Performance Meters */
.performance-meters h4 { font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.meter-item { margin-bottom: 12px; }
.meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 600;
}
.meter-bar {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s ease;
}

/* ============================================
   CAMPAIGNS SECTION
   ============================================ */
.filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filter-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  transition: var(--transition);
}
.filter-tab:hover { border-color: var(--primary-light); color: var(--primary); }
.filter-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.tab-count {
  background: rgba(255,255,255,0.25);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}
.filter-tab:not(.active) .tab-count {
  background: var(--border);
  color: var(--text-secondary);
}

.campaigns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.campaign-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}
.campaign-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--primary-light); }

.cc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.cc-brand { display: flex; align-items: center; gap: 12px; }
.cc-brand-avatar {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: white;
  flex-shrink: 0;
}
.cc-brand-name { font-size: 15px; font-weight: 700; }
.cc-campaign-name { font-size: 12px; color: var(--text-secondary); }
.cc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.cc-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--bg);
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}
.cc-divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.cc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cc-budget { font-size: 17px; font-weight: 800; color: var(--primary); }
.cc-budget-label { font-size: 11px; color: var(--text-secondary); }
.cc-progress { margin-top: 14px; }
.cc-progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; }
.cc-progress-bar { height: 5px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.cc-progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); border-radius: var(--radius-full); }

/* Campaign Card — Edit / Delete buttons */
.cc-actions { display: flex; align-items: center; gap: 6px; }
.cc-btn-edit {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  background: var(--primary-bg);
  color: var(--primary);
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius-md);
  font-size: 11px; font-weight: 700;
  transition: var(--transition);
}
.cc-btn-edit:hover { background: var(--primary); color: white; }
.cc-btn-delete {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: #fff0ee;
  color: var(--danger);
  border: 1.5px solid #ffc9be;
  border-radius: var(--radius-md);
  font-size: 12px;
  transition: var(--transition);
}
.cc-btn-delete:hover { background: var(--danger); color: white; border-color: var(--danger); }

/* Campaign Card — Payment row (Advance / Remaining) */
.cc-payment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.cc-payment-item {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  display: flex; flex-direction: column; gap: 3px;
}
.cc-payment-item.green { background: #e8faf5; border: 1px solid #b2f0de; }
.cc-payment-item.orange { background: #fff8ee; border: 1px solid #ffddb2; }
.cc-pay-label { font-size: 10px; color: var(--text-secondary); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.cc-pay-label .fa-check-circle { color: var(--success); }
.cc-pay-label .fa-clock       { color: var(--warning); }
.cc-pay-val   { font-size: 12px; font-weight: 800; color: var(--text-primary); }

/* Campaign Card — Advance progress bar */
.cc-adv-bar {
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 8px;
}
.cc-adv-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #55efc4);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* ── Status Selector in Campaign Modal ─────── */
.status-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.status-option-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 12px; font-weight: 700;
  color: var(--text-secondary);
  transition: var(--transition);
}
.status-option-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.status-option-btn.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.1);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.active-dot    { background: var(--success); box-shadow: 0 0 4px var(--success); }
.pending-dot   { background: var(--warning); box-shadow: 0 0 4px var(--warning); }
.completed-dot { background: var(--info);    box-shadow: 0 0 4px var(--info); }
.rejected-dot  { background: var(--danger);  box-shadow: 0 0 4px var(--danger); }

/* ── Payment Summary Box in Campaign Modal ─── */
.payment-summary-box {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  justify-content: center;
}
.psb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.psb-row span   { color: var(--text-secondary); font-weight: 600; }
.psb-row strong { font-size: 13px; color: var(--text-primary); font-weight: 800; }
.psb-divider    { height: 1px; background: var(--border); }
.psb-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}
.psb-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.psb-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}
#psbPercent { font-size: 10px; color: var(--text-secondary); white-space: nowrap; }

/* ── Range input ───────────────────────────── */
.progress-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.range-input {
  flex: 1;
  accent-color: var(--primary);
  cursor: pointer;
}
.range-val {
  min-width: 38px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
}

/* ── Form Select ───────────────────────────── */
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23636e72' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
  cursor: pointer;
}
html[dir="ltr"] .form-select {
  background-position: right 14px center;
  padding-left: 16px;
  padding-right: 36px;
}

/* ── Invoice Actions (view + edit buttons) ─── */
.inv-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.inv-edit-btn { color: var(--primary) !important; border-color: var(--primary-light) !important; }
.inv-edit-btn:hover { background: var(--primary) !important; color: white !important; border-color: var(--primary) !important; }

/* ── Invoice View Modal ────────────────────── */
.invoice-view-body { display: flex; flex-direction: column; gap: 0; }
.inv-view-logo {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--primary-bg);
}
.inv-view-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.inv-view-row:last-child { border-bottom: none; }
.inv-view-row span  { color: var(--text-secondary); font-weight: 500; }
.inv-view-row strong { font-weight: 700; color: var(--text-primary); }
.inv-view-row.highlight strong { font-size: 16px; color: var(--primary); }
.modal.modal-sm { max-width: 440px; }
.modal.modal-lg { max-width: 760px; }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,26,46,0.55);
  z-index: 2000;
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalSlideUp 0.3s ease;
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 800; }
.modal-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--danger); color: white; }

.modal-body { padding: 24px 28px; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 28px 24px;
  border-top: 1px solid var(--border);
}
html[dir="rtl"] .modal-footer { justify-content: flex-start; }

/* ---------- Form Elements ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-primary); }

.form-input {
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg);
  transition: var(--transition);
  width: 100%;
  resize: none;
}
.form-input:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.1);
}

/* Platform Selector */
.platform-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.platform-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}
.platform-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.platform-btn.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

/* Content Type Selector */
.content-type-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.content-type-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}
.content-type-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.content-type-btn.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(108,92,231,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108,92,231,0.5);
}
.btn-primary.small { padding: 7px 14px; font-size: 12px; }
.btn-primary.full-width { width: 100%; justify-content: center; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost {
  padding: 7px 14px;
  color: var(--primary);
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
}
.btn-ghost:hover { background: var(--primary); color: white; }

/* ============================================
   FINANCE SECTION
   ============================================ */
.finance-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.finance-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.finance-stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.finance-stat-icon.green  { background: rgba(0,184,148,0.1);  color: var(--success); }
.finance-stat-icon.orange { background: rgba(253,203,110,0.15); color: var(--warning); }
.finance-stat-icon.blue   { background: rgba(116,185,255,0.15); color: var(--info); }
.finance-stat-icon.purple { background: var(--primary-bg); color: var(--primary); }
.finance-stat-label { display: block; font-size: 11px; color: var(--text-secondary); font-weight: 600; margin-bottom: 4px; }
.finance-stat-value { font-size: 18px; font-weight: 800; color: var(--text-primary); }

.finance-tabs-wrap { margin-bottom: 20px; }

.finance-tab-content { display: none; }
.finance-tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* Table */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1.5px solid var(--border); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: 13px;
}
.data-table th {
  padding: 14px 18px;
  text-align: right;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg);
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
html[dir="ltr"] .data-table th { text-align: left; }
.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  font-weight: 500;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }

/* Transactions */
.transactions-list { display: flex; flex-direction: column; gap: 10px; }
.transaction-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  transition: var(--transition);
}
.transaction-item:hover { border-color: var(--primary-light); }
.tx-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.tx-info { flex: 1; }
.tx-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.tx-date { font-size: 12px; color: var(--text-secondary); }
.tx-amount { font-size: 16px; font-weight: 800; }
.tx-amount.credit { color: var(--success); }
.tx-amount.debit  { color: var(--danger); }

/* Withdraw */
.withdraw-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.balance-card {
  background: linear-gradient(135deg, var(--primary), #a29bfe);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.balance-card span:first-child { font-size: 13px; opacity: 0.8; }
.balance-card strong { font-size: 32px; font-weight: 800; }
.balance-card span:last-child { font-size: 11px; opacity: 0.7; }

.currency-converter {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1.5px solid var(--border);
}
.currency-converter h4 { font-size: 14px; font-weight: 700; margin-bottom: 16px; }
.converter-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.conv-input { flex: 1; }
.conv-input label { display: block; font-size: 11px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.conv-icon { color: var(--primary); font-size: 18px; flex-shrink: 0; margin-top: 16px; }
.conv-rate { font-size: 12px; color: var(--text-secondary); margin-top: 12px; }

.withdraw-form { background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px; border: 1.5px solid var(--border); }
.withdraw-form h4 { font-size: 15px; font-weight: 700; margin-bottom: 20px; }

.payment-methods { display: flex; gap: 10px; flex-wrap: wrap; }
.payment-method-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}
.payment-method-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.payment-method-btn.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

/* ============================================
   PROFILE SECTION
   ============================================ */
.profile-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}

.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.profile-cover {
  height: 120px;
  background: linear-gradient(135deg, #6C5CE7 0%, #fd79a8 50%, #fdcb6e 100%);
}
.profile-info {
  padding: 0 24px 24px;
  text-align: center;
  position: relative;
}
.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-top: -44px;
  margin-bottom: 12px;
}
.profile-avatar {
  width: 88px; height: 88px;
  border-radius: 50%;
  border: 4px solid var(--bg-card);
  object-fit: cover;
  display: block;
}
.profile-edit-avatar {
  position: absolute;
  bottom: 0; right: 0;
  width: 28px; height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.profile-edit-avatar:hover { background: var(--primary-dark); transform: scale(1.1); }

.profile-name { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.profile-bio { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }

.profile-stats-row {
  display: flex;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.profile-stat {
  flex: 1;
  text-align: center;
  padding: 0 10px;
}
.profile-stat:not(:last-child) {
  border-left: 1px solid var(--border);
}
html[dir="ltr"] .profile-stat:not(:last-child) {
  border-left: none;
  border-right: 1px solid var(--border);
}
.profile-stat strong { display: block; font-size: 18px; font-weight: 800; color: var(--primary); }
.profile-stat span { font-size: 11px; color: var(--text-secondary); }

/* Social Links */
.social-links-section { padding: 20px 24px 24px; border-top: 1px solid var(--border); }
.social-links-section h4 { font-size: 14px; font-weight: 700; margin-bottom: 14px; }
.social-links { display: flex; flex-direction: column; gap: 10px; }
.social-link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  transition: var(--transition);
}
.social-link-item:hover { border-color: var(--primary-light); }
.social-link-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: white;
  flex-shrink: 0;
}
.social-link-icon.instagram { background: linear-gradient(45deg,#E1306C,#F77737); }
.social-link-icon.tiktok    { background: #000; }
.social-link-icon.youtube   { background: #FF0000; }
.social-link-icon.snapchat  { background: #FFFC00; color: #000; }
.social-link-info { flex: 1; }
.social-link-info span { display: block; font-size: 12px; font-weight: 700; }
.social-handle { font-weight: 500 !important; color: var(--text-secondary) !important; font-size: 11px !important; }
.social-link-stats { text-align: center; }
.social-link-stats strong { display: block; font-size: 14px; font-weight: 700; }
.social-link-stats span { font-size: 10px; color: var(--text-secondary); }
.social-link-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  transition: var(--transition);
}
.social-link-btn.connected {
  background: rgba(0,184,148,0.1);
  color: var(--success);
  border: 1.5px solid rgba(0,184,148,0.2);
}
.social-link-btn.connect {
  background: var(--primary-bg);
  color: var(--primary);
  border: 1.5px solid var(--primary-light);
}
.social-link-btn.connect:hover { background: var(--primary); color: white; }

/* Portfolio */
.portfolio-section {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.portfolio-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  aspect-ratio: 1;
}
.portfolio-item img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); display: block; }
.portfolio-item:hover img { transform: scale(1.05); }
.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(108,92,231,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  flex-direction: column;
  gap: 4px;
}
.portfolio-item:hover .portfolio-overlay { opacity: 1; }
.portfolio-overlay i { color: white; font-size: 20px; }
.portfolio-overlay span { color: white; font-size: 11px; font-weight: 600; }

.niche-section { margin-top: 16px; }
.niche-section h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.niche-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.niche-tag {
  padding: 6px 16px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--primary-light);
}
.niche-add {
  padding: 6px 16px;
  background: var(--bg);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  border: 1.5px dashed var(--border);
  transition: var(--transition);
}
.niche-add:hover { border-color: var(--primary); color: var(--primary); }

/* ============================================
   ANALYTICS SECTION
   ============================================ */
.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
}
.kpi-trend.up   { background: rgba(0,184,148,0.12); color: var(--success); }
.kpi-trend.down { background: rgba(225,112,85,0.12); color: var(--danger); }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--text-primary); margin-bottom: 6px; }
.kpi-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }

.analytics-charts {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin-bottom: 24px;
}
.audience-legend { display: flex; gap: 20px; margin-top: 16px; justify-content: center; }
.aud-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.aud-legend-item span:first-child {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 3px;
}

/* Top Content */
.top-content-list { display: flex; flex-direction: column; gap: 12px; }
.top-content-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.top-content-item:hover { background: var(--primary-bg); }
.top-content-rank {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.top-content-rank.gold   { background: linear-gradient(135deg, #f9ca24, #f0932b); }
.top-content-rank.silver { background: linear-gradient(135deg, #dfe6e9, #b2bec3); }
.top-content-rank.bronze { background: linear-gradient(135deg, #cd853f, #a0522d); }
.top-content-thumb {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}
.top-content-info { flex: 1; }
.top-content-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.top-content-meta { font-size: 11px; color: var(--text-secondary); }
.top-content-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
html[dir="ltr"] .top-content-stats { align-items: flex-start; }
.top-content-reach { font-size: 14px; font-weight: 800; color: var(--primary); }
.top-content-eng { font-size: 11px; color: var(--success); }

/* ============================================
   SETTINGS SECTION
   ============================================ */
.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}
.settings-nav {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 12px;
  border: 1.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.setting-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  text-align: right;
  width: 100%;
}
html[dir="ltr"] .setting-nav-btn { text-align: left; }
.setting-nav-btn:hover { background: var(--bg); color: var(--text-primary); }
.setting-nav-btn.active { background: var(--primary-bg); color: var(--primary); }
.setting-nav-btn i { width: 18px; text-align: center; }

.settings-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1.5px solid var(--border);
}
.settings-tab { display: none; }
.settings-tab.active { display: block; animation: fadeIn 0.3s ease; }
.settings-tab h4 { font-size: 16px; font-weight: 800; margin-bottom: 24px; }

.settings-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

/* Language Options */
.lang-options { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }
.lang-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.lang-option:hover { border-color: var(--primary-light); }
.lang-option.active { border-color: var(--primary); background: var(--primary-bg); }
.lang-flag { font-size: 28px; }
.lang-option > div:nth-child(2) { flex: 1; }
.lang-option strong { display: block; font-size: 14px; font-weight: 700; }
.lang-option span { font-size: 12px; color: var(--text-secondary); }
.lang-check { color: var(--primary); font-size: 20px; opacity: 0; }
.lang-option.active .lang-check { opacity: 1; }

.currency-options h5 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.currency-option-btns { display: flex; gap: 12px; }
.currency-option-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
  text-align: center;
}
.currency-option-btn:hover { border-color: var(--primary-light); color: var(--primary); }
.currency-option-btn.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

/* Payment Settings */
.payment-settings { display: flex; flex-direction: column; gap: 12px; }
.payment-setting-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
}
.payment-setting-icon {
  width: 42px; height: 42px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.payment-setting-info { flex: 1; }
.payment-setting-info strong { display: block; font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.payment-setting-info span { font-size: 12px; color: var(--text-secondary); }
.add-payment {
  border-style: dashed;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  gap: 12px;
  transition: var(--transition);
}
.add-payment:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-bg); }
.add-payment i { color: var(--primary); font-size: 18px; }

/* Notification Settings */
.notif-settings { display: flex; flex-direction: column; gap: 0; }
.notif-setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 20px;
}
.notif-setting-item:last-child { border-bottom: none; }
.notif-setting-item > div { }
.notif-setting-item strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.notif-setting-item span { font-size: 12px; color: var(--text-secondary); }

/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: var(--radius-full);
  transition: var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  right: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
html[dir="ltr"] .toggle-slider::before { right: auto; left: 3px; }
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(-20px); }
html[dir="ltr"] .toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Security Settings */
.security-settings { display: flex; flex-direction: column; gap: 18px; }
.security-divider { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.security-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.security-option strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.security-option span { font-size: 12px; color: var(--text-secondary); }

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-primary);
  color: white;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  transition: var(--transition);
  box-shadow: var(--shadow-xl);
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast i { color: var(--success); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr; }
  .dashboard-bottom { grid-template-columns: 1fr; }
  .finance-stats { grid-template-columns: repeat(2, 1fr); }
  .analytics-kpis { grid-template-columns: repeat(2, 1fr); }
  .analytics-charts { grid-template-columns: 1fr; }
  .withdraw-wrap { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 260px; }
  .sidebar { transform: translateX(100%); }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  html[dir="ltr"] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; margin-right: 0 !important; }
  .menu-toggle { display: flex; }
  .sidebar-close { display: flex; }

  .top-header { padding: 0 16px; }
  .header-search { display: none; }
  .section { padding: 20px 16px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; gap: 12px; }
  .stat-value { font-size: 20px; }
  .finance-stats { grid-template-columns: 1fr 1fr; }
  .analytics-kpis { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-form { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: repeat(3, 1fr); }
  .campaigns-grid { grid-template-columns: 1fr; }
  .currency-switch { display: none; }
  .lang-toggle span { display: none; }
  .withdraw-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .finance-stats { grid-template-columns: 1fr; }
  .analytics-kpis { grid-template-columns: 1fr; }
  .modal { border-radius: var(--radius-lg); }
  .platform-selector { gap: 6px; }
  .platform-btn { padding: 7px 10px; font-size: 11px; }
}
