:root {
  --navy-950: #06142f;
  --navy-900: #0a2148;
  --navy-800: #123a70;
  --blue-600: #1477d4;
  --blue-500: #22a6ee;
  --cyan-400: #67e8f9;
  --ice-100: #eaf8ff;
  --ice-50: #f6fcff;
  --ink: #10213b;
  --muted: #63758d;
  --line: #d8e8f4;
  --white: #ffffff;
  --success: #15936c;
  --warning: #d98408;
  --danger: #d04457;
  --shadow: 0 18px 48px rgba(16, 55, 99, .13);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(103, 232, 249, .25), transparent 27rem),
    radial-gradient(circle at 88% 18%, rgba(34, 166, 238, .16), transparent 28rem),
    linear-gradient(180deg, var(--ice-50), #edf7fd 70%, #e7f3fa);
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, sans-serif;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(216, 232, 244, .82);
  background: rgba(246, 252, 255, .86);
  backdrop-filter: blur(18px);
}
.header-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 74px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy-950);
  text-decoration: none;
  font-weight: 900;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: white;
  background: linear-gradient(145deg, var(--blue-500), var(--navy-800));
  box-shadow: 0 10px 24px rgba(20, 119, 212, .25);
  font-size: 22px;
}
.brand-copy { line-height: 1.15; }
.brand-copy small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.button {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  padding: 0 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.button:hover { transform: translateY(-2px); }
.button:focus-visible, .icon-button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(34, 166, 238, .26);
  outline-offset: 2px;
}
.button-primary { color: white; background: linear-gradient(135deg, var(--blue-600), var(--navy-800)); box-shadow: 0 12px 24px rgba(18, 58, 112, .22); }
.button-secondary { color: var(--navy-800); background: white; border: 1px solid var(--line); }
.button-danger { color: white; background: var(--danger); }
.button-small { min-height: 38px; padding: 0 14px; font-size: 13px; }
.button-block { width: 100%; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--navy-800); }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 70px; }
.page-heading { margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--blue-600); font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; color: var(--navy-950); font-size: clamp(30px, 5vw, 52px); line-height: 1.12; }
h2 { color: var(--navy-950); font-size: clamp(22px, 3vw, 30px); }
.subheading { max-width: 720px; color: var(--muted); font-size: 17px; line-height: 1.75; }

