:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #1f2937;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #d9e0e8;
  --line-strong: #c5ced8;
  --blue: #2563eb;
  --blue-soft: #e8f0ff;
  --teal: #0f766e;
  --teal-soft: #e6f5f3;
  --amber: #b45309;
  --amber-soft: #fff3d7;
  --rose: #be123c;
  --rose-soft: #ffe8ee;
  --green: #16803c;
  --green-soft: #e7f6ec;
  --purple: #6d28d9;
  --purple-soft: #f0e8ff;
  --shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
  --shadow-sm: 0 3px 10px rgba(31, 41, 55, 0.06);
  --radius: 8px;
  --transition: 160ms ease;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.05), transparent 260px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.45;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

body[data-classroom-mode="1"] .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body[data-classroom-mode="1"] .sidebar {
  display: none;
}

body[data-classroom-mode="1"] .workspace {
  padding: 20px clamp(16px, 3vw, 40px) 36px;
}

body[data-classroom-mode="1"] .page-desc {
  display: none;
}

body[data-classroom-mode="1"] #section-overview .layout-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

body[data-classroom-mode="1"] #overviewQuickGrid {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

body[data-classroom-mode="1"] #overviewQuickGrid .quick-score-card {
  min-height: 112px;
  padding: 18px;
}

body[data-classroom-mode="1"] #overviewQuickGrid .quick-score-label {
  font-size: 17px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 6px 14px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: #ffffff;
  display: grid;
  place-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.brand-logo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #0f8f67;
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
}

.brand-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-button {
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
  text-align: left;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}

.nav-button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.nav-button.active {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(102, 112, 133, 0.12);
  flex: 0 0 auto;
}

.nav-button.active .nav-icon {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.sidebar-footer strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.sidebar-footer span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  min-width: 0;
  padding: 22px 26px 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.page-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.page-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.18;
}

.page-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.topbar-class-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.topbar-class-switch .select.compact {
  min-width: 132px;
  max-width: 180px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}

.topbar-class-add {
  white-space: nowrap;
}

.topbar-class-quota {
  white-space: nowrap;
}

.preset-group-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.preset-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.publish-badge-done {
  background: #dcfce7;
  color: #166534;
}

.publish-badge-draft {
  background: #fef3c7;
  color: #92400e;
}

.award-row.preview {
  border-style: dashed;
}

.award-row.published {
  border-color: #f0d7a6;
  background: #fffdf7;
}

.award-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.award-row .award-main {
  min-width: 0;
}

.award-row.manual {
  border-color: #93c5fd;
  background: #f8fbff;
}

.monthly-override-list {
  display: grid;
  gap: 10px;
}

.monthly-override-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.status-pill,
.small-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.online {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.offline {
  background: var(--rose-soft);
  color: var(--rose);
}

.status-pill.syncing {
  background: var(--amber-soft);
  color: var(--amber);
}

.small-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

.tag.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.tag.teal {
  background: var(--teal-soft);
  color: var(--teal);
}

.tag.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.tag.rose {
  background: var(--rose-soft);
  color: var(--rose);
}

.tag.purple {
  background: var(--purple-soft);
  color: var(--purple);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.btn {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 13px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(31, 41, 55, 0.05);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: var(--blue);
  color: #ffffff;
}

.btn.success {
  background: var(--teal);
  color: #ffffff;
}

.btn.danger {
  background: var(--rose);
  color: #ffffff;
}

.btn.ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

.btn.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: background var(--transition), transform var(--transition);
}

.icon-button:hover {
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat-tile,
.panel,
.data-table,
.modal {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
}

.stat-tile {
  padding: 15px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.stat-tile::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
}

.stat-tile.teal::after {
  background: rgba(15, 118, 110, 0.1);
}

.stat-tile.amber::after {
  background: rgba(180, 83, 9, 0.1);
}

.stat-tile.rose::after {
  background: rgba(190, 18, 60, 0.1);
}

.stat-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 17px;
}

.stat-tile.teal .stat-icon {
  background: var(--teal-soft);
  color: var(--teal);
}

.stat-tile.amber .stat-icon {
  background: var(--amber-soft);
  color: var(--amber);
}

.stat-tile.rose .stat-icon {
  background: var(--rose-soft);
  color: var(--rose);
}

.stat-value {
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
  font-weight: 850;
}

.stat-note {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 14px;
}

.panel {
  overflow: hidden;
}

.panel-header {
  padding: 15px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 850;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 15px 16px 16px;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.quick-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 11px;
  cursor: pointer;
  text-align: left;
  min-height: 82px;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.quick-card:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.quick-card.positive {
  border-left: 4px solid var(--green);
}

.quick-card.negative {
  border-left: 4px solid var(--rose);
}

.quick-card strong {
  display: block;
  margin-top: 7px;
  font-size: 13px;
}

.quick-card span {
  color: var(--muted);
  font-size: 12px;
}

.quick-card .score {
  float: right;
  font-weight: 850;
  color: var(--green);
}

.quick-card.negative .score {
  color: var(--rose);
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
}

.field,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
  min-height: 38px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field:focus,
.textarea:focus,
.select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.filter-date .field {
  width: 142px;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.student-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 88px;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 25px;
  font-weight: 850;
  box-shadow: inset 0 -8px 18px rgba(37, 99, 235, 0.08);
  overflow: hidden;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

.avatar.teal {
  background: var(--teal-soft);
  color: var(--teal);
}

.avatar.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.avatar.rose {
  background: var(--rose-soft);
  color: var(--rose);
}

.avatar.purple {
  background: var(--purple-soft);
  color: var(--purple);
}

.student-name {
  min-width: 0;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.badge-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.student-table-person .badge-strip {
  margin-top: 7px;
}

.student-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 118px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #f5d58a;
  border-radius: 999px;
  background: #fff7df;
  color: #8a5a00;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.student-badge span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-badge.large {
  max-width: none;
  min-height: 32px;
  padding: 6px 11px;
  font-size: 13px;
}

.points-badge {
  min-width: 56px;
  text-align: center;
  border-radius: var(--radius);
  padding: 8px 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 18px;
  font-weight: 850;
}

.points-badge.negative {
  background: var(--rose-soft);
  color: var(--rose);
}

.points-badge.neutral {
  background: var(--surface-soft);
  color: var(--muted);
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
  margin-top: 7px;
}

.progress > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.rank-list,
.history-list,
.group-list,
.award-list {
  display: grid;
  gap: 8px;
}

.rank-row,
.history-row,
.group-row,
.award-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
  display: grid;
  align-items: center;
  gap: 9px;
}

.rank-row {
  grid-template-columns: 34px minmax(0, 1fr) 64px;
}

.rank-no {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 850;
}

.rank-title,
.history-title,
.group-title,
.award-title {
  min-width: 0;
  font-weight: 850;
}

.rank-sub,
.history-sub,
.group-sub,
.award-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.rank-score {
  text-align: right;
  font-weight: 850;
}

.history-row {
  grid-template-columns: 56px minmax(0, 1fr) auto;
}

.history-row.voided,
.overview-history-row.voided {
  background: var(--surface-soft);
  opacity: 0.82;
}

.history-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.history-score {
  border-radius: var(--radius);
  padding: 7px 8px;
  text-align: center;
  font-weight: 850;
}

.history-score.plus {
  background: var(--green-soft);
  color: var(--green);
}

.history-score.minus {
  background: var(--rose-soft);
  color: var(--rose);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.check-inline {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.group-row {
  grid-template-columns: 12px minmax(0, 1fr) auto;
}

.group-dot {
  width: 12px;
  height: 42px;
  border-radius: 999px;
  background: var(--blue);
}

.member-strip {
  display: flex;
  margin-top: 8px;
}

.member-strip .mini-avatar {
  margin-left: -7px;
}

.member-strip .mini-avatar:first-child {
  margin-left: 0;
}

.mini-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
}

.mini-avatar.image {
  background: #ffffff;
}

.mini-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

.award-row {
  grid-template-columns: 40px minmax(0, 1fr);
}

.award-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 20px;
  overflow: hidden;
}

.award-icon-img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
}

.empty-state-img {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  object-fit: cover;
  display: block;
  margin: 0 auto 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.empty-state strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.hidden {
  display: none !important;
}

.compact-number {
  width: 82px;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.08), transparent 280px),
    var(--bg);
}

