/* ========================================================================= */
/* THEME SYSTEM: 3 DISTINCT PALETTES (Dark Obsidian, Ocean Blue, Enterprise Light) */
/* ========================================================================= */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* 1. DARK THEME (🖤 Obsidian Jet / True Carbon) */
:root, [data-theme="dark"], [data-theme="dark-obsidian"] {
  --bg-surface-950: #000000;
  --bg-surface-900: #09090b;
  --bg-surface-850: #121215;
  --bg-surface-800: #18181b;
  --bg-surface-750: #222226;
  --bg-surface-700: #27272a;
  --bg-surface-600: #3f3f46;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.2);
  --glass-bg: rgba(14, 14, 17, 0.88);
  --glass-modal-bg: rgba(9, 9, 11, 0.98);
  --scrollbar-thumb: rgba(255, 255, 255, 0.2);
  --scrollbar-track: #000000;
  --chart-grid: rgba(255, 255, 255, 0.08);
  --chart-text: #a1a1aa;
  --code-bg: #000000;
  --card-bg: #09090b;
  --card-border: rgba(255, 255, 255, 0.1);
  --canvas-neutral: #000000;
}

/* 2. BLUE THEME (🌌 Midnight Navy / Deep Ocean) */
[data-theme="blue"], [data-theme="dark-ocean"] {
  --bg-surface-950: #06080e;
  --bg-surface-900: #0a0f18;
  --bg-surface-850: #0f1726;
  --bg-surface-800: #152033;
  --bg-surface-750: #1c2b44;
  --bg-surface-700: #243655;
  --bg-surface-600: #324870;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --glass-bg: rgba(15, 23, 38, 0.82);
  --glass-modal-bg: rgba(10, 15, 24, 0.96);
  --scrollbar-thumb: rgba(255, 255, 255, 0.15);
  --scrollbar-track: rgba(10, 15, 24, 0.6);
  --chart-grid: rgba(255, 255, 255, 0.08);
  --chart-text: #94a3b8;
  --code-bg: #06080e;
  --card-bg: #0a0f18;
  --card-border: rgba(255, 255, 255, 0.08);
  --canvas-neutral: #06080e;
}

/* 3. LIGHT THEME (☀️ Crisp Enterprise Slate & Pure White) */
[data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], html.light {
  --bg-surface-950: #f7f9fb;
  --bg-surface-900: #ffffff;
  --bg-surface-850: #f1f4f7;
  --bg-surface-800: #edf0f4;
  --bg-surface-750: #d7e2ed;
  --bg-surface-700: #94a3b8;
  --bg-surface-600: #64748b;
  --text-primary: #222222;
  --text-secondary: #333333;
  --text-muted: #555555;
  --border-subtle: #d7e2ed;
  --border-medium: #d7e2ed;
  --glass-bg: rgba(255, 255, 255, 0.98);
  --glass-modal-bg: #ffffff;
  --scrollbar-thumb: rgba(15, 23, 42, 0.22);
  --scrollbar-track: #f7f9fb;
  --chart-grid: rgba(0, 0, 0, 0.06);
  --chart-text: #555555;
  --code-bg: #edf0f4;
  --card-bg: #ffffff;
  --card-border: #d7e2ed;
  --canvas-neutral: #f7f9fb;
}

/* Explicit Surface Fallbacks */
.bg-surface-950 { background-color: var(--bg-surface-950) !important; }
.bg-surface-900 { background-color: var(--bg-surface-900) !important; }
.bg-surface-850 { background-color: var(--bg-surface-850) !important; }
.bg-surface-800 { background-color: var(--bg-surface-800) !important; }
.bg-surface-750 { background-color: var(--bg-surface-750) !important; }
.bg-surface-700 { background-color: var(--bg-surface-700) !important; }
.bg-surface-600 { background-color: var(--bg-surface-600) !important; }

