/* ═══════════════════════════════════════════════════
   Leadstore Dashboard — Design System
   ═══════════════════════════════════════════════════ */

:root {
  --bg:          #050507;
  --bg-secondary:#0c0e16;
  --bg-card:     #111320;
  --bg-card-elevated: #161829;
  --bg-hover:    #1a1d2e;
  --border:      #1a1d2e;
  --border-light:#262a3d;
  --border-subtle:#3a3f57;

  --text:        #eef0f8;
  --text-secondary:#b0b5cc;
  --text-muted:  #7d84a2;
  --text-dim:    #555c7a;

  --accent:      #7c6cf6;
  --accent-hover:#9b8fff;
  --accent-subtle:rgba(124,108,246,0.07);
  --accent-glow: rgba(124,108,246,0.15);
  --accent-glow-strong: rgba(124,108,246,0.3);

  --success:     #34d399;
  --success-dim: rgba(52,211,153,0.08);
  --warning:     #fbbf24;
  --warning-dim: rgba(251,191,36,0.08);
  --danger:      #f87171;
  --danger-dim:  rgba(248,113,113,0.08);
  --pink:        #f472b6;
  --cyan:        #22d3ee;
  --violet:      #a78bfa;
  --orange:      #fb923c;

  --font-sans:   'Inter', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', monospace;

  --sidebar-w:   260px;
  --radius:      16px;
  --radius-sm:   10px;
  --radius-xs:   6px;

  --shadow-sm:   0 2px 8px rgba(0,0,0,.3);
  --shadow-md:   0 8px 32px rgba(0,0,0,.35);
  --shadow-lg:   0 20px 60px rgba(0,0,0,.45);
  --shadow-glow: 0 0 24px rgba(124,108,246,.18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse at 15% 0%, rgba(124,108,246,.07) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 5%, rgba(167,139,250,.05) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(52,211,153,.03) 0%, transparent 50%),
    radial-gradient(ellipse at 0% 50%, rgba(244,114,182,.03) 0%, transparent 40%);
  background-attachment: fixed;
}
/* Noise texture overlay for depth */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #52525b; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.7); cursor: pointer; }
select option { background: var(--bg-secondary); color: var(--text); }

/* ── Animations ─────────────────────────────────── */
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }
@keyframes slideUp { from { opacity:0; transform:translateY(16px) } to { opacity:1; transform:translateY(0) } }
@keyframes slideInRight { from { opacity:0; transform:translateX(-16px) } to { opacity:1; transform:translateX(0) } }
@keyframes slideInLeft { from { opacity:0; transform:translateX(16px) } to { opacity:1; transform:translateX(0) } }
@keyframes scaleIn { from { opacity:0; transform:scale(.95) } to { opacity:1; transform:scale(1) } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes shimmer { 0% { background-position: -200% 0 } 100% { background-position: 200% 0 } }
@keyframes pulseGlow { 0%,100% { box-shadow: 0 0 8px rgba(124,108,246,.15) } 50% { box-shadow: 0 0 24px rgba(124,108,246,.35) } }
@keyframes breathe { 0%,100% { opacity:.5 } 50% { opacity:1 } }
@keyframes countUp { from { opacity:0; transform:translateY(6px) } to { opacity:1; transform:translateY(0) } }
@keyframes pageFadeIn { from { opacity:0; transform:translateY(12px) } to { opacity:1; transform:translateY(0) } }
@keyframes gradientShift { 0% { background-position: 0% 50% } 50% { background-position: 100% 50% } 100% { background-position: 0% 50% } }
@keyframes borderGlow { 0%,100% { border-color: rgba(124,108,246,.08) } 50% { border-color: rgba(124,108,246,.2) } }
@keyframes edgePulse { 0%,100% { opacity: .3; } 50% { opacity: .8; } }
@keyframes glowDrift { 0%,100% { opacity: .6; } 50% { opacity: 1; } }
@keyframes barGrow { from { width: 0; } }
@keyframes dotPulse { 0%,100% { transform: scale(1); opacity: .6; } 50% { transform: scale(1.6); opacity: 1; } }
@keyframes activeGlow { 0%,100% { box-shadow: inset 3px 0 8px -4px rgba(124,108,246,.2); } 50% { box-shadow: inset 3px 0 12px -4px rgba(124,108,246,.5); } }

.animate-fade { animation: fadeIn .25s ease-out; }
.animate-slide-up { animation: slideUp .3s cubic-bezier(.16,1,.3,1); }
.animate-slide-right { animation: slideInRight .3s cubic-bezier(.16,1,.3,1); }
.spin { animation: spin 1s linear infinite; }

/* ── Scroll-reveal: hidden by default, revealed by IntersectionObserver ── */
.reveal {
  opacity: 0; transform: translateY(20px);
  transition: opacity .5s cubic-bezier(.16,1,.3,1), transform .5s cubic-bezier(.16,1,.3,1);
}
.reveal.revealed { opacity: 1; transform: translateY(0); }
.reveal-right {
  opacity: 0; transform: translateX(-20px);
  transition: opacity .5s cubic-bezier(.16,1,.3,1), transform .5s cubic-bezier(.16,1,.3,1);
}
.reveal-right.revealed { opacity: 1; transform: translateX(0); }
.reveal-scale {
  opacity: 0; transform: scale(.92);
  transition: opacity .4s cubic-bezier(.16,1,.3,1), transform .4s cubic-bezier(.16,1,.3,1);
}
.reveal-scale.revealed { opacity: 1; transform: scale(1); }

/* ── Page transition wrapper ─────────────────────── */
.page-transition { animation: pageFadeIn .35s cubic-bezier(.16,1,.3,1); }

/* ── KPI count-up animation ──────────────────────── */
.kpi-value { animation: countUp .4s cubic-bezier(.16,1,.3,1) backwards; }

/* ── Hover micro-interactions ────────────────────── */
.interactive { transition: all .25s cubic-bezier(.16,1,.3,1); }
.interactive:hover { transform: translateY(-2px); }
.interactive:active { transform: translateY(0) scale(.98); }

/* ── Typography ─────────────────────────────────── */
.text-2xs { font-size: 10px; line-height: 14px; }
.text-xs  { font-size: 12px; }
.text-sm  { font-size: 13px; }
.text-base{ font-size: 14px; }
.text-lg  { font-size: 18px; }
.text-xl  { font-size: 20px; }
.text-2xl { font-size: 26px; }
.font-mono { font-family: var(--font-mono); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: .06em; }
.tracking-wider { letter-spacing: .1em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.text-primary { color: var(--text); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* ── Layout ─────────────────────────────────────── */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, rgba(12,14,22,.98) 0%, rgba(8,9,16,.99) 100%);
  border-right: 1px solid rgba(124,108,246,.06);
  display: flex; flex-direction: column;
  z-index: 50;
  transition: width .3s cubic-bezier(.16,1,.3,1);
}

.sidebar-logo {
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px; height: 72px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; cursor: default;
  position: relative;
}
.sidebar-logo::after {
  content: ''; position: absolute; bottom: -1px; left: 24px; right: 24px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,108,246,.3), transparent);
  animation: breathe 4s ease-in-out infinite;
}
.sidebar-logo-icon {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, #7c6cf6 0%, #a78bfa 50%, #c4b5fd 100%);
  background-size: 200% 200%; animation: gradientShift 4s ease infinite, pulseGlow 4s ease-in-out infinite;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(124,108,246,.35), 0 0 0 1px rgba(124,108,246,.1);
}
.sidebar-brand { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.sidebar-sub {
  font-size: 10px; color: var(--text-dim); letter-spacing: .04em; text-transform: uppercase;
}
.sidebar-sub::before {
  content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--success); margin-right: 5px; vertical-align: middle;
  box-shadow: 0 0 6px var(--success);
  animation: dotPulse 2s ease-in-out infinite;
}

