/* Bố cục tổng thể Full màn hình */
body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden; /* Khóa đứng màn hình nền */
    background-color: #0F172A;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.admin-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
    background-color: #0F172A;
}

/* Sidebar cố định toàn bộ chiều cao */
.sidebar {
    width: 280px;
    height: 100%;
    background-color: #1E293B;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid #334155;
    text-align: center;
}
.sidebar-header h2 {
    color: #F8FAFC;
    margin: 0;
    font-size: 22px;
    letter-spacing: 2px;
}
.sidebar-header p {
    font-size: 11px;
    color: #38BDF8;
    margin-top: 5px;
    font-weight: bold;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
}
.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 14px 25px;
    color: #94A3B8;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}
.sidebar-menu a:hover {
    background-color: rgba(51, 65, 85, 0.5);
    color: #F8FAFC;
}
.sidebar-menu a.active {
    background-color: #0F172A;
    color: #38BDF8;
    border-left-color: #38BDF8;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #334155;
}
.btn-exit {
    width: 100%;
    padding: 12px;
    background: #334155;
    color: #F8FAFC;
    border: 1px solid #475569;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}
.btn-exit:hover {
    background: #EF4444;
    border-color: #EF4444;
}

/* Vùng nội dung chính tự cuộn */
.admin-content {
    flex: 1;
    height: 100%;
    padding: 30px;
    overflow-y: auto; /* Chỉ cuộn dọc ở vùng này */
    box-sizing: border-box;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}
.top-bar h1 {
    color: #F8FAFC;
    margin: 0;
    font-size: 28px;
    font-weight: 800;
}
.admin-profile {
    font-weight: bold;
    color: #94A3B8;
    background: #1E293B;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #334155;
}

/* Thống kê thẻ nâng cao */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.dash-card {
    padding: 25px 20px;
    border-radius: 16px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.card-blue { background: linear-gradient(145deg, #0f2b48, #0f172a); border-top: 3px solid #38BDF8; }
.card-green { background: linear-gradient(145deg, #0d3824, #0f172a); border-top: 3px solid #10B981; }
.card-indigo { background: linear-gradient(145deg, #1e1b4b, #0f172a); border-top: 3px solid #6366F1; }
.card-red { background: linear-gradient(145deg, #451a1a, #0f172a); border-top: 3px solid #EF4444; }

.card-icon { font-size: 28px; margin-bottom: 10px; }
.dash-num { font-size: 36px; font-weight: 900; color: #F8FAFC; }
.dash-label { font-size: 13px; color: #94A3B8; font-weight: 600; margin-top: 5px; text-transform: uppercase; }

.online-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    color: #10B981;
    display: flex;
    align-items: center;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.online-dot {
    width: 6px;
    height: 6px;
    background-color: #10B981;
    border-radius: 50%;
    margin-right: 6px;
    animation: blink 1.5s infinite;
}
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }

/* CSS cho Phân hệ Quản lý Tài khoản người dùng */
.management-section {
    background: #1E293B;
    border-radius: 16px;
    border: 1px solid #334155;
    padding: 25px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.35);
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}
.section-header h2 {
    color: #F8FAFC;
    font-size: 20px;
    margin: 0;
}
.search-box input {
    background: #0F172A;
    color: white;
    border: 1px solid #475569;
    padding: 10px 16px;
    border-radius: 8px;
    width: 280px;
    outline: none;
}
.search-box input:focus {
    border-color: #38BDF8;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}
.user-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.user-table th {
    background-color: #0F172A;
    color: #94A3B8;
    padding: 14px 16px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.user-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #334155;
    color: #E2E8F0;
    font-size: 14px;
}
.user-table tr:last-child td {
    border-bottom: none;
}
.user-table tr:hover td {
    background-color: rgba(148, 163, 184, 0.05);
}

/* Các nhãn trạng thái (Status labels) */
.status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
}
.status-tag.offline { background: rgba(148, 163, 184, 0.1); color: #94A3B8; }
.status-tag.lobby { background: rgba(16, 185, 129, 0.15); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-tag.playing { background: rgba(239, 68, 68, 0.15); color: #FCA5A5; border: 1px solid rgba(239, 68, 68, 0.3); animation: pulse 2s infinite; }

@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; } }

.btn-kick {
    background: rgba(239, 68, 68, 0.2);
    color: #EF4444;
    border: 1px solid #EF4444;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    transition: 0.2s;
}
.btn-kick:hover {
    background: #EF4444;
    color: white;
}

/* Trạng thái tài khoản bị khóa */
.status-tag.locked { 
    background: rgba(239, 68, 68, 0.2); 
    color: #EF4444; 
    border: 1px solid rgba(239, 68, 68, 0.5); 
}

/* Định dạng chung cho cụm nút thao tác Admin */
.btn-admin-op {
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 11px;
    transition: 0.2s;
    border: 1px solid transparent;
    margin-right: 4px;
}

/* Nút Chỉnh sửa thông tin */
.btn-edit {
    background: rgba(56, 189, 248, 0.2);
    color: #38BDF8;
    border-color: #38BDF8;
}
.btn-edit:hover { background: #38BDF8; color: #0F172A; }

/* Nút Khóa tài khoản */
.btn-lock {
    background: rgba(245, 158, 11, 0.2);
    color: #F59E0B;
    border-color: #F59E0B;
}
.btn-lock:hover { background: #F59E0B; color: #0F172A; }

/* Nút Mở khóa tài khoản */
.btn-unlock {
    background: rgba(16, 185, 129, 0.2);
    color: #10B981;
    border-color: #10B981;
}
.btn-unlock:hover { background: #10B981; color: white; }

/* Nút Xóa vĩnh viễn dữ liệu */
.btn-delete {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.4);
}
.btn-delete:hover { background: #EF4444; color: white; }