/* ---- Page Header with Filters ---- */

/* ---- DataTable Per-Column Filter Popover ---- */

/* Allow popover to overflow the table header and container */
.dt-table-wrap,
.dt-table-wrap .mud-table-container,
.dt-table-wrap .mud-table-head,
.dt-table-wrap .mud-table-head .mud-table-row,
.dt-table-wrap th.hp-th,
.dt-table-wrap .mud-table-head .mud-table-cell {
    overflow: visible !important;
}

/* Each <th> is the positioning parent for its filter popover */
.dt-table-wrap th.hp-th,
.dt-table-wrap .mud-table-head .mud-table-cell {
    position: relative;
}

/* Anchor is the <th> itself — add position:relative via dt-has-filter */
.dt-filter-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
}

.dt-filter-anchor {
    display: inline;
}

.dt-filter-popover {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    cursor: default;
    white-space: normal;
    background: var(--color-bg-white) !important;
    border-radius: 8px !important;
    border: 1px solid var(--color-border) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    padding: 6px !important;
}

.dt-filter-body {
    padding: 0;
}

.dt-filter-body .mud-input-control {
    margin: 0 !important;
}

.dt-filter-body .mud-select {
    min-width: 140px !important;
    font-size: 12px !important;
}

.dt-filter-body .mud-input {
    font-size: 12px !important;
    padding: 4px 8px !important;
}

.dt-filter-body .mud-input-slot {
    font-size: 12px !important;
}

.dt-filter-body .mud-input-label {
    display: none !important;
}

.dt-filter-body .mud-input-outlined .mud-input-outlined-border {
    border-radius: 6px !important;
}

.dt-filter-body .mud-select .mud-input-adornment {
    margin: 0 !important;
}

.dt-filter-nofilter {
    padding: 8px 12px;
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--color-text-subtle);
    white-space: nowrap;
}

/* ---- SearchToolbar ---- */

.um-filters {
    display: flex;
    align-items: center;
    gap: 17px;
}




/* ---- UserEmptyState ---- */

.um-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 40px;
    text-align: center;
}

.um-empty-icon {
    margin-bottom: 24px;
}

.um-empty-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-accent);
    margin: 0 0 12px;
}

.um-empty-description {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-muted);
    max-width: 420px;
    line-height: 1.6;
    margin: 0 0 32px;
}

.um-empty-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 24px;
    font-size: 14px;
    cursor: pointer;
    border: none;
}

/* ---- UserTable ---- */

/* UM-specific row styles (kept — UM has row hover + deleted state) */
.um-tr {
    transition: background 0.1s ease;
}

.um-tr:hover {
    background: var(--color-bg-subtle);
}

.um-tr--deleted {
    background: #F9FAFB;
}

.um-tr--deleted .hp-td {
    color: rgba(0, 0, 0, 0.4);
}

.um-tr--deleted .hp-td-primary,
.um-tr--deleted .hp-td-secondary,
.um-tr--deleted .hp-td-date,
.um-tr--deleted .um-status-text,
.um-tr--deleted .um-group-badge,
.um-tr--deleted .um-role-badge {
    color: rgba(0, 0, 0, 0.4) !important;
    opacity: 0.7;
}

.um-tr--deleted .hp-td-avatar-mud {
    opacity: 0.5;
}

/* ---- Avatar variants (User Management only) ---- */

.hp-td-avatar-mud.hp-td-avatar-mud--pending {
    background: #FFF3E0 !important;
    border-color: #FFCC80 !important;
    color: #FFB74D !important;
}

.hp-td-avatar-mud.hp-td-avatar-mud--expired {
    background: #FFEBEE !important;
    border-color: #EF9A9A !important;
    color: #E57373 !important;
}


/* ---- Group Badge ---- */

.um-group-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0px 8px;
    gap: 4px;
    height: 24px;
    border-radius: 12px;
    background: rgba(42, 47, 111, 0.06);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 16px;
    color: #1F245A;
    white-space: nowrap;
}

