/* =============================================================
   PopTop Dashboard - Unified Design System v3.0
   Clean, Modern, Ultra-Responsive SaaS Architecture
   ============================================================= */

/* ─── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --primary:           #090e27;
  --primary-dark:      #050816;
  --primary-light:     #161e47;
  --primary-soft:      rgba(9, 14, 39, 0.06);
  --primary-navy:      #090e27;
  --primary-navy-light:#161e47;

  --accent:            #fe5d29;
  --accent-light:      #ff794d;
  --accent-soft:       rgba(254, 93, 41, 0.08);
  --primary-orange:    #fe5d29;
  --primary-orange-hover: #e04a17;

  /* Legacy Aliases */
  --primary-color:     #090e27;
  --secondary-color:   #fe5d29;
  --color-purple-700:  #090e27;
  --color-cyan-500:    #fe5d29;
  --color-cyan-400:    #ff794d;

  /* Sidebar (Light by default) */
  --sidebar-bg:        #FFFFFF;
  --sidebar-border:    #E2E8F0;
  --sidebar-width:     265px;
  --sidebar-collapsed: 72px;
  --nav-text:          #475569;
  --nav-text-hover:    #fe5d29;
  --nav-hover-bg:      rgba(254, 93, 41, 0.06);
  --nav-active-bg:     rgba(254, 93, 41, 0.10);
  --nav-active-text:   #fe5d29;
  --nav-active-border: #fe5d29;

  /* Content Canvas */
  --bg:                #F8FAFC;
  --bg-card:           #FFFFFF;
  --bg-hover:          #F1F5F9;
  --light-bg:          #F1F5F9;

  /* Typography */
  --text-primary:      #0F172A;
  --text-secondary:    #475569;
  --text-muted:        #94A3B8;
  --dark-text:         #0F172A;

  /* Status Colors */
  --success-color:     #10B981;
  --success-soft:      rgba(16, 185, 129, 0.1);
  --warning-color:     #F59E0B;
  --warning-soft:      rgba(245, 158, 11, 0.1);
  --danger-color:      #EF4444;
  --danger-soft:       rgba(239, 68, 68, 0.1);
  --info-color:        #3B82F6;
  --info-soft:         rgba(59, 130, 246, 0.1);

  /* Borders & Shadows */
  --border-color:      #E2E8F0;
  --border-radius:     12px;
  --border-radius-lg:  16px;
  --shadow-xs:         0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm:         0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md:         0 6px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg:         0 12px 36px rgba(0, 0, 0, 0.10);

  /* Transitions */
  --transition:        all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast:   all 0.15s ease;
}

/* ─── Dark Mode Tokens ──────────────────────────────────────── */
[data-bs-theme="dark"],
body.dark-mode {
  --bg:                #050814;
  --bg-card:           #090e27;
  --bg-hover:          #11183c;
  --light-bg:          #11183c;

  --sidebar-bg:        #070b1e;
  --sidebar-border:    rgba(255, 255, 255, 0.08);
  --nav-text:          #94A3B8;
  --nav-text-hover:    #ff794d;
  --nav-hover-bg:      rgba(254, 93, 41, 0.08);
  --nav-active-bg:     rgba(254, 93, 41, 0.14);
  --nav-active-text:   #fe5d29;
  --nav-active-border: #fe5d29;

  --text-primary:      #F8FAFC;
  --text-secondary:    #94A3B8;
  --text-muted:        #64748B;
  --dark-text:         #F8FAFC;

  --border-color:      rgba(255, 255, 255, 0.08);
  --shadow-sm:         0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md:         0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg:         0 12px 36px rgba(0, 0, 0, 0.55);
}

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

body, button, input, select, textarea, .form-control, .btn, .card, .table, h1, h2, h3, h4, h5, h6, p, label, .modal, .dropdown-menu {
  font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

body {
  background-color: var(--bg);
  color: var(--text-primary);
  margin: 0;
  overflow-x: hidden;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

/* ─── Main Layout Structure ──────────────────────────────────── */
.main-wrapper {
  display: flex;
  min-height: 100vh;
  direction: rtl;
  width: 100%;
}

.main-content {
  flex: 1;
  padding: 0;
  transition: margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  min-width: 0;
  margin-right: var(--sidebar-width);
  background-color: var(--bg);
  min-height: 100vh;
}

/* ─── Sleek Modern Sidebar ───────────────────────────────────── */
.sidebar {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  border-left: none;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.02);
}

/* Sidebar Header & Brand Logo */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  height: 76px;
  min-height: 76px;
}

.sidebar-header .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.sidebar-header .logo img {
  max-width: 160px;
  max-height: 42px;
  object-fit: contain;
  transition: var(--transition);
}

/* Edge Toggle Button */
.toggle-sidebar-btn-edge {
  position: absolute;
  top: 24px;
  left: -12px;
  width: 24px;
  height: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.toggle-sidebar-btn-edge:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.toggle-sidebar-btn-edge i {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.sidebar.collapsed .toggle-sidebar-btn-edge i {
  transform: rotate(180deg);
}

/* Mobile Close Button */
.mobile-close-sidebar {
  position: absolute;
  top: 16px;
  left: 14px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition-fast);
}

.mobile-close-sidebar:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

/* ─── Sidebar Navigation Links ───────────────────────────────── */
.sidebar nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.85rem 0.6rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.08) transparent;
}

