/* User-management detail panel theme repair.
 * The legacy detail view was authored as a dark-only surface. Keep the existing
 * structure/behavior, but make light mode authoritative for the full panel,
 * tab strip, cards, copy, and toggle tracks.
 */

html[data-theme="light"] [class*="bg-[rgba(10,12,18,0.96)]"],
html.light [class*="bg-[rgba(10,12,18,0.96)]"] {
  background: var(--mc-bg-primary, #fffdf8) !important;
  color: var(--mc-text-primary, #172033) !important;
  border-color: var(--mc-border, #dbe3ec) !important;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .18) !important;
}

html[data-theme="light"] [class*="bg-[rgba(10,12,18,0.96)]"] > div,
html.light [class*="bg-[rgba(10,12,18,0.96)]"] > div {
  color: var(--mc-text-primary, #172033);
}

/* Legacy tab copy was set inline to rgba(255,255,255,.6). Override it only
 * inside the user-detail panel, while preserving the active gold tab. */
html[data-theme="light"] [class*="bg-[rgba(10,12,18,0.96)]"] button[style*="rgba(255,255,255,0.6)"],
html.light [class*="bg-[rgba(10,12,18,0.96)]"] button[style*="rgba(255,255,255,0.6)"] {
  color: var(--mc-text-secondary, #475569) !important;
}

html[data-theme="light"] [class*="bg-[rgba(10,12,18,0.96)]"] :is(h1,h2,h3,h4,h5,h6,p,span,label)[class*="text-white"],
html.light [class*="bg-[rgba(10,12,18,0.96)]"] :is(h1,h2,h3,h4,h5,h6,p,span,label)[class*="text-white"] {
  color: var(--mc-text-primary, #172033) !important;
}

html[data-theme="light"] [class*="bg-[rgba(10,12,18,0.96)]"] [class*="text-white/50"],
html[data-theme="light"] [class*="bg-[rgba(10,12,18,0.96)]"] [class*="text-white/60"],
html[data-theme="light"] [class*="bg-[rgba(10,12,18,0.96)]"] [class*="text-white/70"],
html.light [class*="bg-[rgba(10,12,18,0.96)]"] [class*="text-white/50"],
html.light [class*="bg-[rgba(10,12,18,0.96)]"] [class*="text-white/60"],
html.light [class*="bg-[rgba(10,12,18,0.96)]"] [class*="text-white/70"] {
  color: var(--mc-text-muted, #64748b) !important;
}

/* Cards in the overview should read as cards, not gray slabs on black. */
html[data-theme="light"] [class*="bg-[rgba(10,12,18,0.96)]"] .mc-subcard,
html.light [class*="bg-[rgba(10,12,18,0.96)]"] .mc-subcard {
  background: var(--mc-surface-1, #fff) !important;
  color: var(--mc-text-primary, #172033) !important;
  border-color: var(--mc-border, #dbe3ec) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06) !important;
}

/* Off-state toggle tracks were white-on-light after the first compatibility
 * pass. Give them a visible neutral rail while leaving the thumb white. */
html[data-theme="light"] [class*="bg-[rgba(10,12,18,0.96)]"] button[class*="w-12"][class*="h-6"][class*="bg-white/20"],
html.light [class*="bg-[rgba(10,12,18,0.96)]"] button[class*="w-12"][class*="h-6"][class*="bg-white/20"] {
  background: #cbd5e1 !important;
  border: 1px solid #b6c2d0 !important;
}

html[data-theme="light"] [class*="bg-[rgba(10,12,18,0.96)]"] button[class*="w-12"][class*="h-6"] > span,
html.light [class*="bg-[rgba(10,12,18,0.96)]"] button[class*="w-12"][class*="h-6"] > span {
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(15,23,42,.22) !important;
}

/* Keep primary destructive/action button copy intentional. */
html[data-theme="light"] [class*="bg-[rgba(10,12,18,0.96)]"] :is(button,a)[data-allow-dark-text="true"] {
  color: #0a0a0f !important;
}

@media (max-width: 720px) {
  html[data-theme="light"] [class*="bg-[rgba(10,12,18,0.96)]"],
  html.light [class*="bg-[rgba(10,12,18,0.96)]"] {
    border-radius: 18px !important;
  }
}
