/* ==========================================================================
   MarginMitra Pro — Ultra-Premium SaaS Stylesheet
   Design: Dark mesh gradient + vivid glassmorphism + fluid animations
   ========================================================================== */

/* ====================== DESIGN TOKENS ====================== */
:root {
  /* Core Palette */
  --bg-void: #02040a;
  --bg-deep: #060d1a;
  --bg-dark: #0a1628;
  --bg-mid: #0f2040;
  --bg-elevated: #132848;

  /* Text */
  --text-white: #ffffff;
  --text-bright: #f0f6ff;
  --text-secondary: #94afd0;
  --text-muted: #5a7497;

  /* Brand Accents */
  --cyan: #00d4ff;
  --cyan-dark: #0099cc;
  --cyan-glow: rgba(0, 212, 255, 0.3);
  --cyan-subtle: rgba(0, 212, 255, 0.08);

  --pink: #ff2d8d;
  --pink-glow: rgba(255, 45, 141, 0.3);
  --pink-subtle: rgba(255, 45, 141, 0.08);

  --violet: #8b5cf6;
  --violet-glow: rgba(139, 92, 246, 0.3);
  --violet-subtle: rgba(139, 92, 246, 0.08);

  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.25);

  /* Status */
  --green: #10d98a;
  --green-glow: rgba(16, 217, 138, 0.25);
  --red: #ff3b5c;
  --red-glow: rgba(255, 59, 92, 0.25);
  --orange: #ff7a29;

  /* Glass */
  --glass-bg: rgba(10, 22, 40, 0.75);
  --glass-bg-light: rgba(15, 32, 64, 0.6);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-border-bright: rgba(0, 212, 255, 0.25);
  --glass-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255,255,255,0.05) inset;

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Plus Jakarta Sans', sans-serif;

  /* Transitions */
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-void);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-void);
  color: var(--text-bright);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* === Animated Mesh Background === */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(0, 212, 255, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(255, 45, 141, 0.06) 0%, transparent 55%),
    radial-gradient(ellipse 70% 60% at 50% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 5% 90%, rgba(0, 212, 255, 0.04) 0%, transparent 50%),
    linear-gradient(160deg, var(--bg-void) 0%, var(--bg-deep) 40%, var(--bg-dark) 70%, var(--bg-void) 100%);
  z-index: -1;
  pointer-events: none;
  animation: meshPulse 18s ease-in-out infinite alternate;
}

/* Animated noise overlay for premium texture */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.02'/%3E%3C/svg%3E");
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
}

@keyframes meshPulse {
  0%   { opacity: 0.8; }
  50%  { opacity: 1; }
  100% { opacity: 0.8; }
}

