:root {
  --bg: #f4f6f7;
  --panel: #ffffff;
  --ink: #17232c;
  --muted: #66737d;
  --line: #dbe3e8;
  --green: #147d64;
  --green-dark: #0f604d;
  --blue: #315f96;
  --red: #b74336;
  --shadow: 0 18px 38px rgba(20, 37, 48, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(24, 36, 44, .035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(24, 36, 44, .035) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  letter-spacing: 0;
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px clamp(14px, 4vw, 38px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-weight: 800;
}

.brand-mark.large {
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
}

nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.user-pill {
  display: grid;
  gap: 2px;
  min-width: 120px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

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

.user-pill strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

nav a,
.primary-action,
.form-actions a,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary-action,
button[type="submit"] {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.primary-action:hover,
button[type="submit"]:hover {
  background: var(--green-dark);
}

.danger-action,
button[type="submit"].danger-action {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
}

.danger-action:hover,
button[type="submit"].danger-action:hover {
  border-color: #973629;
  background: #973629;
}

button:disabled {
  cursor: not-allowed;
  color: #8a949b;
  background: #eef2f4;
}

form.is-submitting button[type="submit"],
form.is-submitting input[type="submit"] {
  pointer-events: none;
}

.page {
  width: min(1180px, calc(100% - 28px));
  margin: 24px auto 44px;
}

.page.wide-page {
  width: min(1520px, calc(100% - 20px));
}

.hero,
.page-title,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.95);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 28px;
}

h1, h2, h3, p { margin-top: 0; }

h1 { font-size: clamp(24px, 4vw, 34px); line-height: 1.2; }
h2 { font-size: 18px; }
h3 { margin: 18px 0 10px; font-size: 14px; color: var(--muted); }
p { color: var(--muted); line-height: 1.7; }

.page-title {
  padding: 22px 24px;
  margin-bottom: 16px;
}

.page-title-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.page-title-with-action > div {
  min-width: min(100%, 360px);
}

.page-title-with-action h1 {
  margin-bottom: 10px;
}

.page-title-with-action p {
  margin-bottom: 0;
}

.page-title-with-action .primary-action {
  flex: 0 0 auto;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.stats div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.stats strong {
  display: block;
  font-size: 30px;
}

.stats span {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

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

.panel {
  padding: 20px;
  margin-bottom: 16px;
}

.compact-panel {
  padding: 16px 18px;
}

.finance-season-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.finance-season-stats div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
}

.finance-season-stats span {
  color: var(--muted);
  font-size: 13px;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title-row h2 {
  margin: 0;
}

.panel-title-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-action {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

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

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

.fields.three-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: #40505a;
  font-size: 13px;
  font-weight: 700;
}

label.wide {
  grid-column: 1 / -1;
}

.fields > .wide {
  grid-column: 1 / -1;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  outline: 0;
}

input[readonly] {
  color: var(--muted);
  background: #f4f7f8;
}

textarea { resize: vertical; }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(20, 125, 100, .12);
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.section-title-row h2 {
  margin-bottom: 0;
  white-space: nowrap;
}

.score-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  color: #4b5b64;
  font-size: 12px;
  line-height: 1.45;
}

.score-legend span {
  padding: 3px 7px;
  border: 1px solid #d8e4e8;
  border-radius: 7px;
  background: #f8fbfa;
}

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

.score-card {
  min-height: 154px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.score-card span {
  font-size: 15px;
  color: var(--ink);
}

.score-card small {
  min-height: 38px;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.45;
}

.score-card input {
  margin-top: auto;
  font-size: 18px;
  font-weight: 800;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips label {
  display: block;
}

.chips input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chips span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.chips input:checked + span {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.date-dialog-root {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.date-dialog-root[hidden],
[data-weekly-only][hidden],
[data-fixed-only][hidden] {
  display: none !important;
}

.date-dialog-launch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.date-dialog-launch output {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid #d8e4e8;
  border-radius: 7px;
  color: #38505b;
  background: #f8fbfa;
  font-size: 13px;
  font-weight: 700;
}

.calendar-dialog {
  width: min(860px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(11, 25, 35, .28);
}

.calendar-dialog::backdrop {
  background: rgba(18, 31, 40, .42);
  backdrop-filter: blur(3px);
}

.calendar-dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.calendar-dialog-head,
.calendar-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calendar-dialog-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.calendar-dialog-head button,
.calendar-dialog-actions button {
  min-height: 34px;
}

.calendar-dialog-actions {
  justify-content: flex-end;
  padding-top: 2px;
}

.calendar-dialog-actions > div {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.class-student-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(11, 25, 35, .28);
}

.class-student-dialog::backdrop {
  background: rgba(18, 31, 40, .42);
  backdrop-filter: blur(3px);
}

.class-student-dialog form {
  display: grid;
  max-height: inherit;
}

.class-student-dialog-head,
.class-student-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
}

.class-student-dialog-head {
  border-bottom: 1px solid var(--line);
}

.class-student-dialog-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.class-student-dialog-body {
  max-height: 420px;
  overflow: auto;
  padding: 16px 18px;
}

.class-student-picker {
  align-content: start;
}

.class-student-picker label {
  max-width: 100%;
}

.class-student-picker span {
  border-radius: 7px;
}

.duplicate-student-hint {
  margin-top: 0;
}

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

.scheduled-student-picker label,
.scheduled-student-picker span {
  width: 100%;
}

.scheduled-student-picker span {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
  min-height: 62px;
  padding: 9px 12px;
  border-radius: 8px;
}

.scheduled-student-picker strong,
.scheduled-student-picker em {
  line-height: 1.35;
}

.scheduled-student-picker strong {
  font-size: 14px;
}

.scheduled-student-picker em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.scheduled-student-picker input:checked + span em {
  color: rgba(255, 255, 255, .86);
}

.class-student-dialog-actions {
  border-top: 1px solid var(--line);
  background: #f8fbfb;
}

.class-student-dialog-actions > div {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.class-delete-dialog {
  width: min(520px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(11, 25, 35, .28);
}

.class-delete-dialog::backdrop {
  background: rgba(18, 31, 40, .42);
  backdrop-filter: blur(3px);
}

.class-delete-dialog-head,
.class-delete-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
}

.class-delete-dialog-head {
  border-bottom: 1px solid var(--line);
}

.class-delete-dialog-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.class-delete-dialog-body {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
}

.class-delete-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #f8fbfb;
}

.confirm-dialog {
  width: min(460px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(11, 25, 35, .28);
}

.confirm-dialog::backdrop {
  background: rgba(18, 31, 40, .42);
  backdrop-filter: blur(3px);
}

.confirm-dialog-body {
  display: grid;
}

.confirm-dialog-head,
.confirm-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
}

.confirm-dialog-head {
  border-bottom: 1px solid var(--line);
}

.confirm-dialog-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.confirm-dialog p {
  margin: 0;
  padding: 18px;
  color: #40505a;
  line-height: 1.7;
}

.confirm-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #f8fbfb;
}

.add-session-dialog {
  width: min(720px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(11, 25, 35, .28);
}

.add-session-dialog::backdrop {
  background: rgba(18, 31, 40, .42);
  backdrop-filter: blur(3px);
}

.add-session-dialog-body {
  display: grid;
  gap: 16px;
  margin: 0;
}

.add-session-dialog-head,
.add-session-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
}

.add-session-dialog-head {
  border-bottom: 1px solid var(--line);
}

.add-session-dialog-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.add-session-dialog-body > .fields,
.add-session-dialog-body > .hint {
  margin-right: 18px;
  margin-left: 18px;
}

.add-session-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #f8fbfb;
}

.calendar-selected-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d8e4e8;
  border-radius: 7px;
  color: var(--green-dark);
  background: #edf8f4;
  font-size: 13px;
  font-weight: 800;
}

.month-calendar {
  display: grid;
  gap: 12px;
}

.month-calendar-toolbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  align-items: end;
  gap: 10px;
}

.month-calendar-toolbar label {
  min-width: 180px;
}

.month-calendar-toolbar input {
  min-height: 38px;
}

.calendar-weekdays,
.month-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.calendar-weekdays span {
  display: grid;
  place-items: center;
  min-height: 30px;
  border-bottom: 1px solid var(--line);
  color: #51616b;
  font-size: 13px;
  font-weight: 800;
}

.month-calendar-grid {
  min-height: 310px;
}

.month-calendar-empty {
  min-height: 54px;
  border-radius: 8px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(23, 35, 44, .035),
    rgba(23, 35, 44, .035) 4px,
    transparent 4px,
    transparent 10px
  );
}

.month-calendar-day {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 54px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfcfd;
  font-weight: 700;
}

.month-calendar-day strong {
  font-size: 17px;
}

.month-calendar-day span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.month-calendar-day:hover {
  border-color: var(--green);
  background: #eef8f4;
}

.month-calendar-day.is-today {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.month-calendar-day.is-selected {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.month-calendar-day.is-selected span {
  color: rgba(255, 255, 255, .82);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.courseware-picker,
.course-entry-card {
  margin: 14px 0 20px;
  padding: 14px;
  border: 1px solid #d8e4e8;
  border-radius: 8px;
  background: #f8fbfa;
}

.courseware-picker h3,
.course-entry-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.courseware-picker .fields,
.course-entry-card .fields {
  align-items: end;
}

.courseware-picker select:disabled {
  color: #879198;
  background: #eef2f4;
}

.attachment-uploader {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.attachment-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.attachment-actions output {
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #d8e4e8;
  border-radius: 7px;
  color: #40505a;
  background: #f8fbfa;
  font-size: 13px;
  font-weight: 700;
}

.attachment-file-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attachment-file-list li {
  padding: 7px 10px;
  border: 1px solid #d8e4e8;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.inline-filter {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-filter label {
  width: min(360px, 100%);
}

.compact-filter {
  padding: 12px 14px;
}

.compact-filter .inline-filter {
  margin: 0;
}

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

.dashboard-today-panel {
  margin-bottom: 16px;
}

.dashboard-today-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-today-card {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 94px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  background: #3586d8;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(21, 92, 150, 0.18);
}

.dashboard-today-card.is-attended {
  border-color: #8fcaa9;
  color: #0d6847;
  background: #dcf6e8;
  box-shadow: 0 8px 18px rgba(27, 124, 83, 0.12);
}

.dashboard-today-card strong,
.dashboard-today-card span,
.dashboard-today-card em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-today-card strong {
  font-size: 15px;
}

.dashboard-today-card em {
  font-style: normal;
  opacity: 0.92;
}

.dashboard-record-list,
.dashboard-summary-area {
  --dashboard-row-height: 68px;
  --dashboard-list-height: calc(var(--dashboard-row-height) * 10 + 8px * 9);
}

.dashboard-record-list {
  max-height: var(--dashboard-list-height);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.dashboard-list-row {
  align-items: center;
  min-height: var(--dashboard-row-height);
}

.dashboard-list-row > span,
.dashboard-list-row > em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-summary-area {
  height: var(--dashboard-list-height);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}

.dashboard-stage-list {
  max-height: calc(var(--dashboard-row-height) * 3 + 8px * 2);
  align-content: start;
  grid-auto-rows: minmax(var(--dashboard-row-height), auto);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.dashboard-quarterly-block {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  margin-top: 0;
}

.dashboard-quarterly-list {
  min-height: 0;
  align-content: start;
  grid-auto-rows: minmax(var(--dashboard-row-height), auto);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.dashboard-list-row .quarterly-status {
  min-height: 24px;
  margin-right: 2px;
  vertical-align: middle;
}

.student-report-list {
  --student-report-row-height: 68px;
  --student-archive-list-height: calc(var(--student-report-row-height) * 10 + 8px * 9);
  max-height: var(--student-archive-list-height);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.student-report-list .report-list-row {
  min-height: var(--student-report-row-height);
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
  text-decoration: none;
}

.list-row:hover {
  border-color: var(--green);
  background: #eef8f4;
}

.list-row em {
  color: var(--muted);
  font-style: normal;
}

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

.session-list-row:hover {
  border-color: var(--green);
  background: #eef8f4;
}

.session-list-row.is-locked {
  background: #fffdf7;
}

.session-list-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.session-list-main span,
.session-list-main em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-list-main em {
  color: var(--muted);
  font-style: normal;
}

.session-list-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.session-list-actions form {
  margin: 0;
}

.session-list-actions button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.report-list-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 1.1fr) minmax(96px, max-content);
  align-items: center;
  column-gap: 14px;
}

.report-main,
.report-courseware {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-courseware {
  color: #4a6670;
  font-size: 14px;
}

.report-list-row-static {
  cursor: default;
  background: #f8fafb;
}

.report-list-row-static:hover {
  border-color: var(--line);
  background: #f8fafb;
}

.attendance-record-row {
  background: #fffdf7;
}

.attendance-record-row:hover {
  border-color: #caa85b;
  background: #fff6d8;
}

.record-status {
  display: block;
  justify-self: end;
  min-width: 0;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.record-status[data-status="签到"],
.record-status[data-status="迟到"],
.record-status[data-status="补课完成"] {
  color: #12694d;
}

.record-status[data-status="请假"] {
  color: #81621b;
}

.record-status[data-status="缺勤"] {
  color: #a94235;
}

.attendance-focus-row td {
  background: #fff6d8;
  box-shadow: inset 3px 0 0 #d5a93c;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

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

.data-table th {
  color: var(--muted);
  font-weight: 700;
}

.schedule-warning-cell {
  color: #8a5b10;
  background: #fff4cf;
  box-shadow: inset 3px 0 0 #e3b341;
}

.schedule-warning-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #e5bd4d;
  border-radius: 4px;
  color: #7a4b00;
  background: #ffe8a3;
  font-weight: 800;
  white-space: nowrap;
}

.table-panel {
  overflow-x: auto;
  padding: 0;
}

.schedule-table {
  min-width: 1120px;
}

.schedule-table th,
.schedule-table td {
  padding: 13px 12px;
  vertical-align: middle;
}

.class-name-link {
  color: #ef665d;
  font-weight: 800;
  text-decoration: none;
}

.school-class-compact,
.school-class-mini-link {
  display: inline-grid;
  gap: 2px;
  max-width: 180px;
  color: #ef665d;
  text-decoration: none;
}

.school-class-compact strong,
.school-class-mini-link {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-class-compact span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.school-grade-summary {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  color: #243540;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-time {
  max-width: 260px;
  color: #334752;
  line-height: 1.5;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 210px;
}

.row-actions a,
.row-actions button {
  min-height: 30px;
  padding: 0 4px;
  border: 0;
  color: #ef665d;
  background: transparent;
  font-weight: 800;
  text-decoration: none;
}

.row-actions form {
  display: inline;
  margin: 0;
}

.hint,
.empty {
  color: var(--muted);
  font-size: 13px;
}

.summary-box {
  white-space: pre-wrap;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  line-height: 1.7;
}

.summary-file-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.student-summary-scroll-area {
  --student-report-row-height: 68px;
  --student-archive-list-height: calc(var(--student-report-row-height) * 10 + 8px * 9);
  --summary-card-height: 82px;
  height: var(--student-archive-list-height);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}

.stage-summary-list {
  max-height: calc(var(--summary-card-height) * 3 + 10px * 2);
  align-content: start;
  grid-auto-rows: minmax(var(--summary-card-height), auto);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.quarterly-request-list {
  min-height: 0;
  align-content: start;
  grid-auto-rows: minmax(var(--summary-card-height), auto);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.stage-summary-list .summary-file-card,
.quarterly-request-list .summary-file-card {
  min-height: var(--summary-card-height);
}

.summary-file-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.profile-record-panel {
  align-self: stretch;
}

.profile-record-list {
  --profile-record-card-height: 82px;
  display: grid;
  gap: 10px;
  max-height: calc(var(--profile-record-card-height) * 3 + 10px * 2);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.profile-record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  height: var(--profile-record-card-height);
  min-height: var(--profile-record-card-height);
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  overflow: hidden;
}

.profile-record-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.profile-record-actions {
  display: flex;
  justify-content: flex-end;
}

.profile-record-actions .summary-action-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font-weight: 800;
}

.profile-record-actions .summary-action-button:hover {
  border-color: var(--green);
  color: var(--green-dark);
  background: #eef8f4;
}

.profile-record-card strong,
.profile-record-card span,
.profile-record-card em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-record-card strong {
  color: var(--ink);
  white-space: nowrap;
}

.profile-record-card span,
.profile-record-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.5;
}

.profile-record-list .empty {
  margin: 0;
}

.profile-record-dialog {
  width: min(680px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(22, 34, 43, .22);
}

.profile-record-dialog::backdrop {
  background: rgba(13, 23, 31, .36);
}

.profile-record-dialog form {
  display: grid;
  margin: 0;
}

.profile-record-dialog-head,
.profile-record-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.profile-record-dialog-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.profile-record-dialog-body {
  padding: 18px;
}

.profile-record-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.summary-file-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.summary-file-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.summary-file-main span {
  color: var(--muted);
  font-size: 13px;
}

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

.summary-file-actions form {
  margin: 0;
}

.summary-file-actions a,
.summary-file-actions .summary-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.summary-file-actions .summary-action-button {
  width: auto;
}

.summary-file-actions a:hover,
.summary-file-actions .summary-action-button:hover:not(:disabled) {
  border-color: var(--green);
  color: var(--green-dark);
  background: #eef8f4;
}

.quarterly-summary-block {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.student-summary-scroll-area .quarterly-summary-block {
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  margin-top: 0;
}

.quarterly-summary-block h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.quarterly-file-card {
  background: #fffdf7;
}

.quarterly-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.quarterly-status-pending,
.quarterly-status-processing {
  color: #81621b;
  background: #fff5cc;
}

.quarterly-status-completed {
  color: #12694d;
  background: #e4f6ec;
}

.quarterly-status-failed {
  color: #a94235;
  background: #fde9e5;
}

.quarterly-error {
  color: #a94235 !important;
}

.quarterly-summary-dialog {
  width: min(620px, calc(100vw - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(22, 34, 43, .22);
}

.quarterly-summary-dialog::backdrop {
  background: rgba(13, 23, 31, .36);
}

.quarterly-summary-dialog form {
  display: grid;
  gap: 0;
  margin: 0;
}

.quarterly-summary-dialog-head,
.quarterly-summary-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.quarterly-summary-dialog-head h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 18px;
}

.quarterly-summary-dialog-head p {
  margin: 0;
  font-size: 13px;
}

.quarterly-summary-dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

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

.quarterly-options label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  cursor: pointer;
}

.quarterly-options label:has(input:checked) {
  border-color: var(--green);
  background: #edf8f3;
}

.quarterly-options label:has(input:disabled) {
  color: #93a0a8;
  background: #f5f7f8;
  cursor: not-allowed;
}

.quarterly-options span {
  display: grid;
  gap: 4px;
}

.quarterly-options strong {
  font-size: 15px;
}

.quarterly-options em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.5;
}

.quarterly-note {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.quarterly-note textarea {
  min-height: 86px;
  resize: vertical;
}

.quarterly-summary-dialog-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.toolbar,
.schedule-toolbar,
.week-nav,
.schedule-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.schedule-toolbar {
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.95);
  box-shadow: var(--shadow);
}

.schedule-toolbar .toolbar,
.schedule-toolbar .week-nav {
  margin-bottom: 0;
}

.week-nav {
  justify-content: flex-end;
}

.week-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.week-nav strong {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 7px;
  background: #edf5f2;
  color: var(--green-dark);
}

.week-jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.week-jump label {
  display: inline;
  color: var(--muted);
  white-space: nowrap;
}

.week-jump input {
  width: 152px;
  min-height: 36px;
  padding: 7px 9px;
}

.week-jump button {
  min-height: 36px;
  white-space: nowrap;
}

.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f5f8f9;
}

.view-switch a {
  min-height: 30px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
}

.view-switch a.is-active {
  color: #fff;
  background: var(--green);
}

.schedule-meta span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.schedule-day {
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.schedule-day.today {
  background: #fff9df;
}

.schedule-day header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
}

.session-card {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 7px;
  color: #fff;
  background: var(--blue);
  text-decoration: none;
}

.session-card em,
.work-session em {
  font-style: normal;
  opacity: .92;
}

.week-board-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--shadow);
}

.week-board {
  --week-board-bottom-room: 10px;
  display: grid;
  grid-template-columns: 58px repeat(7, minmax(176px, 1fr));
  min-width: 1290px;
  background: #fff;
}

.time-column,
.day-column {
  min-width: 0;
}

.time-column {
  position: relative;
}

.corner,
.day-column header {
  height: 36px;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
  color: #e45a51;
  font-weight: 800;
  font-size: 13px;
}

.day-column header span {
  margin-right: 4px;
}

.day-column header strong {
  font-size: 13px;
}

.time-track {
  position: relative;
  height: calc(var(--hour-count) * 56px + var(--week-board-bottom-room));
}

.hour-label {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  transform: translateY(-6px);
  color: #41505a;
  font-size: 12px;
}

.day-column {
  border-left: 1px solid var(--line);
}

.day-column.current-day header,
.day-column.current-day .day-track {
  background: #fff9df;
}

.day-track {
  position: relative;
  height: calc(var(--hour-count) * 56px + var(--week-board-bottom-room));
  background: #fff;
}

.hour-line {
  height: 56px;
  border-bottom: 1px solid #e8edf0;
  background-image: linear-gradient(to bottom, transparent 27px, #edf1f4 27px, #edf1f4 28px, transparent 28px);
}

.work-session {
  position: absolute;
  left: 8px;
  right: auto;
  width: calc(100% - 16px);
  z-index: 2;
  min-height: 42px;
  overflow: visible;
  font-size: 12px;
}

.work-session-face {
  display: grid;
  align-content: start;
  gap: 3px;
  height: 100%;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #fff;
  background: #3586d8;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(21, 92, 150, .22);
}

.work-session.is-attended .work-session-face {
  border: 1px solid #8fcaa9;
  color: #0d6847;
  background: #dcf6e8;
  box-shadow: 0 8px 18px rgba(27, 124, 83, .14);
}

.work-session strong,
.work-session span,
.work-session em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-popover {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 3000;
  display: none;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 13px;
  border: 1px solid #d6e0e6;
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 18px 42px rgba(17, 32, 42, .22);
}

.work-session:hover,
.work-session:focus-within,
.month-work-session:hover,
.month-work-session:focus-within {
  z-index: 50;
}

.work-session.is-popover-open .session-popover,
.month-work-session.is-popover-open .session-popover {
  display: block;
}

.session-popover h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
}

.session-popover dl {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
}

.session-popover dl div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
}

.session-popover dt {
  color: var(--muted);
  font-weight: 700;
}

.session-popover dd {
  margin: 0;
}

.popover-students {
  display: grid;
  gap: 6px;
  max-height: 142px;
  margin: 10px 0;
  overflow: auto;
}

.popover-students a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #eef2f4;
  border-radius: 7px;
  color: var(--ink);
  background: #fbfcfd;
  text-decoration: none;
}

.popover-students p {
  margin: 0;
}

.popover-students em {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  color: #5f6870;
  background: #edf0f2;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.popover-students em[data-status="签到"],
.popover-students em[data-status="迟到"],
.popover-students em[data-status="补课完成"] {
  color: #0f604d;
  background: #e4f4ee;
}

.popover-students em[data-status="请假"] {
  color: #8a5b10;
  background: #fff1cb;
}

.popover-students em[data-status="缺勤"] {
  color: var(--red);
  background: #fff1ee;
}

.popover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.popover-actions a,
.popover-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.popover-actions form {
  display: inline;
  margin: 0;
}

.popover-actions .substitute-form {
  flex: 1 0 100%;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 7px;
  border: 1px solid #dce8e7;
  border-radius: 7px;
  background: #f8fbfa;
}

.popover-actions .substitute-form select {
  min-width: 0;
  height: 32px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
}

.popover-actions .substitute-form button {
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.popover-actions .substitute-form button:disabled {
  background: #edf1f2;
  color: #8a9398;
  cursor: not-allowed;
}

.work-month-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.work-month-head,
.work-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
  min-width: 1120px;
}

.work-month-head span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: #e45a51;
  font-size: 13px;
  font-weight: 800;
}

.work-month-head span:last-child {
  border-right: 0;
}

.work-month-day {
  min-height: 148px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.work-month-day:nth-child(7n) {
  border-right: 0;
}

.work-month-day.is-outside {
  background: #f5f8f9;
  opacity: .58;
}

.work-month-day.is-today {
  background: #fff9df;
}

.work-month-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: #465760;
}

.work-month-day header strong {
  font-size: 15px;
}

.work-month-day header span {
  color: var(--muted);
  font-size: 12px;
}

.work-month-session-list {
  display: grid;
  gap: 6px;
}

.month-work-session {
  position: relative;
  min-width: 0;
}

.month-work-session-face {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #fff;
  background: #3586d8;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(21, 92, 150, .18);
}

.month-work-session.is-attended .month-work-session-face {
  border: 1px solid #8fcaa9;
  color: #0d6847;
  background: #dcf6e8;
  box-shadow: 0 6px 14px rgba(27, 124, 83, .12);
}

.month-work-session-face strong,
.month-work-session-face em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-work-session-face strong {
  font-size: 12px;
}

.month-work-session-face em {
  font-size: 11px;
  font-style: normal;
  opacity: .92;
}

.work-month-empty {
  margin: 6px 0 0;
  color: #a1adb5;
  font-size: 12px;
}

.disabled-link,
.disabled-link:hover {
  pointer-events: none;
  opacity: .45;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  color: #3b4b55;
  font-size: 12px;
  font-weight: 800;
}

.inline-check input {
  width: auto;
  min-width: 0;
}

.static-row {
  cursor: default;
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
}

.alert {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--red);
  background: #fff1ee;
  font-size: 13px;
}

.notice {
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid #bfded2;
  border-radius: 8px;
  color: var(--green-dark);
  background: #edf8f4;
}

.notice.success {
  border-color: #b7d8c7;
  background: #effaf3;
}

.account-form h2 {
  margin-top: 20px;
}

.admin-table input {
  min-width: 130px;
}

.admin-table td {
  vertical-align: top;
}

.teacher-management-table th:nth-child(2),
.teacher-management-table th:nth-child(3),
.teacher-management-table th:nth-child(4),
.teacher-management-table td:nth-child(2),
.teacher-management-table td:nth-child(3),
.teacher-management-table td:nth-child(4) {
  text-align: center;
}

.teacher-management-table td:last-child {
  width: 150px;
}

.teacher-name-cell strong {
  font-size: 16px;
}

.teacher-term-filter .filter-summary {
  align-self: center;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid #d8e4e8;
  border-radius: 7px;
  color: var(--green-dark);
  background: #edf8f4;
  font-size: 13px;
  font-weight: 800;
}

.teacher-stat-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--green-dark);
  background: #eef8f4;
  text-decoration: none;
  font-weight: 900;
}

.teacher-stat-link:hover {
  border-color: var(--green);
  background: #dff3eb;
}

.teacher-account-dialog-body {
  display: grid;
  gap: 14px;
}

.teacher-account-summary,
.teacher-account-form {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.teacher-account-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  color: #40505a;
  font-weight: 700;
}

.teacher-account-summary span {
  min-width: 0;
}

.teacher-account-summary strong {
  color: var(--ink);
}

.teacher-account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.teacher-account-note {
  align-self: end;
  padding: 10px 12px;
  border: 1px solid #d8e4e8;
  border-radius: 7px;
  color: var(--muted);
  background: #f8fbfa;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.teacher-account-toggle {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.teacher-account-toggle p {
  margin: 6px 0 0;
  font-size: 13px;
}

.inline-account-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 6px 6px 0;
}

.inline-account-form input {
  width: 120px;
}

.inline-account-form input[name="reason"],
.inline-account-form input[name="graduation_reason"] {
  width: min(280px, 52vw);
}

.row-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.row-actions input {
  width: min(220px, 34vw);
  min-width: 150px;
}

.row-actions select {
  min-width: 140px;
  min-height: 34px;
  border-radius: 6px;
}

.row-actions button.danger-action,
.row-actions button[type="submit"].danger-action {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--red);
  color: #fff;
  background: var(--red);
}

.row-actions button.danger-action:hover,
.row-actions button[type="submit"].danger-action:hover {
  border-color: #973629;
  background: #973629;
}

.finance-actions {
  min-width: 150px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.finance-actions button {
  min-width: 56px;
}

.finance-actions .finance-check-button {
  min-width: 64px;
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.finance-actions .finance-check-button:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.finance-actions .finance-refund-button {
  min-width: 58px;
  color: #9b3c32;
  border-color: #e3c8c2;
  background: #fff;
}

.finance-actions .finance-refund-button:hover {
  color: #7f3129;
  border-color: #cf9c92;
  background: #fff6f4;
}

.finance-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(18, 31, 40, .42);
  backdrop-filter: blur(3px);
}

.finance-modal-backdrop[hidden] {
  display: none;
}

.finance-modal {
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(11, 25, 35, .28);
}

.finance-modal header,
.finance-modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
}

.finance-modal header {
  border-bottom: 1px solid var(--line);
}

.finance-modal footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #f8fbfb;
}

.finance-modal h2 {
  margin: 0;
  font-size: 18px;
}

.finance-modal-body {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
}

.finance-modal-summary {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #cfe3dc;
  border-radius: 7px;
  color: var(--green-dark);
  background: #edf8f4;
  font-weight: 700;
}

.finance-modal label {
  display: grid;
  gap: 6px;
  color: #40505a;
  font-weight: 800;
}

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

.finance-modal input,
.finance-modal select,
.finance-modal textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  font: inherit;
}

.finance-modal input,
.finance-modal select {
  min-height: 42px;
  padding: 0 12px;
}

.finance-modal textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

.school-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(11, 25, 35, .25);
}

