:root{--gold:#e8c86a;--gold-soft:#f3dd9a;--navy:#07172f;--navy-2:#123163;--ink:#f5f7fb;--muted:rgba(245,247,251,.68);--stroke:rgba(255,255,255,.2);--danger:#fb7185;--green:#62e6bb}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html{min-height:100%;background:#07172f}body{min-height:100vh;color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Thonburi,"Leelawadee UI",Sarabun,"Noto Sans Thai",sans-serif;background:radial-gradient(850px 600px at 100% 0,rgba(42,198,173,.2),transparent 58%),radial-gradient(850px 600px at 0 0,rgba(232,200,106,.15),transparent 60%),linear-gradient(155deg,var(--navy-2),var(--navy) 64%,#050f21);-webkit-font-smoothing:antialiased}
.page{min-height:100vh;display:flex;flex-direction:column}.topbar{display:flex;align-items:center;gap:12px;padding:15px clamp(14px,4vw,44px);border-bottom:1px solid rgba(255,255,255,.14)}.crest{width:46px;height:46px;display:grid;place-items:center;border-radius:13px;background:linear-gradient(145deg,var(--gold-soft),var(--gold) 52%,#c59e3d);color:#382a04;font-weight:900;font-size:15px}.brand{font-size:clamp(17px,2.4vw,24px);font-weight:850}.brand span{color:var(--gold-soft)}.back{margin-left:auto;color:rgba(245,247,251,.75);font-size:13px;font-weight:750;text-decoration:none}.back:hover{text-decoration:underline}.back:focus-visible,.button:focus-visible,input:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.main{width:min(980px,100%);margin:0 auto;padding:clamp(36px,7vw,72px) clamp(14px,4vw,32px);flex:1}.eyebrow{color:var(--gold-soft);font-size:12px;font-weight:850;letter-spacing:1.4px;text-transform:uppercase}.hero{text-align:center}.hero h1{margin-top:10px;font-size:clamp(31px,6vw,52px);line-height:1.12}.hero p{max-width:660px;margin:12px auto 0;color:var(--muted);font-size:clamp(14px,2vw,16px);line-height:1.7}
.panel{margin:32px auto 0;padding:clamp(22px,4vw,36px);border:1px solid var(--stroke);border-radius:24px;background:linear-gradient(145deg,rgba(255,255,255,.15),rgba(255,255,255,.075));box-shadow:0 26px 70px -35px #000,inset 0 1px rgba(255,255,255,.22);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}.panel-head{display:flex;align-items:center;gap:14px}.panel-icon{width:54px;height:54px;flex:0 0 54px;display:grid;place-items:center;border-radius:16px;background:linear-gradient(145deg,#fb7185,#d92d4f);box-shadow:0 12px 26px -13px #000}.panel-icon svg{width:28px;height:28px}.panel-head h2{font-size:clamp(20px,3vw,26px)}.panel-head p{margin-top:3px;color:var(--muted);font-size:13px;line-height:1.5}
.form{display:flex;gap:10px;margin-top:24px}.field{flex:1;min-width:0}.field label{display:block;margin-bottom:8px;color:var(--gold-soft);font-size:13px;font-weight:800}.field input{width:100%;height:52px;padding:0 16px;border:1px solid rgba(255,255,255,.26);border-radius:14px;background:rgba(3,15,35,.6);color:#fff;font:inherit;font-size:16px}.field input::placeholder{color:rgba(245,247,251,.35)}.button{align-self:end;height:52px;padding:0 23px;border:0;border-radius:14px;background:linear-gradient(145deg,var(--gold-soft),var(--gold));color:#342704;font:inherit;font-weight:900;cursor:pointer;box-shadow:0 12px 26px -14px rgba(232,200,106,.75)}.button:hover{filter:brightness(1.06)}.button.secondary{background:rgba(255,255,255,.12);color:#fff;border:1px solid var(--stroke);box-shadow:none}.error{min-height:21px;margin-top:9px;color:#ff9aaa;font-size:13px}.note{margin-top:18px;padding:13px 15px;border:1px solid rgba(232,200,106,.24);border-radius:13px;background:rgba(232,200,106,.08);color:rgba(245,247,251,.72);font-size:12.5px;line-height:1.6}
.results{margin-top:25px}.results[hidden],.workspace[hidden],.login[hidden]{display:none}.result-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.result-head h2{font-size:19px}.query-label{color:var(--gold-soft);font-size:13px;font-weight:800}.table-wrap{overflow-x:auto;border:1px solid var(--stroke);border-radius:16px;background:rgba(3,15,35,.38)}table{width:100%;min-width:680px;border-collapse:collapse;text-align:left}th,td{padding:14px 15px;border-bottom:1px solid rgba(255,255,255,.12);font-size:13px}th{background:rgba(255,255,255,.09);color:var(--gold-soft);white-space:nowrap}td{color:rgba(245,247,251,.8)}tbody tr:last-child td{border-bottom:0}.empty-row{text-align:center!important;padding:28px 18px!important;color:var(--muted)!important;line-height:1.65}.status{display:inline-block;padding:4px 9px;border-radius:999px;background:rgba(251,113,133,.15);border:1px solid rgba(251,113,133,.35);color:#ff9aaa;font-weight:850}
.demo-banner{margin:0 0 12px;padding:10px 12px;border:1px solid rgba(232,200,106,.3);border-radius:12px;background:rgba(232,200,106,.09);color:var(--gold-soft);font-size:12.5px;font-weight:750;line-height:1.5}.status.grade-r{border-color:rgba(232,200,106,.4);background:rgba(232,200,106,.14);color:var(--gold-soft)}.status.grade-ms{border-color:rgba(160,140,255,.4);background:rgba(160,140,255,.14);color:#d2c7ff}
.status.state-pending{border-color:rgba(232,200,106,.38);background:rgba(232,200,106,.12);color:var(--gold-soft)}.status.state-progress{border-color:rgba(90,169,255,.38);background:rgba(90,169,255,.13);color:#a9d2ff}.status.state-done{border-color:rgba(98,230,187,.38);background:rgba(98,230,187,.13);color:var(--green)}.status.neutral{border-color:rgba(255,255,255,.18);background:rgba(255,255,255,.08);color:rgba(245,247,251,.6)}.button.inline{height:auto;min-height:38px;padding:8px 12px;border-radius:11px;font-size:12px;white-space:nowrap}.button.registered{border:1px solid rgba(98,230,187,.35);background:rgba(98,230,187,.12);color:var(--green);box-shadow:none}.status-select{width:100%;min-width:145px;min-height:38px;padding:8px 10px;border:1px solid rgba(255,255,255,.22);border-radius:10px;background:#10274a;color:var(--ink);font:inherit;font-size:12px}.status-select:focus-visible{outline:2px solid var(--gold);outline-offset:2px}.table-actions{display:flex;align-items:center;gap:10px}.table-actions .button{width:auto;margin:0}
.workspace-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:22px}.mini{padding:20px;border:1px solid var(--stroke);border-radius:17px;background:rgba(3,15,35,.32)}.mini h3{font-size:16px}.mini p{margin-top:7px;color:var(--muted);font-size:13px;line-height:1.55}.upload{grid-column:1/-1;padding:30px 20px;border:1px dashed rgba(232,200,106,.55);border-radius:17px;text-align:center;background:rgba(232,200,106,.055)}.upload strong{display:block;font-size:17px}.upload span{display:block;margin:7px auto 16px;color:var(--muted);font-size:13px}.disabled{opacity:.48;cursor:not-allowed}.logout{margin-top:18px;text-align:right}.footer{padding:17px;color:rgba(245,247,251,.45);font-size:12px;text-align:center}
@media(max-width:620px){.topbar{padding:11px 13px}.crest{width:40px;height:40px;font-size:13px}.brand{font-size:15px}.back{font-size:11px}.main{padding:34px 13px}.hero h1{font-size:33px}.panel{margin-top:25px;padding:21px 16px;border-radius:20px}.panel-head{align-items:flex-start}.panel-icon{width:47px;height:47px;flex-basis:47px;border-radius:14px}.form{display:block}.button{width:100%;margin-top:12px}.result-head{display:block}.query-label{display:block;margin-top:5px}.table-wrap{margin-right:-2px}th,td{padding:12px;font-size:12px}.workspace-grid{grid-template-columns:1fr}.upload{grid-column:auto}.logout .button{width:100%}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
@media(max-width:620px){.button.inline{width:auto;margin-top:0}}
table{min-width:860px}.error.success-message{color:var(--green)}.status.state-pending{border-color:rgba(232,200,106,.38);background:rgba(232,200,106,.12);color:var(--gold-soft)}.status.state-progress{border-color:rgba(90,169,255,.38);background:rgba(90,169,255,.13);color:#a9d2ff}.status.state-done{border-color:rgba(98,230,187,.38);background:rgba(98,230,187,.13);color:var(--green)}.status.neutral{border-color:rgba(255,255,255,.18);background:rgba(255,255,255,.08);color:rgba(245,247,251,.6)}.button.inline{height:auto;min-height:38px;padding:8px 12px;border-radius:11px;font-size:12px;white-space:nowrap}.button.registered{border:1px solid rgba(98,230,187,.35);background:rgba(98,230,187,.12);color:var(--green);box-shadow:none}.status-select{width:100%;min-width:145px;min-height:38px;padding:8px 10px;border:1px solid rgba(255,255,255,.22);border-radius:10px;background:#10274a;color:var(--ink);font:inherit;font-size:12px}.status-select:focus-visible{outline:2px solid var(--gold);outline-offset:2px}.table-actions{display:flex;align-items:center;gap:10px}.table-actions .button{width:auto;margin:0}
.status.grade-fail{border-color:rgba(251,113,133,.3);background:rgba(251,113,133,.08);color:#ffc0ca}.file-label{display:block;margin:12px auto 7px;color:var(--gold-soft);font-size:13px;font-weight:800}.upload input[type=file]{display:block;max-width:100%;margin:0 auto 14px;color:var(--muted);font:inherit;font-size:12px}.upload input[type=file]::file-selector-button{margin-right:10px;padding:8px 11px;border:1px solid var(--stroke);border-radius:9px;background:rgba(255,255,255,.1);color:var(--ink);font:inherit;cursor:pointer}.button:disabled{opacity:.58;cursor:not-allowed;filter:none}
.admin-nav{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}
.admin-nav a{padding:8px 13px;border:1px solid var(--stroke);border-radius:999px;background:rgba(255,255,255,.08);color:#fff;font-size:13px;font-weight:750;text-decoration:none}
.admin-nav a:hover,.admin-nav a:focus-visible{border-color:var(--gold);color:var(--gold-soft);outline:none}
.form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin-top:16px;align-items:end}
.form-grid .button{width:100%;margin:0}
.field select{width:100%;height:52px;padding:0 12px;border:1px solid rgba(255,255,255,.26);border-radius:14px;background:#10274a;color:#fff;font:inherit}
.field select:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.section-hint{margin-top:6px;color:var(--muted);font-size:13px;line-height:1.6}
.button.danger{background:rgba(251,113,133,.14);color:#ffb3bf;border:1px solid rgba(251,113,133,.4);box-shadow:none}
.row-actions{display:flex;gap:8px;flex-wrap:wrap}
.muted-cell{color:var(--muted)!important}
.results.anchor{scroll-margin-top:16px}
.room-level{display:flex;flex-wrap:wrap;align-items:center;gap:7px;padding:6px 0;border-top:1px solid rgba(255,255,255,.08)}
.room-level:first-child{border-top:0}
.room-level-title{min-width:42px;color:#fff;font-size:13px;font-weight:800}
.room-chip{min-width:46px;min-height:36px;padding:6px 10px;border:1px solid rgba(255,255,255,.24);border-radius:10px;background:rgba(255,255,255,.06);color:#fff;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
.room-chip[aria-pressed="true"]{border-color:var(--gold);background:linear-gradient(145deg,var(--gold-soft),var(--gold));color:#342704}
.room-chip.whole{color:var(--gold-soft);border-style:dashed}
.room-chip:disabled{opacity:.35;cursor:not-allowed;text-decoration:line-through}
.room-chip:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.room-trigger{width:100%;height:52px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 14px 0 16px;border:1px solid rgba(255,255,255,.26);border-radius:14px;background:rgba(3,15,35,.6);color:#fff;font:inherit;text-align:left;cursor:pointer}
.room-trigger span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.room-trigger-action{flex:0 0 auto;padding:4px 9px;border-radius:8px;background:rgba(232,200,106,.15);color:var(--gold-soft);font-size:12px;font-weight:800}
.room-trigger:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.room-dialog{width:min(560px,calc(100vw - 32px));max-height:calc(100vh - 48px);margin:auto;padding:0;border:1px solid var(--stroke);border-radius:20px;background:#10264a;color:var(--ink);box-shadow:0 24px 70px rgba(0,0,0,.55)}
.room-dialog::backdrop{background:rgba(3,10,25,.7)}
.room-dialog[open]{display:flex;flex-direction:column}
.room-dialog-head{padding:20px 20px 8px}
.room-dialog-head h3{font-size:18px}
.room-dialog-head .section-hint{margin-top:4px}
.room-dialog-body{padding:4px 20px 8px;overflow-y:auto}
.room-dialog-actions{display:flex;justify-content:flex-end;gap:10px;padding:14px 20px 18px;border-top:1px solid rgba(255,255,255,.1)}
.room-dialog-actions .button{width:auto;height:44px;margin:0}
.icon-button{display:inline-grid;place-items:center;width:38px;height:38px;padding:0;border:1px solid var(--stroke);border-radius:11px;background:rgba(255,255,255,.1);color:var(--gold-soft);cursor:pointer}.icon-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.icon-button:hover{background:rgba(255,255,255,.18)}.icon-button:focus-visible{outline:2px solid var(--gold);outline-offset:2px}.icon-button.danger{color:#ffb3bf;border-color:rgba(251,113,133,.4);background:rgba(251,113,133,.12)}.icon-button.danger:hover{background:rgba(251,113,133,.22)}.row-actions{flex-wrap:nowrap}
.edit-form{display:flex;flex-direction:column;min-height:0}.edit-fields{display:grid;gap:14px;padding-top:12px}.edit-fields .field input[readonly]{background:rgba(255,255,255,.06);color:rgba(245,247,251,.7)}.edit-fields .error{margin-top:0}
.remedial-view[hidden],.settings[hidden]{display:none}
.course-form{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}
.list-toolbar{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:12px}.list-toolbar select,.list-toolbar input{height:44px;padding:0 12px;border:1px solid rgba(255,255,255,.26);border-radius:12px;background:#10274a;color:#fff;font:inherit;font-size:14px}.list-toolbar input{flex:1;min-width:180px;background:rgba(3,15,35,.6)}.list-toolbar select:focus-visible,.list-toolbar input:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.course-table{min-width:720px}.course-row{cursor:pointer}.course-row:hover td,.course-row:focus-visible td{background:rgba(232,200,106,.07)}.course-row:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}.strong-cell{font-weight:800;white-space:nowrap}
.count-pill{display:inline-block;padding:4px 9px;border-radius:999px;background:rgba(255,255,255,.08);color:var(--muted);font-size:12px;font-weight:750;white-space:nowrap}.count-pill.warn{background:rgba(251,113,133,.14);color:#ffc0ca}
.go-arrow{display:inline-grid;place-items:center;width:28px;height:38px;color:var(--muted)}.go-arrow svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}.row-actions{align-items:center}
.back-link{display:inline-flex;align-items:center;gap:6px;padding:8px 12px 8px 8px;border:1px solid var(--stroke);border-radius:999px;background:rgba(255,255,255,.08);color:#fff;font:inherit;font-size:13px;font-weight:750;cursor:pointer}.back-link svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.back-link:hover,.back-link:focus-visible{border-color:var(--gold);color:var(--gold-soft);outline:none}
.course-head{margin-top:18px}.course-head h2{font-size:clamp(21px,3.4vw,27px);line-height:1.3}
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(95px,1fr));gap:10px;margin-top:16px}.stat{padding:12px 14px;border:1px solid var(--stroke);border-radius:14px;background:rgba(3,15,35,.32)}.stat strong{display:block;font-size:24px;line-height:1.1}.stat span{color:var(--muted);font-size:12.5px;font-weight:700}.stat.warn strong{color:#ffb3bf}.stat.ok strong{color:var(--green)}
.student-form{grid-template-columns:minmax(220px,2fr) minmax(140px,1fr) auto}.student-form .button{width:auto;padding:0 22px}
@media(max-width:620px){.student-form{grid-template-columns:1fr}.student-form .button{width:100%}}
.filter-chips{display:flex;gap:6px;flex-wrap:wrap}.filter-chip{padding:7px 12px;border:1px solid var(--stroke);border-radius:999px;background:rgba(255,255,255,.06);color:#fff;font:inherit;font-size:12.5px;font-weight:750;cursor:pointer}.filter-chip[aria-pressed="true"]{border-color:var(--gold);background:rgba(232,200,106,.16);color:var(--gold-soft)}.filter-chip:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.cell-note{display:block;margin-top:4px;color:var(--muted);font-size:11px}
.dialog-label{margin:12px 0 8px;color:var(--gold-soft);font-size:13px;font-weight:800}.grade-choices{display:grid;grid-template-columns:repeat(6,1fr);gap:8px}.grade-chip{min-height:44px;border:1px solid rgba(255,255,255,.24);border-radius:12px;background:rgba(255,255,255,.06);color:#fff;font:inherit;font-size:16px;font-weight:800;cursor:pointer}.grade-chip.fail{color:#ffc0ca}.grade-chip.pass{color:#b9f5df}.grade-chip[aria-pressed="true"]{border-color:var(--gold);background:linear-gradient(145deg,var(--gold-soft),var(--gold));color:#342704}.grade-chip:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.history-list{list-style:none;display:grid;gap:6px;color:var(--muted);font-size:13px}.history-list li{padding:8px 10px;border-radius:10px;background:rgba(255,255,255,.05)}
.settings{display:grid;gap:10px;margin-top:30px;padding-top:20px;border-top:1px solid rgba(255,255,255,.12)}.settings-item{padding:14px 16px;border:1px solid var(--stroke);border-radius:16px;background:rgba(3,15,35,.28)}.settings-item summary{cursor:pointer;font-weight:800}.settings-item[open] summary{margin-bottom:10px}.summary-note{color:var(--muted);font-size:13px;font-weight:600}
.teacher-greeting{color:var(--gold-soft);font-weight:800}
.demo-banner:not([hidden]){display:flex;flex-wrap:wrap;align-items:center;gap:10px}.demo-banner span{flex:1;min-width:220px}.demo-banner .button{margin:0}
.course-table .term-row td{padding:14px 12px 8px;color:var(--gold-soft);font-size:13px;font-weight:850;letter-spacing:.3px;background:rgba(232,200,106,.08);border-top:1px solid rgba(232,200,106,.3)}
