* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: #0b132b;
  color: #f1f5f9;
  min-height: 100vh;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2.5rem;
  background: rgba(13, 23, 49, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: #1e3a8a;
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.1rem;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #38bdf8;
}

.btn-login-nav {
  padding: 6px 14px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Main Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.trophy-badge {
  font-size: 2.8rem;
  color: #fbbf24;
  margin-bottom: 0.5rem;
  display: inline-block;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.main-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
  color: #ffffff;
}

.subtitle {
  color: #94a3b8;
  font-size: 1rem;
}

/* Card */
.card {
  background: #111d38;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background: #162447;
  color: #94a3b8;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.95rem;
}

.table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: bold;
}

.rank-gold {
  background: #eab308;
  color: #422006;
}

.rank-silver {
  background: #94a3b8;
  color: #0f172a;
}

.rank-bronze {
  background: #ca8a04;
  color: #451a03;
}

.rank-normal {
  color: #64748b;
  font-weight: 600;
}

.footer-note {
  padding: 1rem 1.5rem;
  color: #38bdf8;
  font-size: 0.85rem;
  background: rgba(56, 189, 248, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Login Page */
.center-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: url('./hinh-nen-vo-tri-04.jpg');
  background-size: cover;
  background-position-y: -150px;
  font-size: 10px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #111d38;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 2.5rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.shield-badge {
  width: 68px;
  height: 68px;
  background: rgba(30, 58, 138, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  font-size: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 1.2rem;
}

.login-title {
  font-size: 1.5rem;
  margin-bottom: 0.4rem;
}

.login-sub {
  color: #94a3b8;
  font-size: 0.88rem;
  margin-bottom: 1.8rem;
}

.input-group {
  position: relative;
  margin-bottom: 1.2rem;
  text-align: left;
}

.input-group .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: #64748b;
}

.input-group input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  background: #0b132b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: #38bdf8;
}

.btn {
  padding: 0.8rem 1.4rem;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  background: #334155;
  color: #e2e8f0;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-edit {
  background: #2563eb;
  color: white;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
  margin-right: 6px;
}

.btn-del {
  background: #dc2626;
  color: white;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
}

