/* ==========================================================================
   RG Platform — Master Design System & Stylesheet
   Matches Reference UI (Desktop & Mobile)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Color Palette - Deep Midnight Navy & Rich Accents */
  --bg-darkest: #07090E;
  --bg-main: #0B0E17;
  --bg-sidebar: #0D111D;
  --bg-header: rgba(13, 17, 29, 0.85);
  --bg-card: #131826;
  --bg-card-elevated: #161D2E;
  --bg-card-hover: #1A2236;
  --bg-input: #0D1220;
  
  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  /* Accent Colors */
  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-light: rgba(99, 102, 241, 0.12);
  --primary-gradient: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  --primary-glow: 0 8px 24px -4px rgba(99, 102, 241, 0.35);
  
  --purple: #8B5CF6;
  --purple-gradient: linear-gradient(135deg, #7C3AED 0%, #9333EA 100%);
  
  --green: #10B981;
  --green-light: rgba(16, 185, 129, 0.12);
  --green-glow: 0 4px 12px rgba(16, 185, 129, 0.2);
  
  --blue: #3B82F6;
  --blue-light: rgba(59, 130, 246, 0.12);
  
  --orange: #F59E0B;
  --orange-light: rgba(245, 158, 11, 0.12);
  
  --pink: #EC4899;
  --pink-light: rgba(236, 72, 153, 0.12);
  
  --red: #EF4444;
  --red-light: rgba(239, 68, 68, 0.12);
  
  /* Typography */
  --text-white: #FFFFFF;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-dark: #334155;
  
  /* Layout Sizing */
  --sidebar-width: 260px;
  --header-height: 70px;
  --mobile-nav-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

img, svg {
  display: block;
  max-width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-darkest);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   Layout Architecture
   ========================================================================== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-main);
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-white);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--primary-glow);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
}

.sidebar-menu {
  flex: 1;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.menu-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.menu-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0.5rem 0.85rem;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.93rem;
  transition: var(--transition);
}

.menu-item svg {
  width: 18px;
  height: 18px;
  opacity: 0.85;
  flex-shrink: 0;
}

.menu-item:hover {
  color: var(--text-white);
  background-color: rgba(255, 255, 255, 0.04);
}

.menu-item.active {
  background: var(--primary-gradient);
  color: var(--text-white);
  font-weight: 600;
  box-shadow: var(--primary-glow);
}

.menu-item.active svg {
  opacity: 1;
}

/* Sidebar Level Card */
.sidebar-level-card {
  margin: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
}

.level-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.level-badge-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  color: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
}

.level-badge-icon svg {
  width: 16px;
  height: 16px;
}

.level-title {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.level-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--orange);
}

.level-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.level-progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
}

.level-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Sidebar Invite Promo */
.sidebar-invite-card {
  margin: 0.75rem 1rem 1.25rem;
  padding: 1.1rem;
  background: linear-gradient(145deg, #1A1C38 0%, #15182D 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.sidebar-invite-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 0.35rem;
}

.sidebar-invite-card p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 0.85rem;
}

.btn-invite-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--primary-gradient);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.sidebar-invite-illustration {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 58px;
  height: 58px;
  opacity: 0.85;
}

/* Main Area */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Header */
.app-header {
  height: var(--header-height);
  background-color: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
}

.btn-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-md);
}

.header-search {
  position: relative;
  width: 320px;
}

.header-search input {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  color: var(--text-white);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition);
}

.header-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.header-search svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-action-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}

.header-action-btn:hover {
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.15);
}

.header-action-btn svg {
  width: 18px;
  height: 18px;
}

.badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background-color: var(--red);
  border-radius: var(--radius-full);
  box-shadow: 0 0 0 2px var(--bg-header);
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.65rem 0.35rem 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.user-profile-btn:hover {
  border-color: var(--border-focus);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--bg-card-elevated);
}

.user-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-white);
}

.user-role-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--orange);
}

/* Main Content Body */
.app-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   Hero Section (Reference Design)
   ========================================================================== */
.dashboard-hero {
  background: linear-gradient(135deg, #15183A 0%, #1A1D4E 40%, #0F1426 100%);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-xl);
  padding: 2.75rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

.hero-glow-blob {
  position: absolute;
  top: -40%;
  right: 15%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.1) 40%, transparent 70%);
  border-radius: var(--radius-full);
  pointer-events: none;
}

