html,
body {
    font-family: 'Alfa Interface Sans', Arial, sans-serif;
    margin: 0;
    color: var(--rb-text-primary);
    background-color: var(--rb-bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

#blazor-error-ui {
    display: none;
}

/* layout */
.rb-main-content {
    padding: var(--rb-spacing-l) var(--rb-spacing-m);
}

.rb-page-title {
    color: var(--rb-text-primary);
    font-family: 'Alfa Interface Sans', Arial, sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin-bottom: var(--rb-spacing-l);
}

.rb-card {
    background-color: var(--rb-bg-primary) !important;
    border: 1px solid var(--rb-border-secondary);
    border-radius: var(--rb-radius-l) !important;
    box-shadow: none !important;
}

.rb-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* app bar */
.rb-appbar {
    border-bottom: 1px solid var(--rb-border-primary) !important;
    box-shadow: none !important;
    overflow: hidden;
}

.rb-appbar .mud-toolbar-appbar {
    min-height: var(--mud-appbar-height);
}

.rb-appbar__title {
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: 'Alfa Interface Sans', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--rb-text-primary);
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.rb-appbar__title:hover,
.rb-appbar__title:focus,
.rb-appbar__title:focus-visible,
.rb-appbar__title:active {
    color: var(--rb-text-primary);
    text-decoration: none;
    outline: none;
    box-shadow: none;
    opacity: 0.88;
}

.rb-appbar .mud-button-text {
    color: var(--rb-text-secondary);
    font-weight: 500;
}

.rb-appbar .mud-button-text:hover {
    color: var(--rb-text-primary);
    background-color: transparent;
}

/* buttons — kurs-base-button size L / accent */
.rb-btn.mud-button-root {
    min-height: 3rem;
    padding: 0 1.75rem;
    border-radius: var(--rb-radius-l);
    font-family: 'Styrene A LC Medium', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    text-transform: none;
    box-shadow: none;
}

.rb-btn-accent.mud-button-filled-primary {
    background-color: var(--rb-bg-accent);
    color: var(--rb-text-on-accent);
}

.rb-btn-accent.mud-button-filled-primary:hover {
    background-color: var(--rb-bg-accent-hover);
}

.rb-btn-secondary.mud-button-filled-default {
    background-color: var(--rb-bg-secondary);
    color: var(--rb-text-primary);
}

.rb-btn-secondary.mud-button-filled-default:hover {
    background-color: var(--rb-bg-tertiary);
}

.mud-button-root.mud-button-filled-primary:not(.rb-btn) {
    background-color: var(--rb-bg-accent);
    border-radius: var(--rb-radius-l);
    min-height: 2.5rem;
    padding: 0 1.75rem;
    font-family: 'Styrene A LC Medium', 'Helvetica Neue', Arial, sans-serif;
}

.mud-button-root.mud-button-filled-primary:not(.rb-btn):hover {
    background-color: var(--rb-bg-accent-hover);
}

.mud-button-root.mud-button-filled-default:not(.rb-btn),
.mud-button-root.mud-button-filled.mud-button-filled-secondary:not(.rb-btn) {
    background-color: var(--rb-bg-secondary);
    color: var(--rb-text-primary);
    border-radius: var(--rb-radius-l);
    min-height: 2.5rem;
    padding: 0 1.75rem;
}

.mud-button-root.mud-button-filled-default:not(.rb-btn):hover,
.mud-button-root.mud-button-filled.mud-button-filled-secondary:not(.rb-btn):hover {
    background-color: var(--rb-bg-tertiary);
}

.mud-button-root.mud-button-outlined-default {
    border-color: var(--rb-border-primary);
    color: var(--rb-text-primary);
    border-radius: var(--rb-radius-l);
}

/* form fields — kurs-input: placeholder inside, grey fill, no border */
.rb-form {
    --rb-input-fill: #f2f3f5;
    --rb-input-box-height: 3.5rem;
    --rb-input-font-size: 1.125rem;
    --rb-input-line-height: 1.5rem;
}

@media (min-width: 1199px) {
    .rb-form {
        --rb-input-font-size: 1.25rem;
        --rb-input-line-height: 1.75rem;
    }
}

.rb-form .mud-input.mud-input-filled {
    background-color: var(--rb-input-fill) !important;
    border-radius: var(--rb-radius-l);
    width: 100%;
    min-width: 0;
    min-height: var(--rb-input-box-height);
}

.rb-form .mud-input.mud-input-filled:hover {
    background-color: var(--rb-input-fill) !important;
}

.rb-form .mud-input.mud-input-filled.mud-input-focused,
.rb-form .mud-input.mud-input-filled:focus-within {
    background-color: var(--rb-bg-primary) !important;
    box-shadow: inset 0 0 0 1px var(--rb-border-primary) !important;
}

.rb-form .mud-input-outlined-border,
.rb-form .mud-input-control-input-container fieldset {
    border: none !important;
    border-radius: var(--rb-radius-l) !important;
    background-color: var(--rb-input-fill) !important;
    box-shadow: none !important;
    width: 100%;
    min-width: 0;
}

.rb-form .mud-input-control:hover .mud-input-outlined-border,
.rb-form .mud-input-control-input-container:hover fieldset {
    background-color: var(--rb-input-fill) !important;
}

.rb-form .mud-input-control.mud-input-focused .mud-input-outlined-border,
.rb-form .mud-input-control:focus-within .mud-input-outlined-border,
.rb-form .mud-input-control.mud-input-focused fieldset,
.rb-form .mud-input-control:focus-within fieldset {
    background-color: var(--rb-bg-primary) !important;
    border: 1px solid var(--rb-border-primary) !important;
    box-shadow: none !important;
}

/* MudBlazor paints primary/red on focus — force neutral gray */
.rb-form .mud-input-control.mud-input-focused:not(.mud-input-error) .mud-input-outlined-border,
.rb-form .mud-input-control:focus-within:not(.mud-input-error) .mud-input-outlined-border {
    border-color: var(--rb-border-primary) !important;
}

.rb-form .mud-input-control.mud-input-error .mud-input-outlined-border,
.rb-form .mud-input-control.mud-input-error fieldset {
    box-shadow: inset 0 0 0 1px #ec2d20 !important;
}

.rb-form .mud-input-control.mud-input-error .mud-input.mud-input-filled {
    box-shadow: inset 0 0 0 1px #ec2d20 !important;
}

.rb-form .mud-input-helper-text,
.rb-form .mud-input-error-text {
    font-size: 0.75rem;
    line-height: 1.33;
    letter-spacing: -0.03em;
    color: #ec2d20 !important;
    margin-top: 0.25rem;
    padding-left: 0;
}

.rb-form .mud-input-control {
    width: 100%;
    margin-bottom: 0.75rem;
}

.rb-form .mud-input-control-input-container,
.rb-form .mud-input {
    width: 100%;
}

.rb-form .mud-input > input.mud-input-root,
.rb-form .mud-input > textarea.mud-input-root,
.rb-form .mud-input-slot,
.rb-form .mud-input-filled .mud-input-slot {
    background-color: transparent !important;
    border: 0;
    border-radius: var(--rb-radius-l);
    box-shadow: none !important;
    font-family: 'Alfa Interface Sans', Arial, sans-serif;
    font-size: var(--rb-input-font-size);
    font-weight: 400;
    line-height: var(--rb-input-line-height);
    letter-spacing: -0.03em;
    color: var(--rb-text-primary);
    box-sizing: border-box !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
    width: 100%;
}

.rb-form .mud-input > input.mud-input-root {
    min-height: var(--rb-input-box-height);
    height: auto;
    padding: calc((var(--rb-input-box-height) - var(--rb-input-line-height)) / 2) 0.75rem !important;
}

.rb-form .mud-input > textarea.mud-input-root {
    min-height: 6.5rem !important;
    height: auto;
    padding: 0.75rem !important;
    resize: vertical;
    display: block;
}

.rb-form .mud-input > input.mud-input-root::placeholder,
.rb-form .mud-input > textarea.mud-input-root::placeholder {
    color: var(--rb-text-secondary);
    opacity: 1;
    font-size: var(--rb-input-font-size);
    line-height: var(--rb-input-line-height);
}

.rb-form .mud-input-underline:before,
.rb-form .mud-input-underline:after {
    display: none;
}

.rb-form .mud-input-outlined-border legend {
    display: none;
}

.rb-switch {
    margin-top: 0.5rem;
}

.rb-switch .mud-typography-body1 {
    color: var(--rb-text-primary);
    font-size: 1rem;
}

/* data grid search input */
.rb-data-grid {
    background-color: var(--rb-bg-primary);
    border: 1px solid var(--rb-border-secondary);
    border-radius: var(--rb-radius-l);
    overflow: hidden;
}

.rb-data-grid .mud-table-toolbar {
    padding: var(--rb-spacing-l) var(--rb-spacing-m) var(--rb-spacing-s);
    background-color: var(--rb-bg-primary);
    border-bottom: none;
}

.rb-data-grid .mud-table-head .mud-table-cell {
    color: var(--rb-text-secondary);
    font-family: 'Styrene A LC Medium', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    border-bottom: 1px solid var(--rb-border-primary);
    background-color: var(--rb-bg-primary);
}

.rb-data-grid .mud-table-body .mud-table-row {
    cursor: pointer;
}

.rb-data-grid .mud-table-body .mud-table-row:nth-child(odd) .mud-table-cell {
    background-color: var(--rb-bg-primary);
}

.rb-data-grid .mud-table-body .mud-table-row:nth-child(even) .mud-table-cell {
    background-color: var(--rb-bg-secondary);
}

.rb-data-grid .mud-table-body .mud-table-row:hover .mud-table-cell {
    background-color: var(--rb-bg-tertiary) !important;
}

.rb-data-grid .mud-table-body .mud-table-cell {
    border-bottom: none;
    color: var(--rb-text-primary);
    font-size: 0.875rem;
}

.rb-data-grid .mud-table-pagination {
    border-top: 1px solid var(--rb-border-secondary);
    background-color: var(--rb-bg-primary);
}

.rb-data-grid .mud-input-control .mud-input-outlined .mud-input-slot {
    min-height: 2.5rem;
}

/* chips / status pills */
.rb-chip-positive.mud-chip {
    background-color: var(--rb-bg-positive);
    color: var(--rb-text-on-accent);
    border-radius: var(--rb-radius-l);
    font-weight: 500;
    font-size: 0.875rem;
}

.rb-chip-neutral.mud-chip {
    background-color: var(--rb-bg-secondary);
    color: var(--rb-text-primary);
    border-radius: var(--rb-radius-l);
    font-weight: 500;
    font-size: 0.875rem;
}

/* breadcrumbs */
.mud-breadcrumbs .mud-breadcrumb-item a,
.mud-breadcrumbs .mud-breadcrumb-item {
    color: var(--rb-text-secondary);
    font-size: 0.875rem;
}

.mud-breadcrumbs .mud-breadcrumb-item a:hover {
    color: var(--rb-text-primary);
}

/* switch */
.mud-switch .mud-switch-button {
    color: var(--rb-bg-accent);
}

/* snackbar accent */
.mud-snackbar.mud-alert-filled-success {
    background-color: var(--rb-bg-positive);
}