.sidebar-nav {
  flex: 1; padding: 20px 14px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  /* Gradient fade at top and bottom for scroll hint */
  mask-image: linear-gradient(to bottom, transparent 0%, black 16px, black calc(100% - 16px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 16px, black calc(100% - 16px), transparent 100%);
}

.sidebar-link {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none;
  font-size: 13px; font-weight: 500; letter-spacing: .01em;
  transition: all .2s cubic-bezier(.16,1,.3,1); cursor: pointer;
  border: 1px solid transparent; background: none; width: 100%; text-align: left;
}
.sidebar-link:hover { color: var(--text-secondary); background: var(--bg-hover); border-color: var(--border); transform: translateX(3px); }
.sidebar-link:active { transform: translateX(1px) scale(.98); }
.sidebar-link.active {
  color: #c4b5fd; background: linear-gradient(90deg, rgba(124,108,246,.12) 0%, rgba(124,108,246,.04) 100%);
  border-color: rgba(124,108,246,.15);
  border-left: 3px solid var(--accent);
  padding-left: 11px;
  animation: activeGlow 3s ease-in-out infinite;
}
.sidebar-link.active svg { stroke: #c4b5fd; }
.sidebar-link svg { flex-shrink: 0; opacity: .6; transition: all .2s; }
.sidebar-link:hover svg { opacity: 1; }

.sidebar-footer {
  border-top: 1px solid transparent; padding: 14px; position: relative;
  background-image: linear-gradient(var(--bg-secondary), var(--bg-secondary)), linear-gradient(90deg, transparent, rgba(124,108,246,.15), transparent);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
}

.settings-menu {
  position: absolute; bottom: 100%; left: 8px; right: 8px;
  background: var(--bg-card-elevated); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 6px 0;
  box-shadow: var(--shadow-lg); z-index: 100;
  animation: slideUp .15s cubic-bezier(.16,1,.3,1);
}
.settings-menu-header {
  padding: 10px 16px 6px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim);
}
.settings-menu-item {
  display: block; width: 100%; padding: 8px 16px; border: none;
  background: none; color: var(--text-secondary); font-size: 13px;
  font-family: var(--font-sans); text-align: left; cursor: pointer;
  transition: all .15s;
}
.settings-menu-item:hover { background: var(--bg-hover); color: var(--text); }
.settings-menu-danger:hover { background: var(--danger-dim); color: var(--danger); }

/* ── Dashboard background effects ──────────────── */
.dash-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.dash-glow {
  position: absolute; border-radius: 50%; opacity: .7; pointer-events: none;
}
.dg1 { width: 800px; height: 800px; top: -5%; left: 10%; background: radial-gradient(circle, rgba(124,108,246,.14) 0%, rgba(124,108,246,.04) 40%, transparent 70%); animation: orbFloat1 30s ease-in-out infinite; }
.dg2 { width: 700px; height: 700px; bottom: 5%; right: 5%; background: radial-gradient(circle, rgba(167,139,250,.1) 0%, rgba(167,139,250,.03) 40%, transparent 70%); animation: orbFloat2 35s ease-in-out infinite; }
.dg3 { width: 600px; height: 600px; top: 50%; left: 50%; background: radial-gradient(circle, rgba(244,114,182,.08) 0%, rgba(244,114,182,.02) 40%, transparent 60%); animation: orbFloat3 28s ease-in-out infinite; }

.dash-aurora { position: fixed; inset: 0; pointer-events: none; overflow: hidden; opacity: .6; z-index: 0; }
.dash-aurora::before {
  content: ''; position: absolute; top: -50%; left: -20%; width: 140%; height: 200%;
  background: linear-gradient(180deg, transparent 30%, rgba(124,108,246,.04) 40%, rgba(167,139,250,.05) 50%, transparent 60%);
  animation: auroraWave 20s ease-in-out infinite; opacity: .7;
}
.dash-aurora::after {
  content: ''; position: absolute; top: -30%; left: 10%; width: 120%; height: 180%;
  background: linear-gradient(160deg, transparent 35%, rgba(52,211,153,.03) 45%, rgba(244,114,182,.02) 55%, transparent 65%);
  animation: auroraWave 28s ease-in-out infinite reverse; opacity: .6;
}

.dash-smoke { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ds1 { width: 1000px; height: 700px; top: -10%; right: -10%; background: radial-gradient(ellipse, rgba(124,108,246,.12) 0%, rgba(124,108,246,.03) 40%, transparent 65%); animation: smokeDrift1 35s ease-in-out infinite; opacity: .5; }
.ds2 { width: 1100px; height: 800px; bottom: -15%; left: -10%; background: radial-gradient(ellipse, rgba(167,139,250,.1) 0%, rgba(167,139,250,.03) 40%, transparent 65%); animation: smokeDrift2 40s ease-in-out infinite; opacity: .45; }
.ds3 { width: 900px; height: 600px; top: 40%; left: 30%; background: radial-gradient(ellipse, rgba(244,114,182,.07) 0%, rgba(244,114,182,.02) 40%, transparent 60%); animation: smokeDrift3 32s ease-in-out infinite; opacity: .4; }
.ds4 { width: 1200px; height: 900px; top: -5%; left: -15%; background: radial-gradient(ellipse, rgba(52,211,153,.06) 0%, rgba(52,211,153,.02) 40%, transparent 60%); animation: smokeRise 38s ease-in-out infinite; opacity: .35; }
.ds5 { width: 1000px; height: 800px; bottom: 10%; right: 20%; background: radial-gradient(ellipse, rgba(124,108,246,.08) 0%, rgba(124,108,246,.02) 40%, transparent 60%); animation: smokeDrift1 42s ease-in-out infinite reverse; opacity: .4; }

.dash-stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.dash-particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.dash-meteors { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.dm1 { top: 5%; right: -5%; animation: meteorShoot 8s ease-in 3s infinite; }
.dm2 { top: 15%; right: -10%; animation: meteorShoot 10s ease-in 9s infinite; }
.dm3 { top: 8%; right: 20%; animation: meteorShoot 7s ease-in 18s infinite; }

.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: margin-left .3s cubic-bezier(.16,1,.3,1);
  position: relative; z-index: 1;
}
.page-content { max-width: 1400px; margin: 0 auto; padding: 28px 32px; position: relative; z-index: 1; }

/* ── Page Header ────────────────────────────────── */
.page-header { margin-bottom: 28px; animation: slideUp .3s cubic-bezier(.16,1,.3,1); }
.page-header-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.page-title {
  font-size: 24px; font-weight: 800; letter-spacing: -.03em;
  background: linear-gradient(135deg, #f0f2f8 0%, #d4ccff 30%, #c4b5fd 60%, #a78bfa 100%);
  background-size: 200% 200%; animation: gradientShift 6s ease infinite;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.page-desc { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 12px; }

.last-updated {
  font-size: 10px; color: var(--text-dim); animation: breathe 3s ease-in-out infinite;
}
.last-updated::before {
  content: ''; display: inline-block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--success); margin-right: 6px; vertical-align: middle;
  box-shadow: 0 0 6px var(--success);
  animation: dotPulse 2s ease-in-out infinite;
}
.refresh-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s cubic-bezier(.16,1,.3,1);
}
.refresh-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); box-shadow: var(--shadow-glow), 0 0 20px rgba(124,108,246,.15); transform: rotate(45deg) scale(1.1); }
.refresh-btn:active { transform: rotate(180deg) scale(.9); transition: transform .15s; }
.refresh-btn.loading svg { animation: spin .8s linear infinite; }