.school-dialog::backdrop {
  background: rgba(18, 31, 40, .35);
  backdrop-filter: blur(3px);
}

.school-dialog form {
  display: grid;
  max-height: calc(100vh - 40px);
  grid-template-rows: auto 1fr auto;
}

.school-dialog header,
.school-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
}

.school-dialog header {
  border-bottom: 1px solid var(--line);
}

.school-dialog footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #f8fbfb;
}

.school-dialog h2 {
  margin: 0;
  font-size: 18px;
}

.school-dialog-body {
  display: grid;
  gap: 16px;
  overflow: auto;
  padding: 18px;
}

.school-choice-grid,
.school-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.school-choice-grid label,
.school-choice-row label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  font-weight: 700;
  cursor: pointer;
}

.school-choice-grid input,
.school-choice-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.school-choice-grid span,
.school-choice-row span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #243540;
  background: #fff;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.school-choice-grid input:checked + span,
.school-choice-row input:checked + span {
  border-color: rgba(31, 132, 104, .55);
  color: var(--green-dark);
  background: #e8f6f0;
  box-shadow: inset 0 0 0 1px rgba(31, 132, 104, .16);
}

.school-choice-grid input:focus-visible + span,
.school-choice-row input:focus-visible + span {
  outline: 2px solid rgba(31, 132, 104, .35);
  outline-offset: 2px;
}

