/* BK Learning — giao diện "vở học sinh": giấy kẻ dòng, mực xanh, bút đỏ của cô, bút dạ quang vàng */
:root {
  --ink: #1F3A93;        /* mực xanh */
  --ink-soft: #3D58B0;
  --paper: #F7F9FC;      /* giấy trắng lạnh */
  --rule: #D6E0F2;       /* dòng kẻ vở */
  --margin: #E0475B;     /* đường lề đỏ, bút đỏ: cảnh báo quá hạn */
  --hi: #FFE45C;         /* bút dạ quang: cảnh báo vàng */
  --ok: #23804F;         /* dấu tích */
  --text: #1B2233;
  --muted: #5B6478;
  --line: #C9D3E6;
  --white: #FFFFFF;
  --radius-s: 4px;
  --radius-m: 10px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Patrick Hand", "Comic Sans MS", cursive;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 400 16px/1.55 var(--font);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink-soft); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--white); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Thanh trên cùng */
.top {
  display: flex; align-items: center; gap: 16px; padding: 12px clamp(16px, 4vw, 40px);
  background: var(--white); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { padding: 6px 10px; border-radius: var(--radius-s); color: var(--text); text-decoration: none; font-size: 15px; }
.nav a[aria-current="page"] { background: var(--rule); color: var(--ink); font-weight: 600; }
.nav a:hover { color: var(--ink); }
.lang { border: 1px solid var(--line); background: var(--white); border-radius: var(--radius-s); padding: 6px 10px; font: 600 14px var(--font); color: var(--ink); cursor: pointer; }

main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 40px) 64px; }
main:focus { outline: none; }
.narrow { max-width: 640px; }

h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px; color: var(--ink); font-weight: 700; }
h2 { font-size: 22px; line-height: 1.25; margin: 32px 0 12px; letter-spacing: -0.01em; }
h3 { font-size: 17px; margin: 20px 0 8px; }
p { margin: 0 0 12px; }
.lead { font-size: 18px; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Trang vở: phần nổi bật duy nhất của thiết kế */
.page {
  position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m);
  padding: 24px 24px 24px 56px;
}
.page::before { content: ""; position: absolute; top: 0; bottom: 0; left: 36px; width: 2px; background: var(--margin); opacity: .55; }
.page h2:first-child, .page h1:first-child { margin-top: 0; }

/* Biểu mẫu */
label { display: block; font-weight: 600; font-size: 15px; margin: 14px 0 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 14px; }
input, select, textarea {
  width: 100%; font: 400 16px/1.4 var(--font); color: var(--text);
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--white);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink-soft); }
.pin { font-size: 28px; letter-spacing: .4em; text-align: center; max-width: 220px; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 180px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.choice { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--white); font-weight: 500; margin: 0; cursor: pointer; }
.choice input { width: auto; margin: 0; }
.choice:has(input:checked) { border-color: var(--ink); background: var(--rule); color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 16px var(--font); padding: 11px 18px; border-radius: var(--radius-s); border: 1px solid var(--ink);
  background: var(--ink); color: var(--white); cursor: pointer; text-decoration: none; min-height: 44px;
}
.btn:hover { background: var(--ink-soft); }
.btn.quiet { background: var(--white); color: var(--ink); }
.btn.quiet:hover { background: var(--rule); }
.btn.danger { background: var(--white); color: var(--margin); border-color: var(--margin); }
.btn.small { font-size: 14px; padding: 6px 12px; min-height: 34px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.err { color: var(--margin); font-weight: 600; margin-top: 10px; }

/* Trang chủ */
.home { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); align-items: start; }
.home-intro h1 { font-size: clamp(34px, 6vw, 54px); }
.home-links { display: grid; gap: 12px; margin-top: 28px; }
.home-link { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--white); text-decoration: none; color: var(--text); }
.home-link strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 2px; }
.home-link:hover { border-color: var(--ink-soft); }
.levels { display: flex; gap: 6px; margin: 16px 0 0; flex-wrap: wrap; }
.level { font-size: 14px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); }
@media (max-width: 760px) { .home { grid-template-columns: 1fr; } .page { padding: 20px 16px 20px 44px; } .page::before { left: 26px; } .notes { margin: 0 -16px 0 -44px; padding: 0 16px 0 44px; } }

