.teacher {
  max-width: 900px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px 32px;
}
.teacher h1 { font-size: 1.6rem; margin: 0; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
}

.login { max-width: 380px; margin: 15vh auto 0; text-align: center; }
.login form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

.teacher input, .teacher select {
  font: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.teacher input:focus, .teacher select:focus { outline: none; border-color: var(--accent); }

.hint { color: var(--muted); margin: 8px 0 0; }
.center { text-align: center; }
.error { color: var(--accent); min-height: 1.4em; margin: 10px 0 0; }

.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.bar h1 { white-space: nowrap; }
.teacher button { white-space: nowrap; }
button.small, .button-link.small { font-size: 0.95rem; padding: 9px 14px; }
.bar-actions { display: flex; gap: 8px; }
.button-link {
  display: inline-block;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
  white-space: nowrap;
}
.back-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}
button:disabled { opacity: 0.5; cursor: default; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.filters select { min-width: 96px; }
.count { flex: 1; color: var(--muted); padding-bottom: 10px; white-space: nowrap; }

.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
th { font-size: 0.85rem; color: var(--muted); position: sticky; top: 0; background: var(--surface); }
td:last-child, th:last-child { text-align: right; font-weight: 700; }
tbody tr:last-child td { border-bottom: none; }
.table-wrap .hint { padding: 16px; margin: 0; }
.table-wrap .hint:empty { display: none; }

@media (max-width: 560px) {
  .filters label { flex: 1; }
  .filters select { min-width: 0; width: 100%; }
  #download { flex-basis: 100%; order: 3; }
  .count { flex-basis: 100%; order: 4; padding: 0; }
}