.school-detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.school-detail-title .status {
  margin-top: 6px;
}

.school-detail-stats article strong {
  font-size: clamp(22px, 2vw, 32px);
}

.school-management-grid {
  align-items: stretch;
}

.school-add-students-form {
  display: grid;
  gap: 12px;
}

.school-add-students-form textarea {
  min-height: 180px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  resize: vertical;
}

.school-info-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.school-info-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.school-info-list div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.school-info-list dt {
  color: var(--muted);
  font-weight: 700;
}

.school-info-list dd {
  margin: 0;
  font-weight: 800;
}

.school-attendance-records-panel {
  margin-top: 18px;
}

.school-attendance-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.school-attendance-tags .status {
  margin: 0;
}

.school-attendance-total {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.school-attendance-list {
  display: grid;
  gap: 10px;
  max-height: 640px;
  overflow: auto;
  padding-right: 4px;
}

.school-attendance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.school-attendance-row strong,
.school-attendance-row span {
  display: block;
}

.school-attendance-row span {
  margin-top: 3px;
  color: var(--muted);
}

.school-attendance-row select {
  min-height: 40px;
}

.school-table td {
  vertical-align: top;
}

.school-student-filter {
  margin: 4px 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
}

.finance-schedule-panel {
  overflow-x: auto;
}

.teacher-schedule-section {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.teacher-schedule-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.teacher-schedule-heading h2 {
  margin: 0;
  font-size: 20px;
}

.teacher-schedule-heading span {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.finance-week-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  background: #fff;
  table-layout: fixed;
}

.finance-week-table col.period-col {
  width: 56px;
}

.finance-week-table col.time-col {
  width: 132px;
}

.finance-week-table th,
.finance-week-table td {
  border: 1px solid #171717;
  text-align: center;
  vertical-align: middle;
}

.finance-week-table th {
  height: 30px;
  color: #101820;
  background: #f5f8f6;
  font-weight: 800;
}

.period-cell {
  width: 56px;
  font-size: 16px;
  letter-spacing: 0;
  background: #fbfcfb;
}

.time-cell {
  width: 132px;
  min-height: 88px;
  padding: 12px 10px;
  font-size: 13px;
  line-height: 1.25;
}

.time-cell span {
  display: inline-block;
  white-space: nowrap;
}

.finance-week-cell {
  min-height: 88px;
  padding: 4px 6px;
}

.finance-week-cell.has-course,
.finance-month-day.has-course {
  background: #fff2c8;
}

.finance-course-card {
  display: grid;
  gap: 3px;
  position: relative;
  padding: 4px 2px;
  color: #05080a;
  line-height: 1.35;
  font-size: 13px;
}

.finance-course-card + .finance-course-card {
  margin-top: 5px;
  padding-top: 7px;
  border-top: 1px solid rgba(0, 0, 0, .22);
}

.finance-course-card strong,
.finance-course-card span,
.finance-course-card em,
.finance-course-card b {
  overflow-wrap: anywhere;
}

.finance-course-card strong {
  font-weight: 700;
}

.finance-course-card em {
  color: #111;
  font-style: normal;
}

.finance-course-card b {
  color: #e00000;
  font-weight: 900;
}

.finance-course-card.compact {
  align-content: start;
  padding: 4px 0;
  font-size: 12px;
}

.schedule-overview-panel .finance-week-table,
.finance-schedule-panel .finance-week-table {
  border: 1px solid #ccd8df;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: #f8fbfb;
}

.schedule-overview-panel .finance-week-table th,
.schedule-overview-panel .finance-week-table td,
.finance-schedule-panel .finance-week-table th,
.finance-schedule-panel .finance-week-table td {
  border-color: #d7e1e7;
}

.schedule-overview-panel .finance-week-table th,
.finance-schedule-panel .finance-week-table th,
.schedule-month-head span {
  color: #20313b;
  background: #eef5f3;
}

.schedule-overview-panel .period-cell,
.finance-schedule-panel .period-cell {
  color: #29434f;
  background: #f8fbfb;
  font-weight: 800;
}

.schedule-overview-panel .time-cell,
.finance-schedule-panel .time-cell {
  padding: 10px 8px;
  color: #263944;
  background: #fbfcfd;
  font-weight: 800;
  vertical-align: middle;
}

.schedule-week-cell,
.finance-schedule-panel .finance-week-cell {
  padding: 8px;
  vertical-align: top;
}

.schedule-week-cell.has-course,
.schedule-month-day.has-course,
.finance-schedule-panel .finance-week-cell.has-course,
.finance-month-day:has(.finance-schedule-course-card) {
  background: #fff6d8;
}

.schedule-course-card,
.finance-schedule-course-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d8e3e8;
  border-left: 4px solid var(--green);
  border-radius: 8px;
  color: #17232c;
  background: #fff;
  box-shadow: 0 8px 18px rgba(20, 37, 48, .08);
  text-align: left;
}

.schedule-course-card + .schedule-course-card,
.finance-schedule-course-card + .finance-schedule-course-card,
.schedule-overview-panel .finance-course-card + .finance-course-card,
.schedule-month .finance-course-card + .finance-course-card,
.finance-schedule-panel .finance-schedule-course-card + .finance-schedule-course-card,
.finance-month .finance-schedule-course-card + .finance-schedule-course-card {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #d8e3e8;
}

.schedule-course-main {
  display: grid;
  gap: 3px;
}

.schedule-course-time {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.schedule-course-title {
  color: #101d25;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.35;
}

.schedule-course-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.schedule-course-meta-row span {
  min-height: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #4d606b;
  background: #f0f5f6;
  font-size: 12px;
  line-height: 1.35;
}

.attendance-course-card em {
  color: #475b66;
  font-size: 12px;
}

.attendance-course-card b.attendance-tag {
  justify-self: center;
  color: #3b4b55;
  font-size: 11px;
}

.attendance-student-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.attendance-student-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  padding: 2px 4px;
  border: 1px solid rgba(16, 24, 32, .22);
  border-radius: 3px;
  color: #101820;
  background: rgba(255, 255, 255, .92);
  text-decoration: none;
}

.schedule-student-chips,
.finance-schedule-course-card .finance-student-chips {
  justify-content: flex-start;
  gap: 6px;
}

.schedule-student-chip,
.finance-schedule-course-card .finance-student-chip summary {
  min-height: 26px;
  padding: 2px 8px;
  border-color: #d4e0e6;
  border-radius: 6px;
  background: #f8fbfb;
  font-weight: 800;
}

.finance-schedule-course-card .finance-check-tag {
  border-radius: 5px;
}

.attendance-tag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.attendance-tag.is-present {
  border-color: #9acfb4;
  color: #116045;
  background: #e4f5ec;
}

.attendance-tag.is-leave {
  border-color: #efd08f;
  color: #8a5b10;
  background: #fff2c8;
}

.attendance-tag.is-absent {
  border-color: #f2a89d;
  color: #9e2f24;
  background: #fff1ee;
}

.attendance-tag.is-partial {
  border-color: #aac7ec;
  color: #1f5d9b;
  background: #e9f3ff;
}

.attendance-tag.is-unmarked {
  border-color: #cfd8de;
  color: #61717b;
  background: #eef2f4;
}

.attendance-course-card b.attendance-tag.is-present {
  border-color: #8fcaa9;
  color: #0d6847;
  background: #dcf6e8;
}

.attendance-course-card b.attendance-tag.is-unmarked {
  border-color: #efd284;
  color: #895b08;
  background: #fff4c7;
}

.finance-student-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.finance-student-chip {
  position: relative;
  display: inline-flex;
}

.finance-student-chip summary {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  padding: 2px 4px;
  border: 1px solid rgba(16, 24, 32, .3);
  border-radius: 3px;
  background: rgba(255, 255, 255, .92);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.finance-student-chip summary::-webkit-details-marker {
  display: none;
}

.finance-student-chip[open] summary {
  border-color: #101820;
  box-shadow: 0 0 0 2px rgba(16, 24, 32, .08);
}

.finance-check-tag {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.finance-check-tag.is-checked {
  border-color: #9acfb4;
  color: #116045;
  background: #e4f5ec;
}

.finance-check-tag.is-unchecked {
  border-color: #f0b48e;
  color: #9a3412;
  background: #fff0df;
}

.finance-check-tag.is-partial {
  border-color: #e1c66d;
  color: #7a5a03;
  background: #fff8d9;
}

.finance-check-tag.is-none {
  border-color: #ccd5dc;
  color: #65737d;
  background: #eef2f4;
}

.finance-check-tag.is-refunded {
  border-color: #efc26d;
  color: #8a5b10;
  background: #fff3cc;
}

.finance-student-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 7px);
  left: 0;
  width: 310px;
  max-height: var(--finance-popover-max-height, 360px);
  overflow: auto;
  padding: 10px;
  border: 1px solid #101820;
  border-radius: 4px;
  background: #fff;
  color: #0b1720;
  text-align: left;
  box-shadow: 0 16px 36px rgba(16, 24, 32, .2);
}

.finance-student-chip.is-popover-up .finance-student-popover {
  top: auto;
  bottom: calc(100% + 7px);
}

.finance-week-cell:nth-last-child(-n + 2) .finance-student-popover,
.finance-month-day:nth-child(7n) .finance-student-popover {
  right: 0;
  left: auto;
}

.finance-student-popover header,
.finance-payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.finance-payment-item {
  display: grid;
  gap: 5px;
  padding-top: 8px;
  border-top: 1px solid #e2e8ee;
}

.finance-status-form {
  display: grid;
  gap: 6px;
}

.finance-status-form input,
.finance-status-form select {
  width: 100%;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font: inherit;
}

.finance-status-form .row-actions {
  min-width: 0;
  gap: 6px;
}

.finance-status-form .row-actions button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid #cdd8df;
  border-radius: 5px;
  color: #101820;
  background: #fff;
}