/* ====================== SCROLLBARS ====================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* ====================== TYPOGRAPHY ====================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-white);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover { color: var(--text-white); }

/* ====================== UTILITY CLASSES ====================== */
.w-100 { width: 100%; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mt-4 { margin-top: 32px; }
.my-3 { margin-top: 20px; margin-bottom: 20px; }
.p-3 { padding: 20px; }
.flex-1 { flex: 1; }
.d-flex { display: flex; }
.gap-2 { gap: 10px; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.warn { color: var(--orange); }
.text-muted { color: var(--text-muted); }

/* ====================== BUTTONS ====================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: 14px;
  cursor: pointer;
  border: 0;
  white-space: nowrap;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.2s ease;
}

.btn:hover::after { background: rgba(255, 255, 255, 0.05); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan) 0%, #006af5 100%);
  color: #fff;
  box-shadow: 0 4px 20px var(--cyan-glow), 0 1px 0 rgba(255,255,255,0.2) inset;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--cyan-glow), 0 1px 0 rgba(255,255,255,0.2) inset;
}

.btn-secondary {
  background: var(--glass-bg-light);
  color: var(--text-bright);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  border-color: rgba(0, 212, 255, 0.35);
  color: var(--text-white);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, var(--green) 0%, #009e62 100%);
  color: var(--bg-void);
  font-weight: 800;
  box-shadow: 0 4px 18px var(--green-glow);
}
.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px var(--green-glow);
}

.btn-text {
  background: transparent;
  color: var(--text-secondary);
}
.btn-text:hover { color: var(--text-white); }

.btn-large {
  min-height: 54px;
  padding: 0 32px;
  font-size: 16px;
  border-radius: 12px;
}
.btn-sm {
  min-height: 32px;
  padding: 0 14px;
  font-size: 12px;
  border-radius: 8px;
}

/* ====================== GLASS CARDS ====================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-smooth);
  position: relative;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 60%);
  pointer-events: none;
}

.glass-card:hover {
  border-color: rgba(0, 212, 255, 0.18);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65), 0 0 30px rgba(0, 212, 255, 0.06), 0 1px 0 rgba(255,255,255,0.05) inset;
  transform: translateY(-1px);
}

/* ====================== SPA VIEWS ====================== */
.view-section {
  display: none;
  animation: pageSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.view-section.active { display: block; }
.view-section.active.app-layout { display: grid; }


.sub-view {
  display: none;
  animation: pageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.sub-view.active { display: block; }

/* ====================== HEADER / NAV ====================== */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 48px;
  height: 70px;
  background: rgba(2, 4, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.main-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-glow), transparent);
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: default;
}

.logo-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pink) 0%, var(--cyan) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  box-shadow: 0 4px 18px rgba(0, 212, 255, 0.35), 0 0 0 1px rgba(255,255,255,0.12) inset;
  transition: var(--transition-spring);
}
.logo:hover .logo-icon {
  transform: rotate(-8deg) scale(1.08);
  box-shadow: 0 6px 28px rgba(0, 212, 255, 0.5);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.03em;
}

.logo-text span {
  color: var(--cyan);
  font-size: 11px;
  text-transform: uppercase;
  background: var(--cyan-subtle);
  border: 1px solid rgba(0, 212, 255, 0.2);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  gap: 36px;
}

.nav-links a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  position: relative;
  transition: var(--transition-fast);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cyan);
  border-radius: 99px;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.nav-links a:hover {
  color: var(--text-white);
}
.nav-links a:hover::after { transform: scaleX(1); }

.nav-auth { display: flex; gap: 12px; align-items: center; }

/* ====================== LANDING PAGE ====================== */
.app-container { flex: 1; }

/* Hero Section */
.hero-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 90px 48px 60px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 72px;
  align-items: center;
}

/* Eyebrow label */
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--cyan-subtle);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 99px;
  padding: 6px 16px;
  margin-bottom: 24px;
}

.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}

.hero-content h1 {
  font-size: 58px;
  line-height: 1.07;
  margin-bottom: 22px;
  background: linear-gradient(135deg, #fff 30%, rgba(0, 212, 255, 0.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-content p {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 520px;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Trust badges */
.trust-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.trust-item-icon {
  font-size: 14px;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 52px;
  border: 1px solid var(--glass-border);
}

.stat-item {
  background: var(--glass-bg);
  padding: 22px 24px;
  text-align: center;
  transition: var(--transition-fast);
}

.stat-item:hover { background: var(--glass-bg-light); }

.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--cyan);
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-top: 6px;
  display: block;
}

/* Hero Preview Panel */
.hero-preview { position: relative; }

.preview-card {
  border-radius: 24px;
  border-color: rgba(0, 212, 255, 0.15);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 60px rgba(0, 212, 255, 0.05);
  overflow: hidden;
}

.preview-card::after {
  content: '';
  position: absolute;
  top: -1px; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.4), transparent);
}

.preview-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--glass-border);
  gap: 14px;
}

.preview-dots {
  display: flex;
  gap: 6px;
}

.preview-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.preview-title-bar {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.preview-body { padding: 20px; }

.preview-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.preview-metric {
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}

.preview-metric .lbl {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: 0.06em;
}

.preview-metric .val {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--text-white);
}

.preview-metric .val.pos { color: var(--green); }