/* Date Filter Bar */
.date-filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 14px 18px; border-radius: var(--radius);
  background: rgba(12,14,22,.85); border: 1px solid rgba(124,108,246,.06);
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.preset-pills { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.pill {
  padding: 7px 16px; border-radius: 100px; border: 1px solid transparent;
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .2s cubic-bezier(.16,1,.3,1);
  background: none; color: var(--text-muted);
}
.pill:hover { color: var(--text-secondary); background: var(--bg-hover); border-color: var(--border); }
.pill.active {
  background: linear-gradient(135deg, #7c6cf6 0%, #a78bfa 50%, #c4b5fd 100%);
  background-size: 200% 200%; animation: gradientShift 3s ease infinite;
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 20px rgba(124,108,246,.35), inset 0 1px 0 rgba(255,255,255,.15);
  transform: scale(1.05);
}
.pill:active { transform: scale(.95); }
.custom-range { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; }
.custom-range input {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-xs); padding: 7px 12px;
  color: var(--text); font-family: var(--font-mono); font-size: 11px;
  outline: none; transition: all .2s;
}
.custom-range input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }

/* ── Cards ──────────────────────────────────────── */
.card {
  background: linear-gradient(145deg, rgba(17,19,32,.95) 0%, rgba(14,16,28,.92) 100%);
  border: 1px solid rgba(124,108,246,.06);
  border-radius: var(--radius); padding: 22px;
  transition: all .35s cubic-bezier(.16,1,.3,1);
  position: relative;
}
.card::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit;
  background: linear-gradient(135deg, rgba(124,108,246,.08), rgba(167,139,250,.04), transparent 70%);
  pointer-events: none; z-index: 0; opacity: 0; transition: opacity .4s;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude; -webkit-mask-composite: xor;
  padding: 1px;
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: rgba(124,108,246,.15); box-shadow: 0 4px 20px rgba(0,0,0,.2), 0 0 1px rgba(124,108,246,.2); transform: translateY(-2px); }
.card-hover:hover { transform: translateY(-5px) scale(1.005); box-shadow: var(--shadow-md), 0 0 40px rgba(124,108,246,.08), 0 0 1px rgba(124,108,246,.3); }
.card-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--text-muted); margin-bottom: 18px; position: relative; z-index: 1; }

/* ── KPI Cards ──────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.kpi-card {
  background: linear-gradient(145deg, rgba(17,19,32,.95) 0%, rgba(14,16,28,.92) 100%);
  border: 1px solid rgba(124,108,246,.05);
  border-radius: var(--radius); padding: 18px 20px;
  border-top: 2px solid var(--accent);
  transition: all .35s cubic-bezier(.16,1,.3,1);
  animation: slideUp .45s cubic-bezier(.16,1,.3,1) backwards;
  position: relative; overflow: hidden;
}
.kpi-card:nth-child(1) { animation-delay: .05s; }
.kpi-card:nth-child(2) { animation-delay: .1s; }
.kpi-card:nth-child(3) { animation-delay: .15s; }
.kpi-card:nth-child(4) { animation-delay: .2s; }
.kpi-card:nth-child(5) { animation-delay: .25s; }
.kpi-card:nth-child(6) { animation-delay: .3s; }
.kpi-card:nth-child(7) { animation-delay: .35s; }
.kpi-card:nth-child(8) { animation-delay: .4s; }
.kpi-card:nth-child(9) { animation-delay: .45s; }
.kpi-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(180deg, rgba(124,108,246,.06) 0%, transparent 100%);
  pointer-events: none;
}
/* Edge lighting — top edge glow */
.kpi-card::before {
  content: ''; position: absolute; top: -1px; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,108,246,.4), transparent);
  pointer-events: none; z-index: 2;
}
.kpi-card:hover {
  border-color: rgba(124,108,246,.18);
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 20px 50px rgba(0,0,0,.25), 0 0 30px rgba(124,108,246,.12), inset 0 1px 0 rgba(124,108,246,.1);
}
.kpi-card:hover::before {
  animation: edgePulse 2s ease-in-out infinite;
  background: linear-gradient(90deg, transparent, rgba(124,108,246,.6), transparent);
}
.kpi-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: 8px; position: relative; z-index: 1; }
.kpi-value { font-size: 26px; font-weight: 700; font-family: var(--font-mono); color: var(--text); line-height: 1; position: relative; z-index: 1; }
.kpi-sub { font-size: 10px; color: var(--text-dim); margin-top: 8px; position: relative; z-index: 1; }
.kpi-delta { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px; animation: fadeIn .6s .3s backwards; }
.kpi-delta-good { color: var(--success); background: var(--success-dim); animation: fadeIn .6s .3s backwards; }
.kpi-delta-bad { color: var(--danger); background: var(--danger-dim); animation: fadeIn .6s .3s backwards; }

.kpi-group-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 12px;
  position: relative; display: inline-block;
}
.kpi-group-title::after {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin-left: 8px; vertical-align: middle;
  animation: dotPulse 2.5s ease-in-out infinite;
}

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; animation: fadeIn .15s ease-out;
}
.modal-card {
  background: var(--bg-card-elevated); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 24px; width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg); animation: slideUp .2s cubic-bezier(.16,1,.3,1);
}

/* ── Workflow Alerts ─────────────────────────────── */
.alert-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
  transition: all .2s; position: relative;
}
.alert-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.alert-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.alert-icon { font-size: 16px; line-height: 1; }
.alert-severity { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 4px; }
.alert-title { font-size: 13px; font-weight: 600; color: var(--text); }
.alert-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

/* ── Decision Engine ─────────────────────────────── */
.decision-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600;
  white-space: nowrap; letter-spacing: .02em;
  border: 1px solid currentColor; border-opacity: .2;
}