.sidebar nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar nav::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.08);
  border-radius: 4px;
}

/* Category Label */
.menu-label,
.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 12px 14px 6px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

/* Nav Item Link */
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--nav-text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  white-space: nowrap;
  margin-bottom: 3px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: right;
}

.nav-link i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.nav-link span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link:hover {
  background-color: var(--nav-hover-bg);
  color: var(--nav-text-hover);
}

.nav-link:hover i {
  color: var(--accent);
}

/* ACTIVE NAV LINK - High Contrast & Gorgeous */
.nav-link.active {
  background: var(--nav-active-bg) !important;
  color: var(--nav-active-text) !important;
  font-weight: 700 !important;
  border-right: 3px solid var(--nav-active-border) !important;
}

.nav-link.active i {
  color: var(--nav-active-text) !important;
}

/* Locked Navigation Item */
.nav-locked {
  opacity: 0.55;
  cursor: pointer;
  position: relative;
}

.nav-locked.disabled {
  cursor: pointer;
}

.nav-locked:hover {
  background: rgba(255, 93, 44, 0.08) !important;
  color: var(--primary-orange, #ff5d2c) !important;
  opacity: 0.85;
}

.nav-locked:hover i {
  color: var(--primary-orange, #ff5d2c) !important;
}

.nav-lock-badge {
  margin-right: auto;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: rgba(255, 93, 44, 0.12) !important;
  color: #ff5d2c !important;
  border: 1px solid rgba(255, 93, 44, 0.35) !important;
  font-family: system-ui, -apple-system, sans-serif;
}

/* ─── Sidebar Footer & User Profile ──────────────────────────── */
.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg);
  flex-shrink: 0;
  position: relative;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  width: 100%;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.sidebar-user-card:hover,
.sidebar-user-card.menu-open {
  background: var(--primary-soft);
  border-color: rgba(108, 63, 197, 0.25);
}

.sidebar-user-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.sidebar-user-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(108, 63, 197, 0.3);
}

.sidebar-user-initial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(108, 63, 197, 0.25);
}

.sidebar-user-status-dot {
  position: absolute;
  bottom: 0px;
  left: 0px;
  width: 9px;
  height: 9px;
  background: var(--success-color);
  border-radius: 50%;
  border: 2px solid var(--sidebar-bg);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.sidebar-user-credits {
  font-size: 0.68rem;
  color: var(--primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  background: var(--primary-soft);
  padding: 1px 6px;
  border-radius: 5px;
}

.sidebar-user-arrow {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.sidebar-user-card.menu-open .sidebar-user-arrow i {
  transform: rotate(180deg);
}

/* Floating User Menu Popover */
.sidebar-user-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 10px;
  left: 10px;
  background: var(--bg-card);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  z-index: 9999;
  overflow: hidden;
  padding: 6px;
  animation: slideUpFade 0.2s ease;
}

.sidebar-user-menu.open {
  display: block;
}

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

.sidebar-user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition-fast);
  border-radius: 8px;
}

.sidebar-user-menu-item:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.sidebar-user-menu-item i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.sidebar-user-menu-item:hover i {
  color: var(--primary);
}

.sidebar-user-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 6px;
}

.sidebar-user-menu-logout {
  color: var(--danger-color);
}
.sidebar-user-menu-logout i {
  color: var(--danger-color);
}
.sidebar-user-menu-logout:hover {
  background: var(--danger-soft);
  color: var(--danger-color);
}
.sidebar-user-menu-logout:hover i {
  color: var(--danger-color);
}

/* ─── Collapsed Sidebar Mode ─────────────────────────────────── */
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  overflow: visible;
}

.sidebar.collapsed ~ .main-content {
  margin-right: var(--sidebar-collapsed);
}

.sidebar.collapsed .menu-label,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-lock-badge,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-user-arrow {
  display: none !important;
}

.sidebar.collapsed nav {
  padding: 0.75rem 0.35rem;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding: 10px 0;
  border-right: 3px solid transparent;
}

.sidebar.collapsed .nav-link i {
  font-size: 1.25rem;
}

.sidebar.collapsed .nav-link.active {
  border-right-color: var(--primary) !important;
}

.sidebar.collapsed .sidebar-footer {
  padding: 8px;
}

.sidebar.collapsed .sidebar-user-card {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  padding: 0;
  justify-content: center;
  border-radius: 10px;
}

.sidebar.collapsed .sidebar-user-menu {
  position: absolute;
  bottom: 0;
  right: calc(100% + 10px);
  left: auto;
  width: 210px;
}

/* ─── Logo Display Handlers ──────────────────────────────────── */
.logo-light           { display: block; }
.logo-dark            { display: none; }
.logo-expanded-light  { display: block; }
.logo-expanded-dark   { display: none; }
.logo-collapsed-light { display: none; }
.logo-collapsed-dark  { display: none; }

.sidebar.collapsed .logo-expanded-light  { display: none; }
.sidebar.collapsed .logo-collapsed-light { display: block; max-width: 38px; }

[data-bs-theme="dark"] .logo-light,
body.dark-mode .logo-light          { display: none !important; }
[data-bs-theme="dark"] .logo-dark,
body.dark-mode .logo-dark           { display: block !important; }

