/* RBAC: Admin Users Management UI */

/* Users List */
.users-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

.users-table thead {
    background: var(--bg-tertiary);
}

.users-table th,
.users-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.users-table tbody tr:hover {
    background: var(--bg-hover);
}

.users-table tbody tr.inactive {
    opacity: 0.6;
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin: 2px;
}

.role-badge.admin {
    background: #ff4444;
    color: white;
}

.role-badge.user {
    background: #4CAF50;
    color: white;
}

/* Group Badges */
.group-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    margin: 2px;
    color: white;
}

.group-badge i {
    margin-right: 4px;
}

.group-badge.no-group {
    background: #999;
    color: white;
    font-style: italic;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #4CAF50;
    color: white;
}

.status-badge.inactive {
    background: #999;
    color: white;
}

.btn-icon {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 16px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--bg-hover);
}

.admin-badge {
    background: #ff4444;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 6px;
}

/* Roles Modal */
.roles-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.roles-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.roles-modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: 12px;
    width: 600px;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.roles-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.roles-modal-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.roles-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.roles-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.roles-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.roles-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.user-info-display {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.user-info-row {
    margin-bottom: 8px;
    font-size: 14px;
}

.user-info-row:last-child {
    margin-bottom: 0;
}

.user-info-row strong {
    color: var(--text-secondary);
    min-width: 80px;
    display: inline-block;
}

.roles-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.role-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.role-checkbox-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-hover);
}

.role-checkbox-item input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.role-checkbox-item input[type="checkbox"]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.role-info {
    flex: 1;
}

.role-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.role-title i {
    font-size: 18px;
    color: var(--primary-color);
}

.role-title strong {
    font-size: 15px;
}

.role-required {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: normal;
    font-style: italic;
}

.role-badge-future {
    background: #FFA500;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #ff4444;
}

.error-message i {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}