/* ── Gradient section divider ────────────────────── */
.section-divider {
  height: 1px; border: none; margin: 28px 0;
  background: linear-gradient(90deg, transparent 0%, rgba(124,108,246,.15) 30%, rgba(167,139,250,.15) 70%, transparent 100%);
}

/* ── Metrics Calculator ──────────────────────────── */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.metric-calc-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  transition: all .25s cubic-bezier(.16,1,.3,1);
  position: relative; overflow: hidden;
}
.metric-calc-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.metric-calc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.metric-calc-icon { font-size: 20px; line-height: 1; }
.metric-calc-label { font-size: 12px; font-weight: 700; color: var(--text); letter-spacing: .02em; }
.metric-calc-desc { font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.metric-calc-value { font-size: 28px; font-weight: 800; font-family: var(--font-mono); color: var(--text); line-height: 1; margin-bottom: 10px; }
.metric-calc-formula {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border-radius: var(--radius-xs);
  background: var(--bg-hover); border: 1px solid var(--border);
}
.metric-calc-formula-label { font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.metric-calc-formula-nums { font-size: 11px; font-family: var(--font-mono); color: var(--text-muted); }

/* Hero metric (CPA) */
.metric-hero {
  border-top: 2px solid #f472b6;
  grid-column: span 2;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(244,114,182,.03) 100%);
}
.metric-hero::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(180deg, rgba(244,114,182,.05) 0%, transparent 100%);
  pointer-events: none;
}
.metric-hero-value { font-size: 36px; color: #f472b6; }
@media(max-width:768px) { .metric-hero { grid-column: span 1; } .metrics-grid { grid-template-columns: repeat(2, 1fr); } }

/* Funnel progress bars */
.funnel-bar-bg { height: 6px; border-radius: 3px; background: var(--bg-hover); overflow: hidden; position: relative; }
.funnel-bar-fill {
  height: 100%; border-radius: 3px; min-width: 2px;
  animation: barGrow .8s cubic-bezier(.16,1,.3,1) backwards;
  position: relative;
}
.funnel-bar-fill::after {
  content: ''; position: absolute; top: 0; right: 0; width: 6px; height: 100%;
  border-radius: 50%; background: inherit; filter: brightness(1.5);
  animation: dotPulse 2s ease-in-out infinite;
}

/* ── Buttons ────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 20px; border-radius: var(--radius-sm); border: none;
  background: linear-gradient(135deg, #7c6cf6 0%, #a78bfa 50%, #c4b5fd 100%);
  background-size: 200% 200%; animation: gradientShift 3s ease infinite;
  color: #fff; font-weight: 600;
  font-family: var(--font-sans); font-size: 13px;
  cursor: pointer; transition: all .25s cubic-bezier(.16,1,.3,1);
  box-shadow: 0 4px 20px rgba(124,108,246,.3), inset 0 1px 0 rgba(255,255,255,.15);
  position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.1) 50%, transparent 60%);
  background-size: 250% 250%;
  transition: background-position .5s;
}
.btn-primary:hover::after { background-position: 100% 100%; }
.btn-primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 32px rgba(124,108,246,.4), inset 0 1px 0 rgba(255,255,255,.2); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; filter: none; }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 18px; border-radius: var(--radius-sm);
  background: var(--bg-hover); color: var(--text-secondary);
  border: 1px solid var(--border-light); font-weight: 500;
  font-family: var(--font-sans); font-size: 13px;
  cursor: pointer; transition: all .15s;
}
.btn-secondary:hover { color: var(--text); border-color: var(--border-subtle); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  background: none; border: none; color: var(--text-muted);
  font-family: var(--font-sans); font-size: 13px;
  cursor: pointer; transition: all .15s;
}
.btn-ghost:hover { color: var(--text-secondary); background: var(--bg-hover); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }
.btn-full { width: 100%; }

/* ── Badges ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 500;
  border: 1px solid;
}
.badge-success { background: rgba(34,197,94,.1); color: var(--success); border-color: rgba(34,197,94,.2); }
.badge-danger { background: rgba(239,68,68,.1); color: var(--danger); border-color: rgba(239,68,68,.2); }
.badge-muted { background: var(--bg-hover); color: var(--text-dim); border-color: var(--border); }
.badge-accent { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent-glow); }

.delta-good { background: rgba(34,197,94,.1); color: var(--success); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.delta-bad { background: rgba(239,68,68,.1); color: var(--danger); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }

/* ── Tables ─────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th {
  text-align: left; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim); padding: 12px 16px;
  border-bottom: 1px solid rgba(124,108,246,.06);
  background: rgba(12,14,22,.95);
  white-space: nowrap;
  cursor: pointer; user-select: none; transition: color .2s;
  position: sticky; top: 0; z-index: 2;
}
table th::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,108,246,.1), transparent);
}
table th:hover { color: var(--text-secondary); }
table th.sort-active { color: var(--accent); }
table td {
  padding: 11px 16px; border-bottom: 1px solid rgba(30,33,48,.6);
  color: var(--text-secondary); white-space: nowrap; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; transition: background .15s;
}
table tr:hover td { background: rgba(124,108,246,.03); }
table tr:last-child td { border-bottom: none; }
table tbody tr { transition: background .15s; }
table tbody tr:nth-child(even) td { background: rgba(15,17,23,.4); }
table tbody tr:nth-child(even):hover td { background: rgba(124,108,246,.04); }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-top: 1px solid var(--border); }
.pagination-info { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }
.pagination-btns { display: flex; gap: 6px; }
.pagination-btns button {
  padding: 7px 14px; border-radius: var(--radius-xs);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-muted); font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all .2s cubic-bezier(.16,1,.3,1);
}
.pagination-btns button:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); background: var(--accent-subtle); }
.pagination-btns button:disabled { opacity: .25; cursor: not-allowed; }

/* ── Tabs ───────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 8px; }
.tab-btn {
  padding: 12px 18px; border: none; background: none;
  color: var(--text-muted); font-family: var(--font-sans);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all .2s cubic-bezier(.16,1,.3,1); position: relative;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--accent-hover); border-bottom-color: var(--accent); }

/* ── Drill-down rows ────────────────────────────── */
.drill-row {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 20px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-card);
  cursor: pointer; transition: all .25s cubic-bezier(.16,1,.3,1);
  animation: slideUp .3s cubic-bezier(.16,1,.3,1) backwards;
  position: relative; overflow: hidden;
}
.drill-row::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(124,108,246,.02) 100%);
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.drill-row:hover { border-color: var(--border-light); transform: translateX(6px); box-shadow: var(--shadow-sm), -4px 0 12px rgba(124,108,246,.06); }
.drill-row:hover::before { opacity: 1; }
.drill-row .color-bar { width: 3px; height: 36px; border-radius: 2px; flex-shrink: 0; box-shadow: 0 0 8px currentColor; }
.drill-row .row-info { flex: 1; min-width: 0; }
.drill-row .row-name { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drill-row .row-sub { font-size: 10px; color: var(--text-dim); margin-top: 3px; letter-spacing: .02em; }
.drill-row .row-metrics { display: none; grid-template-columns: repeat(4, 1fr); gap: 28px; text-align: right; }
.drill-row .metric-label { font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.drill-row .metric-value { font-size: 14px; font-family: var(--font-mono); color: var(--text-secondary); font-weight: 500; }
.drill-row .chevron { color: var(--text-dim); transition: all .25s; flex-shrink: 0; }
.drill-row:hover .chevron { color: var(--accent); transform: translateX(3px); }
@media(min-width:768px) { .drill-row .row-metrics { display: grid; } }

/* ── Breadcrumb ─────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-dim); text-decoration: none; transition: color .2s; padding: 2px 6px; border-radius: 4px; margin: -2px -6px; }
.breadcrumb a:hover { color: var(--accent); background: var(--accent-subtle); }
.breadcrumb .bc-sep { font-size: 10px; opacity: .5; }
.breadcrumb .bc-current { color: var(--text-secondary); font-weight: 500; }

/* ── Back button ────────────────────────────────── */
.back-btn {
  padding: 8px; border-radius: var(--radius-sm);
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.back-btn:hover { background: var(--bg-hover); color: var(--text-secondary); }

/* ── Charts ─────────────────────────────────────── */
.charts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 16px; margin-top: 8px; }
@media(max-width:560px) { .charts-grid { grid-template-columns: 1fr; } }
.chart-container { position: relative; height: 300px; }

/* ── Form elements ──────────────────────────────── */
.form-label { display: block; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 11px 16px; border-radius: var(--radius-sm);
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-sans); font-size: 13px;
  outline: none; transition: all .2s;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle), var(--shadow-glow); transform: translateY(-1px); }
