/* =====================================================================
   DASHBOARD GLOW  -  HLC black-and-gold "glowing OS" treatment
   ---------------------------------------------------------------------
   Premium dark + radial-gold-glow look rendered entirely in the HLC brand
   (black canvas, metallic-gold glow, glassmorphic cards, glowing gold KPI
   numbers). SCOPED to Command Center home (#executiveDashboardRoot), Sales
   (#salesIntelRoot) and Billing (#paymentsBillingRoot). Self-contained: it
   forces a dark canvas AND readable light/gold text so it looks right in any
   theme (no dark-on-dark). Visual only; honors reduced-motion.
   ===================================================================== */

/* ---- dark glowing canvas ---- */
#executiveDashboardRoot,
#salesIntelRoot,
#paymentsBillingRoot {
  --glow-gold: #D4AF37;
  --glow-soft: #F7E7A1;
  --glow-ink: #ECE3C4;      /* readable body text on the dark canvas */
  --glow-dim: #B9AD86;      /* muted labels/eyebrows */
  /* SELF-CONTAINED DARK SURFACE: re-point the base design-system tokens to dark values INSIDE the
     dashboard so EVERY component (co-*, mc-*, ds-*) that reads --ds-surface/--ds-text renders dark
     surfaces + light/gold text in ANY page theme. Without this, light-theme white card surfaces
     (--ds-surface-2:#fff) sat under the forced cream text -> invisible cream-on-white in light mode. */
  --ds-bg: #050505;
  --ds-surface-1: #141210; --ds-surface-2: #1a1612; --ds-surface-3: #201a13;
  --ds-surface-glass: rgba(26,22,12,0.74);
  --ds-hairline: rgba(212,175,55,0.18); --ds-hairline-strong: rgba(212,175,55,0.30);
  --ds-overlay: rgba(212,175,55,0.06);
  --ds-text-hi: var(--glow-soft); --ds-text: var(--glow-ink); --ds-text-lo: var(--glow-dim); --ds-text-mute: var(--glow-dim);
  position: relative;
  color: var(--glow-ink);
  background:
    radial-gradient(120% 90% at 85% -10%, rgba(212,175,55,0.16), transparent 55%),
    radial-gradient(90% 70% at 10% 0%, rgba(212,175,55,0.07), transparent 50%),
    radial-gradient(60% 60% at 78% 40%, rgba(212,175,55,0.06), transparent 60%),
    #050505;
  border-radius: 18px;
  padding: 18px 18px 28px;
  isolation: isolate;
}
#executiveDashboardRoot::before,
#salesIntelRoot::before,
#paymentsBillingRoot::before {
  content: ""; position: absolute; top: -40px; right: -60px; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(212,175,55,0.20), rgba(212,175,55,0.05) 45%, transparent 70%);
  filter: blur(14px); z-index: -1; pointer-events: none;
}

/* ---- READABILITY: force light text for everything in scope (an ID selector beats
   base plain-class rules, so light-theme dark text can never sit on the dark canvas).
   More specific gold rules below still win for headings + numbers. ---- */
#executiveDashboardRoot *,
#salesIntelRoot *,
#paymentsBillingRoot * { color: var(--glow-ink); border-color: rgba(212,175,55,0.22); }
/* muted secondary text (eyebrows, subtitles, meta, hints) */
#executiveDashboardRoot [class*="eyebrow"], #executiveDashboardRoot [class*="__sub"], #executiveDashboardRoot [class*="__meta"], #executiveDashboardRoot [class*="hint"], #executiveDashboardRoot [class*="muted"], #executiveDashboardRoot [class*="label"],
#salesIntelRoot [class*="eyebrow"], #salesIntelRoot [class*="__sub"], #salesIntelRoot [class*="__meta"], #salesIntelRoot [class*="hint"], #salesIntelRoot [class*="muted"], #salesIntelRoot [class*="label"],
#paymentsBillingRoot [class*="eyebrow"], #paymentsBillingRoot [class*="__sub"], #paymentsBillingRoot [class*="hint"], #paymentsBillingRoot [class*="muted"], #paymentsBillingRoot [class*="label"] { color: var(--glow-dim); }
/* page title + lead paragraph read bright */
#executiveDashboardRoot .view-title, #executiveDashboardRoot .view-lead,
#salesIntelRoot .view-title, #salesIntelRoot .view-lead,
#paymentsBillingRoot .view-title, #paymentsBillingRoot .view-lead { color: #FBF4DC; }

