:root {
  --ink: #063554;
  --muted: #5a7188;
  --blue: #0a7ec9;
  --navy: #052c4a;
  --cyan: #12b8c4;
  --jade: #0d9b7a;
  --gold: #e8b23a;
  --bronze: #b8862d;
  --violet: #0d9b7a; /* giữ tên cũ → chuyển sang ngọc */
  --red: #c51f2d;
  --line: rgba(5, 44, 74, .12);
  --glass: linear-gradient(155deg, rgba(255,255,255,.88), rgba(232,246,248,.62));
  --shadow: 0 20px 48px rgba(5,44,74,.13), inset 0 1px 0 rgba(255,255,255,.92);
  --shadow-lift: 0 26px 56px rgba(5,44,74,.18), inset 0 1px 0 #fff;
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
  --display: "Lexend", "Be Vietnam Pro", system-ui, sans-serif;
  --radius: 20px;
  --ease: cubic-bezier(.22,1,.36,1);
  /* Chiều cao header — dùng cho thanh tổng điểm sticky */
  --topbar-h: 108px;
  --score-sticky-top: 112px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  position: relative; min-height: 100vh; color: var(--ink); font: 15px/1.5 var(--font);
  background:
    radial-gradient(920px 480px at 0% -10%, rgba(10,126,201,.22), transparent 58%),
    radial-gradient(780px 420px at 100% 0%, rgba(13,155,122,.16), transparent 55%),
    radial-gradient(640px 360px at 70% 100%, rgba(232,178,58,.12), transparent 50%),
    linear-gradient(180deg, #d4e8f4 0%, #e8f2f6 42%, #e2eef5 100%);
}
.ambient {
  pointer-events: none; position: fixed; inset: 0; z-index: -1; opacity: .55;
  background-image:
    radial-gradient(rgba(5,44,74,.06) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 88%);
}
a { color: var(--blue); }
svg { fill: currentColor; }
h1 { margin: 0 0 .4rem; font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
h2 { margin: 0 0 .6rem; font-size: 1.08rem; }
.display { font-family: var(--display); letter-spacing: -.03em; }
.lede, .muted { color: var(--muted); }
.lede { margin: 0 0 1rem; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,.72);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(245,251,255,.86));
  box-shadow: 0 12px 34px rgba(8,59,102,.1);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.topbar-inner {
  width: min(1440px, 100%); min-height: 88px; margin: auto; padding: .55rem clamp(1rem,3vw,2.4rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand-block {
  display: flex; align-items: center; gap: .85rem; min-width: 0; flex: 1 1 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  height: 100px;
  max-width: min(420px,38vw);
  color: var(--navy);
  text-decoration: none;
  flex: 0 1 auto;
}
.brand-logo { display: block; width: auto; height: 100%; max-width: 100%; object-fit: contain; object-position: left center; }
.brand-meta {
  min-width: 0; display: flex; flex-direction: column; justify-content: center;
  padding-left: .85rem; border-left: 1px solid rgba(8,59,102,.16); line-height: 1.2;
}
.brand-meta strong {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: min(280px,28vw); color: var(--navy); font-size: .92rem; font-weight: 800; text-transform: uppercase;
}
.brand-meta span { color: var(--muted); font-size: .72rem; font-weight: 700; margin-top: .18rem; }
.brand-mark {
  width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 16px; color: #fff;
  background: linear-gradient(145deg, #4eb8ef, var(--blue) 55%, var(--navy));
  box-shadow: 0 10px 22px rgba(8,118,201,.3), inset 0 1px 0 rgba(255,255,255,.5);
}
.brand-mark svg { width: 29px; height: 29px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.18; }
.brand-copy strong { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .025em; }
.brand-copy small { color: var(--muted); font-size: .72rem; font-weight: 600; margin-top: .15rem; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; }
.top-actions form { margin: 0; }
.nav-pill {
  min-height: 46px; display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1.15rem;
  border: 0; border-radius: 999px; color: var(--navy); text-decoration: none; font: 800 .9rem var(--font); cursor: pointer;
  background: linear-gradient(180deg, #fff, #eef7fd);
  box-shadow: 0 10px 22px rgba(8,59,102,.12), inset 0 0 0 1px rgba(8,118,201,.18), inset 0 1px 0 #fff;
  transition: transform .15s ease, box-shadow .15s ease;
}
.nav-pill svg { width: 19px; height: 19px; color: var(--blue); }
.nav-pill:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(8,118,201,.18), inset 0 0 0 1px rgba(8,118,201,.28); }
.nav-pill.active {
  color: #fff; background: linear-gradient(180deg, #4eb8ef, var(--blue) 52%, #0a4f8f);
  box-shadow: 0 14px 28px rgba(8,118,201,.3), inset 0 1px 0 rgba(255,255,255,.55);
}
.nav-pill.active svg { color: #fff; }
.nav-pill.login-button {
  color: #fff; background: linear-gradient(180deg, #28c9b8, #0f9a8f 45%, #0a6f78);
  box-shadow: 0 14px 28px rgba(10,111,120,.28), inset 0 1px 0 rgba(255,255,255,.55);
}
.nav-pill.login-button svg, .nav-pill.logout svg { color: #fff; }
.nav-pill.logout {
  color: #fff; background: linear-gradient(180deg, #ef6a74, var(--red));
  box-shadow: 0 12px 24px rgba(197,31,45,.25), inset 0 1px 0 rgba(255,255,255,.4);
}
.user-name {
  max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: .45rem .8rem; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--navy);
  background: rgba(255,255,255,.72); box-shadow: inset 0 0 0 1px rgba(8,59,102,.1);
}

.shell { display: flex; min-height: calc(100vh - 78px); }
.shell.public-shell { display: block; }
.admin-body { background:
  radial-gradient(780px 360px at 0% 0%, rgba(10,126,201,.2), transparent 62%),
  radial-gradient(720px 320px at 100% 0%, rgba(13,155,122,.12), transparent 55%),
  radial-gradient(600px 280px at 50% 100%, rgba(232,178,58,.1), transparent 50%),
  linear-gradient(180deg, #d0e4f2 0%, #eaf3f7 46%, #e3eef5 100%); }
.admin-shell { width: min(1480px,100%); margin: 0 auto; gap: 0; }
.side-nav {
  width: 268px; flex: none; margin: .85rem 0 .85rem .85rem; padding: 1rem .85rem 1.2rem;
  border: 1px solid rgba(255,255,255,.72); border-radius: 24px;
  background: linear-gradient(165deg, rgba(255,255,255,.9), rgba(232,243,251,.78));
  box-shadow: 0 18px 40px rgba(8,59,102,.12), inset 0 1px 0 #fff;
  backdrop-filter: blur(16px);
}
.side-brand {
  margin: 0 .2rem 1rem; padding: .9rem 1rem; border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(18,184,196,.35), transparent 42%),
    linear-gradient(145deg, #0a6eb5, #052c4a 72%);
  box-shadow: 0 14px 28px rgba(5,44,74,.24), inset 0 1px 0 rgba(255,255,255,.22);
}
.side-brand strong { display: block; font-size: .92rem; line-height: 1.25; }
.side-brand span { display: block; margin-top: .25rem; color: rgba(255,255,255,.75); font-size: .72rem; font-weight: 600; }
.nav-label { margin: .95rem .55rem .4rem; color: #6f88a0; font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.nav-label.nav-group { margin-top: 1.15rem; padding-top: .75rem; border-top: 1px dashed rgba(8,59,102,.14); }
.nav-item {
  display: flex; align-items: center; gap: .65rem; margin-bottom: .28rem; padding: .55rem .65rem;
  border-radius: 14px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .9rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.nav-item:hover { background: rgba(255,255,255,.9); color: var(--blue); transform: translateX(2px); box-shadow: 0 8px 18px rgba(8,59,102,.08); }
.nav-item.active {
  color: #fff; background: linear-gradient(135deg, #2aa0e4, #0876c9 55%, #0a4f8f);
  box-shadow: 0 12px 24px rgba(8,118,201,.28);
}
.nav-item.nav-hot { background: rgba(255,255,255,.55); box-shadow: inset 0 0 0 1px rgba(8,118,201,.1); }
.nav-item.nav-hot.active { color: #fff; background: linear-gradient(135deg, #2aa0e4, #0876c9 55%, #0a4f8f); }
.nav-ico {
  width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center;
  border-radius: 11px; color: var(--blue); background: rgba(8,118,201,.1);
}
.nav-ico svg { width: 18px; height: 18px; }
.nav-ico.blue { color: #fff; background: linear-gradient(145deg,#4eb8ef,#0876c9); }
.nav-ico.cyan { color: #fff; background: linear-gradient(145deg,#45d9e4,#0aa1ae); }
.nav-ico.gold { color: #6b4b0b; background: linear-gradient(145deg,#ffe58d,#f4b942); }
.nav-item.active .nav-ico { color: #fff; background: rgba(255,255,255,.18); }
.nav-item.active .nav-ico.gold { color: #fff; }
.nav-pill.admin-pill { color: #fff; background: linear-gradient(180deg,#4eb8ef,var(--blue) 55%,var(--navy)); }
.nav-pill.admin-pill svg { color: #fff; }
main { flex: 1; width: 100%; max-width: 1240px; padding: 1.25rem 1.4rem 2.5rem; }
.admin-main { max-width: none; padding: 1.1rem 1.2rem 2.4rem; }
.home-main { max-width: 1440px; margin: auto; padding: 1.3rem clamp(1rem,3vw,2.4rem) 3rem; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  margin-bottom: 1rem; padding: 1.05rem 1.15rem; border-radius: 22px;
  border: 1px solid rgba(255,255,255,.75); background: linear-gradient(135deg,rgba(255,255,255,.88),rgba(232,244,252,.72));
  box-shadow: 0 16px 34px rgba(8,59,102,.1), inset 0 1px 0 #fff;
}
.page-kicker { display: inline-block; margin-bottom: .28rem; color: #0a7ab5; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.page-head h1 { margin-bottom: .2rem; }
.page-head .lede { margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: flex-end; }
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: end; gap: .7rem;
  margin-bottom: .9rem; padding: .85rem 1rem; border-radius: 18px;
  border: 1px solid rgba(255,255,255,.7); background: rgba(255,255,255,.55);
  box-shadow: inset 0 1px 0 #fff;
}
.filter-bar > div { min-width: 150px; }
.filter-tabs { display: flex; gap: .35rem; margin-left: auto; }
.chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: .35rem .8rem;
  border-radius: 999px; color: var(--navy); text-decoration: none; font-size: .8rem; font-weight: 700;
  background: rgba(255,255,255,.85); box-shadow: inset 0 0 0 1px rgba(8,59,102,.12);
}
.chip.on { color: #fff; background: linear-gradient(180deg,#39a4df,var(--blue)); box-shadow: 0 8px 16px rgba(8,118,201,.22); }
.empty-panel { text-align: center; padding: 2rem 1.2rem; }
.empty-panel .muted { margin: .45rem 0 1rem; }
.rank-podium {
  display: grid; gap: .85rem; margin-bottom: 1.1rem;
}
.rank-podium-row {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem;
}
.rank-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: .28rem;
  padding: 1.15rem 1rem 1.2rem; border-radius: 22px; text-align: center;
  border: 1px solid rgba(255,255,255,.85); background: rgba(255,255,255,.78);
  box-shadow: 0 14px 28px rgba(8,59,102,.1);
  color: inherit; text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}
a.rank-card:hover { transform: translateY(-3px); box-shadow: 0 20px 36px rgba(8,59,102,.16); }
.rank-card strong {
  position: relative; z-index: 2;
  font-family: Lexend, "Be Vietnam Pro", sans-serif;
  font-size: 1.2rem; color: var(--navy); letter-spacing: .01em;
}
.rank-card b {
  position: relative; z-index: 2;
  color: var(--blue); font-size: 1.7rem; line-height: 1; font-weight: 800;
}
.rank-card b em { font-style: normal; font-size: .72em; margin-left: .08em; opacity: .75; }
.rank-card small {
  position: relative; z-index: 2;
  color: var(--muted); font-weight: 700; font-size: .78rem; letter-spacing: .02em;
}
.rank-badge {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 28px; padding: .2rem .7rem; margin-bottom: .15rem;
  border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .08em;
  color: #fff; background: linear-gradient(145deg, #4eb8ef, #0876c9);
  box-shadow: 0 8px 16px rgba(8,118,201,.2);
}
.lop-link { color: inherit; text-decoration: none; }
.lop-link:hover { color: var(--blue); text-decoration: underline; }

/* TOP 1 — hàng trên */
.rank-card.hang-1 {
  min-height: 210px; padding: 1.55rem 1.25rem 1.45rem;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255,230,120,.55), transparent 55%),
    linear-gradient(165deg, #fff8d8 0%, #ffe9a8 38%, #fff 72%);
  border-color: rgba(244,185,66,.45);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.65) inset,
    0 22px 44px rgba(180,120,20,.18),
    0 8px 18px rgba(8,59,102,.08);
  animation: rank-pulse 2.8s ease-in-out infinite;
}
.rank-card.hang-1:hover { transform: translateY(-4px) scale(1.01); }
.rank-card.hang-1 .rank-badge {
  background: linear-gradient(145deg, #ffe58d, #f4b942);
  color: #6b4b0b; box-shadow: 0 10px 18px rgba(244,185,66,.35);
}
.rank-card.hang-1 strong { font-size: 1.55rem; }
.rank-card.hang-1 b {
  font-size: 2.35rem;
  background: linear-gradient(180deg, #c98912, #8a5a08);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rank-card.hang-1 small { color: #8a6a28; }
.rank-crown {
  position: relative; z-index: 2; width: 56px; height: 36px; margin-bottom: .1rem;
  filter: drop-shadow(0 6px 10px rgba(201,137,18,.35));
  animation: crown-bob 2.2s ease-in-out infinite;
}
.rank-crown svg { width: 100%; height: 100%; fill: url(#none); }
.rank-crown svg path {
  fill: #f4b942; stroke: #c98912; stroke-width: 1.2;
}
.rank-shine {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: rank-shine 3.6s ease-in-out infinite;
}
.fw-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
}

/* TOP 2–3 — hàng dưới */
.rank-card.hang-2 {
  background: linear-gradient(165deg, #eef3f8 0%, #f7fafc 55%, #fff 100%);
  border-color: rgba(142,164,184,.4);
}
.rank-card.hang-2 .rank-badge {
  background: linear-gradient(145deg, #dce7f1, #8ea4b8); color: #2c3e50;
  box-shadow: 0 8px 14px rgba(100,120,140,.2);
}
.rank-card.hang-2 b { color: #5a7188; }
.rank-card.hang-3 {
  background: linear-gradient(165deg, #f8ebe0 0%, #fff6ef 55%, #fff 100%);
  border-color: rgba(201,123,69,.35);
}
.rank-card.hang-3 .rank-badge {
  background: linear-gradient(145deg, #f0c9a8, #c97b45); color: #5a3018;
  box-shadow: 0 8px 14px rgba(201,123,69,.22);
}
.rank-card.hang-3 b { color: #a85a2a; }

@keyframes rank-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,255,255,.65) inset, 0 22px 44px rgba(180,120,20,.18), 0 8px 18px rgba(8,59,102,.08); }
  50% { box-shadow: 0 0 0 1px rgba(255,255,255,.8) inset, 0 26px 52px rgba(180,120,20,.28), 0 0 28px rgba(255,210,80,.35); }
}
@keyframes crown-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes rank-shine {
  0%, 55% { transform: translateX(-120%); }
  80%, 100% { transform: translateX(120%); }
}

.rank-pill {
  display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 .4rem;
  border-radius: 999px; color: #fff; font-weight: 800; background: linear-gradient(145deg,#4eb8ef,#0876c9);
}
tr.top-rank td { background: rgba(255,246,214,.45); }

.phan-cong-grid {
  display: flex; flex-wrap: wrap; gap: .4rem .65rem;
  padding: .55rem .7rem; border-radius: 12px;
  background: rgba(255,255,255,.55); box-shadow: inset 0 0 0 1px rgba(8,59,102,.1);
  max-height: 160px; overflow: auto;
}
.phan-cong-item {
  display: inline-flex; align-items: center; gap: .35rem;
  margin: 0; color: var(--ink); font-size: .84rem; font-weight: 600; cursor: pointer;
}
.phan-cong-item input { width: auto; margin: 0; }

.glass, .panel, .card {
  border: 1px solid rgba(255,255,255,.72); background: var(--glass);
  box-shadow: var(--shadow); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
}
.panel, .card { border-radius: 18px; padding: 1rem 1.05rem; }
.panel { margin-bottom: 1rem; }
.alert { padding: .7rem .9rem; border-radius: 12px; margin-bottom: .9rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); }
.alert.ok { background: rgba(218,244,232,.9); color: #0d6a46; }
.alert.loi { background: rgba(253,232,228,.92); color: #8d2b2b; }
.row { display: flex; gap: .65rem; flex-wrap: wrap; align-items: end; }
.grow { flex: 1; min-width: 180px; }

label { display: block; margin-bottom: .22rem; color: var(--muted); font-size: .8rem; font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid rgba(8,59,102,.18); border-radius: 10px;
  color: var(--ink); background: rgba(255,255,255,.82); font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(8,118,201,.5); box-shadow: 0 0 0 3px rgba(8,118,201,.12); }
textarea { min-height: 88px; }
.chk { display: flex; align-items: center; gap: .4rem; margin-top: 1.3rem; }
.chk input { width: auto; }
.btn, button.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: .55rem 1rem; border: 0; border-radius: 999px;
  color: #fff; background: linear-gradient(180deg, #3eb0e8, var(--blue) 52%, #064a7a);
  box-shadow: 0 10px 22px rgba(10,126,201,.24), inset 0 1px 0 rgba(255,255,255,.35);
  text-decoration: none; cursor: pointer; font: 700 .9rem var(--font);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover, button.btn:hover, a.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(10,126,201,.3), inset 0 1px 0 rgba(255,255,255,.4); }
.btn.phu { color: var(--ink); background: rgba(255,255,255,.9); border: 1px solid var(--line); box-shadow: 0 6px 14px rgba(5,44,74,.06); }
.btn.phu:hover { box-shadow: 0 10px 20px rgba(5,44,74,.1); }
.btn.nguy { background: linear-gradient(180deg, #e85a66, var(--red)); box-shadow: 0 10px 22px rgba(197,31,45,.22); }
.btn.nho { padding: .35rem .7rem; font-size: .82rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }
.link, button.link { padding: 0; border: 0; background: none; color: var(--blue); cursor: pointer; font: inherit; text-decoration: underline; }

.bang { overflow: auto; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.58); }
table { width: 100%; border-collapse: collapse; background: transparent; }
th, td { padding: .5rem .55rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: rgba(241,247,252,.78); font-size: .73rem; letter-spacing: .035em; text-transform: uppercase; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.tat td { color: var(--muted); }
.badge { display: inline-block; padding: .06rem .5rem; border-radius: 999px; background: #e7eef5; font-size: .75rem; }
.badge.chon { color: #78520e; background: #f8e6b6; }
.badge.tat { background: #eee; }
.diem { font-variant-numeric: tabular-nums; font-weight: 700; }
.tong { color: var(--blue); }
.ghi { max-width: 340px; color: #334; white-space: pre-wrap; }
.delta-cell { min-width: 180px; max-width: 320px; }
.delta-list { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .3rem; }
.delta-chip {
  display: inline-flex; align-items: baseline; gap: .25rem;
  padding: .22rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.delta-chip em { font-style: normal; font-weight: 700; opacity: .75; font-size: .7rem; }
.delta-chip.minus { color: #9b1c28; background: rgba(197,31,45,.1); }
.delta-chip.plus { color: #0a6d5c; background: rgba(13,155,122,.12); }
.delta-chip.ok { color: #0a6d5c; background: rgba(13,155,122,.14); }
.delta-empty { color: var(--muted); font-size: .82rem; font-weight: 600; }

/* Chấm điểm: thẻ mobile (ẩn trên desktop) */
/* Báo cáo lỗi + khối chấm */
.bao-cao-loi { margin-bottom: 1rem; }
.bao-cao-head { margin-bottom: .75rem; }
.bao-cao-head h2 { margin: 0 0 .2rem; font-size: 1.25rem; }
.bao-cao-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .85rem; }
.bao-cao-tabs .chip { border: 0; cursor: pointer; font: inherit; }
.bc-pane { display: none; }
.bc-pane.on { display: block; }
.loi-bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.loi-bar-meta {
  display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; margin-bottom: .22rem;
}
.loi-bar-ten { color: var(--navy); font-size: .88rem; font-weight: 700; line-height: 1.3; }
.loi-bar-so { flex: 0 0 auto; color: var(--muted); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.loi-bar-so b { color: var(--red); }
.loi-bar-track {
  height: 8px; border-radius: 999px; background: rgba(8,59,102,.08); overflow: hidden;
}
.loi-bar-track span {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, #e85a66, var(--red));
  min-width: 2px;
}
.loi-lop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .65rem;
}
.loi-lop-card {
  padding: .7rem .8rem; border-radius: 14px;
  background: rgba(255,255,255,.72); box-shadow: inset 0 0 0 1px rgba(8,59,102,.1);
}
.loi-lop-card header {
  display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .45rem;
}
.loi-lop-card header strong { color: var(--navy); }
.loi-lop-card header span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.loi-lop-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.loi-lop-card li {
  display: grid; grid-template-columns: 1fr auto auto; gap: .4rem; align-items: baseline;
  font-size: .78rem;
}
.loi-lop-card li span {
  color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.loi-lop-card li b { color: var(--red); }
.loi-lop-card li em { color: var(--muted); font-style: normal; font-weight: 700; }

.khoi-cham-list { display: grid; gap: .7rem; }
.khoi-block {
  border-radius: 18px; border: 1px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.55); box-shadow: var(--shadow);
  overflow: hidden;
}
.khoi-summary {
  list-style: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .65rem 1rem; padding: .85rem 1rem; cursor: pointer; user-select: none;
}
.khoi-summary::-webkit-details-marker { display: none; }
.khoi-summary-main { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .85rem; min-width: 0; }
.khoi-badge {
  display: inline-flex; align-items: center; min-height: 34px; padding: .25rem .75rem;
  border-radius: 999px; color: #fff; font-weight: 800; font-size: .9rem;
  background: linear-gradient(145deg, #4eb8ef, #0876c9);
  box-shadow: 0 8px 16px rgba(8,118,201,.22);
}
.khoi-stats { color: var(--ink); font-size: .88rem; font-weight: 600; }
.khoi-stats b { color: var(--navy); }
.khoi-summary-nhat {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem;
  color: var(--navy); font-size: .86rem;
}
.khoi-summary-nhat strong { font-size: .95rem; }
.khoi-summary-nhat em { color: var(--blue); font-style: normal; font-weight: 800; }
.khoi-caret {
  width: 18px; height: 18px; margin-left: .25rem;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5z'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: .55; transition: transform .15s ease;
}
.khoi-block[open] .khoi-caret { transform: rotate(180deg); }
.khoi-block[open] .khoi-summary {
  border-bottom: 1px solid rgba(8,59,102,.1);
  background: rgba(232,246,255,.45);
}
.khoi-body { padding: .85rem 1rem 1rem; }
.khoi-loi-mini { margin-bottom: .75rem; }
.khoi-loi-mini strong {
  display: block; margin-bottom: .35rem; color: var(--muted);
  font-size: .72rem; letter-spacing: .04em; text-transform: uppercase;
}
.khoi-loi-mini .delta-chip { max-width: 100%; }
.khoi-loi-mini .delta-chip em { opacity: .9; }

@media print {
  .khoi-block { break-inside: avoid; }
  details.khoi-block > .khoi-body { display: block !important; }
  .bc-pane { display: block !important; margin-bottom: 1rem; }
  .bao-cao-tabs { display: none !important; }
}

.cham-cards { display: none; }
.cham-card {
  display: flex; flex-direction: column; gap: .65rem;
  margin-bottom: .7rem; padding: .85rem .9rem; border-radius: 18px;
  border: 1px solid rgba(255,255,255,.82); background: rgba(255,255,255,.78);
  box-shadow: 0 12px 28px rgba(8,59,102,.1), inset 0 1px 0 #fff;
}
.cham-card.chua { background: rgba(255,255,255,.62); }
.cham-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
}
.cham-card-title { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .45rem; }
.cham-card-title h3 {
  margin: 0; color: var(--navy); font-family: var(--display);
  font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2;
}
.cham-card-score { flex: 0 0 auto; text-align: right; line-height: 1.15; }
.cham-card-score b {
  display: block; color: var(--blue); font-family: var(--display);
  font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em;
}
.cham-card-score span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.cham-card-delta .delta-list { margin-bottom: 0; }
.cham-card-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem;
  margin: 0; padding: .55rem .45rem; list-style: none;
  border-radius: 12px; background: rgba(8,59,102,.04);
}
.cham-card-metrics li {
  display: flex; flex-direction: column; align-items: center; gap: .12rem; min-width: 0; text-align: center;
}
.cham-card-metrics em { color: var(--muted); font-size: .65rem; font-style: normal; font-weight: 700; }
.cham-card-metrics strong { color: var(--navy); font-size: .92rem; font-variant-numeric: tabular-nums; }
.cham-card-actions {
  display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .1rem;
}
.cham-card-actions form { margin: 0; flex: 1 1 auto; min-width: 0; }
.cham-card-actions .btn {
  flex: 1 1 auto; min-width: 0; width: 100%; min-height: 44px;
}
.cham-card-actions .link-chi-tiet { flex: 0 1 auto; width: auto; min-width: 5.5rem; }
.cham-card-actions .cham-go {
  flex: 1 1 8rem; min-height: 44px; font-size: .95rem;
}
.link-chi-tiet {
  display: inline-block; margin-top: .15rem; padding: 0; border: 0; background: none;
  color: var(--blue); font: 700 .78rem var(--font); cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.link-chi-tiet:hover { color: var(--navy); }
.chi-tiet-dialog {
  width: min(520px, calc(100vw - 2rem)); max-height: min(80vh, 640px); padding: 0; border: 0;
  border-radius: 22px; background: transparent; box-shadow: none;
}
.chi-tiet-dialog::backdrop { background: rgba(5, 32, 54, .48); backdrop-filter: blur(4px); }
.chi-tiet-card {
  display: flex; flex-direction: column; gap: .85rem; margin: 0; padding: 1.1rem 1.15rem 1rem;
  border-radius: 22px; border: 1px solid rgba(255,255,255,.85);
  background: linear-gradient(155deg, rgba(255,255,255,.97), rgba(232,246,248,.9));
  box-shadow: 0 28px 64px rgba(5,44,74,.28), inset 0 1px 0 #fff;
}
.chi-tiet-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.chi-tiet-card header h2 { margin: 0; font-size: 1.25rem; }
.chi-tiet-body {
  max-height: 48vh; overflow: auto; padding: .85rem .95rem; border-radius: 14px;
  background: rgba(255,255,255,.78); box-shadow: inset 0 0 0 1px rgba(5,44,74,.08);
  color: var(--ink); font-size: .92rem; line-height: 1.55; white-space: pre-wrap;
}
.chi-tiet-card footer { display: flex; justify-content: flex-end; }
.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: .65rem; margin: .8rem 0 1rem; }
.stat { padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.8); }
.stat b { display: block; font-size: 1.25rem; }
.stat em { color: var(--muted); font-size: .76rem; font-style: normal; }
table.phieu input, table.phieu select { min-width: 0; }
table.phieu td { vertical-align: middle; }
.xoa-dong {
  width: 34px; height: 34px; border: 0; border-radius: 10px; cursor: pointer; font: inherit;
  color: var(--red); background: rgba(197,31,45,.08);
}
.xoa-dong:hover { background: rgba(197,31,45,.16); }

.phieu-head .page-kicker {
  display: inline-block; margin-bottom: .35rem; padding: .2rem .55rem; border-radius: 999px;
  color: #0a6d66; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(40,201,184,.16);
}
.phieu-form { display: flex; flex-direction: column; gap: 1rem; }
.block-quick { box-shadow: 0 14px 30px rgba(10,139,130,.1), inset 0 1px 0 #fff, inset 4px 0 0 #0a8b82; }
.score-sticky {
  position: sticky; top: var(--score-sticky-top); z-index: 40; display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr)) auto; gap: .55rem; align-items: center;
  padding: .75rem .85rem; border-radius: 18px;
  border: 1px solid rgba(255,255,255,.8);
  background: linear-gradient(145deg,rgba(255,255,255,.94),rgba(232,244,252,.9));
  box-shadow: 0 14px 32px rgba(8,59,102,.14), inset 0 1px 0 #fff;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  /* Tránh bị cắt mép khi nổi */
  overflow: visible; width: 100%; box-sizing: border-box;
}
.score-chip {
  display: flex; flex-direction: column; gap: .1rem; padding: .55rem .7rem; border-radius: 14px;
  background: rgba(255,255,255,.78); box-shadow: inset 0 0 0 1px rgba(8,59,102,.08);
  min-width: 0;
}
.score-chip span { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.score-chip b { color: var(--navy); font-size: 1.35rem; line-height: 1.1; white-space: nowrap; }
.score-chip.tong { background: linear-gradient(145deg,#e8f6ff,#d7ecfb); }
.score-chip.tong b { color: var(--blue); }
.score-chip .lbl-full, .picked-tong .lbl-full { font-style: normal; }
.score-chip .lbl-short, .picked-tong .lbl-short { display: none; font-style: normal; }
.score-actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }
.phieu-lop { display: inline; }
.phieu-tuan::before { content: " · "; }
.phieu-tuan { display: inline; color: var(--muted); font-weight: 700; font-size: .85em; }
.phieu-block {
  border-radius: 22px; padding: 1.05rem 1.1rem 1.15rem;
  border: 1px solid rgba(255,255,255,.78); background: rgba(255,255,255,.62);
  box-shadow: 0 14px 30px rgba(8,59,102,.08), inset 0 1px 0 #fff;
}
.block-nenep { box-shadow: 0 14px 30px rgba(8,118,201,.1), inset 0 1px 0 #fff, inset 4px 0 0 #0876c9; }
.block-hoctap { box-shadow: 0 14px 30px rgba(32,201,216,.1), inset 0 1px 0 #fff, inset 4px 0 0 #20c9d8; }
.block-thuong { box-shadow: 0 14px 30px rgba(244,185,66,.12), inset 0 1px 0 #fff, inset 4px 0 0 #f4b942; }
.block-khac { box-shadow: 0 14px 30px rgba(115,87,216,.08), inset 0 1px 0 #fff, inset 4px 0 0 #7357d8; }
.phieu-dc { width: 180px; flex: 0 0 180px; }
.phieu-ghichu { min-width: 220px; }
.phieu-ghichu textarea { width: 100%; display: block; box-sizing: border-box; }
.block-title { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .85rem; }
.block-num {
  width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%;
  color: #fff; font-weight: 800; background: linear-gradient(145deg,#4eb8ef,#0876c9);
}
.block-title h2 { margin: 0 0 .15rem; font-size: 1.12rem; }
.block-title p { margin: 0; color: var(--muted); font-size: .82rem; }
.quick-actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.btn.hot {
  min-height: 48px; padding: .7rem 1.2rem;
  background: linear-gradient(180deg,#28c9b8,#0a8b82);
  box-shadow: 0 12px 24px rgba(10,139,130,.25);
}
.day-picker { display: flex; flex-wrap: wrap; gap: .35rem; }
.day-btn {
  min-width: 48px; min-height: 42px; border: 0; border-radius: 12px; cursor: pointer;
  color: var(--navy); font: 800 .86rem var(--font);
  background: rgba(255,255,255,.9); box-shadow: inset 0 0 0 1px rgba(8,59,102,.12);
}
.day-btn.on { color: #fff; background: linear-gradient(145deg,#4eb8ef,#0876c9); box-shadow: 0 8px 16px rgba(8,118,201,.25); }
.picker-bar { margin-bottom: .7rem; width: 100%; }
.picker-bar.full { display: block; width: 100%; }
.picker-bar input,
.picker-bar.full input { display: block; width: 100%; min-height: 46px; font-size: .95rem; box-sizing: border-box; }
.chip-groups, .check-groups { display: grid; gap: .8rem; max-height: 420px; overflow: auto; padding-right: .2rem; margin-bottom: .85rem; }
.chip-group h3, .check-group h3 { margin: 0 0 .4rem; color: var(--muted); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; }
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.check-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem;
}
.loi-check {
  display: flex; flex-direction: column; gap: .4rem; padding: .45rem .5rem;
  border-radius: 12px; background: rgba(255,255,255,.92);
  box-shadow: inset 0 0 0 1px rgba(8,118,201,.14);
  transition: box-shadow .12s ease, background .12s ease;
}
.loi-check.on {
  background: linear-gradient(160deg, rgba(232,246,255,.98), rgba(255,255,255,.95));
  box-shadow: inset 0 0 0 1px rgba(8,118,201,.35), 0 6px 14px rgba(8,118,201,.1);
}
.loi-check-top {
  display: grid; grid-template-columns: auto 1fr auto; gap: .35rem .4rem; align-items: start;
  cursor: pointer; margin: 0;
}
.loi-check-top input { width: auto; margin: .15rem 0 0; accent-color: #0876c9; }
.loi-ngan {
  color: var(--navy); font-size: .78rem; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.loi-check-top em { color: var(--blue); font-size: .68rem; font-style: normal; font-weight: 800; white-space: nowrap; }
.loi-check-top em.tru { color: var(--red); }
.loi-check.thuong-check.on {
  background: linear-gradient(160deg, rgba(255,248,230,.98), rgba(255,255,255,.95));
  box-shadow: inset 0 0 0 1px rgba(176,122,0,.28), 0 6px 14px rgba(176,122,0,.08);
}
.loi-detail { display: grid; gap: .35rem; padding-top: .15rem; border-top: 1px dashed rgba(8,118,201,.18); }
.loi-detail[hidden] { display: none !important; }
.loi-detail .loi-hs {
  min-height: 34px; margin: 0; padding: .35rem .5rem; font-size: .82rem;
}
.loi-detail-row { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.loi-detail .qty-cell input { width: 48px; min-height: 32px; }
.loi-detail .qty-btn { width: 30px; height: 30px; }
.donvi-label { color: var(--muted); font-size: .72rem; font-weight: 700; }
.pick-chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: .12rem;
  max-width: 100%; padding: .5rem .7rem; border: 0; border-radius: 12px; cursor: pointer; text-align: left;
  color: var(--navy); background: rgba(255,255,255,.92);
  box-shadow: inset 0 0 0 1px rgba(8,118,201,.16), 0 4px 10px rgba(8,59,102,.05);
  transition: transform .12s ease, box-shadow .12s ease;
}
.pick-chip:hover { transform: translateY(-1px); box-shadow: 0 8px 16px rgba(8,118,201,.14), inset 0 0 0 1px rgba(8,118,201,.28); }
.pick-chip span { font-size: .82rem; font-weight: 700; line-height: 1.25; }
.pick-chip em { color: var(--blue); font-size: .72rem; font-style: normal; font-weight: 800; }
.pick-chip.thuong em { color: #b07a00; }
.picked-box {
  border-radius: 16px; padding: .75rem; background: rgba(244,249,253,.78);
  box-shadow: inset 0 0 0 1px rgba(8,59,102,.08);
}
.picked-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .55rem; }
.picked-head strong { color: var(--navy); }
.picked-head span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.picked-tong {
  display: flex; justify-content: space-between; align-items: center; gap: .75rem;
  margin-top: .7rem; padding: .65rem .8rem; border-radius: 12px;
  background: rgba(197,31,45,.07); box-shadow: inset 0 0 0 1px rgba(197,31,45,.14);
}
.picked-tong span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.picked-tong strong { color: var(--red); font-size: 1.05rem; }
.picked-tong.thuong { background: rgba(244,185,66,.14); box-shadow: inset 0 0 0 1px rgba(176,122,0,.18); }
.picked-tong.thuong strong { color: #9a6a00; }
.picked-tong.hoctap {
  margin-top: .85rem;
  background: rgba(18,184,196,.1); box-shadow: inset 0 0 0 1px rgba(10,161,174,.2);
}
.picked-tong.hoctap strong { color: #0a7a84; }
.picked-tong.hoctap .ht-con {
  color: var(--muted); font-size: .82rem; font-weight: 700; white-space: nowrap;
}
.picked-tong.hoctap .ht-con b { color: #0a7a84; font-size: 1em; }
.empty-hint { margin: .4rem 0 0; color: var(--muted); font-size: .82rem; }
.hidden-form { display: none !important; }
.loi-ten { font-weight: 700; color: var(--navy); line-height: 1.3; }
.qty-cell { display: inline-flex; align-items: center; gap: .25rem; }
.qty-cell input { width: 56px; text-align: center; padding: .35rem .2rem; }
.qty-btn {
  width: 34px; height: 34px; border: 0; border-radius: 10px; cursor: pointer;
  color: var(--navy); font: 800 1rem var(--font); background: #fff;
  box-shadow: inset 0 0 0 1px rgba(8,59,102,.14);
}
.qty-btn:hover { background: #eef7fd; color: var(--blue); }
.qty-cell.big { margin-top: .55rem; }
.qty-cell.big input { width: 70px; min-height: 44px; font-size: 1.15rem; font-weight: 800; }
.qty-cell.big .qty-btn { width: 42px; height: 42px; }
.toggle-pill {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 34px; padding: .2rem .55rem;
  border-radius: 999px; cursor: pointer; background: rgba(255,255,255,.9);
  box-shadow: inset 0 0 0 1px rgba(8,59,102,.12); font-size: .78rem; font-weight: 800;
}
.toggle-pill input { width: auto; margin: 0; }
.stepper-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .7rem; }
.stepper-card {
  display: flex; flex-direction: column; padding: .9rem; border-radius: 16px;
  background: linear-gradient(160deg,rgba(255,255,255,.95),rgba(232,248,251,.8));
  box-shadow: inset 0 0 0 1px rgba(10,161,174,.14);
}
.stepper-card span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.stepper-card strong { margin-top: .2rem; color: #0a7a84; font-size: .95rem; }
tr.dong.flash { animation: flashRow .45s ease; }
@keyframes flashRow {
  from { background: rgba(40,201,184,.28); }
  to { background: transparent; }
}
.phieu-footer-actions {
  display: flex; flex-wrap: nowrap; align-items: center; gap: .5rem;
  margin-top: .35rem; overflow-x: auto;
}
.phieu-footer-actions .btn { flex: 0 0 auto; white-space: nowrap; }

.brand-hero {
  position: relative; overflow: hidden; border-radius: 28px; margin-bottom: .5rem;
  background: #052c4a;
  box-shadow: 0 28px 64px rgba(5,44,74,.28), inset 0 1px 0 rgba(255,255,255,.28);
  animation: riseIn .7s var(--ease) both;
}
.hero-values {
  position: absolute; z-index: 2; right: clamp(1rem,3vw,2.4rem); bottom: clamp(.9rem,2.4vw,1.6rem);
  display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end;
}
.hero-values span {
  padding: .35rem .7rem; border-radius: 999px; color: #fff; font-size: .72rem; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
  background: rgba(5,44,74,.55); border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(8px); box-shadow: 0 8px 18px rgba(0,0,0,.15);
}
.brand-hero > img {
  display: block; width: 100%; height: auto; min-height: clamp(220px,32vw,420px);
  aspect-ratio: 21 / 8; object-fit: cover; object-position: center center;
}
.brand-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); border-radius: inherit; }
.brand-hero-cta {
  position: absolute; z-index: 2; left: clamp(1.2rem,3.5vw,3.2rem); bottom: clamp(1rem,2.8vw,2rem);
  display: flex; align-items: flex-start; flex-direction: column; gap: .65rem;
}
.hero-context {
  display: flex; flex-direction: column; padding: .6rem .95rem; border-radius: 14px; color: #fff;
  background: rgba(3,43,76,.78); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); backdrop-filter: blur(8px);
}
.hero-context strong { font-size: .95rem; text-transform: uppercase; }
.hero-context span { margin-top: .12rem; color: rgba(255,255,255,.78); font-size: .74rem; }
.brand-hero-cta .hero-cta {
  color: #fff; background: linear-gradient(180deg,#2ed4b8,#0d9b7a 55%,#087a62);
  box-shadow: 0 14px 32px rgba(8,90,72,.4), inset 0 1px 0 rgba(255,255,255,.55);
  font-family: var(--display); letter-spacing: -.01em;
}
.brand-hero-cta .hero-cta:hover { transform: translateY(-2px); }
.brand-hero-cta .hero-cta svg { color: #fff; }
.top5-section { margin-top: 1.35rem; }
.top5-list { display: grid; gap: .7rem; }
.top5-item {
  display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: .9rem;
  padding: .9rem 1rem; border-radius: 18px; border: 1px solid rgba(255,255,255,.8);
  background: linear-gradient(145deg,rgba(255,255,255,.9),rgba(237,246,253,.72));
  box-shadow: 0 12px 28px rgba(8,59,102,.1), inset 0 1px 0 #fff;
}
.top5-rank {
  width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
  color: #fff; font-size: 1.15rem; font-weight: 800;
  background: linear-gradient(145deg,#4eb8ef,#0876c9); box-shadow: 0 8px 16px rgba(8,118,201,.22);
}
.top5-copy { min-width: 0; display: flex; flex-direction: column; }
.top5-copy strong { font-size: 1.12rem; color: var(--navy); }
.top5-copy small { color: var(--muted); font-size: .78rem; font-weight: 600; margin-top: .12rem; }
.top5-score { text-align: right; }
.top5-score b { display: block; color: var(--blue); font-size: 1.45rem; line-height: 1; }
.top5-score span { color: var(--muted); font-size: .72rem; font-weight: 700; }
.top5-item.hang-1 {
  background: linear-gradient(145deg,rgba(255,246,210,.95),rgba(255,255,255,.82));
  box-shadow: 0 16px 32px rgba(180,130,20,.14), inset 0 1px 0 #fff;
}
.top5-item.hang-1 .top5-rank { color: #6b4b0b; background: linear-gradient(145deg,#ffe58d,#f4b942); }
.top5-item.hang-2 .top5-rank { background: linear-gradient(145deg,#d9e5f0,#8ea4b8); }
.top5-item.hang-3 .top5-rank { background: linear-gradient(145deg,#f0c9a8,#c97b45); }

.home-hero {
  position: relative; min-height: 350px; display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr);
  align-items: center; overflow: hidden; border-radius: 30px; padding: clamp(1.6rem,4vw,3.2rem);
  background:
    radial-gradient(circle at 82% 42%, rgba(32,201,216,.27), transparent 32%),
    linear-gradient(125deg, rgba(8,59,102,.97), rgba(8,118,201,.89) 58%, rgba(32,201,216,.7));
  box-shadow: 0 24px 60px rgba(8,59,102,.25), inset 0 1px 0 rgba(255,255,255,.3);
}
.home-hero::before, .home-hero::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.13); }
.home-hero::before { width: 460px; height: 460px; right: -90px; top: -180px; }
.home-hero::after { width: 300px; height: 300px; right: 80px; bottom: -210px; }
.hero-copy { position: relative; z-index: 2; color: #fff; }
.hero-kicker, .section-kicker { display: block; margin-bottom: .65rem; color: #8ce8f0; font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.hero-copy h1 { max-width: 780px; font-size: clamp(2rem,4.7vw,4rem); line-height: 1.08; letter-spacing: -.035em; }
.hero-copy h1 em { color: #9ef1f5; font-style: normal; }
.hero-copy p { max-width: 660px; margin: 1rem 0 1.35rem; color: rgba(255,255,255,.82); font-size: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1rem; }
.hero-cta {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 48px; padding: .65rem 1.15rem;
  border-radius: 999px; color: var(--navy); background: linear-gradient(180deg,#fff,#dff8fb);
  box-shadow: 0 12px 25px rgba(0,0,0,.2), inset 0 1px 0 #fff; font-weight: 800; text-decoration: none;
}
.hero-cta svg { width: 20px; height: 20px; color: var(--blue); }
.formula { color: rgba(255,255,255,.72); font-size: .8rem; font-weight: 600; }
.hero-visual { position: relative; z-index: 2; min-height: 250px; display: grid; place-items: center; }
.trophy {
  width: 210px; height: 210px; display: grid; place-items: center; border-radius: 50%; color: #fff2ad;
  background: linear-gradient(145deg,rgba(255,255,255,.2),rgba(255,255,255,.05));
  box-shadow: 0 20px 50px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.25); backdrop-filter: blur(12px);
}
.trophy svg { width: 132px; filter: drop-shadow(0 12px 15px rgba(0,0,0,.22)); }
.float-icon { position: absolute; display: grid; place-items: center; border-radius: 16px; color: #fff; font-size: 1.3rem; font-weight: 900; box-shadow: 0 12px 25px rgba(0,0,0,.18); }
.float-icon.book { width: 52px; height: 52px; left: 5%; top: 18%; background: linear-gradient(145deg,#64db90,#198b52); transform: rotate(-8deg); }
.float-icon.star { width: 46px; height: 46px; right: 4%; top: 10%; color: #77520c; background: linear-gradient(145deg,#ffe889,#f4b942); transform: rotate(10deg); }
.float-icon.chart { width: 48px; height: 48px; right: 7%; bottom: 8%; background: linear-gradient(145deg,#a993ff,#6c4dd1); }

.week-head {
  position: relative; z-index: 25;
  display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 2rem 0 .85rem;
}
.week-head:has(.week-menu[open]) { z-index: 60; }
.week-head h2 { margin: 0; font-size: clamp(1.4rem,2.4vw,1.95rem); }
.section-kicker {
  display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .35rem;
  color: var(--jade); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.section-kicker::before {
  content: ""; width: 18px; height: 3px; border-radius: 999px;
  background: linear-gradient(90deg, var(--jade), var(--gold));
}
.week-chip {
  position: relative; display: flex; align-items: center; gap: .55rem; padding: .55rem .8rem; border-radius: 16px;
  background: rgba(255,255,255,.66); border: 1px solid rgba(255,255,255,.8); color: var(--muted); font-size: .72rem;
}
.week-menu { position: relative; z-index: 1; padding: 0; border: 0; background: transparent; }
.week-menu[open] { z-index: 70; }
.week-menu > summary {
  list-style: none; display: flex; align-items: center; gap: .55rem; cursor: pointer; user-select: none;
  padding: .55rem .75rem .55rem .8rem; border-radius: 16px;
  background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.88);
  box-shadow: inset 0 1px 0 #fff; transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.week-menu > summary::-webkit-details-marker { display: none; }
.week-menu > summary:hover {
  border-color: rgba(8,118,201,.28);
  box-shadow: 0 8px 18px rgba(8,118,201,.12), inset 0 1px 0 #fff;
  transform: translateY(-1px);
}
.week-menu[open] > summary {
  border-color: rgba(8,118,201,.35);
  box-shadow: 0 10px 22px rgba(8,118,201,.14), inset 0 1px 0 #fff;
}
.week-cal { width: 27px; height: 27px; color: var(--blue); flex: 0 0 auto; }
.week-caret { width: 18px; height: 18px; color: var(--blue); flex: 0 0 auto; opacity: .75; transition: transform .15s ease; }
.week-menu[open] .week-caret { transform: rotate(180deg); }
.week-menu > summary > span { display: flex; flex-direction: column; gap: .12rem; min-width: 0; text-align: left; }
.week-menu strong { color: var(--ink); font-size: .86rem; }
.week-menu em { font-style: normal; }
.week-tag {
  display: inline-flex; align-self: flex-start; margin-top: .1rem; padding: .1rem .4rem; border-radius: 999px;
  font-size: .66rem; font-weight: 800; letter-spacing: .02em;
}
.week-tag.now { color: #0a6d66; background: rgba(40,201,184,.16); }
.week-tag.past { color: #6b5a12; background: rgba(244,185,66,.2); }
.week-tag.soon { color: #3d4ea3; background: rgba(99,122,230,.14); }
.week-menu-list {
  position: absolute; right: 0; top: calc(100% + .35rem); z-index: 80;
  display: flex; flex-direction: column; gap: .2rem; min-width: 260px; max-height: min(320px, 55vh); overflow: auto;
  padding: .4rem; border-radius: 16px;
  background: #fff; border: 1px solid rgba(8,118,201,.14);
  box-shadow: 0 18px 36px rgba(8,59,102,.22);
  -webkit-overflow-scrolling: touch;
}
.week-menu-item {
  display: flex; flex-direction: column; gap: .1rem; padding: .55rem .7rem; border-radius: 12px;
  color: var(--navy); text-decoration: none; transition: background .12s ease;
}
.week-menu-item:hover { background: rgba(8,118,201,.08); }
.week-menu-item.on { background: linear-gradient(145deg,#e8f6ff,#d7ecfb); }
.week-menu-item b { font-size: .86rem; }
.week-menu-item small { color: var(--muted); font-size: .72rem; }
.week-menu-item.hien-tai b::after {
  content: " · hiện tại"; color: #0a6d66; font-size: .72rem; font-weight: 800;
}
.home-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .9rem; }
.home-grid, .top5-section { position: relative; z-index: 1; }
.tinh-grid { grid-template-columns: 1fr 1fr; }
.tinh-note { margin-top: 1rem; }
.tinh-note strong { display: block; margin-bottom: .35rem; color: var(--navy); }
.tinh-note p { margin: 0; }
.tinh-note a { font-weight: 700; }
@media (max-width: 760px) {
  .tinh-grid { grid-template-columns: 1fr; }
}
.stat-glass {
  min-height: 112px; display: flex; align-items: center; gap: .9rem; padding: 1rem; border-radius: 22px;
  border: 1px solid rgba(255,255,255,.82); background: var(--glass); box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat-glass:hover { transform: translateY(-3px); box-shadow: 0 22px 46px rgba(8,59,102,.17), inset 0 1px 0 #fff; }
.stat-icon { width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 17px; color: #fff; }
.stat-icon svg { width: 28px; height: 28px; }
.stat-glass.blue .stat-icon { background: linear-gradient(145deg,#4eb8ef,#0a7ec9); }
.stat-glass.cyan .stat-icon { background: linear-gradient(145deg,#52dfdf,#0aa1ae); }
.stat-glass.violet .stat-icon,
.stat-glass.jade .stat-icon { background: linear-gradient(145deg,#3fd4b0,#0d9b7a); }
.stat-glass.gold .stat-icon { color: #67490b; background: linear-gradient(145deg,#ffe58d,#e8b23a); }
.stat-glass > div { min-width: 0; display: flex; flex-direction: column; }
.stat-glass strong {
  color: var(--navy); font-family: var(--display);
  font-size: clamp(1.55rem,3vw,2.2rem); line-height: 1.1; letter-spacing: -.03em;
}
.stat-glass strong small { margin-left: .12rem; color: #88a0b4; font-size: .9rem; }
.stat-glass > div > span { margin-top: .28rem; color: var(--muted); font-size: .77rem; font-weight: 700; }
.home-grid { display: grid; grid-template-columns: 1.4fr .8fr; gap: .9rem; margin-top: .9rem; }
.progress-card, .leader-card { min-height: 135px; border-radius: 22px; padding: 1.1rem 1.2rem; }
.card-title, .leader-card { display: flex; align-items: center; gap: .85rem; }
.round-icon, .leader-crown { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; }
.round-icon { color: #fff; background: linear-gradient(145deg,#4eb8ef,var(--blue)); }
.round-icon svg { width: 25px; height: 25px; }
.card-title > div, .leader-card > div { display: flex; flex-direction: column; }
.card-title span, .leader-card span { color: var(--muted); font-size: .75rem; font-weight: 700; }
.card-title strong, .leader-card strong { color: var(--navy); font-size: 1.08rem; }
.progress-track { height: 9px; margin: 1rem 0 .55rem; overflow: hidden; border-radius: 999px; background: rgba(8,59,102,.09); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--cyan),var(--blue)); }
.progress-card p { margin: 0; color: var(--muted); font-size: .76rem; }
.leader-card { background: linear-gradient(145deg,rgba(255,250,226,.86),rgba(255,255,255,.66)); }
.leader-crown { color: #78520e; background: linear-gradient(145deg,#ffe889,var(--gold)); font-size: 1.3rem; }
.leader-card strong { margin: .1rem 0; font-size: 1.35rem; }
.leader-card small { color: var(--muted); }

.site-footer {
  color: rgba(255,255,255,.78);
  background:
    linear-gradient(120deg, rgba(13,155,122,.22), transparent 40%),
    linear-gradient(145deg,#041f38,#0a4f82 55%,#0a6d72);
  font-size: .76rem; box-shadow: 0 -12px 35px rgba(5,44,74,.14);
}
.footer-tagline {
  display: block; margin-top: .28rem; font-style: normal;
  color: #9ef0d8; font-size: .72rem; font-weight: 600;
}
.footer-main {
  width: min(1440px,100%); margin: auto; padding: 1.35rem clamp(1rem,3vw,2.4rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem 2rem;
}
.footer-product, .footer-school { display: flex; align-items: center; gap: .9rem; }
.footer-product > img { width: 66px; height: 66px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0,0,0,.25)); }
.footer-product > div, .footer-school { display: flex; flex-direction: column; }
.footer-product strong, .footer-school strong { color: #fff; font-size: .96rem; letter-spacing: .02em; }
.footer-product span, .footer-school span, .footer-school small { color: rgba(255,255,255,.72); }
.footer-school { min-width: 250px; padding: .75rem 1rem; border-radius: 16px; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.footer-school span { font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.footer-school small { margin-top: .12rem; }
.footer-bottom {
  padding: .78rem clamp(1rem,3vw,2.4rem); border-top: 1px solid rgba(255,255,255,.13); background: rgba(0,0,0,.12);
  display: flex; align-items: center; justify-content: space-between; gap: .7rem 1.5rem;
}
.footer-developer { display: inline-flex; align-items: center; gap: .45rem; color: rgba(255,255,255,.76); text-decoration: none; }
.footer-developer img { width: auto; height: 28px; padding: 2px 6px; object-fit: contain; border-radius: 6px; background: #fff; }
.footer-developer strong { color: #fff; font-size: .75rem; }

.login-body { min-height: 100vh; }
.login-wrap {
  position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; padding: 1rem;
  background:
    linear-gradient(105deg,rgba(4,31,56,.55),rgba(4,38,72,.18) 48%,rgba(4,38,72,.05)),
    url("../images/brand/login-background.jpg") center / cover no-repeat fixed;
}
.login {
  width: min(430px,100%); margin-left: min(4vw,60px); justify-self: start; padding: 1.65rem 1.55rem 1.5rem;
  border: 1px solid rgba(255,255,255,.85); border-radius: 28px;
  background: linear-gradient(155deg,rgba(255,255,255,.94),rgba(230,248,246,.78));
  box-shadow: 0 28px 70px rgba(3,34,65,.34), inset 0 1px 0 #fff; backdrop-filter: blur(18px);
  animation: riseIn .65s var(--ease) both;
}
.login-brand { display: block; max-width: 300px; margin: 0 auto .55rem; }
.login-brand img { display: block; width: 100%; height: auto; }
.login-kicker {
  margin: 0 0 .35rem; text-align: center; color: var(--jade);
  font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.login h1 { color: var(--navy); text-align: center; font-size: 1.75rem; }
.login .lede { text-align: center; margin-bottom: 1.15rem; }
.login-field { margin-bottom: .75rem; }
.login-field > label { display: block; margin-bottom: .35rem; color: var(--navy); font-size: .78rem; font-weight: 700; }
.login-input {
  position: relative; display: flex; align-items: center;
  border: 1px solid rgba(8,59,102,.18); border-radius: 12px;
  background: rgba(255,255,255,.9); box-shadow: inset 0 1px 0 #fff;
}
.login-input:focus-within { border-color: rgba(8,118,201,.5); box-shadow: 0 0 0 3px rgba(8,118,201,.12); }
.login-icon {
  display: grid; place-items: center; width: 42px; flex: 0 0 42px; color: #6f8aa3; pointer-events: none;
}
.login-icon svg, .login-eye svg { width: 20px; height: 20px; fill: currentColor; }
.login-input input {
  flex: 1; min-width: 0; width: auto; margin: 0; padding: .72rem .2rem .72rem 0;
  border: 0; background: transparent; box-shadow: none;
}
.login-input input:focus { border: 0; box-shadow: none; }
.login-eye {
  display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px;
  border: 0; background: transparent; color: #6f8aa3; cursor: pointer; border-radius: 0 12px 12px 0;
}
.login-eye:hover { color: var(--blue); background: rgba(8,118,201,.06); }
.login-eye .eye-off { display: none; }
.login-eye.showing .eye-on { display: none; }
.login-eye.showing .eye-off { display: block; }
.login-remember {
  display: flex; align-items: center; gap: .45rem; margin: .15rem 0 1rem;
  color: var(--navy); font-size: .82rem; font-weight: 600; cursor: pointer; user-select: none;
}
.login-remember input { width: 1rem; height: 1rem; accent-color: var(--blue); cursor: pointer; }
.login .btn { width: 100%; min-height: 48px; }
.login-back { display: block; margin-top: .9rem; color: var(--muted); text-align: center; text-decoration: none; font-size: .78rem; font-weight: 600; }

@media (max-width: 980px) {
  .home-stats { grid-template-columns: repeat(2,1fr); }
  .home-hero { grid-template-columns: 1fr minmax(220px,.55fr); }
  .trophy { width: 170px; height: 170px; }
  .trophy svg { width: 105px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 760px) {
  .topbar-inner { min-height: 72px; }
  .brand { height: 56px; max-width: min(46vw,220px); }
  .brand-meta { padding-left: .55rem; }
  .brand-meta strong { max-width: min(140px,28vw); font-size: .72rem; }
  .brand-meta span { font-size: .64rem; }
  .brand-mark { width: 42px; height: 42px; border-radius: 14px; }
  .brand-copy strong { font-size: .83rem; }
  .brand-copy small, .user-name { display: none; }
  .nav-pill { min-height: 42px; padding: .5rem .85rem; font-size: .8rem; }
  .nav-pill span { display: inline; }
  .shell, .admin-shell { flex-direction: column; }
  .side-nav {
    width: auto; margin: .7rem .7rem 0; padding: .7rem; display: flex; flex-wrap: nowrap;
    gap: .25rem; overflow-x: auto; align-items: center;
  }
  .side-brand, .side-nav .nav-label { display: none; }
  .nav-item { flex: 0 0 auto; margin: 0; white-space: nowrap; }
  .nav-item span:last-child { font-size: .8rem; }
  .page-head, .page-actions { flex-direction: column; align-items: stretch; }
  .page-actions .btn { width: 100%; }
  .filter-tabs { margin-left: 0; width: 100%; }
  .rank-podium-row { grid-template-columns: 1fr; }
  .rank-card.hang-1 { min-height: 190px; animation: none; }
  .rank-card.hang-1 strong { font-size: 1.35rem; }
  .rank-card.hang-1 b { font-size: 2rem; }
  /* —— Trang chấm điểm (mobile) —— */
  body:has(.phieu-form) .site-footer { display: none; }
  .phieu-form { gap: .7rem; padding-bottom: 5.5rem; }
  .phieu-head { gap: .4rem; margin-bottom: .15rem; }
  .phieu-head h1 {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .45rem;
    font-size: 1.2rem; line-height: 1.2;
  }
  .phieu-tuan::before { content: none; }
  .phieu-tuan {
    display: inline-block; padding: .12rem .45rem; border-radius: 999px;
    color: var(--blue); font-size: .72rem; font-weight: 800;
    background: rgba(8,118,201,.1);
  }
  .phieu-head .lede {
    display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0;
    font-size: .78rem; line-height: 1.3;
  }
  .phieu-truong {
    display: block; width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .phieu-head .page-actions { display: none; }
  /* Header + menu ngang — thanh tổng dính ngay bên dưới, không bị che */
  :root {
    --topbar-h: 72px;
    --sidenav-h: 64px;
    --score-sticky-top: calc(var(--topbar-h) + var(--sidenav-h) + 6px);
  }
  body:has(.phieu-form) .side-nav {
    position: sticky; top: var(--topbar-h); z-index: 45;
    margin: 0; border-radius: 0; border-left: 0; border-right: 0;
    background: rgba(255,255,255,.96);
    box-shadow: 0 8px 18px rgba(8,59,102,.08);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .score-sticky-slot { min-height: 3.1rem; }
  /* Thanh tổng: 1 hàng ngang, không xuống dòng */
  .score-sticky {
    top: var(--score-sticky-top); gap: .28rem; padding: .4rem .45rem;
    display: flex; align-items: stretch;
    border-radius: 12px; z-index: 44;
  }
  .score-chip {
    flex: 1 1 0; min-width: 0;
    flex-direction: row; align-items: center; justify-content: space-between;
    gap: .2rem; padding: .38rem .4rem; border-radius: 10px;
  }
  .score-chip span {
    flex: 0 0 auto; font-size: .68rem; letter-spacing: 0; line-height: 1; text-transform: none;
  }
  .score-chip b { font-size: .92rem; line-height: 1; }
  .score-chip.tong { flex: 1.15 1 0; }
  .score-chip.tong b { font-size: 1.02rem; }
  .score-chip .lbl-full, .picked-tong .lbl-full { display: none; }
  .score-chip .lbl-short, .picked-tong .lbl-short { display: inline; }
  .score-actions { display: none; }
  .picked-tong {
    flex-wrap: nowrap; gap: .5rem; padding: .55rem .7rem; white-space: nowrap;
  }
  .picked-tong span { font-size: .78rem; }
  .picked-tong strong { font-size: 1.05rem; white-space: nowrap; }
  .phieu-block { padding: .85rem .8rem .95rem; border-radius: 16px; }
  .block-title { gap: .55rem; margin-bottom: .65rem; }
  .block-num { width: 30px; height: 30px; flex-basis: 30px; font-size: .85rem; }
  .block-title h2 { font-size: 1rem; }
  .block-title p { font-size: .76rem; }
  .quick-actions { flex-direction: column; align-items: stretch; gap: .55rem; }
  .btn.hot { width: 100%; min-height: 50px; font-size: .95rem; }
  .day-picker { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .3rem; width: 100%; }
  .day-btn { min-width: 0; width: 100%; min-height: 46px; border-radius: 10px; font-size: .84rem; }
  .picker-bar input { min-height: 48px; font-size: 1rem; }
  .chip-groups, .check-groups {
    max-height: min(52vh, 360px); gap: .65rem;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }
  .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
  .loi-check { padding: .55rem .5rem; border-radius: 12px; }
  .loi-check.on { grid-column: 1 / -1; }
  .loi-check-top { gap: .4rem; align-items: center; }
  .loi-check-top input { width: 1.15rem; height: 1.15rem; margin: 0; }
  .loi-ngan { font-size: .84rem; -webkit-line-clamp: 3; }
  .loi-check-top em { font-size: .72rem; }
  .loi-detail .loi-hs { min-height: 44px; font-size: .95rem; }
  .loi-detail .qty-btn { width: 42px; height: 42px; font-size: 1.1rem; }
  .loi-detail .qty-cell input { width: 56px; min-height: 42px; font-size: 1rem; }
  .toggle-pill { min-height: 40px; padding: .35rem .7rem; font-size: .84rem; }
  .stepper-grid { grid-template-columns: 1fr; gap: .55rem; }
  .stepper-card { padding: .8rem; }
  .qty-cell.big .qty-btn { width: 48px; height: 48px; }
  .qty-cell.big input { width: 72px; min-height: 48px; }
  .picked-box { padding: .55rem; }
  .picked-head { margin-bottom: .4rem; }
  .picked-tong { padding: .55rem .65rem; position: sticky; bottom: 0; }
  .picked-box .bang { overflow: visible; border: 0; background: transparent; }
  table.phieu thead { display: none; }
  table.phieu, table.phieu tbody { display: block; width: 100%; }

  /* Thẻ lỗi đã ghi nhận — 2 hàng, không nhãn dọc */
  table.phieu tr.dong {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      "thu loi diem xoa"
      "hs  hs  sl   codo";
    gap: .3rem .35rem;
    align-items: center;
    margin-bottom: .35rem; padding: .45rem .5rem; border-radius: 12px;
    background: rgba(255,255,255,.95); box-shadow: inset 0 0 0 1px rgba(8,59,102,.1);
  }
  table.phieu tr.dong td {
    display: flex; flex-direction: row; align-items: center; gap: .25rem;
    padding: 0; border: 0; min-width: 0;
  }
  table.phieu tr.dong td::before { display: none !important; }

  table.phieu tr.dong td[data-label="Thứ"] { grid-area: thu; }
  table.phieu tr.dong td[data-label="Lỗi"],
  table.phieu tr.dong td[data-label="Mục"] { grid-area: loi; }
  table.phieu tr.dong td[data-label="Học sinh"] { grid-area: hs; }
  table.phieu tr.dong td.qty-cell { grid-area: sl; flex-wrap: nowrap; justify-content: flex-end; }
  table.phieu tr.dong td[data-label="Cờ đỏ"] { grid-area: codo; justify-content: flex-end; }
  table.phieu tr.dong td.diem-dong,
  table.phieu tr.dong td[data-label="Trừ"],
  table.phieu tr.dong td[data-label="Cộng"] { grid-area: diem; justify-content: flex-end; }
  table.phieu tr.dong td.td-xoa { grid-area: xoa; justify-content: flex-end; margin: 0; }
  table.phieu tr.dong td[data-label="Điểm"] { display: none; }

  /* Thưởng: 1 hàng + số lượng */
  #bang-thuong tr.dong {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-areas: "loi sl diem xoa";
  }
  #bang-thuong tr.dong td[data-label="Mục"] { grid-area: loi; }
  #bang-thuong tr.dong td.qty-cell { grid-area: sl; }
  #bang-thuong tr.dong td[data-label="Cộng"] { grid-area: diem; }
  #bang-thuong tr.dong td.td-xoa { grid-area: xoa; }

  table.phieu tr.dong .thu {
    width: 3.1rem; min-height: 34px; padding: .25rem .2rem;
    font-size: .78rem; font-weight: 800; text-align: center;
  }
  table.phieu tr.dong .loi-ten {
    font-size: .86rem; font-weight: 800; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  table.phieu tr.dong td[data-label="Học sinh"] input {
    width: 100%; min-height: 36px; margin: 0; padding: .35rem .5rem; font-size: .86rem;
  }
  table.phieu tr.dong .diem-dong {
    color: var(--red); font-size: .88rem; font-weight: 800; white-space: nowrap;
  }
  #bang-thuong tr.dong .diem-dong { color: #9a6a00; }
  table.phieu tr.dong .toggle-pill {
    min-height: 34px; padding: .2rem .5rem; font-size: .78rem; white-space: nowrap;
  }
  table.phieu .qty-btn { width: 34px; height: 34px; font-size: .95rem; }
  table.phieu tr.dong .sl {
    width: 40px; min-height: 34px; padding: .2rem .15rem; font-size: .88rem; font-weight: 800;
  }
  table.phieu .xoa-dong { width: 34px; height: 34px; border-radius: 9px; font-size: .85rem; }
  .phieu-footer-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: .4rem;
    margin: 0; padding: .55rem .7rem calc(.55rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255,255,255,.94); border-top: 1px solid rgba(8,59,102,.1);
    box-shadow: 0 -10px 28px rgba(8,59,102,.12); backdrop-filter: blur(10px);
    overflow: visible; flex-wrap: nowrap;
  }
  .phieu-footer-actions .btn {
    width: 100%; min-height: 46px; margin: 0; padding: .55rem .4rem;
    font-size: .78rem; border-radius: 12px; white-space: normal; line-height: 1.15; text-align: center;
  }
  .phieu-footer-actions .btn.nguy { grid-column: 1 / -1; }
  .row { flex-direction: column; align-items: stretch; }
  .row > [style*="width:180px"] { width: 100% !important; }
  .phieu-khac-row { display: flex; flex-direction: column; gap: .65rem; width: 100%; }
  .phieu-dc { width: 100%; flex: none; }
  .phieu-ghichu { width: 100%; min-width: 0; flex: none; }
  .phieu-ghichu textarea {
    width: 100% !important; max-width: 100%; min-height: 96px;
    display: block; box-sizing: border-box;
  }
  main, .admin-main { padding: .7rem .7rem 1rem; }
  .home-main { padding: .9rem .85rem 2rem; }
  .brand-hero { border-radius: 20px; }
  .brand-hero > img { min-height: 190px; aspect-ratio: 16 / 9; object-fit: cover; }
  .brand-hero-cta {
    position: static; width: 100%; padding: .75rem .9rem .55rem;
    background: linear-gradient(180deg,rgba(255,255,255,.9),rgba(232,248,246,.94));
  }
  .hero-values {
    position: static; justify-content: center; padding: 0 .9rem .85rem;
    background: linear-gradient(180deg,rgba(232,248,246,.94),rgba(232,248,246,.94));
  }
  .hero-values span { color: var(--navy); background: rgba(255,255,255,.85); border-color: rgba(13,155,122,.2); }
  .hero-context { width: 100%; color: var(--navy); background: rgba(255,255,255,.78); }
  .hero-context strong { color: var(--navy); }
  .hero-context span { color: var(--muted); }
  .brand-hero-cta .hero-cta { min-height: 44px; padding: .55rem .95rem; font-size: .82rem; width: 100%; justify-content: center; }
  .top5-item { grid-template-columns: 42px 1fr auto; gap: .7rem; padding: .8rem .85rem; }
  .top5-rank { width: 40px; height: 40px; font-size: 1rem; }
  .top5-copy strong { font-size: 1rem; }
  .top5-score b { font-size: 1.25rem; }
  .home-hero { min-height: auto; grid-template-columns: 1fr; padding: 1.5rem; }
  .hero-visual { min-height: 205px; order: -1; }
  .hero-copy { text-align: center; }
  .hero-copy p { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .week-head { align-items: stretch; flex-direction: column; overflow: visible; }
  .week-menu { align-self: stretch; width: 100%; }
  .week-menu-list {
    left: 0; right: 0; min-width: 0; max-height: min(360px, 60vh);
    /* Nổi trên các khung thống kê / thẻ phía dưới trên mobile */
    z-index: 90;
  }
  .home-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .footer-main, .footer-bottom { align-items: flex-start; flex-direction: column; }
  .footer-school { width: 100%; min-width: 0; }
  .footer-developer { flex-wrap: wrap; }
  .login { margin: 0; justify-self: center; }
}
@media (max-width: 480px) {
  .brand {max-width: 42vw;height: 66px;}
  .brand-meta strong { max-width: 30vw; font-size: .66rem; }
  .brand-meta span { display: none; }
  .brand-copy strong { max-width: 155px; }
  .top-actions { gap: .35rem; }
  .nav-pill { min-height: 40px; padding: .45rem .7rem; font-size: .76rem; }
  .nav-pill span { display: none; }
  .nav-pill { width: 40px; padding: 0; justify-content: center; }
  .home-stats { grid-template-columns: 1fr; }
  .stat-glass { min-height: 92px; }
  .trophy { width: 150px; height: 150px; }
  .brand-hero > img { min-height: 168px; }
  .footer-product > img { width: 52px; height: 52px; }
  .footer-product strong { font-size: .8rem; }
  :root {
    --topbar-h: 66px;
    --sidenav-h: 58px;
    --score-sticky-top: calc(var(--topbar-h) + var(--sidenav-h) + 4px);
  }
  .score-sticky { padding: .35rem .4rem; gap: .22rem; }
  .score-chip { padding: .32rem .3rem; }
  .score-chip span { font-size: .64rem; }
  .score-chip b { font-size: .88rem; }
  .score-chip.tong b { font-size: .96rem; }
  /* Giữ 2 cột lỗi — 1 cột làm dài trang và khó nhìn */
  .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loi-check.on { grid-column: 1 / -1; }
  .phieu-footer-actions { grid-template-columns: 1fr 1fr; }
  .phieu-footer-actions .btn:first-child { grid-column: 1 / -1; }
  .phieu-footer-actions .btn {
    font-size: .8rem; white-space: nowrap; padding: .5rem .35rem;
  }
  .side-nav { margin: .5rem .5rem 0; padding: .5rem; }
  .nav-item { padding: .55rem .7rem; min-height: 42px; }
  .filter-bar { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; align-items: end; }
  .filter-bar > div { min-width: 0; width: auto; }
  .filter-bar .filter-tabs { grid-column: 1 / -1; margin-left: 0; width: 100%; }
  .bang { -webkit-overflow-scrolling: touch; }
  .bang td.no-print { white-space: nowrap; }
  .bang .btn.nho, .bang .btn.phu.nho { min-height: 38px; padding: .4rem .65rem; }

  /* /cham: bỏ bảng cuộn ngang → thẻ dọc */
  .cham-desktop { display: none !important; }
  .cham-cards { display: block; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; min-height: 42px; }
}
/* —— Nhận diện & chuyển động tinh tế —— */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes softPulse {
  0%, 100% { box-shadow: 0 14px 28px rgba(13,155,122,.18); }
  50% { box-shadow: 0 18px 36px rgba(13,155,122,.28); }
}
.reveal { animation: riseIn .65s var(--ease) both; }
.home-stats.reveal { animation-delay: .08s; }
.home-grid.reveal { animation-delay: .16s; }
.top5-section.reveal { animation-delay: .24s; }
.page-head { position: relative; overflow: hidden; }
.page-head::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 999px;
  background: linear-gradient(180deg, var(--jade), var(--blue));
}
.page-head::after {
  content: ""; position: absolute; right: -40px; top: -48px; width: 140px; height: 140px;
  border-radius: 50%; background: radial-gradient(circle, rgba(13,155,122,.12), transparent 68%);
  pointer-events: none;
}
.page-head > * { position: relative; z-index: 1; }
.page-kicker { color: var(--jade); letter-spacing: .1em; }
.bang {
  border: 1px solid rgba(255,255,255,.75); border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(240,248,252,.62));
  box-shadow: 0 14px 34px rgba(5,44,74,.08), inset 0 1px 0 #fff;
}
th {
  color: #4d6880; background: linear-gradient(180deg, rgba(232,246,248,.95), rgba(236,245,250,.82));
  font-family: var(--display); font-size: .7rem; letter-spacing: .06em;
}
tr:hover td { background: rgba(13,155,122,.04); }
.top5-item { transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.top5-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.top5-score b { font-family: var(--display); }
.leader-card { animation: softPulse 3.6s ease-in-out infinite; }
.nav-pill.login-button {
  background: linear-gradient(180deg, #2ed4b8, #0d9b7a 50%, #0a6f68);
  box-shadow: 0 14px 28px rgba(13,155,122,.28), inset 0 1px 0 rgba(255,255,255,.5);
}
.alert.ok {
  border-left: 4px solid var(--jade);
  background: linear-gradient(90deg, rgba(13,155,122,.12), rgba(218,244,232,.9));
}
.alert.loi { border-left: 4px solid var(--red); }
.phieu-block { transition: box-shadow .2s var(--ease); }
.phieu-block:hover { box-shadow: var(--shadow-lift), inset 0 1px 0 #fff; }
.score-sticky {
  border: 1px solid rgba(255,255,255,.88);
  background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(226,246,244,.88));
}
.score-sticky-slot { width: 100%; }
/* Màn hẹp vừa: xếp nút Lưu xuống dưới để không mất cạnh phải */
@media (max-width: 1100px) and (min-width: 761px) {
  .score-sticky {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .score-actions {
    grid-column: 1 / -1; justify-content: stretch;
  }
  .score-actions .btn { flex: 1; }
}
.score-chip b { font-family: var(--display); font-variant-numeric: tabular-nums; }
.block-num {
  background: linear-gradient(145deg, #3fd4b0, #0a7ec9);
  box-shadow: 0 8px 16px rgba(10,126,201,.22);
}

/* —— Tiêu chí · Tổng điểm (nhóm) —— */
.muc-goc-panel { margin-bottom: 1rem; }
.muc-goc-head { margin-bottom: .75rem; }
.muc-goc-head strong { display: block; font-size: 1.15rem; margin-top: .15rem; }
.muc-goc-row { align-items: end; }
.tc-groups { display: grid; gap: 1.1rem; }
.tc-nhom {
  padding: 1rem 1.05rem 1.1rem; border-radius: 22px;
  border: 1px solid rgba(255,255,255,.8);
  background: linear-gradient(155deg, rgba(255,255,255,.88), rgba(236,246,250,.7));
  box-shadow: var(--shadow);
}
.tc-nhom.nhom-nenep { box-shadow: var(--shadow), inset 4px 0 0 #0a7ec9; }
.tc-nhom.nhom-hoctap { box-shadow: var(--shadow), inset 4px 0 0 #12b8c4; }
.tc-nhom.nhom-thuong { box-shadow: var(--shadow), inset 4px 0 0 #e8b23a; }
.tc-nhom-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .85rem;
  margin-bottom: .85rem; padding-bottom: .75rem;
  border-bottom: 1px dashed rgba(5,44,74,.12);
}
.tc-nhom-head h2 { margin: 0 0 .2rem; font-size: 1.35rem; }
.tc-nhom-head .muted { margin: .2rem 0 0; font-size: .82rem; }
.tc-count { margin: .35rem 0 0; color: var(--muted); font-size: .78rem; font-weight: 700; }
.tc-phan { margin-top: .85rem; }
.tc-phan-head {
  display: flex; align-items: center; justify-content: space-between; gap: .55rem;
  margin-bottom: .45rem;
}
.tc-phan-head h3 {
  margin: 0; color: var(--navy); font-size: .92rem; font-weight: 800;
  letter-spacing: .02em;
}
.tc-bang { margin: 0; }
.tc-actions { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.tc-bang code {
  padding: .12rem .35rem; border-radius: 6px; font-size: .78rem;
  background: rgba(5,44,74,.06); color: var(--navy);
}
@media (max-width: 760px) {
  .tc-nhom-head, .tc-phan-head { flex-direction: column; align-items: stretch; }
  .tc-nhom-head .btn, .tc-phan-head .btn { width: 100%; }
  .tc-actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .stat-glass, .nav-pill, .btn, .top5-item, .phieu-block { transition: none; }
  .reveal, .brand-hero, .login, .leader-card { animation: none !important; }
  .cham-desktop { display: block !important; }
  .cham-cards { display: none !important; }
}
@media print {
  .topbar, .side-nav, .actions, .no-print, .site-footer, .ambient, .phieu-footer-actions { display: none !important; }
  body, main { background: #fff; max-width: none; }
  .shell { display: block; }
}