[data-bs-theme="dark"] .logo-expanded-light,
body.dark-mode .logo-expanded-light { display: none !important; }
[data-bs-theme="dark"] .logo-expanded-dark,
body.dark-mode .logo-expanded-dark  { display: block !important; }

[data-bs-theme="dark"] .sidebar.collapsed .logo-expanded-dark,
body.dark-mode .sidebar.collapsed .logo-expanded-dark { display: none !important; }
[data-bs-theme="dark"] .sidebar.collapsed .logo-collapsed-dark,
body.dark-mode .sidebar.collapsed .logo-collapsed-dark { display: block !important; max-width: 38px; }

/* ─── Mobile Header & Overlay ────────────────────────────────── */
.mobile-header {
  position: sticky;
  top: 0;
  z-index: 950;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.mobile-menu-toggle {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: var(--transition-fast);
}

.mobile-menu-toggle:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 999;
  backdrop-filter: blur(4px);
}

.mobile-sidebar-overlay.active {
  display: block;
}

/* ═════════════════════════════════════════════════════════════
   DASHBOARD OVERVIEW COMPONENTS (ahexpress Modern Clean Style)
   ═════════════════════════════════════════════════════════════ */

/* ─── Welcome Section ───────────────────────────────────────── */
.welcome-section {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.welcome-section h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.welcome-section h1 span {
  color: var(--primary);
}

.welcome-section p {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

.date-badge {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-xs);
}

/* ─── Quick Actions Grid (3 Horizontal Cards) ───────────────── */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.action-card {
  background-color: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(108, 63, 197, 0.25);
}

.action-card.primary-gradient {
  background: linear-gradient(135deg, #fe5d29, #e04a17) !important;
  color: #ffffff !important;
  border: none;
  box-shadow: 0 4px 16px rgba(254, 93, 41, 0.28);
}

.action-card.primary-gradient:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(254, 93, 41, 0.4);
}

.action-card.primary-gradient h3 {
  color: #ffffff !important;
}

.action-card.primary-gradient p {
  color: rgba(255, 255, 255, 0.88) !important;
}

.icon-wrapper {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 10px;
  background-color: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.action-card.primary-gradient .icon-wrapper {
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.action-card .icon-wrapper.accent {
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.1);
}

.action-card .icon-wrapper.navy {
  color: #022a5e;
  background-color: rgba(2, 42, 94, 0.08);
}

[data-bs-theme="dark"] .action-card .icon-wrapper.navy {
  color: var(--accent);
  background-color: rgba(255, 122, 9, 0.15);
}

.action-content {
  flex: 1;
}

.action-content h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.action-content p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ─── Modern Executive KPI Summary Grid ─────────────────────── */
.exec-summary-section {
  margin-bottom: 28px;
}

.exec-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.exec-section-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.exec-section-header h2 i {
  color: var(--accent);
}

.exec-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.exec-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseLiveDot 2s infinite;
}

@keyframes pulseLiveDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.exec-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.exec-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.exec-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(254, 93, 41, 0.3);
}