/* Theme Transition Smoothing */
html.theme-transition,
html.theme-transition body,
html.theme-transition aside,
html.theme-transition header,
html.theme-transition .glass-panel,
html.theme-transition .glass-modal,
html.theme-transition button,
html.theme-transition select,
html.theme-transition input,
html.theme-transition tr,
html.theme-transition td {
  transition: background-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.22s cubic-bezier(0.4, 0, 0.2, 1),
              color 0.18s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ========================================================================= */
/* 4. LIGHT THEME HIGH CONTRAST & TYPOGRAPHY OVERRIDES                      */
/* ========================================================================= */
[data-theme="light"] body,
[data-theme="light-enterprise"] body,
[data-theme="light-pure"] body,
html.light body {
  color: #0f172a;
}

[data-theme="light"] .text-white,
[data-theme="light-enterprise"] .text-white,
[data-theme="light-pure"] .text-white,
html.light .text-white {
  color: #222222 !important;
}

[data-theme="light"] .text-slate-100,
[data-theme="light-enterprise"] .text-slate-100,
[data-theme="light-pure"] .text-slate-100,
html.light .text-slate-100 {
  color: #222222 !important;
}

[data-theme="light"] .text-slate-200,
[data-theme="light-enterprise"] .text-slate-200,
[data-theme="light-pure"] .text-slate-200,
html.light .text-slate-200 {
  color: #333333 !important;
}

[data-theme="light"] .text-slate-300,
[data-theme="light-enterprise"] .text-slate-300,
[data-theme="light-pure"] .text-slate-300,
html.light .text-slate-300 {
  color: #333333 !important;
}

[data-theme="light"] .text-slate-400,
[data-theme="light-enterprise"] .text-slate-400,
[data-theme="light-pure"] .text-slate-400,
html.light .text-slate-400 {
  color: #555555 !important;
}

[data-theme="light"] .text-slate-500,
[data-theme="light-enterprise"] .text-slate-500,
[data-theme="light-pure"] .text-slate-500,
html.light .text-slate-500 {
  color: #666666 !important;
}

/* WCAG AA (>= 4.5:1) Accent & Semantic Color Token Overrides in Light Mode */
:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(.text-blue-400, .text-blue-300, .text-blue-200, .text-sky-300, .text-sky-400) {
  color: #1d4ed8 !important; /* > 5.8:1 on #ffffff */
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(.text-purple-400, .text-purple-300, .text-purple-200, .text-violet-300, .text-violet-400) {
  color: #6b21a8 !important; /* > 6.4:1 on #ffffff */
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(.text-cyan-400, .text-cyan-300, .text-cyan-200) {
  color: #0e7490 !important; /* > 4.8:1 on #ffffff */
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(.text-emerald-400, .text-emerald-300, .text-emerald-200, .text-teal-400) {
  color: #065f46 !important; /* > 6.5:1 on #ffffff */
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(.text-amber-400, .text-amber-300, .text-amber-200, .text-yellow-400, .text-yellow-500, .text-orange-400, .text-orange-300) {
  color: #92400e !important; /* > 5.5:1 on #ffffff */
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(.text-rose-400, .text-rose-300, .text-rose-200, .text-rose-100, .text-red-400, .text-red-300, .text-red-200, .text-red-100) {
  color: #991b1b !important; /* > 6.8:1 on #ffffff */
}

/* Code context callout & danger panels in light mode */
:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) .bg-rose-950\/90 {
  background-color: #fef2f2 !important;
  border-color: #fca5a5 !important;
}
:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) .bg-rose-950\/90 .text-white {
  color: #7f1d1d !important;
}
:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) .bg-rose-950\/90 .text-rose-300\/80 {
  color: #991b1b !important;
}
:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) .bg-rose-950\/40 {
  background-color: #fff1f2 !important;
  border-color: #fecdd3 !important;
}
:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) .bg-amber-950\/40 {
  background-color: #fffbeb !important;
  border-color: #fde68a !important;
}

/* Hover & Background Utilities in Light Mode */
[data-theme="light"] .hover\:text-white:hover,
[data-theme="light-enterprise"] .hover\:text-white:hover,
[data-theme="light-pure"] .hover\:text-white:hover,
html.light .hover\:text-white:hover {
  color: #0f172a;
}

[data-theme="light"] .bg-white\/5,
[data-theme="light"] .bg-white\/10,
[data-theme="light-enterprise"] .bg-white\/5,
[data-theme="light-enterprise"] .bg-white\/10,
[data-theme="light-pure"] .bg-white\/5,
[data-theme="light-pure"] .bg-white\/10,
html.light .bg-white\/5,
html.light .bg-white\/10 {
  background-color: rgba(15, 23, 42, 0.05) !important;
}

[data-theme="light"] .hover\:bg-white\/5:hover,
[data-theme="light"] .hover\:bg-white\/10:hover,
[data-theme="light-enterprise"] .hover\:bg-white\/5:hover,
[data-theme="light-enterprise"] .hover\:bg-white\/10:hover,
[data-theme="light-pure"] .hover\:bg-white\/5:hover,
[data-theme="light-pure"] .hover\:bg-white\/10:hover,
html.light .hover\:bg-white\/5:hover,
html.light .hover\:bg-white\/10:hover {
  background-color: rgba(15, 23, 42, 0.08) !important;
}

[data-theme="light"] .border-white\/5,
[data-theme="light"] .border-white\/10,
[data-theme="light"] .border-white\/20,
[data-theme="light"] .border-white\/30,
[data-theme="light-enterprise"] .border-white\/5,
[data-theme="light-enterprise"] .border-white\/10,
[data-theme="light-enterprise"] .border-white\/20,
[data-theme="light-enterprise"] .border-white\/30,
[data-theme="light-pure"] .border-white\/5,
[data-theme="light-pure"] .border-white\/10,
[data-theme="light-pure"] .border-white\/20,
[data-theme="light-pure"] .border-white\/30,
html.light .border-white\/5,
html.light .border-white\/10,
html.light .border-white\/20,
html.light .border-white\/30 {
  border-color: rgba(15, 23, 42, 0.12) !important;
}

/* Sidebar & Header in light mode */
[data-theme="light"] aside,
[data-theme="light-enterprise"] aside,
[data-theme="light-pure"] aside,
html.light aside {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="light"] header,
[data-theme="light-enterprise"] header,
[data-theme="light-pure"] header,
html.light header {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* Sidebar Nav Buttons & Workspace container in Light Mode */
[data-theme="light"] #navGroupPortfolio,
[data-theme="light"] #navGroupWorkspace,
[data-theme="light"] #navGroupAdmin,
[data-theme="light-enterprise"] #navGroupPortfolio,
[data-theme="light-enterprise"] #navGroupWorkspace,
[data-theme="light-enterprise"] #navGroupAdmin,
html.light #navGroupPortfolio,
html.light #navGroupWorkspace,
html.light #navGroupAdmin {
  color: #0f172a;
}

[data-theme="light"] #navGroupWorkspace,
[data-theme="light-enterprise"] #navGroupWorkspace,
html.light #navGroupWorkspace {
  background-color: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] #navWorkspaceReturnPrompt,
