:root{
    --sc-blue:#0877d8;
    --sc-blue-dark:#0757ad;
    --sc-sky:#eaf6ff;
    --sc-gold:#ffbd17;
    --sc-bg:#f5f8fc;
    --sc-text:#1f2d3d;
    --sc-muted:#6b7b8e;
    --sc-border:#e6edf5;
    --sc-shadow:0 12px 30px rgba(35,77,120,.08);
}
*{box-sizing:border-box}
body{margin:0;font-family:'Sarabun',sans-serif;background:var(--sc-bg);color:var(--sc-text)}
.app-shell{min-height:100vh;display:flex}
.sidebar{width:280px;position:fixed;inset:0 auto 0 0;background:linear-gradient(180deg,#0b7cdc 0%,#065cac 68%,#064d91 100%);color:#fff;padding:20px 16px;z-index:1050;display:flex;flex-direction:column;box-shadow:8px 0 30px rgba(5,64,120,.12)}
.brand-box{display:flex;align-items:center;gap:12px;color:#fff;padding:5px 7px 18px;border-bottom:1px solid rgba(255,255,255,.18)}
.brand-box:hover{color:#fff}
.brand-box img{width:60px;height:60px;object-fit:contain;background:#fff;border-radius:16px;padding:5px;box-shadow:0 8px 20px rgba(0,0,0,.13)}
.brand-name{font-size:1.55rem;font-weight:700;line-height:1}.brand-school{font-size:.78rem;opacity:.85;margin-top:7px;white-space:nowrap}
.sidebar-label{font-size:.74rem;text-transform:uppercase;letter-spacing:.08em;opacity:.7;padding:22px 12px 8px}
.sidebar .nav-link{color:rgba(255,255,255,.88);border-radius:13px;padding:11px 13px;display:flex;align-items:center;gap:11px;font-weight:500;transition:.2s}
.sidebar .nav-link i{width:23px;font-size:1.05rem}.sidebar .nav-link:hover,.sidebar .nav-link.active{color:#fff;background:rgba(255,255,255,.15);transform:translateX(2px)}
.sidebar .nav-link.active{box-shadow:inset 3px 0 0 var(--sc-gold)}
.sidebar-bottom{margin-top:auto;padding:16px;background:rgba(0,0,0,.10);border:1px solid rgba(255,255,255,.12);border-radius:16px}
.main-content{margin-left:280px;min-height:100vh;width:calc(100% - 280px);display:flex;flex-direction:column}
.topbar{height:82px;background:rgba(255,255,255,.92);backdrop-filter:blur(8px);display:flex;align-items:center;gap:15px;padding:0 30px;border-bottom:1px solid var(--sc-border);position:sticky;top:0;z-index:1000}
.topbar-title{font-weight:700;font-size:1.2rem}.topbar-subtitle{font-size:.82rem;color:var(--sc-muted)}
.content-area{padding:30px;flex:1}.footer{text-align:center;color:#8a98a8;font-size:.85rem;padding:16px 20px 24px}
.hero-card{background:linear-gradient(135deg,#0b7cdc,#1fa6f5);color:#fff;border-radius:24px;padding:28px;position:relative;overflow:hidden;box-shadow:0 18px 40px rgba(7,119,216,.22)}
.hero-card:after{content:'';position:absolute;width:260px;height:260px;border-radius:50%;background:rgba(255,255,255,.09);right:-85px;top:-105px}.hero-card:before{content:'';position:absolute;width:130px;height:130px;border-radius:50%;background:rgba(255,189,23,.18);right:120px;bottom:-65px}
.hero-card>*{position:relative;z-index:2}.hero-logo{width:82px;height:82px;object-fit:contain;background:#fff;border-radius:20px;padding:7px;box-shadow:0 12px 30px rgba(0,0,0,.15)}
.stat-card,.panel-card{background:#fff;border:1px solid var(--sc-border);border-radius:20px;box-shadow:var(--sc-shadow)}
.stat-card{padding:20px;height:100%}.stat-icon{width:48px;height:48px;border-radius:15px;display:grid;place-items:center;background:var(--sc-sky);color:var(--sc-blue);font-size:1.25rem}.stat-number{font-size:1.8rem;font-weight:700;line-height:1.1}.stat-label{color:var(--sc-muted);font-size:.9rem}
.panel-card{padding:22px}.section-title{font-size:1.05rem;font-weight:700;margin:0}.section-subtitle{font-size:.85rem;color:var(--sc-muted)}
.table{--bs-table-bg:transparent}.table thead th{font-size:.82rem;color:#657489;font-weight:600;border-bottom-color:#e9eef5}.table td{vertical-align:middle;border-bottom-color:#eff3f8}
.btn-primary{--bs-btn-bg:var(--sc-blue);--bs-btn-border-color:var(--sc-blue);--bs-btn-hover-bg:var(--sc-blue-dark);--bs-btn-hover-border-color:var(--sc-blue-dark);border-radius:11px}.btn-warning{border-radius:11px}.form-control,.form-select{border-radius:11px;border-color:#dce5ef;min-height:42px}.form-control:focus,.form-select:focus{border-color:#72bff4;box-shadow:0 0 0 .2rem rgba(8,119,216,.12)}
.badge-soft-blue{background:#eaf6ff;color:#0b70c4}.badge-soft-green{background:#e9f9ef;color:#138a45}.badge-soft-gold{background:#fff5d8;color:#9a6a00}
.login-page{min-height:100vh;background:radial-gradient(circle at top left,#e5f5ff 0,#f7fbff 38%,#eef4ff 100%);display:flex;align-items:center;justify-content:center;padding:24px}.login-wrap{width:min(1050px,100%);display:grid;grid-template-columns:1.1fr .9fr;background:#fff;border:1px solid #eaf0f6;border-radius:30px;overflow:hidden;box-shadow:0 26px 70px rgba(29,74,121,.14)}
.login-brand{padding:46px;background:linear-gradient(160deg,#eff8ff,#fffaf0);display:flex;align-items:center;justify-content:center;position:relative}.login-brand img{width:min(520px,100%);height:auto;object-fit:contain}.login-panel{padding:54px 48px;display:flex;flex-direction:column;justify-content:center}.login-mini-logo{width:76px;height:76px;object-fit:contain;margin-bottom:14px}.login-title{font-size:2rem;font-weight:700;color:#075fae}.login-sub{color:#718096;margin-bottom:28px}.input-group-text{border-radius:11px 0 0 11px;background:#f7f9fc;border-color:#dce5ef}.login-panel .form-control{border-radius:0 11px 11px 0}
.empty-state{text-align:center;padding:45px 20px;color:#8291a3}.empty-state i{font-size:3rem;color:#b9dffc;display:block;margin-bottom:12px}
.sidebar-backdrop{display:none}
@media(max-width:991.98px){.sidebar{transform:translateX(-100%);transition:.25s}.sidebar.show{transform:translateX(0)}.main-content{margin-left:0;width:100%}.sidebar-backdrop.show{display:block;position:fixed;inset:0;background:rgba(14,35,57,.42);z-index:1040}.topbar{padding:0 18px}.content-area{padding:20px}}
@media(max-width:767.98px){.login-wrap{grid-template-columns:1fr}.login-brand{padding:24px}.login-brand img{max-height:260px}.login-panel{padding:32px 24px}.hero-card{padding:22px}.content-area{padding:16px}.topbar-subtitle{display:none}}

/* SmartClass v0.2 classroom module */
.page-heading{font-size:1.55rem;font-weight:700;color:#16324b}
.class-card{background:#fff;border:1px solid var(--sc-border);border-radius:22px;overflow:hidden;box-shadow:var(--sc-shadow);transition:.2s ease}
.class-card:hover{transform:translateY(-3px);box-shadow:0 18px 36px rgba(35,77,120,.13)}
.class-card-cover{padding:20px;color:#fff;min-height:155px;position:relative;overflow:hidden}
.class-card-cover:after{content:'';position:absolute;width:130px;height:130px;border:25px solid rgba(255,255,255,.12);border-radius:50%;right:-35px;bottom:-48px}
.cover-1{background:linear-gradient(135deg,#0877d8,#27a7f7)}
.cover-2{background:linear-gradient(135deg,#5c60d6,#8d6ee8)}
.cover-3{background:linear-gradient(135deg,#098a83,#20b5a8)}
.cover-4{background:linear-gradient(135deg,#e28b12,#f5b51b)}
.cover-5{background:linear-gradient(135deg,#d85d73,#ef8698)}
.class-subject-badge{display:inline-flex;align-items:center;background:rgba(255,255,255,.9);color:#1267ad;border-radius:999px;padding:5px 10px;font-size:.78rem;font-weight:700;box-shadow:0 4px 12px rgba(0,0,0,.08)}
.mini-stat{display:inline-flex;align-items:center;gap:5px;background:#f6f9fc;border:1px solid #e6edf5;padding:5px 9px;border-radius:999px;color:#617084;font-size:.78rem}
.join-code-box{display:flex;align-items:center;justify-content:space-between;gap:12px;background:#f4f9fd;border:1px dashed #9fd2f5;border-radius:14px;padding:10px 12px}
.join-code-box small{display:block;color:#718096;font-size:.72rem}.join-code-box strong{display:block;color:#075fae;letter-spacing:.05em}
.classroom-hero{background:linear-gradient(135deg,#075fac,#1598ea);color:#fff;border-radius:26px;padding:30px;box-shadow:0 18px 42px rgba(7,95,172,.2);position:relative;overflow:hidden}
.classroom-hero:before{content:'';position:absolute;width:300px;height:300px;border-radius:50%;background:rgba(255,255,255,.08);right:-100px;top:-170px}.classroom-hero>*{position:relative;z-index:2}
.student-hero{background:linear-gradient(135deg,#0877d8,#22a7f4)}
.class-code-large{background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.25);padding:14px 16px;border-radius:18px;min-width:185px;backdrop-filter:blur(4px)}
.class-code-large small,.class-code-large span{display:block;opacity:.8;font-size:.76rem}.class-code-large strong{font-size:1.35rem;letter-spacing:.06em;display:block}
.classroom-tabs{background:#fff;border:1px solid var(--sc-border);border-radius:16px;padding:7px;box-shadow:var(--sc-shadow);gap:5px}
.classroom-tabs .nav-link{border-radius:11px;color:#617084;font-weight:600;padding:10px 15px}.classroom-tabs .nav-link.active{background:#eaf6ff;color:#0877d8}
.stream-card{background:#fff;border:1px solid var(--sc-border);border-radius:20px;padding:20px;box-shadow:var(--sc-shadow)}
.avatar-circle{width:45px;height:45px;min-width:45px;border-radius:50%;display:grid;place-items:center;background:#eaf6ff;color:#0877d8;font-size:1.1rem}
.stream-text{line-height:1.75;color:#3d4d5f;white-space:normal;overflow-wrap:anywhere}
.attachment-chip{display:flex;align-items:center;gap:8px;text-decoration:none;color:#276a9f;background:#f5faff;border:1px solid #d9ecfb;border-radius:13px;padding:10px 12px;max-width:100%}.attachment-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.material-card{display:flex;align-items:flex-start;gap:15px;background:#fff;border:1px solid var(--sc-border);border-radius:18px;padding:18px;box-shadow:var(--sc-shadow)}
.material-icon{width:52px;height:52px;min-width:52px;border-radius:16px;display:grid;place-items:center;background:#eaf6ff;color:#0877d8;font-size:1.35rem}
.student-material-card{display:flex;flex-direction:column;background:#fff;border:1px solid var(--sc-border);border-radius:20px;padding:20px;box-shadow:var(--sc-shadow)}
.student-search-list{display:flex;flex-direction:column;gap:8px;max-height:430px;overflow:auto}.student-search-item{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 12px;border:1px solid #edf1f6;border-radius:13px;background:#fbfdff}
.join-class-logo{width:100px;height:100px;object-fit:contain}.class-code-input{letter-spacing:.08em}
.joined-class-link{display:flex;align-items:center;justify-content:space-between;gap:14px;text-decoration:none;border:1px solid #e6edf5;border-radius:16px;padding:15px;background:#fbfdff;transition:.18s}.joined-class-link:hover{background:#f1f8ff;border-color:#cce6f8;transform:translateY(-1px)}
.dashboard-class-card{display:block;border:1px solid #e6edf5;border-radius:18px;padding:17px;height:100%;background:#fbfdff;transition:.18s}.dashboard-class-card:hover{background:#fff;border-color:#bddff6;box-shadow:0 10px 25px rgba(35,77,120,.09);transform:translateY(-2px)}
.latest-list{display:flex;flex-direction:column}.latest-item{display:flex;align-items:center;gap:11px;text-decoration:none;padding:11px 0;border-bottom:1px solid #eff3f8}.latest-item:last-child{border-bottom:0}.latest-icon{width:38px;height:38px;min-width:38px;border-radius:12px;display:grid;place-items:center;background:#eaf6ff;color:#0877d8}.latest-item:hover .fw-semibold{color:#0877d8!important}
.min-w-0{min-width:0}
.copy-btn.copied{background:#e9f9ef!important;color:#138a45!important;border-color:#c8eed6!important}
@media(max-width:767.98px){.classroom-hero{padding:22px}.classroom-tabs{overflow:auto;flex-wrap:nowrap}.classroom-tabs .nav-link{white-space:nowrap}.material-card{padding:15px}.class-code-large{min-width:0}}

/* SmartClass v0.3 */
.stat-value{font-size:1.8rem;font-weight:700;line-height:1.1}
.gradebook-table th{white-space:nowrap;background:#f8fbff}
.gradebook-table .sticky-col{position:sticky;left:0;z-index:2;background:#fff;min-width:190px}
.gradebook-table thead .sticky-col{z-index:3;background:#f8fbff}
.accordion-button:not(.collapsed){background:#f1f8ff;color:var(--sc-blue)}
.accordion-button:focus{box-shadow:none}
@media(max-width:767.98px){
  .classroom-tabs{overflow-x:auto;flex-wrap:nowrap;padding-bottom:4px}
  .classroom-tabs .nav-link{white-space:nowrap}
  .gradebook-table .sticky-col{min-width:160px}
}

/* SmartClass v0.4 - Lessons & CBT */
.lesson-card,.student-lesson-card{display:flex;align-items:flex-start;gap:16px;background:#fff;border:1px solid var(--sc-border);border-radius:20px;padding:20px;box-shadow:var(--sc-shadow);transition:.18s}
.student-lesson-card{align-items:center;height:100%}.student-lesson-card:hover{transform:translateY(-2px);border-color:#b9def8;box-shadow:0 14px 30px rgba(35,77,120,.12)}
.lesson-number{width:48px;height:48px;min-width:48px;border-radius:15px;display:grid;place-items:center;background:linear-gradient(135deg,#0877d8,#21a6f4);color:#fff;font-size:1.2rem;font-weight:700;box-shadow:0 8px 18px rgba(8,119,216,.2)}
.lesson-chip{display:inline-flex;align-items:center;gap:5px;background:#f5f9fd;border:1px solid #e4edf6;border-radius:999px;padding:5px 9px;color:#617084;font-size:.78rem}
.lesson-hero{background:linear-gradient(135deg,#075fac,#188fdc);border-radius:26px;padding:30px;color:#fff;box-shadow:0 18px 42px rgba(7,95,172,.19);position:relative;overflow:hidden}.lesson-hero:after{content:'';position:absolute;width:280px;height:280px;border:42px solid rgba(255,255,255,.07);border-radius:50%;right:-90px;top:-120px}.lesson-hero>*{position:relative;z-index:2}.student-lesson-hero{background:linear-gradient(135deg,#0877d8,#1f9dec)}
.learning-flow{display:flex;align-items:center;justify-content:center;gap:14px;background:#fff;border:1px solid var(--sc-border);border-radius:18px;padding:14px 18px;box-shadow:var(--sc-shadow)}.flow-step{display:flex;align-items:center;gap:10px}.flow-step>span,.section-index{width:34px;height:34px;border-radius:11px;display:inline-grid;place-items:center;background:#eaf6ff;color:#0877d8;font-weight:700}.flow-step div{display:flex;flex-direction:column}.flow-step small{color:#8391a1;font-size:.72rem}.learning-flow>i{color:#b8c7d5}
.quiz-manage-card,.student-quiz-card{background:#fff;border:1px solid var(--sc-border);border-radius:20px;padding:20px;box-shadow:var(--sc-shadow)}.quiz-mini-stat{background:#f7fafc;border:1px solid #e9eff5;border-radius:13px;padding:9px 4px}.quiz-mini-stat strong,.quiz-mini-stat small{display:block}.quiz-mini-stat strong{font-size:1.05rem;color:#173957}.quiz-mini-stat small{font-size:.69rem;color:#8391a1}.quiz-icon{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;background:linear-gradient(135deg,#e7f5ff,#d9edff);color:#0877d8;font-size:1.55rem}
.question-manage-card{background:#fff;border:1px solid var(--sc-border);border-radius:20px;padding:20px;box-shadow:var(--sc-shadow)}.question-no{width:38px;height:38px;min-width:38px;border-radius:12px;display:grid;place-items:center;background:#0877d8;color:#fff;font-weight:700}.question-text{line-height:1.65}.question-preview-image{max-width:100%;max-height:320px;border-radius:14px;border:1px solid #e6edf5}.choice-preview{display:flex;align-items:flex-start;gap:8px;border:1px solid #e8eef5;border-radius:13px;padding:10px 12px;background:#fbfdff}.choice-preview.correct{background:#ecfbf2;border-color:#bfe9ce;color:#147c41}
.exam-intro-card{background:linear-gradient(135deg,#075fac,#138fdc);color:#fff;border-radius:25px;overflow:hidden;box-shadow:0 20px 45px rgba(7,95,172,.2)}.exam-intro-top{display:flex;align-items:center;gap:18px;padding:26px}.exam-intro-top img{width:74px;height:74px;object-fit:contain;background:#fff;border-radius:18px;padding:7px}.exam-info-grid{display:grid;grid-template-columns:repeat(4,1fr);background:rgba(0,0,0,.08);border-top:1px solid rgba(255,255,255,.15)}.exam-info-grid>div{text-align:center;padding:16px;border-right:1px solid rgba(255,255,255,.12)}.exam-info-grid>div:last-child{border-right:0}.exam-info-grid i,.exam-info-grid strong,.exam-info-grid span{display:block}.exam-info-grid i{font-size:1.15rem;margin-bottom:4px}.exam-info-grid strong{font-size:1.25rem}.exam-info-grid span{font-size:.72rem;opacity:.78}
.result-hero{display:flex;align-items:center;gap:18px;border-radius:25px;padding:28px;color:#fff}.result-hero.passed{background:linear-gradient(135deg,#14884b,#25a862)}.result-hero.failed{background:linear-gradient(135deg,#d05b49,#e27c55)}.result-icon{width:72px;height:72px;border-radius:22px;display:grid;place-items:center;background:rgba(255,255,255,.18);font-size:2rem}.score-circle{width:190px;height:190px;border-radius:50%;margin:auto;display:flex;flex-direction:column;justify-content:center;border:12px solid #eaf0f5;background:#fff}.score-circle.passed{border-color:#ccefd9}.score-circle.failed{border-color:#f5d5d0}.score-circle strong{font-size:2.6rem;line-height:1;color:#173957}.score-circle span{font-size:.8rem;color:#718096;margin-top:8px}.review-question{border:1px solid #e8eef5;border-radius:16px;padding:16px}.review-question.correct{background:#f2fbf5;border-color:#caedd7}.review-question.wrong{background:#fff8f6;border-color:#f1d4cd}

/* CBT full-screen exam */
.cbt-body{margin:0;background:#eef3f8;font-family:'Sarabun',sans-serif;color:#203449;overflow-x:hidden}.cbt-header{position:fixed;top:0;left:0;right:0;height:74px;background:#fff;border-bottom:1px solid #dce5ef;display:flex;align-items:center;padding:0 22px;z-index:1030;box-shadow:0 4px 15px rgba(23,57,87,.06)}.cbt-brand{display:flex;align-items:center;gap:10px}.cbt-brand img{width:52px;height:52px;object-fit:contain}.cbt-brand strong,.cbt-brand small{display:block}.cbt-brand strong{color:#075fac;font-size:1.05rem}.cbt-brand small{color:#718096;max-width:430px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cbt-student{margin-left:auto;color:#5b6c7e;font-size:.86rem}.cbt-timer{margin-left:20px;display:flex;align-items:center;gap:8px;background:#eaf6ff;color:#075fac;border:1px solid #cce8fb;border-radius:13px;padding:9px 14px;font-weight:700;font-size:1.05rem;min-width:105px;justify-content:center}.cbt-timer.warning{background:#fff4da;color:#9a6400;border-color:#f3d486}.cbt-timer.danger{background:#fff0ed;color:#c34434;border-color:#f1c4bd;animation:pulseTimer 1s infinite}@keyframes pulseTimer{50%{transform:scale(1.04)}}
.cbt-layout{display:grid;grid-template-columns:260px minmax(0,1fr);min-height:100vh;padding-top:74px}.cbt-sidebar{position:fixed;top:74px;left:0;bottom:0;width:260px;background:#fff;border-right:1px solid #dce5ef;padding:20px;display:flex;flex-direction:column;overflow-y:auto}.cbt-side-title{font-weight:700;font-size:1.05rem;margin-bottom:10px}.cbt-legend{display:flex;gap:12px;flex-wrap:wrap;font-size:.72rem;color:#718096;margin-bottom:14px}.cbt-legend span{display:flex;align-items:center;gap:5px}.dot{width:10px;height:10px;border-radius:50%;display:inline-block}.dot.answered{background:#1f9d58}.dot.unanswered{background:#dbe3ea}.question-palette{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.palette-btn{aspect-ratio:1;border:1px solid #d9e3ec;border-radius:10px;background:#f5f7fa;color:#617084;font-weight:600;transition:.15s}.palette-btn.answered{background:#e8f8ee;border-color:#bfe8ce;color:#168148}.palette-btn.current{outline:3px solid rgba(8,119,216,.16);border-color:#0877d8;color:#0877d8}.cbt-progress-box{margin-top:18px;padding:13px;border-radius:13px;background:#f7fafc;border:1px solid #e7edf3}.cbt-main{grid-column:2;max-width:1000px;width:100%;padding:30px 34px 110px;margin:0 auto}.cbt-save-status{margin-left:auto;width:max-content;display:flex;align-items:center;gap:6px;font-size:.78rem;color:#6f8295;background:#fff;border:1px solid #dfe7ef;padding:7px 10px;border-radius:999px;margin-bottom:12px}.cbt-save-status.saved{color:#14884b;background:#edf9f1}.cbt-save-status.saving{color:#a56b00;background:#fff8e8}.cbt-save-status.error{color:#bf4134;background:#fff0ed}.cbt-question{display:none;background:#fff;border:1px solid #dde6ee;border-radius:22px;padding:28px;box-shadow:0 10px 25px rgba(30,70,105,.07)}.cbt-question.active{display:block}.question-topline{display:flex;justify-content:space-between;color:#718096;font-size:.82rem;border-bottom:1px solid #edf1f5;padding-bottom:13px;margin-bottom:22px}.cbt-question-text{font-size:1.18rem;font-weight:600;line-height:1.8;color:#1f3549}.cbt-question-image{max-width:100%;max-height:420px;border-radius:15px;border:1px solid #e4ebf2}.cbt-choices{display:grid;gap:12px;margin-top:24px}.cbt-choice{display:flex;align-items:flex-start;gap:12px;border:2px solid #e4eaf0;border-radius:16px;padding:14px 16px;background:#fff;cursor:pointer;transition:.15s}.cbt-choice:hover{border-color:#a8d5f3;background:#f8fcff}.cbt-choice.selected{border-color:#0877d8;background:#eef8ff;box-shadow:0 0 0 3px rgba(8,119,216,.08)}.cbt-choice input{position:absolute;opacity:0;pointer-events:none}.choice-letter{width:34px;height:34px;min-width:34px;border-radius:10px;display:grid;place-items:center;background:#f0f4f7;color:#506477;font-weight:700}.cbt-choice.selected .choice-letter{background:#0877d8;color:#fff}.choice-text{padding-top:5px;line-height:1.6}.choice-check{margin-left:auto;color:#0877d8;font-size:1.2rem;opacity:0;padding-top:4px}.cbt-choice.selected .choice-check{opacity:1}.cbt-nav{position:fixed;bottom:0;left:260px;right:0;height:82px;background:rgba(255,255,255,.96);border-top:1px solid #dce5ef;display:flex;align-items:center;justify-content:center;gap:24px;z-index:1020;backdrop-filter:blur(8px)}.cbt-mobile-toolbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
@media(max-width:991.98px){.learning-flow{justify-content:flex-start;overflow-x:auto}.flow-step{min-width:max-content}.cbt-layout{display:block}.cbt-sidebar{display:none}.cbt-main{padding:20px 16px 126px;max-width:760px}.cbt-nav{left:0;height:96px;gap:8px;padding:25px 10px 9px;justify-content:stretch}.cbt-nav #questionPosition{position:absolute;top:5px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:.72rem}.cbt-nav .btn{flex:1;min-width:0;white-space:nowrap}.cbt-mobile-submit{font-weight:700;box-shadow:0 6px 16px rgba(25,135,84,.22)}.cbt-header{height:68px;padding:0 12px}.cbt-layout{padding-top:68px}.cbt-brand img{width:45px;height:45px}.cbt-brand small{max-width:180px}.cbt-timer{margin-left:auto;min-width:90px;padding:8px 10px}.question-palette{grid-template-columns:repeat(6,1fr)}}
@media(max-width:575.98px){.exam-info-grid{grid-template-columns:repeat(2,1fr)}.exam-info-grid>div:nth-child(2){border-right:0}.lesson-card,.student-lesson-card{padding:15px}.lesson-number{width:42px;height:42px;min-width:42px}.cbt-question{padding:20px 16px}.cbt-question-text{font-size:1.05rem}.cbt-choice{padding:12px}.cbt-nav{gap:6px;padding-left:7px;padding-right:7px}.cbt-nav .btn{font-size:.78rem;padding:.55rem .45rem}.cbt-nav .btn i{margin-left:0!important;margin-right:0!important}.cbt-brand small{display:none}.question-palette{grid-template-columns:repeat(5,1fr)}}

.question-modal-form{min-height:0}.question-modal-form .modal-body{overflow-y:auto}.question-modal-inline-actions{position:sticky;bottom:-1px;background:linear-gradient(180deg,rgba(255,255,255,.94),#fff);padding-top:12px;border-top:1px solid #edf2f7;margin-top:8px}.question-modal-footer{background:#fff;position:sticky;bottom:0;z-index:2;box-shadow:0 -8px 20px rgba(26,55,88,.05)}


/* SmartClass v0.4.2 - CBT anti screen switching */
.anti-cheat-settings{padding:13px;border:1px solid #f2d8d3;background:#fff8f6;border-radius:14px}
.cbt-proctor-badge{margin-left:auto;align-items:center;gap:7px;border:1px solid #f0d4cf;background:#fff4f1;color:#b44333;border-radius:999px;padding:8px 12px;font-size:.78rem;font-weight:700}
.proctor-gate,.proctor-warning{position:fixed;inset:0;z-index:3000;background:rgba(14,28,43,.76);backdrop-filter:blur(7px);display:none;align-items:center;justify-content:center;padding:20px}.proctor-gate.show,.proctor-warning.show{display:flex}.proctor-gate-card,.proctor-warning-card{width:min(520px,100%);background:#fff;border-radius:24px;padding:30px;text-align:center;box-shadow:0 28px 80px rgba(0,0,0,.28)}.proctor-shield,.proctor-warning-icon{width:78px;height:78px;border-radius:24px;display:grid;place-items:center;margin:0 auto 18px;font-size:2rem}.proctor-shield{background:#eaf6ff;color:#0877d8}.proctor-warning-icon{background:#fff0ed;color:#d24635}.proctor-gate-card h3,.proctor-warning-card h3{font-size:1.35rem;font-weight:700}.proctor-gate-card p,.proctor-warning-card p{color:#647487;line-height:1.7}.exam-terminated{pointer-events:none;filter:grayscale(.15)}


/* SmartClass v0.4.3 exam protection */
.proctor-action-toast{position:fixed;top:92px;left:50%;transform:translate(-50%,-16px);z-index:3200;width:min(620px,calc(100% - 28px));background:#fff8e7;border:1px solid #f0d08a;border-radius:15px;padding:12px 16px;box-shadow:0 16px 38px rgba(48,39,16,.18);display:flex;align-items:center;gap:11px;color:#7b5605;opacity:0;visibility:hidden;transition:.2s ease;pointer-events:none}.proctor-action-toast.show{opacity:1;visibility:visible;transform:translate(-50%,0)}.proctor-action-toast i{font-size:1.25rem;color:#c17b00}.proctor-action-toast strong{display:block;font-size:.9rem}.proctor-action-toast span{display:block;font-size:.76rem;color:#8b6c29}.cbt-body.protected-exam img{-webkit-user-drag:none}.proctor-log-badges{display:flex;gap:5px;flex-wrap:wrap;justify-content:center}
@media(max-width:575.98px){.proctor-action-toast{top:78px}.proctor-action-toast span{font-size:.7rem}}


@media print{
 body.cbt-body{background:#fff!important}
 body.cbt-body *{visibility:hidden!important}
 body.cbt-body::before{content:'ไม่อนุญาตให้พิมพ์หรือบันทึกหน้าข้อสอบระหว่างการสอบ';visibility:visible!important;display:block!important;position:fixed;inset:0;padding:80px 30px;text-align:center;font-family:'Sarabun',sans-serif;font-size:24px;font-weight:700;color:#b42318;background:#fff;z-index:99999}
}

/* SmartClass v0.5 AI quiz generator */
.ai-source-panel{position:sticky;top:100px}.ai-source-text{line-height:1.65;resize:vertical}.ai-question-card{border-left:4px solid #8ecdf5}.sticky-save-bar{position:sticky;bottom:12px;z-index:20;background:rgba(255,255,255,.96);backdrop-filter:blur(8px);border:1px solid var(--sc-border);border-radius:16px;padding:13px 15px;box-shadow:0 14px 30px rgba(25,66,105,.14);display:flex;align-items:center;justify-content:space-between;gap:15px}.btn-warning{--bs-btn-color:#5f4300;--bs-btn-bg:#ffc83d;--bs-btn-border-color:#ffc83d;--bs-btn-hover-bg:#f2b91e;--bs-btn-hover-border-color:#f2b91e}@media(max-width:1199.98px){.ai-source-panel{position:static}}@media(max-width:575.98px){.sticky-save-bar{align-items:stretch;flex-direction:column}.sticky-save-bar .btn{width:100%}}

/* SmartClass v0.6 - AI Lesson Studio */
.ai-studio-card{background:linear-gradient(180deg,#fff,#fbfdff)}
.ai-studio-icon{width:58px;height:58px;min-width:58px;border-radius:18px;display:grid;place-items:center;background:linear-gradient(135deg,#e9f6ff,#fff2c9);color:#0877d8;font-size:1.55rem;box-shadow:0 8px 20px rgba(8,119,216,.1)}
.ai-history-item{display:block;text-decoration:none;color:inherit;border:1px solid #e7edf4;border-radius:13px;padding:10px 12px;background:#fbfdff;transition:.15s}.ai-history-item:hover{border-color:#acd9f5;background:#f5fbff;transform:translateY(-1px)}
.ai-preview-tabs{background:#fff;border:1px solid var(--sc-border);border-radius:15px;padding:6px;display:flex;gap:5px;box-shadow:var(--sc-shadow)}.ai-preview-tabs .nav-link{border-radius:10px;color:#5e7184;font-weight:600}.ai-preview-tabs .nav-link.active{background:#eaf6ff;color:#0877d8}
.ai-question-card{border:1px solid #e4ebf2;border-radius:18px;padding:17px;background:#fbfdff}.ai-question-card:hover{border-color:#c8dfef}
.ai-large-textarea{line-height:1.75}.ai-save-panel{border:1px solid #bfe1f7;background:linear-gradient(180deg,#fff,#f7fcff)}
.ai-studio-promo{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;border-radius:18px;color:#fff;background:linear-gradient(135deg,#075fac,#1598ea);box-shadow:0 14px 30px rgba(7,95,172,.16)}
.ai-lesson-content{padding:26px}.ai-content-block{border-bottom:1px solid #edf1f5;padding:4px 0 20px;margin-bottom:20px}.ai-content-block:last-of-type{border-bottom:0}.ai-content-block h5{font-weight:700;color:#173957;margin-bottom:10px}.lesson-reading-text{white-space:normal;overflow-wrap:anywhere;line-height:1.9;color:#34495d}.ai-summary-box{background:#f4f9fd;border:1px solid #d8eaf7;border-left:4px solid #0877d8;border-radius:14px;padding:15px 17px;color:#35526c}.ai-answer-key{border-left:4px solid #ffbd17}
@media(max-width:767.98px){.ai-studio-promo{align-items:flex-start;flex-direction:column}.ai-preview-tabs{overflow-x:auto;flex-wrap:nowrap}.ai-preview-tabs .nav-link{white-space:nowrap}.ai-lesson-content{padding:18px}}

/* SmartClass v0.7 student import */
.import-step-icon{width:52px;height:52px;min-width:52px;border-radius:17px;display:grid;place-items:center;background:linear-gradient(135deg,#0877d8,#25a7f4);color:#fff;font-size:1.3rem;font-weight:700;box-shadow:0 9px 20px rgba(8,119,216,.18)}
.import-stat{background:#f8fbfe;border:1px solid #e5edf5;border-radius:16px;padding:14px;text-align:center;height:100%}.import-stat strong{display:block;font-size:1.7rem;color:#123d61}.import-stat span{display:block;font-size:.78rem;color:#748497;margin-top:3px}
.import-field-list{display:grid;gap:9px}.import-field-list>div{display:flex;justify-content:space-between;gap:10px;padding:9px 11px;border:1px solid #e8eef5;border-radius:12px;background:#fbfdff}.import-field-list span{color:#7b8b9d;font-size:.78rem;text-align:right}
.password-option{display:flex;gap:10px;align-items:flex-start;border:1px solid #dfe8f1;border-radius:14px;padding:12px;cursor:pointer;height:100%;background:#fff;transition:.15s}.password-option:hover{border-color:#9fd1f2;background:#f9fcff}.password-option input{margin-top:4px}.password-option strong,.password-option small{display:block}.password-option small{color:#7c8a9b;margin-top:2px}
.import-preview-table{max-height:590px}.import-preview-table thead th{position:sticky;top:0;background:#f7fafc;z-index:2;box-shadow:0 1px 0 #e7edf3}

/* SmartClass v0.8 written worksheet + AI grading */
.written-form-wrap{max-width:980px;margin:0 auto}
.written-form-header{background:#fff;border:1px solid var(--sc-border);border-top:7px solid var(--sc-blue);border-radius:22px;padding:24px;box-shadow:var(--sc-shadow)}
.written-form-icon{width:54px;height:54px;min-width:54px;border-radius:16px;display:grid;place-items:center;background:linear-gradient(135deg,#eaf6ff,#fff6d8);color:var(--sc-blue);font-size:1.45rem}
.written-question-card,.grading-question-card{background:#fff;border:1px solid var(--sc-border);border-radius:20px;padding:22px;box-shadow:var(--sc-shadow)}
.written-question-card.reviewed{border-color:#d6eadf}
.written-q-number{width:38px;height:38px;min-width:38px;border-radius:12px;background:var(--sc-blue);color:#fff;display:grid;place-items:center;font-weight:700}
.written-q-text{font-size:1.02rem;font-weight:600;line-height:1.7;padding-top:4px}
.written-answer-input{min-height:130px;line-height:1.7;background:#fbfdff}
.written-submit-bar{position:sticky;bottom:12px;z-index:20;background:rgba(255,255,255,.96);backdrop-filter:blur(10px);border:1px solid var(--sc-border);border-radius:18px;padding:14px 16px;box-shadow:0 14px 35px rgba(35,77,120,.14);display:flex;align-items:center;justify-content:space-between;gap:16px}
.written-result-row{display:flex;gap:24px;align-items:flex-start;padding:12px 14px;background:#f4fbf7;border:1px solid #d7eedf;border-radius:13px}
.grading-question-card{box-shadow:none;background:#fcfdff}
.student-written-answer{line-height:1.75;white-space:normal;overflow-wrap:anywhere}
.grading-guide{background:#fff;border:1px dashed #cbd9e6;border-radius:13px;padding:10px 12px}
.grading-guide summary{cursor:pointer;color:#49667e;font-weight:600}
.ai-score-note{background:linear-gradient(135deg,#f0f8ff,#fff9e7);border:1px solid #d7e9f8;border-radius:14px;padding:12px;color:#315f83}
.btn-ai-grade{--bs-btn-color:#fff;--bs-btn-bg:#635bdb;--bs-btn-border-color:#635bdb;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:#5149c4;--bs-btn-hover-border-color:#5149c4;border-radius:11px}
@media(max-width:575.98px){.written-form-header,.written-question-card,.grading-question-card{padding:16px}.written-submit-bar{bottom:6px;flex-direction:column;align-items:stretch}.written-submit-bar .btn{width:100%}.written-result-row{flex-direction:column;gap:8px}}

/* SmartClass v0.9 Knowledge Assessment */
.knowledge-source-list{display:grid;gap:9px;max-height:430px;overflow:auto;padding-right:3px}.knowledge-source-item{display:flex;align-items:center;gap:10px;border:1px solid #e3ebf4;background:#fbfdff;border-radius:14px;padding:11px 12px;cursor:pointer;transition:.15s}.knowledge-source-item:hover{border-color:#9fd2f5;background:#f4faff}.knowledge-source-item:has(.form-check-input:checked){border-color:#68baf0;background:#edf8ff;box-shadow:0 0 0 3px rgba(8,119,216,.06)}.knowledge-assessment-card{background:#fff;border:1px solid var(--sc-border);border-radius:20px;padding:20px;box-shadow:var(--sc-shadow)}.knowledge-student-card{border-top:4px solid var(--sc-gold)}
.knowledge-breakdown-card{border:1px solid #e6edf5;border-radius:15px;padding:14px;background:#fbfdff}.knowledge-breakdown-card .progress-bar{background:linear-gradient(90deg,#0877d8,#20a6f4)}

/* SmartClass v1.0 - AI Learning Analytics */
.analytics-score-circle{width:118px;height:118px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#f8fbfd;border:9px solid #dceaf5;flex:0 0 auto}.analytics-score-circle.good{border-color:#bfe8cf;background:#f2fbf6}.analytics-score-circle.watch{border-color:#f6dca1;background:#fffaf0}.analytics-score-circle strong{font-size:2rem;line-height:1;color:#173957}.analytics-score-circle span{font-size:.7rem;color:#748598;margin-top:5px}.analytics-table td,.analytics-table th{white-space:nowrap}.analytics-lesson-row{padding:13px 0;border-bottom:1px solid #edf2f6}.analytics-lesson-row:last-child{border-bottom:0}.analytics-ai-empty{display:flex;align-items:center;gap:16px;padding:22px;border:1px dashed #b8daf3;border-radius:17px;background:#f7fbff}.analytics-ai-icon,.analytics-quick-icon{width:58px;height:58px;min-width:58px;border-radius:18px;display:grid;place-items:center;background:linear-gradient(135deg,#e9f7ff,#fff3c8);color:#0877d8;font-size:1.5rem}.analytics-list{padding-left:1.25rem;margin-bottom:0}.analytics-list li{margin-bottom:8px;line-height:1.55}.analytics-insight-card{height:100%;border:1px solid #e5edf5;background:#fbfdff;border-radius:16px;padding:15px}.analytics-support-card{height:100%;border-radius:16px;padding:16px;border:1px solid #eadfd4;background:#fffaf5}.analytics-support-card.urgent{border-color:#f0c3bd;background:#fff5f3}.analytics-support-card.watch{border-color:#f1dca8;background:#fffaf0}.analytics-quick-card{background:linear-gradient(135deg,#ffffff,#f4fbff 70%,#fff9e7)}
@media print{.sidebar,.topbar,.footer,.no-print{display:none!important}.main-content{margin:0!important;width:100%!important}.content-area{padding:0!important}.panel-card,.stat-card{box-shadow:none!important;break-inside:avoid}.analytics-table{font-size:10px}.report-print-header{display:block!important}body{background:#fff!important}}
