:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
  color: #0f172a;
  background: #f4f7fb;
  font-size: 14px;
  --blue: #2563eb;
  --muted: #64748b;
  --line: #e2e8f0;
  --nav: #111e37;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
.button-link {
  min-height: 40px;
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
button,
input,
select {
  min-height: 40px;
  border-radius: 8px;
}
button {
  border: 1px solid var(--line);
  padding: 8px 14px;
  background: white;
  color: #334155;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition:
    background 0.15s,
    border-color 0.15s;
}
button:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #b5c5dc;
}
.primary {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}
.primary:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
.danger {
  color: #dc2626;
  border-color: #fecaca;
  background: white;
}
.danger:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #dc2626;
}
.ghost {
  background: transparent;
  border-color: transparent;
}
.icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  vertical-align: middle;
}
a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 3px solid #93b4ff;
  outline-offset: 3px;
}
input,
select {
  width: 100%;
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  background: white;
}
input:focus,
select:focus {
  border-color: #2563eb;
}
input[type="file"] {
  font-size: 13px;
  padding: 8px;
  min-height: 42px;
}
input::file-selector-button {
  border: 0;
  background: #eef2ff;
  color: #3730a3;
  padding: 5px 9px;
  border-radius: 5px;
  margin-right: 8px;
}
label {
  display: block;
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}
label > input,
label > select {
  margin-top: 7px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 24px;
  letter-spacing: -0.6px;
  margin-bottom: 8px;
}
h2 {
  font-size: 17px;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
h3 {
  font-size: 15px;
  margin-bottom: 6px;
}
.hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 0;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.8px;
  font-weight: 700;
  color: #718096;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: 1px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #2563eb;
  color: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px #2563eb20;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 1.8px;
  font-weight: 500;
  color: #94a3b8;
  margin-top: 4px;
}
.shell {
  min-height: 100dvh;
  padding-left: 226px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 226px;
  background: var(--nav);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 30px 18px 20px;
  z-index: 10;
}
.sidebar .brand {
  margin: 0 10px 42px;
}
.sidebar .eyebrow {
  margin-left: 14px;
  color: #8290aa;
  margin-bottom: 14px;
}
.nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.nav button {
  color: #aebbd0;
  background: transparent;
  border-color: transparent;
  justify-content: flex-start;
  padding: 12px 14px;
  gap: 12px;
  font-weight: 500;
}
.nav button:hover:not(:disabled) {
  background: #20314e;
  color: white;
  border-color: transparent;
}
.nav button.active {
  background: #2563eb;
  color: white;
  box-shadow: 0 4px 12px #0001;
}
.sidebar-foot {
  margin-top: auto;
  padding-top: 36px;
}
.sidebar-foot .hint {
  color: #8290aa;
  font-size: 11px;
  margin: 18px 12px 0;
}
.sidebar-foot button {
  width: 100%;
  color: #b8c4d8;
  justify-content: flex-start;
}
.topbar {
  height: 86px;
  background: #ffffffd9;
  border-bottom: 1px solid var(--line);
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar h1 {
  font-size: 19px;
  margin-bottom: 4px;
}
.topbar .hint {
  font-size: 12px;
}
.teacher-status {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 12px;
  color: #475569;
}
.avatar {
  display: grid;
  place-items: center;
  background: #e9efff;
  color: #3f51a3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-weight: 700;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a34a;
  display: inline-block;
  margin-right: 5px;
}
.content {
  max-width: 1440px;
  margin: auto;
  padding: 28px 34px 40px;
  min-width: 0;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.page-heading .eyebrow {
  margin-bottom: 7px;
}
.panel,
.activity-card,
.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 5px #0f172a03;
}
.panel {
  padding: 22px;
  margin-bottom: 20px;
  min-width: 0;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.count {
  display: inline-block;
  border-radius: 6px;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 6px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.form-grid.student-form {
  grid-template-columns: 1fr 1fr 1fr auto;
}
.form-grid.assignment-form {
  grid-template-columns: 1fr 1.3fr 1.2fr auto;
}
.compact-form {
  display: flex;
  align-items: end;
  gap: 12px;
  max-width: 520px;
}
.compact-form label {
  flex: 1;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.activity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.activity-card {
  padding: 20px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.activity-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.activity-head h3 {
  font-size: 16px;
}
.activity-class {
  color: #64748b;
  font-size: 12px;
  margin: 6px 0 18px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.badge {
  font-size: 11px;
  padding: 4px 8px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
.badge.success {
  background: #f0fdf4;
  color: #15803d;
  border-color: #dcfce7;
}
.badge.warning {
  background: #fffbeb;
  color: #b45309;
  border-color: #fef3c7;
}
.badge.danger {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.late-duration {
  display: block;
  color: #b45309;
  margin-top: 5px;
  white-space: nowrap;
}
.late-notice {
  display: flex;
  gap: 12px;
  padding: 13px;
  margin-bottom: 18px;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  background: #fff7ed;
  color: #b45309;
}
.late-notice p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.6;
}
.late-result {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.statistics-filter {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  align-items: end;
}
.statistics-filter .class-filter {
  grid-row: span 2;
}
.statistics-filter select[multiple] {
  min-height: 112px;
}
.statistics-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.statistics-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 20px;
}
.statistics-tabs button {
  white-space: nowrap;
}
.statistics-tabs button.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}
.statistics-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.statistics-metric {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  text-align: left;
  min-width: 0;
}
.statistics-metric.clickable {
  cursor: pointer;
}
.statistics-metric.clickable:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}
.statistics-metric span {
  color: var(--muted);
  font-size: 12px;
}
.statistics-metric strong {
  display: block;
  font-size: 25px;
  margin-top: 8px;
  color: #0f172a;
}
.chart-wrap {
  width: 100%;
  min-height: 230px;
  overflow: hidden;
}
.chart-wrap svg {
  width: 100%;
  height: auto;
  min-height: 220px;
}
.chart-grid-line {
  stroke: #e2e8f0;
  stroke-width: 1;
}
.chart-axis-label {
  fill: #64748b;
  font-size: 11px;
}
.chart-line {
  fill: none;
  stroke: #2563eb;
  stroke-width: 3;
}
.chart-line.secondary {
  stroke: #16a34a;
}
.chart-point {
  fill: #fff;
  stroke: #2563eb;
  stroke-width: 2;
}
.bar-chart {
  display: grid;
  gap: 12px;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 160px) 1fr 55px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.bar-track {
  height: 10px;
  background: #eef2f7;
  border-radius: 8px;
  overflow: hidden;
}
.bar-track span {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: #2563eb;
}
.matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 600px;
}
.matrix-table {
  width: max-content;
  min-width: 100%;
}
.matrix-table th,
.matrix-table td {
  min-width: 88px;
  text-align: center;
}
.matrix-table .matrix-person {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 150px;
  text-align: left;
  background: #fff;
  box-shadow: 2px 0 0 #e2e8f0;
}
.matrix-table th.matrix-person {
  background: #f8fafc;
  z-index: 4;
}
.matrix-mobile {
  display: none;
}
.matrix-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fff;
}
.matrix-card h3 small {
  color: var(--muted);
  font-weight: 400;
  margin-left: 5px;
}
.matrix-card > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #f1f5f9;
  font-size: 12px;
}
.matrix-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 4px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.matrix-cell.present,
.matrix-cell.on_time {
  color: #15803d;
  background: #f0fdf4;
}
.matrix-cell.late {
  color: #b45309;
  background: #fff7ed;
}
.matrix-cell.absent,
.matrix-cell.missing {
  color: #dc2626;
  background: #fef2f2;
}
.weight-note {
  padding: 12px 14px;
  border-radius: 9px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 20px;
}
.statistics-error {
  text-align: center;
  padding: 42px 20px;
}
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.skeleton {
  height: 100px;
  border-radius: 12px;
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 50%, #eef2f7 75%);
  background-size: 200% 100%;
  animation: skeleton 1.2s infinite linear;
}
@keyframes skeleton {
  to {
    background-position: -200% 0;
  }
}
.badge.info {
  background: #eff6ff;
  color: #2563eb;
  border-color: #dbeafe;
}
.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 12px;
  color: #475569;
}
.time-grid span {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 5px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 12px;
}
.stat {
  font-size: 11px;
  color: #64748b;
}
.stat strong {
  display: block;
  font-size: 22px;
  font-weight: 650;
  color: #0f172a;
  margin-top: 5px;
  letter-spacing: -0.6px;
}
.stat:last-child strong {
  color: #2563eb;
}
.progress {
  height: 5px;
  border-radius: 10px;
  background: #eef2f7;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress > span {
  display: block;
  height: 100%;
  background: #2563eb;
  border-radius: 10px;
}
.activity-actions {
  padding-top: 16px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.activity-actions button {
  font-size: 12px;
  padding: 6px 10px;
  min-height: 34px;
}
.activity-actions .danger {
  margin-left: auto;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.metric {
  padding: 20px;
  position: relative;
}
.metric .metric-icon {
  position: absolute;
  right: 18px;
  top: 18px;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  padding: 9px;
  display: flex;
}
.metric:nth-child(2) .metric-icon {
  background: #eef2ff;
  color: #6366f1;
}
.metric:nth-child(3) .metric-icon {
  background: #f0fdf4;
  color: #16a34a;
}
.metric:nth-child(4) .metric-icon {
  background: #fff7ed;
  color: #d97706;
}
.metric p {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
}
.metric strong {
  font-size: 32px;
  letter-spacing: -1px;
  font-weight: 650;
  display: block;
}
.metric small {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 10px;
}
.welcome {
  background: linear-gradient(105deg, #172a50, #233f75);
  color: white;
  padding: 26px;
  border-radius: 14px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.welcome:after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  border: 35px solid #ffffff05;
  border-radius: 50%;
  right: -45px;
  top: -50px;
  pointer-events: none;
}
.welcome h2 {
  font-size: 21px;
  margin-bottom: 10px;
}
.welcome .hint {
  color: #b9c9e5;
  max-width: 560px;
}
.welcome button {
  position: relative;
  z-index: 1;
  white-space: nowrap;
  background: #ffffff15;
  border-color: #ffffff25;
  color: white;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.recent-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  border-top: 1px solid #f1f5f9;
}
.recent-row h3 {
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.recent-row .hint {
  font-size: 11px;
}
.empty {
  text-align: center;
  padding: 38px 16px;
  color: #94a3b8;
  line-height: 1.8;
}
.empty .icon {
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  color: #b8c4d6;
}
.empty p {
  margin-bottom: 0;
  font-size: 13px;
}
.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.class-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px;
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.class-card h3 {
  overflow-wrap: anywhere;
  font-size: 14px;
}
.class-card .danger {
  padding: 6px;
  min-height: 32px;
  margin-left: auto;
  flex-shrink: 0;
}
.class-card .class-symbol {
  background: #eef2ff;
  color: #6366f1;
  padding: 9px;
  border-radius: 8px;
  display: flex;
}
.table-wrap {
  max-height: 540px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 1;
}
th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  overflow-wrap: anywhere;
}
td button {
  font-size: 12px;
  min-height: 32px;
  padding: 5px 10px;
}
tbody tr:hover {
  background: #f8fafc;
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.table-toolbar input {
  max-width: 270px;
}
.table-foot {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 12px;
}
.import-card {
  border-top: 3px solid #818cf8;
}
.import-card .compact-form {
  max-width: 680px;
}
.import-preview {
  margin-top: 20px;
}
.import-preview .card {
  border: 1px solid var(--line);
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.import-table-wrap {
  max-height: 300px;
  overflow: auto;
  margin-top: 12px;
}
.import-class-input {
  max-width: 300px;
  margin: 8px 0;
}
.import-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.import-status {
  font-size: 13px;
  line-height: 1.8;
  margin: 12px 0 0;
}
.import-error {
  color: #dc2626;
}
.import-ok {
  color: #16a34a;
}
.message {
  font-size: 13px;
  line-height: 1.7;
  border-radius: 8px;
  padding: 11px 13px;
  background: #fef2f2;
  color: #b91c1c;
  overflow-wrap: anywhere;
  margin: 12px 0 0;
}
.message:empty {
  display: none;
}
.message.success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #dcfce7;
}
.message.info {
  background: #eff6ff;
  color: #2563eb;
}
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(ellipse at 50% 0, #dfe8fc, transparent 65%), #f4f7fb;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 15px 50px #17335d0a;
}
.login-card .brand {
  justify-content: center;
  margin-bottom: 14px;
}
.login-card > .hint {
  text-align: center;
  margin-bottom: 30px;
}
.login-card h1 {
  font-size: 18px;
  margin-bottom: 7px;
}
.login-card form {
  margin-top: 22px;
}
.login-card button {
  width: 100%;
  margin-top: 18px;
}
.login-foot {
  text-align: center;
  color: #94a3b8;
  font-size: 11px;
  margin: 24px 0 0;
}
.student-layout {
  min-height: 100dvh;
  padding: 0 18px 36px;
}
.student-header {
  max-width: 560px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 23px 0;
}
.student-header .brand {
  font-size: 18px;
}
.student-header .brand-mark {
  width: 30px;
  height: 30px;
}
.student-header > span {
  font-size: 12px;
  color: #64748b;
}
.student {
  max-width: 560px;
  margin: auto;
}
.student .panel {
  padding: 22px;
}
.student-activity {
  border-top: 3px solid #2563eb;
}
.student-activity h1 {
  font-size: 21px;
  margin: 16px 0 7px;
  overflow-wrap: anywhere;
}
.student-activity .time-grid {
  margin-top: 20px;
}
.student-fields {
  display: grid;
  gap: 15px;
}
.student-note {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  color: #2563eb;
  border-radius: 8px;
  font-size: 12px;
  padding: 10px 12px;
  line-height: 1.7;
  margin-bottom: 20px;
}
.student-submit {
  width: 100%;
  margin-top: 20px;
  min-height: 44px;
}
.student-footer {
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.8;
}
.upload-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.file-picker {
  border: 1px dashed #bdcce4;
  border-radius: 10px;
  background: #f8faff;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  color: #334155;
  position: relative;
}
.file-picker:hover {
  background: #eff6ff;
  border-color: #2563eb;
}
.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  left: 50%;
  bottom: 0;
  min-height: 0;
  padding: 0;
}
.file-picker:focus-within {
  outline: 3px solid #93b4ff;
  outline-offset: 2px;
}
.file-picker .icon {
  display: block;
  margin: 0 auto 8px;
  color: #2563eb;
}
.file-picker small {
  display: block;
  color: #94a3b8;
  font-weight: 400;
  margin-top: 5px;
  font-size: 10px;
}
.file-list {
  margin-top: 16px;
  max-height: 260px;
  overflow: auto;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 0;
}
.file-row > div {
  min-width: 0;
  flex: 1;
}
.file-row p {
  font-size: 12px;
  overflow-wrap: anywhere;
  margin: 0 0 3px;
}
.file-row small {
  color: #94a3b8;
  font-size: 11px;
}
.file-row button {
  padding: 5px;
  min-height: 30px;
  flex-shrink: 0;
}
.file-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
  color: #64748b;
}
.result-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 22px;
  margin-top: 20px;
  color: #166534;
}
.result-card h2 {
  margin: 10px 0;
}
.result-card p {
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 0;
  overflow-wrap: anywhere;
}
.toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  max-width: calc(100vw - 40px);
  display: grid;
  gap: 10px;
}
.toast {
  padding: 13px 16px;
  border-radius: 10px;
  color: #fff;
  background: #1e293b;
  box-shadow: 0 8px 24px #0f172a20;
  max-width: 420px;
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  gap: 12px;
  align-items: center;
}
.toast.error {
  background: #991b1b;
}
.toast button {
  color: white;
  min-height: 24px;
  padding: 0 4px;
  border: 0;
  background: transparent;
}
.boot {
  padding: 80px 20px;
  text-align: center;
  color: #64748b;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  width: min(860px, calc(100% - 32px));
  max-height: 85dvh;
  box-shadow: 0 24px 80px #0f172a30;
  color: #0f172a;
}
dialog::backdrop {
  background: #0f172a80;
  backdrop-filter: blur(3px);
}
.modal-head {
  padding: 19px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.modal-head h2 {
  margin: 0;
  font-size: 17px;
}
.modal-head button {
  padding: 5px;
  min-height: 32px;
}
.modal-body {
  padding: 22px;
  overflow: auto;
  max-height: calc(85dvh - 77px);
}
.modal-body .table-wrap {
  max-height: 55dvh;
}
.qr-content {
  text-align: center;
  max-width: 440px;
  margin: auto;
}
.qr {
  display: block;
  width: 240px;
  height: 240px;
  max-width: 100%;
  object-fit: contain;
  margin: 15px auto;
  background: white;
}
.qr-link {
  display: block;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  word-break: break-all;
  line-height: 1.7;
  margin: 18px 0 12px;
}
.confirm-text {
  line-height: 1.8;
  color: #64748b;
  font-size: 14px;
}
.confirm-actions {
  justify-content: flex-end;
  margin-top: 24px;
}
.download-list {
  display: grid;
  gap: 8px;
}
.download-list button {
  justify-content: flex-start;
  text-align: left;
  overflow-wrap: anywhere;
  white-space: normal;
}
.mobile-menu {
  display: none;
}
.section-heading button {
  flex-shrink: 0;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1600px) {
  .content {
    padding-top: 34px;
  }
}
@media (max-width: 1150px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid > button {
    grid-column: 1/-1;
    justify-self: start;
  }
  .form-grid.student-form,
  .form-grid.assignment-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .activity-grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 16px;
  }
  .metric .metric-icon {
    right: 12px;
    top: 14px;
    padding: 6px;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .statistics-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .statistics-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .content {
    padding: 24px;
  }
  .topbar {
    padding: 0 24px;
  }
}
@media (max-width: 760px) {
  .shell {
    padding-left: 0;
  }
  .sidebar {
    width: auto;
    position: static;
    padding: 18px;
    background: #111e37;
  }
  .sidebar .brand {
    margin: 0;
    font-size: 19px;
  }
  .sidebar .brand small,
  .sidebar > .eyebrow,
  .sidebar-foot .hint {
    display: none;
  }
  .mobile-menu {
    display: flex;
    margin-left: auto;
    color: white;
    border-color: #ffffff25;
    background: transparent;
  }
  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .nav {
    display: none;
    margin-top: 18px;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .sidebar.open .nav {
    display: grid;
  }
  .sidebar-foot {
    display: none;
    padding-top: 6px;
  }
  .sidebar.open .sidebar-foot {
    display: block;
  }
  .topbar {
    padding: 18px;
    height: auto;
    min-height: 78px;
  }
  .topbar h1 {
    font-size: 17px;
  }
  .teacher-status .status-label {
    display: none;
  }
  .content {
    padding: 20px 16px 32px;
  }
  .page-heading h1 {
    font-size: 21px;
  }
  .page-heading .eyebrow {
    font-size: 10px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .statistics-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .statistics-filter .class-filter {
    grid-row: auto;
    grid-column: 1 / -1;
  }
  .statistics-filter select[multiple] {
    min-height: 90px;
  }
  .statistics-metrics,
  .skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .statistics-metric strong {
    font-size: 22px;
  }
  .bar-row {
    grid-template-columns: 90px 1fr 48px;
  }
  .matrix-wrap {
    display: none;
  }
  .matrix-mobile {
    display: grid;
    gap: 10px;
  }
  .metric strong {
    font-size: 27px;
  }
  .metric small {
    font-size: 10px;
  }
  .welcome {
    padding: 22px;
    display: block;
  }
  .welcome h2 {
    font-size: 19px;
  }
  .welcome button {
    margin-top: 18px;
  }
  .panel {
    padding: 18px;
    border-radius: 12px;
  }
  .section-heading {
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
  }
  .section-heading h2 {
    font-size: 16px;
  }
  .activity-card {
    padding: 18px;
  }
  .activity-actions .danger {
    margin-left: 0;
  }
  .form-grid,
  .form-grid.student-form,
  .form-grid.assignment-form {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .compact-form {
    flex-wrap: wrap;
  }
  .compact-form label {
    flex-basis: 180px;
  }
  .class-grid {
    grid-template-columns: 1fr;
  }
  .table-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .table-toolbar input {
    max-width: none;
  }
  .responsive-table thead {
    display: none;
  }
  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
  }
  .responsive-table tr {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
  }
  .responsive-table td {
    display: grid;
    grid-template-columns: 85px minmax(0, 1fr);
    border: 0;
    padding: 6px 0;
    gap: 8px;
  }
  .responsive-table td:before {
    content: attr(data-label);
    color: #94a3b8;
    font-size: 12px;
  }
  .responsive-table td button {
    justify-self: start;
  }
  .responsive-table td .download-list button {
    justify-self: stretch;
  }
  .responsive-table .empty-cell {
    display: block;
  }
  .responsive-table .empty-cell:before {
    display: none;
  }
  .import-table-wrap table {
    table-layout: fixed;
  }
  .import-table-wrap th,
  .import-table-wrap td {
    padding: 9px 6px;
    font-size: 12px;
  }
  .time-grid {
    gap: 8px;
  }
  .time-grid b {
    font-weight: 500;
  }
  .login-card {
    padding: 28px 24px;
  }
  .student-layout {
    padding: 0 14px 28px;
  }
  .student-header {
    padding: 20px 4px;
  }
  .student .panel {
    padding: 20px;
  }
  .modal-head,
  .modal-body {
    padding: 16px;
  }
  .toasts {
    right: 16px;
    bottom: 16px;
  }
  .activity-head h3 {
    font-size: 15px;
  }
}
@media (max-width: 380px) {
  .form-grid,
  .form-grid.student-form,
  .form-grid.assignment-form {
    grid-template-columns: 1fr;
  }
  .metric .metric-icon {
    padding: 5px;
    right: 10px;
  }
  .metric .metric-icon .icon {
    width: 16px;
  }
  .metric p {
    font-size: 11px;
  }
  .stats {
    gap: 4px;
  }
  .stat strong {
    font-size: 20px;
  }
  .activity-actions button {
    padding: 6px 8px;
  }
  .upload-choices {
    grid-template-columns: 1fr;
  }
  .time-grid {
    grid-template-columns: 1fr;
  }
  .student-header .brand {
    font-size: 17px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Prevent intrinsic input widths from expanding narrow grid tracks. */
.form-grid > * {
  min-width: 0;
}
.page-heading {
  flex-wrap: wrap;
}
.recent-row > div {
  min-width: 0;
}
.download-list button span {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .form-grid,
  .form-grid.student-form,
  .form-grid.assignment-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 500px) {
  .form-grid,
  .form-grid.student-form,
  .form-grid.assignment-form {
    grid-template-columns: minmax(0, 1fr);
  }
  .form-grid > button {
    justify-self: stretch;
  }
  .compact-form {
    max-width: 100%;
  }
  .compact-form label {
    min-width: 0;
  }
  .statistics-filter {
    grid-template-columns: minmax(0, 1fr);
  }
  .statistics-filter .class-filter,
  .statistics-actions {
    grid-column: auto;
  }
  .statistics-actions button,
  .statistics-actions .button-link {
    flex: 1 1 135px;
  }
}

.student-header .brand small {
  display: none;
}