.btn-edit:hover { background: #1d4ed8; }
.btn-del:hover { background: #b91c1c; }

.error-msg {
  color: #f87171;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.back-link {
  margin-top: 1.5rem;
}

.back-link a {
  color: #94a3b8;
  font-size: 0.88rem;
  text-decoration: none;
}

.back-link a:hover {
  color: #38bdf8;
}

/* Admin Dashboard */
.admin-body {
  background: #080e1f;
}

.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: #0d1730;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-menu {
  padding: 1.2rem 0 4.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.sidebar-menu a {
  padding: 0.85rem 1.5rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border-left: 3px solid #38bdf8;
}

.sidebar-menu .logout-link {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 260px;
  box-sizing: border-box;
  margin-top: 0;
  color: #f87171;
  background: #0d1730;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-menu .logout-link:hover {
  background: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
  border-left: 3px solid #dc2626;
}

.admin-main {
  flex: 1;
  margin-left: 260px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #0d1730;
}

.admin-user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #cbd5e1;
}

.admin-content {
  padding: 2.5rem;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.8rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.modal-dialog {
  background: #111d38;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 100%;
  max-width: 460px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.btn-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #0b132b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #fff;
  outline: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 1.5rem;
}

/* Form fields used by point-request submission */
.form-group textarea,
.form-group input[type="file"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #0b132b;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #fff;
  outline: none;
  font: inherit;
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group small { display:block; color:#94a3b8; margin-top:5px; font-size:.78rem; }
#pointRequestMessage { color:#7dd3fc; font-size:.9rem; }
#submitPointRequestBtn:disabled { opacity:.6; cursor:wait; }
#pointRequests a { color:#7dd3fc; text-decoration:underline; }
@media (max-width: 700px) {
  .modal-dialog { width: calc(100% - 24px); max-height: 90vh; overflow-y: auto; padding: 1.2rem; }
  .content-header { gap:1rem; align-items:flex-start; flex-wrap:wrap; }
}


/* Hạng phong cách Liên Quân */
.col-position, .col-id, .col-score { white-space: nowrap; }
.col-score { text-align: right; color: #38bdf8; font-weight: 800; }
.arena-rank { display:inline-block; padding:4px 7px; border-radius:7px; font-size:.76rem; font-weight:800; white-space:nowrap; background:#334155; color:#e2e8f0; }
.rank-stars { display:block; margin-top:3px; color:#fbbf24; font-size:.72rem; white-space:nowrap; }
.arena-tier-0 { background:#78350f; color:#fde68a; }
.arena-tier-1 { background:#475569; color:#e2e8f0; }
.arena-tier-2 { background:#854d0e; color:#fef08a; }
.arena-tier-3 { background:#065f46; color:#a7f3d0; }
.arena-tier-4 { background:#1d4ed8; color:#dbeafe; }
.arena-tier-5 { background:#6d28d9; color:#ede9fe; }
.arena-tier-6 { background:#9f1239; color:#ffe4e6; }
.arena-tier-7 { background:#9a3412; color:#ffedd5; }
.arena-tier-8 { background:linear-gradient(110deg,#7c2d12,#a16207); color:#fef3c7; }

/* Xem trước bằng chứng ở form gửi và ngay trong bảng duyệt */
.evidence-preview { display:grid; grid-template-columns:repeat(auto-fill,minmax(105px,1fr)); gap:9px; margin-top:10px; }
.evidence-preview-item, .admin-evidence-item { min-width:0; display:flex; flex-direction:column; gap:5px; }
.evidence-preview-item img, .evidence-preview-item video { width:100%; height:100px; object-fit:cover; border-radius:8px; background:#020617; border:1px solid rgba(148,163,184,.3); }
.evidence-preview-item small { overflow-wrap:anywhere; color:#cbd5e1; font-size:.72rem; }
#pointRequestsBody .admin-evidence-item { display:inline-flex; vertical-align:top; width:100px; margin:4px 6px 4px 0; }
#pointRequestsBody .admin-evidence-item img, #pointRequestsBody .admin-evidence-item video { display:block; width:100px; height:76px; object-fit:cover; background:#020617; border-radius:7px; border:1px solid rgba(148,163,184,.35); }
#pointRequestsBody .admin-evidence-item a { font-size:.72rem; overflow-wrap:anywhere; }

@media (max-width: 700px) {
  .header { padding: .75rem .8rem; align-items:flex-start; gap:10px; flex-direction:column; }
  .nav-links { width:100%; gap: .55rem; flex-wrap:wrap; }
  .nav-links a { font-size:.78rem; }
  .btn-login-nav { padding:5px 8px; }
  .container { padding:1.25rem .45rem; }
  .hero { margin-bottom:1.1rem; }
  .trophy-badge { font-size:1.8rem; margin-bottom:.2rem; }
  .main-title { font-size:1.35rem; line-height:1.25; letter-spacing:0; }
  .subtitle { font-size:.78rem; line-height:1.4; }
  .leaderboard-card { border-radius:9px; }
  #leaderboardTable { table-layout:fixed; width:100%; }
  #leaderboardTable th { padding:.55rem .2rem; font-size:.61rem; letter-spacing:0; text-transform:none; overflow-wrap:anywhere; }
  #leaderboardTable td { padding:.58rem .2rem; font-size:.72rem; overflow-wrap:anywhere; }
  #leaderboardTable .col-position { width:11%; text-align:center; }
  #leaderboardTable .col-id { width:15%; }
  #leaderboardTable .col-name { width:30%; }
  #leaderboardTable .col-score { width:14%; text-align:right; }
  #leaderboardTable .col-rank { width:30%; text-align:center; }
  .rank-badge { width:22px; height:22px; font-size:.68rem; }
  .rank-normal { font-size:.75rem; }
  .arena-rank { padding:3px 4px; font-size:.61rem; white-space:normal; line-height:1.15; }
  .rank-stars { font-size:.61rem; margin-top:2px; }
  .footer-note { padding:.7rem; font-size:.68rem; line-height:1.4; }
  .container > div[style*="justify-content:center"] { margin-bottom:.75rem !important; }
  .container > div[style*="justify-content:center"] .btn { padding:.65rem .8rem; font-size:.82rem; }
}

/* Huy hiệu rank chi tiết: mỗi bậc có bảng màu và ánh sáng riêng */
.arena-rank {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 7px 11px 7px 11px;
  border: 1px solid var(--rank-border, rgba(255,255,255,.24));
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .01em;
  white-space: nowrap;
  box-shadow: 0 0 11px var(--rank-glow, rgba(148,163,184,.22)), inset 0 1px 0 rgba(255,255,255,.2);
  text-shadow: 0 1px 1px rgba(0,0,0,.3);
}
.arena-rank::before { content: ""; width: 4px; height: 75%; position: absolute; left: 2px; top: 12%; border-radius: 4px; background: rgba(255,255,255,.8); opacity: .55; }
.arena-rank i { font-size: .8rem; filter: drop-shadow(0 0 3px currentColor); }
.arena-tier-0 { --rank-glow: rgba(180,83,9,.26); --rank-border: #b96c36; background: linear-gradient(135deg,#3f241b,#a9582c 55%,#5d301d); color: #ffdfba; }
.arena-tier-1 { --rank-glow: rgba(203,213,225,.25); --rank-border: #cbd5e1; background: linear-gradient(135deg,#334155,#cbd5e1 52%,#64748b); color: #f8fafc; }
.arena-tier-2 { --rank-glow: rgba(234,179,8,.3); --rank-border: #facc15; background: linear-gradient(135deg,#713f12,#facc15 52%,#854d0e); color: #fff7c2; }
.arena-tier-3 { --rank-glow: rgba(45,212,191,.3); --rank-border: #5eead4; background: linear-gradient(135deg,#064e3b,#14b8a6 55%,#134e4a); color: #ccfbf1; }
.arena-tier-4 { --rank-glow: rgba(56,189,248,.52); --rank-border: #7dd3fc; background: linear-gradient(135deg,#082f80,#0284c7 45%,#38bdf8 70%,#1e40af); color: #effaff; box-shadow: 0 0 15px rgba(14,165,233,.34), 0 0 4px rgba(125,211,252,.55), inset 0 1px 0 rgba(255,255,255,.38); }
.arena-tier-4 i { color: #e0f2fe; filter: drop-shadow(0 0 5px #7dd3fc); }
.arena-tier-5 { --rank-glow: rgba(192,132,252,.38); --rank-border: #d8b4fe; background: linear-gradient(135deg,#3b0764,#7e22ce 48%,#c084fc); color: #faf5ff; }
.arena-tier-6 { --rank-glow: rgba(251,113,133,.3); --rank-border: #fda4af; background: linear-gradient(135deg,#4c0519,#be123c 50%,#881337); color: #fff1f2; }
.arena-tier-7 { --rank-glow: rgba(249,115,22,.38); --rank-border: #fdba74; background: linear-gradient(135deg,#431407,#c2410c 50%,#f97316); color: #fff7ed; }
.arena-tier-8 { --rank-glow: rgba(250,204,21,.5); --rank-border: #fef08a; background: linear-gradient(120deg,#713f12,#fbbf24 48%,#fff7ed 62%,#ca8a04); color: #422006; box-shadow: 0 0 16px rgba(250,204,21,.35), inset 0 1px 0 rgba(255,255,255,.65); }
.arena-tier-8 i { color: #fff7ed; filter: drop-shadow(0 0 4px #a16207); }
.rank-stars { color: #fbbf24; font-weight: 800; text-shadow: 0 0 5px rgba(251,191,36,.24); }
.btn-code { background: rgba(129,140,248,.15); border: 1px solid rgba(129,140,248,.45); color: #c7d2fe; }
.btn-code:hover { background: rgba(129,140,248,.26); }
.leaderboard-actions { display:flex; justify-content:center; align-items:center; flex-wrap:wrap; gap:.65rem; margin:0 0 1.5rem; }
.request-daily-warning { padding: .8rem; margin-bottom: 1rem; border: 1px solid rgba(251,191,36,.3); border-radius: 9px; color: #fde68a; background: rgba(120,53,15,.2); font-size: .84rem; line-height: 1.5; }
.request-daily-warning i { margin-right: .4rem; }
.request-help { color:#cbd5e1; font-size:.87rem; line-height:1.5; margin-bottom:1rem; }
.status-dialog { max-width: 620px; }
.point-status-result { display:grid; gap:.7rem; margin-top:1rem; }
.request-status-card { border:1px solid rgba(148,163,184,.2); background:rgba(15,23,42,.65); border-radius:10px; padding:.85rem; }
.request-status-card p { margin:.45rem 0 0; line-height:1.45; overflow-wrap:anywhere; }
.request-status-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:.5rem; }
.request-status-pill { display:inline-flex; padding:4px 8px; border-radius:99px; font-weight:800; font-size:.75rem; }
.status-pending { color:#fde68a; background:rgba(161,98,7,.25); border:1px solid rgba(250,204,21,.3); }
.status-approved { color:#bbf7d0; background:rgba(21,128,61,.22); border:1px solid rgba(74,222,128,.3); }
.status-rejected { color:#fecaca; background:rgba(153,27,27,.22); border:1px solid rgba(248,113,113,.3); }
.decision-note { overflow-wrap:anywhere; padding:.55rem; margin-top:.5rem; border-radius:7px; background:rgba(127,29,29,.2); color:#fecaca; font-size:.83rem; }
.status-approved-text { color:#86efac; }
.status-error { color:#fca5a5; }
#pointStatusResult:empty { display:none; }
@media (max-width:700px) {
  .leaderboard-actions { gap:.45rem; margin-bottom:.8rem; }
  .leaderboard-actions .btn { padding:.65rem .7rem; font-size:.78rem; }
  .arena-rank { max-width:100%; padding:3px 5px; gap:3px; border-radius:5px 8px 5px 8px; font-size:.6rem; white-space:normal; line-height:1.15; }
  .arena-rank i { font-size:.62rem; }
  .request-daily-warning { font-size:.78rem; padding:.65rem; }
  .request-status-card { padding:.7rem; }
}
.arena-unranked { --rank-glow: rgba(148,163,184,.12); --rank-border: rgba(148,163,184,.35); background: linear-gradient(135deg,#1e293b,#475569); color:#cbd5e1; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }

/* Tối ưu khu vực quản trị trên điện thoại: menu không còn bị co thành một thanh */
@media (max-width: 700px) {
  .admin-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
  .sidebar {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.12);
  }
  .sidebar-header { padding: .9rem 1rem; }
  .sidebar-menu {
    padding: .45rem .55rem .65rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: .35rem;
  }
  .sidebar-menu a {
    flex: 1 1 calc(50% - .35rem);
    min-width: 0;
    padding: .7rem .65rem;
    border: 1px solid rgba(148,163,184,.14);
    border-radius: 9px;
    font-size: .82rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }
  .sidebar-menu a:hover,
  .sidebar-menu a.active { border-left: 1px solid #38bdf8; }
  .sidebar-menu .logout-link {
    position: static;
    left: auto;
    bottom: auto;
    width: auto;
    box-sizing: border-box;
    flex: 1 1 100%;
    margin-top: .15rem;
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .admin-main { margin-left: 0; width: 100%; min-width: 0; }
  .admin-topbar { padding: .9rem 1rem; gap: .7rem; flex-wrap: wrap; }
  .admin-content { padding: 1rem .8rem; min-width: 0; }
  .content-header { flex-wrap: wrap; gap: .75rem; }
  .admin-content .table-container,
  .admin-content .table-responsive { max-width: 100%; overflow-x: auto; }
  .admin-content table { min-width: 560px; }
  .admin-content input,
  .admin-content select,
  .admin-content textarea { max-width: 100%; }
}


/* Fix mobile admin table: keep the action column accessible by horizontal scrolling */
@media (max-width: 700px) {
  .admin-content .table-card {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .admin-content .admin-table {
    width: 620px;
    min-width: 620px;
    table-layout: auto;
  }
  .admin-content .admin-table th,
  .admin-content .admin-table td {
    white-space: nowrap;
  }
  .admin-content .admin-table th:last-child,
  .admin-content .admin-table td:last-child {
    min-width: 130px;
    text-align: center;
  }
  .admin-content .admin-table td:last-child .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: .5rem .6rem;
    margin: 2px;
    font-size: .78rem;
  }
}


/* Tìm kiếm thành viên trong trang quản trị, tối ưu cho cả điện thoại */
.admin-member-search {
  width: 100%;
  box-sizing: border-box;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 12px;
  background: rgba(15,23,42,.58);
}
.admin-member-search label {
  display: block;
  margin-bottom: .55rem;
  color: #cbd5e1;
  font-size: .9rem;
  font-weight: 600;
}
.admin-member-search label i { color: #38bdf8; margin-right: .35rem; }
.admin-member-search-input {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid rgba(148,163,184,.35);
  border-radius: 10px;
  background: rgba(2,6,23,.55);
  overflow: hidden;
}
.admin-member-search-input:focus-within { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,.12); }
.admin-member-search-input input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: .8rem .85rem;
  border: 0;
  outline: none;
  color: #f8fafc;
  background: transparent;
  font: inherit;
  font-size: 16px;
}
.admin-member-search-input input::placeholder { color: #94a3b8; }
.admin-member-search-input button {
  flex: 0 0 42px;
  height: 42px;
  border: 0;
  color: #cbd5e1;
  background: transparent;
  cursor: pointer;
}
.admin-member-search-input button:hover { color: #fff; }
.admin-member-search small {
  display: block;
  margin-top: .55rem;
  color: #94a3b8;
  font-size: .8rem;
  line-height: 1.4;
}
@media (max-width: 700px) {
  .admin-member-search { margin: .8rem 0; padding: .8rem; }
  .admin-member-search-input input { padding: .75rem .7rem; }
}


/* Tra cứu mật khẩu: danh sách gợi ý giống công cụ tìm kiếm, thân thiện điện thoại. */
.password-lookup-matches { display: grid; gap: .45rem; margin: .5rem 0 1rem; max-height: 280px; overflow-y: auto; }
.password-lookup-match { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; min-width: 0; padding: .75rem .85rem; border: 1px solid #334155; border-radius: 10px; background: #0f172a; color: #e2e8f0; text-align: left; cursor: pointer; }
.password-lookup-match:hover, .password-lookup-match:focus-visible { border-color: #38bdf8; background: #172554; outline: none; }
.password-lookup-match strong { overflow-wrap: anywhere; }
.password-lookup-match span { flex: 0 0 auto; color: #7dd3fc; font-size: .85rem; }
@media (max-width: 700px) {
  .password-lookup-match { padding: .8rem .7rem; font-size: .9rem; }
  .password-lookup-match span { font-size: .78rem; }
  .password-lookup-matches { max-height: 240px; }
}


/* Upload bằng chứng dung lượng lớn và biểu mẫu bảo mật Admin */
.admin-password-card { overflow-wrap: anywhere; }
.admin-password-card input { box-sizing: border-box; max-width: 100%; }
#changeAdminPasswordMessage { line-height: 1.45; }
#requestEvidence { min-height: 48px; cursor: pointer; }
#requestEvidencePreview { min-width: 0; }
#pointRequestMessage { overflow-wrap: anywhere; line-height: 1.45; }
#submitPointRequestBtn:disabled { opacity: .65; cursor: progress; }
@media (max-width: 700px) {
  .admin-password-card { padding: 16px !important; }
  .admin-password-card .btn { width: 100%; justify-content: center; white-space: normal; }
  .modal-dialog { width: calc(100% - 16px); max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; padding: 1rem; }
  .modal-dialog .modal-actions { display: grid; grid-template-columns: 1fr; }
  .modal-dialog .modal-actions .btn { width: 100%; justify-content: center; }
  #requestEvidence { font-size: .82rem; padding: .65rem; }
  .evidence-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evidence-preview-item img, .evidence-preview-item video { height: 120px; }
}


/* Giao diện đồng bộ, chống tràn và bảo đảm các nút/bảng dùng được trên mọi màn hình. */
html { scroll-behavior: smooth; }
body { overflow-wrap: anywhere; }
button, input, select, textarea { font: inherit; }
img, video, canvas, svg { max-width: 100%; }
.container, .admin-main, .admin-content, .admin-password-card, .card { min-width: 0; }
.nav-links { flex-wrap: wrap; row-gap: .7rem; }
.nav-links a { display: inline-flex; align-items: center; gap: .4rem; line-height: 1.4; }
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.table-scroll:focus-within { outline: 1px solid rgba(56,189,248,.25); }
.table-scroll .admin-table { min-width: 760px; }
.leaderboard-table-scroll { overflow-x: auto; }
.table td, .table th { overflow-wrap: anywhere; }
.admin-table td { vertical-align: top; }
.admin-table .btn { white-space: nowrap; }
.modal { padding: 12px; overflow-y: auto; align-items: flex-start; }
.modal-dialog { width: min(100%, 680px); max-width: 680px; max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; margin: auto; }
.modal-header { position: sticky; top: -1px; z-index: 2; background: #111d38; }
.form-group input, .form-group textarea, .form-group select { width: 100%; min-width: 0; }
.modal-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.modal-actions .btn { min-height: 42px; }

/* Danh sách chọn thành viên theo tên/ID trong form đề xuất. */
.request-member-picker { position: relative; }
.request-member-suggestions { display: grid; gap: .35rem; margin-top: .4rem; max-height: 240px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid rgba(56,189,248,.28); border-radius: 10px; background: #0b132b; padding: .35rem; }
.request-member-suggestions[hidden] { display: none; }
.request-member-option { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; min-width: 0; padding: .7rem .75rem; border: 1px solid transparent; border-radius: 8px; background: rgba(30,58,138,.22); color: #f1f5f9; text-align: left; cursor: pointer; }
.request-member-option:hover, .request-member-option:focus-visible { border-color: #38bdf8; background: rgba(14,116,144,.28); outline: 2px solid transparent; }
.request-member-option strong { min-width: 0; overflow-wrap: anywhere; }
.request-member-option span { flex: 0 0 auto; color: #7dd3fc; font-size: .82rem; white-space: nowrap; }
.request-member-hint { padding: .65rem .7rem; color: #94a3b8; font-size: .84rem; line-height: 1.45; }
.request-member-error { color: #fca5a5; }

/* Quy chế điểm: bố cục hai cột trên màn hình rộng, một cột trên điện thoại. */
.rules-page { max-width: 1080px; }
.rules-card, .rules-note { padding: clamp(1rem, 2.4vw, 1.6rem); margin-bottom: 1rem; }
.rules-card h2, .rules-note h2 { display: flex; align-items: center; gap: .65rem; font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.35; }
.rules-card h2 i, .rules-note h2 i { flex: 0 0 auto; }
.rules-card ul { margin: 1rem 0 0 1.25rem; color: #cbd5e1; line-height: 1.75; }
.rules-card li { padding-left: .2rem; margin: .25rem 0; }
.rank-order { margin-top: 1rem; color: #cbd5e1; line-height: 1.8; }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.rules-grid .rules-card { margin-bottom: 0; }
.rules-positive h2 { color: #86efac; }
.rules-negative h2 { color: #fca5a5; }
.rules-positive li::marker { color: #4ade80; }
.rules-negative li::marker { color: #f87171; }
.rules-grid li { padding-bottom: .45rem; }
.rules-grid li strong { display: block; color: #e2e8f0; font-size: .92rem; }
.rules-note p { margin: .85rem 0 1rem; color: #cbd5e1; line-height: 1.7; }
.rules-note .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }

@media (max-width: 900px) {
  .header { padding: 1rem; flex-wrap: wrap; gap: .8rem; }
  .nav-links { gap: .65rem 1rem; }
  .container { padding: 1.5rem 1rem; }
  .admin-content { padding: 1.25rem; }
  .admin-topbar { padding: 1rem 1.25rem; }
  .content-header { gap: 1rem; flex-wrap: wrap; }
}
@media (max-width: 700px) {
  .header { align-items: flex-start; }
  .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: .45rem; }
  .nav-links a { justify-content: flex-start; min-width: 0; padding: .55rem .5rem; border: 1px solid rgba(148,163,184,.15); border-radius: 8px; font-size: .78rem; overflow-wrap: anywhere; }
  .nav-links .btn-login-nav { padding: .55rem .5rem; }
  .container { padding: 1.1rem .65rem; }
  .hero { margin-bottom: 1rem; }
  .main-title { font-size: clamp(1.25rem, 6vw, 1.65rem); }
  .subtitle { font-size: .85rem; }
  .rules-grid { grid-template-columns: minmax(0, 1fr); }
  .rules-card, .rules-note { padding: 1rem; }
  .rules-grid li strong { line-height: 1.5; }
  .request-member-option { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .request-member-option span { white-space: normal; }
  .modal { padding: 8px; }
  .modal-dialog { width: 100%; max-height: calc(100dvh - 16px); padding: 1rem; }
  .modal-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .modal-actions .btn { width: 100%; justify-content: center; }
  .admin-content { padding: .85rem; }
  .admin-topbar { padding: .8rem; }
  .content-header > div { min-width: 0; }
  .content-header h2 { font-size: 1.1rem; line-height: 1.35; }
  .content-header > .btn { width: 100%; justify-content: center; }
  .sidebar-menu .logout-link { position: static; width: auto; margin-top: 0; }
  .table-scroll .admin-table { min-width: 760px; }
}
@media (max-width: 380px) {
  .logo-text { font-size: 1rem; }
  .nav-links { grid-template-columns: minmax(0, 1fr); }
  .container { padding-inline: .45rem; }
  .rules-card h2, .rules-note h2 { font-size: 1rem; }
}
@media (max-width: 700px) {
  #leaderboardTable .rank-stars { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
  #leaderboardTable .arena-rank { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  #leaderboardTable td, #leaderboardTable th { padding-inline: .18rem; }
  .leaderboard-table-scroll { overflow-x: auto; }
}