/* Animated bar chart mock */
.preview-chart {
  height: 130px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.bar-chart-mock {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
}

.bar-chart-mock .bar {
  flex: 1;
  border-radius: 6px 6px 0 0;
  position: relative;
  animation: barGrow 1.8s cubic-bezier(0.1, 1, 0.1, 1) both;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.bar-chart-mock .bar:hover { opacity: 0.8; }

.bar-chart-mock .bar span {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.preview-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}
.status-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite;
}

.preview-run-btn {
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  background: var(--cyan-subtle);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
  transition: var(--transition-fast);
}
.preview-run-btn:hover { background: rgba(0, 212, 255, 0.15); }

/* ====================== LANDING SECTIONS ====================== */
.features-section,
.pricing-section,
.faq-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 80px 48px;
}

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-bottom: 14px;
}

.section-title {
  font-size: 42px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-white) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 48px;
  max-width: 580px;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.feature-card {
  cursor: default;
  transition: var(--transition-smooth);
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 212, 255, 0.2);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 212, 255, 0.08);
}

.feat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  color: #fff;
  margin-bottom: 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transition: var(--transition-spring);
}

.feature-card:hover .feat-icon {
  transform: rotate(-6deg) scale(1.1);
}

.flipkart-bg { background: linear-gradient(135deg, #00b4d8, #0068b3); box-shadow: 0 8px 24px rgba(0, 180, 216, 0.35); }
.meesho-bg   { background: linear-gradient(135deg, #ff2d8d, #ff6dba); box-shadow: 0 8px 24px rgba(255, 45, 141, 0.35); }
.ajio-bg     { background: linear-gradient(135deg, #8b5cf6, #ec4899);  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35); }

.feature-card h3 { font-size: 20px; margin-bottom: 10px; }
.feature-card p { color: var(--text-secondary); font-size: 14px; line-height: 1.65; }

/* Feature checklist items */
.feature-points {
  list-style: none;
  margin-top: 16px;
}
.feature-points li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.feature-points li::before {
  content: '✓';
  color: var(--green);
  font-weight: 900;
  font-size: 12px;
  flex-shrink: 0;
}

/* ====================== PRICING ====================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.price-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
  transition: var(--transition-smooth);
}

.price-card:hover {
  transform: translateY(-8px);
}

.price-card.popular {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), 0 24px 60px rgba(0, 212, 255, 0.15);
  background: linear-gradient(160deg, rgba(0, 212, 255, 0.04) 0%, var(--glass-bg) 100%);
}

.price-card .badge {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--cyan) 0%, #006af5 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  padding: 5px 16px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  box-shadow: 0 4px 16px var(--cyan-glow);
}

.price-card h3 { font-size: 20px; margin-bottom: 10px; }

.price-amount {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin: 12px 0 8px;
}
.price-currency { font-size: 20px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.price-number { font-family: var(--font-display); font-size: 48px; font-weight: 800; color: var(--text-white); line-height: 1; }
.price-period { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }

.price-card > p { color: var(--text-secondary); font-size: 14px; margin-bottom: 22px; min-height: 36px; }

.price-features {
  list-style: none;
  margin-bottom: 28px;
  flex-grow: 1;
}
.price-features li {
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13.5px;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 10px;
}
.price-features li::before {
  content: '✓';
  color: var(--cyan);
  font-weight: 900;
  font-size: 12px;
  flex-shrink: 0;
}

/* ====================== FAQ ====================== */
.faq-list {
  display: grid;
  gap: 14px;
  max-width: 820px;
  margin: 40px auto 0;
}

.faq-item {
  cursor: pointer;
  transition: var(--transition-smooth);
}
.faq-item:hover {
  border-color: rgba(0, 212, 255, 0.2);
  transform: translateX(4px);
}

.faq-item h4 { font-size: 17px; margin-bottom: 10px; }
.faq-item p { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }

/* ====================== APP SHELL (DASHBOARD) ====================== */
.app-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 100vh;
}

/* === Sidebar === */
.app-sidebar {
  background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-void) 100%);
  border-right: 1px solid var(--glass-border);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 99;
}

/* Sidebar top glow line */
.app-sidebar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-glow), transparent);
}

.app-sidebar .logo {
  margin-bottom: 28px;
}

.user-profile {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 18px 16px;
  margin-top: auto;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  transition: var(--transition-fast);
}

.user-profile:hover {
  border-color: rgba(0, 212, 255, 0.15);
  background: rgba(0, 212, 255, 0.02);
}

.profile-avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet) 0%, var(--cyan) 100%);
  display: grid;
  place-items: center;
  font-size: 18px;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px var(--violet-glow);
}

