/* SSO config grid UX parity (ASPX → Blazor).
 * Applied to all /config/sso/* list and add pages via App.razor link tag.
 * Wrapper class .sso-config-grid on the root <MudPaper>.
 */

.sso-config-grid .mud-table-cell {
    padding: 4px 8px;
}

.sso-config-grid .mud-table-head .mud-table-cell {
    padding: 6px 8px;
    font-weight: 600;
    background-color: var(--mud-palette-background-grey);
}

/* Dense rows + nicer striping contrast to match ASPX RadGrid feel. */
.sso-config-grid .mud-table-row {
    height: 32px;
}

.sso-config-grid .mud-input-control {
    margin-top: 0;
}

/* Toolbar spacing: keep buttons compact, search input fixed width. */
.sso-config-grid .mud-toolbar {
    min-height: 48px;
    padding: 0 4px;
}

.sso-config-grid .sso-search-field {
    max-width: 320px;
    min-width: 220px;
}

/* Action column: right-aligned icon button strip. */
.sso-config-grid .sso-actions-cell {
    text-align: right;
    white-space: nowrap;
}

/* Empty-state: centered icon + message to replace the bare "No items" text. */
.sso-config-grid .sso-empty-state {
    padding: 32px 16px;
    text-align: center;
    color: var(--mud-palette-text-secondary);
}

/* Modernized toolbar: tighter padding, icon-prefixed actions, NO wrap (the
 * filter goes in a separate row below the action toolbar instead). */
.sso-toolbar {
    padding-left: 0 !important;
    padding-right: 0 !important;
    gap: 4px;
    flex-wrap: nowrap;
    overflow: visible;
}

/* Filter row below the action toolbar — LEFT-aligned per ASPX. */
.sso-filter-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
}

.sso-filter-group {
    background: var(--mud-palette-background-grey);
    padding: 2px 8px;
}

.sso-filter-group .mud-input-control {
    margin-top: 0 !important;
}

.sso-filter-group .mud-input-control .mud-input {
    padding-top: 2px !important;
    padding-bottom: 2px !important;
}

.sso-filter-group .mud-button-text {
    min-width: 60px;
    padding: 4px 8px;
}

.sso-search-field {
    min-width: 220px;
    max-width: 280px;
}

.sso-config-grid > .mud-toolbar {
    background: transparent;
    min-height: 48px;
}

/* SelectColumn fix: MudDataGrid renders the SelectColumn with style="width:0%"
 * which collapses the column to zero width and makes the checkbox overflow
 * invisibly behind the next column. Force a sane min-width + center alignment. */
.sso-config-grid table thead tr th:first-child,
.sso-config-grid table tbody tr td:first-child {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    text-align: center;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

/* Make checkboxes a bit smaller + centered for dense rows. */
.sso-config-grid .mud-table-cell .mud-checkbox {
    margin: 0 auto;
}

/* Row-hover affordance — makes the row look clickable. */
.sso-config-grid .mud-table-body .mud-table-row {
    transition: background-color 120ms ease;
}
.sso-config-grid .mud-table-body .mud-table-row:hover {
    background-color: var(--mud-palette-action-disabled-background, rgba(0,0,0,0.04)) !important;
    cursor: pointer;
}

/* Selected-row highlight — picks up MudDataGrid's selection state
 * (rows whose first-cell checkbox is checked OR rows with the .mud-selected-item class). */
.sso-config-grid .mud-table-body .mud-table-row.mud-selected-item,
.sso-config-grid .mud-table-body .mud-table-row:has(.mud-checkbox-input:checked) {
    background-color: rgba(33, 150, 243, 0.10) !important;
    border-left: 3px solid var(--mud-palette-primary, #1976d2);
}
.sso-config-grid .mud-table-body .mud-table-row.mud-selected-item:hover,
.sso-config-grid .mud-table-body .mud-table-row:has(.mud-checkbox-input:checked):hover {
    background-color: rgba(33, 150, 243, 0.18) !important;
}