.exec-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.exec-kpi-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exec-kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.exec-kpi-card.kpi-impressions .exec-kpi-icon {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.exec-kpi-card.kpi-revenue .exec-kpi-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.exec-kpi-card.kpi-conversions .exec-kpi-icon {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.exec-kpi-card.kpi-reach .exec-kpi-icon {
  background: rgba(14, 165, 233, 0.12);
  color: #0ea5e9;
}

.exec-kpi-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0;
}

.exec-kpi-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.exec-kpi-pill.pill-warning { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.exec-kpi-pill.pill-success { background: rgba(16, 185, 129, 0.12); color: #059669; }
.exec-kpi-pill.pill-danger { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.exec-kpi-pill.pill-info { background: rgba(14, 165, 233, 0.12); color: #0284c7; }
.exec-kpi-pill.pill-primary { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }

.exec-kpi-value-wrap {
  margin-bottom: 10px;
}

.exec-kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.exec-kpi-unit {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.exec-kpi-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}

.exec-kpi-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.exec-kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.exec-kpi-btn-link {
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

.exec-kpi-btn-link:hover {
  color: var(--primary-orange-hover);
  text-decoration: underline;
}

/* ─── The 4 Pillars Marketing Reports Section ───────────────── */
.pillars-report-section {
  margin-bottom: 32px;
}

.pillars-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
}

.pillars-section-header .title-group h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pillars-section-header .title-group h2 i {
  color: var(--accent);
}

.pillars-section-header .title-group p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.pillar-card {
  background: var(--bg-card);
  border-radius: 18px;
  border: 1px solid var(--border-color);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.pillar-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: transparent;
  transition: var(--transition);
}

.pillar-card.pillar-popups:hover::before { background: #fe5d29; }
.pillar-card.pillar-upsell:hover::before { background: #10b981; }
.pillar-card.pillar-landing:hover::before { background: #6366f1; }
.pillar-card.pillar-search:hover::before { background: #8b5cf6; }

.pillar-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(2, 42, 94, 0.15);
}

.pillar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  gap: 10px;
  flex-wrap: wrap;
}

.pillar-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pillar-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pillar-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pillar-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}

.pillar-card.pillar-popups .pillar-icon { background: rgba(254, 93, 41, 0.1); color: #fe5d29; }
.pillar-card.pillar-upsell .pillar-icon { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.pillar-card.pillar-landing .pillar-icon { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.pillar-card.pillar-search .pillar-icon { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.pillar-title-wrap h3 {
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 2px 0;
  color: var(--text-primary);
}

.pillar-title-wrap p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.pillar-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.pillar-status-pill.status-active {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.pillar-status-pill.status-inactive {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
}

.pillar-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.pm-item {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
}

.pm-item:hover {
  background: var(--bg-hover);
}

.pm-item-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pm-item-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.pm-item-value span {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.pillar-progress-box {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pillar-pb-text {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.pillar-pb-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.pillar-pb-bar {
  width: 90px;
  height: 6px;
  background: var(--border-color);
  border-radius: 999px;
  overflow: hidden;
}

.pillar-pb-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.pillar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.pillar-btn-manage {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.pillar-btn-manage:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.pillar-btn-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent);
  border: 1px solid var(--accent);
  transition: var(--transition);
  white-space: nowrap;
}

.pillar-btn-create:hover {
  background: var(--primary-orange-hover);
  border-color: var(--primary-orange-hover);
  color: #ffffff;
}

[data-bs-theme="dark"] .pm-item,
body.dark-mode .pm-item,
[data-bs-theme="dark"] .pillar-progress-box,
body.dark-mode .pillar-progress-box {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .pillar-btn-manage,
body.dark-mode .pillar-btn-manage {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

[data-bs-theme="dark"] .pillar-btn-manage:hover,
body.dark-mode .pillar-btn-manage:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ─── Responsive Queries for Executive & Pillars Grid ───────── */
@media (max-width: 1200px) {
  .exec-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 991px) {
  .pillars-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .exec-kpi-grid {
    grid-template-columns: 1fr;
  }
  .pillar-metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .pm-item {
    padding: 10px;
  }
  .pm-item-value {
    font-size: 14px;
  }
  .pillar-footer {
    flex-direction: column;
  }
  .pillar-btn-manage, .pillar-btn-create {
    width: 100%;
  }
}

/* ─── Locked Feature Pillar Card & Overlay ──────────────────── */
.pillar-card.is-locked {
  position: relative;
  overflow: hidden;
  border-color: rgba(245, 158, 11, 0.25);
}

.pillar-card.is-locked:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}

.pillar-card.is-locked .pillar-header {
  position: relative;
  z-index: 2;
  filter: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.pillar-card.is-locked .pillar-card-content {
  filter: blur(1.5px);
  opacity: 0.35;
  pointer-events: none;
  user-select: none;
}

.pillar-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 20px 16px;
  text-align: center;
  border-radius: 12px;
}

[data-bs-theme="dark"] .pillar-lock-overlay,
body.dark-mode .pillar-lock-overlay {
  background: rgba(9, 14, 39, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lock-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.pillar-lock-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 6px 0;
}

.pillar-lock-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  line-height: 1.5;
  max-width: 270px;
}

.pillar-lock-desc strong {
  color: var(--text-primary);
  font-weight: 800;
}

.btn-pillar-upgrade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #fe5d29, #e04a17);
  color: #ffffff !important;
  border: none;
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(254, 93, 41, 0.35);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-pillar-upgrade:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(254, 93, 41, 0.5);
  color: #ffffff !important;
}

.pillar-status-pill.status-locked {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

/* ─── Summary Section & Stats Grid ──────────────────────────── */
.summary-section {
  background-color: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.last-update {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background-color: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--primary);
  background-color: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xs);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.stat-info {
  flex: 1;
}

.stat-info p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  font-weight: 600;
}

.stat-info h4 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.stat-info h4 span {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ─── Dashboard Impressions Limit Card ──────────────────────── */
.stat-card-impressions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 16px;
  background-color: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: pointer;
}

.stat-card-impressions:hover {
  border-color: #f59e0b;
  background-color: var(--bg-card);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
}

.stat-card-impressions-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-card-impressions .stat-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.stat-card-impressions .stat-progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.stat-card-impressions .stat-subtext {
  font-size: 0.74rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  font-weight: 600;
}

/* ─── Analytics Row (Chart & Top Sources) ───────────────────── */
.analytics-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.chart-card,
.top-cities-card,
.recent-shipments-section {
  background-color: var(--bg-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.date-filter {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg);
  color: var(--text-primary);
  outline: none;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
}

.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

/* ─── Sources Progress List ──────────────────────────────────── */
.cities-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.city-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.city-info {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-bg {
  width: 100%;
  height: 8px;
  background-color: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
}

.city-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 15px;
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  gap: 10px;
}

.city-empty i {
  font-size: 32px;
  opacity: 0.45;
  color: var(--text-muted);
}

/* ─── Recent Campaigns Custom Table ──────────────────────────── */
.recent-shipments-section {
  margin-top: 0;
}

.view-all {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition-fast);
}

.view-all:hover {
  text-decoration: underline;
}

.table-responsive {
  overflow-x: auto;
  width: 100%;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
  font-size: 14px;
  text-align: right;
}

.custom-table th {
  text-align: right;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid var(--border-color);
  background-color: var(--bg-card);
}

.custom-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background-color: var(--bg-hover);
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.status.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}

.status.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}

.status.badge-primary {
  background-color: rgba(2, 42, 94, 0.08);
  color: #022a5e;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}

.table-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
  transition: var(--transition-fast);
}

.table-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.campaign-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.campaign-type-pill i {
  color: var(--accent);
}


/* ═════════════════════════════════════════════════════════════
   GLOBAL DASHBOARD UI COMPONENTS (Used across inner pages)
   ═════════════════════════════════════════════════════════════ */

/* ─── Cards ─────────────────────────────────────────────────── */
.card,
.stat-card,
.content-card,
.dashboard-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: var(--transition);
}

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

/* ─── Buttons ────────────────────────────────────────────────── */
.btn-primary-custom,
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff !important;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1.25rem;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 4px 12px rgba(108, 63, 197, 0.2);
}

.btn-primary-custom:hover,
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(108, 63, 197, 0.3);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff !important;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1.25rem;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.3);
}

.btn-secondary,
.btn-outline-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.55rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* ─── Page Header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ─── Form Controls ──────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}

.form-control,
.form-select {
  width: 100%;
  padding: 0.7rem 0.95rem;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: 'Cairo', sans-serif;
  background-color: var(--bg-card);
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 63, 197, 0.12);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* ─── Tabs ───────────────────────────────────────────────────── */
.tabs-nav {
  display: flex;
  overflow-x: auto;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
  gap: 0.25rem;
  scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 0.7rem 1.1rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  font-family: 'Cairo', sans-serif;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ═════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN (Desktop, Tablet, Mobile)
   ═════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .db-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .db-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .sidebar {
    right: -100%;
    width: var(--sidebar-width) !important;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
  }

  .sidebar.mobile-open {
    right: 0;
  }

  .main-content {
    margin-right: 0 !important;
    padding: 1.25rem 1rem;
  }

  .toggle-sidebar-btn-edge {
    display: none !important;
  }

  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
  }

  .welcome-banner-actions {
    width: 100%;
    justify-content: space-between;
  }

  .d-lg-none { display: block !important; }
  .d-lg-flex { display: none !important; }
}

@media (min-width: 993px) {
  .d-lg-none { display: none !important; }
  .d-lg-flex { display: flex !important; }
  .mobile-header { display: none !important; }
}

@media (max-width: 576px) {
  .db-kpi-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .welcome-title {
    font-size: 1.3rem;
  }
  .maestro-quick-tools {
    grid-template-columns: 1fr;
  }
  .main-content {
    padding: 1rem 0.75rem;
  }
}

/* ═════════════════════════════════════════════════════════════
   AHEXPRESS-STYLE DASHBOARD OVERVIEW ARCHITECTURE
   Tailored for Popups, Landing Pages & Traffic Analytics
   ═════════════════════════════════════════════════════════════ */
:root {
  --primary-navy: #090e27;
  --primary-navy-light: #161e47;
  --primary-orange: #ff5d2c;
  --primary-orange-hover: #e54a1a;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --border-color-light: #f1f5f9;
}

[data-bs-theme="dark"],
body.dark-mode {
  --primary-navy: #090e27;
  --primary-navy-light: #161e47;
  --primary-orange: #ff5d2c;
  --bg-surface: #090e27;
  --bg-surface-hover: #11183c;
  --border-color-light: rgba(255, 255, 255, 0.05);
}

.content-wrapper {
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 32px 48px;
}

/* ─── Dashboard Top Header (Sticky) ──────────────────────────── */
.dashboard-top-header {
  height: 76px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 10px rgba(9, 14, 39, 0.04);
}

.dashboard-top-header .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: var(--bg);
  border-radius: 10px;
  padding: 8px 16px;
  width: 320px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary-navy);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(2, 42, 94, 0.1);
}

[data-bs-theme="dark"] .search-bar:focus-within {
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(255, 122, 9, 0.2);
}

.search-bar i {
  color: var(--text-muted);
  margin-left: 10px;
  font-size: 14px;
}

.search-bar input {
  border: none;
  background: none;
  outline: none;
  width: 100%;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Cairo', sans-serif;
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-navy {
  background: var(--primary-navy);
  color: #ffffff !important;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-navy:hover {
  background: var(--primary-navy-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 42, 94, 0.25);
  color: #ffffff;
}

.btn-secondary-custom {
  background: var(--card-bg);
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color);
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: var(--transition);
}

.btn-secondary-custom:hover {
  background: var(--bg-hover);
  color: var(--primary-orange) !important;
  border-color: var(--primary-orange);
  transform: translateY(-1px);
}

.btn-orange {
  background: #fe5d29;
  color: #ffffff !important;
  border: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 3px 12px rgba(254, 93, 41, 0.28);
}

.btn-orange:hover {
  background: #e04a17;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(254, 93, 41, 0.4);
}

.header-icon-btn {
  background: none;
  border: 1px solid var(--border-color);
  font-size: 16px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
}

.header-icon-btn:hover {
  background-color: var(--bg-hover);
  color: var(--primary-orange);
}

.header-icon-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ef4444;
}

.user-menu-wrapper {
  position: relative;
}

.user-avatar-pill {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  overflow: hidden;
}

.user-avatar-pill:hover,
.user-avatar-pill.active {
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(254, 93, 41, 0.2);
}

.top-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 235px;
  background: var(--bg-card);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  z-index: 1050;
  padding: 8px;
  animation: slideDownFade 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-user-dropdown.open {
  display: block;
}

.top-user-dropdown-header {
  padding: 8px 12px 6px;
}

.top-user-dropdown-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.top-user-dropdown-credits {
  font-size: 0.72rem;
  color: var(--primary-orange);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

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

/* ─── Top User Dropdown Language Selector (Unified for RTL & LTR) ─── */
.top-user-dropdown-lang-section {
  padding: 8px 10px 6px;
  margin: 4px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.top-user-dropdown-lang-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-user-dropdown-lang-title i {
  color: var(--primary-orange, #fe5d29);
  font-size: 0.8rem;
}

.top-user-dropdown-lang-buttons {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  background: var(--bg-hover, #f1f5f9) !important;
  padding: 3px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  gap: 4px !important;
}

.lang-switch-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  padding: 6px 8px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  border-radius: 7px !important;
  text-decoration: none !important;
  color: var(--text-secondary, #64748b) !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  cursor: pointer !important;
  border: 1px solid transparent !important;
  white-space: nowrap !important;
}

.lang-switch-btn:hover {
  color: var(--text-primary, #0f172a) !important;
  background: rgba(255, 255, 255, 0.7) !important;
}

.lang-switch-btn.active {
  background: var(--bg-card, #ffffff) !important;
  color: var(--primary-orange, #fe5d29) !important;
  border-color: rgba(254, 93, 41, 0.3) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
}

.lang-switch-btn.active i {
  font-size: 0.68rem;
  color: var(--primary-orange, #fe5d29);
}

[data-bs-theme="dark"] .top-user-dropdown-lang-buttons,
body.dark-mode .top-user-dropdown-lang-buttons {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-bs-theme="dark"] .lang-switch-btn:hover,
body.dark-mode .lang-switch-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

[data-bs-theme="dark"] .lang-switch-btn.active,
body.dark-mode .lang-switch-btn.active {
  background: var(--primary-light, #161e47) !important;
  color: var(--primary-orange, #fe5d29) !important;
  border-color: rgba(254, 93, 41, 0.4) !important;
}

/* ─── Welcome Section ────────────────────────────────────────── */
.welcome-section {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.welcome-section h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.welcome-section h1 span {
  color: var(--primary-navy);
}

[data-bs-theme="dark"] .welcome-section h1 span {
  color: var(--primary-orange);
}

.welcome-section p {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

.date-badge {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-xs);
}

/* ─── Quick Actions Grid ─────────────────────────────────────── */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.action-card {
  background-color: var(--bg-surface);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.action-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-color);
}

.action-card.primary-gradient {
  background: linear-gradient(135deg, #022a5e 0%, #084085 100%);
  color: #ffffff;
  border: none;
}

.action-card.primary-gradient h3 {
  color: #ffffff;
}

.action-card.primary-gradient p {
  color: rgba(255, 255, 255, 0.75);
}

.icon-wrapper {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 12px;
  background-color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.action-card.primary-gradient .icon-wrapper {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.action-card .icon-wrapper.accent {
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.1);
}

.action-card .icon-wrapper.navy {
  color: var(--primary-navy);
  background-color: rgba(2, 42, 94, 0.08);
}

[data-bs-theme="dark"] .action-card .icon-wrapper.navy {
  color: var(--primary-orange);
  background-color: rgba(255, 122, 9, 0.15);
}

.action-content h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.action-content p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ─── Summary Section ────────────────────────────────────────── */
.summary-section {
  background-color: var(--bg-surface);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 28px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.last-update {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background-color: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--primary-navy);
  background-color: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

[data-bs-theme="dark"] .stat-card:hover {
  border-color: var(--primary-orange);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-info p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 2px;
  font-weight: 600;
}

.stat-info h4 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.stat-info h4 span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ─── Analytics Row ──────────────────────────────────────────── */
.analytics-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.chart-card, .top-cities-card, .recent-shipments-section {
  background-color: var(--bg-surface);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.card-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.date-filter {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg);
  color: var(--text-primary);
  outline: none;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
}

.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

/* Sources / Cities List */
.cities-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.city-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.city-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-bg {
  width: 100%;
  height: 8px;
  background-color: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* ─── Recent Campaigns Section ───────────────────────────────── */
.recent-shipments-section {
  margin-top: 0;
}

.view-all {
  color: var(--primary-orange);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
}

.view-all:hover {
  color: var(--primary-orange-hover);
  text-decoration: underline;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 650px;
}

.custom-table th {
  text-align: right;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid var(--border-color-light);
}

.custom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color-light);
  font-size: 13.5px;
  color: var(--text-primary);
  vertical-align: middle;
}

.custom-table tbody tr:hover {
  background-color: var(--bg-hover);
}

/* Badges */
.status {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.badge-primary { background: rgba(2, 42, 94, 0.1); color: var(--primary-navy); }
[data-bs-theme="dark"] .badge-primary { background: rgba(255, 122, 9, 0.15); color: var(--primary-orange); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

@media (max-width: 992px) {
  .analytics-row {
    grid-template-columns: 1fr;
  }
  .dashboard-top-header {
    display: none;
  }
}

@media (max-width: 768px) {
  .quick-actions-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .welcome-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Unified Grid & Utility Classes ────────────────────────── */
.grid-2col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.grid-half {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 992px) {
  .grid-2col,
  .grid-half,
  .grid-3col {
    grid-template-columns: 1fr;
  }
}

.custom-progress-bg {
  background: var(--bg-hover, #f1f5f9);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
}

.custom-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.date-filter-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select,
.filter-input {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--primary-orange);
}

.date-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.keyword-pill {
  background: rgba(9, 14, 39, 0.04);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
[data-bs-theme="dark"] .keyword-pill {
  background: rgba(255, 255, 255, 0.05);
}

.badge-count {
  background: var(--primary-orange);
  color: #fff;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

/* ─── Global / Carts Modal System ────────────────────────────── */
.fin-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(9, 14, 39, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.fin-modal-backdrop.open {
  display: flex !important;
}

.fin-modal {
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  animation: modalFadeIn 0.2s ease-out;
}

.fin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.fin-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.fin-modal-close {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.fin-modal-close:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.fin-modal-body {
  font-size: 14px;
  color: var(--text-primary);
}

.fin-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.fin-btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  transition: var(--transition);
  text-decoration: none;
}

.fin-btn-outline {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.fin-btn-outline:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.fin-btn-primary {
  background: #fe5d29;
  border: none;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(254, 93, 41, 0.25);
}

.fin-btn-primary:hover {
  background: #e04a17;
  color: #fff !important;
}

.fin-btn-success {
  background: #10b981;
  border: none;
  color: #fff !important;
}

.fin-btn-success:hover {
  background: #059669;
  color: #fff !important;
}

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

/* ═════════════════════════════════════════════════════════════
   AUTHENTICATION PAGES (Login, Register, Password Recovery)
   ═════════════════════════════════════════════════════════════ */
.auth-main-wrapper {
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.auth-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background-color: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Floating theme switch on auth screen */
.auth-top-actions {
  position: absolute;
  top: 24px;
  inset-inline-start: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 50;
}

.auth-top-actions .auth-theme-toggle,
.auth-top-actions a.auth-theme-toggle,
.auth-top-actions button.auth-theme-toggle {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  margin: 0 !important;
  flex-shrink: 0;
}

.auth-theme-toggle {
  position: absolute;
  top: 24px;
  inset-inline-start: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-fast);
  z-index: 10;
}

.auth-theme-toggle:hover {
  color: var(--primary-orange);
  border-color: var(--primary-orange);
  transform: scale(1.05);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 16px 40px rgba(9, 14, 39, 0.07);
  padding: 36px 32px;
  position: relative;
  z-index: 2;
  margin: auto;
  transition: var(--transition);
}

[data-bs-theme="dark"] .auth-card,
body.dark-mode .auth-card {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  background: var(--bg-card);
}

.auth-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.auth-logo img {
  max-height: 48px;
  max-width: 180px;
  object-fit: contain;
  transition: var(--transition-fast);
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
  margin: 0 0 6px 0;
}

.auth-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  text-align: center;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.auth-card .alert {
  border-radius: 12px;
  font-size: 13.5px;
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  line-height: 1.5;
}

.auth-card .alert i {
  font-size: 16px;
  flex-shrink: 0;
}

.auth-card .alert-info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
}

[data-bs-theme="dark"] .auth-card .alert-info,
body.dark-mode .auth-card .alert-info {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

.auth-card .alert-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: #047857;
}

[data-bs-theme="dark"] .auth-card .alert-success,
body.dark-mode .auth-card .alert-success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.auth-card .alert-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

[data-bs-theme="dark"] .auth-card .alert-danger,
body.dark-mode .auth-card .alert-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form .form-group {
  margin-bottom: 0;
}

.auth-form .form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-icon input.form-control {
  width: 100%;
  height: 48px;
  padding: 10px 42px 10px 42px;
  border-radius: 12px;
  border: 1.5px solid var(--border-color);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Cairo', sans-serif;
  transition: var(--transition-fast);
}

.input-with-icon input.form-control:focus {
  border-color: var(--primary-orange);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(254, 93, 41, 0.15);
  outline: none;
}

.input-with-icon input.form-control:disabled {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-muted);
  cursor: not-allowed;
  border-style: dashed;
}

[data-bs-theme="dark"] .input-with-icon input.form-control:disabled,
body.dark-mode .input-with-icon input.form-control:disabled {
  background: rgba(255, 255, 255, 0.04);
}

.input-with-icon > i:not(.toggle-password-icon):not(#toggleIcon),
.input-with-icon .input-icon {
  position: absolute;
  right: 14px;
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
  z-index: 2;
}

.input-with-icon .toggle-password-icon,
.input-with-icon > i#toggleIcon {
  position: absolute;
  left: 14px;
  right: auto;
  color: var(--text-muted);
  font-size: 17px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
  z-index: 3;
}

.input-with-icon .toggle-password-icon:hover,
.input-with-icon > i#toggleIcon:hover {
  color: var(--primary-orange);
}

/* Steps Progress System */
.steps-container {
  width: 100%;
  margin: 0 0 20px 0;
}

.steps-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 50px;
}

.steps-progress::before {
  content: '';
  position: absolute;
  top: 19px;
  left: calc(50% - 60px);
  right: calc(50% - 60px);
  height: 2px;
  background: var(--border-color);
  z-index: 1;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 2;
  text-decoration: none;
}

.step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.step-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.step-item.active .step-circle {
  background: var(--primary-orange);
  border-color: var(--primary-orange);
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(254, 93, 41, 0.2);
}

.step-item.active .step-label {
  color: var(--primary-orange);
  font-weight: 700;
}

.step-item.completed .step-circle {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
}

.step-item.completed .step-label {
  color: #10b981;
  font-weight: 700;
}

/* Data Review */
.data-review {
  background: var(--bg);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  width: 100%;
}

.data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.data-item:last-child {
  border-bottom: none;
}

.data-label {
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-label i {
  color: var(--primary-orange);
  font-size: 15px;
}

.data-value {
  color: var(--text-primary);
  font-weight: 700;
  text-align: left;
  font-size: 13.5px;
}

.auth-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin: 4px 0;
}

.auth-forgot-link {
  color: var(--primary-orange);
  font-weight: 700;
  text-decoration: none;
  font-size: 12.5px;
  transition: opacity 0.2s;
}

.auth-forgot-link:hover {
  opacity: 0.85;
  text-decoration: underline;
}

.auth-btn {
  background: linear-gradient(135deg, #fe5d29, #e04a17);
  color: #ffffff !important;
  border: none;
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(254, 93, 41, 0.28);
  transition: var(--transition);
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(254, 93, 41, 0.38);
}

.auth-btn-secondary {
  background: transparent;
  color: var(--text-secondary) !important;
  border: 1.5px solid var(--border-color);
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  text-decoration: none;
}

.auth-btn-secondary:hover {
  background: var(--bg);
  border-color: var(--text-muted);
  color: var(--text-primary) !important;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0 14px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
  padding: 0 12px;
}

.auth-oauth-btn {
  width: 100%;
  height: 46px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13.5px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  font-family: 'Cairo', sans-serif;
  transition: var(--transition);
  cursor: pointer;
}

.auth-salla-btn {
  background: #004956;
  color: #ffffff !important;
  border-color: #004956;
}

.auth-salla-btn:hover {
  background: #003640;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 73, 86, 0.25);
}

.auth-zid-btn {
  background: #5b21b6;
  color: #ffffff !important;
  border-color: #5b21b6;
}

.auth-zid-btn:hover {
  background: #4c1d95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 33, 182, 0.25);
}

.auth-woo-btn {
  background: #7f54b3;
  color: #ffffff !important;
  border-color: #7f54b3;
}

.auth-woo-btn:hover {
  background: #6c3da6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(127, 84, 179, 0.3);
}

.auth-oauth-btn img {
  height: 20px;
  object-fit: contain;
}

.auth-footer-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 24px;
  line-height: 1.5;
}

.auth-footer-text a {
  color: var(--primary-orange);
  font-weight: 700;
  text-decoration: none;
}

.auth-footer-text a:hover {
  text-decoration: underline;
}

@media (max-width: 576px) {
  .auth-card {
    padding: 24px 16px;
    border-radius: 16px;
    margin: 10px auto;
    max-width: 100%;
  }
  .auth-wrapper {
    padding: 20px 12px;
  }
  .steps-progress {
    gap: 30px;
  }
  .steps-progress::before {
    left: calc(50% - 40px);
    right: calc(50% - 40px);
  }
  .data-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .data-value {
    text-align: right;
    padding-right: 23px;
  }
}

/* ==========================================================================
   Popup Templates & Editor Components (Unified Platform Design)
   ========================================================================== */
.type-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.type-tab {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-dashboard);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
}

.type-tab:hover {
  color: var(--primary-orange);
  border-color: var(--primary-orange);
}

.type-tab.active {
  background: var(--primary-orange);
  color: #ffffff;
  border-color: var(--primary-orange);
  box-shadow: 0 3px 10px rgba(254, 93, 41, 0.3);
}

.tmpl-card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid var(--border-color);
}

.tmpl-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-orange);
}

.tmpl-card.selected {
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 4px rgba(254, 93, 41, 0.25);
}

.tmpl-prev {
  height: 115px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.tmpl-info {
  padding: 14px;
}

.tmpl-title {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.tmpl-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tmpl-badge {
  background: rgba(254, 93, 41, 0.1);
  color: var(--primary-orange);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 700;
}

/* Selected Bar */
.popup-selected-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 999;
  box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
}

/* Editor Components */
.sw-editor {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.sw-panel {
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.sw-panel-section {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sw-panel-section:last-child {
  border-bottom: none;
}

.sw-panel-title {
  font-weight: 800;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-panel-title i {
  color: var(--primary-orange);
}

.sw-field {
  margin-bottom: 1rem;
}

.sw-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.sw-preview-wrap {
  position: sticky;
  top: 90px;
  background: var(--bg-dashboard);
  border-radius: 16px;
  border: 2px dashed var(--border-color);
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sw-preview-inner {
  width: 100%;
  padding: 24px;
}

.sw-tab {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--bg-dashboard);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 1.25rem;
}

.sw-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: var(--transition);
}

.sw-tab-btn.active {
  background: var(--primary-orange);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(254, 93, 41, 0.28);
}

.sw-tab-btn:hover:not(.active) {
  color: var(--primary-orange);
}

@media (max-width: 991px) {
  .sw-editor {
    grid-template-columns: 1fr;
  }
  .popup-selected-bar {
    padding: 14px 20px;
  }
}