[data-theme="light-enterprise"] #navWorkspaceReturnPrompt,
html.light #navWorkspaceReturnPrompt {
  background-color: #ffffff !important;
  border-color: #cbd5e1 !important;
}

/* Inactive Sidebar Buttons in Light Mode */
:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"]) aside button:not([class*="bg-blue-600/"]):not([class*="bg-blue-500/"]):not([class~="bg-blue-600"]):not([class~="bg-purple-600"]):not([class*="bg-purple-600/"]):not([class*="bg-emerald-600/"]) {
  color: #334155 !important;
  background-color: transparent !important;
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"]) aside button:not([class*="bg-blue-600/"]):not([class*="bg-blue-500/"]):not([class~="bg-blue-600"]):not([class~="bg-purple-600"]):not([class*="bg-purple-600/"]):not([class*="bg-emerald-600/"]) span {
  color: #334155 !important;
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"]) aside button:not([class*="bg-blue-600/"]):not([class*="bg-blue-500/"]):not([class~="bg-blue-600"]):not([class~="bg-purple-600"]):not([class*="bg-purple-600/"]):not([class*="bg-emerald-600/"]):hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"]) aside button:not([class*="bg-blue-600/"]):not([class*="bg-blue-500/"]):not([class~="bg-blue-600"]):not([class~="bg-purple-600"]):not([class*="bg-purple-600/"]):not([class*="bg-emerald-600/"]):hover span {
  color: #0f172a !important;
}

/* ACTIVE Sidebar Button in Light Mode */
:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"]) aside button:is([class*="bg-blue-600/"], [class*="bg-blue-500/"], [class~="bg-blue-600"], [class*="text-blue-400"], [id^="nav-"][class*="bg-blue-"]) {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1.5px solid #60a5fa !important;
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.16) !important;
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"]) aside button:is([class*="bg-blue-600/"], [class*="bg-blue-500/"], [class~="bg-blue-600"], [class*="text-blue-400"], [id^="nav-"][class*="bg-blue-"]) :is(span, svg, div) {
  color: #1d4ed8 !important;
  font-weight: 700 !important;
}