.auth-screen.open {
  display: grid;
}

.auth-card {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 22px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.auth-logo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.auth-brand h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.auth-brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-message {
  margin-bottom: 12px;
  border: 1px solid var(--amber-soft);
  border-radius: var(--radius);
  background: #fffbeb;
  color: var(--amber);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 750;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 850;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.split-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.settings-tabs {
  margin-bottom: 18px;
}

.category-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.category-tab-note {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.72;
}

.category-tab.active .category-tab-note {
  opacity: 0.85;
}

.category-tab.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.settings-grid {
  display: grid;
  gap: 10px;
}

.monthly-report {
  color: var(--ink);
}

.report-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.report-kicker,
.report-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.report-heading h2 {
  margin: 4px 0 0;
  font-size: 28px;
  letter-spacing: 0;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.report-grid h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.report-list {
  margin: 0;
  padding-left: 22px;
}

.report-list li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.report-list li span {
  display: inline-block;
  min-width: 120px;
}

.report-list strong {
  float: right;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.report-table th,
.report-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

.report-table th {
  background: var(--subtle);
}

.setting-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.teacher-form {
  align-items: stretch;
  margin-bottom: 12px;
}

.teacher-form .field,
.teacher-form .select {
  min-width: 140px;
}

.teacher-list {
  display: grid;
  gap: 8px;
}

.teacher-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
}

.teacher-row.inactive {
  background: var(--surface-soft);
  color: var(--muted);
}

.teacher-title {
  font-weight: 850;
}

.teacher-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.teacher-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.maintenance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.maintenance-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
}

.maintenance-tile strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.maintenance-tile span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.small-select {
  min-height: 32px;
  padding: 5px 28px 5px 9px;
  font-size: 13px;
}

.setting-label {
  font-weight: 850;
}

.setting-desc {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  display: none;
  place-items: center;
  padding: 18px;
  z-index: 30;
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  width: min(620px, 100%);
  max-height: min(760px, 88vh);
  overflow: auto;
}

.modal-header,
.modal-footer {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.modal-title {
  margin: 0;
  font-size: 17px;
}

.modal-body {
  padding: 16px;
}

.checkbox-list {
  max-height: 340px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.check-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 40;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  padding: 11px 12px;
  box-shadow: var(--shadow);
  font-weight: 750;
}

.toast.success {
  background: var(--teal);
}

.toast.error {
  background: var(--rose);
}

.toast.warning {
  background: var(--amber);
}

.global-loading {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  display: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 850;
}

body[data-loading="1"] .global-loading {
  display: inline-flex;
}

.design-frame-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 10px;
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

/* Generated-design alignment */
body {
  background: #f6f8fb;
}

.app-shell {
  grid-template-columns: 220px minmax(0, 1fr);
}

.sidebar {
  padding: 14px 12px;
  background: #ffffff;
  box-shadow: none;
  gap: 16px;
}

.brand {
  height: 50px;
  padding: 0 2px 12px;
  border-bottom: 1px solid #e5eaf1;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #ffffff;
  font-size: 0;
}

.brand-mark::before {
  content: none;
}

.brand-title {
  font-size: 17px;
  letter-spacing: 0;
}

.brand-subtitle {
  display: none;
}

.nav-list {
  gap: 10px;
}

.nav-button {
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 7px;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
}

.nav-button.active {
  background: #2563eb;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.nav-icon {
  width: 24px;
  height: 24px;
  background: transparent;
  filter: grayscale(1);
  font-size: 18px;
}

.nav-button.active .nav-icon {
  background: transparent;
  filter: grayscale(1) brightness(3);
}

.sidebar-footer {
  display: none;
}

.workspace {
  padding: 0 24px 36px;
}

.topbar {
  min-height: 64px;
  align-items: center;
  margin: 0 -24px 20px;
  padding: 0 24px;
  border-bottom: 1px solid #e5eaf1;
  background: #ffffff;
}

.page-kicker {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  font-weight: 900;
}

.page-title,
.page-desc {
  display: none;
}

.top-actions {
  gap: 14px;
}

.status-pill {
  min-height: auto;
  padding: 0;
  background: transparent !important;
  border: 0;
  color: #166534 !important;
  font-size: 13px;
}

.date-pill {
  min-height: 38px;
  padding: 7px 16px;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  box-shadow: 0 0 0 1px #e0e7ef;
}

.date-pill::before {
  content: "▣";
  color: #64748b;
}

.teacher-menu {
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #0f172a;
  font-weight: 900;
  cursor: pointer;
}

.teacher-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  box-shadow: 0 0 0 2px #e0f2fe;
}

.teacher-avatar-fallback {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 950;
  box-shadow: 0 0 0 2px #e0f2fe;
}

.teacher-caret {
  color: #64748b;
  font-size: 12px;
}

.overview-layout {
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 0;
}

.stat-watch-hidden {
  display: none;
}

.stat-tile,
.panel,
.modal {
  border-color: #dfe7f1;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045);
}

.stat-tile {
  min-height: 132px;
  padding: 18px 20px;
}

.stat-tile::after {
  width: 70px;
  height: 70px;
  right: 18px;
  top: 20px;
  background: transparent;
}

.stat-top {
  color: #64748b;
  font-size: 13px;
}

.stat-icon {
  width: 34px;
  height: 34px;
  background: transparent !important;
  font-size: 26px;
}

.stat-value {
  margin-top: 22px;
  color: #0f172a;
  font-size: 34px;
  letter-spacing: 0;
}

.stat-note {
  margin-top: 8px;
  font-size: 14px;
}

.panel {
  border-radius: 8px;
}

.panel-header {
  min-height: 72px;
  padding: 16px 20px;
}

.panel-title {
  font-size: 17px;
  color: #0f172a;
}

.panel-title-icon {
  color: #2563eb;
}

.panel-subtitle {
  margin-top: 5px;
  color: #64748b;
  font-size: 13px;
}

.panel-body {
  padding: 18px 20px 20px;
}

.btn {
  min-height: 38px;
  border-radius: 7px;
}

.btn.primary {
  background: #2563eb;
}

.btn.ghost {
  color: #475569;
  background: #ffffff;
  border-color: #d8e1ec;
}

.quick-score-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.quick-score-card {
  min-height: 78px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: 1fr auto;
  align-items: center;
  justify-content: center;
  column-gap: 12px;
  row-gap: 1px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.quick-score-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.quick-score-card.good {
  background: #effdf4;
  border-color: #91d6a8;
  color: #15803d;
}

.quick-score-card.neutral {
  background: #fffbeb;
  border-color: #f6c76c;
  color: #b45309;
}

.quick-score-card.bad {
  background: #fff1f2;
  border-color: #f4a5b7;
  color: #be123c;
}

.quick-score-icon {
  grid-row: 1 / 3;
  font-size: 28px;
}

.quick-score-value {
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
}

.quick-score-label {
  color: currentColor;
  font-size: 13px;
  font-weight: 850;
}

#overviewStudents.student-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.growth-card {
  min-height: 154px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px 14px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
}

.portrait-avatar,
.mini-face {
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #e0f2fe, #dbeafe);
  box-shadow: inset 0 -8px 16px rgba(37, 99, 235, 0.08);
  overflow: hidden;
}

.portrait-avatar {
  width: 48px;
  height: 48px;
  font-size: 28px;
}

.mini-face {
  width: 32px;
  height: 32px;
  font-size: 18px;
}

.portrait-avatar-img,
.mini-face-img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

.growth-card-main {
  min-width: 0;
}

.growth-card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.growth-points {
  color: #15803d;
  font-size: 20px;
  font-weight: 950;
}

.growth-stage {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.growth-stage.amber {
  background: #fff0d6;
  color: #b45309;
  border: 1px solid #f0c98f;
}

.growth-stage.teal {
  background: #e7f8f1;
  color: #047857;
  border: 1px solid #a7e2c6;
}

.growth-stage.rose {
  background: #ffe8ee;
  color: #be123c;
  border: 1px solid #f8b5c4;
}

.growth-progress {
  height: 7px;
  margin-top: 16px;
}

.growth-progress > span {
  background: #2563eb;
}

.growth-value {
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
}

.overview-rank-row {
  display: grid;
  grid-template-columns: 32px minmax(88px, 1fr) 88px 84px;
  align-items: center;
  min-height: 38px;
  padding: 0 8px;
  border-bottom: 1px solid #edf1f6;
  column-gap: 8px;
  font-size: 13px;
}

.overview-rank-row:last-child {
  border-bottom: 0;
}

.overview-rank-no {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #f8fafc;
  color: #64748b;
  font-weight: 950;
}

.overview-rank-no.rank-gold {
  background: #fff3d7;
  color: #d97706;
}

.overview-rank-no.rank-blue {
  background: #e8f0ff;
  color: #2563eb;
}

.overview-rank-no.rank-orange {
  background: #ffeadb;
  color: #ea580c;
}

.overview-rank-name {
  color: #0f172a;
  font-weight: 900;
}

.overview-rank-total {
  color: #475569;
  text-align: right;
}

.overview-rank-avg {
  color: #64748b;
  text-align: right;
}

.overview-rank-avg strong {
  color: #15803d;
}

.overview-history-row {
  display: grid;
  grid-template-columns: 44px 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-bottom: 1px solid #edf1f6;
}

.overview-history-row:last-child {
  border-bottom: 0;
}

.overview-history-time {
  min-width: 74px;
  text-align: right;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.overview-history-time span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-weight: 700;
}

.overview-award-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.overview-award-grid-six {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .overview-award-grid-six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.overview-award-card {
  min-height: 136px;
  border: 1px solid #f0dfc7;
  border-radius: 8px;
  background: #fffaf2;
  padding: 16px 10px;
  text-align: center;
}

.overview-award-icon {
  font-size: 30px;
  line-height: 1;
}

.overview-award-img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

.image-fallback {
  display: inline-grid;
  place-items: center;
  background: var(--surface-soft);
  color: currentColor;
  font-weight: 900;
  line-height: 1;
  object-fit: initial;
}

.overview-award-title {
  margin-top: 10px;
  color: #7c2d12;
  font-weight: 950;
}

.overview-award-name {
  margin-top: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
}

.overview-award-stat {
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
}

/* Product UI polish inspired by docs/ui-design */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --subtle: #94a3b8;
  --line: #dfe7f1;
  --line-strong: #cbd5e1;
  --blue: #2563eb;
  --blue-soft: #eaf2ff;
  --teal: #0f8f67;
  --teal-soft: #e8f8f1;
  --amber: #b7791f;
  --amber-soft: #fff5dd;
  --rose: #be123c;
  --rose-soft: #fff1f3;
  --green: #11905f;
  --green-soft: #e8f8ef;
  --purple: #6d5bd0;
  --purple-soft: #f0edff;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.055);
}

body {
  background:
    linear-gradient(180deg, #f8fbff 0, #f6f8fb 260px),
    #f6f8fb;
  color: #0f172a;
}

.app-shell {
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  padding: 16px 14px;
  border-right-color: #e4ebf4;
  background: #ffffff;
}

.brand {
  min-height: 58px;
  padding: 4px 4px 16px;
}

.brand-title {
  font-size: 18px;
}

.nav-list {
  gap: 7px;
}

.nav-button {
  min-height: 44px;
  border-radius: 8px;
  color: #53627a;
  padding: 10px 12px;
}

.nav-button:hover {
  background: #f3f7fb;
  color: #0f172a;
}

.nav-button.active {
  background: linear-gradient(180deg, #10a86f, #0b8e5f);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(10, 142, 95, 0.23);
}

.nav-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
  filter: none;
}

.nav-button.active .nav-icon {
  background: rgba(255, 255, 255, 0.18);
  filter: none;
}

.workspace {
  padding: 0 28px 44px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  margin: 0 -28px 22px;
  padding: 0 28px;
  border-bottom: 1px solid #e5edf6;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.page-kicker {
  font-size: 17px;
  font-weight: 950;
}

.teacher-menu {
  min-height: 40px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
}

.teacher-menu:hover {
  background: #f3f7fb;
}

.status-pill.online,
.status-pill.syncing,
.status-pill.offline {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 900;
}

.status-pill.online {
  background: #e8f8ef !important;
  border-color: #bdebd1;
}

.status-pill.syncing {
  background: #fff6df !important;
  border-color: #f4d99b;
  color: #b7791f !important;
}

.status-pill.offline {
  background: #fff1f3 !important;
  border-color: #f5bcc8;
  color: #be123c !important;
}

.date-pill {
  color: #475569;
  background: #f8fafc;
}

.layout-grid {
  gap: 18px;
}

.overview-layout {
  grid-template-columns: minmax(0, 1fr) 356px;
}

.stack {
  gap: 18px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-tile,
.panel,
.modal,
.data-table {
  border-color: #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
}

.stat-tile {
  min-height: 118px;
  padding: 18px 18px 16px;
}

.stat-tile::after {
  display: none;
}

.stat-top {
  align-items: center;
  color: #52627a;
  font-size: 13px;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #0f8f67;
  background: #e8f8ef !important;
  font-size: 22px;
}

.stat-tile.teal .stat-icon {
  color: #2563eb;
  background: #eaf2ff !important;
}

.stat-tile.amber .stat-icon {
  color: #b7791f;
  background: #fff5dd !important;
}

.stat-tile.rose .stat-icon {
  color: #be123c;
  background: #fff1f3 !important;
}

.stat-value {
  color: #0f172a;
  font-size: 34px;
  font-weight: 950;
}

.stat-denominator {
  color: #64748b;
  font-size: 18px;
  font-weight: 850;
}

.stat-note {
  color: #64748b;
  font-size: 13px;
}

.panel-header {
  min-height: 70px;
  padding: 16px 18px;
}

.panel-title {
  font-size: 17px;
  font-weight: 950;
}

.panel-subtitle {
  color: #64748b;
}

.panel-body {
  padding: 18px;
}

.btn {
  border-radius: 8px;
  font-weight: 900;
  box-shadow: none;
}

.btn.primary {
  background: #0f8f67;
  border-color: #0f8f67;
}

.btn.primary:hover {
  box-shadow: 0 10px 22px rgba(15, 143, 103, 0.22);
}

#classroomModeButton.primary {
  background: #0f8f67;
  border-color: #0f8f67;
  color: #ffffff;
}

#classroomModeButton.ghost {
  background: #ffffff;
  color: #334155;
}

.btn.ghost {
  background: #ffffff;
}

.btn.danger {
  background: #c92745;
  border-color: #c92745;
}

.field,
.textarea,
.select {
  border-color: #d7e1ec;
  border-radius: 8px;
  background: #ffffff;
}

.field:focus,
.textarea:focus,
.select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.quick-score-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quick-score-card {
  min-height: 84px;
  border-radius: 8px;
}

.quick-score-card.good {
  background: #f0fbf5;
}

.quick-score-card.bad {
  background: #fff4f6;
}

.quick-score-value {
  font-size: 24px;
}

#overviewStudents.student-grid {
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
}

.growth-card {
  border-radius: 8px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.growth-card:hover,
.student-card:hover,
.group-row:hover,
.rank-row:hover,
.history-row:hover,
.teacher-row:hover,
.setting-row:hover {
  border-color: #cbd8e6;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.portrait-avatar {
  width: 54px;
  height: 54px;
}

.student-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

#section-students .student-grid {
  grid-template-columns: 1fr;
}

#section-students .layout-grid {
  grid-template-columns: minmax(0, 1fr);
}

#section-students .layout-grid > aside.stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#section-students .student-card {
  grid-template-columns: 56px minmax(0, 1fr) 78px;
  min-height: 82px;
}