.form-input::placeholder { color: var(--text-dim); }
.form-select {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border-light);
  color: var(--text); font-family: var(--font-sans); font-size: 13px;
  outline: none; cursor: pointer; transition: border-color .15s;
}
.form-select:focus { border-color: var(--accent); }

/* ── Segment controls ───────────────────────────── */
.segment-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 20px; }
.btn-group { display: flex; }
.btn-group button {
  padding: 6px 14px; border: 1px solid var(--border-light);
  background: var(--bg-card); color: var(--text-muted);
  font-family: var(--font-sans); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .15s; margin-left: -1px;
}
.btn-group button:first-child { border-radius: var(--radius-xs) 0 0 var(--radius-xs); margin-left: 0; }
.btn-group button:last-child { border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
.btn-group button.active { background: var(--accent); border-color: var(--accent); color: #fff; z-index: 1; }
.btn-group button:hover:not(.active) { color: var(--text-secondary); }

/* ── Compare ────────────────────────────────────── */
.compare-pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media(max-width:600px) { .compare-pickers { grid-template-columns: 1fr; } }
.period-picker { padding: 20px; border-top-width: 2px; }
.period-letter { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 12px; }
.period-dates { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.period-dates input {
  flex: 1; padding: 8px 10px; border-radius: var(--radius-xs);
  background: var(--bg-secondary); border: 1px solid var(--border-light);
  color: var(--text); font-family: var(--font-mono); font-size: 11px;
  outline: none; transition: border-color .15s;
}
.period-dates input:focus { border-color: var(--accent); }

/* ── Changelog ──────────────────────────────────── */
.changelog-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.type-pill {
  padding: 6px 14px; border-radius: 100px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); background: none;
  color: var(--text-secondary); cursor: pointer; transition: all .15s;
}
.type-pill:hover { color: var(--text); }
.type-pill.active { border-color: currentColor; }

.changelog-entry {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 18px 22px; border-bottom: 1px solid rgba(30,33,48,.5);
  transition: all .25s cubic-bezier(.16,1,.3,1); animation: slideInRight .3s cubic-bezier(.16,1,.3,1) backwards;
}
.changelog-entry:nth-child(2) { animation-delay: .05s; }
.changelog-entry:nth-child(3) { animation-delay: .1s; }
.changelog-entry:nth-child(4) { animation-delay: .15s; }
.changelog-entry:nth-child(5) { animation-delay: .2s; }
.changelog-entry:hover { background: rgba(124,108,246,.03); transform: translateX(4px); }
.changelog-entry:last-child { border-bottom: none; }
.entry-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 14px;
}
.entry-body { flex: 1; min-width: 0; }
.entry-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.entry-type { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.entry-author { font-size: 10px; color: var(--accent); font-weight: 500; background: var(--accent-subtle); padding: 1px 8px; border-radius: 100px; }
.entry-date { font-size: 10px; color: var(--text-dim); }
.entry-desc { font-size: 13px; color: var(--text-secondary); }
.entry-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.changelog-entry:hover .entry-actions { opacity: 1; }
.entry-edit, .entry-delete {
  padding: 6px; border-radius: 6px;
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; transition: all .15s;
}
.entry-edit:hover { background: var(--bg-hover); color: var(--accent); }
.entry-delete:hover { background: var(--bg-hover); color: var(--danger); }

.changelog-form {
  padding: 20px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 20px;
  animation: slideUp .2s ease-out;
}
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-row > div { flex: 1; }

/* ── Empty State ────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 64px 24px;
  color: var(--text-dim); text-align: center;
}
.empty-icon {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--bg-hover); display: flex; align-items: center;
  justify-content: center; margin-bottom: 20px; color: var(--text-dim);
  border: 1px solid var(--border);
}
.empty-title { font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.empty-desc { font-size: 12px; color: var(--text-dim); max-width: 340px; line-height: 1.7; }

/* ── Loading skeleton ───────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--border) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── Setup Screen ───────────────────────────────── */
/* ── Setup Overlay — Split Panel Layout ──────────── */
.setup-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: #020204;
  display: grid; grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
}

/* Glow orbs — organic floating motion */
@keyframes orbFloat1 { 0%,100% { transform: translate(0,0) scale(1); } 25% { transform: translate(80px,-60px) scale(1.1); } 50% { transform: translate(-40px,-100px) scale(.95); } 75% { transform: translate(-80px,40px) scale(1.05); } }
@keyframes orbFloat2 { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(-100px,70px) scale(1.15); } 66% { transform: translate(60px,-80px) scale(.9); } }
@keyframes orbFloat3 { 0%,100% { transform: translate(0,0) scale(1); } 20% { transform: translate(50px,80px) scale(1.1); } 50% { transform: translate(-70px,-40px) scale(.95); } 80% { transform: translate(90px,-60px) scale(1.05); } }
@keyframes particleFloat { 0%,100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-80px) translateX(var(--drift,20px)); } }
@keyframes particleFade { 0%,100% { opacity: 0; } 20%,80% { opacity: 1; } }
@keyframes auroraWave { 0% { transform: translateX(-30%) skewX(-5deg); } 50% { transform: translateX(30%) skewX(5deg); } 100% { transform: translateX(-30%) skewX(-5deg); } }

