:root {
  font-family: 'Anuphan', sans-serif;
  color: #1b3040;
  background: #f4f6f9;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-family: 'Anuphan', sans-serif; }
button, input { font: inherit; }
.container { width: min(1320px, calc(100% - 40px)); margin-inline: auto; }
.topbar { background: linear-gradient(110deg, #08765d, #07354a); color: white; box-shadow: 0 3px 16px #091e2b20; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 70px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-icon { background: #ffffff27; display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px; font-size: 25px; }
.brand strong { display: block; font-size: 20px; letter-spacing: .7px; }
.brand small { display: block; color: #daeee9; font-size: 12px; }
.user-actions { display: flex; gap: 14px; align-items: center; }
.user-actions form { margin: 0; }
.user-name { font-size: 13px; }
.logout-button { border: 1px solid #ffffff70; border-radius: 100px; color: white; background: #ffffff18; padding: 7px 15px; cursor: pointer; }
.logout-button:hover { background: #ffffff30; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 24px; padding: 32px 37px; background: linear-gradient(110deg, #08765d, #0c374d); color: white; border-radius: 19px; box-shadow: 0 10px 22px #092a3321; }
.hero-body { min-width: 0; }
.tag { display: inline-block; border-radius: 100px; background: #fff; color: #08755d; padding: 6px 15px; font-size: 12px; font-weight: 700; }
h1 { margin: 14px 0 5px; font-size: clamp(25px, 3vw, 37px); line-height: 1.35; }
.hero p { color: #d4e8e6; margin: 6px 0 0; font-size: 15px; }
.hero-side { min-width: 165px; text-align: right; }
.hero-side span, .hero-side small { display: block; font-size: 13px; color: #c7e4e3; }
.hero-side strong { display: block; font-size: 30px; line-height: 1.4; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.stat { padding: 22px; background: white; border: 1px solid #e6eaf0; border-radius: 16px; box-shadow: 0 4px 14px #152b3e0a; }
.stat-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; font-size: 23px; }
.blue { background: #e7f1ff; }
.green { background: #e4f8ea; }
.teal { background: #e2f7f8; }
.yellow { background: #fff5d6; }
.stat h2 { font-size: 19px; margin: 14px 0 4px; }
.stat p { color: #758190; font-size: 13px; margin: 0; }
.section { margin: 32px 0 45px; }
.section > h2 { font-size: 21px; margin: 0 0 16px; }
.modules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.module { text-align: center; padding: 23px 15px; background: #fff; border: 1px solid #e5ebf0; border-radius: 15px; box-shadow: 0 4px 14px #152b3e0a; }
.module > span { display: grid; place-items: center; margin: auto; width: 49px; height: 49px; border-radius: 15px; background: #f1f6f8; font-size: 25px; }
.module h3 { font-size: 16px; margin: 10px 0 3px; }
.module p { color: #7a8592; margin: 0; font-size: 13px; }
.notice { color: #657889; font-size: 13px; margin-top: 18px; }
footer { background: white; border-top: 1px solid #e5ebf0; text-align: center; padding: 22px; color: #7b8793; font-size: 12px; }
/* Forms for administrator setup and login */
.auth-page { display: flex; min-height: 100vh; flex-direction: column; }
.auth-wrap { flex: 1; width: min(100% - 28px, 460px); margin: 45px auto; }
.auth-card { background: white; padding: 30px; border: 1px solid #e5ebf0; border-radius: 20px; box-shadow: 0 12px 35px #173b480d; }
.auth-icon { display: grid; place-items: center; background: #e6f8ee; width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; font-size: 28px; }
.auth-card h1 { text-align: center; font-size: 25px; margin: 15px 0 5px; }
.auth-subtitle { color: #788996; text-align: center; font-size: 14px; margin: 0 0 24px; }
.auth-card label { display: block; margin: 14px 0 7px; font-size: 14px; font-weight: 600; }
.auth-card input:not([type="hidden"]) { width: 100%; border: 1px solid #d5dee7; background: #fff; border-radius: 12px; padding: 11px 13px; outline: none; }
.auth-card input:focus { border-color: #0b8c77; box-shadow: 0 0 0 3px #0b8c771f; }
.primary-button { width: 100%; margin-top: 23px; background: linear-gradient(110deg, #08765d, #0c4154); border: none; color: #fff; border-radius: 12px; padding: 12px; font-weight: 700; cursor: pointer; }
.primary-button:hover { filter: brightness(1.1); }
.alert { border-radius: 12px; padding: 12px; margin: 15px 0; font-size: 13px; }
.alert-error { background: #fff0f0; border: 1px solid #ffc4c4; color: #a02e33; }
.alert-ok { background: #e7f7ee; border: 1px solid #b8dfc9; color: #156448; }
.auth-note { text-align: center; color: #748493; font-size: 12px; line-height: 1.8; margin-top: 20px; }
@media (max-width: 850px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .container { width: min(100% - 28px, 1320px); }
  .topbar-inner { min-height: 68px; }
  .brand strong { font-size: 17px; }
  .brand small { font-size: 10px; }
  .user-name { display: none; }
  .logout-button { font-size: 12px; padding: 7px 11px; }
  .hero { padding: 23px; display: block; margin-top: 15px; }
  .hero-side { text-align: left; margin-top: 18px; padding-top: 14px; border-top: 1px solid #ffffff3b; }
  .hero-side strong { font-size: 23px; }
  .stats { gap: 10px; margin-top: 14px; }
  .stat { padding: 14px; }
  .stat h2 { font-size: 16px; }
  .modules { gap: 10px; }
  .module { padding: 17px 8px; }
  .module h3 { font-size: 14px; }
  .module p { font-size: 12px; }
  .auth-wrap { margin: 22px auto; }
  .auth-card { padding: 23px 20px; }
}

/* ===== Step 4: management of color houses and classrooms ===== */
.brand-link, .header-link { color: inherit; text-decoration: none; }
.brand-link:hover, .header-link:hover { opacity: .9; }
.header-link { font-size: 13px; border: 1px solid #ffffff55; border-radius: 100px; padding: 7px 13px; }
.module-link { display: block; color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.module-link:hover { border-color: #0d987f; transform: translateY(-2px); }
.module-ready { display: inline-block; margin-top: 10px; color: #08765d; font-weight: 700; font-size: 12px; }
.management { padding-bottom: 35px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 27px; }
.page-heading h1 { font-size: clamp(23px, 2.7vw, 32px); margin: 5px 0; }
.page-heading p, .section-heading p { color: #748391; font-size: 14px; margin: 0; }
.eyebrow { color: #0a896f; font-size: 12px; font-weight: 700; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 22px 0 29px; }
.mini-stat { background: #fff; border: 1px solid #e5ebf0; padding: 17px 19px; border-radius: 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mini-stat span { color: #5d7180; font-size: 14px; }
.mini-stat strong { font-size: 24px; color: #12634f; }
.management-section { scroll-margin-top: 20px; margin-bottom: 30px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap; margin: 0 0 14px; }
.section-heading h2 { font-size: 21px; margin: 0 0 4px; }
.section-heading form { margin: 0; }
.management-grid { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(340px, 1.35fr); gap: 17px; align-items: start; }
.panel { background: #fff; border: 1px solid #e3eaf0; border-radius: 17px; padding: 23px; box-shadow: 0 5px 18px #0f2e4209; min-width: 0; }
.panel h3 { font-size: 18px; margin: 0 0 17px; }
.panel label:not(.check-label) { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 7px; }
.panel input:not([type="hidden"]):not([type="checkbox"]), .panel select { display: block; width: 100%; min-width: 0; background: #fff; border: 1px solid #d8e1e8; border-radius: 11px; padding: 10px 12px; color: #23394b; outline: none; font: inherit; }
.panel input:focus, .panel select:focus { border-color: #12967d; box-shadow: 0 0 0 3px #12967d19; }
.panel input[type="color"] { padding: 3px !important; height: 44px; cursor: pointer; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.check-label { display: flex; gap: 9px; align-items: center; margin: 18px 0; font-size: 13px; }
.check-label input { accent-color: #08765d; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid transparent; border-radius: 10px; font: inherit; font-weight: 600; font-size: 13px; line-height: 1.5; padding: 10px 15px; text-decoration: none; cursor: pointer; text-align: center; }
.btn-primary { color: #fff; background: linear-gradient(110deg,#08765d,#0d4b59); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { color: #496171; background: #fff; border-color: #cfdde6; }
.btn-secondary:hover { background: #f2f7f8; }
.btn-soft { color: #086c56; background: #e7f6f0; border-color: #bee5d5; }
.btn-soft:hover { background: #d6efe5; }
.btn-danger { color: #fff; background: #b73a49; }
.btn-danger-outline { color: #af3446; background: #fff; border-color: #f1bdc6; }
.house-list { display: grid; gap: 11px; }
.house-row { display: flex; align-items: center; gap: 10px; padding: 10px; background: #f8fafb; border: 1px solid #e7edf1; border-radius: 12px; }
.panel .color-preview { width: 38px !important; min-width: 38px !important; height: 38px !important; padding: 2px !important; border-radius: 9px; opacity: 1; cursor: default; }
.house-info { display: grid; gap: 2px; flex: 1; min-width: 0; }
.house-info strong { font-size: 14px; overflow-wrap: anywhere; }
.house-info small, .room-group-title small { font-size: 11px; color: #7b8895; }
.inline-actions { display: flex; gap: 9px; }
.inline-actions a { color: #0a8069; font-size: 12px; font-weight: 600; text-decoration: none; }
.inline-actions a:hover { text-decoration: underline; }
.inline-actions .danger-link { color: #ad3d4d; }
.muted, .empty-state { color: #82919c; font-size: 13px; }
.empty-state { background: #f5f8fa; border-radius: 12px; padding: 16px; }
.confirm-box { background: #fff6f6; border: 1px solid #f4c8d0; border-radius: 12px; padding: 15px; margin-top: 18px; }
.confirm-box strong { color: #a22b3f; font-size: 14px; }
.confirm-box p { font-size: 12px; color: #8f5862; margin: 6px 0; }
.room-group { border-bottom: 1px solid #edf1f4; padding: 12px 0; }
.room-group:last-child { border-bottom: 0; }
.room-group-title { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.room-group-title strong { font-size: 14px; }
.room-group-title small { margin-left: auto; }
.room-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.room-chip { display: inline-flex; background: #e9f6f0; border: 1px solid #cce8dc; color: #086e56; border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 600; text-decoration: none; }
.room-chip:hover { background: #d7efdf; }
.room-chip-unassigned { background: #f1f4f7; border-color: #e2e8ee; color: #536878; }
@media(max-width:900px) { .management-grid { grid-template-columns: 1fr; } .mini-stats { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:540px) { .page-heading { align-items: flex-start; } .panel { padding: 17px; } .mini-stats { gap: 8px; } .mini-stat { padding: 12px; } .mini-stat strong { font-size: 19px; } .mini-stat span { font-size: 12px; } .section-heading form { width: 100%; } .section-heading form .btn { width: 100%; } .header-link { font-size: 12px; padding: 6px 10px; } .house-row { flex-wrap: wrap; } .inline-actions { margin-left: 45px; } }