.student-table-shell {
  overflow: hidden;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
}

.student-table-head,
.student-table-row {
  display: grid;
  grid-template-columns: 48px minmax(150px, 1.2fr) minmax(92px, 0.7fr) 76px minmax(130px, 0.9fr) minmax(145px, 1fr) minmax(220px, auto);
  align-items: center;
  column-gap: 10px;
}

.student-table-head {
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid #e7edf5;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 950;
}

.student-table-row {
  min-height: 78px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f7;
  transition: background var(--transition), box-shadow var(--transition);
}

.student-table-row:last-child {
  border-bottom: 0;
}

.student-table-row:hover {
  background: #fbfdff;
  box-shadow: inset 3px 0 0 #0f8f67;
}

.row-index {
  color: #64748b;
  font-size: 12px;
  font-weight: 950;
}

.muted-text {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.student-table-person {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-table-person .avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
}

.group-chip {
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid #dfe7f1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.group-chip::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--group-color);
  flex: 0 0 auto;
}

.growth-cell {
  min-width: 0;
}

.growth-cell .progress {
  margin-top: 8px;
}

.last-action-cell {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.last-action-cell strong {
  color: #0f8f67;
  font-weight: 950;
}

.last-action-cell span {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-table-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.danger-icon {
  color: #be123c;
}

.student-card {
  border-radius: 8px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.student-card .split-actions {
  padding-top: 6px;
  border-top: 1px solid #eef3f8;
}

.points-badge {
  border-radius: 8px;
}

.quick-grid {
  grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
  gap: 12px;
}

.quick-card {
  min-height: 116px;
  padding: 14px;
  border-radius: 8px;
  border-left-width: 1px;
}

.quick-card.positive {
  background: #f0fbf5;
  border-color: #bdebd1;
}

.quick-card.negative {
  background: #fff4f6;
  border-color: #f4b8c4;
}

.quick-card strong {
  margin-top: 10px;
  color: #0f172a;
  font-size: 14px;
}

.quick-card .score {
  min-width: 44px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(17, 144, 95, 0.1);
  text-align: center;
}

.quick-card.negative .score {
  background: rgba(190, 18, 60, 0.1);
}

.category-tab {
  min-height: 36px;
  border-radius: 8px;
  background: #ffffff;
}

.category-tab.active {
  background: #0f8f67;
  border-color: #0f8f67;
  color: #ffffff;
}

#section-history .panel-body > .filters {
  padding: 12px;
  border: 1px solid #e2eaf3;
  border-radius: 8px;
  background: #f8fafc;
}

.history-row {
  grid-template-columns: 62px minmax(0, 1fr) auto;
  min-height: 66px;
  border-radius: 8px;
}

#historyList .history-row,
#auditLogList .history-row {
  border-left: 4px solid transparent;
}

#historyList .history-row.plus {
  border-left-color: #16a34a;
}

#historyList .history-row.minus {
  border-left-color: #dc2626;
}