/* ========================================================================= */
/* SOLID ACTION BUTTONS & PILLS (FORCE CRISP WHITE TEXT ON SOLID BACKGROUNDS) */
/* ========================================================================= */
:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(
  button.bg-blue-600,
  button.bg-blue-500,
  button.bg-blue-700,
  button.bg-indigo-600,
  button.bg-indigo-500,
  button.bg-indigo-700,
  button.bg-purple-600,
  button.bg-purple-500,
  button.bg-purple-700,
  button.bg-emerald-600,
  button.bg-emerald-500,
  button.bg-emerald-700,
  button.bg-rose-600,
  button.bg-rose-500,
  button.bg-red-600,
  button.bg-red-500,
  button.bg-amber-600,
  button.bg-amber-500,
  a.bg-blue-600,
  a.bg-indigo-600,
  a.bg-purple-600,
  a.bg-emerald-600,
  a.bg-rose-600,
  a.bg-red-600,
  a.bg-amber-600,
  .auth-btn-primary,
  .btn-primary,
  .badge-solid,
  #btnGateUnifiedSubmit
):not(aside button) {
  color: #ffffff !important;
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(
  button.bg-blue-600,
  button.bg-blue-500,
  button.bg-blue-700,
  button.bg-indigo-600,
  button.bg-indigo-500,
  button.bg-indigo-700,
  button.bg-purple-600,
  button.bg-purple-500,
  button.bg-purple-700,
  button.bg-emerald-600,
  button.bg-emerald-500,
  button.bg-emerald-700,
  button.bg-rose-600,
  button.bg-rose-500,
  button.bg-red-600,
  button.bg-red-500,
  button.bg-amber-600,
  button.bg-amber-500,
  a.bg-blue-600,
  a.bg-indigo-600,
  a.bg-purple-600,
  a.bg-emerald-600,
  a.bg-rose-600,
  a.bg-red-600,
  a.bg-amber-600,
  .auth-btn-primary,
  .btn-primary,
  .badge-solid,
  #btnGateUnifiedSubmit
):not(aside button) :is(*, span, svg, div, p, b, strong, i, .text-white, .text-slate-100, .text-slate-200, .text-slate-300, .text-blue-100, .text-blue-200) {
  color: #ffffff !important;
}

/* Hover on solid dark/colored buttons in light theme */
:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(
  button[class*="hover:bg-blue-"]:hover,
  button[class*="hover:bg-indigo-"]:hover,
  button[class*="hover:bg-purple-"]:hover,
  button[class*="hover:bg-emerald-"]:hover,
  button[class*="hover:bg-rose-"]:hover,
  button[class*="hover:bg-red-"]:hover,
  button[class*="hover:bg-amber-"]:hover,
  a[class*="hover:bg-blue-"]:hover,
  a[class*="hover:bg-indigo-"]:hover,
  a[class*="hover:bg-purple-"]:hover,
  a[class*="hover:bg-emerald-"]:hover
):not([class*="hover:bg-blue-600/"]):not([class*="hover:bg-blue-500/"]):not([class*="hover:bg-purple-600/"]):not([class*="hover:bg-emerald-600/"]):not([class*="hover:bg-rose-600/"]):not(aside button) {
  color: #ffffff !important;
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(
  button[class*="hover:bg-blue-"]:hover,
  button[class*="hover:bg-indigo-"]:hover,
  button[class*="hover:bg-purple-"]:hover,
  button[class*="hover:bg-emerald-"]:hover,
  button[class*="hover:bg-rose-"]:hover,
  button[class*="hover:bg-red-"]:hover,
  button[class*="hover:bg-amber-"]:hover,
  a[class*="hover:bg-blue-"]:hover,
  a[class*="hover:bg-indigo-"]:hover,
  a[class*="hover:bg-purple-"]:hover,
  a[class*="hover:bg-emerald-"]:hover
):not([class*="hover:bg-blue-600/"]):not([class*="hover:bg-blue-500/"]):not([class*="hover:bg-purple-600/"]):not([class*="hover:bg-emerald-600/"]):not([class*="hover:bg-rose-600/"]):not(aside button) :is(*, span, svg, div, p, b, strong, i, .text-white, .text-slate-100, .text-slate-200, .text-slate-300) {
  color: #ffffff !important;
}

/* ========================================================================= */
/* TRANSLUCENT BADGES, BUTTONS & SUBTABS IN LIGHT MODE                       */
/* ========================================================================= */
:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(
  .bg-blue-500\/10,
  .bg-blue-500\/15,
  .bg-blue-500\/20,
  .bg-blue-500\/30,
  .bg-blue-600\/10,
  .bg-blue-600\/15,
  .bg-blue-600\/20,
  .bg-blue-600\/25,
  .bg-blue-600\/30,
  .bg-sky-500\/20,
  button[class*="bg-blue-600/"],
  button[class*="bg-blue-500/"],
  [id^="subtab-btn-"][class*="bg-blue-600/"],
  [id^="chip-sev-"][class*="bg-blue-600/"],
  [id^="scanCat-"][class*="bg-blue-600/"],
  [id^="cloneFmt-"][class*="bg-blue-600/"],
  [id^="toolSubTab-"][class*="bg-blue-600/"],
  #sonarSyncBtn,
  #devInnerTab-overview
):not(aside button) {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #93c5fd !important;
  font-weight: 700 !important;
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(
  .bg-blue-500\/10,
  .bg-blue-500\/15,
  .bg-blue-500\/20,
  .bg-blue-500\/30,
  .bg-blue-600\/10,
  .bg-blue-600\/15,
  .bg-blue-600\/20,
  .bg-blue-600\/25,
  .bg-blue-600\/30,
  .bg-sky-500\/20,
  button[class*="bg-blue-600/"],
  button[class*="bg-blue-500/"],
  [id^="subtab-btn-"][class*="bg-blue-600/"],
  [id^="chip-sev-"][class*="bg-blue-600/"],
  [id^="scanCat-"][class*="bg-blue-600/"],
  [id^="cloneFmt-"][class*="bg-blue-600/"],
  [id^="toolSubTab-"][class*="bg-blue-600/"],
  #sonarSyncBtn,
  #devInnerTab-overview
):not(aside button) :is(*, span, svg, div) {
  color: #1d4ed8 !important;
  font-weight: 700 !important;
}

/* Badges inside light mode */
[data-theme="light"] .bg-amber-500\/20,
[data-theme="light-enterprise"] .bg-amber-500\/20,
[data-theme="light-pure"] .bg-amber-500\/20,
html.light .bg-amber-500\/20,
[data-theme="light"] #navIssuesBadge,
[data-theme="light-enterprise"] #navIssuesBadge,
[data-theme="light-pure"] #navIssuesBadge,
html.light #navIssuesBadge,
[data-theme="light"] aside button #navIssuesBadge,
[data-theme="light-enterprise"] aside button #navIssuesBadge,
html.light aside button #navIssuesBadge {
  background-color: #fef3c7 !important;
  border: 1px solid #f59e0b !important;
  color: #b45309 !important;
  font-weight: 800 !important;
}

[data-theme="light"] .bg-yellow-500\/20,
[data-theme="light-enterprise"] .bg-yellow-500\/20,
html.light .bg-yellow-500\/20 {
  background-color: #fef9c3 !important;
  border-color: #fde047 !important;
  color: #854d0e !important;
}

[data-theme="light"] .bg-orange-500\/20,
[data-theme="light-enterprise"] .bg-orange-500\/20,
html.light .bg-orange-500\/20 {
  background-color: #ffedd5 !important;
  border-color: #fdba74 !important;
  color: #c2410c !important;
}

[data-theme="light"] .bg-indigo-500\/20,
[data-theme="light-enterprise"] .bg-indigo-500\/20,
html.light .bg-indigo-500\/20,
:is(html.light, [data-theme*="light"]) :is(.bg-indigo-500\/10, .bg-indigo-500\/15, .bg-indigo-500\/25, .bg-indigo-600\/20, .bg-indigo-600\/30, button[class*="bg-indigo-500/"]) {
  background-color: #e0e7ff !important;
  border-color: #c7d2fe !important;
  color: #4338ca !important;
}
:is(html.light, [data-theme*="light"]) button[class*="bg-indigo-500/"] :is(*, span, svg) {
  color: #4338ca !important;
}

[data-theme="light"] .bg-purple-500\/20,
[data-theme="light-enterprise"] .bg-purple-500\/20,
[data-theme="light-pure"] .bg-purple-500\/20,
html.light .bg-purple-500\/20,
:is(html.light, [data-theme*="light"]) :is(.bg-purple-500\/10, .bg-purple-500\/15, .bg-purple-600\/20, .bg-purple-600\/30, button[class*="bg-purple-500/"], button[class*="bg-purple-600/"]) {
  background-color: #f3e8ff !important;
  border-color: #d8b4fe !important;
  color: #6b21a8 !important;
}
:is(html.light, [data-theme*="light"]) :is(button[class*="bg-purple-500/"], button[class*="bg-purple-600/"], #btnGateKeycloakDirect) :is(*, span, svg) {
  color: #6b21a8 !important;
}

[data-theme="light"] .bg-cyan-500\/20,
[data-theme="light-enterprise"] .bg-cyan-500\/20,
html.light .bg-cyan-500\/20,
:is(html.light, [data-theme*="light"]) :is(.bg-cyan-500\/10, .bg-cyan-600\/20, .bg-cyan-600\/30, button[class*="bg-cyan-500/"], button[class*="bg-cyan-600/"]) {
  background-color: #cffafe !important;
  border-color: #a5f3fc !important;
  color: #0e7490 !important;
}
:is(html.light, [data-theme*="light"]) :is(button[class*="bg-cyan-500/"], button[class*="bg-cyan-600/"]) :is(*, span, svg) {
  color: #0e7490 !important;
}

[data-theme="light"] .bg-emerald-500\/20,
[data-theme="light-enterprise"] .bg-emerald-500\/20,
[data-theme="light-pure"] .bg-emerald-500\/20,
html.light .bg-emerald-500\/20,
:is(html.light, [data-theme*="light"]) :is(.bg-emerald-500\/10, .bg-emerald-500\/15, .bg-emerald-600\/20, .bg-emerald-600\/30, button[class*="bg-emerald-500/"], button[class*="bg-emerald-600/"]) {
  background-color: #d1fae5 !important;
  border-color: #6ee7b7 !important;
  color: #065f46 !important;
}
:is(html.light, [data-theme*="light"]) :is(button[class*="bg-emerald-500/"], button[class*="bg-emerald-600/"]) :is(*, span, svg) {
  color: #065f46 !important;
}

[data-theme="light"] .bg-rose-500\/20,
[data-theme="light"] .bg-red-500\/20,
[data-theme="light-enterprise"] .bg-rose-500\/20,
[data-theme="light-enterprise"] .bg-red-500\/20,
html.light .bg-rose-500\/20,
html.light .bg-red-500\/20,
:is(html.light, [data-theme*="light"]) :is(.bg-rose-500\/10, .bg-rose-500\/15, .bg-red-500\/10, .bg-rose-600\/20, .bg-rose-600\/30, .bg-red-600\/20, .bg-red-600\/30, button[class*="bg-rose-500/"], button[class*="bg-red-500/"], button[class*="bg-red-600/"]) {
  background-color: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
}
:is(html.light, [data-theme*="light"]) :is(button[class*="bg-rose-500/"], button[class*="bg-red-600/"]) :is(*, span, svg) {
  color: #b91c1c !important;
}

/* Neutral Slate / Standard Badges in Dark & Light Modes */
.badge-standard {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  background-color: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.badge-standard .material-symbols-outlined {
  color: #94a3b8;
  font-size: 13px;
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) .badge-standard {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  font-weight: 800 !important;
}
:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) .badge-standard :is(*, span, svg) {
  color: #334155 !important;
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(.bg-slate-500\/20, .bg-slate-500\/10, .bg-slate-600\/20) {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
  font-weight: 700 !important;
}
:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) :is(.bg-slate-500\/20, .bg-slate-500\/10, .bg-slate-600\/20) :is(*, span, svg) {
  color: #334155 !important;
}

/* Micro Tech Stack Badges (e.g. YAML/JSON, XML, JavaScript, C++, Python) */
.tech-stack-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--mui-font-mono, monospace);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
}