.profile-info strong {
  display: block;
  font-size: 13px;
  color: var(--text-white);
  overflow-wrap: anywhere;
  font-weight: 700;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 800;
  background: var(--cyan-subtle);
  color: var(--cyan);
  padding: 3px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  margin-top: 5px;
  border: 1px solid rgba(0, 212, 255, 0.2);
  letter-spacing: 0.06em;
}
.plan-badge.free {
  background: rgba(90, 116, 151, 0.15);
  color: var(--text-muted);
  border-color: rgba(90, 116, 151, 0.25);
}
.plan-badge.enterprise {
  background: var(--violet-subtle);
  color: var(--violet);
  border-color: rgba(139, 92, 246, 0.25);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 24px;
}

.nav-item {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13.5px;
  padding: 11px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition-smooth);
  position: relative;
}

.nav-item:hover {
  background: rgba(0, 212, 255, 0.07);
  color: var(--text-bright);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.12) 0%, rgba(0, 106, 245, 0.08) 100%);
  color: var(--text-white);
  border: 1px solid rgba(0, 212, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 212, 255, 0.1);
}

.sidebar-footer {
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

/* === Main Content === */
.app-main-content {
  padding: 40px 44px;
  background: radial-gradient(ellipse 80% 40% at 50% 0%, rgba(0, 212, 255, 0.03), transparent 60%);
  overflow-x: hidden;
  min-width: 0;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 28px;
  line-height: 1.5;
}

/* ====================== PORTAL SELECTION ====================== */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 28px;
}

.portal-select-card {
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 270px;
  position: relative;
  overflow: hidden;
}

/* Subtle animated inner glow */
.portal-select-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.portal-select-card:has(.fk-icon)::after  { background: radial-gradient(circle at 20% 20%, rgba(0, 212, 255, 0.08), transparent 60%); }
.portal-select-card:has(.ms-icon)::after  { background: radial-gradient(circle at 20% 20%, rgba(255, 45, 141, 0.08), transparent 60%); }
.portal-select-card:has(.aj-icon)::after  { background: radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.08), transparent 60%); }

.portal-select-card:hover::after { opacity: 1; }

.portal-select-card:hover {
  transform: translateY(-8px) scale(1.015);
}
.portal-select-card:hover:has(.fk-icon)  {
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 180, 216, 0.12);
}
.portal-select-card:hover:has(.ms-icon)  {
  border-color: rgba(255, 45, 141, 0.3);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 45, 141, 0.12);
}
.portal-select-card:hover:has(.aj-icon)  {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(139, 92, 246, 0.12);
}

.portal-icon {
  width: 58px; height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  color: #fff;
  margin-bottom: 22px;
  transition: var(--transition-spring);
}

.portal-select-card:hover .portal-icon {
  transform: rotate(6deg) scale(1.12);
}

.fk-icon { background: linear-gradient(135deg, #00d4ff 0%, #0068b3 100%); box-shadow: 0 8px 24px rgba(0, 212, 255, 0.4); }
.ms-icon { background: linear-gradient(135deg, #ff2d8d 0%, #ff6dba 100%); box-shadow: 0 8px 24px rgba(255, 45, 141, 0.4); }
.aj-icon { background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4); }

.portal-select-card h3 { font-size: 22px; margin-bottom: 10px; }
.portal-select-card > p { color: var(--text-secondary); font-size: 14px; line-height: 1.55; flex-grow: 1; }

.portal-cta {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--cyan);
  font-size: 13px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease;
}
.portal-select-card:hover .portal-cta { gap: 10px; }

/* ====================== WIZARD FORM ====================== */
.wizard-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.wizard-header h2 { flex: 1; }

.wizard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}

/* ====================== FORM ELEMENTS ====================== */
.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-bright);
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 10px;
  color: var(--text-white);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: var(--transition-fast);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
  background: rgba(0, 212, 255, 0.03);
}

input::placeholder { color: var(--text-muted); }

small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 5px;
}

/* File Upload Cards */
.file-upload-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 128px;
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.01);
  padding: 18px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
  text-align: center;
}

