*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #16a34a;
  --green-light: #dcfce7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --amber: #d97706;
  --amber-light: #fef3c7;
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --gray: #6b7280;
  --gray-light: #f3f4f6;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --footer-bg: #fafafa;
  --input-bg: #ffffff;
  --overlay: rgba(15, 23, 42, .55);
}

body { font-family: 'Inter', sans-serif; font-size: 15px; color: var(--text); background: var(--bg); }

/* ── Navbar ─────────────────────────── */
.navbar { display: flex; align-items: center; gap: 16px; padding: 12px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.nav-brand { font-weight: 700; font-size: 18px; text-decoration: none; color: var(--text); }
.nav-links { display: flex; gap: 4px; margin-left: 16px; }
.nav-links a { padding: 6px 14px; border-radius: 8px; text-decoration: none; color: var(--text-muted);
  font-size: 14px; font-weight: 500; transition: background .15s; }
.nav-links a:hover { background: var(--gray-light); color: var(--text); }
.nav-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.admin-link { background: var(--amber-light) !important; color: var(--amber) !important; }
.score-badge { background: var(--green-light); color: var(--green); padding: 4px 12px;
  border-radius: 20px; font-size: 13px; font-weight: 600; }
.btn-logout { font-size: 13px; color: var(--text-muted); text-decoration: none; }
.btn-logout:hover { color: var(--red); }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 4px; }
.avatar-initials {
  background: linear-gradient(135deg,#2563eb,#7c3aed); color:#fff;
  font-size:13px; font-weight:700; display:flex; align-items:center; justify-content:center;
}
.nav-profile-link {
  display:flex; align-items:center; gap:8px;
  text-decoration:none; color: var(--text);
  padding: 4px 6px; border-radius: 8px; transition: background .15s;
}
.nav-profile-link:hover { background: var(--gray-light); }

/* ── Nav: người theo dõi tôi ───────── */
.nav-followers { position: relative; }
.nav-followers-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-muted);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.nav-followers-btn:hover,
.nav-followers-btn[aria-expanded="true"] {
  background: var(--gray-light); color: var(--text); border-color: #93c5fd;
}
.nav-followers-count { min-width: 1ch; text-align: center; }
.nav-followers-panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: min(320px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 120; overflow: hidden;
}
.nav-followers-panel__head {
  padding: 10px 14px; font-size: 12px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.nav-followers-panel__count {
  background: var(--blue-light); color: var(--blue);
  padding: 2px 8px; border-radius: 10px; font-size: 11px;
}
.nav-followers-list { list-style: none; margin: 0; padding: 6px 0; max-height: 280px; overflow-y: auto; }
.nav-followers-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; text-decoration: none; color: var(--text);
  transition: background .12s;
}
.nav-followers-item:hover { background: var(--gray-light); }
.nav-followers-avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.nav-followers-avatar-ph {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.nav-followers-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.nav-followers-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-followers-dept { font-size: 11px; color: var(--text-muted); }
.nav-followers-mode {
  flex-shrink: 0; font-size: 10px; font-weight: 700;
  padding: 3px 7px; border-radius: 8px; white-space: nowrap;
}
.nav-followers-mode--same { background: #dbeafe; color: #1d4ed8; }
.nav-followers-mode--inverse { background: #fce7f3; color: #be185d; }
.nav-followers-empty {
  margin: 0; padding: 14px; font-size: 13px; color: var(--text-muted); text-align: center;
}

/* ── Container ──────────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-header h2 { font-size: 22px; font-weight: 700; }

/* ── Alerts ─────────────────────────── */
.alert { padding: 10px 16px; border-radius: var(--radius); margin-bottom: 12px; font-size: 14px; }
.alert-success { background: var(--green-light); color: var(--green); }
.alert-danger  { background: var(--red-light); color: var(--red); }
.alert-info    { background: var(--blue-light); color: var(--blue); }

/* ── Login ──────────────────────────── */
.login-page { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: var(--surface); border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,.1);
  padding: 40px 36px; max-width: 400px; width: 100%; text-align: center; }
.login-logo { font-size: 56px; margin-bottom: 12px; }
.login-card h1 { font-size: 24px; font-weight: 700; }
.login-sub { color: var(--text-muted); margin: 8px 0 24px; }
.login-divider { color: var(--text-muted); font-size: 13px; margin: 16px 0; }
.tg-widget-wrap { display: flex; justify-content: center; }
.login-note { font-size: 13px; color: var(--text-muted); margin-top: 20px; line-height: 1.6; }

/* ── Match cards ────────────────────── */
.matches-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.match-card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow);
  padding: 20px; border-top: 3px solid var(--border); transition: box-shadow .2s; }
