/* ========================================
   BPE Custom Styles - Global Application
   Testing conversion from custom classes to direct MudBlazor targeting
   ======================================== */

.field-label-60 {
    width: 60px;
}

.field-label-100 {
    width: 100px;
}

.field-label-120 {
    width: 120px;
}

.field-label-140 {
    width: 140px;
}

.field-label-150 {
    width: 150px;
}

.mud-picker .mud-input.mud-input-outlined.mud-input-adorned-end {
    padding-right: unset;
}

/* Design system: 8px radius for surfaces */
.mud-card {
    border-radius: 8px;
}

.mud-card-content {
    padding: 8px 16px;
}

.mud-input-control.mud-input-control-margin-dense {
    margin: 0px 0px;
}

/*.mud-input > input.mud-input-root-outlined.mud-input-root-margin-dense {
    padding-top: 1px;
    padding-bottom: 1px;
}*/

/* 4px grid - dense input vertical padding */
.mud-input > input.mud-input-root-outlined.mud-input-root-margin-dense, div.mud-input-slot.mud-input-root-outlined.mud-input-root-margin-dense {
    padding-top: 4px;
    padding-bottom: 4px;
}

.mud-button-outlined-size-small.mud-icon-button {
    padding: 0px;
    max-height: 20px;
}

/* Input controls - outlined variant; 4px grid */
.mud-input > input.mud-input-root-outlined,
div.mud-input-slot.mud-input-root-outlined {
    padding: 4px 8px;
}

/* MudSelect dense padding - targets div instead of input; 4px grid */
.mud-select .mud-select-input {
    padding: 0px 4px;
}

/* Small outlined buttons padding and font size - 4px grid */
.mud-button-outlined-size-small {
    padding: 4px 8px;
    font-size: .7rem;
}

/* Button line-height reset */
.mud-button {
    line-height: unset;
}

/* Radio button icon padding reduction - GLOBAL */
.mud-radio .mud-icon-button {
    padding: 0px;
}

/* Radio button spacing - GLOBAL; 4px grid */
.mud-radio.mud-radio-content-placement-end.mud-radio-with-content {
    margin-right: 8px;
    margin-inline-end: 8px;
}

/* Textarea padding reduction - GLOBAL; 4px grid */
.mud-input > textarea.mud-input-root {
    margin: 0px 0px !important;
    padding: 4px 8px !important;
}

/* Dense table cell padding - GLOBAL; 4px grid */
.mud-table.mud-table-dense .mud-table-row .mud-table-cell {
    padding: 4px;
    padding-inline-end: unset;
    line-height: 1.25rem;
}

    /* Dense table last column spacing removal - GLOBAL */
    .mud-table.mud-table-dense .mud-table-row .mud-table-cell:last-child {
        padding-right: 0px;
        padding-inline-end: 0px;
    }

/* Input control max-width - GLOBAL (instead of .custom-control-container) */
.mud-input-control {
    max-width: fit-content;
}

/* DatePicker icon padding reduction - GLOBAL (instead of .custom-datepicker-icon) */
.mud-picker .mud-icon-button,
.mud-input-adornment .mud-icon-button {
    padding: 0px;
}

/* DatePicker icon positioning - GLOBAL */
.mud-picker .mud-icon-button-edge-end,
.mud-input-adornment .mud-icon-button-edge-end {
    margin-right: unset;
    margin-inline-end: unset;
}

/* Checkbox icon padding reduction - GLOBAL (instead of .custom-checkbox-icon) */
.mud-checkbox .mud-icon-button {
    padding: 0px;
}

/* Checkbox text size reduction - GLOBAL */
.mud-checkbox .mud-typography-body1 {
    font-size: 11px;
}

/* ========================================
   CONDITIONAL/SPECIFIC OVERRIDES
   Keep custom classes for page-specific needs
   ======================================== */

/* Grid item top padding - specific override */
.custom-grid-item-top {
    padding-top: 4px !important;
}

/* Grid item left padding - specific override */
@media (min-width: 992px) {
    .custom-grid-item-left {
        padding-left: 4px !important;
    }
}

/* Reusable section headers - no per-page colors; use for page title and card section header */
.bpe-page-section-title {
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default, #e0e0e0);
}

.bpe-card-section-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--mud-palette-lines-default, #e0e0e0);
}

/* ========================================
   LAYOUT AND FOOTER (4px grid)
   ======================================== */

.bpe-layout-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.footer-class {
    width: 100%;
}

.footer-class-inner {
    height: 60px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   BLAZOR ERROR UI (theme-aware, 4px grid)
   Hidden by default; framework shows via display: block.
   ======================================== */

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 16px;
    background: var(--mud-palette-error, #dc3545);
    color: white;
    align-items: center;
    justify-content: space-between;
    z-index: 9999;
    font-size: 0.875rem;
}

/* When framework shows the bar (sets display: block), use flex so message and actions don't overlap */
#blazor-error-ui[style*="display: block"] {
    display: flex !important;
}

.blazor-error-ui-message {
    flex: 1 1 auto;
    min-width: 0;
}

.blazor-error-ui-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
}
