:root{--mr:#8B2630;--mrs:#F6E8EA;--ink:#33353B;--mut:#7B8090;--bg:#F5F6FA;--line:#E2E5EC;--lnk:#3B9AE1;--lime:#F6E8EA;--lilac:#E8EBF6;--pink:#FBE4EF;--sky:#E3F1FC;--sun:#FFF0C9;--red:#D13B3B;--ok:#2E9E63;--sh:0 2px 10px rgba(30,35,60,.06)}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{max-width:100vw;overflow-x:clip;min-height:100dvh}
body{font-family:'Roboto',system-ui,sans-serif;color:var(--ink);background:var(--bg);line-height:1.45;-webkit-tap-highlight-color:transparent}
h1,h2,h3,h4{font-weight:700;overflow-wrap:anywhere}
p,small,span,div,td{overflow-wrap:anywhere}
svg.lucide{width:20px;height:20px;stroke-width:2;flex:none}
button,input,select,textarea{font:inherit;color:inherit;max-width:100%}
button{cursor:pointer}[hidden]{display:none!important}
.shell{width:min(100%,980px);margin:0 auto;min-height:100dvh;padding-bottom:calc(118px + env(safe-area-inset-bottom,0px))}
.head{position:sticky;top:0;z-index:30;display:grid;grid-template-columns:44px 1fr 44px;align-items:center;gap:8px;padding:calc(env(safe-area-inset-top,0px) + 12px) 12px 14px;background:var(--mr);color:#fff;box-shadow:0 4px 14px rgba(40,10,15,.22)}
.head h1{font-size:19px;font-weight:500;text-align:center}
.ic{width:42px;height:42px;display:grid;place-items:center;border:0;border-radius:50%;background:none;color:#fff}
.ic:active{background:rgba(255,255,255,.18)}
.logo{width:36px;height:42px;display:grid;place-items:center;border-radius:9px;background:#fff;color:var(--mr);box-shadow:0 2px 6px rgba(0,0,0,.22)}
.body{padding:16px}
.col{display:flex;flex-direction:column;gap:14px}
.row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;justify-content:space-between}
.g2{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,350px),1fr));gap:16px;align-items:start}
.fg{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:10px}
.pill{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:99px;background:#EEF0F6;font-size:12px;font-weight:500}
.st-wait,.g3{background:#FFF0C9;color:#6E5200}.g1,.st-done{background:#DDF4E6;color:#1B6B42}.g2c{background:#E3F1FC;color:#1F6FB5}.g4,.st-abs{background:#FBE0E0;color:#A12B2B}
.hk,.dev-box,.q-card,.info,.list,.tw,.card{background:#fff;border:1px solid var(--line);border-radius:22px;box-shadow:var(--sh)}
.hk{padding:14px;display:flex;flex-direction:column;gap:12px}
.dev-box{display:flex;gap:12px;padding:16px}.dev-box.col{flex-direction:column}
.q-card{padding:12px;display:flex;flex-direction:column;gap:8px;border-radius:18px;box-shadow:none}
.info{padding:18px 20px}.info h2{font-size:20px;font-weight:500}.info .sub{color:var(--mut);font-size:14px;margin-top:2px}
.info hr{border:0;border-top:1px solid var(--line);margin:12px 0 8px}
.kv{display:flex;gap:12px;padding:4px 0;font-size:14.5px}.kv span{flex:0 0 34%;color:var(--mut)}.kv b{font-weight:500;flex:1}
.sec{font-size:17px;font-weight:700;padding:4px 4px 0}
.list{overflow:hidden}
.li{display:flex;flex-wrap:wrap;align-items:center;gap:10px 12px;padding:12px 14px;border-bottom:1px solid var(--line)}
.li:last-child{border-bottom:0}
.ava{width:48px;height:48px;border-radius:50%;border:2px solid var(--mr);background:#E9EAEE;color:#fff;display:grid;place-items:center;overflow:hidden;flex:none}
.ava svg.lucide{width:26px;height:26px}.ava img{width:100%;height:100%;object-fit:cover}
.li-main{flex:1 1 150px;min-width:0}.li-main b{display:block;font-weight:500;font-size:16px}.li-main small{color:var(--mut);font-size:14px}
.li-meta,.li-act{display:flex;gap:6px;flex-wrap:wrap;align-items:center}.li-act{margin-left:auto}
.li select{width:auto;min-height:38px;max-width:150px;font-size:13px;padding:4px 10px}
.field{display:flex;flex-direction:column;gap:5px;width:100%;min-width:0}
label{font-size:13px;color:var(--mut)}
input,select,textarea{min-height:44px;padding:9px 13px;border:1px solid var(--line);border-radius:14px;background:#fff;width:100%;min-width:0}
textarea{min-height:92px;resize:vertical;line-height:1.45}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--mr);box-shadow:0 0 0 3px rgba(139,38,48,.12)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:8px 18px;border:0;border-radius:16px;background:var(--mr);color:#fff;font-weight:500;font-size:14px;box-shadow:0 4px 12px rgba(139,38,48,.28);transition:transform .1s,box-shadow .1s;width:100%}
.btn:active:not(:disabled){transform:scale(.97);box-shadow:none}
.btn:disabled{opacity:.55;cursor:wait;box-shadow:none}
.btn:focus-visible,.nav button:focus-visible,.ic:focus-visible{outline:3px solid rgba(59,154,225,.55);outline-offset:2px}
.btn.k{background:var(--mrs);color:var(--mr);box-shadow:none}
.btn.w{background:#fff;color:var(--ink);box-shadow:none;border:1px solid var(--line)}
.btn.p{background:var(--sky);color:#1F6FB5;box-shadow:none}
.btn.r{background:var(--red);color:#fff;box-shadow:none}
.btn.sun{background:var(--sun);color:#6E5200;box-shadow:none}
.btn.s{min-height:38px;padding:4px 14px;font-size:13px;width:auto;border-radius:13px}
.alert{padding:12px 14px;border-radius:16px;background:#FBE4E4;color:#7A2323;font-size:13px}
.alert.info{background:#E3F1FC;color:#1B4F7C}.alert.ok{background:#DDF4E6;color:#1B6B42}
.code-tag{padding:2px 8px;border-radius:8px;background:var(--mrs);color:var(--mr);font-family:ui-monospace,Menlo,Consolas,monospace;font-weight:700;font-size:13px}
.subtabs{display:flex;gap:6px;flex-wrap:wrap;padding:5px;background:#fff;border:1px solid var(--line);border-radius:18px}
.subtabs button{flex:1;min-height:40px;padding:6px 14px;border:0;border-radius:14px;background:none;color:var(--mut);font-weight:500;font-size:13px;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.subtabs button.on{background:var(--mr);color:#fff}
.tw{overflow-x:auto}
table{width:100%;min-width:560px;border-collapse:collapse;font-size:14px}
th{background:#FAFBFD;text-align:left;font-size:12.5px;font-weight:500;color:var(--mut);padding:10px 12px;border-bottom:1px solid var(--line)}
td{padding:11px 12px;border-bottom:1px solid var(--line);vertical-align:top}
tr:last-child td{border-bottom:0}
.sp{width:16px;height:16px;border-radius:50%;border:3px solid rgba(128,128,128,.3);border-top-color:currentColor;animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
#toast{position:fixed;left:50%;top:calc(env(safe-area-inset-top,0px) + 12px);transform:translate(-50%,-160px);background:#2B2D33;color:#fff;padding:11px 18px;border-radius:16px;z-index:450;transition:transform .25s;max-width:92vw;font-weight:500;text-align:center;box-shadow:0 8px 24px rgba(0,0,0,.25)}
#toast.show{transform:translate(-50%,0)}#toast.bad{background:var(--red)}
.lock{position:fixed;inset:0;z-index:300;display:none;place-items:center;padding:16px;background:rgba(30,20,25,.5);backdrop-filter:blur(3px);overflow:auto}
.lock.bg-solid{background:var(--mr)}
.lock.on{display:grid}
.card{width:min(100%,420px);padding:22px;display:flex;flex-direction:column;gap:12px;border-radius:26px;box-shadow:0 12px 40px rgba(0,0,0,.25)}
.card.wide{width:min(100%,860px)}
.av{width:76px;height:76px;border-radius:50%;border:2px solid var(--mr);object-fit:cover;background:#E9EAEE}
.sg{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.ck{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:500;color:var(--ink);cursor:pointer}.ck input{width:20px;min-height:20px;padding:0;accent-color:var(--mr)}
.sc{display:block;margin-top:5px;font-size:15px;font-weight:500;text-align:center}
.opt-group{display:flex;gap:6px;flex-wrap:wrap}
.opt-btn{min-width:38px;min-height:36px;padding:4px 10px;border:1px solid var(--line);border-radius:12px;background:#fff;font-weight:500;font-size:13px}
.opt-btn.on{background:var(--mr);border-color:var(--mr);color:#fff}
.sc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(76px,1fr));gap:6px}
.sc-cell{display:flex;flex-direction:column;gap:2px;font-size:11.5px;color:var(--mut)}
.sc-cell input{min-height:38px;padding:4px 8px;border-radius:10px;font-size:14px}
.sc-fg{display:grid;grid-template-columns:repeat(auto-fit,minmax(104px,1fr));gap:8px}
.sc-bgd{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:8px}
.sc-bgd div{padding:10px 12px;border-radius:14px;background:var(--bg);font-size:13px;line-height:1.5}
.sc-bgd b{display:block;color:var(--mr)}
.cam-box{position:relative;width:100%;max-width:560px;margin:0 auto;border-radius:22px;overflow:hidden;background:#000;aspect-ratio:3/4}
.cam-box video{width:100%;height:100%;object-fit:cover;display:block}
.cam-guide{position:absolute;inset:6%;border:2px dashed #fff;border-radius:14px;pointer-events:none;box-shadow:0 0 0 9999px rgba(0,0,0,.32)}
.cam-corner{position:absolute;width:24px;height:24px;border:4px solid #fff}
.cam-corner.tl{top:4%;left:4%;border-right:0;border-bottom:0}
.cam-corner.tr{top:4%;right:4%;border-left:0;border-bottom:0}
.cam-corner.bl{bottom:4%;left:4%;border-right:0;border-top:0}
.cam-corner.br{bottom:4%;right:4%;border-left:0;border-top:0}
.scan-img{max-width:100%;max-height:380px;border-radius:14px;object-fit:contain;background:#f5f5f5}
.nav{position:fixed;left:50%;bottom:calc(env(safe-area-inset-bottom,0px) + 12px);transform:translateX(-50%);width:min(calc(100% - 24px),520px);display:grid;grid-template-columns:repeat(4,1fr);padding:6px;background:#fff;border:1px solid var(--line);border-radius:32px;box-shadow:0 8px 24px rgba(30,35,60,.16);z-index:40}
.nav-ind{position:absolute;top:6px;bottom:6px;left:6px;width:calc((100% - 12px)/4);border-radius:26px;background:var(--mrs);transform:translateX(calc(var(--i,0)*100%));transition:transform .3s cubic-bezier(.3,.9,.3,1)}
.nav button{position:relative;z-index:1;border:0;background:none;display:flex;flex-direction:column;align-items:center;gap:2px;padding:9px 4px;border-radius:26px;color:var(--mut);font-size:12.5px;font-weight:500}
.nav button.on{color:var(--mr);font-weight:700}
.lock.bg-solid.on{display:block;padding:0;backdrop-filter:none}
.lg{position:relative;min-height:100dvh;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;overflow:hidden}
.lg-qwrap{flex:1;display:flex;align-items:flex-start;padding-top:clamp(8px,6vh,48px)}
.lg-q{font-family:'Lora',Georgia,serif;font-weight:600;font-size:clamp(20px,5.6vw,25px);line-height:1.5;color:#fff;white-space:pre-line;padding-left:16px;border-left:3px solid rgba(255,255,255,.3);max-width:30ch}
.lg-q .rest{color:transparent}
.lg-caret{display:inline-block;width:0;height:1.1em;position:relative;vertical-align:-.16em}
.lg-caret::after{content:"";position:absolute;left:2px;top:0;width:2px;height:100%;background:#fff}
.lg-caret.off{visibility:hidden}
.lg-top{position:relative;flex:1;width:100%;max-width:420px;padding:calc(env(safe-area-inset-top,0px) + 28px) 24px 28px;display:flex;flex-direction:column;justify-content:space-between;gap:24px;color:#fff}
.lg-top h1{font-family:'Lora',Georgia,serif;font-weight:600;font-size:32px;line-height:1.2;letter-spacing:-.01em}
.lg-top p{margin-top:8px;font-size:15px;line-height:1.5;color:rgba(255,255,255,.85);max-width:30ch}
.lg-sheet{position:relative;width:100%;max-width:420px;padding:26px 24px calc(26px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:14px;background:#fff;border-radius:28px 28px 0 0;box-shadow:0 -12px 40px rgba(30,5,10,.28)}
.lg-sheet .btn{min-height:50px;font-size:15px}
.pw{position:relative}
.pw input{padding-right:52px;min-height:50px;font-size:16px}
.eye{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:42px;height:42px;display:grid;place-items:center;border:0;border-radius:50%;background:none;color:var(--mut)}
.eye:active{background:var(--bg)}
.eye:focus-visible{outline:3px solid rgba(59,154,225,.55)}
@media(min-width:700px){.lg{justify-content:center}.lg-top{flex:none;gap:36px;padding:0 24px 28px}.lg-qwrap{flex:none;min-height:9.5em;padding-top:0;font-size:24px}.lg-sheet{border-radius:28px;box-shadow:0 18px 50px rgba(30,5,10,.35)}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* ===================== BẢN DÀNH CHO ĐIỆN THOẠI ===================== */
html{-webkit-text-size-adjust:100%}
button,select,label,input,textarea{touch-action:manipulation}
.shell{width:min(100%,560px);padding-bottom:calc(96px + env(safe-area-inset-bottom,0px))}
.body{padding:12px}.col{gap:12px}
.head{grid-template-columns:44px 1fr 44px;padding:calc(env(safe-area-inset-top,0px) + 8px) 8px 10px}
.head h1{font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.logo{width:32px;height:38px}
/* Thanh điều hướng dính đáy, ngón cái chạm tới */
.nav{bottom:0;width:min(100%,560px);border-width:1px 0 0;border-radius:20px 20px 0 0;padding:6px 10px calc(6px + env(safe-area-inset-bottom,0px));box-shadow:0 -6px 20px rgba(30,35,60,.12)}
.nav-ind{left:10px;width:calc((100% - 20px)/4);bottom:calc(6px + env(safe-area-inset-bottom,0px))}
.nav button{min-height:54px;font-size:12px}
/* Khối nội dung gọn hơn */
.info,.dev-box,.hk,.q-card{border-radius:18px}
.info{padding:16px}.info h2{font-size:18px}.dev-box{padding:14px}.sec{font-size:16px}
.kv{flex-direction:column;gap:0}.kv span{flex:none;font-size:13px}
/* Form: chữ 16px để iPhone không tự phóng to, ô nhập cao dễ chạm */
.fg{grid-template-columns:1fr}
input,select,textarea,.li select{font-size:16px;min-height:48px}
textarea{min-height:200px}
.ck{align-items:flex-start;line-height:1.35;min-height:44px;padding:2px 0}
.ck input{width:22px;height:22px;min-height:22px;flex:none}
.row>.field{flex:1 1 100%!important;min-width:0!important}
.row>.row{flex:1 1 100%}
/* Nút: chữ tự xuống dòng, đủ lớn để bấm */
.btn{white-space:normal;line-height:1.25;min-height:48px}
.btn.s{min-height:46px;font-size:14px;padding:8px 14px;border-radius:14px}
.row>.btn{flex:1 1 calc(50% - 4px);width:auto!important;min-width:0}
#asgPaneCfg .dev-box>.row>.btn,#aTools .hk .row>.btn{flex-basis:100%}
#pScan .btn.sun{min-height:56px;font-size:16px}
/* Tab con xếp dọc */
.subtabs{flex-direction:column;gap:4px}
.subtabs button{flex:none;width:100%;justify-content:flex-start;text-align:left;white-space:normal;line-height:1.25;padding:10px 14px;min-height:46px}
/* Danh sách học sinh: ảnh + tên ở trên, nút ở dưới */
.li{display:grid;grid-template-columns:48px 1fr;gap:8px 12px;align-items:center}
.li>small:only-child{grid-column:1/-1}
.li-main,.li-meta{grid-column:2;flex:none}
.li-act{grid-column:1/-1;margin:0;flex-wrap:nowrap}
.li-act select{flex:1 1 auto;max-width:none}
.li-act .btn.k{flex:1 1 auto;width:auto}
.li-act .btn.w{flex:0 0 48px;width:48px!important;padding:0}
/* Bảng → thẻ xếp dọc (nhãn cột lấy từ tiêu đề bảng) */
.tw{overflow:visible;background:none;border:0;box-shadow:none;border-radius:0}
table,tbody,tr,td{display:block;width:100%;min-width:0}
thead{display:none}
tbody tr{background:#fff!important;border:1px solid var(--line);border-left-width:4px;border-radius:16px;margin-bottom:10px;padding:4px 14px;box-shadow:var(--sh)}
tbody tr:has(.st-done){border-left-color:var(--ok)}
tbody tr:has(.st-abs){border-left-color:var(--red)}
td{padding:8px 0;border-bottom:1px dashed var(--line)}
tr td:last-child{border-bottom:0}
td:first-child{font-size:16px;padding-top:10px}
td[data-label]{display:grid;grid-template-columns:minmax(84px,34%) 1fr;gap:4px 10px}
td[data-label]::before{content:attr(data-label);color:var(--mut);font-size:12.5px;font-weight:500}
td[data-label=""]{display:block}td[data-label=""]::before{display:none}
td[style]{text-align:left!important;white-space:normal!important}
td .btn.s{width:100%!important;margin-top:6px}
/* Cửa sổ phụ mở như tấm trượt từ đáy màn hình */
.lock:not(.bg-solid){place-items:end stretch;padding:0}
.lock:not(.bg-solid) .card,.lock:not(.bg-solid) .card.wide{width:100%;max-width:none;max-height:92dvh;overflow:auto;border-radius:24px 24px 0 0;padding:20px 16px calc(20px + env(safe-area-inset-bottom,0px))}
/* Camera & ảnh quét */
.cam-box{max-width:none;max-height:68dvh;border-radius:18px}
.scan-img{max-height:300px}
.alert{font-size:13px}
/* Quả cầu → vòng tổng quan xếp loại (bấm để xem chi tiết) */
.logo{width:40px;height:40px;border:0;padding:0;border-radius:50%;cursor:pointer;transition:transform .15s}
.logo:active{transform:scale(.93)}
.logo:focus-visible{outline:3px solid rgba(255,255,255,.75);outline-offset:2px}
.logo svg{width:100%;height:100%;display:block}
.dn-t{fill:none;stroke:#EEF0F6}.dn-s{fill:none}
.dn-n{font:700 11px Roboto,sans-serif;fill:var(--mr);text-anchor:middle;dominant-baseline:central}
.ov{gap:14px}
.ov-top{display:flex;align-items:center;gap:18px}
.ov-ring{width:136px;height:136px;flex:none}.ov-ring .dn-n{font-size:9px}
.ov-leg{flex:1;display:flex;flex-direction:column;gap:9px;font-size:14.5px}
.ov-leg div{display:flex;align-items:center;gap:8px}
.ov-leg i{width:11px;height:11px;border-radius:50%;flex:none}.ov-leg b{margin-left:auto}
.ov-tiles{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ov-tile{padding:11px 14px;border-radius:16px;background:var(--bg)}
.ov-tile b{display:block;font-size:21px;color:var(--mr)}.ov-tile small{color:var(--mut);font-size:12.5px}
.ov-att{display:flex;align-items:center;gap:8px;padding:8px 0;border-top:1px solid var(--line)}

/* ===================== BẢN DÀNH CHO MÁY TÍNH (≥1024px) ===================== */
.nav-brand,.nav-foot,.lg-hd,.hero-stats,.topo{display:none}
.topo{fill:none;stroke:currentColor;stroke-width:1.1;overflow:visible;pointer-events:none}
.topo path{vector-effect:non-scaling-stroke}
.topo g{transform-origin:200px 200px;animation:topoSpin 90s linear infinite}
.topo g:nth-child(even){animation-direction:reverse}
@keyframes topoSpin{to{transform:rotate(360deg)}}
@keyframes rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes popIn{from{opacity:0;transform:translateY(14px) scale(.97)}to{opacity:1;transform:none}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes needle{0%,100%{transform:rotate(-18deg)}25%{transform:rotate(22deg)}50%{transform:rotate(-8deg)}75%{transform:rotate(12deg)}}

@media (min-width:1024px){
:root{--sw:264px}
.topo{display:block}
.bg-topo{position:fixed;right:-260px;top:-220px;width:840px;height:840px;color:var(--mr);opacity:.07;z-index:0}

/* ---- Khung chính: thanh bên trái + vùng nội dung rộng ---- */
.shell{position:relative;z-index:1;width:auto;max-width:none;margin:0 0 0 var(--sw);padding:0}
.body{max-width:1400px;margin:0 auto;padding:28px 40px 12px}
.col{gap:20px}
.shell>div:last-child{max-width:1400px;margin:0 auto}
.head{grid-template-columns:auto 1fr auto;gap:16px;padding:20px 40px 18px;background:rgba(245,246,250,.86);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);color:var(--ink);box-shadow:none;border-bottom:1px solid var(--line)}
.head h1{font-family:'Lora',Georgia,serif;font-weight:600;font-size:27px;letter-spacing:-.01em;text-align:left;white-space:normal}
.ic{width:44px;height:44px;color:var(--ink);transition:background .2s,color .2s}
.ic:hover{background:rgba(139,38,48,.09);color:var(--mr)}
.ic svg{transition:transform .5s cubic-bezier(.3,.9,.3,1)}
.ic[data-act=settings]:hover svg{transform:rotate(90deg)}
.logo{width:46px;height:46px;background:#fff;box-shadow:0 0 0 1px var(--line),var(--sh);transition:transform .2s}
.logo:hover{transform:scale(1.07)}

/* ---- Thanh bên ---- */
.nav{--pt:172px;--bh:54px;--gp:6px;left:0;top:0;bottom:0;transform:none;width:var(--sw);display:flex;flex-direction:column;gap:var(--gp);padding:var(--pt) 14px 24px;border:0;border-radius:0;overflow:hidden;background:linear-gradient(185deg,#8B2630 0%,#6B1A24 58%,#4A1018 100%);box-shadow:6px 0 30px rgba(60,10,16,.25)}
.nav-ind{left:14px;right:14px;width:auto;top:calc(var(--pt) + var(--i,0)*(var(--bh) + var(--gp)));bottom:auto;height:var(--bh);transform:none;border-radius:14px;background:rgba(255,255,255,.15);box-shadow:inset 3px 0 0 #F3D9A4;transition:top .45s cubic-bezier(.3,.9,.3,1)}
.nav button{flex:none;flex-direction:row;justify-content:flex-start;gap:14px;height:var(--bh);min-height:var(--bh);padding:0 20px;border-radius:14px;color:rgba(255,255,255,.7);font-size:15px;transition:color .2s,background .2s}
.nav button:hover{color:#fff;background:rgba(255,255,255,.06)}
.nav button.on{color:#fff;font-weight:700}
.nav button svg.lucide{width:21px;height:21px}
.nav-brand{display:flex;align-items:center;gap:14px;position:absolute;left:22px;right:22px;top:36px;color:#fff}
.nav-brand svg{width:48px;height:48px;flex:none}
.nav-brand b{display:block;font:600 24px/1.1 'Lora',Georgia,serif}
.nav-brand small{font-size:13px;color:rgba(255,255,255,.72)}
.compass-needle{transform-origin:24px 24px;animation:needle 8s ease-in-out infinite}
.topo-nav{position:absolute;left:-100px;bottom:-150px;width:460px;height:460px;color:#fff;opacity:.17}
.nav-foot{display:block;position:absolute;left:22px;right:22px;bottom:24px;font-size:13px;line-height:1.5;color:rgba(255,255,255,.72)}
.nav-foot b{display:block;font-size:14px;font-weight:500;color:#fff}

/* ---- Hiệu ứng vào trang: mỗi lần đổi tab, các khối hiện lần lượt ---- */
.body>section:not([hidden])>*{animation:rise .55s cubic-bezier(.2,.7,.2,1) both}
.body>section:not([hidden])>:nth-child(2){animation-delay:.06s}
.body>section:not([hidden])>:nth-child(3){animation-delay:.12s}
.body>section:not([hidden])>:nth-child(4){animation-delay:.18s}
.body>section:not([hidden])>:nth-child(n+5){animation-delay:.24s}

/* ---- Khối, ô nhập, nút ---- */
.info,.dev-box,.hk,.list,.tw{border-radius:20px}
.dev-box{padding:22px}.hk{padding:20px}
input,select,textarea{font-size:14.5px;min-height:42px}
textarea{min-height:110px}
.fg{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}
.kv{flex-direction:row;gap:12px}.kv span{flex:0 0 34%}
.btn{min-height:44px}.btn.s{min-height:38px;font-size:13px;padding:4px 14px}
.btn:hover:not(:disabled){transform:translateY(-1px);filter:brightness(1.05)}
.row>.btn{flex:0 0 auto;width:auto!important}
.row>.field{flex:1 1 280px!important;min-width:220px!important}
.row>.row{flex:0 1 auto}
#asgPaneCfg .dev-box>.row>.btn,#aTools .hk .row>.btn{flex:0 0 auto}
#pScan .btn.sun{min-height:48px;font-size:15px}
.subtabs{flex-direction:row}
.subtabs button{flex:1;width:auto;justify-content:center;text-align:center;min-height:42px;padding:6px 14px}

/* ---- Trang Học sinh ---- */
#pList{display:grid;grid-template-columns:minmax(0,1fr);gap:20px}
#pList>.info{position:relative;overflow:hidden;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 48px;align-items:center;padding:34px 40px;border:0;color:#fff;background:linear-gradient(120deg,#8B2630 0%,#6E1B25 70%,#58141D 100%);box-shadow:0 18px 40px -18px rgba(110,27,37,.55)}
#pList>.info>*{position:relative;z-index:1;grid-column:1}
#pList>.info h2{font-family:'Lora',Georgia,serif;font-weight:600;font-size:32px;line-height:1.2}
#pList>.info .sub{color:rgba(255,255,255,.8);font-size:16px}
#pList>.info hr{border-top-color:rgba(255,255,255,.2);margin:18px 0 10px}
#pList>.info .kv span{color:rgba(255,255,255,.68)}
#pList>.info>.hero-topo{position:absolute;right:-110px;top:-170px;width:540px;height:540px;color:#fff;opacity:.2;z-index:0}
.hero-stats{display:flex;gap:12px;grid-column:2!important;grid-row:1/span 4}
.hero-stats div{min-width:116px;padding:16px 20px;border-radius:16px;background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.18)}
.hero-stats b{display:block;font:600 36px/1.1 'Lora',Georgia,serif;font-variant-numeric:tabular-nums}
.hero-stats small{font-size:13px;color:rgba(255,255,255,.78)}
.li{grid-template-columns:52px minmax(0,1fr) auto;gap:10px 18px;padding:14px 22px;position:relative;transition:background .2s}
.li::before{content:"";position:absolute;left:0;top:12px;bottom:12px;width:3px;border-radius:0 3px 3px 0;background:var(--mr);transform:scaleY(0);transition:transform .25s}
.li:hover{background:#FBF7F8}.li:hover::before{transform:scaleY(1)}
.ava{width:52px;height:52px}
.li-main,.li-meta{grid-column:auto}
.li-act{grid-column:2/-1;margin:0;flex-wrap:nowrap;justify-content:flex-start}
.li-act select{flex:none;max-width:160px;min-height:38px;font-size:13px}
.li-act .btn.k{flex:none;width:auto}
.li-act .btn.w{flex:none;width:38px!important;padding:0}

/* ---- Bảng trở lại dạng bảng (bản điện thoại đang biến thành thẻ) ---- */
.tw{overflow-x:auto;background:#fff;border:1px solid var(--line);box-shadow:var(--sh)}
table{display:table;width:100%;min-width:780px}
thead{display:table-header-group}tbody{display:table-row-group}
tr{display:table-row;width:auto}
td,td[data-label]{display:table-cell;width:auto;padding:12px;border-bottom:1px solid var(--line)}
td[data-label]::before{content:none}
td:first-child{font-size:14px;padding-top:12px}
tbody tr{border:0;border-radius:0;margin:0;padding:0;box-shadow:none;background:transparent!important}
tbody tr:has(.st-done){background:#F1FAF5!important}
tbody tr:has(.st-abs){background:#FDF3F3!important}
tbody tr:has(.st-done) td:first-child{box-shadow:inset 4px 0 0 var(--ok)}
tbody tr:has(.st-abs) td:first-child{box-shadow:inset 4px 0 0 var(--red)}
tr:last-child td{border-bottom:0}
td[style*=right]{text-align:right!important;white-space:nowrap!important}
td .btn.s{width:auto!important;margin-top:0}
tr td:last-child{border-bottom:1px solid var(--line)}tr:last-child td:last-child{border-bottom:0}

/* ---- Trang Bài kiểm tra ---- */
#pAsg>.dev-box.col:first-child{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px 32px;align-items:start}
#pAsg>.dev-box.col:first-child>*{grid-column:1/-1}
#pAsg>.dev-box.col:first-child>div:nth-of-type(2){grid-column:1}
#pAsg>.dev-box.col:first-child>div:nth-of-type(3){grid-column:2}
#pAsg>.dev-box.col:first-child>.btn{justify-self:start;width:auto;min-width:280px}
#qEditorList .hk>.col{display:grid;grid-template-columns:repeat(auto-fill,minmax(430px,1fr));gap:12px;align-items:start}
.cam-box{max-width:480px;max-height:none}
.scan-img{max-height:380px}

/* ---- Cửa sổ phụ: hộp thoại giữa màn hình ---- */
.lock:not(.bg-solid){place-items:center;padding:32px}
.lock:not(.bg-solid).on{animation:fadeIn .2s both}
.lock:not(.bg-solid) .card{width:min(100%,460px);max-width:none;max-height:90dvh;overflow:auto;border-radius:26px;padding:28px}
.lock:not(.bg-solid) .card.wide{width:min(100%,1000px)}
.lock:not(.bg-solid) .card.ov{width:min(100%,560px)}
.lock:not(.bg-solid).on .card{animation:popIn .34s cubic-bezier(.2,.8,.2,1) both}

/* ---- Màn hình đăng nhập: chia đôi ---- */
.lg{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(440px,.8fr);justify-content:stretch;align-items:stretch;min-height:100dvh}
.lg-top{position:relative;overflow:hidden;flex:none;max-width:none;gap:40px;padding:72px clamp(48px,6vw,104px);justify-content:space-between}
.lg-top>*{position:relative;z-index:1}
.lg-top>.lg-topo{position:absolute;right:-220px;bottom:-280px;width:900px;height:900px;color:#fff;opacity:.2;z-index:0}
.lg-qwrap{flex:none;min-height:10em;padding-top:0}
.lg-q{font-size:clamp(26px,2.5vw,38px);max-width:20ch}
.lg-top h1{font-size:clamp(38px,4vw,56px)}
.lg-top p{font-size:18px;max-width:34ch}
.lg-sheet{width:auto;max-width:none;align-items:center;justify-content:center;gap:18px;padding:64px clamp(36px,5vw,88px);border-radius:0;box-shadow:none}
.lg-sheet>*{width:100%;max-width:400px}
.lg-hd{display:block;margin-bottom:6px}
.lg-hd b{display:block;font:600 30px/1.2 'Lora',Georgia,serif;color:var(--mr)}
.lg-hd small{display:block;margin-top:6px;font-size:15px;color:var(--mut)}
.lock.on .lg-sheet>*{animation:rise .6s cubic-bezier(.2,.7,.2,1) both}
.lock.on .lg-sheet>:nth-child(2){animation-delay:.08s}
.lock.on .lg-sheet>:nth-child(3){animation-delay:.16s}
.lock.on .lg-sheet>:nth-child(4){animation-delay:.24s}
}

/* Màn rộng: ô lọc và ô thêm học sinh nằm cạnh nhau, mỗi học sinh một dòng */
@media (min-width:1280px){
#pList{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr)}
#pList>.info,#pList>.sec,#pList>.list{grid-column:1/-1}
.li{grid-template-columns:52px minmax(200px,1.2fr) minmax(190px,1fr) auto}
.li-act{grid-column:auto}
}

/* ---- Hiệu ứng đánh máy ---- */
.lg-q{white-space:normal}
.lg-q .w{display:inline-block;white-space:nowrap}
.lg-q .c{color:transparent}
.lg-q .c.on{color:inherit}
.lg-q .c.cur,.lg-q .c.cur0{position:relative}
.lg-q .c.cur::after,.lg-q .c.cur0::before{content:"";position:absolute;top:.1em;bottom:.06em;width:2px;background:#fff}
.lg-q .c.cur::after{right:-3px}
.lg-q .c.cur0::before{left:-3px}
.lg-q.blink .c.cur::after,.lg-q.blink .c.cur0::before{visibility:hidden}

/* ---- Công tắc hiệu ứng ---- */
.fx-btn{display:none}
html[data-fx=off] *,html[data-fx=off] *::before,html[data-fx=off] *::after{animation:none!important;transition:none!important}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
html[data-paused] *{animation-play-state:paused!important}
@media (min-width:1024px){
.head{grid-template-columns:auto 1fr auto auto}
.fx-btn{display:grid;position:relative}
.fx-btn::after{content:"";position:absolute;left:11px;right:11px;top:50%;height:2px;border-radius:2px;background:currentColor;transform:rotate(-45deg) scaleX(0);transition:transform .25s}
html[data-fx=off] .fx-btn{color:var(--mut)}
html[data-fx=off] .fx-btn::after{transform:rotate(-45deg) scaleX(1)}
body:has(#lock.on) :is(.bg-topo,.topo-nav,.hero-topo) g,body:has(#lock.on) .compass-needle{animation-play-state:paused}
}

/* ===================== v2: hết rớt chữ · thanh trạng thái thẳng hàng · ô tệp · điểm danh ===================== */
td,th{overflow-wrap:normal;word-break:normal}
th{white-space:nowrap}
.pill{min-height:28px;line-height:1.2;justify-content:center;text-align:center}
.li-meta .pill,td .pill,.code-tag{white-space:nowrap}
.li-meta{display:grid;grid-template-columns:repeat(2,minmax(112px,1fr));gap:6px;width:100%;max-width:270px}
.li-meta .pill{width:100%;overflow:hidden;text-overflow:ellipsis;display:inline-flex}
td .pill{min-width:132px}
.filebox{position:relative;display:flex;align-items:center;gap:12px;min-height:50px;padding:8px 10px 8px 14px;border:1.5px dashed #C9A0A6;border-radius:14px;background:var(--mrs);color:var(--ink);font-size:14px;cursor:pointer;transition:background .15s,border-color .15s}
.filebox:hover,.filebox:focus-within{background:#F1DDE0;border-color:var(--mr)}
.filebox.has{border-style:solid;border-color:var(--ok);background:#F4FBF7}
.filebox>svg.lucide{color:var(--mr);width:22px;height:22px}.filebox.has>svg.lucide{color:var(--ok)}
.filebox .fb-t{flex:1;min-width:0;display:flex;flex-direction:column}
.filebox .fb-t b{font-weight:500;font-size:14px;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.filebox .fb-t small{font-size:12px;color:var(--mut)}
.filebox em{font-style:normal;flex:none;padding:7px 14px;border-radius:10px;background:var(--mr);color:#fff;font-size:13px;font-weight:500}
.filebox input{position:absolute;inset:0;width:100%;height:100%;min-height:0;padding:0;border:0;opacity:0;cursor:pointer}
input[type=file]::file-selector-button{margin-right:12px;padding:8px 14px;border:0;border-radius:10px;background:var(--mr);color:#fff;font:500 13px Roboto,sans-serif;cursor:pointer}
.at-hero{background:linear-gradient(135deg,#8B2630,#B23A48);color:#fff;border-radius:24px;padding:16px;display:flex;flex-direction:column;gap:14px;box-shadow:0 8px 22px rgba(139,38,48,.28)}
.at-top{display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between;align-items:center}
.at-date{display:flex;align-items:center;gap:6px}
.at-nav{width:40px;height:40px;border:0;border-radius:50%;background:rgba(255,255,255,.18);color:#fff;display:grid;place-items:center}
.at-nav:active{background:rgba(255,255,255,.32)}
.at-dl{position:relative;display:flex;flex-direction:column;align-items:center;min-width:136px;padding:4px 10px;cursor:pointer;line-height:1.25}
.at-dl small{font-size:12px;opacity:.88}.at-dl b{font-size:22px;font-weight:700}
.at-dl input{position:absolute;inset:0;width:100%;height:100%;min-height:0;padding:0;border:0;opacity:0;cursor:pointer}
.at-cls{display:flex;align-items:center;gap:8px;background:#fff;color:var(--mr);border-radius:14px;padding:0 10px 0 12px;min-height:44px}
.at-cls select{border:0;background:none;outline:0;min-height:40px;padding:0 4px 0 0;font-weight:700;font-size:16px;color:var(--mr)}
.at-prog{display:flex;align-items:center;gap:14px}
.at-ring{--p:0;flex:none;position:relative;width:86px;height:86px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(#7BE0A4 calc(var(--p)*1%),rgba(255,255,255,.22) 0)}
.at-ring::before{content:"";position:absolute;inset:9px;border-radius:50%;background:#9A2F3C}
.at-ring b{position:relative;font-size:19px}
.at-stats{flex:1;min-width:0;display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.at-st{display:flex;flex-direction:column;align-items:center;padding:8px 2px;border-radius:14px;background:rgba(255,255,255,.14);line-height:1.2;text-align:center}
.at-st b{font-size:20px}.at-st span{font-size:11.5px;opacity:.88}
.at-st.ok b{color:#9BF0BF}.at-st.ab b{color:#FFB3B3}.at-st.wt b{color:#FFE08A}
.at-sync{align-self:flex-start;display:inline-flex;align-items:center;gap:6px;border:0;border-radius:99px;padding:7px 14px;font-size:12.5px;font-weight:500;background:rgba(255,255,255,.18);color:#fff}
.at-sync.err{background:#FFF0C9;color:#6E5200}.at-sync svg.lucide{width:16px;height:16px}
.at-tools{display:flex;flex-direction:column;gap:10px}
.at-seg{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;padding:4px;border-radius:14px;background:#EEF0F6}
.at-seg button{min-height:38px;border:0;border-radius:10px;background:none;font-size:13.5px;font-weight:500;color:var(--mut)}
.at-seg button.on{background:#fff;color:var(--mr);box-shadow:var(--sh)}
.at-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,330px),1fr));gap:10px}
.at-card{display:grid;grid-template-columns:22px 44px minmax(0,1fr) 38px;align-items:center;gap:10px;padding:10px 12px;background:#fff;border:1.5px solid var(--line);border-radius:18px;box-shadow:var(--sh);transition:background .2s,border-color .2s}
.at-n{font-size:12px;color:var(--mut);text-align:center}
.at-card .ava{width:44px;height:44px;border-color:var(--line);background:var(--mrs);color:var(--mr);font-weight:700;font-size:16px}
.at-card b{display:block;font-weight:500;font-size:15px}.at-card small{color:var(--mut);font-size:12.5px}
.at-x{width:38px;height:38px;display:grid;place-items:center;border:1.5px solid var(--line);border-radius:12px;background:#fff;color:var(--mut)}
.at-btns{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.at-b{min-height:44px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1.5px solid var(--line);border-radius:14px;background:#fff;font-weight:500;font-size:14.5px;white-space:nowrap;transition:transform .08s}
.at-b:active{transform:scale(.97)}
.at-card.pre{border-color:#9ED9B8;background:#F4FBF7}.at-card.pre .at-b.p{background:var(--ok);border-color:var(--ok);color:#fff}
.at-card.abs{border-color:#F1A7A7;background:#FDF0F0}.at-card.abs .at-b.a{background:var(--red);border-color:var(--red);color:#fff}
@media (max-width:420px){.at-prog{flex-direction:column;align-items:stretch}.at-ring{align-self:center}}
@media (min-width:1024px){
#asgPaneOv table{table-layout:fixed;min-width:1200px}
#asgPaneOv td{vertical-align:middle}
#asgPaneOv td:nth-child(6){vertical-align:top;overflow-wrap:break-word}
#asgPaneOv td .btn{white-space:nowrap}
#asgPaneOv th:nth-child(1){width:140px}#asgPaneOv th:nth-child(2){width:170px}#asgPaneOv th:nth-child(3){width:176px}
#asgPaneOv th:nth-child(4){width:96px}#asgPaneOv th:nth-child(5){width:120px}#asgPaneOv th:nth-child(7){width:160px}
#asgPaneOv td:nth-child(3) .pill{width:100%}
}
@media (min-width:1280px){.li{grid-template-columns:52px minmax(200px,1.2fr) 270px auto}}

/* --- CSS tách từ thuộc tính style nội tuyến (38 phần tử) --- */
.extracted-style-1 {
    justify-content:flex-start;
}

.extracted-style-2 {
    flex-wrap:wrap;align-items:flex-end;
}

.extracted-style-3 {
    flex:2;min-width:180px;
}

.extracted-style-4 {
    flex:1;min-width:110px;
}

.extracted-style-5 {
    min-height:44px;
}

.extracted-style-6 {
    justify-content:flex-start;
}

.extracted-style-7 {
    vertical-align:middle;
}

.extracted-style-8 {
    background:var(--sun);
}

.extracted-style-9 {
    justify-content:flex-start;gap:16px;
}

.extracted-style-10 {
    gap:6px;
}

.extracted-style-11 {
    width:80px;min-height:36px;
}

.extracted-style-12 {
    background:var(--bg);
}

.extracted-style-13 {
    vertical-align:middle;
}

.extracted-style-14 {
    background:var(--bg);
}

.extracted-style-15 {
    flex:2;min-width:240px;
}

.extracted-style-16 {
    align-self:flex-end;
}

.extracted-style-17 {
    justify-content:flex-start;
}

.extracted-style-18 {
    width:95px;
}

.extracted-style-19 {
    justify-content:flex-start;
}

.extracted-style-20 {
    width:95px;
}

.extracted-style-21 {
    justify-content:flex-start;
}

.extracted-style-22 {
    width:95px;
}

.extracted-style-23 {
    justify-content:flex-start;gap:18px;margin-top:4px;
}

.extracted-style-24 {
    gap:6px;
}

.extracted-style-25 {
    width:80px;min-height:36px;
}

.extracted-style-26 {
    width:auto;
}

.extracted-style-27 {
    width:auto;
}

.extracted-style-28 {
    width:auto;
}

.extracted-style-29 {
    vertical-align:middle;
}

.extracted-style-30 {
    justify-content:flex-start;
}

.extracted-style-31 {
    width:auto;
}

.extracted-style-32 {
    width:auto;
}

.extracted-style-33 {
    vertical-align:middle;
}

.extracted-style-34 {
    font-size:13px;
}

.extracted-style-35 {
    vertical-align:middle;
}

.extracted-style-36 {
    margin-top:8px;
}

.extracted-style-37 {
    text-align:center;font-size:12.5px;padding:24px 16px 8px;color:rgba(23,18,15,0.7);line-height:1.6;
}

.extracted-style-38 {
    --i:0;
}