.history-row.voided,
.overview-history-row.voided {
  background: #f8fafc;
  color: #64748b;
}

.history-row.voided .history-title {
  text-decoration: line-through;
  text-decoration-color: #94a3b8;
}

.history-score {
  border-radius: 8px;
}

.rank-row,
.group-row,
.award-row,
.teacher-row,
.setting-row,
.maintenance-tile {
  border-radius: 8px;
}

.group-row {
  grid-template-columns: 14px minmax(0, 1fr) auto;
  padding: 14px;
}

.group-dot {
  width: 10px;
}

.award-row {
  min-height: 64px;
}

.overview-award-card {
  border-color: #f2dfbd;
}

#section-monthly .layout-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
}

.monthly-report-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.monthly-report {
  min-height: 520px;
  border: 1px solid #f0dfbd;
  border-radius: 8px;
  background: #fffdf8;
  padding: 22px;
}

.report-heading {
  border-bottom-color: #efd7a7;
}

.report-heading h2 {
  color: #9a5c10;
  font-size: 28px;
  line-height: 1.15;
  word-break: keep-all;
}

.report-grid > div {
  border: 1px solid #edf1f6;
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.report-table th {
  background: #fff5dd;
  color: #7c4a10;
}

.settings-tabs {
  position: sticky;
  top: 68px;
  z-index: 12;
  margin: -4px 0 18px;
  padding: 10px;
  border: 1px solid #e1e9f2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

#section-settings .layout-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
}

#section-settings .panel[data-settings-panel="class"],
#section-settings .panel[data-settings-panel="data"],
#section-settings .panel[data-settings-panel="points"],
#section-settings .panel[data-settings-panel="account"],
#section-settings .panel[data-settings-panel="audit"],
#section-settings .panel[data-settings-panel="status"] {
  grid-column: 1 / -1;
}