:is([data-theme="dark"], [data-theme="dark-obsidian"], [data-theme="blue"], [data-theme="dark-ocean"], html.dark, :root:not(.light):not([data-theme*="light"])) .tech-stack-pill {
  background-color: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
}

:is(html.light, [data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], [data-theme*="light"]) .tech-stack-pill {
  background-color: #f1f4f7 !important;
  border: 1px solid #d7e2ed !important;
  color: #334155 !important;
}


/* Pink / Magenta Subtabs & Badges in Light Mode */
:is([data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], html.light) :is(
  .text-pink-300,
  .text-pink-400,
  .text-pink-500
) {
  color: #9d174d !important;
}

:is([data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], html.light) :is(
  .bg-pink-500\/10,
  .bg-pink-500\/20,
  .bg-pink-600\/30,
  .bg-pink-500\/30
) {
  background-color: #fce7f3 !important;
  border-color: #f472b6 !important;
  color: #9d174d !important;
}

:is([data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], html.light) [id^="subtab-dna-"][class*="bg-pink-"] {
  background-color: #fce7f3 !important;
  border-color: #f472b6 !important;
  color: #9d174d !important;
}

:is([data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], html.light) [id^="subtab-dna-"][class*="bg-pink-"] span {
  color: #9d174d !important;
  font-weight: 700 !important;
}