.finance-status-form .row-actions button:hover {
  border-color: #101820;
}

.finance-status-form .row-actions button.secondary-action {
  color: #6b7378;
}

.empty.small {
  margin: 0;
  font-size: 12px;
}

.finance-months {
  display: grid;
  gap: 16px;
}

.finance-month h2 {
  margin-bottom: 12px;
}

.finance-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
}

.finance-month-head span {
  padding: 8px;
  border: 1px solid #171717;
  border-bottom: 0;
  background: #f5f8f6;
  text-align: center;
  font-weight: 800;
}

.finance-month-day {
  min-height: 128px;
  padding: 6px 8px;
  border: 1px solid #171717;
  background: #fff;
}

.finance-month-day header {
  margin-bottom: 4px;
  color: #17232c;
  font-weight: 800;
}

.finance-month-day.is-outside,
.finance-month-day.is-muted {
  color: #9aa4aa;
  background: #f4f6f7;
}

.finance-month-day.is-outside.has-course,
.finance-month-day.is-muted.has-course {
  background: #f7efd6;
}

.schedule-month .finance-month-head span,
.finance-month .finance-month-head span {
  border-color: #d7e1e7;
  color: #20313b;
  background: #eef5f3;
}

.schedule-month .finance-month-day,
.finance-month .finance-month-day {
  min-height: 150px;
  border-color: #d7e1e7;
  background: #fff;
}