/* ---- glassmorphic gold cards + tiles (broad, scoped) ---- */
#executiveDashboardRoot [class*="card"], #executiveDashboardRoot .mc-section, #executiveDashboardRoot .mc-brief, #executiveDashboardRoot [class*="tile"], #executiveDashboardRoot [class*="kpi"],
#salesIntelRoot [class*="card"], #salesIntelRoot .mc-section, #salesIntelRoot [class*="kpi"], #salesIntelRoot [class*="pipe"], #salesIntelRoot [class*="opp"], #salesIntelRoot [class*="tile"],
#paymentsBillingRoot [class*="card"], #paymentsBillingRoot [class*="tile"], #paymentsBillingRoot [class*="kpi"] {
  background: linear-gradient(160deg, rgba(26,22,12,0.74), rgba(10,10,10,0.84));
  border: 1px solid rgba(212,175,55,0.26);
  border-radius: 14px;
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  box-shadow: inset 0 1px 0 rgba(247,231,161,0.08), 0 18px 48px -26px rgba(0,0,0,0.9), 0 0 40px -22px rgba(212,175,55,0.4);
}
/* don't double-glass inner sub-parts of a card (heads/foots) */
#executiveDashboardRoot [class*="card__"], #salesIntelRoot [class*="card__"], #paymentsBillingRoot [class*="card__"] {
  background: transparent; border: 0; box-shadow: none; backdrop-filter: none; border-radius: 0;
}

/* ---- glowing gold KPI numbers + headings (win via higher specificity) ---- */
#executiveDashboardRoot .mc-brief__hello,
#salesIntelRoot .view-title {
  background: linear-gradient(90deg, #F7E7A1, #D4AF37);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 26px rgba(212,175,55,0.30);
}
#executiveDashboardRoot .mc-brief__pulse-v,
#salesIntelRoot .c3-kpi__k, #salesIntelRoot .si-pipe__val, #salesIntelRoot .si-opp__val,
#paymentsBillingRoot .pay-card b, #paymentsBillingRoot .pay-card strong {
  color: var(--glow-soft) !important;
  text-shadow: 0 0 20px rgba(212,175,55,0.55), 0 0 2px rgba(212,175,55,0.35);
  font-weight: 700;
}
#executiveDashboardRoot .mc-section__title, #executiveDashboardRoot .ds-card__title,
#salesIntelRoot .mc-section__title, #salesIntelRoot .ds-card__title,
#paymentsBillingRoot .ds-card__title { color: var(--glow-gold) !important; }

/* ---- tab bar / segmented controls stay readable ---- */
#salesIntelRoot [class*="tab"], #salesIntelRoot [role="tab"],
#executiveDashboardRoot [class*="segment"], #executiveDashboardRoot [role="tab"] { color: var(--glow-dim); }
#salesIntelRoot [aria-selected="true"], #salesIntelRoot [class*="tab"][class*="on"],
#executiveDashboardRoot [aria-selected="true"] { color: var(--glow-gold); }

/* ---- chips / "live" dots: gentle gold pulse ---- */
#executiveDashboardRoot .ds-chip, #salesIntelRoot .ds-chip, #paymentsBillingRoot .pay-tag {
  border: 1px solid rgba(212,175,55,0.4); color: var(--glow-soft); background: rgba(212,175,55,0.08);
}
#executiveDashboardRoot .ds-chip--dot::before, #executiveDashboardRoot .ds-chip--positive::before {
  box-shadow: 0 0 8px 1px rgba(212,175,55,0.8); animation: hlc-glow-pulse 2.2s ease-in-out infinite;
}
@keyframes hlc-glow-pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* ---- bars / sparklines glow gold ---- */
#executiveDashboardRoot .mc-bar > span, #executiveDashboardRoot .mc-bar i,
#salesIntelRoot .mc-bar > span, #paymentsBillingRoot [class*="bar"] > span {
  background: linear-gradient(90deg, #D4AF37, #F7E7A1) !important; box-shadow: 0 0 10px rgba(212,175,55,0.5);
}

/* ---- primary / gold-filled buttons: DARK text on gold (fixes white-on-yellow), + gold glow ---- */
#executiveDashboardRoot .ds-btn--primary, #salesIntelRoot .ds-btn--primary, #paymentsBillingRoot .ds-btn--primary,
#executiveDashboardRoot .ds-btn--primary *, #salesIntelRoot .ds-btn--primary *, #paymentsBillingRoot .ds-btn--primary * {
  color: #1a1407 !important;
  text-shadow: none !important;
  font-weight: 700;
}
#executiveDashboardRoot .ds-btn--primary, #salesIntelRoot .ds-btn--primary, #paymentsBillingRoot .ds-btn--primary {
  background: linear-gradient(145deg, #F3D878, #C79A2E) !important;
  border-color: rgba(212,175,55,0.6) !important;
  box-shadow: 0 0 20px -4px rgba(212,175,55,0.7);
}

/* =====================================================================
   VISITORS / ANALYTICS (#hlc-analytics-root) - ADD GLOW ONLY.
   This dashboard already ships its own dark+gold palette, so we do NOT force
   text/background here (would fight its design) - we only add the gold glow
   (card bloom + glowing KPI numbers) you asked for.
   ===================================================================== */
