/* Админ панель с эффектом жидкого стекла */
.admin-main {
    min-height: calc(100vh - 80px);
    padding: 2rem 1rem;
}

.admin-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    max-width: 1800px;
    margin: 0 auto;
}

/* Сайдбар */
.admin-sidebar {
    background: rgba(26, 31, 58, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.admin-menu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-menu-item {
    padding: 1rem 1.25rem;
    background: rgba(10, 14, 39, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.admin-menu-item:hover {
    color: #00d4ff;
    background: rgba(0, 212, 255, 0.15);
    transform: translateX(5px);
    border-color: rgba(0, 212, 255, 0.3);
}

.admin-menu-item.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(0, 153, 255, 0.3));
    color: #00d4ff;
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

/* Контент */
.admin-content {
    background: rgba(26, 31, 58, 0.7);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.admin-tab-content {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Заголовок */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(0, 212, 255, 0.2);
}

.admin-header h2 {
    font-size: 2rem;
    color: #00d4ff;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

/* Статистика */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card-admin {
    background: rgba(10, 14, 39, 0.6);
    backdrop-filter: blur(15px);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card-admin:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.3);
}

.stat-icon {
    font-size: 3rem;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
}

.stat-info h3 {
    font-size: 2rem;
    color: #00d4ff;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Таблица */
.admin-table {
    width: 100%;
    overflow-x: auto;
    border-radius: 15px;
    background: rgba(10, 14, 39, 0.5);
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table thead {
    background: rgba(0, 212, 255, 0.15);
}

.admin-table th {
    padding: 1rem;
    text-align: left;
    color: #00d4ff;
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 212, 255, 0.5);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

.admin-table tr {
    transition: all 0.3s ease;
}

.admin-table tbody tr:hover {
    background: rgba(0, 212, 255, 0.1);
}

/* Аватары в таблице - ИСПРАВЛЕНО */
.admin-table .user-avatar,
.top-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
    object-fit: cover; /* ВАЖНО: обрезает изображение по размеру */
    display: inline-block;
    vertical-align: middle;
}

/* Бейджи ролей */
.role-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.role-user {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.5);
}

/* Кнопки действий */
.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.5rem;
}

.btn-edit {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.5);
}

.btn-edit:hover {
    background: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

.btn-delete {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.5);
}

.btn-delete:hover {
    background: rgba(255, 68, 68, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.4);
}

/* Кнопки */
.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #00d4ff, #0099ff);
    border: none;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 212, 255, 0.5);
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Секции статистики */
.stats-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(10, 14, 39, 0.5);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-section h3 {
    color: #00d4ff;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Топ пользователей */
.top-users-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.top-user-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(26, 31, 58, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.top-user-item:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateX(5px);
}

.top-rank {
    font-size: 1.5rem;
    font-weight: bold;
    color: #00d4ff;
    min-width: 40px;
}

.top-user-name {
    flex: 1;
    color: #fff;
    font-weight: 500;
}

.top-user-stat {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Последние ключи */
.recent-keys-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recent-key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(26, 31, 58, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.key-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.key-info strong {
    color: #00d4ff;
}

/* Настройки */
.settings-section {
    padding: 1.5rem;
    background: rgba(10, 14, 39, 0.5);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    color: #00d4ff;
    margin-bottom: 1rem;
}

.settings-section button {
    margin-right: 1rem;
    margin-bottom: 0.5rem;
}

/* Код ключа */
code {
    background: rgba(0, 212, 255, 0.15);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.3);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .admin-container {
        grid-template-columns: 250px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 968px) {
    .admin-container {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        position: static;
    }
    
    .admin-menu {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .admin-menu-item {
        white-space: nowrap;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .admin-main {
        padding: 1rem 0.5rem;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .admin-header h2 {
        font-size: 1.5rem;
    }
    
    .admin-table {
        font-size: 0.85rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .action-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .top-user-item {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .admin-menu {
        flex-direction: column;
    }
    
    .admin-menu-item {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
    
    .stat-info h3 {
        font-size: 1.5rem;
    }
}

/* Скроллбар */
.admin-table::-webkit-scrollbar {
    height: 8px;
}

.admin-table::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 10px;
}

.admin-table::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}