.match-card.open { border-top-color: var(--green); }
.match-card.finished { border-top-color: var(--blue); }
.match-card.live { border-top-color: #d97706; }
.match-card.closed { border-top-color: var(--gray); opacity: .8; }

.match-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.match-num { font-weight: 600; font-size: 13px; color: var(--text-muted); }
.match-status { font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 20px; }
.status-open { background: var(--green-light); color: var(--green); }
.status-done { background: var(--blue-light); color: var(--blue); }
.status-live { background: #fef3c7; color: #d97706; }
.status-closed { background: var(--gray-light); color: var(--gray); }

.match-teams { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.team { display: flex; align-items: center; gap: 6px; flex: 1; }
.team-left { justify-content: flex-end; text-align: right; }
.team-name { font-weight: 700; font-size: 15px; }
.team-flag { font-size: 22px; line-height: 1; flex-shrink: 0; }
.team-side { background: var(--gray-light); color: var(--gray); width: 26px; height: 26px;
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; }
.handicap-team .team-side { background: #fde68a; color: #92400e; }
.team-side-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; flex-shrink: 0; }
.handicap-inline { font-size: 10px; font-weight: 700; color: var(--red);
  background: #fee2e2; border-radius: 4px; padding: 0 4px; white-space: nowrap; }
.match-vs { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.vs-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.handicap-badge { background: #fef3c7; color: #92400e; font-size: 11px;
  padding: 3px 8px; border-radius: 20px; font-weight: 700; white-space: nowrap; }
/* Chiều chấp: T chấp → xanh dương, P chấp → tím */
.handicap-badge.hdp-left  { background: #dbeafe; color: #1e40af; }
.handicap-badge.hdp-right { background: #ede9fe; color: #5b21b6; }
.final-score { font-size: 20px; font-weight: 700; color: var(--blue); }
.final-score-big { font-size: 28px; font-weight: 800; color: var(--blue); }
.preliminary-badge { background: #fef3c7; color: #d97706; font-size: 11px;
  padding: 2px 8px; border-radius: 20px; font-weight: 700; }

.match-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 12px; margin-bottom: 14px; }

/* ── Bet form ───────────────────────── */
.bet-form { display: flex; gap: 8px; }
.btn-bet { flex: 1; padding: 10px 8px; border-radius: 8px; border: 2px solid #d1d5db;
  font-weight: 700; font-size: 14px; cursor: pointer; transition: all .15s;
  background: #f0f9ff; color: #1e40af; -webkit-tap-highlight-color: rgba(59,130,246,.2); }
.btn-bet.btn-left  { background: #f0fdf4; color: #15803d; border-color: #86efac; }
.btn-bet.btn-right { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; }
.btn-bet:hover, .btn-bet:focus { opacity: .85; outline: none; }
.btn-bet.btn-left:hover,  .btn-bet.btn-left:focus  { background: #dcfce7; border-color: #4ade80; }
.btn-bet.btn-right:hover, .btn-bet.btn-right:focus { background: #dbeafe; border-color: #60a5fa; }
@media (max-width: 480px) {
  .btn-bet { padding: 12px 6px; font-size: 13px; }
  .bet-btn-label { display: none; }
}
.btn-sm { font-size: 12px; padding: 6px 12px; }
.bet-change { align-items: center; gap: 10px; }
.change-hint { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

/* Đổi lệnh — nút chưa chọn giữ màu T/P bình thường; nút đã chọn viền đậm hơn */
.bet-change .btn-bet.not-selected {
  opacity: 1; box-shadow: none; transform: none;
}
.bet-change .btn-bet.not-selected.btn-left {
  background: #f0fdf4 !important; color: #15803d !important;
  border: 2px solid #86efac !important;
}
.bet-change .btn-bet.not-selected.btn-right {
  background: #eff6ff !important; color: #1d4ed8 !important;
  border: 2px solid #93c5fd !important;
}
.bet-change .btn-bet.active {
  flex: 1.05; font-size: 14px; font-weight: 800; border-width: 3px;
  transform: none; box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}
.bet-change .btn-bet.active.selected-t {
  background: #dcfce7 !important; color: #15803d !important;
  border-color: #22c55e !important;
  box-shadow: 0 0 0 3px rgba(34,197,94,.22);
}
.bet-change .btn-bet.active.selected-p {
  background: #dbeafe !important; color: #1d4ed8 !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,.22);
}
.pick-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(21,128,61,.15); color: #15803d;
  font-size: 10px; margin-right: 4px; font-weight: 800;
}
.bet-change .btn-bet.active.selected-p .pick-check {
  background: rgba(29,78,216,.15); color: #1d4ed8;
}

/* Highlight đội đã chọn — nhẹ, chỉ ô T/P + tên đội */
.team.user-picked .team-side { font-weight: 800; }
.team-left.user-picked .team-side { background: #16a34a; color: #fff; }
.team-right.user-picked .team-side { background: #2563eb; color: #fff; }
.team.user-picked .team-name { font-weight: 800; }

/* ── My bet ─────────────────────────── */
.my-bet { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 12px; }
.my-bet-placed {
  display: flex; align-items: flex-start; gap: 12px;
  border-radius: 10px; padding: 12px 14px;
}
.my-bet-badge {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
}
.my-bet-placed.choice-t .my-bet-badge { background: linear-gradient(135deg, #16a34a, #22c55e); }
.my-bet-placed.choice-p .my-bet-badge { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.my-bet-body { flex: 1; min-width: 0; }
.my-bet-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; line-height: 1.4; }
.my-bet-team { font-weight: 700; }
.my-bet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; }
.my-bet-placed.bet-pending {
  background: #f8fafc;
  box-shadow: inset 4px 0 0 #22c55e, 0 1px 4px rgba(0,0,0,.06);
  border: 1px solid #e2e8f0;
}
.my-bet-placed.choice-p.bet-pending { box-shadow: inset 4px 0 0 #3b82f6, 0 1px 4px rgba(0,0,0,.06); }
.bet-win  { background: var(--green-light); color: var(--green); }
.bet-lose { background: var(--red-light); color: var(--red); }
.bet-draw { background: var(--amber-light); color: var(--amber); }
.bet-pending { background: var(--blue-light); color: var(--blue); }
.my-bet-placed.bet-pending { color: #1e293b; }
.placed-time { font-size: 12px; color: var(--text-muted); }
.auto-tag { font-size: 11px; opacity: .8; }

/* ── Leaderboard ────────────────────── */
.prize-banner {
  background: var(--surface);
  border: 1px solid #f0c040;
  border-radius: 14px;
  padding: 18px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.prize-banner__main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.prize-banner__label {
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
}
.prize-banner__value {
  font-size: 32px;
  font-weight: 800;
  color: #b45309;
  letter-spacing: -0.02em;
}
.prize-banner__value--neg { color: var(--red); }
.prize-banner__meta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.prize-banner__neg { color: var(--red); }
.prize-banner__pos { color: var(--green); }
.leaderboard { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--border); }
.lb-row:last-child { border-bottom: none; }
.lb-row--link { text-decoration: none; color: inherit; cursor: pointer;
  transition: background 0.15s; }
.lb-row--link:hover { background: var(--gray-light); }
.lb-me { background: #eff6ff; }
.lb-me:hover { background: #dbeafe !important; }
.lb-rank { width: 32px; font-size: 18px; }
.lb-name { flex: 1; font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lb-score { font-weight: 700; font-size: 16px; color: var(--green); }
.lb-score.score-negative { color: var(--red); }
.lb-arrow { color: var(--text-muted); font-size: 18px; font-weight: 300; }
.score-badge--negative { background: var(--red-light, #fff0f0); color: var(--red) !important; }
.you-tag { background: var(--blue); color: #fff; font-size: 11px; padding: 1px 6px;
  border-radius: 10px; }
.dept-tag { background: var(--gray-light); color: var(--text-muted); font-size: 11px;
  padding: 1px 8px; border-radius: 10px; font-weight: 400; }
/* W/D/L badges */
.lb-wdl { display: flex; gap: 4px; align-items: center; }
.lb-wdl span { font-size: 11px; font-weight: 700; padding: 2px 6px;
  border-radius: 8px; min-width: 28px; text-align: center; }
.wdl-w { background: #d1fae5; color: #065f46; }
.wdl-d { background: #fef3c7; color: #92400e; }
.wdl-l { background: #fee2e2; color: #991b1b; }
.wdl-auto { background: #f3e8ff; color: #7e22ce; }
/* Avatar trong lb: tăng size một chút */
.lb-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; border: 1px solid var(--border); }
.lb-avatar-ph { width: 32px; height: 32px; border-radius: 50%; background: var(--accent, #4f8ef7);
  color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; }

/* ── Bản tin hàng ngày ─────────────── */
.page-header__hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
}
.bulletin-list { display: flex; flex-direction: column; gap: 8px; }
.bulletin-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}
.bulletin-card__row {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.bulletin-card__details { flex: 1; min-width: 0; }
.bulletin-card__toggle {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--gray-light, #f8fafc);
  transition: background 0.15s ease;
  user-select: none;
}
.bulletin-card__toggle::-webkit-details-marker { display: none; }
.bulletin-card__toggle::marker { content: ""; }
.bulletin-card__toggle:hover { background: #eef2ff; }
.bulletin-card__details[open] .bulletin-card__toggle {
  border-bottom: 1px solid var(--border);
}
.bulletin-card__chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.15s ease;
  line-height: 1;
}
.bulletin-card__details[open] .bulletin-card__chevron {
  transform: rotate(90deg);
  color: var(--accent, #4f8ef7);
}
.bulletin-card__head-main { flex: 1; min-width: 0; }
.bulletin-delete-form {
  flex-shrink: 0;
  margin: 0;
  padding: 8px 10px 8px 0;
  display: flex;
  align-items: flex-start;
}
.bulletin-card__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.35;
}
.bulletin-card__meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bulletin-card__dot { opacity: 0.5; }
.bulletin-card__author { font-style: italic; }
.bulletin-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bulletin-badge--auto { background: #dbeafe; color: #1d4ed8; }
.bulletin-badge--manual { background: #fef3c7; color: #b45309; }
.bulletin-card__body {
  padding: 16px 18px 18px 44px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}
  word-break: break-word;
}

/* ── Table ──────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; background: var(--surface);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.data-table th { padding: 12px 14px; text-align: left; font-size: 12px; font-weight: 600;
  color: var(--text-muted); background: var(--gray-light); border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 14px; font-size: 14px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.row-win { background: #f0fdf4; }
.row-lose { background: #fef2f2; }
.row-draw { background: #fffbeb; }
.positive { color: var(--green); font-weight: 600; }
.negative { color: var(--red); font-weight: 600; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--red); }

/* ── Admin ──────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border-radius: 12px; padding: 20px; text-align: center;
  box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stat-num { font-size: 32px; font-weight: 800; color: var(--blue); }
.stat-label { font-size: 13px; color: var(--text-muted); }
.admin-links { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.form-card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow);
  padding: 28px; max-width: 480px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-input { width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px; outline: none; background: var(--input-bg); color: var(--text); }
.form-input:focus { border-color: var(--blue); }
.inline-form { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.result-form { row-gap: 6px; }
.result-final-check { display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-muted); white-space: nowrap; cursor: pointer; }
.result-final-check input { margin: 0; }
.score-input { width: 52px; padding: 5px 8px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; text-align: center; }
.status-badge { padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.status-open { background: var(--green-light); color: var(--green); }
.status-finished { background: var(--blue-light); color: var(--blue); }
.status-closed { background: var(--gray-light); color: var(--gray); }
.admin-tag { background: var(--amber-light); color: var(--amber); font-size: 11px;
  padding: 1px 6px; border-radius: 10px; margin-left: 4px; }

/* ── Buttons ────────────────────────── */
.btn-primary { background: var(--blue); color: #fff; border: none; padding: 9px 18px;
  border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-block; transition: opacity .15s; }
.btn-primary:hover { opacity: .88; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border);
  padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer;
  text-decoration: none; display: inline-block; }
.btn-success { background: var(--green-light); color: var(--green); border: none; cursor: pointer;
  padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.btn-danger { background: var(--red-light); color: var(--red); border: none; cursor: pointer;
  padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; }

/* ── Misc ───────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state span { font-size: 48px; display: block; margin-bottom: 12px; }
.tip-box { margin-top: 20px; background: var(--blue-light); color: var(--blue);
  padding: 12px 18px; border-radius: 10px; font-size: 14px; }
.date-nav { display: flex; gap: 8px; }
.score-display { font-size: 14px; color: var(--text-muted); }
.link-sm { font-size: 13px; color: var(--blue); text-decoration: none; }
code { background: var(--gray-light); padding: 2px 6px; border-radius: 4px; font-size: 13px; }

/* ── Mobile ─────────────────────────── */
@media (max-width: 600px) {
  .matches-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .navbar { flex-wrap: wrap; gap: 8px; }
  .nav-user { width: 100%; justify-content: flex-end; }

  /* Match card trên mobile */
  .match-card { padding: 14px; }
  .match-header { margin-bottom: 12px; gap: 6px; }
  .team-name { font-size: 14px; }
  .match-meta { flex-wrap: wrap; gap: 6px 12px; margin-bottom: 12px; }

  /* Nút xem lượt chọn nhỏ hơn trên mobile */
  .btn-see-bets { padding: 2px 8px; font-size: 11px; }

  /* Poll bar labels nhỏ hơn */
  .poll-bar-label { font-size: 11px; }
}

/* ── Google login button ─────────────────────────── */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 12px 20px; margin: 20px 0;
  background: #fff; color: #3c4043; font-size: 15px; font-weight: 500;
  border: 1.5px solid #dadce0; border-radius: 8px; text-decoration: none;
  transition: box-shadow .2s, background .15s; cursor: pointer;
}
.btn-google:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); background: #f8f9fa; }

/* ── Nav name ────────────────────────────────────── */
.nav-name { font-size: 14px; font-weight: 500; color: var(--text);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Form label ──────────────────────────────────── */
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

/* ── Status upcoming ─────────────────────────────── */
.status-upcoming { background: #f3f4f6; color: #6b7280; }

/* ── Flag images từ flagcdn.com ── */
.flag-img {
  display: inline-block;
  vertical-align: middle;
  width: 20px;
  height: 15px;
  border-radius: 2px;
  object-fit: cover;
  flex-shrink: 0;
}
.team-flag .flag-img {
  width: 24px;
  height: 18px;
}
.lb-rank .flag-img {
  width: 18px;
  height: 13px;
}

/* ── Legal disclaimer ────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); padding: 16px 24px; margin-top: 32px;
  background: var(--footer-bg); }
.footer-disclaimer { max-width: 860px; margin: 0 auto; display: flex; gap: 10px;
  align-items: flex-start; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.footer-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.footer-disclaimer strong { color: var(--text); }

.login-disclaimer { margin-top: 16px; background: #fffbe6; border: 1px solid #ffe58f;
  border-radius: 8px; padding: 12px 14px; font-size: 12px; color: #7d5a00;
  text-align: left; line-height: 1.7; }
.login-disclaimer p { margin: 0 0 4px; }
.login-disclaimer p:last-child { margin: 0; }
.login-disclaimer strong { color: #5c4000; }

.tip-box--legal { background: #f0fdf4; border-color: #bbf7d0; color: #166534; margin-top: 8px; }
.tip-box--legal strong { color: #14532d; }

/* ── Datetime inputs: luôn dùng định dạng 24h ─────────────────────────────── */
input[type="time"],
input[type="datetime-local"] {
  -webkit-appearance: none;
  appearance: none;
}
/* Chrome/Edge: ẩn AM/PM selector khi locale là 24h (sẽ hoạt động khi html lang="vi") */
input[type="time"]::-webkit-datetime-edit-ampm-field,
input[type="datetime-local"]::-webkit-datetime-edit-ampm-field {
  display: none;
}

/* ── Nhật ký hoạt động ─────────────────────────────────────────────────────── */
.log-filter-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 20px; margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.log-filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr auto;
  gap: 12px; align-items: end;
}
@media (max-width: 900px) {
  .log-filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 500px) {
  .log-filter-grid { grid-template-columns: 1fr; }
}
.log-filter-field { display: flex; flex-direction: column; gap: 4px; }
.log-filter-field label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.log-filter-actions { display: flex; gap: 8px; }

.log-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }

.log-table-wrap { overflow-x: auto; border-radius: 12px; box-shadow: 0 1px 6px rgba(0,0,0,.07); }
.log-table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  font-size: 13px;
}
.log-table thead th {
  background: #f1f5f9; padding: 10px 12px; font-weight: 700;
  text-align: left; color: #374151; border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.log-row { border-bottom: 1px solid #f1f5f9; transition: background .1s; }
.log-row:hover { background: #f8fafc; }
.log-row td { padding: 8px 12px; vertical-align: middle; }

.log-time { white-space: nowrap; }
.log-date { display: block; font-size: 12px; color: #374151; font-weight: 600; }
.log-hour { display: block; font-size: 11px; color: var(--text-muted); }

.log-actor-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--blue); text-decoration: none; font-weight: 600; font-size: 12px;
}
.log-actor-link:hover { text-decoration: underline; }
.log-avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }

.log-desc { color: #1e293b; line-height: 1.4; max-width: 420px; }

.log-ip { font-size: 11px; color: var(--text-muted); font-family: monospace; }

/* Category badges */
.log-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 700; padding: 2px 7px;
  border-radius: 20px; white-space: nowrap;
}
.badge-auth     { background: #ede9fe; color: #5b21b6; }
.badge-bet      { background: #dcfce7; color: #15803d; }
.badge-follow   { background: #f3e8ff; color: #7e22ce; }
.badge-match    { background: #dbeafe; color: #1e40af; }
.badge-result   { background: #fef9c3; color: #92400e; }
.badge-score    { background: #fce7f3; color: #9d174d; }
.badge-user     { background: #e0f2fe; color: #0369a1; }
.badge-whitelist{ background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.badge-betvalue { background: #fff7ed; color: #c2410c; }
.badge-bulletin { background: #ecfeff; color: #0e7490; }
.badge-default  { background: #f1f5f9; color: #475569; }

/* Pagination */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 6px; margin-top: 20px; flex-wrap: wrap;
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid #d1d5db; border-radius: 8px;
  background: #fff; color: #374151; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all .15s;
}
.page-btn:hover { background: #dbeafe; border-color: #93c5fd; color: var(--blue); }
.page-btn--active { background: var(--blue); color: #fff; border-color: var(--blue); }
.page-ellipsis { color: var(--text-muted); padding: 0 4px; font-size: 14px; }

/* ── Profile ─────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px; align-items: start;
}
@media (max-width: 680px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-stats-col { order: 1; }
  .profile-card { order: 2; }
}

.profile-card {
  background: var(--surface); border-radius: 16px; padding: 24px 20px;
  box-shadow: var(--shadow); text-align: center;
}
@media (min-width: 681px) {
  .profile-card { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 88px); overflow-y: auto; }
}
.profile-avatar-wrap { margin-bottom: 14px; }
.profile-avatar-btn {
  display: block; margin: 0 auto; padding: 0; border: none; background: none;
  cursor: pointer; border-radius: 50%; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.profile-avatar-btn:hover .profile-avatar,
.profile-avatar-btn:hover .profile-avatar-placeholder { border-color: var(--blue); }
.profile-avatar-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.profile-avatar {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--border); display: block; transition: border-color .15s;
}
.profile-avatar-placeholder {
  width: 100px; height: 100px; border-radius: 50%;
  background: linear-gradient(135deg,#2563eb,#7c3aed);
  color: #fff; font-size: 40px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--border); transition: border-color .15s;
}
.profile-avatar-hint {
  font-size: 11px; color: var(--text-muted); margin-top: 6px;
}
.profile-name   { font-weight: 700; font-size: 18px; margin-bottom: 3px; }
.profile-sub    { font-size: 13px; color: var(--text-muted); margin-bottom: 2px; }
.profile-email  { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.profile-dept   { font-size: 13px; color: var(--blue); margin-bottom: 10px; }
.profile-score  {
  display: inline-block; background: var(--green-light); color: var(--green);
  font-size: 16px; font-weight: 700; padding: 5px 16px; border-radius: 20px;
  margin-bottom: 16px;
}
.profile-score.score-neg { background: var(--red-light); color: var(--red); }

.avatar-upload-label {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue-light); color: var(--blue);
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s;
}
.avatar-upload-label:hover { background: #bfdbfe; }
.avatar-hint { font-size: 11px; color: var(--text-muted); margin-top: 12px; line-height: 1.6; }

.profile-stats-col { display: flex; flex-direction: column; gap: 16px; }
.profile-section {
  background: var(--surface); border-radius: 14px; padding: 18px 20px;
  box-shadow: var(--shadow);
}
.profile-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }

.profile-stat-grid {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 8px;
}
@media (max-width: 500px) {
  .profile-stat-grid { grid-template-columns: repeat(2,1fr); }
}
.profile-stat {
  background: var(--gray-light); border-radius: 10px;
  padding: 12px 8px; text-align: center;
}
.pstat-num   { display: block; font-size: 20px; font-weight: 700; margin-bottom: 3px; }
.pstat-label { display: block; font-size: 11px; color: var(--text-muted); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red);   }

.profile-log-list { display: flex; flex-direction: column; gap: 6px; }
.profile-log-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 10px; border-radius: 8px; background: var(--gray-light);
  font-size: 13px;
}
.profile-log-desc  { color: #374151; flex: 1; margin-right: 12px; }
.profile-log-delta { font-weight: 700; white-space: nowrap; }

.profile-info-list { display: flex; flex-direction: column; gap: 8px; }
.profile-info-row  {
  display: flex; justify-content: space-between;
  font-size: 13px; padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.profile-info-row:last-child { border-bottom: none; padding-bottom: 0; }
.pinfo-label { color: var(--text-muted); }

/* ── Nút xem lượt chọn ──────────────────────── */
.btn-see-bets {
  margin-left: auto;
  background: #f1f5f9; border: 1px solid #e2e8f0;
  border-radius: 20px; padding: 3px 10px;
  font-size: 12px; font-weight: 600; color: #475569;
  cursor: pointer; transition: background .15s, color .15s;
  white-space: nowrap;
}
.btn-see-bets:hover { background: #dbeafe; color: #2563eb; border-color: #93c5fd; }

/* ── Bet Poll (phân bổ lựa chọn) ───────────── */
.bet-poll { margin: 10px 0 4px; }

.bet-poll-labels {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.poll-label-t { font-size: 13px; font-weight: 700; color: #2563eb; }
.poll-label-p { font-size: 13px; font-weight: 700; color: #dc2626; }

.bet-poll-bar {
  height: 12px; border-radius: 99px; overflow: hidden;
}

.bet-poll-total {
  text-align: center; font-size: 11px;
  color: var(--text-muted); margin-top: 5px;
}

/* ── Chat Widget ─────────────────────────── */
#chat-widget {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}

#chat-fab {
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff; border: none; border-radius: 50px;
  padding: 12px 20px; font-size: 14px; font-weight: 600;
  cursor: pointer; box-shadow: 0 4px 16px rgba(37,99,235,.45);
  transition: transform .15s, box-shadow .15s;
}
#chat-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,99,235,.55); }
#chat-fab-icon { font-size: 20px; line-height: 1; }

#chat-window {
  width: 370px; height: 520px;
  background: var(--surface); border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--border);
  animation: chatSlideIn .2s ease;
}
@keyframes chatSlideIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

#chat-header {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
#chat-header-info { display: flex; align-items: center; gap: 10px; }
.chat-avatar-bot { font-size: 28px; line-height: 1; }
.chat-header-btn {
  background: rgba(255,255,255,.2); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  font-size: 13px; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.chat-header-btn:hover { background: rgba(255,255,255,.35); }

#chat-messages {
  flex: 1; overflow-y: auto; padding: 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
#chat-messages::-webkit-scrollbar { width: 4px; }
#chat-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.bot  { justify-content: flex-start; }

.chat-bubble {
  max-width: 82%; padding: 9px 13px;
  border-radius: 14px; font-size: 13.5px; line-height: 1.55;
  word-break: break-word; white-space: pre-wrap;
}
.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff; border-bottom-right-radius: 4px;
}
.chat-msg.bot .chat-bubble {
  background: #f1f5f9; color: #1e293b;
  border-bottom-left-radius: 4px;
}

/* Typing indicator */
#chat-typing { padding: 0 12px 6px; display: flex; }
.typing-indicator { display: flex; align-items: center; gap: 4px; padding: 10px 14px !important; }
.typing-indicator span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #94a3b8; display: inline-block;
  animation: typingBounce 1.2s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: .2s; }
.typing-indicator span:nth-child(3) { animation-delay: .4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-5px); }
}

#chat-input-area {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-top: 1px solid #f1f5f9; flex-shrink: 0;
}
#chat-input {
  flex: 1; border: 1.5px solid var(--border); border-radius: 10px;
  padding: 8px 12px; font-size: 13.5px; outline: none;
  transition: border-color .15s; font-family: inherit;
  background: var(--input-bg); color: var(--text);
}
#chat-input:focus { border-color: #2563eb; }
#chat-send-btn {
  width: 36px; height: 36px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff; cursor: pointer; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; transition: opacity .15s;
}
#chat-send-btn:hover { opacity: .85; }
#chat-send-btn:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 500px) {
  #chat-window { width: calc(100vw - 16px); height: 72vh; }
  #chat-widget { bottom: 16px; right: 8px; }
  #chat-fab-label { display: none; }
  #chat-fab { padding: 12px; border-radius: 50%; }
}

/* ── Theme toggle ───────────────────────────── */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; font-size: 17px; line-height: 1;
  transition: background .15s, border-color .15s, transform .15s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--gray-light); transform: scale(1.05); }
.theme-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.theme-toggle--standalone {
  position: fixed; top: 14px; right: 14px; z-index: 200;
  box-shadow: var(--shadow);
}
[data-theme="light"] .theme-icon--dark,
[data-theme="dark"] .theme-icon--light { display: none; }

/* ── Bet detail modal ───────────────────────── */
.bd-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--overlay); display: none;
  align-items: center; justify-content: center; padding: 16px;
}
.bd-modal {
  background: var(--surface); border-radius: 20px; width: 100%; max-width: 520px;
  max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.3); overflow: hidden;
  border: 1px solid var(--border);
}
.bd-header {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff; padding: 18px 20px; display: flex;
  align-items: center; justify-content: space-between; flex-shrink: 0;
}
.bd-title { font-weight: 700; font-size: 16px; line-height: 1.3; }
.bd-sub { font-size: 12px; opacity: .8; margin-top: 3px; }
.bd-close {
  background: rgba(255,255,255,.2); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s;
}
.bd-close:hover { background: rgba(255,255,255,.35); }
.bd-bar { display: flex; height: 8px; flex-shrink: 0; }
.bd-cols { display: grid; grid-template-columns: 1fr 1px 1fr; flex: 1; overflow: hidden; min-height: 0; }
.bd-col { display: flex; flex-direction: column; overflow: hidden; }
.bd-col-divider { background: var(--border); }
.bd-head-t {
  padding: 12px 16px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  border-top: 3px solid #2563eb; background: var(--bd-head-t-bg, #f8faff);
}
.bd-head-p {
  padding: 12px 16px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
  border-top: 3px solid #ef4444; background: var(--bd-head-p-bg, #fff8f8);
}
.bd-list { overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.bd-empty { padding: 20px 8px; text-align: center; color: var(--text-muted); font-size: 13px; }
.bd-loading { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }
.bd-player {
  display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px;
}
.bd-player--me { background: var(--bd-me-bg, #eff6ff); }
.bd-player-name { font-size: 13px; color: var(--text); line-height: 1.3; }
.bd-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.bd-avatar-ph {
  width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.bd-me-tag {
  background: var(--blue-light); color: var(--blue); font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; margin-left: 4px;
}
.bd-head-title-t { font-weight: 700; font-size: 13px; color: #60a5fa; }
.bd-head-title-p { font-weight: 700; font-size: 13px; color: #f87171; }
.bd-head-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
