/* ═══════════════════════════════════════════════════════════════
   Helios theme — purple/pink glass dashboard
   Activated by `<html data-theme="helios">`. Overrides CSS variables
   from dashboard.css and tweaks a handful of components (nav pills,
   buttons, chart glow) to match a soft, dark, fuchsia-accent look.
   Flip back to the orange "classic" theme by removing the attribute
   (or clicking the Theme toggle in the header).
   ═══════════════════════════════════════════════════════════════ */

:root[data-theme="helios"] {
  /* Palette (shared by dark + light modes) */
  --primary:        #e879f9;                  /* fuchsia */
  --primary-light:  rgba(232, 121, 249, 0.14);
  --primary-glow:   rgba(232, 121, 249, 0.32);
  --secondary:      #c084fc;                  /* lavender */
  --glass-blur:     22px;

  /* Surfaces — deeper near-black with a faint purple tint */
  --bg:             #07060f;
  --bg-elevated:    #130f22;
  --card-bg:        rgba(20, 15, 32, 0.72);
  --card-bg-hover:  rgba(32, 24, 50, 0.88);
  --border:         rgba(255, 255, 255, 0.06);
  --border-hover:   rgba(232, 121, 249, 0.22);

  /* Text — slightly cooler whites */
  --text:           #f3eefb;
  --text-muted:     #9a8fb0;

  /* Semantic colors stay but shift to the pink/purple family */
  --green:          #7ee787;    /* keep for up-deltas */
  --red:            #fb7185;    /* keep for down-deltas */
  --blue:           #c084fc;    /* replaced with lavender */
  --yellow:         #fbbf24;
  --orange:         #e879f9;    /* re-mapped to pink to avoid orange leak */

  /* Shape — softer, rounder */
  --radius:         20px;
  --radius-sm:      14px;

  /* Shadow — heavier, with a hint of magenta glow */
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.5),
               0 2px 8px rgba(0, 0, 0, 0.3),
               0 0 0 1px rgba(232, 121, 249, 0.04);
  --shadow-lg: 0 30px 70px rgba(0, 0, 0, 0.55),
               0 10px 24px rgba(0, 0, 0, 0.35),
               0 0 40px rgba(232, 121, 249, 0.06);
}

/* ═══════════ Helios × light mode ═══════════
   When the moon/sun toggle is in light mode AND the palette is Helios,
   flip surfaces to a pale lavender-white but keep fuchsia accents. */