.hero-content {
  max-width: 540px;
  z-index: 2;
}

.hero-greeting {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-white);
  margin-bottom: 0.75rem;
  line-height: 1.15;
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-md);
  box-shadow: var(--primary-glow);
  transition: var(--transition);
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.5);
}

.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-white);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.hero-artwork {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-3d-visual {
  width: 320px;
  height: 220px;
  position: relative;
}

/* 3D Monitor Illustration in CSS/SVG */
.screen-stand {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 24px;
  background: linear-gradient(180deg, #4F46E5 0%, #312E81 100%);
  border-radius: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.screen-body {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 145px;
  background: linear-gradient(135deg, #7C3AED 0%, #4338CA 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 36px rgba(79, 70, 229, 0.45);
}

.screen-play-icon {
  width: 54px;
  height: 54px;
  background: #fff;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6366F1;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.floating-coin-stack {
  position: absolute;
  right: 15px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
}

.coin-gold {
  width: 48px;
  height: 48px;
  background: radial-gradient(circle at 30% 30%, #FDE68A 0%, #F59E0B 70%, #B45309 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #78350F;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.45);
  border: 2px solid #FEF3C7;
}

.floating-gem {
  position: absolute;
  top: 25px;
  left: 20px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  transform: rotate(45deg);
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.4);
}

/* ==========================================================================
   KPI Statistics Row (4 Cards)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg-card-hover);
}

.stat-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrapper svg {
  width: 24px;
  height: 24px;
}

.stat-icon-green {
  background: var(--green-light);
  color: var(--green);
}
.stat-icon-blue {
  background: var(--blue-light);
  color: var(--blue);
}
.stat-icon-purple {
  background: var(--primary-light);
  color: var(--primary);
}
.stat-icon-orange {
  background: var(--orange-light);
  color: var(--orange);
}

.stat-meta {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.2rem;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.01em;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.74rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.stat-trend.positive {
  color: var(--green);
}

/* ==========================================================================
   Content Grid Panels (3 Columns)
   ========================================================================== */
.panels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.panel-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
}

.panel-view-all {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

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

/* Watch Ads List */
.ads-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.ad-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.ad-item-row:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 102, 241, 0.25);
}

.ad-brand-col {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ad-logo-box {
  width: 40px;
  height: 40px;
  background: #FFFFFF;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #111;
  font-size: 0.85rem;
  overflow: hidden;
}

.ad-meta-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-white);
  line-height: 1.2;
}

.ad-meta-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.ad-action-col {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.badge-reward-pill {
  background: var(--green-light);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.btn-play-round {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-gradient);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
  transition: var(--transition);
}

.btn-play-round:hover {
  transform: scale(1.08);
}

.btn-play-round svg {
  width: 14px;
  height: 14px;
}

/* Referrals Panel */
.referral-box {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.referral-input-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.referral-input-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.referral-input-group {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.75rem;
  gap: 0.5rem;
}

.referral-input-group input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
}

.btn-copy-ref {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.btn-copy-ref:hover {
  color: var(--text-white);
}

.referral-note {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.referral-metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.ref-metric-item {
  display: flex;
  flex-direction: column;
}

.ref-metric-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.ref-metric-number {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-white);
}

.btn-invite-friends {
  width: 100%;
  padding: 0.75rem;
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: var(--primary-glow);
  transition: var(--transition);
}

.btn-invite-friends:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.45);
}

/* User Plans Panel */
.plan-summary-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.plan-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plan-badge-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.plan-crown-icon {
  color: var(--orange);
}

.plan-active-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-white);
}

.badge-active-pill {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.plan-price-large {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-white);
}

.plan-price-period {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.plan-renew-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.plan-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.plan-features-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.plan-features-list li svg {
  width: 16px;
  height: 16px;
  color: var(--green);
  flex-shrink: 0;
}

.btn-manage-plan {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-white);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn-manage-plan:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Ecommerce Store Panel */
.store-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.store-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.store-item-row:hover {
  background: var(--bg-card-hover);
}

.store-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.store-item-thumb {
  width: 44px;
  height: 44px;
  background: #0E1322;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.store-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.store-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-white);
  line-height: 1.2;
}

.store-item-price {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.btn-cart-mini {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cart-mini:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Featured Courses Panel */
.courses-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.course-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.course-item-row:hover {
  background: var(--bg-card-hover);
}

.course-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.course-item-thumb {
  width: 44px;
  height: 44px;
  background: #0E1322;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.course-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-white);
  line-height: 1.2;
}

.course-rating-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--orange);
  font-weight: 600;
}

.course-rating-row span {
  color: var(--text-muted);
  font-weight: 400;
}

.course-price-tag {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-white);
}