#hlc-analytics-root .an-card,
#hlc-analytics-root .an-kpis > *,
#hlc-analytics-root .an-bk,
#hlc-analytics-root .an-panel,
#hlc-analytics-root .an-chart-wrap,
#hlc-analytics-root .an-track,
#hlc-analytics-root .an-funnel > * {
  border-color: rgba(212,175,55,0.30) !important;
  box-shadow: inset 0 1px 0 rgba(247,231,161,0.07), 0 18px 46px -26px rgba(0,0,0,0.9), 0 0 42px -22px rgba(212,175,55,0.5) !important;
  transition: box-shadow .25s ease, transform .25s ease;
}
#hlc-analytics-root .an-card:hover,
#hlc-analytics-root .an-panel:hover,
#hlc-analytics-root .an-bk:hover {
  box-shadow: inset 0 1px 0 rgba(247,231,161,0.12), 0 0 60px -16px rgba(212,175,55,0.7) !important;
  transform: translateY(-1px);
}
#hlc-analytics-root .an-k-value,
#hlc-analytics-root .an-bk-big {
  text-shadow: 0 0 20px rgba(212,175,55,0.55), 0 0 2px rgba(212,175,55,0.35);
}
#hlc-analytics-root .an-chart-wrap { position: relative; }
#hlc-analytics-root .an-chart-wrap::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 60px -28px rgba(212,175,55,0.6);
}
@media (prefers-reduced-motion: reduce) {
  #hlc-analytics-root .an-card, #hlc-analytics-root .an-panel, #hlc-analytics-root .an-bk { transition: none; }
}

/* =====================================================================
   REVENUE - SQUARE band (Command Center) - the badass glowing money header.
   Real Square sales; see executive-dashboard.js renderSquareMoneyBand().
   ===================================================================== */
#executiveDashboardRoot .mc-square {
  position: relative;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(212,175,55,0.18), transparent 55%),
    linear-gradient(150deg, rgba(30,25,12,0.82), rgba(8,8,8,0.9));
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 0 rgba(247,231,161,0.1), 0 20px 56px -28px rgba(0,0,0,0.9), 0 0 60px -24px rgba(212,175,55,0.55);
  overflow: hidden;
}
#executiveDashboardRoot .mc-square::before {
  content: ""; position: absolute; top: -60px; right: -40px; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(212,175,55,0.28), rgba(212,175,55,0.06) 45%, transparent 70%);
  filter: blur(10px); pointer-events: none;
}
#executiveDashboardRoot .mc-square__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
#executiveDashboardRoot .mc-square__head .mc-section__title {
  margin: 0; font-size: 15px; letter-spacing: .02em;
  color: var(--glow-gold) !important;
}
#executiveDashboardRoot .mc-square__hint { font-size: 11px; color: var(--glow-dim); }
#executiveDashboardRoot .mc-square__grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 14px; align-items: stretch;
}
@media (max-width: 720px) { #executiveDashboardRoot .mc-square__grid { grid-template-columns: 1fr; } }
#executiveDashboardRoot .mc-square__hero, #executiveDashboardRoot .mc-square__tile {
  background: linear-gradient(160deg, rgba(26,22,12,0.7), rgba(10,10,10,0.82));
  border: 1px solid rgba(212,175,55,0.26);
  border-radius: 13px; padding: 16px 18px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(247,231,161,0.08), 0 0 34px -20px rgba(212,175,55,0.5);
}
#executiveDashboardRoot .mc-square__k {
  font: 800 40px/1.02 var(--font-display, inherit);
  background: linear-gradient(92deg, #FBEFBF, #F7E7A1 40%, #D4AF37);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 30px rgba(212,175,55,0.45);
}
#executiveDashboardRoot .mc-square__v {
  font: 800 26px/1.05 var(--font-display, inherit);
  color: var(--glow-soft);
  text-shadow: 0 0 18px rgba(212,175,55,0.5);
}
#executiveDashboardRoot .mc-square__cap { margin-top: 6px; font-size: 12px; color: var(--glow-dim); }
#executiveDashboardRoot .mc-square--empty .mc-square__note { color: var(--glow-ink); font-size: 13px; margin: 0; }
/* Partial-coverage warning: prominent, never mistaken for a complete total. */
#executiveDashboardRoot .mc-square__partial {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  background: rgba(212,175,55,0.1); border: 1px solid rgba(212,175,55,0.5);
  color: #FBF4DC; font-size: 12.5px; line-height: 1.45;
  box-shadow: 0 0 22px -8px rgba(212,175,55,0.55);
}
#executiveDashboardRoot .mc-square__partial strong { color: var(--glow-soft); }
/* Honest fine print: location, currency, timezone, refund basis, as-of time. */
#executiveDashboardRoot .mc-square__meta { margin: 12px 0 0; font-size: 11.5px; color: var(--glow-dim); line-height: 1.5; }
#executiveDashboardRoot .mc-square__meta strong { color: var(--glow-ink); }

@media (prefers-reduced-motion: reduce) {
  #executiveDashboardRoot .ds-chip--dot::before, #executiveDashboardRoot .ds-chip--positive::before { animation: none; }
}