:root[data-theme="helios"][data-mode="light"] {
  --bg:             #faf7fe;
  --bg-elevated:    #ffffff;
  --card-bg:        rgba(255, 255, 255, 0.9);
  --card-bg-hover:  #ffffff;
  --border:         rgba(99, 65, 128, 0.1);
  --border-hover:   rgba(232, 121, 249, 0.38);
  --text:           #1a1024;
  --text-muted:     #6b5d7f;
  --primary-light:  rgba(232, 121, 249, 0.12);
  --primary-glow:   rgba(232, 121, 249, 0.3);
  --shadow-sm: 0 1px 3px rgba(99, 65, 128, 0.08);
  --shadow-md: 0 8px 24px rgba(99, 65, 128, 0.1),
               0 2px 8px rgba(99, 65, 128, 0.06);
  --shadow-lg: 0 20px 50px rgba(99, 65, 128, 0.15),
               0 6px 16px rgba(99, 65, 128, 0.08);
}
:root[data-theme="helios"][data-mode="light"] body {
  background: var(--bg);
}
:root[data-theme="helios"][data-mode="light"] body::before {
  background-image: radial-gradient(circle, rgba(232, 121, 249, 0.06) 1px, transparent 1px) !important;
}
:root[data-theme="helios"][data-mode="light"] body::after {
  background:
    radial-gradient(ellipse at 12% 92%, rgba(232, 121, 249, 0.14), transparent 45%),
    radial-gradient(ellipse at 88% 8%, rgba(192, 132, 252, 0.12), transparent 50%) !important;
}
/* Side-nav, cards, pills — swap dark glass for pale glass */
:root[data-theme="helios"][data-mode="light"] .side-nav {
  background: rgba(255, 255, 255, 0.75) !important;
  border-color: rgba(99, 65, 128, 0.1) !important;
}
:root[data-theme="helios"][data-mode="light"] .side-nav::before {
  color: #1a1024 !important;
  border-bottom-color: rgba(99, 65, 128, 0.08) !important;
}
:root[data-theme="helios"][data-mode="light"] .nav-btn {
  color: #4a3a66 !important;
}
:root[data-theme="helios"][data-mode="light"] .nav-btn:hover {
  background: rgba(232, 121, 249, 0.08) !important;
  color: #1a1024 !important;
}
:root[data-theme="helios"][data-mode="light"] .nav-btn.active {
  background: linear-gradient(135deg, rgba(232, 121, 249, 0.2), rgba(192, 132, 252, 0.12)) !important;
  color: #4a0e5c !important;
  box-shadow: inset 0 0 0 1px rgba(232, 121, 249, 0.35),
              0 6px 18px rgba(232, 121, 249, 0.14) !important;
}
:root[data-theme="helios"][data-mode="light"] .nav-label {
  color: inherit !important;
  opacity: 1 !important;
}
/* Sidebar module labels (LAST SYNCED, QUICK ACTIONS, etc.) + KPI labels */
:root[data-theme="helios"][data-mode="light"] .side-module-label,
:root[data-theme="helios"][data-mode="light"] .ads-kpi-label,
:root[data-theme="helios"][data-mode="light"] .kpi-label,
:root[data-theme="helios"][data-mode="light"] .ads-section-title,
:root[data-theme="helios"][data-mode="light"] .section-title,
:root[data-theme="helios"][data-mode="light"] small,
:root[data-theme="helios"][data-mode="light"] [class*="label"],
:root[data-theme="helios"][data-mode="light"] [class*="muted"] {
  color: rgba(26, 16, 36, 0.6) !important;
}
/* Sidebar sync rows: left column is muted, right column is text */
:root[data-theme="helios"][data-mode="light"] .side-sync-row > span:first-child { color: rgba(26, 16, 36, 0.6) !important; }
:root[data-theme="helios"][data-mode="light"] .side-sync-row > span:last-child  { color: #1a1024 !important; }
/* Chart axis labels and grid lines on light */
:root[data-theme="helios"][data-mode="light"] canvas { filter: none !important; }
:root[data-theme="helios"][data-mode="light"] .ads-tab-bar,
:root[data-theme="helios"][data-mode="light"] .ads-kpi-card,
:root[data-theme="helios"][data-mode="light"] .kpi-card,
:root[data-theme="helios"][data-mode="light"] .card,
:root[data-theme="helios"][data-mode="light"] .table-card {
  background: rgba(255, 255, 255, 0.78) !important;
  border-color: rgba(99, 65, 128, 0.1) !important;
  box-shadow: 0 10px 30px rgba(99, 65, 128, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}
:root[data-theme="helios"][data-mode="light"] p { color: rgba(26, 16, 36, 0.78) !important; }
:root[data-theme="helios"][data-mode="light"] h1,
:root[data-theme="helios"][data-mode="light"] h2,
:root[data-theme="helios"][data-mode="light"] h3,
:root[data-theme="helios"][data-mode="light"] h4 {
  color: #1a1024 !important;
  text-shadow: 0 1px 24px rgba(232, 121, 249, 0.08);
}
:root[data-theme="helios"][data-mode="light"] .ads-kpi-value,
:root[data-theme="helios"][data-mode="light"] .kpi-value,
:root[data-theme="helios"][data-mode="light"] .big-number {
  color: #1a1024 !important;
  text-shadow: 0 1px 12px rgba(232, 121, 249, 0.1);
}
:root[data-theme="helios"][data-mode="light"] .ads-kpi-label,
:root[data-theme="helios"][data-mode="light"] .section-label {
  color: rgba(26, 16, 36, 0.6) !important;
}
:root[data-theme="helios"][data-mode="light"] .ads-tab-btn {
  color: rgba(26, 16, 36, 0.6) !important;
}
:root[data-theme="helios"][data-mode="light"] .ads-tab-btn:hover {
  background: rgba(232, 121, 249, 0.08) !important;
  color: #1a1024 !important;
}
:root[data-theme="helios"][data-mode="light"] .ads-tab-btn.active {
  background: linear-gradient(135deg, rgba(232, 121, 249, 0.25), rgba(192, 132, 252, 0.15)) !important;
  color: #4a0e5c !important;
}
/* Table borders in light helios */
:root[data-theme="helios"][data-mode="light"] table th {
  background: rgba(232, 121, 249, 0.08) !important;
  color: rgba(26, 16, 36, 0.6) !important;
}
:root[data-theme="helios"][data-mode="light"] table td {
  color: #1a1024 !important;
  border-bottom-color: rgba(99, 65, 128, 0.08) !important;
}
:root[data-theme="helios"][data-mode="light"] tr:hover td {
  background: rgba(232, 121, 249, 0.05) !important;
}
/* Date picker + user widget etc. on light */
:root[data-theme="helios"][data-mode="light"] #dp-popover {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(232, 121, 249, 0.25) !important;
  box-shadow: 0 20px 50px rgba(99, 65, 128, 0.2),
              0 0 50px rgba(232, 121, 249, 0.12) !important;
}
:root[data-theme="helios"][data-mode="light"] .dp-cal-day { color: #1a1024 !important; }
:root[data-theme="helios"][data-mode="light"] .dp-preset { color: rgba(26, 16, 36, 0.75) !important; }
:root[data-theme="helios"][data-mode="light"] #dp-trigger {
  background: rgba(255, 255, 255, 0.72) !important;
  color: #1a1024 !important;
}
:root[data-theme="helios"][data-mode="light"] .user-widget .uw-icon-btn,
:root[data-theme="helios"][data-mode="light"] .user-widget .uw-user {
  background: rgba(255, 255, 255, 0.82) !important;
  border-color: rgba(99, 65, 128, 0.12) !important;
  color: #1a1024 !important;
}
/* Chart canvases need lighter axis labels in light mode */
:root[data-theme="helios"][data-mode="light"] canvas {
  filter: drop-shadow(0 0 10px rgba(232, 121, 249, 0.08)) !important;
}
/* Sidebar modules in light */
:root[data-theme="helios"][data-mode="light"] .side-action-btn,
:root[data-theme="helios"][data-mode="light"] .side-foot-btn {
  background: rgba(255, 255, 255, 0.75) !important;
  border-color: rgba(99, 65, 128, 0.1) !important;
  color: #1a1024 !important;
}
:root[data-theme="helios"][data-mode="light"] .side-action-btn:hover,
:root[data-theme="helios"][data-mode="light"] .side-foot-btn:hover {
  background: rgba(232, 121, 249, 0.12) !important;
  border-color: rgba(232, 121, 249, 0.3) !important;
}

/* ───────── Atmospheric background glow ───────── */
:root[data-theme="helios"] body::after {
  background:
    radial-gradient(ellipse at 12% 92%,
      rgba(232, 121, 249, 0.22), transparent 42%),
    radial-gradient(ellipse at 88% 8%,
      rgba(192, 132, 252, 0.14), transparent 50%),
    radial-gradient(ellipse at 50% 50%,
      rgba(55, 20, 85, 0.10), transparent 70%) !important;
}
:root[data-theme="helios"] body::before {
  background-image: radial-gradient(circle, rgba(232, 121, 249, 0.06) 1px, transparent 1px) !important;
}

/* ───────── Sidebar — Helios color tint ─────────
   Structure (width, horizontal rows, brand mark, mobile fallback) now
   lives in dashboard.css so Classic + Helios share the same layout.
   This block only re-tints the brand mark, hover and active state. */
:root[data-theme="helios"] .side-nav {
  background: rgba(14, 10, 24, 0.78) !important;
}
:root[data-theme="helios"] .side-nav::before {
  color: #f3eefb !important;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23f0abfc' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9' fill='%23e879f9' fill-opacity='0.14'/><path d='M9 7h4a3 3 0 0 1 3 3v4a3 3 0 0 1-3 3H9z' fill='%23e879f9' fill-opacity='0.35'/></svg>") !important;
}
:root[data-theme="helios"] .nav-btn:hover {
  background: rgba(232, 121, 249, 0.07) !important;
  color: #f3eefb !important;
}
:root[data-theme="helios"] .nav-btn.active {
  background: linear-gradient(135deg,
    rgba(232, 121, 249, 0.26),
    rgba(192, 132, 252, 0.14)) !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(232, 121, 249, 0.35),
              0 10px 24px rgba(232, 121, 249, 0.22) !important;
}
:root[data-theme="helios"] .nav-btn.active .nav-icon {
  color: #f0abfc !important;
  filter: drop-shadow(0 0 6px rgba(240, 171, 252, 0.6)) !important;
}

/* ───────── Primary button → pink gradient ───────── */
:root[data-theme="helios"] .btn-primary,
:root[data-theme="helios"] button.btn-primary {
  background: linear-gradient(135deg, #e879f9, #c084fc) !important;
  color: #1a1024 !important;
  box-shadow: 0 10px 28px rgba(232, 121, 249, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
:root[data-theme="helios"] .btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 12px 34px rgba(232, 121, 249, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ───────── Tabs / segmented controls ───────── */
:root[data-theme="helios"] .tab-btn.active,
:root[data-theme="helios"] .segment-btn.active,
:root[data-theme="helios"] .ads-period-badge.active {
  background: linear-gradient(135deg, rgba(232,121,249,0.28), rgba(192,132,252,0.18)) !important;
  border-color: rgba(232, 121, 249, 0.35) !important;
  color: #fff !important;
}

/* ───────── Cards & KPI tiles — rounder, soft lavender rim ───────── */
:root[data-theme="helios"] .ads-kpi-card,
:root[data-theme="helios"] .kpi-card,
:root[data-theme="helios"] .ads-section-card,
:root[data-theme="helios"] .card,
:root[data-theme="helios"] .table-card {
  border-radius: 20px !important;
  background: rgba(20, 15, 32, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
}
:root[data-theme="helios"] .ads-kpi-card:hover,
:root[data-theme="helios"] .kpi-card:hover {
  background: rgba(28, 20, 44, 0.9) !important;
  box-shadow: 0 18px 44px rgba(232, 121, 249, 0.16),
              0 0 0 1px rgba(232, 121, 249, 0.22) !important;
}

/* Section headings — thinner, lavender tint */
:root[data-theme="helios"] .ads-section-title,
:root[data-theme="helios"] .section-title {
  color: rgba(243, 238, 251, 0.55) !important;
  letter-spacing: 0.14em !important;
}

/* Header title accent (Welcome, Nadia-style — the colon word in pink) */
:root[data-theme="helios"] header h1 .highlight,
:root[data-theme="helios"] header h1 .accent {
  background: linear-gradient(135deg, #e879f9, #c084fc);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ───────── Chart lines — chart.js & inline SVG recolor ─────────
   The CSS vars already carry --primary into most chart series; this
   adds the pink glow filter around the active data-point marker. */
:root[data-theme="helios"] canvas { filter: drop-shadow(0 0 10px rgba(232, 121, 249, 0.12)); }

/* ───────── Search / input chrome ───────── */
:root[data-theme="helios"] .search-box,
:root[data-theme="helios"] input[type="search"],
:root[data-theme="helios"] input[type="text"].search-box {
  background: rgba(28, 22, 44, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 999px !important;
  color: var(--text) !important;
}
:root[data-theme="helios"] .search-box:focus {
  border-color: rgba(232, 121, 249, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(232, 121, 249, 0.14) !important;
}

/* ───────── Pill-shaped "Market / Wallet / Tools"–style tab chips ───────── */
:root[data-theme="helios"] .segmented,
:root[data-theme="helios"] .tab-strip,
:root[data-theme="helios"] .ads-period-switcher {
  background: rgba(20, 15, 32, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 999px !important;
  padding: 4px !important;
}
:root[data-theme="helios"] .segmented > button,
:root[data-theme="helios"] .tab-strip > button,
:root[data-theme="helios"] .ads-period-badge {
  border-radius: 999px !important;
}

/* ───────── Date picker (ads tab) — themed & pushed right ───────── */
:root[data-theme="helios"] .ads-date-picker {
  margin-left: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0 !important;
  padding: 0 4px !important;
  position: relative;
}
/* Hide the "Date range:" label and the duplicated status chips so only
   the trigger button is left — one clean pill at the right of the tabs. */
:root[data-theme="helios"] .ads-date-picker > label,
:root[data-theme="helios"] #ads-period-badge,
:root[data-theme="helios"] #ads-date-range-info,
:root[data-theme="helios"] #ads-coverage-badge {
  display: none !important;
}
/* Trigger button — overrides the inline background/border/radius */
:root[data-theme="helios"] #dp-trigger {
  background: rgba(20, 15, 32, 0.55) !important;
  color: var(--text) !important;
  border: 1px solid rgba(232, 121, 249, 0.28) !important;
  border-radius: 999px !important;
  padding: 8px 16px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  backdrop-filter: blur(10px);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
/* Prepend a calendar icon on the trigger so it reads as a date-picker */
:root[data-theme="helios"] #dp-trigger::before {
  content: '';
  width: 14px; height: 14px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f0abfc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><line x1='16' y1='2' x2='16' y2='6'/><line x1='8' y1='2' x2='8' y2='6'/><line x1='3' y1='10' x2='21' y2='10'/></svg>") center/contain no-repeat;
  flex: 0 0 auto;
}
:root[data-theme="helios"] #dp-trigger:hover {
  background: rgba(32, 22, 50, 0.75) !important;
  border-color: rgba(232, 121, 249, 0.45) !important;
  box-shadow: 0 6px 18px rgba(232, 121, 249, 0.18);
}
/* Popover (two-month calendar) */
:root[data-theme="helios"] #dp-popover {
  background: rgba(14, 10, 24, 0.96) !important;
  border: 1px solid rgba(232, 121, 249, 0.25) !important;
  border-radius: 18px !important;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65),
              0 0 60px rgba(232, 121, 249, 0.16) !important;
  /* Right-align the popover so it never clips off-screen */
  left: auto !important;
  right: 0 !important;
  margin-top: 10px !important;
  max-width: calc(100vw - 48px) !important;
  overflow: hidden !important;
  /* Stacking: force it above KPI cards, charts and sticky side-nav */
  z-index: 10000 !important;
  isolation: isolate;
}
/* Also lift the parent so z-index actually escapes */
:root[data-theme="helios"] .ads-date-picker {
  z-index: 100;
}
:root[data-theme="helios"] #dp-popover * {
  color: inherit;
}
/* Dividers inside the popover */
:root[data-theme="helios"] #dp-popover [style*="border-right"],
:root[data-theme="helios"] #dp-popover [style*="border-top"] {
  border-color: rgba(255, 255, 255, 0.07) !important;
}
/* Preset list items */
:root[data-theme="helios"] .dp-preset {
  color: rgba(243, 238, 251, 0.75) !important;
}
:root[data-theme="helios"] .dp-preset:hover {
  background: rgba(232, 121, 249, 0.1) !important;
  color: #fff !important;
}
:root[data-theme="helios"] .dp-preset.active {
  background: linear-gradient(135deg,
    rgba(232, 121, 249, 0.3),
    rgba(192, 132, 252, 0.18)) !important;
  color: #fff !important;
}
/* Calendar day cells */
:root[data-theme="helios"] .dp-cal-day {
  color: rgba(243, 238, 251, 0.85) !important;
}
:root[data-theme="helios"] .dp-cal-day:hover:not(.dp-out):not(.dp-disabled) {
  background: rgba(232, 121, 249, 0.12) !important;
}
:root[data-theme="helios"] .dp-cal-day.dp-in-range {
  background: rgba(192, 132, 252, 0.18) !important;
  color: #f3eefb !important;
}
:root[data-theme="helios"] .dp-cal-day.dp-selected {
  background: linear-gradient(135deg, #e879f9, #c084fc) !important;
  color: #1a1024 !important;
  font-weight: 700 !important;
}
/* Apply button */
:root[data-theme="helios"] #dp-apply-btn {
  background: linear-gradient(135deg, #e879f9, #c084fc) !important;
  color: #1a1024 !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 8px 22px !important;
  font-weight: 600 !important;
  box-shadow: 0 6px 18px rgba(232, 121, 249, 0.3) !important;
}
/* Cancel link + month-nav arrows + "selected" label */
:root[data-theme="helios"] #dp-popover button[onclick="dpClose()"] {
  color: rgba(243, 238, 251, 0.6) !important;
}
:root[data-theme="helios"] #dp-popover button[onclick="dpClose()"]:hover {
  color: #fff !important;
}
:root[data-theme="helios"] #dp-popover button[onclick^="dpShiftMonth"] {
  color: #f0abfc !important;
  background: rgba(232, 121, 249, 0.08) !important;
  border-radius: 50% !important;
  width: 28px; height: 28px;
  display: inline-grid; place-items: center;
}
:root[data-theme="helios"] #dp-popover button[onclick^="dpShiftMonth"]:hover {
  background: rgba(232, 121, 249, 0.2) !important;
}
:root[data-theme="helios"] #dp-selected-label {
  color: rgba(243, 238, 251, 0.75) !important;
}
:root[data-theme="helios"] .dp-cal-title {
  color: #f3eefb !important;
}
:root[data-theme="helios"] .dp-cal-dow {
  color: rgba(243, 238, 251, 0.45) !important;
}