.card { border: 1px solid rgba(199, 222, 237, .9); border-radius: var(--radius-lg); background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.card-body { padding: 24px; }
.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-header h2, .section-header h3 { margin-bottom: 4px; }
.section-header p { margin-bottom: 0; color: var(--muted); }

.field { display: grid; gap: 8px; }
.field label, .field-label { color: var(--navy-800); font-size: 13px; font-weight: 800; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #c9deeb;
  border-radius: 13px;
  padding: 11px 14px;
  color: var(--ink);
  background: white;
}
.field textarea { min-height: 92px; resize: vertical; }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.status-pill, .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}
.status-pill { color: #0b6d52; background: #dcf7ee; }
.status-warning { color: #975908; background: #fff0cf; }
.status-muted { color: #52677e; background: #edf3f7; }
.tag { color: var(--blue-600); background: #e7f5ff; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { padding: 20px; }
.stat-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 13px; color: white; background: linear-gradient(145deg, var(--blue-500), var(--navy-800)); }
.stat-icon.has-art, .course-icon.has-art { overflow: hidden; padding: 0; background: rgba(226,247,255,.12); }
.stat-icon.has-art img, .course-icon.has-art img { width: 100%; height: 100%; object-fit: contain; }
.section-with-art { display: flex; align-items: center; gap: 14px; }
.feature-art { width: 58px; height: 58px; flex: 0 0 auto; object-fit: contain; filter: drop-shadow(0 8px 13px rgba(0,19,53,.4)); }
.stat-value { margin-bottom: 3px; color: var(--navy-950); font-size: 28px; font-weight: 900; }
.stat-label { color: var(--muted); font-size: 13px; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 14px 15px; border-bottom: 1px solid #e6eff5; text-align: left; vertical-align: middle; }
th { color: var(--navy-800); background: #f3f9fd; font-size: 12px; white-space: nowrap; }
td { font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
.number { font-variant-numeric: tabular-nums; text-align: right; }
.score-input { width: 76px; min-height: 38px; border: 1px solid #c9deeb; border-radius: 10px; padding: 7px 9px; text-align: right; }

.progress-track { height: 9px; overflow: hidden; border-radius: 999px; background: #e4edf3; }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-500), var(--success)); }
.empty-state { padding: 34px; color: var(--muted); text-align: center; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: min(390px, calc(100% - 40px));
  border-radius: 14px;
  padding: 14px 17px;
  color: white;
  background: var(--navy-950);
  box-shadow: 0 18px 45px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: .22s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

.site-footer { padding: 28px 16px; color: var(--muted); text-align: center; font-size: 12px; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .header-inner, .page-shell { width: min(100% - 24px, 1180px); }
  .header-inner { min-height: 66px; }
  .brand-copy small { display: none; }
  .header-actions .button span.mobile-hide { display: none; }
  .page-shell { padding-top: 28px; }
  .form-grid, .stat-grid { grid-template-columns: 1fr; }
  .card-body { padding: 18px; }
  .section-header { align-items: stretch; flex-direction: column; }
  .section-header .button { width: 100%; }
}

/* Frozen classroom theme — adapted from the original ห้อง 4/2 website */
body {
  color: #eefaff;
  background:
    radial-gradient(ellipse at 22% 2%, rgba(46, 153, 224, .62), transparent 34rem),
    radial-gradient(ellipse at 88% 38%, rgba(90, 99, 225, .25), transparent 33rem),
    linear-gradient(155deg, #020c20, #08275a 48%, #04152f);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .11;
  background-image: url("/assets/images/frozen/snowflake_transparent.png");
  background-size: 180px;
  background-position: -30px 20px;
  filter: saturate(.55) brightness(1.7);
}
.site-header {
  border-color: rgba(180, 231, 255, .18);
  background: rgba(2, 14, 38, .78);
  box-shadow: 0 12px 35px rgba(0, 4, 20, .22);
}
.brand { color: #fff; }
.brand-mark { width: 54px; height: 54px; padding: 0; overflow: hidden; background: transparent; box-shadow: none; filter: drop-shadow(0 8px 10px #00132f); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-copy small, .site-footer { color: #a9cce2; }
.button-primary { border: 1px solid #82e1ff; background: linear-gradient(145deg, #2bb7ef, #0754a9 70%); box-shadow: inset 0 2px 2px rgba(255,255,255,.4), 0 13px 28px rgba(0,68,148,.35); }
.button-secondary, .icon-button { color: #eafbff; border-color: rgba(191,234,255,.3); background: linear-gradient(145deg,rgba(255,255,255,.14),rgba(74,157,220,.09)); }
.eyebrow { color: #8fe5ff; }
h1, h2, h3 { color: #f7fdff; }
.subheading, .section-header p, .field-hint, .empty-state { color: #a9c8dd; }
.card {
  border-color: rgba(180, 231, 255, .24);
  background: linear-gradient(145deg, rgba(166,224,255,.16), rgba(5,39,81,.76) 52%, rgba(41,121,180,.14));
  box-shadow: 0 28px 70px rgba(0,12,40,.43), inset 0 1px 1px rgba(255,255,255,.25);
  backdrop-filter: blur(22px);
}
.field label, .field-label { color: #c9e8f8; }
.field input, .field select, .field textarea, .score-input, .assessment-table input, .assessment-table select {
  color: #fff;
  border-color: rgba(174,227,255,.28);
  background: rgba(0,18,48,.58);
}
input::placeholder, textarea::placeholder { color: #7ea4bf; }
.tag { color: #d9f5ff; background: rgba(117, 216, 255, .17); }
.stat-value { color: #f7fdff; }
.stat-label { color: #9fc3dc; }
.stat-icon { border: 1px solid rgba(201,246,255,.45); background: linear-gradient(145deg,#49c8f5,#0a4b9b); box-shadow: inset 0 1px 3px #e5fbff, 0 10px 25px rgba(0,38,93,.38); }
.table-wrap { border-color: rgba(180,231,255,.22); background: rgba(2,18,44,.45); }
th { color: #bfe9fb; background: #092750; }
td { color: #edfaff; border-color: rgba(180,231,255,.1); background: rgba(2,20,48,.28); }
tbody tr:hover td { background: rgba(72,151,207,.12); }
.progress-track { background: #03142e; }
.progress-bar { background: linear-gradient(90deg,#3ed2ff,#7d8fff); box-shadow: 0 0 14px rgba(76,207,255,.62); }
.status-muted { color: #bdd6e6; background: rgba(122,154,179,.18); }
.toast { color: #062650; background: #eafaff; }
@media (max-width: 640px) {
  .brand-mark { width: 48px; height: 48px; }
  .brand-copy { font-size: 14px; }
}