/* Transactions Panel */
.txns-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.txn-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.txn-item-row:hover {
  background: var(--bg-card-hover);
}

.txn-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.txn-icon-square {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.txn-icon-square svg {
  width: 18px;
  height: 18px;
}

.txn-icon-ad {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
}
.txn-icon-ref {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
}
.txn-icon-plan {
  background: rgba(245, 158, 11, 0.12);
  color: var(--orange);
}
.txn-icon-withdraw {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}
.txn-icon-deposit {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
}

.txn-desc {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-white);
  line-height: 1.2;
}

.txn-date {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.txn-amount {
  font-size: 0.88rem;
  font-weight: 700;
}

.txn-amount.credit {
  color: var(--green);
}
.txn-amount.debit {
  color: var(--red);
}

/* ==========================================================================
   Quick Access Grid (Row of 4 Action Cards)
   ========================================================================== */
.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.quick-action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.quick-action-card:hover {
  transform: translateY(-2px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-action-icon svg {
  width: 22px;
  height: 22px;
}

.qa-deposit { background: var(--green-light); color: var(--green); }
.qa-withdraw { background: var(--orange-light); color: var(--orange); }
.qa-courses { background: var(--primary-light); color: var(--primary); }
.qa-shop { background: var(--pink-light); color: var(--pink); }

.quick-action-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.2;
}

.quick-action-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Public & Dashboard Footer
   ========================================================================== */
.app-footer {
  margin-top: 2rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border-subtle);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-white);
}

.footer-tagline {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 320px;
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.social-link-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.social-link-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.social-link-btn svg {
  width: 16px;
  height: 16px;
}

.footer-col-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 1rem;
}

.footer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-nav-list a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-nav-list a:hover {
  color: var(--text-white);
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.newsletter-form input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-white);
  font-size: 0.85rem;
  outline: none;
}

.newsletter-form button {
  background: var(--primary-gradient);
  border: none;
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: var(--primary-glow);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Mobile Bottom Navigation
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-nav-height);
  background: rgba(13, 17, 29, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  z-index: 100;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.5rem;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  transition: var(--transition);
}

.bottom-nav-item svg {
  width: 20px;
  height: 20px;
}

.bottom-nav-item.active {
  color: var(--primary);
  font-weight: 700;
}

/* ==========================================================================
   Forms, Buttons, Modals, Badges & Tables
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-white);
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.45);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--text-white);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: var(--green);
  color: #fff;
  box-shadow: var(--green-glow);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

/* Alert Boxes */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #F87171;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: var(--bg-card-elevated);
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-card);
}

.data-table td {
  padding: 1rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-white);
}

/* Toast Container */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-card);
  color: var(--text-white);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1200px) {
  .panels-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .quick-access-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 0px;
  }
  
  .app-sidebar {
    transform: translateX(-100%);
    width: 280px;
  }
  
  .app-sidebar.open {
    transform: translateX(0);
  }
  
  .app-main {
    margin-left: 0;
  }
  
  .btn-menu-toggle {
    display: block;
  }
  
  .header-search {
    display: none;
  }
  
  .dashboard-hero {
    flex-direction: column;
    padding: 2rem 1.5rem;
    text-align: center;
    gap: 2rem;
  }
  
  .hero-content {
    max-width: 100%;
  }
  
  .hero-actions {
    justify-content: center;
  }
  
  .panels-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-top {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .mobile-bottom-nav {
    display: flex;
  }
  
  .app-content {
    padding: 1.25rem;
    padding-bottom: calc(var(--mobile-nav-height) + 1.5rem);
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .quick-access-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 1.85rem;
  }
}