.setup-glow-1 { position: fixed; top: 8%; left: 5%; width: 900px; height: 900px; background: radial-gradient(circle, rgba(124,108,246,.3) 0%, rgba(124,108,246,.08) 40%, transparent 70%); border-radius: 50%; opacity: .7; pointer-events: none; animation: orbFloat1 20s ease-in-out infinite; }
.setup-glow-2 { position: fixed; bottom: 0; right: 5%; width: 800px; height: 800px; background: radial-gradient(circle, rgba(167,139,250,.25) 0%, rgba(167,139,250,.06) 40%, transparent 70%); border-radius: 50%; opacity: .7; pointer-events: none; animation: orbFloat2 25s ease-in-out infinite; }
.setup-glow-3 { position: fixed; top: 40%; left: 55%; width: 700px; height: 700px; background: radial-gradient(circle, rgba(244,114,182,.18) 0%, rgba(244,114,182,.04) 40%, transparent 60%); border-radius: 50%; opacity: .7; pointer-events: none; animation: orbFloat3 22s ease-in-out infinite; }

/* Aurora beams */
.setup-aurora { position: fixed; inset: 0; pointer-events: none; overflow: hidden; opacity: .7; }
.setup-aurora::before {
  content: ''; position: absolute; top: -50%; left: -30%; width: 160%; height: 200%;
  background: linear-gradient(180deg, transparent 25%, rgba(124,108,246,.06) 35%, rgba(167,139,250,.08) 45%, rgba(124,108,246,.05) 55%, transparent 65%);
  animation: auroraWave 16s ease-in-out infinite; opacity: .7;
}
.setup-aurora::after {
  content: ''; position: absolute; top: -40%; left: 5%; width: 130%; height: 200%;
  background: linear-gradient(160deg, transparent 30%, rgba(52,211,153,.04) 40%, rgba(34,211,238,.06) 50%, rgba(244,114,182,.03) 60%, transparent 70%);
  animation: auroraWave 22s ease-in-out infinite reverse; opacity: .6;
}

