/*
    Theme overrides 2026-05-28 — fix readability issues from the prior
    PR (208) that flipped Color.Primary to brand yellow.

    The general rule: yellow as a BACKGROUND with black text reads great.
    Yellow as a TEXT color on a white/light background is invisible.

    MudBlazor 6.16 uses `var(--mud-palette-primary)` for both backgrounds
    (filled buttons, indicator bars) AND text colors (active nav/tab text).
    The background uses look correct after the flip; the text uses need
    explicit overrides to stay dark on white.

    Also: auth-page submit buttons use raw HTML `.btn-dark` (Bootstrap),
    not `MudButton Color.Primary`. The theme flip didn't reach them.
    Override `.btn-dark` to render brand yellow so the auth pages match
    the rest of the SPA.
*/

/* ============================================================================
   1. MudBlazor — Filled Primary AND Warning buttons MUST have black text on
      yellow. The theme's Warning color is the SAME brand yellow as
      Primary, but MudBlazor only gives Primary a black contrast text — filled
      Warning buttons (e.g. "Force Password Change", "Lock User" on the user
      edit pages) render white-on-yellow and are unreadable. Same brand rule
      (yellow background ⇒ black text). !important pins it regardless of
      specificity.
   ============================================================================ */
.mud-button-filled.mud-button-filled-primary,
.mud-button-filled-primary,
.mud-fab-primary,
.mud-button-filled.mud-button-filled-warning,
.mud-button-filled-warning,
.mud-fab-warning {
    color: var(--kp-black) !important;
}

.mud-button-filled.mud-button-filled-primary .mud-icon-root,
.mud-button-filled-primary .mud-icon-root,
.mud-button-filled.mud-button-filled-warning .mud-icon-root,
.mud-button-filled-warning .mud-icon-root {
    color: var(--kp-black) !important;
}

/* ============================================================================
   2. MudNavLink active state — text in the active menu item must be dark,
      not yellow. The yellow background tint stays.

      NOTE (2026-05-29): MudBlazor 6.16 marks the active link with the class
      `active` (NOT `mud-nav-link-active`), and colors it via
      `.mud-navmenu.mud-navmenu-{default,primary} .mud-nav-link.active`.
      The original PR 209 selector `.mud-nav-link-active` never matched, so the
      yellow text persisted. Target `.mud-nav-link.active` to match the real
      markup; keep the legacy class too in case a future MudBlazor bump renames.
   ============================================================================ */
.mud-navmenu .mud-nav-link.active,
.mud-navmenu .mud-nav-link.active:hover,
.mud-nav-link.active,
.mud-nav-link.mud-nav-link-active {
    color: var(--kp-gray-90) !important;
}

.mud-navmenu .mud-nav-link.active .mud-nav-link-icon,
.mud-navmenu .mud-nav-link.active .mud-nav-link-text,
.mud-nav-link.active .mud-nav-link-icon,
.mud-nav-link.active .mud-nav-link-text {
    color: var(--kp-gray-90) !important;
}

/* ============================================================================
   3. MudTabs active tab — text dark, underline bar stays yellow.
   ============================================================================ */
.mud-tabs .mud-tab.mud-tab-active,
.mud-tabs .mud-tab-active {
    color: var(--kp-gray-90) !important;
}

.mud-tabs .mud-tab.mud-tab-active .mud-icon-root {
    color: var(--kp-gray-90) !important;
}

/* The slider/indicator line under the active tab keeps the brand yellow —
   it's a brand accent and reads fine against the tab background. */
.mud-tabs-tabbar .mud-tabs-tabbar-slider {
    background: var(--kp-yellow) !important;
}

/* ============================================================================
   4. Bootstrap `.btn-dark` → brand yellow. Auth pages (Login, Register,
      ForgetPassword, ResetPassword, ForcePasswordChange, MfaChallenge,
      ApproveUser, InternalUserRegister) use raw HTML `<button class="btn btn-dark btn-lg">`
      for their primary submit. No other code path relies on `.btn-dark`
      looking dark (verified via grep 2026-05-28).
   ============================================================================ */
.btn.btn-dark,
button.btn-dark {
    background-color: var(--kp-yellow) !important;
    border-color: var(--kp-yellow) !important;
    color: var(--kp-black) !important;
}

.btn.btn-dark:hover,
.btn.btn-dark:focus,
.btn.btn-dark:active,
button.btn-dark:hover,
button.btn-dark:focus,
button.btn-dark:active {
    background-color: var(--kp-warning-bright) !important;
    border-color: var(--kp-warning-bright) !important;
    color: var(--kp-black) !important;
}

.btn.btn-dark:disabled,
button.btn-dark:disabled {
    background-color: var(--kp-gray-bs-200) !important;
    border-color: var(--kp-gray-bs-200) !important;
    color: var(--kp-gray-60) !important;
    opacity: 1;
}

/* ============================================================================
   5. Belt-and-braces — any element that uses MudBlazor's `text-primary`
      utility class for foreground color also gets darkened. Rare but
      possible in some KpPageShell breadcrumb crumbs.
   ============================================================================ */
.mud-text-primary,
a.mud-link.mud-link-primary {
    color: var(--kp-gray-90) !important;
}

/* Links keep being clickable — give them an info-blue accent on hover
   so the user has feedback (the yellow theme tone covers brand actions). */
a.mud-link.mud-link-primary:hover {
    color: var(--kp-info-bright) !important;
}

/* ============================================================================
   6. Floating input labels — the focused/active label must read dark, not
      brand-yellow. MudBlazor colors a focused input's label with
      Palette.Primary; on the yellow theme that's invisible. Applies to
      MudTextField AND MudSelect (both wrap their field in .mud-input-control).
      The input outline/underline keeps the brand yellow — only the TEXT is
      darkened (same rule used on the Manage Profile password fields).
   ============================================================================ */
.mud-input-control:focus-within label.mud-input-label,
.mud-input:focus-within ~ label.mud-input-label.mud-input-label-inputcontrol {
    color: var(--kp-gray-90) !important;
}

/* ============================================================================
   7. Dialog / message-box action buttons — a Text or Outlined Primary button
      renders brand-yellow TEXT, which is invisible on the white dialog surface.
      MudMessageBox's confirm button (e.g. "Impersonate", "Yes", "OK") defaults
      to a Text Primary MudButton, so it disappeared. Darken the text so the
      action reads. Filled Primary/Warning buttons are handled in §1 and keep
      their yellow background + black text.
   ============================================================================ */
.mud-dialog-actions .mud-button-text-primary,
.mud-dialog-actions .mud-button-outlined-primary {
    color: var(--kp-gray-90) !important;
}

.mud-dialog-actions .mud-button-text-primary .mud-icon-root,
.mud-dialog-actions .mud-button-outlined-primary .mud-icon-root {
    color: var(--kp-gray-90) !important;
}