/* ---- Role Badge ---- */

.um-roles {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    overflow: hidden;
}

.um-role-badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0px 8px;
    gap: 4px;
    height: 24px;
    border-radius: 12px;
    background: rgba(42, 47, 111, 0.06);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 16px;
    color: #1F245A;
    white-space: nowrap;
}

.um-role--admin {
    background: rgba(59, 130, 246, 0.06);
    color: var(--color-brand-accent);
}

.um-role--dpo {
    background: rgba(16, 185, 129, 0.06);
    color: var(--color-success);
}



/* ---- Status ---- */

.um-status {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.um-status-text {
    font-size: 13px;
    font-weight: 500;
}

.um-status--active {
    color: var(--color-success);
}

.um-status--pending {
    color: #EA580C;
}

.um-status--expired {
    color: #E57373;
}

.um-status--suspended {
    color: var(--color-text-secondary);
}

.um-status--removed {
    color: var(--color-text-subtle);
}

.um-status-sub {
    font-size: 11px;
    font-weight: 400;
    color: var(--color-text-subtle);
}

/* ---- Pagination ---- */

.um-page-ellipsis {
    font-size: 13px;
    color: var(--color-text-subtle);
    padding: 0 4px;
}

/* ---- Loading ---- */

.um-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 0;
}

/* Empty state MudText overrides */
.um-empty-title.mud-typography {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-accent);
    margin: 0 0 12px;
}

.um-empty-description.mud-typography {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-muted);
    max-width: 420px;
    line-height: 1.6;
    margin: 0 0 32px;
}

/* Empty state button — normal case */
.um-empty-cta.mud-button-root {
    text-transform: none;
    letter-spacing: normal;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    border-radius: 12px;
}

/* ---- Snackbar (MudAlert) ---- */

.mud-snackbar-content-message {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
}

.mud-alert-filled-success {
    background-color: var(--color-success-emerald) !important;
}

/* ---- Action Menu ---- */

.action-cell {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.action-trigger {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    background: transparent;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    box-sizing: content-box;
}

.action-trigger:hover {
    background: rgba(17, 24, 39, 0.08);
}

.action-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

.action-menu {
    position: fixed;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    width: 168px;
    background: var(--color-bg-white);
    box-shadow: 0px 1px 8px rgba(0, 0, 0, 0.12),
                0px 3px 4px rgba(0, 0, 0, 0.14),
                0px 3px 3px -2px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.action-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 6px 16px;
    gap: 8px;
    width: 100%;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0.15px;
    color: var(--color-text-primary);
    text-align: left;
    box-sizing: border-box;
}

.action-item:hover {
    background: var(--color-bg-soft);
}

.action-item--danger {
    color: #E53935;
}

.action-item--danger:hover {
    background: #FEF2F2;
}

.action-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex: none;
    color: #D1D5DB;
}

.action-item--danger .action-item-icon {
    color: #E57373;
}

.action-item-text {
    flex: 1;
    display: flex;
    align-items: center;
}

.action-divider {
    width: 100%;
    height: 1px;
    background: rgba(241, 245, 249, 0.5);
    flex: none;
}

.action-divider--strong {
    background: #E5E7EB;
}

/* Action column header & cells — sticky right */
.hp-th--actions {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    text-align: center;
}

.hp-td--actions {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding: 0 !important;
    overflow: visible;
    position: sticky;
    right: 0;
    z-index: 1;
    background: linear-gradient(to right, transparent, #FFFFFF 35%);
    opacity: 0;
    transition: opacity 0.15s ease;
}

tr:hover .hp-td--actions,
.hp-td--actions:focus-within,
.hp-td--actions:has(.action-cell--open) {
    opacity: 1;
}

@media (hover: none) {
    .hp-td--actions {
        opacity: 1;
    }
}

.hp-td--actions .action-cell {
    margin: 0 auto;
}

.hp-td--actions:has(.action-cell--open) {
    z-index: 2;
}