/* Teal & Cyan Subtabs & Badges in Light Mode */
:is([data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], html.light) :is(
  .text-teal-300,
  .text-teal-400
) {
  color: #0f766e !important;
}

:is([data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], html.light) :is(
  .bg-teal-500\/10,
  .bg-teal-500\/20,
  .bg-teal-600\/30
) {
  background-color: #ccfbf1 !important;
  border-color: #5eead4 !important;
  color: #115e59 !important;
}

/* People Hub Subtab Pills in Light Mode */
:is([data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], html.light) #peopleSubTab-dev[class*="bg-emerald-"] {
  background-color: #d1fae5 !important;
  border-color: #34d399 !important;
  color: #065f46 !important;
}
:is([data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], html.light) #peopleSubTab-dev[class*="bg-emerald-"] span {
  color: #065f46 !important;
  font-weight: 600 !important;
}

/* AI Remediation Callout Box in Light Mode */
:is([data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], html.light) .bg-indigo-950\/40 {
  background-color: #eef2ff !important;
  border: 1px solid #c7d2fe !important;
  color: #1e1b4b !important;
}

:is([data-theme="light"], [data-theme="light-enterprise"], [data-theme="light-pure"], html.light) .bg-indigo-950\/40 .text-indigo-200 {
  color: #1e1b4b !important;
}

/* ========================================================================= */
/* RECURRING ISSUES & AI MENTORSHIP DOSSIER HIGH-CONTRAST SYSTEM */
/* ========================================================================= */
.recurring-issue-item {
  background-color: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.875rem;
  padding: 1rem;
  transition: all 0.2s ease-in-out;
}

.recurring-remediation-callout {
  background-color: rgba(49, 46, 129, 0.35);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #c7d2fe;
  border-radius: 0.625rem;
  padding: 0.75rem;
  font-size: var(--fontSz14);
  line-height: 1.5;
}

.recurring-remediation-callout .remediation-title {
  color: #a5b4fc;
  font-weight: 700;
}

.ai-mentorship-dossier-panel {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.75) 0%, rgba(59, 7, 100, 0.75) 100%);
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

/* Light Theme Overrides - 100% Crystal Clear High Contrast */
:is(html.light, [data-theme*="light"]) .recurring-issue-item {
  background-color: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
}

