:root {
  color-scheme: light;
  --brand: #6c5ce7;
  --brand-strong: #5746e1;
  --accent: #06d6a0;
  --glow: 0 20px 60px -25px rgba(108, 92, 231, 0.45);
  --aura-1: radial-gradient(circle at 20% 20%, rgba(108, 92, 231, 0.12), transparent 40%);
  --aura-2: radial-gradient(circle at 80% 10%, rgba(6, 214, 160, 0.12), transparent 38%);
  --aura-3: radial-gradient(circle at 40% 80%, rgba(14, 165, 233, 0.14), transparent 42%);
}

:root.dark {
  color-scheme: dark;
}

body {
  font-family: "Manrope", "Inter", system-ui, -apple-system, sans-serif;
  background: var(--aura-1), var(--aura-2), var(--aura-3), #f8fafc;
}

.dark body,
body.dark {
  background: var(--aura-1), var(--aura-2), var(--aura-3), #0f172a;
}

.glass-card {
  backdrop-filter: blur(12px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.55));
  box-shadow: var(--glow);
  z-index: 1;
  position: relative;
  overflow: visible;
}

.dark .glass-card {
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(17, 24, 39, 0.75));
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.75);
}

.lumi-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.65));
  box-shadow: 0 18px 40px -30px rgba(0, 0, 0, 0.4);
}

.dark .lumi-card {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.92), rgba(17, 24, 39, 0.78));
  border-color: rgba(51, 65, 85, 0.5);
}

.lumi-pill {
  border-radius: 9999px;
}

.lumi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.lumi-sidebar {
  transition: width 200ms ease, padding 200ms ease;
  overflow: visible;
  z-index: 2;
  border-right: 1px solid rgba(100, 116, 139, 0.5);
}

@media (max-width: 1023px) {
  .lumi-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 18rem;
    max-width: 90vw;
    transform: translateX(-105%);
    box-shadow: 0 20px 50px -25px rgba(0, 0, 0, 0.35);
    background: #fff;
    display: none;
  }
  body.mobile-nav-open .lumi-sidebar {
    transform: translateX(0);
    display: flex !important;
    z-index: 10000;
  }
  .mobile-overlay {
    display: none;
  }
  body.mobile-nav-open .mobile-overlay {
    display: block;
  }
}

body[data-compact="true"] .lumi-sidebar {
  width: 84px;
  padding-left: 14px;
  padding-right: 14px;
}

body[data-compact="true"] .lumi-nav-text,
body[data-compact="true"] .lumi-nav-chevron {
  display: none;
}

body[data-compact="true"] .lumi-submenu {
  padding-left: 0;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
}

.lumi-chevron {
  transition: transform 200ms ease;
}

.submenu-open .lumi-chevron {
  transform: rotate(90deg);
}

/* Utility fallback when CDN Tailwind is unavailable */
.bg-slate-100 {
  background-color: #f1f5f9 !important;
}

.lumi-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.22), rgba(6, 214, 160, 0.16));
  color: #fff;
  box-shadow: 0 12px 20px -14px rgba(0, 0, 0, 0.35);
}

.lumi-nav-icon svg {
  width: 16px;
  height: 16px;
}

.dark .lumi-nav-icon {
  box-shadow: 0 12px 20px -14px rgba(0, 0, 0, 0.65);
}

@media (max-width: 1024px) {
  html,
  body {
    overflow-x: hidden;
  }
  .chart-box {
    overflow: hidden;
  }
  canvas.lumi-chart {
    width: 100% !important;
    max-width: 100%;
  }
}

.floating-blob {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(108, 92, 231, 0.12), transparent 35%),
    radial-gradient(circle at 70% 60%, rgba(6, 214, 160, 0.12), transparent 35%),
    radial-gradient(circle at 80% 20%, rgba(94, 234, 212, 0.18), transparent 40%);
  filter: blur(30px);
  opacity: 0.9;
  pointer-events: none;
}

.dark .floating-blob {
  opacity: 0.6;
}

.chart-box {
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6));
}

.dark .chart-box {
  background: linear-gradient(145deg, rgba(19, 27, 45, 0.9), rgba(19, 27, 45, 0.7));
}

canvas.lumi-chart {
  width: 100%;
  height: 240px;
  display: block;
  max-width: 100%;
}

.lumi-scroll {
  scrollbar-width: none;
}

