[hidden] { display: none !important; }
:root {
  --navy: #16233A; --navy2: #22324F; --blue: #1F4E79; --link: #0B57D0; --orange: #E07A2E;
  --bg: #F3F6FA; --card: #FFFFFF; --line: #DCE2EC; --ink: #1B2433; --muted: #5B6679;
  --ok: #1E7B34; --ok-bg: #E6F4EA; --bad: #B3261E; --bad-bg: #FCE8E6; --warn: #8A4B00; --warn-bg: #FFF1D6;
  --lt: #1B3A6B; --lt-bg: #E3EEF9; --grey-bg: #EEF1F5;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 "Segoe UI", system-ui, sans-serif; }
a { color: var(--link); }
button, select, input { font: inherit; }
.top { position: sticky; top: 0; z-index: 5; background: var(--navy); color: #E8EEF7; display: flex; align-items: center;
       gap: 14px; padding: 8px 18px; }
.logo { display: flex; align-items: center; gap: 8px; color: #E8EEF7; text-decoration: none; font-weight: 700; font-size: 15px; }
.logo img { width: 28px; height: 28px; }
.logo b { color: #F2B84B; }
.sp { flex: 1; }
.who { color: #9FB0C8; }
.ghost { background: transparent; color: #E8EEF7; border: 1px solid #4A5E80; border-radius: 4px; padding: 3px 12px; cursor: pointer; }
.wrap { display: flex; min-height: calc(100vh - 44px); }
nav { width: 190px; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 14px 10px;
      display: flex; flex-direction: column; gap: 2px; }
nav a, nav .later { padding: 7px 10px; border-radius: 6px; color: #2A3548; text-decoration: none; }
nav a.on { background: #E3EEF9; color: var(--blue); font-weight: 700; }
nav a:hover { background: #F1F5FA; }
nav .later { color: #9AA5B8; }
nav .lab { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 12px 10px 2px; }
main { flex: 1; min-width: 0; padding: 18px 22px 40px; display: flex; flex-direction: column; gap: 14px; }
h1 { font-size: 20px; margin: 0; }
.cap-nhat { color: var(--muted); font-size: 12px; border-radius: 4px; padding: 2px 6px; }
.cap-nhat.moi { animation: capnhat 1.6s ease-out; }
@keyframes capnhat { from { background: #FFE9A8; color: #5A3D00; } to { background: transparent; } }
.lam-moi .xoay { display: inline-block; }
.lam-moi.dang-tai .xoay { animation: xoay .8s linear infinite; }
@keyframes xoay { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
select, input[type=date], input[type=password], input[type=text] { background: #fff; border: 1px solid #C7D0DD; border-radius: 6px; padding: 5px 9px; }
nav select.subj { margin: 0 6px 6px; padding: 9px 10px; border: 2px solid #9AA5B8; border-radius: 6px; font: inherit; font-size: 15px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: var(--grey-bg); color: var(--ink); cursor: pointer; }
/* ô Môn tô màu theo môn đang chọn (màu của Office); danh sách xổ xuống giữ nền trắng */
nav select.subj.mon-PowerPoint { background: #C43E1C; border-color: #C43E1C; color: #fff; }
nav select.subj.mon-Word { background: #2B579A; border-color: #2B579A; color: #fff; }
nav select.subj.mon-Excel { background: #1D6F42; border-color: #1D6F42; color: #fff; }
nav select.subj option { background: #fff; color: var(--ink); font-weight: 400; }
.subj-tag { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; border-radius: 3px; padding: 0 5px;
  margin-right: 6px; vertical-align: 1px; }
.subj-PowerPoint { background: #C43E1C; } .subj-Word { background: #2B579A; } .subj-Excel { background: #1D6F42; }
.seg { display: inline-flex; border: 1px solid #C7D0DD; border-radius: 6px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-right: 1px solid #C7D0DD; background: #fff; padding: 5px 12px; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--blue); color: #fff; font-weight: 600; }
.btn { border-radius: 6px; padding: 6px 14px; font-weight: 600; border: 1px solid #C7D0DD; background: #fff; cursor: pointer; }
.btn.pri { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn:disabled { opacity: .6; cursor: default; }
.tiles { display: flex; gap: 10px; flex-wrap: wrap; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 16px; min-width: 130px; }
.tile b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 12px; }
.tablebox { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th { background: #F4F7FB; text-align: left; font-weight: 600; color: #3A465A; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 10px; border-bottom: 1px solid #EEF1F6; white-space: nowrap; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #F7FAFD; }
.pill { border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 700; }
.p-ok { color: var(--ok); background: var(--ok-bg); } .p-bad { color: var(--bad); background: var(--bad-bg); }
.p-grey { color: var(--muted); background: var(--grey-bg); } .p-lt { color: var(--lt); background: var(--lt-bg); }
.p-tt { color: var(--warn); background: var(--warn-bg); }
.sw { width: 34px; height: 18px; border-radius: 9px; border: 0; background: var(--ok); position: relative; cursor: pointer; vertical-align: middle; }
.sw::after { content: ""; position: absolute; right: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.sw.off { background: #C2C8D2; } .sw.off::after { right: auto; left: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips span { background: var(--grey-bg); border-radius: 4px; padding: 2px 8px; font-size: 12px; }
.chips .ok { background: #D6F0DD; } .chips .bad { background: #F9D9D6; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 22px 26px; max-width: 380px;
       display: flex; flex-direction: column; gap: 10px; }
.center { display: flex; justify-content: center; padding-top: 40px; }
.err { color: var(--bad); }
.okmsg { color: var(--ok); }
.empty { padding: 16px; color: var(--muted); }
@media (max-width: 760px) {
  .wrap { flex-direction: column; }
  nav { width: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  nav .lab, nav .later { display: none; }
  main { padding: 14px 16px 30px; }
}
.sw:disabled { opacity: .45; cursor: not-allowed; }
.link { border: 0; background: none; color: var(--link); cursor: pointer; font-size: 12px; padding: 0 0 0 8px; }
.link:hover { text-decoration: underline; }

#admin-nav { display: flex; flex-direction: column; gap: 2px; }
.chip { display: inline-block; background: #EEF1F5; border-radius: 4px; padding: 1px 8px; margin: 1px 2px; font-size: 12px; }
dialog.modal { border: 1px solid var(--line); border-radius: 10px; padding: 20px 24px; max-width: min(720px, 92vw); width: 100%; }
dialog.modal::backdrop { background: rgba(22, 35, 58, .35); }
dialog.modal h2 { margin: 0 0 10px; font-size: 17px; }
dialog.modal input[type=text] { width: 100%; }
.big { font: 700 28px/1.2 Consolas, monospace; letter-spacing: .08em; margin: 6px 0 10px; }

/* Luyện tập: điểm tích lũy theo project (30/09/2026) */
table.accum td.pc { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.accum td.pc[data-href] { cursor: pointer; }
table.accum td.pc-ok { color: var(--ok); background: var(--ok-bg); font-weight: 600; }
table.accum td.pc-part { color: var(--warn); background: var(--warn-bg); }
table.accum td.pc-none { color: var(--muted); }
table.accum td.pc[data-href]:hover { outline: 2px solid var(--blue); outline-offset: -2px; }
/* bảng sắp xếp được: bấm tiêu đề cột */
table.sortable th.sorth { cursor: pointer; user-select: none; white-space: nowrap; }
table.sortable th.sorth:hover { color: var(--blue); }
table.sortable th.sorth::after { content: " ↕"; color: var(--muted); font-weight: 400; font-size: 11px; }
table.sortable th.sorth[data-dir="asc"]::after { content: " ▲"; color: var(--blue); }
table.sortable th.sorth[data-dir="desc"]::after { content: " ▼"; color: var(--blue); }

/* Chấm điểm thang 10 (02/10/2026) */
.cham { background: #fff; border: 1px solid var(--blue); border-radius: 8px; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.cham .mocs { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.cham .moc { white-space: nowrap; }
.cham .moc input { width: 58px; border: 1px solid #C7D0DD; border-radius: 6px; padding: 3px 6px; text-align: right; }
td.d10 { text-align: center; }
input.d10in { width: 62px; border: 1px solid #C7D0DD; border-radius: 6px; padding: 3px 6px; text-align: center; }
input.d10in.bad { border-color: var(--bad); background: var(--bad-bg); }
/* Ô ghi chú của GV ở màn Theo lớp: trông như chữ thường, có viền khi rê chuột / đang gõ */
td.gc { min-width: 190px; padding-top: 3px; padding-bottom: 3px; white-space: nowrap; }
input.gcin { width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; background: transparent; font: inherit; color: inherit; }
input.gcin:hover { border-color: #C7D0DD; background: #fff; }
input.gcin:focus { border-color: var(--blue); background: #fff; outline: none; }
td.gc.dang-luu input.gcin { width: calc(100% - 24px); }
/* trục số thang 10: 10 vạch kéo được (02/10/2026) */
.truc { position: relative; height: 96px; margin: 26px 18px 0; user-select: none; touch-action: none; }
.truc .t-bands { position: absolute; left: 0; right: 0; top: 30px; height: 30px; border-radius: 4px; overflow: hidden; }
.truc .t-band { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #2A3548; border-right: 1px solid #fff; overflow: hidden; }
.truc .t-tick { position: absolute; top: 60px; height: 8px; border-left: 1px solid #9AA5B8; }
.truc .t-tick span { position: absolute; top: 10px; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.truc .t-vach { position: absolute; top: 0; width: 0; height: 84px; padding: 0; border: 0; background: none; cursor: ew-resize; }
.truc .t-vach::before { content: ""; position: absolute; left: -1.5px; top: 22px; width: 3px; height: 46px; background: var(--navy); }
.truc .t-vach i { position: absolute; left: -11px; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--navy);
  color: #fff; font: normal 700 12px/22px "Segoe UI", sans-serif; text-align: center; }
.truc .t-vach em { position: absolute; left: 0; top: -22px; transform: translateX(-50%); font: normal 700 12px "Segoe UI", sans-serif;
  color: #fff; background: var(--orange); border-radius: 4px; padding: 0 5px; display: none; }
.truc .t-vach.on em { display: block; }
.truc .t-vach.on i, .truc .t-vach:focus i { background: var(--orange); }
.truc .t-vach.on::before { background: var(--orange); }
.truc .t-vach:focus { outline: none; }
#v-sel input { width: 74px; border: 1px solid #C7D0DD; border-radius: 6px; padding: 2px 6px; }
.cham-foot { display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--blue); border-radius: 8px; padding: 10px 14px; }
/* ô điểm /1000 Thi thử: xanh = ĐẠT, đỏ = CHƯA ĐẠT (02/10/2026) */
td.sc-ok { background: var(--ok-bg); color: var(--ok); }
td.sc-bad { background: var(--bad-bg); color: var(--bad); }
/* đúng nhưng có xem hướng dẫn: ✔ vàng 💡 (02/10/2026) */
.chips .hint { background: #FCEFA8; color: #6B5300; font-weight: 700; box-shadow: inset 0 0 0 1.5px #D9A400; }
.chips .bad.g { box-shadow: inset 0 0 0 1.5px #D9A400; }
.hd-n { color: #6B5300; background: #FCEFA8; border-radius: 4px; padding: 1px 7px; font-weight: 600; }
table.accum td.pc-hint { color: #6B5300; background: #FCEFA8; font-weight: 600; }
/* Làm chung máy (05/10/2026): kéo dòng HS không có máy thả vào dòng bạn cùng máy; HS đó nằm ngay dưới, chỉ hiện điểm của bạn */
.doi-cap { color: #4A3A8C; background: #E7E1FA; border-radius: 4px; padding: 0 6px; font-size: 12px; font-weight: 600; }
.doi-go { padding-left: 4px; }
.doi-keo { color: #A9B4C6; cursor: grab; margin-right: 6px; user-select: none; }
tr[draggable=true]:hover .doi-keo { color: var(--blue); }
.doi-nhanh { color: #8A78D0; margin: 0 6px 0 14px; font-weight: 700; }
tr.doi-con td:not(.sc-ok):not(.sc-bad) { background: #FAF8FF; }
tr.doi-con td:first-child { box-shadow: inset 3px 0 0 #8A78D0; }
tr.doi-dang-keo td { opacity: .45; }
tr.doi-tha td { background: #E7E1FA !important; box-shadow: inset 0 2px 0 #8A78D0, inset 0 -2px 0 #8A78D0; }
/* Thông báo cho HS (02/10/2026): khung xem trước giống app HS */
#tb-nd { width: 100%; font: inherit; border: 1px solid #C7D0DD; border-radius: 6px; padding: 8px 10px; resize: vertical; }
.tb-lop { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.tb-lop label { white-space: nowrap; }
.tb-box { border: 1px solid #E3A83A; background: #FFF8E8; border-radius: 8px; padding: 10px 14px; max-width: 640px; }
.tb-box .tb-h { font-weight: 700; color: #5A3D00; }
.tb-box .tb-nd { white-space: pre-wrap; margin: 4px 0; }
.tb-box .tb-f { text-align: right; color: var(--link); font-size: 12px; }
/* Bộ biểu tượng MỨC ĐỘ — giống hệt app HS (app/bieu_tuong.py), dùng chung cho mọi trường hợp cùng mức ảnh hưởng.
   Đỏ + vạch trắng (không làm được) · vàng + "!" (làm được, không ghi nhận) · xanh (bình thường) · trắng viền xám (không có mạng). Trong nhóm nút: nút đang chọn rõ + viền, nút khác mờ. */
.ttc { position: relative; display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0;
  font-size: 0; vertical-align: middle; flex: none; }
.ttc.sm { width: 16px; height: 16px; }
.ttc.tt-do { --c: #D93025; background: #D93025; }
.ttc.tt-do::after { content: ""; position: absolute; left: 21%; right: 21%; top: 41.5%; height: 17%; background: #fff; border-radius: 1px; }
.ttc.tt-vang { --c: #F9AB00; background: #F9AB00; }
.ttc.tt-vang::before { content: ""; position: absolute; left: 43.5%; width: 13%; top: 19%; height: 41%; background: #3A2A00; border-radius: 1px; }
.ttc.tt-vang::after { content: ""; position: absolute; left: 42.5%; width: 15%; top: 65%; height: 15%; background: #3A2A00; border-radius: 50%; }
.ttc.tt-xanh { --c: #1E9E46; background: #1E9E46; }
.ttc.tt-xam { --c: #9AA0A6; background: #fff; box-shadow: inset 0 0 0 calc(.15 * 22px) #9AA0A6; }
.ttc.sm.tt-xam { box-shadow: inset 0 0 0 calc(.15 * 16px) #9AA0A6; }
.tt { display: inline-flex; gap: 8px; padding: 4px; margin-bottom: 2px; vertical-align: middle; }
.tt button.ttc { cursor: pointer; opacity: .25; transition: opacity .12s; }
.tt button.ttc:hover:not(:disabled) { opacity: .6; }
.tt button.ttc.on { opacity: 1; cursor: default; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.tt button.ttc:disabled { cursor: default; }
.ttl { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; white-space: nowrap; }

/* Chú thích dưới bảng: mỗi ý một dòng (08/10/2026) */
.chu-thich { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.chu-thich b { color: #3A465A; }
/* Màn hình rộng: tiêu đề cột dính dưới thanh trên cùng khi cuộn danh sách dài (thanh trên cao 44px) */
@media (min-width: 1000px) {
  .tablebox { overflow: visible; }
  .tablebox th { position: sticky; top: 44px; z-index: 2; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line); }
  .tablebox tr:first-child th:first-child { border-top-left-radius: 8px; }
  .tablebox tr:first-child th:last-child { border-top-right-radius: 8px; }
}
/* Dùng bàn phím (Tab): thấy rõ đang đứng ở nút / ô nào */
:is(a, button, select, input, textarea):focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.seg button:focus-visible { outline-offset: -2px; }
/* Máy đặt "giảm chuyển động": không xoay, không nháy; nút đang tải chỉ mờ đi */
@media (prefers-reduced-motion: reduce) {
  .lam-moi.dang-tai .xoay, .cap-nhat.moi { animation: none; }
  .lam-moi.dang-tai { opacity: .6; }
  .tt button.ttc { transition: none; }
}

/* PHẢN HỒI THEO 3 LOẠI THAO TÁC (08/10/2026, xem đầu web_gv/app.js). Vòng quay chờ 0,2 giây mới hiện: thao tác nhanh không chớp */
.quay { display: inline-block; width: 14px; height: 14px; border: 2px solid #C7D0DD; border-top-color: var(--blue); border-radius: 50%;
  animation: xoay .8s linear infinite; vertical-align: -2px; }
.quay.to { width: 34px; height: 34px; border-width: 3px; }
@keyframes hien { to { opacity: 1; } }
/* loại 1: nạp lại dữ liệu của trang đang xem — khung đứng yên, vùng dữ liệu mờ đi, vòng quay giữa phần bảng đang thấy */
main.dang-nap .tablebox, main.dang-nap .tiles { opacity: .45; transition: opacity .15s .2s; }
.vong-cho { position: fixed; z-index: 4; transform: translate(-50%, -50%); background: #fff; border-radius: 50%; padding: 10px; line-height: 0;
  box-shadow: 0 2px 10px rgba(22, 35, 58, .25); opacity: 0; animation: hien .1s .2s forwards; }
/* loại 1 (nhỏ): chỗ đang lưu có vòng quay nhỏ */
.dang-luu::after, tr.dang-luu > td:nth-child(2)::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px;
  border: 2px solid #C7D0DD; border-top-color: var(--blue); border-radius: 50%; animation: xoay .8s linear infinite; vertical-align: -2px; }
tr.dang-luu::after { content: none; }
/* loại 2: đổi bố cục — vùng nội dung chỉ còn vòng quay tới khi tải xong */
.cho-trang { display: flex; justify-content: center; padding-top: 120px; }
.cho-trang .quay { opacity: 0; animation: xoay .8s linear infinite, hien .1s .2s forwards; }
/* loại 3: tác động lớn — màn che cả trang (kể cả menu) + hộp báo */
dialog.viec { border: 0; border-radius: 10px; padding: 22px 30px; min-width: 260px; max-width: min(420px, 90vw); text-align: center;
  box-shadow: 0 8px 30px rgba(22, 35, 58, .35); }
dialog.viec[open] { display: flex; flex-direction: column; align-items: center; gap: 8px; }
dialog.viec::backdrop { background: rgba(60, 68, 82, .55); }
dialog.viec b { font-size: 16px; }
dialog.viec .dau { width: 34px; height: 34px; border-radius: 50%; background: var(--ok); color: #fff; font: 700 20px/34px "Segoe UI", sans-serif; }
dialog.viec.loi b { color: var(--bad); }
dialog.viec .btn { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) {
  .quay, .dang-luu::after, tr.dang-luu > td:nth-child(2)::after, .cho-trang .quay { animation-duration: 1.6s, .1s; }
}