:is(html.light, [data-theme*="light"]) .recurring-issue-item .issue-category-title {
  color: #0f172a !important;
  font-weight: 800 !important;
}

:is(html.light, [data-theme*="light"]) .recurring-issue-item .issue-desc-text {
  color: #334155 !important;
}

:is(html.light, [data-theme*="light"]) .recurring-remediation-callout {
  background-color: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  color: #1e3a8a !important;
  box-shadow: 0 1px 2px rgba(59, 130, 246, 0.05) !important;
}

:is(html.light, [data-theme*="light"]) .recurring-remediation-callout .remediation-title {
  color: #1d4ed8 !important;
  font-weight: 800 !important;
}

:is(html.light, [data-theme*="light"]) .ai-mentorship-dossier-panel {
  background-image: none !important;
  background: linear-gradient(135deg, #f8fafc 0%, #ede9fe 100%) !important;
  border: 1px solid #c7d2fe !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08) !important;
}

:is(html.light, [data-theme*="light"]) .ai-mentorship-dossier-panel .mentorship-header-title {
  color: #4338ca !important;
  font-weight: 900 !important;
}

:is(html.light, [data-theme*="light"]) .ai-mentorship-dossier-panel .mentorship-strengths-heading {
  color: #15803d !important;
  font-weight: 800 !important;
}

:is(html.light, [data-theme*="light"]) .ai-mentorship-dossier-panel .mentorship-growth-heading {
  color: #c2410c !important;
  font-weight: 800 !important;
}

:is(html.light, [data-theme*="light"]) #devMentorshipStrengths li,
:is(html.light, [data-theme*="light"]) #devMentorshipGrowth li {
  color: #1e293b !important;
  font-weight: 500 !important;
}

:is(html.light, [data-theme*="light"]) .mentorship-badge-item {
  background-color: #f3e8ff !important;
  border: 1px solid #d8b4fe !important;
  color: #6b21a8 !important;
  font-weight: 700 !important;
}

/* Glass Panels & Modals in Light Mode */
[data-theme="light"] .glass-panel,
[data-theme="light-enterprise"] .glass-panel,
[data-theme="light-pure"] .glass-panel,
html.light .glass-panel {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .glass-modal,
[data-theme="light-enterprise"] .glass-modal,
[data-theme="light-pure"] .glass-modal,
html.light .glass-modal {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
}

/* ========================================================================= */
/* INTERACTIVE METRIC & COMPOSITE KPI CARDS (AFFORDANCE & FORMULA INSPECTOR) */
/* ========================================================================= */
.metric-card-interactive {
  position: relative;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.metric-card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -6px rgba(59, 130, 246, 0.25);
  border-color: rgba(96, 165, 250, 0.5) !important;
}

.metric-card-interactive .metric-interactive-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--fontSz14);
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease-in-out;
  white-space: nowrap;
}

.metric-card-interactive:hover .metric-interactive-badge {
  background: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.6);
  transform: scale(1.04);
}

:is(html.light, [data-theme*="light"]) .metric-card-interactive .metric-interactive-badge {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #93c5fd !important;
}

:is(html.light, [data-theme*="light"]) .metric-card-interactive:hover .metric-interactive-badge {
  background: #dbeafe !important;
  color: #1e40af !important;
  border-color: #3b82f6 !important;
}

/* ========================================================================= */
/* 5. WCAG AA CONTRAST COMPLIANCE: SIGN OUT, VIEW TOGGLES, INSPECT ACTIONS   */
/* ========================================================================= */

/* 5.1 Sign Out Button (fixes washed out salmon badge in light mode) */
:is(html.light, [data-theme*="light"]) button[onclick*="logoutActiveSession"] {
  background-color: #fee2e2 !important;
  border: 1px solid #f87171 !important;
  color: #991b1b !important;
  font-weight: 700 !important;
}
:is(html.light, [data-theme*="light"]) button[onclick*="logoutActiveSession"]:hover {
  background-color: #dc2626 !important;
  color: #ffffff !important;
  border-color: #b91c1c !important;
}
:is(html.light, [data-theme*="light"]) button[onclick*="logoutActiveSession"] :is(span, svg, div) {
  color: inherit !important;
}

/* 5.2 Cards / Compact density toggle buttons on Projects Hub */
:is(html.light, [data-theme*="light"]) :is(#densityBtn-cards, #densityBtn-list):not(.bg-blue-600):not(.bg-cyan-600) {
  color: #334155 !important;
  background-color: transparent !important;
  font-weight: 700 !important;
}
:is(html.light, [data-theme*="light"]) :is(#densityBtn-cards, #densityBtn-list):not(.bg-blue-600):not(.bg-cyan-600):hover {
  color: #0f172a !important;
  background-color: #e2e8f0 !important;
}
:is(html.light, [data-theme*="light"]) :is(#densityBtn-cards, #densityBtn-list):not(.bg-blue-600):not(.bg-cyan-600) svg {
  stroke: #334155 !important;
}
:is(html.light, [data-theme*="light"]) :is(#densityBtn-cards, #densityBtn-list):not(.bg-blue-600):not(.bg-cyan-600):hover svg {
  stroke: #0f172a !important;
}