.file-upload-card input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-upload-card:hover {
  border-color: var(--cyan);
  background: var(--cyan-subtle);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.08);
}

.file-upload-card.has-file {
  border-color: var(--green);
  border-style: solid;
  background: rgba(16, 217, 138, 0.04);
  box-shadow: 0 0 20px rgba(16, 217, 138, 0.08);
}

.file-upload-icon {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.file-upload-card:hover .file-upload-icon { color: var(--cyan); transform: scale(1.1); }
.file-upload-card.has-file .file-upload-icon { color: var(--green); }

.file-upload-card strong {
  font-size: 13.5px;
  color: var(--text-white);
  margin-bottom: 2px;
}

.file-upload-card small { margin: 0; }

/* ====================== LOADING SCREEN ====================== */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 70px 40px;
  max-width: 580px;
  margin: 50px auto;
}

.spinner {
  width: 56px; height: 56px;
  border: 3px solid rgba(0, 212, 255, 0.1);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-bottom: 28px;
  box-shadow: 0 0 20px var(--cyan-glow);
}

.loading-container h3 { margin-bottom: 12px; font-size: 22px; }
.loading-container p { color: var(--text-secondary); font-size: 14px; line-height: 1.65; }

/* ====================== RESULTS DASHBOARD ====================== */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--glass-border);
}

.results-title-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.results-title-section h2 { font-size: 26px; }

.results-actions { display: flex; gap: 12px; align-items: center; }

.badge {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  background: var(--glass-bg-light);
  color: var(--text-bright);
  padding: 4px 14px;
  border-radius: 99px;
  border: 1px solid var(--glass-border);
  letter-spacing: 0.04em;
}

/* Revenue Funnel */
.results-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 22px;
}

.funnel-card { overflow: hidden; }

.revenue-funnel-stages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  align-items: center;
}

.funnel-stage {
  width: 100%;
  max-width: 440px;
  min-height: 58px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  animation: stageSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.funnel-stage span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

.funnel-stage strong {
  font-size: 22px;
  font-family: var(--font-display);
  font-weight: 800;
}

.stage-gross  { background: linear-gradient(90deg, var(--cyan), #006af5); color: #fff; }
.stage-net    { width: 87%; background: linear-gradient(90deg, #52c7e8, #3baadb); color: #fff; }
.stage-settle { width: 74%; background: linear-gradient(90deg, #c8d9f8, #aec5f2); color: #0a1628; }
.stage-profit {
  width: 62%;
  background: rgba(16, 217, 138, 0.08);
  border: 2px solid var(--green);
  color: var(--green);
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.metric-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px 18px;
  transition: var(--transition-fast);
}
.metric-box:hover {
  border-color: rgba(0, 212, 255, 0.15);
  background: rgba(0, 212, 255, 0.02);
}

.metric-box span {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.07em;
}

.metric-box strong {
  display: block;
  font-size: 22px;
  font-family: var(--font-display);
  color: var(--text-white);
}

/* Charts Grid */
.results-charts-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.85fr;
  gap: 22px;
}

.chart-container {
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.chart-container canvas {
  margin-top: 14px;
  flex-grow: 1;
  max-height: 260px;
}

.quantity-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.qty-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: var(--transition-fast);
}
.qty-box:hover { border-color: rgba(0, 212, 255, 0.15); }

.qty-box span {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.07em;
}

.qty-box strong {
  font-size: 22px;
  font-family: var(--font-display);
  color: var(--text-white);
}

/* Alerts Grid */
.alerts-cards-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.alert-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.alert-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cyan);
  border-radius: 3px 3px 0 0;
}

.alert-card.alert-bad::before   { background: var(--red); }
.alert-card.alert-warn::before  { background: var(--orange); }
.alert-card.alert-good::before  { background: var(--green); }

.alert-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 212, 255, 0.2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.alert-card span {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.alert-card strong {
  display: block;
  font-size: 26px;
  margin: 5px 0;
  font-family: var(--font-display);
  color: var(--text-white);
}

.alert-card small { margin: 0; font-size: 11px; }

/* ====================== DYNAMIC TABLES ====================== */
.table-card {
  padding: 0 !important;
  overflow: hidden;
}

.table-header-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 26px;
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
  gap: 16px;
  background: rgba(0, 212, 255, 0.01);
}

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

.search-box input {
  min-height: 36px !important;
  max-width: 220px;
  font-size: 13px !important;
}

.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-tab {
  min-height: 32px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-display);
}

.filter-tab:hover {
  color: var(--text-bright);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 212, 255, 0.25);
}

.filter-tab.active {
  color: var(--bg-void);
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 2px 12px var(--cyan-glow);
}

.table-wrapper {
  overflow-x: auto;
  max-height: 520px;
}

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

th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 13px 16px;
  z-index: 1;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
  letter-spacing: 0.07em;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 13px;
  white-space: nowrap;
  color: var(--text-bright);
  transition: background-color 0.2s ease;
}

tr:nth-child(even) td { background: rgba(255, 255, 255, 0.005); }
tr:hover td { background: rgba(0, 212, 255, 0.03) !important; color: var(--text-white); }

/* ====================== SKU DRAWER ====================== */
.drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 10, 0.7);
  backdrop-filter: blur(6px);
  z-index: 90;
}
.drawer-backdrop.visible { display: block; }