/* Nhận xét: chữ viết tay của cô trên giấy kẻ */
.notes {
  list-style: none; margin: 0 -24px 0 -56px; padding: 0 24px 0 56px;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--rule) 31px, var(--rule) 32px);
}
.note { padding: 0 0 32px; }
.note:last-child { padding-bottom: 0; }
.note-date { font-size: 14px; line-height: 32px; height: 32px; color: var(--muted); font-weight: 600; }
.note-text { font-family: var(--hand); font-size: 22px; line-height: 32px; color: var(--ink); margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note .tag { line-height: 20px; }
.tag { display: inline-block; font-size: 13px; font-weight: 600; padding: 1px 8px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--white); margin-left: 6px; vertical-align: 1px; }
.tag.ok { color: var(--ok); border-color: #A9D6BD; }
.tag.free { color: var(--muted); }
.tag.charged { color: #8A4B00; border-color: #E8C68E; }
.tag.diane { color: var(--margin); border-color: #F1B3BC; }

/* Trạng thái */
.status { display: inline-block; font-weight: 600; font-size: 14px; padding: 2px 8px; border-radius: var(--radius-s); }
.s-ok { color: var(--ok); background: #E7F4EC; }
.s-remind { color: #6B5600; background: #FFF6C2; }
.s-due { color: #6B3A00; background: var(--hi); }
.s-overdue, .s-late { color: var(--white); background: var(--margin); }
.s-warn { color: #4A3D00; background: var(--hi); }
.s-learning { color: var(--muted); background: #EEF1F7; }
.s-paid_ahead { color: var(--ok); background: #E7F4EC; }

.fee-box { margin: 16px 0; padding: 14px 16px; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--white); }
.fee-box.due, .fee-box.remind { border-color: #E9CF4A; background: #FFFBE0; }
.fee-box.overdue { border-color: var(--margin); background: #FDECEE; }
.big-number { font-size: 40px; font-weight: 700; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }

/* Cảnh báo đầu trang */
.alerts { border: 1px solid #E9CF4A; background: #FFFBE0; border-radius: var(--radius-m); padding: 12px 16px; margin: 0 0 20px; }
.alerts.has-late { border-color: var(--margin); background: #FDF1F2; }
.alerts h2 { margin: 0 0 6px; font-size: 17px; }
.alerts ul { margin: 0; padding-left: 20px; }
.alerts li { margin: 2px 0; }

/* Bảng */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--muted); font-size: 14px; background: #FAFBFE; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.row-warn td:first-child { box-shadow: inset 4px 0 var(--hi); }
tr.row-late td:first-child { box-shadow: inset 4px 0 var(--margin); }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #F4F7FD; }

/* Thẻ chọn trong trang quản lý */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line); margin: 8px 0 20px; }
.tabs button { font: 500 15px var(--font); background: none; border: 0; padding: 10px 14px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }

/* Buổi học trong trang giáo viên */
.session { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; margin: 10px 0; background: var(--white); }
.session.warn { border-left: 5px solid var(--hi); }
.session.late { border-left: 5px solid var(--margin); }
.session.cancelled { opacity: .6; }
.session-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.session-head strong { font-size: 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0 20px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; }
.stat > span:first-child { display: block; color: var(--muted); font-size: 14px; margin-bottom: 2px; }
.stat b { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--ink); }

/* Câu hỏi test / bài tập */
.q { margin: 0 0 22px; border: 0; padding: 0; }
.q legend { font-weight: 600; margin-bottom: 8px; white-space: pre-line; font-size: 17px; }
.q .listen { margin: 0 0 10px; }
.q .answer { max-width: 320px; }
.test-part { padding-top: 4px; }
.test-part + .test-part { border-top: 1px solid var(--rule); margin-top: 8px; }
.test-part h2 { margin-top: 16px; margin-bottom: 2px; }
.passage { background: #FAFBFE; border-left: 4px solid var(--ink); padding: 12px 14px; border-radius: var(--radius-s); font-size: 17px; }
.q .choices.pics { flex-direction: row; }
.q .choices.pics .choice { font-size: 40px; padding: 8px 18px; line-height: 1.1; }
.q p { font-weight: 600; margin-bottom: 6px; }
.q .choices { flex-direction: column; align-items: stretch; }
.q .choices.pics { flex-direction: row; align-items: center; }
.q .choice.right { border-color: var(--ok); background: #E7F4EC; }
.q .choice.wrong { border-color: var(--margin); background: #FDECEE; }
.progress { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; margin: 8px 0 20px; }
.progress span { display: block; height: 100%; background: var(--ink); }

.foot { padding: 20px clamp(16px, 4vw, 40px); color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); background: var(--white); display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 16px); opacity: 0; visibility: hidden; background: var(--text); color: var(--white); padding: 10px 16px; border-radius: var(--radius-s); font-weight: 500; transition: transform .2s ease, opacity .2s ease, visibility .2s; z-index: 20; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast.bad { background: var(--margin); }
dialog { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 20px; max-width: 520px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(27, 34, 51, .45); }
.empty { padding: 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-m); background: var(--white); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 600px) {
  .top { flex-wrap: wrap; row-gap: 8px; }
  .nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -6px; }
  .lang { margin-left: auto; }
  .foot { gap: 8px 16px; }
}
@media (max-width: 600px) { .q .choices.pics .choice { font-size: 30px; padding: 6px 12px; } }
input:disabled, select:disabled { background: #F1F4F9; color: var(--muted); }
.s-debt { color: #5B3A8A; background: #F0EAFB; }
.src-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 4px; }
.src-filter .choices { margin: 0; }
.src-filter .choice { padding: 5px 10px; font-size: 14px; }

/* Tên học viên trên một dòng */
.name-cell { white-space: nowrap; }
.status { white-space: nowrap; }
td .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.table-wrap.compact th, .table-wrap.compact td { padding: 8px 10px; }
.table-wrap.compact td { vertical-align: middle; }
.name-cell .mom { color: var(--muted); font-size: 0.92em; }
.table-wrap.compact .name-cell .mom { display: block; font-size: 13px; }
.nowrap { white-space: nowrap; }
.s-free { color: var(--muted); background: #EEF1F7; }
.s-charged { color: #8A4B00; background: #FBEBD3; }
/* Điện thoại: ô tra cứu nhận xét lên đầu trang chủ */
@media (max-width: 760px) { .home > .page { order: -1; } }
input.right, textarea.right { border-color: var(--ok); background: #E7F4EC; }
input.wrong, textarea.wrong { border-color: var(--margin); background: #FDF1F2; }

/* ---------- Bài tập về nhà theo phần ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hw-page { max-width: 820px; margin: 0 auto; }
.hw-head { background: var(--ink); color: var(--white); border-radius: var(--radius-m); padding: 14px 18px; margin-bottom: 14px; }
.hw-head h1 { color: var(--white); margin: 4px 0 2px; }
.hw-head p { margin: 0; opacity: .9; font-style: italic; }
.hw-draft { background: #FFF4D6; border: 1px solid #E8C68E; color: #6B3D00; border-radius: var(--radius-s); padding: 8px 12px; font-weight: 600; }
.hw-remember { background: #FFFBEA; border: 1px solid #EBD9A0; border-radius: var(--radius-m); padding: 12px 16px; margin-bottom: 20px; }
.hw-remember h2 { margin: 0 0 8px; font-size: 18px; }
.hw-remember ul { margin: 8px 0 0; padding-left: 18px; }
.hw-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.hw-cards figure { margin: 0; text-align: center; }
.hw-cards img { width: 100%; max-width: 84px; height: auto; }
.hw-cards figcaption { font-weight: 600; font-size: 14px; }
.hw-part { margin: 22px 0; }
.hw-part h2 { font-size: 19px; margin: 0 0 2px; display: flex; align-items: center; gap: 8px; }
.hw-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: var(--radius-s); background: var(--margin); color: var(--white); font-size: 15px; }
.hw-part.optional { border-top: 2px dashed #E8C68E; padding-top: 10px; }
.hw-part.optional .hw-badge { background: #C98A1B; }
.hw-opt { color: #8A5A00; font-weight: 600; margin: 0 0 6px; }
.hw-vi { margin: 0 0 10px; font-style: italic; }
.hw-box { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; background: #FFFBEA; border: 1px solid #EBD9A0; border-radius: var(--radius-s); padding: 8px 12px; font-weight: 700; margin-bottom: 10px; }
.hw-example { background: #EAF6E6; border: 1px solid #BFE0B4; border-radius: var(--radius-s); padding: 8px 12px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hw-example strong { color: #2E6B1F; }
.hw-example img { width: 72px; height: auto; }
.hw-example em { color: var(--ink); font-weight: 600; }
.hw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.hw-card { position: relative; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--white); padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hw-card img { width: 100%; max-width: 120px; height: auto; }
.hw-card input { text-align: center; }
.hw-n { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; border-radius: 12px; background: var(--rule); color: var(--ink); font-weight: 700; font-size: 14px; }
.hw-card .hw-n { position: absolute; top: 8px; left: 8px; }
.hw-letters { letter-spacing: .35em; color: var(--muted); font-weight: 700; }
.hw-list { display: flex; flex-direction: column; gap: 10px; }
.hw-q { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--white); padding: 10px 12px; }
.hw-line { line-height: 2.4; }
.hw-line > .hw-n { margin-right: 8px; }
.hw-qhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
input.blank { display: inline-block; width: 9em; padding: 4px 8px; margin: 0 4px; min-height: 0; }
.hw-pics .choice { padding: 4px; }
.hw-pics img { width: 92px; height: auto; display: block; }
.hw-q .choice.right, .hw-card .choice.right { border-color: var(--ok); background: #E7F4EC; }
.hw-q .choice.wrong { border-color: var(--margin); background: #FDECEE; }
input.pending, textarea.pending { border-color: #E8C68E; background: #FFF8E6; }
.st-correct { border-color: #A9D6BD; }
.st-wrong { border-color: #F1B3BC; }
.st-blank { border-color: #F1B3BC; border-style: dashed; }
.st-pending { border-color: #E8C68E; }
.hw-sol { margin-top: 6px; line-height: 1.5; text-align: left; width: 100%; }
.hw-score { scroll-margin-top: 130px; background: var(--rule); border-radius: var(--radius-m); padding: 12px 16px; margin: 0 0 16px; }
.hw-score h2 { margin: 0 0 4px; }
.hw-tip { background: #FDECEE; border: 1px solid #F1B3BC; border-radius: var(--radius-s); padding: 10px 12px; }
@media (max-width: 600px) {
  .hw-cards { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .hw-cards figcaption { font-size: 12px; }
  .hw-grid { grid-template-columns: repeat(2, 1fr); }
  .hw-pics img { width: 62px; }
  .hw-pics .choice { gap: 4px; padding: 3px 5px; }
  .hw-card img { max-width: 96px; }
}
.hw-note { margin: -4px 0 10px; color: #8A5A00; }
.hw-frame { color: var(--text); font-weight: 600; }
.hw-jumble { display: block; font-weight: 600; letter-spacing: .02em; }
.hw-passage { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--ink-soft); border-radius: var(--radius-s); padding: 10px 14px; margin-bottom: 10px; }
.hw-passage p { margin: 4px 0; }
.hw-scene { display: block; width: 100%; max-width: 720px; height: auto; border-radius: var(--radius-m); border: 1px solid var(--line); margin-bottom: 10px; }
.hw-gallery { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 10px; }
.hw-gallery figure { margin: 0; text-align: center; }
.hw-gallery img { width: 100%; max-width: 110px; height: auto; }
.hw-gallery figcaption { font-weight: 700; color: var(--margin); }
.hw-qimg { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; }
.hw-qimg .hw-qhead { grid-column: 1 / -1; margin-bottom: 0; }
.hw-qpic { width: 96px; height: auto; grid-row: span 2; }
.hw-qimg .choices, .hw-qimg .hw-sol { grid-column: 2; }
.hw-line.hw-qimg { display: grid; line-height: 1.6; }
.hw-line.hw-qimg > .hw-n { grid-column: 1 / -1; }
@media (max-width: 600px) { .hw-gallery { gap: 4px; } .hw-qpic { width: 76px; } }
.hw-badge { white-space: nowrap; }
.hw-jumble { display: flex; flex-wrap: wrap; gap: 6px; }
.hw-jumble span { border: 1px dashed var(--ink-soft); border-radius: var(--radius-s); padding: 0 8px; background: #F3F6FD; }
.hw-line.hw-qimg > .hw-n { justify-self: start; }
.hw-q .hw-qhead > .hw-n { flex: none; }
.hw-prompt { display: block; font-weight: 600; line-height: 1.5; }
.hw-gallery.story { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.hw-gallery.story img { max-width: 100%; }

/* Dòng tiêu đề nhóm level trong danh sách học viên */
tr.group-row td { background: var(--soft, #eef2fb); font-weight: 700; color: var(--ink, #1f2a44); padding-top: 10px; padding-bottom: 10px; }

/* ---------- Lịch học ---------- */
.slot-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 6px; }
.slot-row .field { margin: 0; }
.slot-row > button { margin-bottom: 4px; }
@media (max-width: 560px) { .slot-row { grid-template-columns: 1fr 1fr; } }
.conflict-box { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--margin); background: #FDECEE; border-radius: var(--radius-m); }
.conflict-box ul { margin: 6px 0; padding-left: 20px; }
ul.plain { list-style: none; padding: 0; margin: 6px 0; }
ul.plain li { padding: 2px 0; }
.lesson { display: block; width: 100%; text-align: left; font: inherit; border: 1px solid var(--rule); border-left: 4px solid var(--ink-soft); border-radius: var(--radius-s);
  background: var(--white); padding: 6px 8px; margin: 4px 0; cursor: pointer; color: var(--text); }
.lesson:disabled { cursor: default; }
.lesson:hover:not(:disabled), .lesson:focus-visible { border-color: var(--ink); }
.lesson.makeup { border-left-color: var(--ok); }
.lesson.moved { border-left-color: #C98A1B; }
.lesson.off { opacity: .6; border-left-color: var(--line); }
.lesson.off .lesson-who { text-decoration: line-through; }
.lesson-time { display: block; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.lesson-who { display: block; font-weight: 600; }
.lesson-sub { display: block; font-size: 13px; color: var(--muted); }
.lesson-sub .tag { margin-left: 4px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.week-day { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 8px; min-height: 120px; }
.week-day.today { border-color: var(--ink); box-shadow: inset 0 3px 0 var(--ink); }
.week-day-head { font-size: 14px; margin-bottom: 4px; }
@media (max-width: 760px) { .week-grid { grid-template-columns: 1fr; } .week-day { min-height: 0; } }
.day-list { display: flex; flex-direction: column; gap: 10px; }
.day-slot { display: grid; grid-template-columns: 110px 1fr; gap: 10px; border-top: 1px solid var(--rule); padding-top: 8px; }
.day-slot-time { font-weight: 700; color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.day-slot-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.day-slot-items .lesson { margin: 0; }
@media (max-width: 560px) { .day-slot { grid-template-columns: 1fr; } }
.lesson-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 6px; }

/* Lịch tuần dạng thời khóa biểu */
.tt-wrap { overflow: auto; max-height: 78vh; border: 1px solid #9AA7C2; border-radius: var(--radius-s); background: var(--white); -webkit-overflow-scrolling: touch; }
.tt { border-collapse: separate; border-spacing: 0; min-width: 980px; width: 100%; font-size: 13px; }
.tt th, .tt td { border-right: 1px solid #B9C3D6; border-bottom: 1px solid #B9C3D6; padding: 3px 5px; vertical-align: top; }
.tt thead th { position: sticky; top: 0; z-index: 2; background: #C9DAF8; font-weight: 600; text-align: center; }
.tt .tt-corner { left: 0; z-index: 3; width: 104px; }
.tt tbody th.tt-slot { position: sticky; left: 0; z-index: 1; background: #C9DAF8; white-space: nowrap; font-weight: 600; text-align: left; font-variant-numeric: tabular-nums; }
.tt tbody td { background: var(--band, #fff); min-width: 128px; }
.tt td.tt-today { box-shadow: inset 2px 0 0 var(--ink), inset -2px 0 0 var(--ink); }
.tt-day { font: inherit; font-weight: 700; border: 0; background: none; cursor: pointer; color: var(--text); display: flex; flex-direction: column; align-items: center; width: 100%; padding: 2px; }
.tt-day:hover, .tt-day:focus-visible { color: var(--ink); text-decoration: underline; }
.tt thead th.tt-today { background: #A4C2F4; }
.tt-date { font-weight: 400; font-size: 12px; color: var(--muted); }
.tt-line { display: block; width: 100%; text-align: left; font: inherit; line-height: 1.35; border: 0; border-bottom: 1px dotted rgba(0,0,0,.18); background: none; padding: 3px 0; cursor: pointer; color: var(--text); }
.tt-line:last-child { border-bottom: 0; }
.tt-line:disabled { cursor: default; }
.tt-line:hover:not(:disabled), .tt-line:focus-visible { background: rgba(255,255,255,.55); }
.tt-line.off { opacity: .55; text-decoration: line-through; }
.tt-time { font-weight: 700; color: #7A2E00; }
.tt-who { font-weight: 600; }
.tt-book { color: #3B4256; }
.tt-line .tag { font-size: 11px; padding: 0 4px; }
.day-slot { background: var(--band, transparent); border-radius: var(--radius-s); padding: 8px; }
.copy-box { margin-top: 16px; }
.copy-preview { width: 100%; font: 14px/1.5 var(--font); white-space: pre-wrap; overflow: auto; background: #FBFCFE; }

.today-box { background: var(--white); border: 1px solid var(--rule); border-left: 4px solid var(--ink); border-radius: var(--radius-m); padding: 14px 16px; margin-bottom: 18px; }
.today-list { list-style: none; padding: 0; margin: 0; }
.today-list li { padding: 8px 0; border-bottom: 1px solid var(--rule); }
.today-list li:last-child { border-bottom: 0; }
.today-list li.off { opacity: .6; }
.today-list li.off strong { text-decoration: line-through; }

/* Trang giáo viên: chọn lịch theo từng giáo viên */
.teacher-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
