/* Giao dien nguoi hoc dung chung: Dao tao mo va Hoc phan (sinh vien) – nut, the, muc luc, cau hoi, dong ho, hop thoai, thong bao */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(.95); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.sec { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.ghost { background: transparent; color: var(--brand); padding: 6px 10px; }
.btn.ok { background: #16a34a; }
.btn.sm { padding: 6px 12px; font-size: .86rem; }
.inp { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 9px; padding: 9px 11px; font: inherit; background: #fff; margin: 4px 0 10px; }
.lbl { display: block; font-size: .86rem; font-weight: 600; color: var(--navy); }
.hint { font-size: .82rem; color: var(--muted); }
.err { background: var(--danger-bg); color: var(--danger-ink); border-radius: 9px; padding: 8px 12px; font-size: .88rem; margin: 6px 0; }
.okbox { background: #dcfce7; color: #14532d; border-radius: 9px; padding: 10px 12px; margin: 8px 0; }
.warnbox { background: var(--warn-bg); color: var(--warn-ink); border-radius: 9px; padding: 10px 12px; margin: 8px 0; }
.card2 { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.hero { background: linear-gradient(120deg, #1C75BC, #2387E3 55%, #7c3aed); color: #fff; border-radius: 16px; padding: 22px 22px; margin-bottom: 16px; }
.hero h1, .dtm .hero h1 { color: #fff; margin: 0 0 6px; font-size: 1.5rem; }
.hero p { margin: 0; opacity: .95; }
.grid-c { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cc { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.cc:hover { box-shadow: 0 6px 18px rgba(16,24,40,.12); }
.cc .cv { aspect-ratio: 16/7; background: linear-gradient(135deg, #1C75BC, #7c3aed); background-size: cover; background-position: center; }
.cc .bd { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cc h3 { margin: 0; font-size: 1.02rem; }
.cc .m { font-size: .8rem; color: var(--muted); }
.tag { display: inline-block; font-size: .74rem; border-radius: 999px; padding: 2px 9px; background: var(--cite-bg); color: var(--cite-ink); font-weight: 600; }
.tag.g { background: #dcfce7; color: #15803d; }
.tag.y { background: var(--warn-bg); color: var(--warn-ink); }
.pb { height: 8px; border-radius: 4px; background: #e5e7eb; overflow: hidden; }
.pb i { display: block; height: 100%; background: #16a34a; border-radius: 4px; transition: width .3s; }
.learn2 { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 880px) { .learn2 { grid-template-columns: minmax(0, 1fr); } }
.side2 { position: sticky; top: 10px; max-height: calc(100vh - 20px); overflow: auto; }
.mod2 { margin: 10px 0 4px; font-weight: 700; font-size: .86rem; color: var(--navy); }
.it2 { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 9px; cursor: pointer; font-size: .9rem; border: 0; background: none; width: 100%; text-align: left; font-family: inherit; color: inherit; }
.it2:hover { background: var(--bg); }
.it2.on { background: var(--cite-bg); }
.it2 .st { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cbd5e1; display: grid; place-items: center; font-size: .7rem; color: #fff; }
.it2 .st.done { background: #16a34a; border-color: #16a34a; }
.it2 small { display: block; color: var(--muted); font-size: .74rem; }
.qbox { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: #fff; }
.qbox .opt2 { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; margin: 6px 0; cursor: pointer; }
.qbox .opt2:hover { background: var(--bg); }
.qbox .opt2.on { border-color: var(--brand); background: var(--cite-bg); }
.timer { position: sticky; top: 8px; z-index: 3; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; box-shadow: 0 2px 8px rgba(16,24,40,.08); }
.timer b { font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.dlg { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: grid; place-items: center; z-index: 50; padding: 12px; }
.dlg > div { background: #fff; border-radius: 16px; padding: 20px; width: min(460px, 100%); max-height: 92vh; overflow: auto; position: relative; }
.dlg .x { position: absolute; right: 10px; top: 8px; border: 0; background: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); }
.toast2 { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; font-size: .9rem; max-width: 90vw; }
.toast2.e { background: #b3261e; }
.row2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }
a.avatar { color: inherit; text-decoration: none; }
.essay2 { width: 100%; min-height: 180px; resize: vertical; font: inherit; line-height: 1.55; }
.qbox .wc { margin: 4px 0 0; }
.files2 { display: grid; gap: 6px; margin: 6px 0 8px; }
.file2 { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 9px; padding: 6px 10px; background: var(--bg); }
.file2 a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file2 small { color: var(--text-muted, #64748b); }
.upl2 { cursor: pointer; }
.upl2.busy { opacity: .6; pointer-events: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Trang hoc phan cua sinh vien: muc luc + noi dung + tro ly ngan truot ---- */
body.hp { height: auto; min-height: 100%; }
body.hp .head { position: sticky; top: 0; z-index: 20; }
body.hp a.avatar { color: inherit; text-decoration: none; }
.lwrap { max-width: 1240px; margin: 0 auto; padding: 16px; transition: margin-right .2s; }
.lwrap .gate { min-height: 50vh; justify-content: center; }
#pane:focus { outline: none; }
#pane > .card2 + .card2 { margin-top: 14px; }
.side2 { position: sticky; top: 74px; max-height: calc(100vh - 90px); overflow: auto; padding: 12px; }
.side2 .mod2 { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; font: inherit; font-weight: 700; font-size: .84rem; color: var(--navy); padding: 4px 6px; margin: 12px 0 2px; text-align: left; cursor: pointer; border-radius: 8px; }
.side2 .mod2:hover { background: var(--bg); }
.side2 .mod2 .cnt { margin-left: auto; font-weight: 600; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.side2 .mod2 .car { flex: none; width: 12px; color: var(--muted); font-size: .7rem; }
.side2 .mod2.static { cursor: default; }
.side2 .mod2.static:hover { background: none; }
.side2 .it2 { font-size: .86rem; }
.side2 .it2 > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.it2 .st.live { border-color: #e53935; background: #e53935; }
.it2 .st.warn { border-color: #f59e0b; }
.it2 .st.part { border-color: var(--brand); background: linear-gradient(90deg, var(--brand) 50%, transparent 50%); }
.side2 .todo-n { margin-left: auto; background: #e53935; color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 700; padding: 1px 7px; }
.pane-h { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 10px; }
.pane-h h2 { margin: 0; font-size: 1.15rem; color: var(--navy); flex: 1; min-width: 200px; }
.pane-h .crumb { display: block; font-size: .78rem; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.pnav { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pnav .btn { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.docframe { width: 100%; height: 76vh; min-height: 420px; border: 1px solid var(--border); border-radius: 12px; background: #fff; display: block; }
.todo { display: flex; flex-direction: column; gap: 8px; }
.todo a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: inherit; background: #fff; }
.todo a:hover { border-color: var(--brand); }
.todo .ic { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--cite-bg); }
.todo .ic.r { background: var(--danger-bg); }
.todo small { display: block; color: var(--muted); font-size: .78rem; }
.todo .late { color: var(--danger-ink); font-weight: 600; }
.chp { display: grid; grid-template-columns: minmax(0, 1fr) 140px 64px auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); font-size: .88rem; }
.chp:first-of-type { border-top: 0; }
@media (max-width: 640px) { .chp { grid-template-columns: 1fr 70px; } .chp .pb, .chp .btn { grid-column: 1 / -1; } }
.stat3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat3 > div { background: var(--bg); border-radius: 12px; padding: 10px 12px; }
.stat3 b { display: block; font-size: 1.35rem; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat3 small { color: var(--muted); font-size: .78rem; }
.staffbar { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 8px 12px; font-size: .86rem; margin-bottom: 12px; }
/* Ngan truot tro ly */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--bg); border-left: 1px solid var(--border); box-shadow: -8px 0 24px rgba(16,24,40,.12); display: flex; flex-direction: column; z-index: 40; transform: translateX(105%); transition: transform .22s ease; visibility: hidden; }
.drawer.open { transform: none; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .drawer, .lwrap { transition: none; } }
.dr-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); background: var(--brand); color: var(--brand-ink); flex: none; }
.drawer .log { flex: 1; min-height: 0; }
.drawer .foot { flex: none; }
.drawer #gateBox { padding: 0 12px; }
@media (min-width: 1280px) { body.dr-open .lwrap { margin-right: 440px; max-width: none; } }
.ai-btn { font-weight: 600; }
.ai-btn[aria-expanded="true"] { background: rgba(255,255,255,.95); color: var(--navy); }
.ai-btn.off { opacity: .75; }
.sheet { z-index: 55; }
.ask-ai { font: inherit; font-size: .8rem; border: 1px solid #c4b5fd; color: #6d28d9; background: #f5f3ff; border-radius: 999px; padding: 4px 11px; cursor: pointer; white-space: nowrap; }
.ask-ai:hover { background: #ede9fe; }
/* Muc luc tren dien thoai: ngan keo ben trai */
.side-mask { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 29; }
@media (max-width: 880px) {
  body.hp.ready .menu-btn { display: grid !important; }
  .lwrap { padding: 12px; }
  .learn2 { grid-template-columns: minmax(0, 1fr); }
  .side2 { position: fixed; top: 0; left: 0; bottom: 0; width: min(330px, 86vw); max-height: none; z-index: 30; border-radius: 0 14px 14px 0; transform: translateX(-105%); transition: transform .2s; visibility: hidden; }
  body.side-open .side2 { transform: none; visibility: visible; }
  .docframe { height: 70vh; }
}
/* Hoc phan cua toi */
.cc .cv.hpc { display: flex; align-items: flex-end; padding: 10px 12px; color: #fff; font-weight: 700; font-family: Consolas, monospace; font-size: .86rem; aspect-ratio: auto; height: 64px; }
@media (max-width: 600px) {
  body.hp .head { gap: 8px; padding-left: 10px; padding-right: 10px; }
  body.hp .head .avatar { display: none; }
  .ai-btn .t { display: none; }
  .ai-btn { width: 36px; height: 32px; padding: 0; display: grid; place-items: center; font-size: 1rem; }
  body.hp #userBtn { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}
body.hp .tbar, body.hp .timer { top: calc(var(--hh, 64px) + 8px); }
body.hp .side2 { top: calc(var(--hh, 64px) + 12px); max-height: calc(100vh - var(--hh, 64px) - 24px); }
@media (max-width: 880px) { body.hp .side2 { top: 0; max-height: none; } }

/* Phong to toan man hinh khung doc tai lieu / bai doc (public/js/phong-to.js) */
.pt-khung { position: relative; }
.pt-nut { margin: 0 0 8px; }
.pt-on { display: flex !important; flex-direction: column; width: 100% !important; height: 100vh !important; height: 100dvh !important; max-height: none !important;
  margin: 0 !important; border: 0 !important; border-radius: 0 !important; background: #fff; overflow: hidden; }
.pt-fix { position: fixed !important; inset: 0; z-index: 10000; width: 100vw !important; }
body.pt-khoa { overflow: hidden; }
.pt-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #0f172a; color: #fff; }
.pt-bar b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pt-bar button { background: rgba(255, 255, 255, .16); color: #fff; border: 0; border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; white-space: nowrap; }
.pt-bar button:hover, .pt-bar button:focus-visible { background: rgba(255, 255, 255, .28); outline: none; }
.pt-k { font-size: .75rem; opacity: .7; margin-left: 4px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 4px; padding: 0 4px; }
@media (hover: none) { .pt-k { display: none; } }
.pt-on iframe, .pt-on .docframe { flex: 1 1 auto; width: 100%; height: auto !important; min-height: 0 !important; border: 0 !important; border-radius: 0 !important; }
/* Bai doc (van ban): che do doc – chu to, cot vua mat, nen diu */
.pt-on.pt-doc { background: #fbfaf6; }
.pt-on .pt-noi { flex: 1 1 auto; overflow: auto; padding: 28px 18px 48px; }
.pt-on .pt-noi > * { max-width: 820px; margin-left: auto; margin-right: auto; font-size: 1.14rem; line-height: 1.8; }