.sku-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(580px, 94vw);
  height: 100vh;
  z-index: 91;
  border-radius: 0;
  border-width: 0 0 0 1px;
  transform: translateX(105%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
}

.sku-drawer.visible { transform: translateX(0); }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 26px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(6, 13, 26, 0.9);
  position: sticky;
  top: 0;
  z-index: 1;
}

.drawer-body {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px 18px;
}

.drawer-section h3 {
  font-size: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 8px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.breakdown-item { margin-bottom: 14px; }

.breakdown-row-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 5px;
  color: var(--text-bright);
}

.progress-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--cyan);
  width: 0;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.pos { background: var(--green); }
.progress-fill.neg { background: var(--red); }

.drawer-suggestion {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.5;
}

.drawer-suggestion.good {
  background: rgba(16, 217, 138, 0.07);
  border: 1px solid rgba(16, 217, 138, 0.2);
  color: var(--green);
}

.drawer-suggestion.bad {
  background: rgba(255, 59, 92, 0.07);
  border: 1px solid rgba(255, 59, 92, 0.2);
  color: var(--red);
}

/* ====================== MODALS ====================== */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 10, 0.82);
  backdrop-filter: blur(10px);
  z-index: 200;
  place-items: center;
  padding: 20px;
}
.modal-backdrop.visible { display: grid; }

.modal-content {
  width: 100%;
  max-width: 480px;
  position: relative;
  animation: modalPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

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

.btn-close {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
  line-height: 1;
}
.btn-close:hover {
  background: rgba(255, 59, 92, 0.1);
  border-color: var(--red);
  color: var(--red);
}

.auth-toggle-text {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}

.payment-order-summary { border-color: rgba(0, 212, 255, 0.15); }

/* ====================== ACCOUNT USAGE ====================== */
.usage-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card-kpi { text-align: center; }

.card-kpi .lbl {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.08em;
}

.card-kpi strong {
  display: block;
  font-size: 36px;
  font-family: var(--font-display);
  color: var(--cyan);
}

.card-kpi .sub-lbl {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* ====================== KEYFRAME ANIMATIONS ====================== */
@keyframes pageSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes barGrow {
  from { height: 0; }
}

@keyframes stageSlideIn {
  from { opacity: 0; transform: translateX(-20px) scale(0.97); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 1200px) {
  .hero-section { grid-template-columns: 1fr; gap: 50px; padding: 60px 40px; }
  .hero-preview { max-width: 520px; margin: 0 auto; }
  .features-grid, .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .results-dashboard-grid, .results-charts-grid { grid-template-columns: 1fr; }
  .alerts-cards-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .app-sidebar { height: auto; position: relative; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .portal-grid { grid-template-columns: 1fr; }
  .usage-stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .main-header { padding: 0 20px; flex-wrap: wrap; height: auto; padding: 14px 20px; }
  .features-grid, .pricing-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .hero-content h1 { font-size: 40px; }
  .app-main-content { padding: 24px 20px; }
  .alerts-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .wizard-grid { grid-template-columns: 1fr; }
}

/* ====================== COLUMN SELECTOR PANEL ====================== */

/* Trigger button */
.btn-col-selector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  background: rgba(0, 212, 255, 0.07);
  border: 1px solid rgba(0, 212, 255, 0.22);
  border-radius: 8px;
  color: var(--cyan);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  letter-spacing: 0.01em;
}

.btn-col-selector:hover {
  background: rgba(0, 212, 255, 0.13);
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.15);
}

.col-count-badge {
  background: var(--cyan);
  color: var(--bg-void);
  font-size: 10px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 99px;
  min-width: 20px;
  text-align: center;
  letter-spacing: 0;
}

/* Floating panel */
.col-selector-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 500;
  width: 260px;
  padding: 0;
  border-radius: 14px;
  border-color: rgba(0, 212, 255, 0.2);
  background: rgba(8, 16, 30, 0.97);
  backdrop-filter: blur(28px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 212, 255, 0.12);
  animation: colPanelIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  overflow: hidden;
}

@keyframes colPanelIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Panel header */
.col-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--glass-border);
}