/* ─── Universal Screen Optimization (Mobile & Tablet) ─── */
@media (max-width: 860px) {
  .responsive-grid-2,
  .responsive-grid-3,
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .plans-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {
  /* Prevent auto-zoom on mobile inputs */
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* Full screen modal responsiveness */
  #surveyModal > div {
    width: 95% !important;
    max-height: 94vh !important;
    margin: 0 auto !important;
    border-radius: 12px !important;
  }

  /* Table mobile scrolling */
  .table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 1rem !important;
  }

  .data-table th,
  .data-table td {
    white-space: nowrap;
    padding: 0.75rem 0.65rem !important;
    font-size: 0.82rem !important;
  }

  /* Mobile Content Spacing & Navigation Clearance */
  .app-content {
    padding: 1rem 0.75rem !important;
    padding-bottom: calc(var(--mobile-nav-height, 65px) + 2rem) !important;
  }

  .panel-card {
    padding: 1.25rem 1rem !important;
    border-radius: 12px !important;
  }

  .header-left, .header-right {
    gap: 0.5rem !important;
  }

  .user-info {
    display: none !important;
  }
}

/* ==========================================================================
   Interactive Component Styles (Phase 9 — JavaScript-Driven)
   ========================================================================== */

/* ─── Page Transition ───────────────────────────────────────────── */
body {
  opacity: 0;
  transition: opacity 0.3s ease;
}
body.page-loaded {
  opacity: 1;
}

/* ─── Search Results Dropdown ───────────────────────────────────── */
.header-search {
  position: relative;
}
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 340px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  padding: 6px;
}
.search-results-dropdown.active {
  display: block;
  animation: slideDown 0.2s ease;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
}
.search-result-item:hover {
  background: var(--bg-card-hover);
}
.search-result-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.search-result-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.search-result-type {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: capitalize;
}
.search-no-results {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ─── Ad Watcher Overlay ────────────────────────────────────────── */
#ad-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(7, 9, 14, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#ad-overlay.active {
  opacity: 1;
  pointer-events: all;
}
#ad-timer-display {
  font-size: 4rem;
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  font-variant-numeric: tabular-nums;
}
.ad-progress-track {
  width: 300px;
  max-width: 80vw;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}
#ad-progress-bar {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.3s linear;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}
.ad-info-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 350px;
  line-height: 1.6;
}
#ad-claim-btn {
  padding: 14px 40px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--primary-glow);
}
#ad-claim-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
#ad-claim-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -4px rgba(99, 102, 241, 0.5);
}
#ad-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.2rem;
}
#ad-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Pulse glow animation for claim button */
.pulse-glow {
  animation: pulseGlow 1.5s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: var(--primary-glow); }
  50% { box-shadow: 0 8px 40px -4px rgba(99, 102, 241, 0.6); }
}

/* ─── Modal System ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: rgba(7, 9, 14, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1rem;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal-content {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s ease;
}
.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}
.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1.1rem;
}
.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}
.modal-body {
  padding: 1.5rem;
}
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

/* ─── Toast Enhancements ────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 260px;
  max-width: 420px;
  pointer-events: all;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-visible {
  opacity: 1;
  transform: translateX(0);
}
.toast-exit {
  opacity: 0;
  transform: translateX(100%);
}
.toast-success {
  border-left: 3px solid var(--green);
}
.toast-error {
  border-left: 3px solid var(--red);
}
.toast-warning {
  border-left: 3px solid var(--orange);
}
.toast-info {
  border-left: 3px solid var(--primary);
}

/* ─── Tooltip System ────────────────────────────────────────────── */
.tooltip-popup {
  position: fixed;
  padding: 6px 12px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  z-index: 11000;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.tooltip-popup.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Alert Close Button ────────────────────────────────────────── */
.alert {
  position: relative;
}
.alert-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  line-height: 1;
}
.alert-close:hover {
  opacity: 1;
}

/* ─── Form Validation ───────────────────────────────────────────── */
.input-error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}
.field-error {
  font-size: 0.78rem;
  color: var(--red);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Spinner ───────────────────────────────────────────────────── */
.spinner-sm {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Quick Amount Buttons ──────────────────────────────────────── */
.quick-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
}
.quick-amount-btn {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.quick-amount-btn:hover {
  background: var(--primary-light);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--primary);
}
.quick-amount-btn.active {
  background: var(--primary-gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--primary-glow);
}

/* ─── Payment Method Cards ──────────────────────────────────────── */
.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 1.5rem;
}
.payment-method-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.payment-method-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
  background: var(--primary-light);
}
.payment-method-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.payment-method-card input[type="radio"] {
  display: none;
}
.payment-method-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
}
.payment-method-name {
  font-size: 0.88rem;
  font-weight: 600;
}