/* 5.3 Inspect Actions across Cockpit Problem Cards, Tables & SlideOver triggers */
:is(html.light, [data-theme*="light"]) :is(
  #macroTop10IssuesContainer button,
  #cockpitToxicComponentsTable button,
  button[onclick*="inspectToxicComponent"],
  button[onclick*="openSlideOverDefect"],
  button[onclick*="inspectDiffDefect"],
  button[onclick*="inspectDeveloper360"]
) {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #93c5fd !important;
  font-weight: 700 !important;
}
:is(html.light, [data-theme*="light"]) :is(
  #macroTop10IssuesContainer button:hover,
  #cockpitToxicComponentsTable button:hover,
  button[onclick*="inspectToxicComponent"]:hover,
  button[onclick*="openSlideOverDefect"]:hover,
  button[onclick*="inspectDiffDefect"]:hover,
  button[onclick*="inspectDeveloper360"]:hover
) {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
}
:is(html.light, [data-theme*="light"]) :is(
  #macroTop10IssuesContainer button:hover :is(*, span, svg, div),
  #cockpitToxicComponentsTable button:hover :is(*, span, svg, div),
  button[onclick*="inspectToxicComponent"]:hover :is(*, span, svg, div),
  button[onclick*="openSlideOverDefect"]:hover :is(*, span, svg, div),
  button[onclick*="inspectDiffDefect"]:hover :is(*, span, svg, div),
  button[onclick*="inspectDeveloper360"]:hover :is(*, span, svg, div)
) {
  color: #ffffff !important;
}

/* General bg-surface-800 interactive buttons in light mode: crisp borders and dark text */
:is(html.light, [data-theme*="light"]) button.bg-surface-800,
:is(html.light, [data-theme*="light"]) button[class*="bg-surface-800"] {
  background-color: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}
:is(html.light, [data-theme*="light"]) button.bg-surface-800:hover,
:is(html.light, [data-theme*="light"]) button[class*="bg-surface-800"]:hover {
  background-color: #2563eb !important;
  color: #ffffff !important;
  border-color: #1d4ed8 !important;
}
:is(html.light, [data-theme*="light"]) button.bg-surface-800:hover :is(*, span, svg, div),
:is(html.light, [data-theme*="light"]) button[class*="bg-surface-800"]:hover :is(*, span, svg, div) {
  color: #ffffff !important;
}

/* 5.4 Defect Explorer Quick Filters & Status Toggles in Light Mode */
:is(html.light, [data-theme*="light"]) :is(#btn-quick-new-issues, #btn-quick-my-issues, #btn-quick-no-tests):not(.active-quick-filter) {
  background-color: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
  font-weight: 600 !important;
}
:is(html.light, [data-theme*="light"]) :is(#btn-quick-new-issues, #btn-quick-my-issues, #btn-quick-no-tests):not(.active-quick-filter):hover {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}
:is(html.light, [data-theme*="light"]) :is(#btn-quick-new-issues, #btn-quick-my-issues, #btn-quick-no-tests).active-quick-filter {
  background-color: #eff6ff !important;
  border: 1.5px solid #3b82f6 !important;
  color: #1d4ed8 !important;
  font-weight: 800 !important;
}

:is(html.light, [data-theme*="light"]) :is(#btn-issues-filter-open, #btn-issues-filter-all, #btn-issues-filter-resolved):not(.bg-blue-600) {
  color: #334155 !important;
  background-color: transparent !important;
  font-weight: 600 !important;
}
:is(html.light, [data-theme*="light"]) :is(#btn-issues-filter-open, #btn-issues-filter-all, #btn-issues-filter-resolved):not(.bg-blue-600):hover {
  color: #0f172a !important;
  background-color: #f1f5f9 !important;
}

/* ========================================================================= */
/* MOBILE SIDEBAR DRAWER (Responsive off-canvas on < 1024px) */
/* ========================================================================= */
@media (max-width: 1023px) {
  #appSidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  }
  #appSidebar.mobile-open {
    transform: translateX(0) !important;
  }
}

/* ========================================================================= */
/* SIDEBAR ACTIVE CONTEXT CARD HARMONY */
/* ========================================================================= */
:is(html.light, [data-theme*="light"]) #sidebarActiveContextCard {
  background-color: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}
:is(html.light, [data-theme*="light"]) #sidebarActiveContextCard:hover {
  background-color: #f8fafc !important;
  border-color: #cbd5e1 !important;
}
:is(html.light, [data-theme*="light"]) #navActiveProjectLabel {
  color: #0f172a !important;
}
:is(html.light, [data-theme*="light"]) #sidebarScopeTitle {
  color: #64748b !important;
}