/* ───────── Internal sub-tab bars → Helios pill strip ─────────
   Rewrites the underline tab bar used across every section
   (Reviews / Ads / Audience / Sales / Reports / Category) into a
   rounded dark-glass pill container with pill-shaped tabs, matching
   the Market / Wallet / Tools look in the Helios reference. */
:root[data-theme="helios"] .ads-tab-bar {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px !important;
  background: rgba(20, 15, 32, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 24px !important;
  padding: 5px !important;
  margin: 0 0 1.5rem !important;
  width: 100% !important;
  max-width: 100%;
  /* NOTE: no backdrop-filter here — it would create a stacking context
     and trap the date-picker popover behind the KPI cards. */
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03),
              0 10px 24px rgba(0,0,0,0.3);
  /* The .ads-date-picker inside needs its stacking context too */
  overflow: visible !important;
  position: relative;
  z-index: 2;
}

:root[data-theme="helios"] .ads-tab-btn {
  background: transparent !important;
  border: none !important;
  border-bottom: none !important;
  border-radius: 999px !important;
  padding: 9px 18px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  color: rgba(243, 238, 251, 0.6) !important;
  margin-bottom: 0 !important;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
:root[data-theme="helios"] .ads-tab-btn:hover {
  background: rgba(232, 121, 249, 0.08) !important;
  color: #f3eefb !important;
}
:root[data-theme="helios"] .ads-tab-btn.active {
  background: linear-gradient(135deg,
    rgba(232, 121, 249, 0.3),
    rgba(192, 132, 252, 0.18)) !important;
  color: #fff !important;
  border-bottom-color: transparent !important;
  box-shadow: inset 0 0 0 1px rgba(232, 121, 249, 0.4),
              0 6px 18px rgba(232, 121, 249, 0.22);
}

/* ───────── Links & highlighted text ───────── */
:root[data-theme="helios"] a,
:root[data-theme="helios"] .link {
  color: #e879f9;
}
:root[data-theme="helios"] a:hover {
  color: #f0abfc;
}

/* ───────── Charts — recolor orange strokes to pink ─────────
   Many chart.js / plotly series are set via --primary; those adopt
   automatically. These rules catch the inline SVG lines in sparklines,
   date-picker chrome, and the sync-badge accents. */
:root[data-theme="helios"] svg [stroke="#f97316"],
:root[data-theme="helios"] svg [fill="#f97316"] {
  stroke: #e879f9 !important;
  fill: #e879f9 !important;
}

/* ───────── Reports tab — Helios tint ───────── */
:root[data-theme="helios"] .reports-pdf-btn {
  background: linear-gradient(135deg, #e879f9, #c084fc) !important;
  color: #1a1024 !important;
  box-shadow: 0 10px 28px rgba(232, 121, 249, 0.35),
              inset 0 1px 0 rgba(255,255,255,0.3) !important;
}
:root[data-theme="helios"] .reports-frame-wrap {
  border-color: rgba(232, 121, 249, 0.18) !important;
  background: rgba(20, 15, 32, 0.72) !important;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5),
              0 0 60px rgba(232, 121, 249, 0.08),
              inset 0 1px 0 rgba(255,255,255,0.04) !important;
}
:root[data-theme="helios"] .reports-frame-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(140deg,
    rgba(232, 121, 249, 0.4),
    transparent 40%,
    rgba(99, 102, 241, 0.25));
  -webkit-mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
          mask-composite: exclude;
  -webkit-mask-composite: xor;
  opacity: 0.6;
}
:root[data-theme="helios"] #reports-frame {
  background: rgba(14, 10, 24, 0.65) !important;
}
:root[data-theme="helios"] .reports-empty {
  background: rgba(14, 10, 24, 0.82) !important;
}
:root[data-theme="helios"] .reports-empty-icon {
  color: #f0abfc !important;
  background: rgba(232, 121, 249, 0.14) !important;
  border-color: rgba(232, 121, 249, 0.3) !important;
  box-shadow: 0 10px 28px rgba(232, 121, 249, 0.2);
}
:root[data-theme="helios"] .reports-empty h3 {
  text-shadow: 0 1px 24px rgba(232, 121, 249, 0.15);
}
:root[data-theme="helios"] .reports-empty code {
  background: rgba(6, 8, 20, 0.7) !important;
  border-color: rgba(232, 121, 249, 0.22) !important;
  color: #f0abfc !important;
}