.schedule-month .finance-month-day.has-course,
.finance-month .finance-month-day.has-course {
  background: #fff6d8;
}

.schedule-month .finance-month-day header,
.finance-month .finance-month-day header {
  margin-bottom: 8px;
  color: #13242e;
  font-size: 15px;
}

.classroom-section .finance-schedule-panel {
  max-height: none;
}

.classroom-usage-table .classroom-usage-cell {
  vertical-align: top;
}

.classroom-usage-cell.has-course {
  background: #fff8dc;
}

.classroom-course-card {
  align-items: stretch;
  gap: 5px;
  padding: 6px 5px;
}

.classroom-course-card .class-name-link {
  color: #12222c;
  font-weight: 800;
  text-decoration: none;
}

.classroom-course-card .class-name-link:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.classroom-change-form {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) auto;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}

.classroom-change-form select {
  min-width: 0;
  height: 32px;
  padding: 4px 6px;
  font-size: 12px;
}

.classroom-change-form button {
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin: 0 4px 4px 0;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status.ok {
  color: var(--green-dark);
  background: #e6f5ef;
}

.status.muted {
  color: #6b7378;
  background: #eef1f3;
}

.status.warn {
  color: #8a5b10;
  background: #fff3d6;
}

.status.partial {
  color: #7a5a03;
  background: #fff8d9;
}

@media (max-width: 820px) {
  .topbar,
  .hero,
  .list-row,
  .school-detail-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats,
  .grid.two,
  .dashboard-today-grid,
  .fields,
  .fields.two-fields,
  .fields.three-fields,
  .score-grid {
    grid-template-columns: 1fr;
  }

  .school-info-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .page {
    width: calc(100% - 20px);
    margin-top: 14px;
  }

  .section-title-row {
    display: grid;
    gap: 8px;
  }

  .score-legend span {
    width: 100%;
  }

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

  .summary-file-actions {
    justify-content: flex-start;
  }

  .report-list-row {
    grid-template-columns: 1fr;
  }

  .record-status {
    justify-content: flex-start;
    white-space: normal;
  }

  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .schedule-toolbar,
  .week-nav,
  .week-jump {
    justify-content: flex-start;
  }

  .week-jump {
    width: 100%;
  }

  .week-jump label {
    width: 100%;
  }

  .week-jump input {
    width: min(190px, 100%);
  }

  .calendar-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .month-calendar-toolbar {
    grid-template-columns: 1fr;
  }

  .calendar-weekdays,
  .month-calendar-grid {
    grid-template-columns: repeat(7, minmax(30px, 1fr));
  }

  .month-calendar-grid {
    max-height: 58vh;
    overflow: auto;
  }

  .calendar-weekdays span {
    font-size: 11px;
  }

  .month-calendar-empty,
  .month-calendar-day {
    min-height: 44px;
  }

  .month-calendar-day {
    padding: 4px 2px;
  }

  .month-calendar-day strong {
    font-size: 14px;
  }

  .month-calendar-day span {
    display: none;
  }

  .calendar-dialog-head,
  .calendar-dialog-actions,
  .date-dialog-launch {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-dialog-actions > div {
    flex-direction: column;
  }
}