.data-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.data-action-card {
  min-height: 94px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.data-action-card:hover {
  border-color: #c6d4e3;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.data-action-card.primary-card {
  border-color: #bdebd1;
  background: #f0fbf5;
}

.data-action-card.danger-card {
  border-color: #f4b8c4;
  background: #fff4f6;
}

.data-action-card .btn {
  white-space: nowrap;
}

.data-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 950;
  letter-spacing: 0;
}

.data-action-icon.green {
  background: #dff7e8;
  color: #0f8f67;
}

.data-action-icon.blue {
  background: #e8f0ff;
  color: #2563eb;
}

.data-action-icon.amber {
  background: #fff3d7;
  color: #b45309;
}

.data-action-icon.teal {
  background: #e6f5f3;
  color: #0f766e;
}

.data-action-icon.rose {
  background: #ffe8ee;
  color: #be123c;
}

#backupPanel,
#maintenancePanel {
  grid-column: auto;
}

.backup-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.backup-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e8f0ff;
  color: #2563eb;
  font-size: 12px;
  font-weight: 950;
}

.backup-title {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-sub {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  overflow-wrap: anywhere;
}

#backupDirLabel {
  overflow-wrap: anywhere;
}

.backup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.setting-row {
  background: #ffffff;
}

.teacher-row {
  min-height: 58px;
}

.maintenance-tile {
  background: #f8fafc;
}

.maintenance-tile strong {
  margin-top: 2px;
  color: #0f172a;
  font-size: 18px;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);
}

.modal {
  width: min(560px, 100%);
  border-color: #dfe7f1;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.2);
}

.modal-header {
  min-height: 62px;
  padding: 18px 20px;
}

.modal-title {
  color: #0f172a;
  font-size: 18px;
  font-weight: 950;
}

.modal-body {
  padding: 18px 20px;
}

.modal-footer {
  padding: 16px 20px;
  background: #f8fafc;
}

.checkbox-list {
  max-height: 420px;
  gap: 10px;
}

.check-row {
  min-height: 54px;
  border-color: #dfe7f1;
  border-radius: 8px;
  padding: 10px 12px;
}

.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #0f8f67;
}

.check-row:hover {
  border-color: #b8c7d9;
  background: #f8fafc;
}

.toast {
  border-radius: 8px;
}

/* Full-page UI alignment pass */
.auth-screen {
  padding: clamp(24px, 4vw, 56px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(248, 251, 255, 0.88)),
    #f6f8fb;
}

.auth-layout {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.78fr);
  align-items: center;
  gap: 44px;
}

.auth-product {
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 36px;
}

.auth-brand-large {
  display: flex;
  align-items: center;
  gap: 22px;
}

.auth-logo-large {
  width: 86px;
  height: 86px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 18px 44px rgba(15, 143, 103, 0.18);
}

.auth-brand-large h1 {
  margin: 0;
  color: #0f172a;
  font-size: 44px;
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: 0;
}

.auth-brand-large p {
  margin: 12px 0 0;
  color: #475569;
  font-size: 17px;
  font-weight: 750;
}

.auth-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.auth-step {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  color: #64748b;
  border-right: 1px solid #edf2f7;
}

.auth-step:last-child {
  border-right: 0;
}

.auth-step strong {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef2f7;
  color: #475569;
  font-size: 18px;
}

.auth-step.active strong {
  background: #0f8f67;
  color: #ffffff;
}

.auth-step span {
  color: #0f172a;
  font-weight: 900;
}

.auth-safety {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  border: 1px solid #bdebd1;
  border-radius: 8px;
  background: #f0fbf5;
  padding: 24px;
}