.lumi-scroll::-webkit-scrollbar {
  width: 0px;
  height: 0px;
}

.lumi-scroll::-webkit-scrollbar-thumb,
.lumi-scroll::-webkit-scrollbar-track {
  background: transparent;
  border: 0;
}

.submenu-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 260ms ease, padding 200ms ease;
  padding-top: 0;
  padding-bottom: 0;
}

.submenu-panel.open {
  max-height: 1200px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.badge-soft {
  background: rgba(108, 92, 231, 0.1);
  color: var(--brand);
}

.dark .badge-soft {
  background: rgba(108, 92, 231, 0.2);
}

/* Fallbacks for primary utility colors if Tailwind CDN misses them */
.bg-primary { background-color: #6c5ce7 !important; }
.text-primary { color: #6c5ce7 !important; }
.border-primary { border-color: #6c5ce7 !important; }
.bg-accent { background-color: #06d6a0 !important; }
.text-accent { color: #06d6a0 !important; }
.border-accent { border-color: #06d6a0 !important; }

.lumi-progress {
  position: relative;
  overflow: hidden;
}

.lumi-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shimmer 2.8s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.lumi-pill-glow {
  box-shadow: 0 10px 30px -16px rgba(6, 214, 160, 0.65);
}

/* Utility fallbacks for primary with opacity (keeps Tailwind-esque classes working even when CDN JIT misses) */
.bg-primary\/10 { background-color: rgba(108, 92, 231, 0.1) !important; }
.bg-primary\/5 { background-color: rgba(108, 92, 231, 0.05) !important; }
.border-primary\/20 { border-color: rgba(108, 92, 231, 0.2) !important; }

/* Gradient fallback when Tailwind CDN misses compound classes */
.bg-gradient-to-br.from-primary.via-sky-500.to-emerald-400 {
  background: linear-gradient(135deg, #6c5ce7, #38bdf8, #10b981) !important;
}

/* General gradient fallbacks (Tailwind-like) */
:root {
  --lumi-primary: #6c5ce7;
  --lumi-emerald: #10b981;
  --lumi-sky-400: #38bdf8;
  --lumi-sky-500: #0ea5e9;
  --lumi-sky-700: #0369a1;
  --lumi-indigo-500: #6366f1;
  --lumi-indigo-700: #4338ca;
  --lumi-amber-400: #fbbf24;
  --lumi-orange-400: #fb923c;
  --lumi-orange-500: #f97316;
  --lumi-lime-400: #a3e635;
  --lumi-lime-500: #84cc16;
  --lumi-cyan-500: #06b6d4;
  --lumi-rose-400: #fb7185;
  --lumi-slate-50: #f8fafc;
  --lumi-slate-900: #0f172a;
}

.bg-gradient-to-br {
  background-image: linear-gradient(
    to bottom right,
    var(
      --tw-gradient-stops,
      var(--tw-gradient-from, var(--lumi-primary)),
      var(--tw-gradient-to, var(--lumi-emerald))
    )
  ) !important;
}

.bg-gradient-to-r {
  background-image: linear-gradient(
    to right,
    var(
      --tw-gradient-stops,
      var(--tw-gradient-from, var(--lumi-primary)),
      var(--tw-gradient-to, var(--lumi-emerald))
    )
  ) !important;
}

/* FROM colors */
.from-primary { --tw-gradient-from: var(--lumi-primary); --tw-gradient-to: rgb(108 92 231 / 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-primary\/90 { --tw-gradient-from: rgba(108, 92, 231, 0.9); --tw-gradient-to: rgba(108, 92, 231, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-primary\/20 { --tw-gradient-from: rgba(108, 92, 231, 0.2); --tw-gradient-to: rgba(108, 92, 231, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-primary\/10 { --tw-gradient-from: rgba(108, 92, 231, 0.1); --tw-gradient-to: rgba(108, 92, 231, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-primary\/5 { --tw-gradient-from: rgba(108, 92, 231, 0.05); --tw-gradient-to: rgba(108, 92, 231, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-emerald-500 { --tw-gradient-from: var(--lumi-emerald); --tw-gradient-to: rgb(16 185 129 / 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-emerald\/20 { --tw-gradient-from: rgba(16, 185, 129, 0.2); --tw-gradient-to: rgba(16, 185, 129, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-emerald\/5 { --tw-gradient-from: rgba(16, 185, 129, 0.05); --tw-gradient-to: rgba(16, 185, 129, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-sky-400 { --tw-gradient-from: var(--lumi-sky-400); --tw-gradient-to: rgb(56 189 248 / 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-sky\/20 { --tw-gradient-from: rgba(14, 165, 233, 0.2); --tw-gradient-to: rgba(14, 165, 233, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-sky\/5 { --tw-gradient-from: rgba(14, 165, 233, 0.05); --tw-gradient-to: rgba(14, 165, 233, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-indigo-500 { --tw-gradient-from: var(--lumi-indigo-500); --tw-gradient-to: rgb(99 102 241 / 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-indigo-700 { --tw-gradient-from: var(--lumi-indigo-700); --tw-gradient-to: rgb(67 56 202 / 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-amber-400 { --tw-gradient-from: var(--lumi-amber-400); --tw-gradient-to: rgb(251 191 36 / 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-amber\/20 { --tw-gradient-from: rgba(245, 158, 11, 0.2); --tw-gradient-to: rgba(245, 158, 11, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-orange-400 { --tw-gradient-from: var(--lumi-orange-400); --tw-gradient-to: rgb(251 146 60 / 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-amber-400 { --tw-gradient-from: var(--lumi-amber-400); --tw-gradient-to: rgb(251 191 36 / 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-white { --tw-gradient-from: #ffffff; --tw-gradient-to: rgb(255 255 255 / 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.from-slate-900\/85 { --tw-gradient-from: rgba(15, 23, 42, 0.85); --tw-gradient-to: rgba(15, 23, 42, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }

/* VIA colors */
.via-primary { --tw-gradient-to: rgb(108 92 231 / 0); --tw-gradient-stops: var(--tw-gradient-from), var(--lumi-primary), var(--tw-gradient-to); }
.via-primary\/70 { --tw-gradient-to: rgba(108, 92, 231, 0); --tw-gradient-stops: var(--tw-gradient-from), rgba(108, 92, 231, 0.7), var(--tw-gradient-to); }
.via-primary\/60 { --tw-gradient-to: rgba(108, 92, 231, 0); --tw-gradient-stops: var(--tw-gradient-from), rgba(108, 92, 231, 0.6), var(--tw-gradient-to); }
.via-sky-500 { --tw-gradient-to: rgba(14, 165, 233, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--lumi-sky-500), var(--tw-gradient-to); }
.via-sky\/20 { --tw-gradient-to: rgba(14, 165, 233, 0); --tw-gradient-stops: var(--tw-gradient-from), rgba(14, 165, 233, 0.2), var(--tw-gradient-to); }
.via-slate-50 { --tw-gradient-to: rgba(248, 250, 252, 0); --tw-gradient-stops: var(--tw-gradient-from), var(--lumi-slate-50), var(--tw-gradient-to); }
.via-white { --tw-gradient-to: rgba(255, 255, 255, 0); --tw-gradient-stops: var(--tw-gradient-from), #ffffff, var(--tw-gradient-to); }
.via-emerald-400 { --tw-gradient-to: rgb(52 211 153 / 0); --tw-gradient-stops: var(--tw-gradient-from), #34d399, var(--tw-gradient-to); }
.via-orange-400 { --tw-gradient-to: rgb(251 146 60 / 0); --tw-gradient-stops: var(--tw-gradient-from), #fb923c, var(--tw-gradient-to); }
.via-lime\/10 { --tw-gradient-to: rgba(132, 204, 22, 0); --tw-gradient-stops: var(--tw-gradient-from), rgba(132, 204, 22, 0.1), var(--tw-gradient-to); }
.via-orange\/10 { --tw-gradient-to: rgba(249, 115, 22, 0); --tw-gradient-stops: var(--tw-gradient-from), rgba(249, 115, 22, 0.1), var(--tw-gradient-to); }
.via-cyan\/10 { --tw-gradient-to: rgba(6, 182, 212, 0); --tw-gradient-stops: var(--tw-gradient-from), rgba(6, 182, 212, 0.1), var(--tw-gradient-to); }
.via-indigo-700 { --tw-gradient-to: rgb(67 56 202 / 0); --tw-gradient-stops: var(--tw-gradient-from), var(--lumi-indigo-700), var(--tw-gradient-to); }

/* TO colors */
.to-sky-400 { --tw-gradient-to: var(--lumi-sky-400); }
.to-sky-500 { --tw-gradient-to: var(--lumi-sky-500); }
.to-sky-700\/60 { --tw-gradient-to: rgba(3, 105, 161, 0.6); }
.to-emerald-400 { --tw-gradient-to: #34d399; }
.to-emerald-200\/50 { --tw-gradient-to: rgba(167, 243, 208, 0.5); }
.to-emerald\/20 { --tw-gradient-to: rgba(16, 185, 129, 0.2); }
.to-emerald\/10 { --tw-gradient-to: rgba(16, 185, 129, 0.1); }
.to-lime-400 { --tw-gradient-to: var(--lumi-lime-400); }
.to-lime-500 { --tw-gradient-to: var(--lumi-lime-500); }
.to-lime\/20 { --tw-gradient-to: rgba(132, 204, 22, 0.2); }
.to-orange-500 { --tw-gradient-to: var(--lumi-orange-500); }
.to-orange\/20 { --tw-gradient-to: rgba(249, 115, 22, 0.2); }
.to-rose-400 { --tw-gradient-to: var(--lumi-rose-400); }
.to-cyan-500 { --tw-gradient-to: var(--lumi-cyan-500); }
.to-slate-900 { --tw-gradient-to: var(--lumi-slate-900); }
.to-slate-50 { --tw-gradient-to: var(--lumi-slate-50); }
.to-white { --tw-gradient-to: #ffffff; }

.tab-input { display: none; }
.tab-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #334155;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
}
.tab-label.tab-soft { background: #e2e8f0; color: #334155; }
.tab-label.tab-soft:hover { background: rgba(108, 92, 231, 0.1); color: #6c5ce7; }
.tab-label.tab-border { border: 1px solid #e2e8f0; background: #fff; box-shadow: 0 6px 20px -14px rgba(15, 23, 42, 0.2); }
.tab-label.tab-border:hover { border-color: rgba(108, 92, 231, 0.4); color: #6c5ce7; }
.tab-label.tab-boxed { background: #f8fafc; color: #334155; border: 1px solid #f1f5f9; }
.tab-label.tab-boxed:hover { color: #6c5ce7; border-color: rgba(108, 92, 231, 0.3); }
.tab-input:checked + .tab-label.tab-soft { background: rgba(108, 92, 231, 0.1); color: #6c5ce7; border-color: rgba(108, 92, 231, 0.2); }
.tab-input:checked + .tab-label.tab-border { border-color: #6c5ce7; background: rgba(108, 92, 231, 0.05); color: #6c5ce7; box-shadow: 0 10px 25px -18px rgba(108, 92, 231, 0.45); }
.tab-input:checked + .tab-label.tab-boxed { background: #fff; color: #6c5ce7; border-color: rgba(108, 92, 231, 0.3); box-shadow: 0 8px 18px -16px rgba(108, 92, 231, 0.4); }
.tab-panel {
  display: none;
  width: 100%;
  flex-basis: 100%;
  order: 99;
}
.tab-input:checked + .tab-label + .tab-panel { display: block; }

.border-1 {
  border-width: 1px;
}


/* Shared utility styles migrated from inline page blocks */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }

[data-page="components-popover"] .glass-card { overflow: visible; }

.editor-toolbar button { transition: background-color 150ms ease, color 150ms ease; }
.editor-area { min-height: 180px; }

.bg-primary\/20 { background-color: rgba(108, 92, 231, 0.2) !important; }

/* Tom Select polish */
.ts-wrapper { width: 100%; position: relative; z-index: 120; }
.ts-control {
  border-radius: 16px;
  min-height: 44px;
  border: 1px solid #e2e8f0;
  padding-inline: 10px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.ts-wrapper.focus .ts-control {
  border-color: #6c5ce7;
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}
.ts-dropdown { border-radius: 12px; border-color: #e2e8f0; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.ts-dropdown .option:hover { background: #f8fafc; }
.ts-dropdown .active { background: #eef2ff; color: #4338ca; }
.ts-control .item { border-radius: 9999px; background: #eef2ff; color: #4338ca; }
.ts-control .remove { color: #9ca3af; margin-left: 6px; }

/* Range accent colors */
input[type=range] { accent-color: #6c5ce7; }
input[type=range].emerald { accent-color: #10b981; }
input[type=range].amber { accent-color: #f59e0b; }
input[type=range].rose { accent-color: #f43f5e; }
input[type=range].sky { accent-color: #38bdf8; }
