@font-face{font-family:systemThai;src:local('TH Sarabun New'),local('Noto Sans Thai')}*{box-sizing:border-box}body{margin:0;font-family:systemThai,'Noto Sans Thai',Tahoma,sans-serif;background:#f3f7fb;color:#16324f;font-size:18px}.topbar{min-height:76px;background:linear-gradient(90deg,#123b63,#176b87);color:white;display:flex;align-items:center;justify-content:space-between;padding:12px 22px;gap:14px;box-shadow:0 2px 16px rgba(0,0,0,.18)}.brand{display:flex;align-items:center;gap:14px}.brand strong{display:block;font-size:26px;line-height:1.1}.brand span{display:block;font-size:17px;opacity:.9}.logo{width:54px;height:54px;border-radius:16px;background:#ffe78a;color:#123b63;display:grid;place-items:center;font-weight:800}.userbox a{color:#fff;background:#d94343;padding:8px 12px;border-radius:10px;text-decoration:none;margin-left:10px}.layout{display:flex;min-height:calc(100vh - 76px)}.sidebar{width:250px;background:#fff;border-right:1px solid #dce7f2;padding:14px;position:sticky;top:0;height:calc(100vh - 76px);overflow:auto}.sidebar a{display:block;padding:13px 14px;margin-bottom:8px;border-radius:13px;color:#123b63;text-decoration:none;background:#f4f8fc}.sidebar a:hover{background:#dff1ff}.content{flex:1;padding:22px;overflow:auto}.card{background:#fff;border:1px solid #dce7f2;border-radius:18px;padding:18px;margin-bottom:16px;box-shadow:0 4px 18px rgba(19,56,88,.07)}h1,h2,h3{margin:0 0 14px}.grid{display:grid;gap:14px}.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}.stat{border-radius:20px;padding:20px;color:white;background:linear-gradient(135deg,#176b87,#64ccc5);min-height:116px}.stat:nth-child(2){background:linear-gradient(135deg,#1f8a70,#bed754)}.stat:nth-child(3){background:linear-gradient(135deg,#b31312,#ea906c)}.stat:nth-child(4){background:linear-gradient(135deg,#533483,#a459d1)}.stat b{font-size:42px;display:block;line-height:1}.stat span{font-size:19px}.form-row{display:grid;grid-template-columns:180px 1fr;gap:10px;align-items:center;margin-bottom:12px}input,select,textarea{width:100%;padding:11px 12px;border:1px solid #c7d6e5;border-radius:12px;font:inherit;background:#fff}button,.btn{border:0;border-radius:12px;padding:11px 16px;background:#176b87;color:white;font:inherit;text-decoration:none;display:inline-flex;gap:8px;align-items:center;cursor:pointer}.btn.secondary,button.secondary{background:#617487}.btn.danger,button.danger{background:#c0392b}.btn.good,button.good{background:#1f8a70}.actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.table-wrap{overflow:auto;border-radius:16px;border:1px solid #dce7f2}table{width:100%;border-collapse:collapse;background:#fff}th,td{padding:11px 12px;border-bottom:1px solid #e8eef5;text-align:left;white-space:nowrap}th{background:#eaf4fb;color:#123b63}.badge{display:inline-block;border-radius:99px;padding:4px 10px;background:#eaf4fb;color:#176b87;font-weight:700}.badge.good{background:#d9f7e9;color:#0b6f45}.badge.warn{background:#fff2cc;color:#9a6700}.badge.danger{background:#ffd9d9;color:#9b1c1c}.alert{padding:12px 14px;border-radius:12px;margin-bottom:14px}.alert-success{background:#d9f7e9;color:#0b6f45}.alert-error{background:#ffd9d9;color:#9b1c1c}.camera-box{display:grid;grid-template-columns:minmax(300px,640px) 1fr;gap:18px}.video-wrap{position:relative;background:#111;border-radius:18px;overflow:hidden;aspect-ratio:4/3}video,canvas.overlay{width:100%;height:100%;object-fit:cover}.overlay{position:absolute;inset:0}.instruction{font-size:28px;font-weight:800;color:#176b87;margin:10px 0}.progress{height:14px;background:#e6edf5;border-radius:999px;overflow:hidden}.progress>div{height:100%;background:#1f8a70;width:0}.student-card{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #e1eaf2;border-radius:14px;padding:12px;margin-bottom:10px;background:#fff}.login-page{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#123b63,#64ccc5)}.login-box{width:min(450px,92vw);background:#fff;border-radius:24px;padding:28px;box-shadow:0 20px 60px rgba(0,0,0,.22)}.hint{font-size:16px;color:#65798b}.manual-list{max-height:65vh;overflow:auto}.attendance-row{display:grid;grid-template-columns:90px 1fr 120px 120px;gap:8px;align-items:center;padding:8px;border-bottom:1px solid #edf2f7}.attendance-row.header{font-weight:800;background:#eaf4fb;border-radius:12px}.status-radio{display:flex;gap:6px;justify-content:flex-end}.status-radio button{padding:7px 10px;background:#dde8f2;color:#123b63}.status-radio button.active{background:#1f8a70;color:#fff}.status-radio button.absent.active{background:#c0392b}@media(max-width:900px){.layout{display:block}.sidebar{width:100%;height:auto;position:static;display:flex;overflow-x:auto;gap:8px}.sidebar a{white-space:nowrap}.topbar{display:block}.userbox{margin-top:8px}.grid-2,.grid-3,.grid-4,.camera-box{grid-template-columns:1fr}.form-row{grid-template-columns:1fr}.content{padding:14px}.attendance-row{grid-template-columns:60px 1fr}.attendance-row.header{display:none}.status-radio{grid-column:1/-1;justify-content:flex-start}}
.codebox{background:#0f172a;color:#e2e8f0;border-radius:14px;padding:14px;overflow:auto;font-family:Consolas,monospace;font-size:15px}.settings-form .form-row label{font-weight:800}
.checklist{display:flex;flex-direction:column;gap:8px;padding:8px 0}.checklist label{font-weight:400}.codebox{white-space:pre-wrap;word-break:break-word;background:#0f172a;color:#e5e7eb;border-radius:12px;padding:14px;overflow:auto}
.mode-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 10px}.mode-tabs .active{outline:3px solid rgba(31,138,112,.24);box-shadow:0 0 0 2px rgba(31,138,112,.12) inset}.mode-tabs .btn{font-weight:800}#fastHint{background:#fff8db;border:1px solid #ffe08a;border-radius:12px;padding:10px 12px;color:#6b5100}