.auth-safety-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #0f8f67;
  color: #ffffff;
  font-size: 24px;
  font-weight: 950;
}

.auth-safety h2 {
  margin: 0;
  font-size: 19px;
}

.auth-safety p {
  margin: 10px 0 0;
  color: #475569;
}

.auth-card {
  width: 100%;
  border-color: #dfe7f1;
  border-radius: 8px;
  padding: 34px;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.14);
}

.auth-card-head h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
}

.auth-card-head p {
  margin: 12px 0 0;
  color: #64748b;
}

.auth-form {
  gap: 16px;
  margin-top: 24px;
}

.auth-field-label {
  display: grid;
  gap: 8px;
  color: #0f172a;
  font-weight: 900;
}

.auth-field-label .field {
  min-height: 54px;
  padding: 13px 15px;
  font-size: 15px;
}

.auth-submit {
  min-height: 56px;
  margin-top: 8px;
  font-size: 17px;
}

.auth-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #edf2f7;
  color: #64748b;
  text-align: center;
  font-size: 13px;
}

#section-points .layout-grid {
  grid-template-columns: minmax(0, 1fr) 360px;
}

#section-points .quick-grid {
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 12px;
}

#section-points aside .quick-grid {
  grid-template-columns: 1fr;
}

#section-points .quick-card {
  min-height: 114px;
  border-width: 1px;
  border-left-width: 3px;
  padding: 14px;
}

#section-points .quick-card.positive {
  border-color: #bdebd1;
  background: #f0fbf5;
}

#section-points .quick-card.negative {
  border-color: #f4b8c4;
  background: #fff4f6;
}

#section-points .quick-card.tone-amber.positive {
  border-color: #f3d39a;
  background: #fff9ed;
}

#section-points .quick-card.tone-blue.positive {
  border-color: #bfdbfe;
  background: #eff6ff;
}

#section-points .quick-card strong {
  margin-top: 12px;
  color: #0f172a;
  font-size: 15px;
}

#section-points .quick-card-meta,
#section-points .quick-card-hint {
  display: block;
}

#section-points .quick-card-meta {
  color: #64748b;
  font-weight: 850;
}

#section-points .quick-card-hint {
  margin-top: 8px;
  color: #64748b;
}

#section-points .quick-card .score {
  min-width: 42px;
  border-radius: 999px;
}

#section-history .panel-body > .filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

#section-history #historySearchInput {
  flex: 1 1 260px;
  max-width: none !important;
}

#section-history #historyCategoryFilter {
  flex: 0 0 170px;
}

.history-table-shell {
  overflow: hidden;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
}

.history-table-head,
.history-table-shell .history-row {
  display: grid;
  grid-template-columns: 72px minmax(240px, 1fr) 132px 98px 108px 82px;
  align-items: center;
  column-gap: 12px;
}

.history-table-head {
  min-height: 42px;
  padding: 0 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e7edf5;
  color: #64748b;
  font-size: 12px;
  font-weight: 950;
}

.history-table-shell .history-row {
  min-height: 66px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  border-left: 4px solid transparent;
  border-radius: 0;
  box-shadow: none;
}

.history-table-shell .history-row:last-child {
  border-bottom: 0;
}

.history-table-shell .history-row.plus {
  border-left-color: #16a34a;
}

.history-table-shell .history-row.minus {
  border-left-color: #dc2626;
}

.history-person-cell,
.history-category-cell,
.history-status-cell,
.history-time-cell {
  min-width: 0;
}

.history-category-cell .tag {
  white-space: nowrap;
}

.status-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.status-chip.active {
  background: #e8f8ef;
  color: #0f8f67;
}

.status-chip.voided {
  background: #eef2f7;
  color: #64748b;
}

.history-time-cell {
  color: #475569;
  font-size: 12px;
  font-weight: 850;
}

.history-table-shell .history-actions {
  justify-content: flex-end;
}

.monthly-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.monthly-metric {
  min-height: 108px;
  border: 1px solid #bdebd1;
  border-radius: 8px;
  background: #f0fbf5;
  padding: 14px;
}

.monthly-metric.blue {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.monthly-metric.amber {
  border-color: #f3d39a;
  background: #fff9ed;
}

.monthly-metric.rose {
  border-color: #f4b8c4;
  background: #fff4f6;
}

.monthly-metric span,
.monthly-metric small {
  display: block;
  color: #64748b;
  font-weight: 800;
}

.monthly-metric strong {
  display: block;
  margin-top: 12px;
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
  font-weight: 950;
}

.monthly-metric em {
  color: #64748b;
  font-size: 16px;
  font-style: normal;
}

.monthly-metric small {
  margin-top: 8px;
  font-size: 12px;
}

.monthly-awards-list {
  display: grid;
  gap: 10px;
}

#section-monthly .award-row {
  min-height: 64px;
  border-color: #dfe7f1;
}

#section-monthly .monthly-report {
  position: relative;
  border: 1px solid #f0d7a6;
  background: #fffdf7;
}

#section-monthly .report-heading {
  border-bottom-color: #efcf91;
}

#section-monthly .report-heading h2 {
  color: #a15c08;
  font-size: 34px;
}

#section-monthly .report-grid > div {
  border-color: #f1dfbd;
  background: #ffffff;
}

#section-monthly .report-table th {
  background: #fff4db;
  color: #8a500b;
}

#section-groups .layout-grid {
  grid-template-columns: minmax(0, 1fr) 340px;
}

#section-groups .group-list {
  gap: 12px;
}

#section-groups .group-row {
  grid-template-columns: 14px minmax(0, 1fr) auto;
  min-height: 112px;
  padding: 16px;
  border-color: #dfe7f1;
}

#section-groups .group-dot {
  height: 74px;
}

#section-groups .group-title {
  font-size: 18px;
}

#section-groups .member-strip {
  margin-top: 12px;
}

#section-groups .mini-avatar {
  width: 32px;
  height: 32px;
}

#section-groups aside .history-row {
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 58px;
}

#section-leaderboard .layout-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
}

#section-leaderboard .rank-list {
  gap: 0;
  overflow: hidden;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #ffffff;
}

#section-leaderboard .rank-row {
  min-height: 64px;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  border-radius: 0;
  box-shadow: none;
}

#section-leaderboard .rank-row:last-child {
  border-bottom: 0;
}

#section-leaderboard .student-rank-row {
  grid-template-columns: 38px 38px minmax(0, 1fr) 86px;
  padding: 12px 14px;
}

#section-leaderboard .rank-no {
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}