/* ───────── Sidebar modules — Helios tint ───────── */
:root[data-theme="helios"] .side-module {
  border-top-color: rgba(255,255,255,0.07) !important;
}
:root[data-theme="helios"] .side-module-label {
  color: rgba(243,238,251,0.52) !important;
}
:root[data-theme="helios"] .pulse-dot {
  background: #7ee787 !important;
  box-shadow: 0 0 10px rgba(126,231,135,0.6) !important;
}
:root[data-theme="helios"] .side-action-btn,
:root[data-theme="helios"] .side-foot-btn {
  background: rgba(20,15,32,0.5) !important;
  border-color: rgba(255,255,255,0.06) !important;
  color: rgba(243,238,251,0.9) !important;
}
:root[data-theme="helios"] .side-action-btn:hover,
:root[data-theme="helios"] .side-foot-btn:hover {
  background: rgba(232,121,249,0.12) !important;
  border-color: rgba(232,121,249,0.3) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(232,121,249,0.14);
}
:root[data-theme="helios"] .side-action-btn:hover svg,
:root[data-theme="helios"] .side-foot-btn:hover svg {
  color: #f0abfc !important;
}

/* ───────── Top-right user widget — Helios tint ───────── */
:root[data-theme="helios"] .user-widget .uw-icon-btn {
  background: rgba(20, 15, 32, 0.72) !important;
  border-color: rgba(255, 255, 255, 0.07) !important;
}
:root[data-theme="helios"] .user-widget .uw-icon-btn:hover {
  background: rgba(32, 24, 50, 0.9) !important;
  border-color: rgba(232, 121, 249, 0.3) !important;
  color: #f3eefb !important;
  box-shadow: 0 6px 18px rgba(232, 121, 249, 0.15);
}
:root[data-theme="helios"] .user-widget .uw-user {
  background: rgba(20, 15, 32, 0.72) !important;
  border-color: rgba(255, 255, 255, 0.07) !important;
}
:root[data-theme="helios"] .user-widget .uw-avatar {
  background: linear-gradient(135deg, #e879f9, #c084fc) !important;
  color: #1a1024 !important;
  box-shadow: 0 6px 18px rgba(232, 121, 249, 0.4),
              inset 0 1px 0 rgba(255,255,255,0.35) !important;
}
:root[data-theme="helios"] .user-widget .uw-role {
  color: #f0abfc !important;
  background: rgba(232, 121, 249, 0.14) !important;
}
:root[data-theme="helios"] .user-widget .uw-icon-btn--danger {
  color: #fb7185 !important;
  border-color: rgba(251, 113, 133, 0.3) !important;
}

/* ───────── Typography — Helios tune for readability ─────────
   Keeps the dashboard's existing hierarchy but pushes contrast up,
   gives headings a hint of fuchsia glow, and brightens muted copy
   so the lavender tone is readable on dark glass. Scoped to
   `:not([data-mode="light"])` so these forced-light-text rules do
   NOT paint white-on-white when the user is in light mode. */
:root[data-theme="helios"]:not([data-mode="light"]) body,
:root[data-theme="helios"]:not([data-mode="light"]) p,
:root[data-theme="helios"]:not([data-mode="light"]) span,
:root[data-theme="helios"]:not([data-mode="light"]) div {
  color: var(--text);
}
:root[data-theme="helios"]:not([data-mode="light"]) p {
  color: rgba(243, 238, 251, 0.78);
  line-height: 1.55;
}
:root[data-theme="helios"]:not([data-mode="light"]) h1,
:root[data-theme="helios"]:not([data-mode="light"]) h2,
:root[data-theme="helios"]:not([data-mode="light"]) h3,
:root[data-theme="helios"]:not([data-mode="light"]) h4 {
  color: #f6f1fd !important;
  letter-spacing: -0.015em;
  text-shadow: 0 1px 24px rgba(232, 121, 249, 0.1);
}
:root[data-theme="helios"]:not([data-mode="light"]) h1 { font-weight: 700; }
:root[data-theme="helios"]:not([data-mode="light"]) h2 { font-weight: 600; }
:root[data-theme="helios"]:not([data-mode="light"]) h3 { font-weight: 600; color: rgba(246, 241, 253, 0.95) !important; }

/* Muted/sub-labels — raise from 50% to 65% so lavender reads clearly */
:root[data-theme="helios"]:not([data-mode="light"]) .ads-kpi-label,
:root[data-theme="helios"]:not([data-mode="light"]) .kpi-label,
:root[data-theme="helios"]:not([data-mode="light"]) .section-sub,
:root[data-theme="helios"]:not([data-mode="light"]) small,
:root[data-theme="helios"]:not([data-mode="light"]) [class*="label"],
:root[data-theme="helios"]:not([data-mode="light"]) [class*="muted"] {
  color: rgba(243, 238, 251, 0.62) !important;
}

/* KPI numbers — crisp white with a subtle fuchsia bloom (dark mode only) */
:root[data-theme="helios"]:not([data-mode="light"]) .ads-kpi-value,
:root[data-theme="helios"]:not([data-mode="light"]) .kpi-value,
:root[data-theme="helios"]:not([data-mode="light"]) .big-number,
:root[data-theme="helios"]:not([data-mode="light"]) .metric-value {
  color: #ffffff !important;
  font-weight: 700 !important;
  text-shadow: 0 2px 20px rgba(232, 121, 249, 0.18);
  font-variant-numeric: tabular-nums;
}

/* Trends: keep semantic green/red but shift the "flat" neutral to lavender */
:root[data-theme="helios"] .trend-flat,
:root[data-theme="helios"] [class*="trend-flat"] {
  color: #c084fc !important;
}

/* Table rows — soften border, bright heading row (dark mode only) */
:root[data-theme="helios"]:not([data-mode="light"]) table th {
  color: rgba(243, 238, 251, 0.6) !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.7rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
:root[data-theme="helios"] table td {
  color: var(--text) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}
:root[data-theme="helios"] table tr:hover td {
  background: rgba(232, 121, 249, 0.04) !important;
}

/* Last-updated / sync badges */
:root[data-theme="helios"] .sync-badge-fresh,
:root[data-theme="helios"] .sync-badge {
  background: rgba(126, 231, 135, 0.1) !important;
  color: #7ee787 !important;
  border: 1px solid rgba(126, 231, 135, 0.25) !important;
}

/* Dividers between sections */
:root[data-theme="helios"] hr,
:root[data-theme="helios"] .divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(90deg, transparent, rgba(232,121,249,0.18), transparent);
  height: 1px;
}

/* Chart canvas container — subtle fuchsia aura behind the plot */
:root[data-theme="helios"] .chart-container,
:root[data-theme="helios"] .ads-chart-wrap {
  position: relative;
}
:root[data-theme="helios"] .chart-container::after,
:root[data-theme="helios"] .ads-chart-wrap::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%,
    rgba(232, 121, 249, 0.08), transparent 60%);
  border-radius: inherit;
}

/* ───────── Theme toggle button in header ───────── */
.theme-switch {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.theme-switch:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--card-bg-hover);
}
.theme-switch svg { width: 13px; height: 13px; }
:root[data-theme="helios"] .theme-switch {
  color: #f0abfc;
  border-color: rgba(232, 121, 249, 0.3);
}