.col-panel-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--text-white);
}

.col-panel-close {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition-fast);
  line-height: 1;
}
.col-panel-close:hover {
  background: rgba(255, 59, 92, 0.12);
  border-color: var(--red);
  color: var(--red);
}

/* Tabs: Reorder | Select */
.col-panel-tabs {
  display: flex;
  padding: 10px 12px 8px;
  gap: 6px;
  border-bottom: 1px solid var(--glass-border);
}

.col-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: 7px;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 11.5px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.col-tab:hover {
  color: var(--text-bright);
  border-color: rgba(0, 212, 255, 0.25);
}

.col-tab.active {
  background: rgba(0, 212, 255, 0.12);
  border-color: rgba(0, 212, 255, 0.35);
  color: var(--cyan);
  box-shadow: 0 2px 10px rgba(0, 212, 255, 0.12);
}

/* Toggle row (Select tab header) */
.col-panel-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.col-panel-quick {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.col-panel-quick button {
  background: none;
  border: none;
  color: var(--cyan);
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  padding: 0 2px;
  font-family: var(--font-display);
  transition: var(--transition-fast);
}

.col-panel-quick button:hover {
  color: var(--text-white);
}

/* Scrollable list */
.col-panel-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px 8px 10px;
}

.col-panel-list::-webkit-scrollbar { width: 4px; }
.col-panel-list::-webkit-scrollbar-track { background: transparent; }
.col-panel-list::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.2); border-radius: 99px; }

/* Each column row (Select mode) */
.col-panel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
}

.col-panel-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.col-panel-item.required {
  opacity: 0.65;
  cursor: default;
}

/* Custom checkbox — class-based (no hidden input, pure JS onclick) */
.col-checkbox-ui {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Checked state — triggered by .checked class on the div */
.col-checkbox-ui.checked {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.col-checkbox-ui.checked::after {
  content: '';
  display: block;
  width: 4px;
  height: 8px;
  border: 2px solid var(--bg-void);
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* Clickable Select rows */
.col-panel-item:not(.required) {
  cursor: pointer;
}

.col-panel-item.col-item-checked {
  background: rgba(0, 212, 255, 0.04);
}

.col-panel-item.required {
  cursor: default;
  opacity: 0.6;
}

.col-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
}

/* Required badge */
.col-required-badge {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  padding: 1px 6px;
  flex-shrink: 0;
}

/* Reorder items */
.reorder-item {
  cursor: grab;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}

.reorder-item:active { cursor: grabbing; }

.reorder-item:hover {
  background: rgba(0, 212, 255, 0.05);
  border-color: rgba(0, 212, 255, 0.15);
}

.reorder-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.15);
}

.reorder-item.drag-over {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
  transform: scale(1.01);
}

/* Drag handle (6-dot grid) */
.drag-handle {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.reorder-item:hover .drag-handle {
  color: var(--cyan);
}


/* ============================================================
   REVENUE FUNNEL — 2×2 KPI CARD GRID + HEALTH SCORE
   ============================================================ */

.kpi-4-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.kpi-4-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.kpi-4-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.03) 0%, transparent 60%);
  pointer-events: none;
}