#section-leaderboard .rank-no.top-1 {
  background: #fff3d7;
  color: #d97706;
}

#section-leaderboard .rank-no.top-2 {
  background: #eef2f7;
  color: #64748b;
}

#section-leaderboard .rank-no.top-3 {
  background: #ffeadb;
  color: #ea580c;
}

#section-leaderboard .rank-title {
  font-size: 15px;
}

#section-leaderboard .rank-score {
  color: #0f8f67;
  font-size: 18px;
  font-weight: 950;
}

#section-leaderboard .progress {
  margin: -1px 14px 12px 66px !important;
}

#section-history .filter-date .field {
  min-width: 142px;
}

#historyPageSizeSelect {
  min-width: 116px;
}

.void-modal-body {
  display: grid;
  gap: 14px;
}

.void-warning {
  border: 1px solid #f4d99b;
  border-radius: 8px;
  background: #fff9ed;
  color: #9a5c10;
  padding: 12px;
  font-size: 13px;
  font-weight: 850;
}

.void-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.void-summary > div {
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.void-summary span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.void-summary strong {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 14px;
}

body[data-classroom-mode="1"] .workspace {
  padding: 0 28px 36px;
}

body[data-classroom-mode="1"] .topbar {
  margin: 0 -28px 18px;
}

body[data-classroom-mode="1"] .teacher-menu {
  display: none;
}

body[data-classroom-mode="1"] #section-overview .overview-layout {
  grid-template-columns: 1fr;
}

body[data-classroom-mode="1"] #section-overview .overview-layout > aside {
  display: none;
}

body[data-classroom-mode="1"] .stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-classroom-mode="1"] #overviewQuickGrid {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

body[data-classroom-mode="1"] #overviewQuickGrid .quick-score-card {
  min-height: 108px;
}

body[data-classroom-mode="1"] #overviewStudents.student-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

body[data-classroom-mode="1"] .growth-card {
  min-height: 178px;
  grid-template-columns: 70px minmax(0, 1fr);
  padding: 18px;
}

body[data-classroom-mode="1"] .portrait-avatar {
  width: 66px;
  height: 66px;
}

body[data-classroom-mode="1"] .student-name {
  font-size: 18px;
}

body[data-classroom-mode="1"] .growth-points {
  font-size: 28px;
}

@media (max-width: 1120px) {
  body[data-classroom-mode="1"] #section-overview .layout-grid,
  body[data-classroom-mode="1"] #overviewQuickGrid {
    grid-template-columns: 1fr;
  }

      .app-shell {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100vw;
        min-width: 0;
      }

      .sidebar {
        position: static;
        height: auto;
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        width: 100%;
        max-width: 100vw;
        min-width: 0;
      }

  .brand {
    border-bottom: 0;
    padding-bottom: 4px;
  }

      .nav-list {
        display: flex;
        overflow-x: auto;
        padding-bottom: 4px;
        max-width: 100%;
      }

  .nav-button {
    min-width: max-content;
  }

  .sidebar-footer {
    display: none;
  }

      .layout-grid {
        grid-template-columns: 1fr;
        min-width: 0;
      }

  .auth-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .auth-product {
    min-height: auto;
  }

  #section-points .layout-grid {
    grid-template-columns: 1fr;
  }

  #section-groups .layout-grid,
  #section-leaderboard .layout-grid {
    grid-template-columns: 1fr;
  }

  #section-points aside .quick-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  #section-history .panel-body > .filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .history-table-head {
    display: none;
  }

  .history-table-shell {
    border: 0;
    background: transparent;
  }

  .history-table-shell .history-row {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    grid-template-areas:
      "score person actions"
      "score category status"
      "score time time";
    row-gap: 8px;
    margin-bottom: 10px;
    border: 1px solid #dfe7f1;
    border-left-width: 4px;
    border-radius: 8px;
    background: #ffffff;
  }

  .history-table-shell .history-score {
    grid-area: score;
  }

  .history-person-cell {
    grid-area: person;
  }

  .history-category-cell {
    grid-area: category;
  }

  .history-status-cell {
    grid-area: status;
    justify-self: end;
  }

  .history-time-cell {
    grid-area: time;
  }

  .history-table-shell .history-actions {
    grid-area: actions;
  }

  .monthly-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #section-students .layout-grid > aside.stack {
    grid-template-columns: 1fr;
  }

  #section-settings .layout-grid {
    grid-template-columns: 1fr;
  }

  .student-table-head {
    display: none;
  }

  .student-table-row {
    grid-template-columns: 48px minmax(220px, 1fr) 84px;
    grid-template-areas:
      "index person points"
      "index group actions"
      "index growth actions"
      "index latest actions";
    align-items: start;
    row-gap: 10px;
  }

  .row-index {
    grid-area: index;
    padding-top: 14px;
  }

  .student-table-person {
    grid-area: person;
  }

  .group-chip {
    grid-area: group;
  }

  .student-table-row > .points-badge {
    grid-area: points;
    justify-self: end;
  }

  .growth-cell {
    grid-area: growth;
  }

  .last-action-cell {
    grid-area: latest;
  }

  .student-table-actions {
    grid-area: actions;
    align-self: stretch;
    justify-content: flex-end;
    align-content: flex-start;
    flex-wrap: wrap;
  }

  .last-action-cell span {
    white-space: normal;
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .workspace,
  .topbar,
  .panel,
  .student-table-shell,
  .history-table-shell,
  .teacher-form,
  .toolbar {
    max-width: 100%;
    min-width: 0;
  }

  .workspace {
    padding: 16px 12px 32px;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
  }

  .topbar {
    flex-direction: column;
    margin-left: 0;
    margin-right: 0;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .filters,
  .toolbar,
  .compact-toolbar {
    width: 100%;
    align-items: stretch;
  }

  .filters .btn,
  .toolbar .btn,
  .toolbar .field,
  .toolbar .select {
    min-width: 0;
  }

  .auth-screen {
    padding: 14px;
  }

  .auth-screen.open {
    display: block;
  }

  .auth-layout {
    width: min(420px, 100%);
    margin: 0 auto;
    gap: 14px;
  }

  .auth-product {
    gap: 14px;
  }

  .auth-brand-large {
    align-items: flex-start;
  }

  .auth-logo-large {
    width: 58px;
    height: 58px;
    border-radius: 14px;
  }

  .auth-brand-large h1 {
    font-size: 28px;
  }

  .auth-brand-large p {
    font-size: 14px;
  }

  .auth-steps,
  .auth-safety {
    display: none;
  }

  .auth-card {
    padding: 18px;
  }

  .auth-card-head h2 {
    font-size: 22px;
  }

  .auth-card-head p {
    margin-top: 8px;
    font-size: 13px;
  }

  .auth-form {
    gap: 10px;
    margin-top: 14px;
  }

  .auth-field-label {
    gap: 6px;
    font-size: 13px;
  }

  .auth-field-label .field {
    min-height: 46px;
    padding: 10px 12px;
  }

  .auth-submit {
    min-height: 48px;
    margin-top: 2px;
    font-size: 16px;
  }

  .auth-note {
    display: none;
  }

  .stats-grid,
  .student-grid,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  #section-history .panel-body > .filters,
  .monthly-metrics {
    grid-template-columns: 1fr;
  }

  #section-history .panel-body > .filters {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }

  #section-history #historyCategoryFilter,
  #historyPageSizeSelect {
    flex-basis: auto;
    width: 100%;
  }

  .void-summary {
    grid-template-columns: 1fr;
  }

  .history-table-shell .history-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "person score"
      "category category"
      "status time"
      "actions actions";
  }

  .history-table-shell .history-score {
    justify-self: end;
  }

  .history-status-cell {
    justify-self: start;
  }

  .history-table-shell .history-actions {
    justify-content: flex-start;
  }

  #section-groups .group-row {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  #section-groups .split-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  #section-leaderboard .student-rank-row {
    grid-template-columns: 32px 34px minmax(0, 1fr) auto;
  }

      .form-grid,
      .setting-row {
        grid-template-columns: 1fr;
      }

  .student-table-row {
    grid-template-columns: 36px minmax(0, 1fr);
    grid-template-areas:
      "index person"
      "index points"
      "index group"
      "index growth"
      "index latest"
      "actions actions";
  }

  .student-table-row > .points-badge {
    justify-self: start;
  }

  .student-table-actions {
    justify-content: flex-start;
  }

  .student-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .student-table-shell {
    border: 0;
    background: transparent;
  }

  .student-table-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "person points"
      "group group"
      "growth growth"
      "latest latest"
      "actions actions";
    margin-bottom: 10px;
    border: 1px solid #dfe7f1;
    border-radius: 8px;
    background: #ffffff;
  }

  .student-table-row:last-child {
    margin-bottom: 0;
    border-bottom: 1px solid #dfe7f1;
  }

  .row-index {
    display: none;
  }

  .student-table-actions {
    justify-content: flex-start;
  }

  .student-table-actions .btn {
    min-width: 48px;
  }

  .data-action-card,
  .backup-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  #section-classroom-tools .layout-grid {
    grid-template-columns: 1fr;
  }

  #classroomSeatGrid {
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .seat-grid {
    min-width: 520px;
  }

  .seat-cell {
    min-height: 66px;
    padding: 7px 6px;
  }

  .random-picker-card {
    min-height: 88px;
  }

  .competition-row {
    grid-template-columns: 28px 12px minmax(0, 1fr) 58px;
  }

  .competition-actions {
    justify-content: flex-start;
  }

  #section-insights .filters .btn {
    flex: 1 1 calc(50% - 6px);
  }

  #section-settings .toolbar {
    justify-content: flex-start;
  }

  .data-action-card .btn,
  .data-action-card a.btn,
  .backup-actions {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .backup-actions {
    justify-content: flex-start;
  }

  .student-card .points-badge {
    grid-column: 1 / -1;
    width: 100%;
  }

  .page-title {
    font-size: 23px;
  }
}