/* Smoke/fog */
@keyframes smokeDrift1 { 0% { transform: translate(-20%,-10%) scale(1) rotate(0deg); opacity:.4; } 25% { opacity:.6; } 50% { transform: translate(15%,8%) scale(1.3) rotate(20deg); opacity:.3; } 75% { opacity:.5; } 100% { transform: translate(-20%,-10%) scale(1) rotate(0deg); opacity:.4; } }
@keyframes smokeDrift2 { 0% { transform: translate(10%,5%) scale(1.1) rotate(0deg); opacity:.3; } 50% { transform: translate(-25%,-15%) scale(1.4) rotate(-15deg); opacity:.5; } 100% { transform: translate(10%,5%) scale(1.1) rotate(0deg); opacity:.3; } }
@keyframes smokeDrift3 { 0% { transform: translate(0,0) scale(1) rotate(5deg); opacity:.35; } 33% { transform: translate(20%,10%) scale(1.2) rotate(-10deg); opacity:.5; } 66% { transform: translate(-15%,5%) scale(1.1) rotate(15deg); opacity:.25; } 100% { transform: translate(0,0) scale(1) rotate(5deg); opacity:.35; } }
@keyframes smokeRise { 0% { transform: translateY(10%) scale(1); opacity:.3; } 50% { transform: translateY(-15%) scale(1.5); opacity:.5; } 100% { transform: translateY(10%) scale(1); opacity:.3; } }
.setup-smoke { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.smoke-cloud { position: absolute; border-radius: 50%; opacity: .5; }
.s1 { width: 1100px; height: 800px; top: -15%; left: -10%; background: radial-gradient(ellipse, rgba(124,108,246,.35) 0%, rgba(124,108,246,.12) 40%, transparent 70%); animation: smokeDrift1 30s ease-in-out infinite; }
.s2 { width: 1200px; height: 900px; bottom: -20%; right: -15%; background: radial-gradient(ellipse, rgba(167,139,250,.3) 0%, rgba(167,139,250,.08) 40%, transparent 70%); animation: smokeDrift2 35s ease-in-out infinite; }
.s3 { width: 1000px; height: 700px; top: 30%; left: 20%; background: radial-gradient(ellipse, rgba(244,114,182,.2) 0%, rgba(244,114,182,.06) 40%, transparent 70%); animation: smokeDrift3 28s ease-in-out infinite; }
.s4 { width: 1400px; height: 1000px; top: -10%; right: -20%; background: radial-gradient(ellipse, rgba(52,211,153,.15) 0%, rgba(52,211,153,.04) 40%, transparent 60%); animation: smokeDrift1 40s ease-in-out infinite reverse; opacity: .4; }
.s5 { width: 900px; height: 900px; bottom: 10%; left: -5%; background: radial-gradient(ellipse, rgba(124,108,246,.25) 0%, rgba(196,181,253,.08) 40%, transparent 65%); animation: smokeRise 25s ease-in-out infinite; opacity: .45; }
.s6 { width: 1300px; height: 800px; top: 50%; left: 40%; background: radial-gradient(ellipse, rgba(167,139,250,.2) 0%, rgba(167,139,250,.05) 40%, transparent 60%); animation: smokeDrift2 32s ease-in-out infinite 5s; opacity: .35; }
.s7 { width: 1000px; height: 1100px; bottom: -25%; right: 30%; background: radial-gradient(ellipse, rgba(124,108,246,.18) 0%, rgba(52,211,153,.08) 30%, transparent 65%); animation: smokeRise 38s ease-in-out infinite 8s; opacity: .3; }

/* Stars & meteors */
@keyframes twinkle { 0%,100% { opacity:.15; transform:scale(.8); } 50% { opacity:.8; transform:scale(1.2); } }
.setup-stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.star { position: absolute; border-radius: 50%; background: #fff; }

@keyframes meteorShoot { 0% { transform: translate(0,0) rotate(-35deg); opacity:0; } 5% { opacity:1; } 30% { opacity:1; } 100% { transform: translate(-800px,600px) rotate(-35deg); opacity:0; } }
.setup-meteors { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.meteor { position: absolute; width: 2px; height: 2px; background: #fff; border-radius: 50%; box-shadow: 0 0 6px 2px rgba(196,181,253,.6), -80px 0 60px 1px rgba(167,139,250,.3), -160px 0 100px rgba(124,108,246,.15); }
.meteor::after { content: ''; position: absolute; top: 0; left: 0; width: 200px; height: 1px; background: linear-gradient(90deg, rgba(196,181,253,.6), transparent); transform-origin: left center; }
.m1 { top: 8%; right: -5%; animation: meteorShoot 6s ease-in 1s infinite; }
.m2 { top: 18%; right: -10%; animation: meteorShoot 8s ease-in 4s infinite; }
.m3 { top: 5%; right: 15%; animation: meteorShoot 7s ease-in 8s infinite; }
.m4 { top: 30%; right: -8%; animation: meteorShoot 9s ease-in 12s infinite; }
.m5 { top: 12%; right: 30%; animation: meteorShoot 5s ease-in 16s infinite; }

/* Particles */
.setup-particles { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.particle { position: absolute; border-radius: 50%; }

/* ── Brand Panel (left side) ──────────────────────── */
@keyframes brandFadeIn { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes dataBarGrow { from { width: 0; opacity: 0; } to { width: var(--w); opacity: 1; } }
@keyframes statFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.setup-brand-panel {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; justify-content: center;
  padding: 80px 60px 80px 80px;
  animation: brandFadeIn .8s cubic-bezier(.16,1,.3,1) .1s both;
}
.setup-brand-panel .setup-logo-wrap {
  position: relative; width: 56px; height: 56px; margin-bottom: 32px;
}
.setup-brand-panel .setup-logo-glow {
  position: absolute; inset: -8px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(124,108,246,.3), rgba(167,139,250,.2));
  opacity: .6; animation: pulseGlow 3s ease-in-out infinite;
}
.setup-brand-panel .setup-logo {
  position: relative; width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, #7c6cf6 0%, #a78bfa 40%, #c4b5fd 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 32px rgba(124,108,246,.4), inset 0 1px 0 rgba(255,255,255,.2);
}
.setup-brand-panel .setup-logo svg { width: 28px; height: 28px; }
.setup-title {
  font-size: 56px; font-weight: 800; letter-spacing: -.05em; line-height: 1;
  background: linear-gradient(135deg, #ffffff 0%, #e8e0ff 30%, #c4b5fd 70%, #a78bfa 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 8px;
  text-shadow: none;
  animation: brandFadeIn .8s cubic-bezier(.16,1,.3,1) .2s both;
}
.setup-sub-fancy {
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(167,139,250,.7);
  margin-bottom: 20px;
  animation: brandFadeIn .8s cubic-bezier(.16,1,.3,1) .3s both;
}
.setup-desc {
  font-size: 15px; color: var(--text-muted); line-height: 1.7; max-width: 380px;
  margin-bottom: 0;
  animation: brandFadeIn .8s cubic-bezier(.16,1,.3,1) .35s both;
}

/* Abstract graph visualization */
@keyframes meshAxisDraw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
@keyframes meshGridFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes meshCurveFlow { from { stroke-dashoffset: 800; } to { stroke-dashoffset: 0; } }
@keyframes meshAreaReveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes meshNodePop { 0%,100% { opacity: .4; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.3); } }
@keyframes meshScan { 0% { left: -15%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { left: 105%; opacity: 0; } }

.setup-mesh {
  margin-top: 48px; max-width: 400px; position: relative; overflow: hidden;
  border-radius: 12px; padding: 8px;
  background: rgba(124,108,246,.02);
  border: 1px solid rgba(124,108,246,.06);
  animation: brandFadeIn .8s cubic-bezier(.16,1,.3,1) .5s both;
}
.mesh-svg { width: 100%; height: auto; display: block; }

/* Axes */
.mesh-axis {
  stroke: rgba(124,108,246,.2); stroke-width: 1;
  stroke-dasharray: 400; stroke-dashoffset: 400;
  animation: meshAxisDraw 1s cubic-bezier(.16,1,.3,1) .6s both;
}
.mesh-tick {
  stroke: rgba(124,108,246,.25); stroke-width: 1;
  opacity: 0; animation: meshGridFade .4s ease .9s both;
}

/* Horizontal grid lines */
.mesh-grid {
  stroke: rgba(124,108,246,.06); stroke-width: 0.5;
  stroke-dasharray: 4 4;
  opacity: 0; animation: meshGridFade .5s ease both;
}
.mg1 { animation-delay: 1s; }
.mg2 { animation-delay: 1.1s; }
.mg3 { animation-delay: 1.2s; }

/* Area fills */
.mesh-area { opacity: 0; animation: meshAreaReveal .8s ease both; }
.ma1 { fill: url(#areaFill1); animation-delay: 1.6s; }
.ma2 { fill: url(#areaFill2); animation-delay: 1.9s; }

/* Line curves */
.mesh-curve {
  stroke-width: 2; fill: none;
  stroke-dasharray: 800; stroke-dashoffset: 800;
  animation: meshCurveFlow 2s cubic-bezier(.16,1,.3,1) both;
  stroke-linecap: round;
}
.mc1 { stroke: rgba(124,108,246,.6); animation-delay: 1.3s; }
.mc2 { stroke: rgba(244,114,182,.35); animation-delay: 1.6s; stroke-width: 1.5; }

/* Data point nodes */
.mesh-node {
  fill: #7c6cf6; opacity: 0;
  transform-origin: center; transform-box: fill-box;
  animation: meshNodePop 3s ease-in-out infinite;
}
.mn1 { animation-delay: 1.6s; }
.mn2 { animation-delay: 1.8s; fill: #a78bfa; }
.mn3 { animation-delay: 2s; fill: #a78bfa; }
.mn4 { animation-delay: 2.2s; }
.mn5 { animation-delay: 2.1s; fill: #f472b6; }
.mn6 { animation-delay: 2.4s; fill: #f472b6; }

/* Scanning line */
.mesh-scan {
  position: absolute; top: 0; bottom: 0; width: 80px; left: -15%;
  background: linear-gradient(90deg, transparent, rgba(124,108,246,.15), transparent);
  animation: meshScan 5s ease-in-out 3s infinite;
  pointer-events: none;
}

/* ── Connection Card (right side) ─────────────────── */
@keyframes cardSlideIn { from { opacity: 0; transform: translateX(32px); } to { opacity: 1; transform: translateX(0); } }
@keyframes edgeGlow { 0%,100% { opacity: .5; } 50% { opacity: 1; } }

.setup-card {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  animation: cardSlideIn .7s cubic-bezier(.16,1,.3,1) .3s both;
}
.setup-card-inner {
  width: 100%; max-width: 400px; position: relative;
  background: linear-gradient(150deg, rgba(17,19,32,.97) 0%, rgba(12,14,24,.95) 100%);
  border: 1px solid rgba(124,108,246,.1);
  border-radius: 20px;
  padding: 40px 36px 36px;
  box-shadow: 0 40px 80px rgba(0,0,0,.6), 0 0 60px rgba(124,108,246,.04);
}
/* Top edge glow */
.setup-card-edge {
  position: absolute; top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,108,246,.5), rgba(167,139,250,.3), transparent);
  animation: edgeGlow 3s ease-in-out infinite;
}
.setup-card-title {
  font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.02em;
  margin-bottom: 6px;
}
.setup-card-desc {
  font-size: 13px; color: var(--text-muted); margin-bottom: 28px; line-height: 1.6;
}
.setup-form { display: flex; flex-direction: column; gap: 14px; }
.setup-input-wrap { position: relative; display: flex; align-items: center; }
.setup-input-icon { position: absolute; left: 14px; color: var(--text-dim); z-index: 2; display: flex; }
.setup-url-input {
  width: 100%; padding: 14px 16px 14px 42px; border-radius: 12px;
  background: rgba(124,108,246,.04); border: 1px solid rgba(124,108,246,.1);
  color: var(--text); font-family: var(--font-mono); font-size: 13px;
  outline: none; transition: all .3s;
}
.setup-url-input:focus {
  border-color: rgba(124,108,246,.35);
  box-shadow: 0 0 0 4px rgba(124,108,246,.08), 0 0 24px rgba(124,108,246,.12);
  background: rgba(124,108,246,.06);
}
.setup-url-input::placeholder { color: var(--text-dim); }

/* Connect button */
.setup-connect-btn {
  width: 100%; padding: 14px 24px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, #7c6cf6 0%, #9b8fff 50%, #7c6cf6 100%);
  background-size: 200% 200%; animation: gradientShift 4s ease infinite;
  color: #fff; font-weight: 700; font-family: var(--font-sans); font-size: 14px;
  cursor: pointer; transition: all .3s cubic-bezier(.16,1,.3,1);
  box-shadow: 0 4px 20px rgba(124,108,246,.3);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  position: relative; overflow: hidden;
}
.setup-connect-btn::after {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  transition: left .6s;
}
.setup-connect-btn:hover::after { left: 100%; }
.setup-connect-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124,108,246,.45), 0 0 48px rgba(124,108,246,.15);
}
.setup-connect-btn:active { transform: translateY(0) scale(.98); }
.setup-connect-btn:disabled {
  opacity: 1; cursor: not-allowed; transform: none;
  background: linear-gradient(135deg, #5a4dd6 0%, #7c6cf6 100%);
}
.setup-connect-btn:disabled::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.setup-btn-text { position: relative; z-index: 1; }
.setup-btn-arrow { position: relative; z-index: 1; display: flex; align-items: center; transition: transform .2s; }
.setup-connect-btn:hover .setup-btn-arrow { transform: translateX(3px); }

/* Card footer */
.setup-card-footer {
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid rgba(124,108,246,.06);
  display: flex; justify-content: center;
}
.setup-security {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-dim); letter-spacing: .02em;
}
.setup-security svg { opacity: .5; }

/* Error */
.setup-error {
  background: rgba(248,113,113,.06); border: 1px solid rgba(248,113,113,.12);
  border-radius: 10px; padding: 10px 14px;
  color: var(--danger); font-size: 12px;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 900px) {
  .setup-overlay {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .setup-brand-panel {
    padding: 48px 32px 24px;
    align-items: center; text-align: center;
  }
  .setup-title { font-size: 40px; }
  .setup-data-preview { display: none; }
  .setup-stats-row { justify-content: center; }
  .setup-card { padding: 24px; }
  .setup-desc { max-width: none; }
}
@media (max-width: 480px) {
  .setup-brand-panel { padding: 36px 24px 16px; }
  .setup-title { font-size: 32px; }
  .setup-stats-row { gap: 20px; }
  .setup-stat-value { font-size: 22px; }
  .setup-card { padding: 16px; }
  .setup-card-inner { padding: 28px 24px 24px; }
}

/* ── Sibling Links ──────────────────────────────── */
.sibling-links { display: flex; flex-wrap: wrap; gap: 8px; }
.sibling-link {
  padding: 6px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-muted); font-size: 12px;
  text-decoration: none; transition: all .15s;
  max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sibling-link:hover { color: var(--text-secondary); border-color: var(--border-light); }

/* ── Responsive ─────────────────────────────────── */
@media(max-width:768px) {
  .sidebar { width: 68px; }
  .sidebar-logo-text, .sidebar-link span { display: none; }
  .sidebar-logo { justify-content: center; padding: 0; }
  .sidebar-link { justify-content: center; padding: 12px; gap: 0; }
  .main-content { margin-left: 68px; }
  .page-content { padding: 16px 18px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 20px; }
  .compare-pickers { grid-template-columns: 1fr; }
  .page-title { font-size: 18px; }
  .charts-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ── Summary stat cards (campaign list) ─────────── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat-card {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
  animation: slideUp .3s cubic-bezier(.16,1,.3,1) backwards;
  transition: all .25s cubic-bezier(.16,1,.3,1);
}
.stat-card:hover { border-color: rgba(124,108,246,.15); transform: translateY(-4px); box-shadow: var(--shadow-md), 0 0 20px rgba(124,108,246,.06); }
.stat-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.stat-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 20px; font-weight: 700; font-family: var(--font-mono); color: var(--text); margin-top: 1px; }

/* ── Error banner ───────────────────────────────── */
.error-banner {
  padding: 14px 18px; border-radius: var(--radius);
  background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.15);
  color: var(--danger); font-size: 13px; margin-bottom: 20px;
}

/* ── Focus visible for accessibility ─────────────── */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Selection color ─────────────────────────────── */
::selection { background: rgba(124,108,246,.25); color: var(--text); }

/* ── Smooth scroll ──────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── Connected status dot ────────────────────────── */
.status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success); display: inline-block;
  box-shadow: 0 0 6px var(--success);
  animation: breathe 2s ease-in-out infinite;
}

/* ── Loading spinner (dashboard) ─────────────────── */
.loading-spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Value highlighting ──────────────────────────── */
.value-positive { color: var(--success); }
.value-negative { color: var(--danger); }
.value-neutral { color: var(--text-secondary); }

/* ── Campaign Manager Tree ────────────────────────── */
.tree-container { display: flex; flex-direction: column; gap: 4px; }

.tree-row {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all .2s cubic-bezier(.16,1,.3,1);
}
.tree-row-l0 { padding-left: 8px; }
.tree-row-l1 { padding-left: 40px; }
.tree-row-l2 { padding-left: 72px; }

.tree-chevron {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; flex-shrink: 0;
  transition: transform .2s cubic-bezier(.16,1,.3,1);
  color: var(--text-dim);
}
.tree-chevron.expanded { transform: rotate(90deg); }
.tree-chevron svg { width: 14px; height: 14px; }
.tree-chevron-spacer { width: 20px; flex-shrink: 0; }

.tree-metrics {
  display: flex; gap: 16px; flex-shrink: 0;
}
.tree-metric {
  font-size: 11px; font-family: var(--font-mono); color: var(--text-secondary);
  white-space: nowrap;
}

.tree-badges {
  display: flex; gap: 6px; align-items: center; flex-shrink: 0;
}
.cm-badge {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 100px; letter-spacing: .02em;
}
.cm-active { background: rgba(34,197,94,.1); color: #22c55e; }
.cm-paused { background: rgba(239,68,68,.1); color: #ef4444; }
.cm-budget { background: rgba(251,191,36,.1); color: #fbbf24; }
.cm-note-dot { font-size: 12px; cursor: help; }

.tree-edit-btn {
  width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid transparent; background: none;
  color: var(--text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; flex-shrink: 0; opacity: 0;
}
.tree-edit-btn svg { width: 14px; height: 14px; }
.tree-row:hover .tree-edit-btn { opacity: 1; }
.tree-edit-btn:hover { border-color: var(--border); color: var(--text-secondary); background: var(--bg-hover); }

.tree-edit-panel {
  padding: 16px 20px; margin: 0 0 4px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: slideUp .25s cubic-bezier(.16,1,.3,1);
}
.tree-row-l0 + .tree-edit-panel { margin-left: 8px; }
.tree-row-l1 + .tree-edit-panel { margin-left: 40px; }
.tree-row-l2 + .tree-edit-panel { margin-left: 72px; }

/* Tabs */
.tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
}
.tab-btn {
  padding: 10px 20px; border: none; background: none;
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .2s;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active { color: var(--accent-hover); border-bottom-color: var(--accent); }