.kpi-4-card:hover {
  border-color: rgba(0, 212, 255, 0.2);
  background: rgba(0, 212, 255, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.kpi-4-label {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.kpi-4-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  color: var(--cyan);
  letter-spacing: -0.02em;
  line-height: 1;
}

/* P/L card value flips color via JS */
.kpi-pl-card .kpi-4-value.pos { color: var(--green); }
.kpi-pl-card .kpi-4-value.neg { color: var(--red); }

/* ---- Revenue Health Score bar ---- */

.health-score-block {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.health-score-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.health-score-label span {
  color: var(--cyan);
  font-size: 15px;
  font-weight: 900;
}

.health-bar-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.health-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #10d98a, #00d4ff);
  box-shadow: 0 0 12px rgba(16, 217, 138, 0.4);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.health-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 99px;
  filter: blur(4px);
}

.health-bar-fill.bad {
  background: linear-gradient(90deg, #ff3b5c, #ff8c42);
  box-shadow: 0 0 12px rgba(255, 59, 92, 0.35);
}

.health-bar-fill.medium {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

/* ---- Avg P/L rows below health bar ---- */

.avg-pl-rows {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.avg-pl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.avg-pl-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.avg-pl-value {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-muted);
}

.avg-pl-value.pos { color: var(--green); }
.avg-pl-value.neg { color: var(--red); }


/* ====================== SKU PERFORMANCE EXPANDABLE ROW ====================== */

.sku-clickable {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cyan);
  transition: color 0.15s ease, transform 0.15s ease;
}

.sku-clickable:hover {
  color: var(--text-bright);
}

.sku-main-row.expanded td:first-child {
  background: rgba(0, 212, 255, 0.9) !important;
  color: var(--bg-void) !important;
}

.sku-main-row.expanded td:first-child .sku-clickable {
  color: var(--bg-void) !important;
}

.sku-order-subrow td {
  font-size: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.015) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

.sku-order-subrow:hover td {
  background: rgba(0, 212, 255, 0.05) !important;
  color: var(--text-bright);
}

.sku-subrow-id-cell {
  padding-left: 24px !important;
  font-family: var(--font-display), monospace;
  font-size: 12px !important;
}

.subrow-indent {
  color: var(--cyan);
  margin-right: 8px;
  font-weight: 700;
}

.subrow-id-text {
  color: var(--text-secondary);
}

.sku-order-subrow.loading-row td {
  padding: 16px 20px !important;
  background: rgba(0, 212, 255, 0.02) !important;
}


/* ====================== ACCOUNT SELECTOR STYLES ====================== */
#wizardAccountSelect {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#wizardAccountSelect:focus {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.25) !important;
  outline: none;
}

#newAccountInputContainer input {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#newAccountInputContainer input:focus {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.25) !important;
  outline: none;
}


/* ====================== DATE PICKER & UPLOAD DRAWER STYLES ====================== */
#dashboardDatePickerPanel {
  display: none;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  background: var(--bg-dark);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border-bright);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.85);
  transition: opacity 0.2s ease;
}

#dashboardDatePickerPanel.visible {
  display: grid !important;
}

#uploadDrawer {
  width: min(720px, 94vw);
  z-index: 105;
}

#uploadDrawer.visible {
  transform: translateX(0) !important;
}

#uploadDrawerBackdrop {
  z-index: 104;
}

#uploadDrawerBackdrop.visible {
  display: block !important;
}


.upload-file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  margin-bottom: 10px;
}

.upload-file-info {
  display: flex;
  flex-direction: column;
}

.upload-file-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-bright);
}

.upload-file-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.upload-file-actions {
  display: flex;
  gap: 8px;
}

.btn-delete-file {
  background: rgba(255, 59, 92, 0.1);
  color: var(--red);
  border: 1px solid rgba(255, 59, 92, 0.2);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete-file:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}


@keyframes pulseRed {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 59, 92, 0.4);
    border-color: rgba(255, 59, 92, 0.25);
  }
  50% {
    box-shadow: 0 0 12px 4px rgba(255, 59, 92, 0.15);
    border-color: rgba(255, 59, 92, 0.6);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 92, 0);
    border-color: rgba(255, 59, 92, 0.25);
  }
}





