/*
 * Metrics MudTheme cannot express (MudBlazor 9.8).
 * Button height, padding, hover lift, and checkbox fill are not palette or typography tokens.
 * Colour for filled primary actions is --pm-brand (tenant brand, else platform navy).
 * Palette.Primary stays the platform navy for other Color.Primary controls.
 * Loaded immediately after app.css, in the slot the old glass button block occupied.
 *
 * Filled and outlined buttons use a 6px radius and 0.625rem padding. That is the
 * current control chrome. Theme DefaultBorderRadius is 4px and does not apply here.
 * Filled primary rules below replace colour, height, padding, and hover lift.
 */

.mud-button-filled {
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    padding: 0.625rem 1.25rem !important;
    transition: all 0.2s ease !important;
}

.mud-button-filled:hover {
    transform: translateY(-1px) !important;
}

/* Workspace tab buttons stay still. More specific than the filled hover lift. */
.module-workspace-page .mud-button-root,
.module-workspace-page .mud-button {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease !important;
}

.module-workspace-page .mud-button-root:hover,
.module-workspace-page .mud-button:hover {
    transform: none !important;
}

.module-workspace-page .mud-button-root:active,
.module-workspace-page .mud-button:active,
.module-workspace-page .mud-button-root:focus,
.module-workspace-page .mud-button:focus {
    transform: none !important;
    scale: 1 !important;
}

.mud-button-outlined {
    border: 1px solid var(--mud-palette-divider) !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    padding: 0.625rem 1.25rem !important;
    background: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
    transition: all 0.2s ease !important;
}

.mud-button-outlined:hover:not(:disabled) {
    background: var(--mud-palette-action-hover) !important;
    border-color: var(--mud-palette-primary) !important;
}

html body .mud-button-filled.mud-button-filled-primary {
    background-color: var(--pm-brand) !important;
    color: var(--pm-brand-contrast, #ffffff) !important;
    border: none !important;
    box-shadow: none !important;
    transition: background-color 0.2s ease !important;
    text-transform: none !important;
    font-weight: 500 !important;
    font-size: var(--pm-font-size-body, 13px) !important;
    min-height: 32px !important;
    padding: 6px 12px !important;
}

html body .mud-button-filled.mud-button-filled-primary:hover:not(:disabled) {
    background-color: var(--tenant-brand-color-hover, var(--pm-brand-hover)) !important;
    transform: none !important;
    box-shadow: none !important;
}

html body .mud-button-filled.mud-button-filled-primary:active:not(:disabled) {
    transform: none !important;
    box-shadow: none !important;
}

html body .mud-icon-button.mud-icon-button-filled-primary {
    background-color: var(--pm-brand) !important;
    color: var(--pm-brand-contrast, #ffffff) !important;
    border: none !important;
    transition: background-color 0.2s ease !important;
}

html body .mud-icon-button.mud-icon-button-filled-primary:hover:not(:disabled) {
    background-color: var(--tenant-brand-color-hover, var(--pm-brand-hover)) !important;
    transform: none !important;
}

html body .mud-button-text.mud-button-text-primary {
    color: var(--pm-brand) !important;
}

html body .mud-button-text.mud-button-text-primary:hover:not(:disabled) {
    background-color: color-mix(in srgb, var(--pm-brand) 10%, transparent) !important;
    color: var(--pm-brand) !important;
}

html body .mud-checkbox.mud-checkbox-primary .mud-checkbox-input {
    color: var(--pm-brand) !important;
}

html body .mud-checkbox.mud-checkbox-primary.mud-checked .mud-checkbox-input {
    background-color: var(--pm-brand) !important;
    border-color: var(--pm-brand) !important;
}

html body .mud-checkbox.mud-checkbox-primary.mud-checked .mud-checkbox-input::after {
    color: var(--pm-brand-contrast, #ffffff) !important;
}

/* Success checkboxes stay on the status token so a completed tick does not pick up brand navy. */
html body .mud-checkbox.mud-checkbox-success .mud-checkbox-input {
    color: var(--mud-palette-success) !important;
}

html body .mud-checkbox.mud-checkbox-success.mud-checked .mud-checkbox-input {
    background-color: var(--mud-palette-success) !important;
    border-color: var(--mud-palette-success) !important;
}

html body .mud-checkbox.mud-checkbox-success.mud-checked .mud-checkbox-input::after {
    color: #fff !important;
}

/* Adornments stay on the platform app bar colour, not the tenant brand. */
html body .mud-input-adornment .mud-icon-button.mud-icon-button-color-primary,
html body .mud-input-adornment .mud-icon.mud-icon-color-primary {
    color: var(--mud-palette-appbar-background) !important;
}