.student-batch-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.student-table-head.with-select,
.student-table-row:has(.student-select-cell) {
  grid-template-columns: 36px 56px minmax(0, 1.4fr) 120px 72px 140px minmax(0, 1fr) auto;
}

.student-table-row.selected {
  background: color-mix(in srgb, var(--teal) 8%, transparent);
}

.student-select-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.group-row.drop-target,
#ungroupedStudents.drop-target {
  outline: 2px dashed var(--teal);
  outline-offset: 2px;
}

@media print {
  @page {
    margin: 14mm;
  }

  body {
    background: #ffffff;
  }

  .sidebar,
  .topbar,
  .section:not(#section-monthly),
  #section-monthly > .layout-grid > .panel:not(.monthly-report-panel),
  [data-print-hidden],
  .toast-wrap,
  .modal-backdrop {
    display: none !important;
  }

  .app-shell,
  .workspace,
  #section-monthly,
  #section-monthly > .layout-grid,
  .monthly-report-panel {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .monthly-report-panel {
    border: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
  }

  .monthly-report-panel .panel-header {
    display: none;
  }

  .monthly-report-panel .panel-body {
    padding: 0 !important;
  }

  .report-heading h2 {
    font-size: 28px;
  }

  .report-grid {
    grid-template-columns: repeat(2, 1fr);
    break-inside: avoid;
  }

  .report-table,
  .report-list li {
    break-inside: avoid;
  }
}

.seat-grid {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.seat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 72px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.seat-cell.empty {
  opacity: 0.55;
}

.seat-cell .seat-label {
  font-size: 11px;
  color: var(--muted);
}

.seat-cell .seat-points {
  font-size: 12px;
  font-weight: 800;
}

.random-picker-card {
  min-height: 104px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  text-align: center;
}

.random-picker-card.spinning {
  border-color: #8dd4c4;
  background: #effaf7;
  box-shadow: inset 0 0 0 2px rgba(13, 148, 136, 0.12);
}

.pick-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.timer-progress {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef2f6;
}

.timer-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
  transition: width 180ms ease;
}

.timer-progress.finished span {
  background: var(--green);
}

.compact-toolbar {
  gap: 6px;
}

.competition-list {
  display: grid;
  gap: 8px;
}

.competition-row {
  display: grid;
  grid-template-columns: 28px 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.competition-rank {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.competition-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.competition-main strong,
.competition-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.competition-main span {
  color: var(--muted);
  font-size: 12px;
}

.competition-score {
  min-width: 54px;
  color: var(--blue);
  font-weight: 950;
  text-align: right;
}

.competition-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.share-page {
  background: var(--bg);
  min-height: 100vh;
}

.share-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px;
}

.share-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.share-header h1 {
  margin: 0;
  font-size: 1.35rem;
}

.share-hero {
  text-align: center;
  padding: 8px 0 4px;
}

.share-badge-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.share-badges {
  margin-top: 10px;
}

.license-banner {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.license-banner.hidden {
  display: none;
}

.license-banner-warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.license-banner-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