/* ─── Tabs System ───────────────────────────────────────────────── */
.tabs-container {
  width: 100%;
}
.tabs-nav {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex: 1;
  text-align: center;
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: var(--primary-glow);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

/* ─── Data Table Enhancements ───────────────────────────────────── */
.data-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.data-table-filter {
  padding: 8px 14px 8px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  min-width: 240px;
  transition: var(--transition);
}
.data-table-filter:focus {
  border-color: var(--border-focus);
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}
.sortable-th:hover {
  color: var(--primary);
}
.sortable-th::after {
  content: '↕';
  margin-left: 6px;
  opacity: 0.3;
  font-size: 0.75rem;
}
.sortable-th.sort-asc::after {
  content: '↑';
  opacity: 1;
  color: var(--primary);
}
.sortable-th.sort-desc::after {
  content: '↓';
  opacity: 1;
  color: var(--primary);
}

/* ─── File Upload ───────────────────────────────────────────────── */
.file-upload-zone {
  border: 2px dashed var(--border-card);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.file-upload-zone:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.04);
}
.file-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-upload-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
}
.file-upload-preview {
  display: none;
  margin-top: 12px;
}
.file-upload-preview img {
  max-width: 200px;
  max-height: 150px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

/* ─── Notification Items ────────────────────────────────────────── */
.notification-item {
  display: flex;
  gap: 14px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition);
}
.notification-item:hover {
  background: rgba(255, 255, 255, 0.02);
}
.notification-item.unread {
  background: rgba(99, 102, 241, 0.04);
  border-left: 3px solid var(--primary);
}
.notification-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}
.notification-body {
  flex: 1;
  min-width: 0;
}
.notification-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}
.notification-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notification-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.btn-mark-read {
  padding: 4px 10px;
  font-size: 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-full);
  color: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  align-self: flex-start;
}
.btn-mark-read:hover {
  background: var(--primary);
  color: #fff;
}

/* ─── Dropdown Menu ─────────────────────────────────────────────── */
.dropdown {
  position: relative;
}
.dropdown-toggle {
  cursor: pointer;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: none;
  padding: 6px;
}
.dropdown-menu.open {
  display: block;
  animation: slideDown 0.2s ease;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.dropdown-item:hover {
  background: var(--primary-light);
  color: var(--text-primary);
}
.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* ─── Admin Chart Containers ────────────────────────────────────── */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.chart-container canvas {
  width: 100% !important;
  height: 220px !important;
}
.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* ─── Toggle Password ──────────────────────────────────────────── */
.password-field {
  position: relative;
}
.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}
.toggle-password:hover {
  color: var(--text-primary);
}

/* ─── Cart Row Animations ───────────────────────────────────────── */
.cart-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.3s ease;
}
.cart-qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-qty-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition);
}
.cart-qty-btn:hover {
  background: var(--primary-light);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--primary);
}

/* ─── Status Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-success {
  background: var(--green-light);
  color: var(--green);
}
.badge-warning {
  background: var(--orange-light);
  color: var(--orange);
}
.badge-danger {
  background: var(--red-light);
  color: var(--red);
}
.badge-info {
  background: var(--blue-light);
  color: var(--blue);
}
.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

/* ─── Confirm Delete Button ─────────────────────────────────────── */
.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--red);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-danger:hover {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ─── Button disabled state ─────────────────────────────────────── */
.btn-disabled,
button:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* ─── Empty state ───────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}
.empty-state-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.empty-state-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto;
}

/* ─── Animations ────────────────────────────────────────────────── */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ─── Mobile Responsive Addons ──────────────────────────────────── */
@media (max-width: 600px) {
  #toast-container {
    top: auto;
    bottom: calc(var(--mobile-nav-height) + 12px);
    right: 12px;
    left: 12px;
  }
  .toast {
    min-width: auto;
    max-width: none;
  }
  .search-results-dropdown {
    min-width: 100%;
    left: -60px;
    right: -20px;
  }
  .modal-content {
    max-width: 100%;
    margin: 0 8px;
  }
  .tabs-nav {
    gap: 0;
  }
  .tab-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
  .payment-methods-grid {
    grid-template-columns: 1fr;
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .chart-container canvas {
    height: 180px !important;
  }
}

/* Adsterra Network Slot Responsive Styling */
.adsterra-live-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}

.adsterra-live-slot iframe,
#adCodeTarget iframe,
#topBannerSlot iframe {
  max-width: 100% !important;
  border-radius: var(--radius-sm);
  margin: 0 auto;
}

#adCodeTarget,
#topBannerSlot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}
