/* =========================================
   USER MANAGEMENT PAGE
   ========================================= */

.user-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.user-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.user-page-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.user-page-subtitle {
    font-size: 12px;
    color: #9ca3af;
    margin: 0;
    font-weight: 400;
}

.user-create-btn {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.user-create-btn:hover { opacity: 0.88; }

.user-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #ebebeb;
    overflow: hidden;
}

/* Filter row — two dropdowns side by side */
.user-filter-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f0;
}

.user-search-wrapper {
    position: relative;
    width: 200px;
}

.user-search-select {
    width: 100%;
    appearance: none;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 7px 32px 7px 12px;
    font-size: 12.5px;
    color: #9ca3af;
    cursor: pointer;
    outline: none;
}

.user-search-chevron {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #aab0bc;
    font-size: 11px;
}

.user-table {
    width: 100%;
    border-collapse: collapse;
}

.user-table thead tr { border-bottom: 1px solid #f0f0f0; }

.user-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.user-table th:first-child,
.user-table td:first-child {
    padding-left: 24px;
}

.user-table th:nth-child(5) {
    text-align: center;
}

.user-table th:nth-child(7),
.user-table td:nth-child(7) {
    padding-right: 48px;
    text-align: right;
}

.user-table td {
    padding: 13px 20px;
    font-size: 13px;
    color: #1f2937;
    border-bottom: 1px solid #f5f5f5;
    vertical-align: middle;
}

.user-table tbody tr:last-child td { border-bottom: none; }
.user-table tbody tr:hover td { background-color: #fafafa; }

/* Render text exactly as stored, preserving multiple consecutive spaces. */
.user-table td.preserve-spaces {
    white-space: pre-wrap;
    word-break: break-word;
}

.user-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
}

    .user-status-badge.active {
        background-color: #E8F6ED;
        color: #16A34A;
    }
    .user-status-badge.inactive {
        background-color: #f3f4f6;
        color: #6b7280;
    }

.user-action-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

/* Bypass IP Toggle */
.user-bypass-cell {
    display: flex;
    align-items: center;
}

.user-toggle {
    position: relative;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
}

.user-toggle input { opacity: 0; width: 0; height: 0; }

.user-toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #d1d5db;
    border-radius: 18px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-toggle input:checked + .user-toggle-slider { background-color: #22c55e; }

.user-toggle-slider::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    left: 3px;
    top: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.user-toggle input:checked + .user-toggle-slider::before { transform: translateX(16px); }

.user-action-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.user-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #d9e0e7;
    background-color: #ffffff;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    box-sizing: border-box;
    padding: 0;
}

.user-icon-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke-width: 2;
}

.user-icon-btn.edit {
    border-color: #d9e0e7;
    background-color: #ffffff;
}

.user-icon-btn.edit:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.user-icon-btn.edit svg {
    stroke: #4a5568;
}

.user-icon-btn.delete {
    border-color: #eaeaea;
    background-color: #ffffff;
}

.user-icon-btn.delete:hover {
    background-color: #fee2e2;
    border-color: #ef4444;
}

.user-icon-btn.delete svg {
    stroke: #ef4444;
}



/* Fix Radzen dropdown popup z-index to appear above dialog */
.rz-dropdown-panel {
    z-index: 10001 !important;
}

/* Ensure dialog body overflow is visible for dropdowns */
.dialog-body {
    overflow: visible !important;
}

.dialog-card {
    overflow: visible !important;
}
