/* ============================================
   УПРАВЛЕНИЕ ПОЛЬЗОВАТЕЛЯМИ
   ============================================ */

/* ===== ПОИСК ===== */
.admin-users-search {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.admin-users-search input {
    flex: 1;
    min-width: 200px;
    padding: 12px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    transition: all 0.3s;
}

.admin-users-search input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.admin-users-search button {
    padding: 12px 24px;
    background: var(--gradient-accent);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.admin-users-search button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.admin-users-reset {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.admin-users-reset:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

/* ===== СЕТКА ЮЗЕРОВ ===== */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.user-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.user-card:hover::before {
    transform: scaleY(1);
}

.user-card:hover {
    transform: translateX(6px);
    border-color: var(--border-hover);
    box-shadow: 0 8px 32px rgba(206, 66, 43, 0.2);
}

.user-card-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--accent);
    box-shadow: 0 0 14px var(--accent-glow);
}

.user-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-card-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 22px;
    color: white;
}

.user-card-info {
    min-width: 0;
    flex: 1;
}

.user-card-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-id {
    font-size: 12px;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 6px;
}

.user-card-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.user-card-role {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(102, 192, 244, 0.15);
    color: var(--steam);
    border-radius: 100px;
    border: 1px solid rgba(102, 192, 244, 0.3);
    white-space: nowrap;
}

.user-card-role-more {
    font-size: 11px;
    padding: 2px 8px;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
}

/* ===== ПРОФИЛЬ ЮЗЕРА ===== */
.user-profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--border);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.user-profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    opacity: 0.4;
    pointer-events: none;
}

.user-profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent);
    box-shadow: 0 0 32px var(--accent-glow);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.user-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-profile-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 44px;
    color: white;
}

.user-profile-info {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.user-profile-info h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.user-profile-username {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 8px;
}

.user-profile-id {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.user-profile-id code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 5px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--steam);
}

html[data-theme="light"] .user-profile-id code {
    background: rgba(0, 0, 0, 0.05);
}

.user-profile-joined {
    color: var(--text-dim);
    font-size: 13px;
}

/* ===== СЕКЦИИ ===== */
.user-section {
    margin-bottom: 32px;
}

.user-section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

/* ===== РОЛИ ===== */
.user-roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.user-role-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all 0.3s;
}

.user-role-has {
    border-color: rgba(67, 181, 129, 0.5);
    background: rgba(67, 181, 129, 0.05);
}

.user-role-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role-actions {
    flex-shrink: 0;
}

.user-role-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    border: 1px solid;
}

.user-role-btn-add {
    background: rgba(67, 181, 129, 0.15);
    color: var(--green);
    border-color: rgba(67, 181, 129, 0.5);
}

.user-role-btn-add:hover {
    background: rgba(67, 181, 129, 0.3);
    transform: scale(1.05);
}

.user-role-btn-remove {
    background: rgba(240, 71, 71, 0.15);
    color: var(--red);
    border-color: rgba(240, 71, 71, 0.5);
}

.user-role-btn-remove:hover {
    background: rgba(240, 71, 71, 0.3);
    transform: scale(1.05);
}

/* ===== МОДЕРАЦИЯ ===== */
.user-moderation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.user-mod-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.user-mod-form label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
}

.user-mod-form input {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    transition: all 0.3s;
}

.user-mod-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.user-mod-btn {
    padding: 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
    border: 1px solid;
}

.user-mod-btn-timeout {
    background: rgba(250, 166, 26, 0.15);
    color: var(--yellow);
    border-color: rgba(250, 166, 26, 0.5);
}

.user-mod-btn-timeout:hover {
    background: rgba(250, 166, 26, 0.3);
    transform: translateY(-2px);
}

.user-mod-btn-kick {
    background: rgba(240, 71, 71, 0.1);
    color: var(--red);
    border-color: rgba(240, 71, 71, 0.4);
}

.user-mod-btn-kick:hover {
    background: rgba(240, 71, 71, 0.25);
    transform: translateY(-2px);
}

.user-mod-btn-ban {
    background: rgba(240, 71, 71, 0.2);
    color: var(--red);
    border-color: rgba(240, 71, 71, 0.6);
}

.user-mod-btn-ban:hover {
    background: rgba(240, 71, 71, 0.35);
    transform: translateY(-2px);
}

/* ===== АДАПТИВ ===== */
@media (max-width: 768px) {
    .user-profile-header {
        flex-direction: column;
        text-align: center;
        padding: 24px 16px;
    }

    .user-profile-avatar {
        width: 90px;
        height: 90px;
    }

    .user-profile-info h1 {
        font-size: 22px;
    }

    .user-roles-grid,
    .user-moderation-grid {
        grid-template-columns: 1fr;
    }
}
/* ===== ПАГИНАЦИЯ ===== */
.users-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.users-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    font-family: inherit;
}

html[data-theme="light"] .users-page-btn {
    background: rgba(0, 0, 0, 0.04);
}

.users-page-btn:hover {
    background: rgba(206, 66, 43, 0.15);
    border-color: var(--border-hover);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(206, 66, 43, 0.2);
}

.users-page-active {
    background: linear-gradient(135deg, var(--accent), #ff8c42);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 20px var(--accent-glow);
    cursor: default;
}

.users-page-active:hover {
    transform: none;
    background: linear-gradient(135deg, var(--accent), #ff8c42);
    color: white;
}

.users-page-dots {
    color: var(--text-dim);
    font-weight: 700;
    padding: 0 4px;
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 480px) {
    .users-pagination {
        gap: 4px;
    }

    .users-page-btn {
        min-width: 34px;
        height: 34px;
        padding: 0 10px;
        font-size: 13px;
    }
}