@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&display=swap');
/* ClassScore Easy v6 */
:root{--blue:#1d4ed8;--bg:#f3f7fd;--card:#fff;--line:#d8e2f2;--text:#16365f;--muted:#6b7f9c;--green:#15803d;--red:#b91c1c;--yellow:#fff8d9;--orange:#f59e0b}
*{box-sizing:border-box}body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Tahoma,sans-serif;background:var(--bg);color:var(--text)}.topbar{position:sticky;top:0;z-index:30;background:#fff;display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--line)}.brand{font-size:24px;font-weight:800}.subtitle,.muted{font-size:12px;color:var(--muted)}.header-actions,.actions,.toolbar-actions{display:flex;gap:7px;align-items:center}.tabs{position:sticky;top:67px;z-index:25;background:var(--bg);display:flex;gap:7px;padding:9px 16px;overflow:auto}.tab,.btn{white-space:nowrap;border:1px solid var(--line);border-radius:9px;padding:8px 11px;background:#fff;color:var(--blue);font-weight:700;cursor:pointer}.tab.active,.btn{background:var(--blue);color:#fff;border-color:var(--blue)}.btn.ghost{background:#fff;color:var(--blue)}.btn.danger{background:#dc2626;color:#fff}.filebtn{display:inline-flex}.page{display:none}.page.active{display:block}main{padding:0 14px 20px}.card{background:#fff;border:1px solid var(--line);border-radius:13px;box-shadow:0 5px 18px rgba(29,78,216,.04)}.padded{padding:14px;margin-bottom:10px}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:11px 13px;margin-bottom:9px}.title-block h2,.section-head h2{margin:0;font-size:18px}.title-block p{margin:3px 0 0;font-size:12px;color:var(--muted)}input,select,textarea{border:1px solid #cbd5e1;border-radius:8px;padding:8px 9px;background:#fff;color:var(--text);font:inherit}textarea{width:100%;resize:vertical}.table-scroll{overflow:auto;max-height:calc(100vh - 205px)}.sheet{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;background:#fff}.sheet th,.sheet td{height:31px;padding:0;border-right:1px solid #cbd5e1;border-bottom:1px solid #cbd5e1;text-align:center}.sheet thead th{position:sticky;top:0;z-index:7;background:#f8fbff;font-size:10px}.sticky-no{position:sticky!important;left:0;z-index:12!important;width:40px;min-width:40px;max-width:40px;background:#f8fbff!important}.sticky-name{position:sticky!important;left:40px;z-index:11!important;width:145px;min-width:145px;max-width:145px;padding:0 6px!important;text-align:left!important;background:#fff!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sheet thead .sticky-name{z-index:13!important;background:#f8fbff!important}.score-head,.score-col{width:40px;min-width:40px;max-width:40px}.attendance-head,.attendance-col{width:45px;min-width:45px;max-width:45px}.col-title{writing-mode:vertical-rl;transform:rotate(180deg);height:58px;padding:4px 1px;white-space:nowrap;overflow:hidden;font-size:10px}.max-row th{height:24px!important;top:58px!important;background:#fff7ed!important;color:#9a3412}.cell,.cell-select{width:100%;height:100%;border:0;border-radius:0;padding:0 1px;text-align:center;background:transparent;outline:0;font-size:12px}.missing-score{background:var(--yellow)}.special-score{background:#fff1e8}.total-col{width:48px!important;min-width:48px!important;background:#f0fdf4!important;font-weight:700}.percent-col{width:54px!important;min-width:54px!important;background:#eef2ff!important;font-weight:700}.result-col{width:58px!important;min-width:58px!important;font-weight:800}.result-pass{background:#ecfdf5!important;color:var(--green)}.result-fail{background:#fef2f2!important;color:var(--red)}.summary-mini{width:38px;min-width:38px}.attendance-toolbar{align-items:flex-start}.attendance-settings{display:flex;gap:8px;flex-wrap:wrap;font-size:12px}.attendance-settings label{display:flex;align-items:center;gap:4px}.mini-input{width:58px!important;text-align:center}.overview-strip{display:flex;gap:12px;flex-wrap:wrap;padding:9px 12px;margin-bottom:9px;font-size:12px}.overview-item{padding-right:12px;border-right:1px solid var(--line)}.section-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}.searchbox{min-width:300px}.students-layout,.settings-grid,.quality-grid,.report-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.student-list{width:100%;border-collapse:collapse}.student-list th,.student-list td{padding:7px;border-bottom:1px solid #edf2f7;text-align:left;font-size:12px}.student-list-wrap{max-height:540px}.helpbox{margin-top:10px;padding:9px;background:#eff6ff;border:1px dashed #93c5fd;border-radius:10px;font-size:12px}.wrap{flex-wrap:wrap}.pillbox{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}.pill{padding:5px 8px;border-radius:999px;background:#eff6ff;border:1px solid #bfdbfe;font-size:12px}.pill button{border:0;background:transparent;color:var(--red);cursor:pointer}.criterion-row{display:grid;grid-template-columns:1fr 90px;gap:8px;align-items:center;margin:7px 0}.summary-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.metric{padding:10px;border:1px solid var(--line);border-radius:10px;background:#fbfdff}.metric b{display:block;font-size:12px;color:var(--muted);margin-bottom:3px}.metric strong{font-size:18px}.missing-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:7px}.missing-tag{padding:5px 8px;border-radius:999px;background:#fff4dd;color:#9a5a00;font-size:12px}.student-result-card{margin-top:8px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#f8fbff}.success{color:var(--green)}.danger-text{color:var(--red)}.settings-grid label{display:block;margin:8px 0}.settings-grid label input{display:block;width:100%;margin-top:4px}
@media(max-width:900px){.topbar{flex-direction:column;align-items:flex-start}.header-actions{width:100%;overflow:auto}.tabs{top:105px;padding:7px}.toolbar{flex-direction:column;align-items:flex-start}.toolbar-actions{width:100%;overflow:auto}.students-layout,.settings-grid,.quality-grid,.report-grid{grid-template-columns:1fr}.summary-grid{grid-template-columns:1fr 1fr}main{padding:0 5px 14px}.sticky-no{width:34px;min-width:34px;max-width:34px}.sticky-name{left:34px;width:118px;min-width:118px;max-width:118px}.score-head,.score-col{width:36px;min-width:36px;max-width:36px}.attendance-head,.attendance-col{width:40px;min-width:40px;max-width:40px}.col-title{height:52px}.max-row th{top:52px!important}.sheet th,.sheet td{height:29px}.total-col{width:44px!important;min-width:44px!important}.percent-col{width:48px!important;min-width:48px!important}.result-col{width:52px!important;min-width:52px!important}.searchbox{min-width:100%;width:100%}.section-head{align-items:flex-start;flex-direction:column}.table-scroll{max-height:calc(100vh - 215px)}}

/* v7 column editor + clearer compact headers */
.danger-outline{color:#b91c1c!important;border-color:#fecaca!important;background:#fff!important}
.column-hint{font-size:11px;color:var(--muted);padding:0 4px 6px}
.score-head,.score-col{width:48px;min-width:48px;max-width:48px}
.attendance-head,.attendance-col{width:48px;min-width:48px;max-width:48px}
.col-title{writing-mode:horizontal-tb!important;transform:none!important;height:46px!important;max-height:46px!important;display:flex;align-items:center;justify-content:center;white-space:normal!important;overflow:hidden;text-overflow:ellipsis;line-height:1.05;font-size:10px;padding:3px;word-break:break-word;cursor:pointer;user-select:none}
.col-title:hover{background:#eaf2ff;color:#1d4ed8}
.max-row th{top:46px!important}
.modal-backdrop{position:fixed;inset:0;z-index:100;background:rgba(15,23,42,.38);display:flex;align-items:center;justify-content:center;padding:16px}
.modal-backdrop.hidden{display:none}.modal-card{width:min(430px,100%);background:#fff;border-radius:16px;border:1px solid var(--line);box-shadow:0 24px 70px rgba(15,23,42,.24);padding:16px}.modal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.modal-head h3{margin:0}.modal-close{border:0;background:#f1f5f9;border-radius:999px;width:32px;height:32px;font-size:22px;cursor:pointer;color:#475569}.modal-card label{display:block;font-weight:700;margin:10px 0}.modal-card label input{display:block;width:100%;margin-top:6px}.modal-actions{display:flex;align-items:center;gap:8px;margin-top:14px}.modal-spacer{flex:1}
@media(max-width:900px){.score-head,.score-col{width:44px;min-width:44px;max-width:44px}.attendance-head,.attendance-col{width:44px;min-width:44px;max-width:44px}.col-title{height:42px!important;max-height:42px!important;font-size:9px}.max-row th{top:42px!important}.header-actions{flex-wrap:nowrap}}


/* v7.1 score headers vertical + attendance letter colors */
.score-head,.score-col{width:54px;min-width:54px;max-width:54px}
.attendance-head,.attendance-col{width:48px;min-width:48px;max-width:48px}
.col-title.vertical-title{writing-mode:vertical-rl!important;transform:rotate(180deg)!important;height:88px!important;max-height:88px!important;line-height:1.08;padding:5px 2px;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;font-size:11px}
.col-title.att-title{writing-mode:horizontal-tb!important;transform:none!important;height:46px!important;max-height:46px!important;display:flex;align-items:center;justify-content:center;white-space:normal!important;line-height:1.05;font-size:10px;padding:3px;word-break:break-word}
.max-row th{top:88px!important}
.attcell{font-weight:800;font-size:16px;padding:0;text-align:center;text-align-last:center;-webkit-appearance:none;appearance:none}
.attcell.status-มา{color:#15803d}
.attcell.status-ขาด{color:#dc2626}
.attcell.status-ลา{color:#0284c7}
.attcell.status-สาย{color:#f59e0b}
@media(max-width:900px){.score-head,.score-col{width:50px;min-width:50px;max-width:50px}.attendance-head,.attendance-col{width:44px;min-width:44px;max-width:44px}.col-title.vertical-title{height:78px!important;max-height:78px!important;font-size:10px}.col-title.att-title{height:42px!important;max-height:42px!important;font-size:9px}.max-row th{top:78px!important}}


/* v7.2 FIX: prevent the score-max row from floating over student rows */
.sheet .max-row th{
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}

/* keep only the main header row fixed while scrolling */
.sheet thead tr:first-child th{
  position: sticky;
  top: 0;
  z-index: 8;
}
.sheet thead tr:first-child .sticky-no{
  z-index: 14 !important;
}
.sheet thead tr:first-child .sticky-name{
  z-index: 13 !important;
}

/* second header row stays directly under the first row at the top of the table,
   but scrolls away with the table instead of overlaying student data */
.sheet .max-row .sticky-no,
.sheet .max-row .sticky-name{
  position: static !important;
  left: auto !important;
}

/* remove old top offsets that caused the floating row */
@media(max-width:900px){
  .sheet .max-row th{
    position: static !important;
    top: auto !important;
  }
}


/* =========================================================
   EasyClassroom by kruboy101 v8 — UI refresh
   ========================================================= */
:root{
  --blue:#1769e0;
  --blue-dark:#0b4ea2;
  --blue-deep:#0a3f82;
  --blue-soft:#eaf3ff;
  --bg:#f4f8fe;
  --card:#ffffff;
  --line:#d6e2f1;
  --text:#17375f;
  --muted:#71829a;
  --green:#138a51;
  --red:#d62828;
  --yellow:#fff7d6;
  --orange:#f59e0b;
}
body{
  background:linear-gradient(180deg,#f7fbff 0,#eef5ff 100%);
}
.topbar{
  min-height:72px;
  padding:12px 22px;
  box-shadow:0 2px 14px rgba(23,105,224,.08);
}
.brand-wrap{display:flex;align-items:center;gap:12px}
.brand-mark{
  width:46px;height:46px;border-radius:14px;
  display:grid;place-items:center;
  background:linear-gradient(145deg,#237cf4,#0f5fd1);
  color:#fff;font-size:24px;
  box-shadow:0 8px 20px rgba(23,105,224,.22);
}
.brand{font-size:24px;color:#0b3f83;letter-spacing:-.2px}
.brand span{color:#1769e0}
.subtitle{margin-top:2px}
.tabs{
  top:72px;
  background:rgba(244,248,254,.96);
  backdrop-filter:blur(8px);
  padding:10px 18px;
  border-bottom:1px solid #e5eef9;
}
.tab{
  border-radius:11px;
  padding:9px 14px;
  transition:.18s ease;
}
.tab:hover{transform:translateY(-1px);box-shadow:0 5px 14px rgba(23,105,224,.08)}
.tab.active{
  background:linear-gradient(135deg,#1e73ed,#1761d2);
  box-shadow:0 7px 16px rgba(23,105,224,.19);
}
.card{
  border-color:#dae6f5;
  border-radius:16px;
  box-shadow:0 8px 26px rgba(31,75,130,.055);
}
.toolbar{padding:13px 15px}
.btn{border-radius:10px}
.btn:not(.ghost):not(.danger){
  background:linear-gradient(135deg,#2179f0,#1763d7);
  box-shadow:0 5px 13px rgba(23,105,224,.16);
}
input,select,textarea{border-color:#cbd9eb}
input:focus,select:focus,textarea:focus{
  outline:none;border-color:#5a9cf3;box-shadow:0 0 0 3px rgba(23,105,224,.09)
}

/* dark, high-contrast header on ALL tables */
.sheet thead tr:first-child th,
.student-list thead th{
  background:linear-gradient(180deg,#1765b9,#0d4d95)!important;
  color:#fff!important;
  border-color:#3f78b8!important;
  font-weight:800;
  text-shadow:0 1px 1px rgba(0,0,0,.08);
}
.student-list thead th{
  position:sticky;
  top:0;
  z-index:5;
  height:38px;
}
.sheet thead tr:first-child .sticky-no,
.sheet thead tr:first-child .sticky-name{
  background:linear-gradient(180deg,#1765b9,#0d4d95)!important;
  color:#fff!important;
}
.sheet thead tr:first-child th.total-col{
  background:linear-gradient(180deg,#1592a7,#0f7892)!important;
  color:#fff!important;
}
.sheet thead tr:first-child th.percent-col,
.sheet thead tr:first-child th.result-col{
  background:linear-gradient(180deg,#1765b9,#0d4d95)!important;
  color:#fff!important;
}

/* make score header row a stable fixed height */
#scoreTable thead tr:first-child th{
  height:88px!important;
  min-height:88px!important;
  position:sticky!important;
  top:0!important;
  z-index:20!important;
}
#scoreTable .col-title.vertical-title{
  height:88px!important;
  max-height:88px!important;
}
#scoreTable thead tr:first-child .sticky-no{z-index:26!important}
#scoreTable thead tr:first-child .sticky-name{z-index:25!important}

/* lock BOTH score header rows while vertical scrolling */
#scoreTable .max-row th{
  position:sticky!important;
  top:88px!important;
  z-index:18!important;
  height:27px!important;
  background:#fff7e8!important;
  color:#b23c00!important;
  border-color:#ecd9c2!important;
  font-weight:800;
}
#scoreTable .max-row .sticky-no{
  position:sticky!important;
  left:0!important;
  z-index:24!important;
}
#scoreTable .max-row .sticky-name{
  position:sticky!important;
  left:40px!important;
  z-index:23!important;
}
#scoreTable .max-row .total-col{
  background:#edfdf3!important;color:#0d7844!important;
}
#scoreTable .max-row .percent-col{
  background:#eef3ff!important;color:#254f9d!important;
}
#scoreTable .max-row .result-col{
  background:#fff3e8!important;color:#b23c00!important;
}

/* row polish */
.sheet tbody tr:nth-child(even) td:not(.missing-score):not(.special-score):not(.total-col):not(.percent-col):not(.result-col){
  background:#fbfdff;
}
.sheet tbody tr:hover td:not(.sticky-no):not(.sticky-name){
  box-shadow:inset 0 0 0 999px rgba(33,121,240,.025);
}
.sheet .sticky-name{font-weight:600}
.missing-score{background:#fff8d9!important}
.total-col{background:#edfdf3!important}
.percent-col{background:#eef3ff!important}

/* stronger visual hierarchy on pages */
.padded h2,.title-block h2,.section-head h2{color:#123f7b}
.helpbox{background:#eef6ff;border-color:#9ac6fa}
.pill{background:#eef5ff}
.metric{background:linear-gradient(180deg,#fff,#f8fbff)}

/* status colors */
.attcell.status-มา{color:#15803d!important}
.attcell.status-ขาด{color:#dc2626!important}
.attcell.status-ลา{color:#0284c7!important}
.attcell.status-สาย{color:#f59e0b!important}

/* mobile */
@media(max-width:900px){
  .topbar{padding:10px}
  .tabs{top:106px}
  #scoreTable thead tr:first-child th{
    height:78px!important;
    min-height:78px!important;
  }
  #scoreTable .col-title.vertical-title{
    height:78px!important;
    max-height:78px!important;
  }
  #scoreTable .max-row th{top:78px!important}
  #scoreTable .max-row .sticky-name{left:34px!important}
}

/* ==========================================================
   EasyClassroom v9 - app shell / homeroom module
   ========================================================== */
:root{--side:#12375d;--side2:#0d2e50;--cyan:#0ea5e9;--shadow:0 8px 28px rgba(20,61,105,.08)}
body{overflow-x:hidden}
.app{min-height:100vh}
.topbar{
  position:fixed!important;top:0;left:0;right:0;z-index:100;
  background:linear-gradient(90deg,#116ac9,#1a82df)!important;
  color:white!important;border:0!important;
}
.topbar .brand,.topbar .brand span,.topbar .subtitle{color:white!important}
.topbar .brand-mark{background:rgba(255,255,255,.16)!important;box-shadow:none!important}
.topbar .header-actions select,.topbar .header-actions .btn{
  background:rgba(255,255,255,.14)!important;color:#fff!important;border-color:rgba(255,255,255,.28)!important
}
.side-nav{
  position:fixed;left:0;top:72px;bottom:0;width:240px;z-index:90;
  background:linear-gradient(180deg,var(--side),var(--side2));
  display:flex;flex-direction:column;padding:12px 10px;color:#fff;
  box-shadow:6px 0 18px rgba(18,55,93,.08)
}
.side-scroll{overflow:auto;flex:1;padding-right:2px}
.side-nav .tab{
  width:100%;display:flex;align-items:center;gap:13px;margin:3px 0;padding:11px 13px;
  color:#f5f9ff;background:transparent;border:0;border-radius:10px;text-align:left;font-size:15px
}
.side-nav .tab:hover{background:rgba(255,255,255,.08);transform:none;box-shadow:none}
.side-nav .tab.active{background:linear-gradient(135deg,#247ce8,#2f91ff);box-shadow:0 7px 18px rgba(0,89,214,.3);color:#fff}
.nav-icon{font-size:19px;width:24px;text-align:center}
.side-brand{margin-top:10px;padding:14px;border-radius:15px;background:linear-gradient(180deg,#225487,#1b4775);text-align:center;display:flex;flex-direction:column;gap:3px}
.side-brand b{font-size:18px;color:#ffe45d}.side-brand small{font-weight:700}.side-brand span{font-size:11px;margin-top:6px;color:#d7ebff}.school-emoji{font-size:36px}
main{margin-left:240px!important;padding-top:92px!important;max-width:none!important}
.page{padding:18px 26px 34px!important}
.welcome-card{padding:24px 28px;display:flex;justify-content:space-between;align-items:center;background:linear-gradient(120deg,#fff,#eef7ff);overflow:hidden}
.welcome-card h1{margin:3px 0 6px;font-size:28px;color:#113f76}.welcome-card p{margin:0;color:#637995}.eyebrow{font-size:11px;font-weight:800;letter-spacing:2px;color:#2677d5}.welcome-badge{font-size:58px}
.home-metrics,.attendance-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:16px 0}
.metric-card{display:flex;gap:13px;align-items:center;background:#fff;border:1px solid #dbe8f6;border-radius:15px;padding:17px 18px;box-shadow:var(--shadow)}
.metric-card>span{font-size:28px}.metric-card small{display:block;color:#75889e}.metric-card b{font-size:22px;color:#153f70;display:block;margin-top:2px}
.metric-card.green{background:#effcf5}.metric-card.orange{background:#fff8eb}.metric-card.purple{background:#f8f2ff}
.home-grid{display:grid;grid-template-columns:1.55fr 1fr;gap:16px}
.quick-actions{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.quick-card{border:1px solid #d9e7f6;background:#fbfdff;border-radius:14px;padding:16px;text-align:left;cursor:pointer;display:grid;grid-template-columns:40px 1fr;grid-template-rows:auto auto;column-gap:10px}
.quick-card>span{grid-row:1/3;font-size:28px}.quick-card b{color:#153f70}.quick-card small{color:#72859b;margin-top:3px}
.quick-card:hover{border-color:#7db2f4;box-shadow:0 8px 18px rgba(23,105,224,.08)}
.mini-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:14px 0 18px}.mini-summary div{background:#f5f8fc;border-radius:12px;text-align:center;padding:12px 6px}.mini-summary b{display:block;font-size:24px;color:#124d8d}.mini-summary span{font-size:12px;color:#75889e}.wide-btn{width:100%}
.page-title-row{display:flex;gap:13px;align-items:center;margin:0 0 15px}.page-title-row h1{margin:0;color:#123f75}.page-title-row p{margin:3px 0 0;color:#6f8297}.page-icon{width:50px;height:50px;border-radius:12px;background:#e9f3ff;color:#1769d9;display:grid;place-items:center;font-size:25px}
.homeroom-controls{display:grid;grid-template-columns:1fr 1fr 1fr 1.35fr;gap:14px}.control-card,.tip-card{background:#fff;border:1px solid #dbe7f5;border-radius:13px;padding:12px 14px}.control-card span{font-size:12px;font-weight:700;color:#5f7289;display:block;margin-bottom:7px}.control-card input,.control-card select{width:100%;height:40px}.tip-card{background:#eaf5ff;color:#18558d;line-height:1.45}
.attendance-metrics{grid-template-columns:repeat(5,1fr)}.att-metric{border-radius:13px;padding:13px 15px;display:flex;align-items:center;gap:12px;border:1px solid #e0e9f3}.att-metric>span{font-size:30px}.att-metric small{display:block;font-weight:700}.att-metric b{font-size:25px}.att-metric em{font-style:normal;font-size:11px;margin-left:4px}.att-metric.all{background:#edfbf3}.att-metric.present{background:#ecf8ff;color:#0876b9}.att-metric.late{background:#fff6df;color:#e48500}.att-metric.leave{background:#f5ecff;color:#7c3db9}.att-metric.absent{background:#fff0f0;color:#d52929}
.attendance-actions{display:flex;gap:9px;align-items:center;margin:8px 0 14px;flex-wrap:wrap}.action-spacer{flex:1}.success-btn{background:linear-gradient(135deg,#19a15c,#0b8749)!important}.parent-btn{background:linear-gradient(135deg,#16a05c,#087b44)!important}
.attendance-card{padding:0;overflow:hidden}.homeroom-table{min-width:1080px}.homeroom-table thead th{text-align:center!important}.homeroom-table thead th:nth-child(3){text-align:left!important}.homeroom-table .subhead th{background:#114f91!important;color:#fff!important;position:sticky;top:40px;z-index:4}.homeroom-table thead tr:first-child th{height:40px;position:sticky;top:0;z-index:5}.name-cell{font-weight:600;min-width:220px}.status-cell{width:58px;text-align:center}.status-radio{width:32px;height:32px;border:2px solid #b9c8da;border-radius:50%;display:inline-grid;place-items:center;cursor:pointer;background:#fff}.status-radio input{display:none}.status-radio span{opacity:0;font-size:16px}.status-radio.selected span,.status-radio:has(input:checked) span{opacity:1}.status-bg-มา .status-radio:has(input:checked){border-color:#16a05c;background:#e8fff1}.status-bg-สาย .status-radio:has(input:checked){border-color:#f1a100;background:#fff3cf}.status-bg-ลา .status-radio:has(input:checked){border-color:#8b55cc;background:#f2e9ff}.status-bg-ขาด .status-radio:has(input:checked){border-color:#e13a3a;background:#ffeaea}.arrival-input{width:105px}.note-input{min-width:210px}.guardian-cell{min-width:130px}.notified{color:#14824c;font-weight:700}.info-strip{margin-top:12px;background:#eaf4ff;border-radius:10px;padding:10px 13px;color:#22649e;font-size:13px}
.linked{color:#0a8c51;font-weight:700}.unlinked{color:#c47a00;font-weight:700}.compact{grid-template-columns:repeat(4,1fr);max-width:720px}.notify-modal{width:min(760px,94vw)}.notify-item{border:1px solid #dbe7f4;border-radius:12px;padding:12px;margin:10px 0}.notify-item small{display:block;color:#73869b;margin:5px 0}.notify-item textarea{width:100%;height:145px;background:#f8fbff}
@media(max-width:1000px){
  .side-nav{width:78px}.side-nav .tab span:not(.nav-icon),.side-brand b,.side-brand small,.side-brand span{display:none}.side-brand{padding:9px}.school-emoji{font-size:28px}
  main{margin-left:78px!important}.homeroom-controls{grid-template-columns:1fr 1fr}.home-grid{grid-template-columns:1fr}.home-metrics{grid-template-columns:1fr 1fr}
}
@media(max-width:700px){
  .topbar{position:sticky!important}.side-nav{position:static;width:auto;height:auto;display:block;padding:7px;overflow-x:auto}.side-scroll{display:flex;overflow-x:auto}.side-nav .tab{min-width:max-content;width:auto}.side-nav .tab span:not(.nav-icon){display:inline}.side-brand{display:none}
  main{margin-left:0!important;padding-top:10px!important}.page{padding:12px!important}.homeroom-controls{grid-template-columns:1fr}.attendance-metrics{grid-template-columns:1fr 1fr}.home-metrics{grid-template-columns:1fr}.quick-actions{grid-template-columns:1fr}
}

/* v9.1 — independent homeroom roster + visible subject-room selector */
.topbar .header-actions #classSelect{
  min-width:190px!important;
  background:#fff!important;
  color:#123f75!important;
  border:1px solid rgba(255,255,255,.8)!important;
  font-weight:800!important;
}
.topbar .header-actions #classSelect option{
  color:#17375f!important;
  background:#fff!important;
}
.topbar .header-actions #classSelect:focus{
  outline:3px solid rgba(255,255,255,.28);
}
.homeroom-controls-v91{grid-template-columns:1fr 1fr 1fr 1.4fr!important}
.homeroom-roster-card{margin:14px 0;padding:14px 16px}
.roster-head{display:flex;align-items:center;justify-content:space-between;gap:14px}
.roster-head h3{margin:0;color:#123f75;font-size:17px}
.roster-head p{margin:3px 0 0;color:#71829a;font-size:12px}
.roster-actions{display:flex;gap:8px;flex-wrap:wrap}
.roster-summary{margin-top:10px;padding:10px 12px;border-radius:10px;background:#f2f7fd;display:flex;gap:12px;align-items:center}
.roster-summary b{color:#174f8f}
.empty-roster,.empty-table{color:#8a98aa;text-align:center!important;padding:18px!important}
#homeroomName{width:100%;height:40px;font-weight:800;color:#123f75}
@media(max-width:1000px){
  .homeroom-controls-v91{grid-template-columns:1fr 1fr!important}
  .roster-head{align-items:flex-start;flex-direction:column}
}
@media(max-width:700px){
  .homeroom-controls-v91{grid-template-columns:1fr!important}
  .topbar .header-actions #classSelect{min-width:150px!important}
}

/* v9.2 — sidebar groups */
.nav-group-title{
  margin:14px 8px 6px;
  padding:7px 8px 6px;
  color:#91b9df;
  font-size:11px;
  font-weight:900;
  letter-spacing:.5px;
  text-transform:none;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.side-nav .nav-group-title:first-of-type{margin-top:10px}
.side-nav .tab{
  margin:2px 0;
}
.side-nav .tab span:last-child{
  white-space:nowrap;
}
@media(max-width:1000px){
  .nav-group-title{
    font-size:0;
    padding:4px 0;
    margin:8px 5px 4px;
    border-bottom:1px solid rgba(255,255,255,.18);
  }
}
@media(max-width:700px){
  .nav-group-title{
    display:none;
  }
}


/* v9.3 — larger paste box + smaller by kruboy101 */
.topbar .brand{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap}
.topbar .brand .brand-sub{
  font-size:.52em!important;
  font-weight:700!important;
  opacity:.95;
  letter-spacing:.2px;
  transform:translateY(-2px);
}
.paste-modal{width:min(760px,96vw)!important}
.paste-help{
  margin:2px 0 12px;
  padding:12px 14px;
  background:#eff6ff;
  border:1px solid #bfdbfe;
  border-radius:12px;
  color:#1e4f8e;
  line-height:1.65;
  font-size:14px;
}
#homeroomPasteText{
  min-height:260px;
  width:100%;
  font-size:16px;
  line-height:1.55;
  padding:14px;
  border-radius:12px;
  background:#fbfdff;
}
.paste-tip{
  margin-top:8px;
  color:#6b7f95;
  font-size:13px;
}
@media(max-width:700px){
  .topbar .brand .brand-sub{font-size:.46em!important;transform:none}
  .paste-modal{width:min(96vw,96vw)!important}
  #homeroomPasteText{min-height:220px;font-size:15px}
}


/* v9.4 — homeroom roster deletion controls */
.roster-danger{
  margin-left:2px;
}
.row-delete-btn{
  border:1px solid #fecaca;
  background:#fff5f5;
  color:#dc2626;
  border-radius:8px;
  padding:6px 10px;
  font-weight:800;
  cursor:pointer;
}
.row-delete-btn:hover{
  background:#fee2e2;
  border-color:#fca5a5;
}
.delete-student-cell{
  width:86px;
  text-align:center!important;
}
.homeroom-table{
  min-width:1160px;
}


/* v9.5 — fix attendance status selection */
.attendance-col{
  width:74px!important;
  min-width:74px!important;
  max-width:74px!important;
}
.attcell{
  width:100%!important;
  min-width:70px!important;
  height:31px!important;
  padding:0 22px 0 6px!important;
  border:1px solid transparent!important;
  border-radius:7px!important;
  background-color:#fff!important;
  font-size:13px!important;
  font-weight:800!important;
  text-align:center!important;
  text-align-last:center!important;
  cursor:pointer!important;

  /* restore native dropdown so the control is obvious and clickable */
  -webkit-appearance:auto!important;
  appearance:auto!important;
}
.attcell:focus{
  outline:none!important;
  border-color:#60a5fa!important;
  box-shadow:0 0 0 3px rgba(37,99,235,.12)!important;
}
.attcell.status-มา{
  color:#15803d!important;
  background:#ecfdf5!important;
}
.attcell.status-ขาด{
  color:#dc2626!important;
  background:#fef2f2!important;
}
.attcell.status-ลา{
  color:#0284c7!important;
  background:#eff6ff!important;
}
.attcell.status-สาย{
  color:#d97706!important;
  background:#fffbeb!important;
}
@media(max-width:900px){
  .attendance-col{
    width:68px!important;
    min-width:68px!important;
    max-width:68px!important;
  }
  .attcell{
    min-width:64px!important;
    font-size:12px!important;
    padding-right:18px!important;
  }
}


/* v9.6 — font + monthly subject attendance */
body,
button,
input,
select,
textarea{
  font-family:"Noto Sans Thai","Leelawadee UI",Tahoma,sans-serif!important;
}
.brand{font-weight:800!important}
.side-nav .tab,.nav-group-title,.student-list th,.sheet thead th{font-weight:700!important}

.attendance-monthbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:10px 12px;
  margin-bottom:9px;
}
.month-nav,.attendance-export-box{
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
}
.month-picker-wrap,.attendance-export-box label{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  font-weight:700;
  color:#50657c;
}
#attendanceMonth{
  min-width:165px;
  font-weight:700;
  color:#164d89;
}
#attendanceExportScope{
  min-width:135px;
  font-weight:700;
}
.month-arrow{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border:1px solid #bfd2ea;
  background:#fff;
  color:#1769d9;
  border-radius:10px;
  font-size:26px;
  line-height:1;
  cursor:pointer;
}
.month-arrow:hover{background:#eef6ff}

#attendanceTable .attendance-head,
#attendanceTable .attendance-col{
  width:58px!important;
  min-width:58px!important;
  max-width:58px!important;
}
#attendanceTable .month-date-title{
  writing-mode:vertical-rl!important;
  transform:rotate(180deg)!important;
  height:92px!important;
  max-height:92px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  white-space:nowrap!important;
  font-size:11px!important;
  font-weight:800!important;
  letter-spacing:.2px;
  padding:5px 2px!important;
  overflow:visible!important;
}
#attendanceTable thead tr:first-child th{
  height:92px!important;
  min-height:92px!important;
  vertical-align:middle;
}
#attendanceTable .attcell{
  min-width:54px!important;
  padding:0 15px 0 3px!important;
  font-size:12px!important;
}
#attendanceTable .sticky-no,
#attendanceTable .sticky-name{
  height:92px!important;
}
@media(max-width:900px){
  .attendance-monthbar{align-items:flex-start;flex-direction:column}
  .attendance-export-box{width:100%}
  #attendanceTable .attendance-head,
  #attendanceTable .attendance-col{
    width:54px!important;
    min-width:54px!important;
    max-width:54px!important;
  }
  #attendanceTable .month-date-title{
    height:84px!important;
    max-height:84px!important;
    font-size:10px!important;
  }
  #attendanceTable thead tr:first-child th,
  #attendanceTable .sticky-no,
  #attendanceTable .sticky-name{
    height:84px!important;
    min-height:84px!important;
  }
}


/* v9.7 — remove bottom sidebar EasyClassroom promo card */
.side-brand{display:none!important}
.side-nav{padding-bottom:12px!important}
.side-scroll{padding-bottom:18px!important}


/* v9.8 — install/share experience */
.install-home-card{
  margin:16px 0;
  padding:18px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  background:linear-gradient(120deg,#ffffff 0%,#eef7ff 100%);
  border:1px solid #cfe1f5;
}
.install-copy{display:flex;align-items:flex-start;gap:14px}
.install-icon{
  width:52px;height:52px;border-radius:15px;
  display:grid;place-items:center;
  font-size:27px;background:#e7f2ff;
}
.install-home-card h2{margin:2px 0 4px;color:#113f76}
.install-home-card p{margin:0 0 12px;color:#667c94}
.install-card-actions{display:flex;gap:8px;flex-wrap:wrap}
.install-url{
  margin-top:10px;font-size:12px;font-weight:700;color:#1769d9;
}
.install-qr{
  width:116px;height:116px;border-radius:12px;
  border:8px solid #fff;box-shadow:0 8px 22px rgba(27,75,130,.12);
}
.install-guide-modal{width:min(760px,96vw)!important}
.install-guide-grid{
  display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0;
}
.install-guide-device{
  background:#f7fbff;border:1px solid #d9e8f7;border-radius:13px;padding:14px;
}
.install-guide-device ol{margin:10px 0 0;padding-left:23px;line-height:1.75}
.device-badge{font-weight:800;color:#124f91;font-size:16px}
.install-qr-panel{
  display:flex;align-items:center;gap:14px;
  padding:12px;background:#eef7ff;border-radius:13px;margin-top:12px;
}
.install-qr-panel img{width:100px;height:100px;border-radius:9px;background:#fff;padding:5px}
.install-qr-panel p{margin:4px 0 0;color:#5e748c}
.install-status-note{
  margin-top:10px;padding:9px 11px;border-radius:9px;
  background:#f5f8fc;color:#50657c;font-size:13px;
}
.install-top-btn{display:inline-flex!important}
@media(max-width:700px){
  .install-home-card{align-items:flex-start}
  .install-qr{width:92px;height:92px}
  .install-guide-grid{grid-template-columns:1fr}
  .install-qr-panel{align-items:flex-start}
}
