:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #182033;
  --muted: #657086;
  --line: #dde4ef;
  --primary: #1769e0;
  --primary-dark: #0c55bd;
  --danger: #c83c3c;
  --ok: #1d7f4f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
  margin-bottom: 16px;
}

.topbar p {
  color: var(--muted);
  margin-top: 4px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.narrow {
  max-width: 420px;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 360px 1fr;
  margin-bottom: 16px;
}

label {
  color: var(--muted);
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  height: 38px;
  padding: 0 10px;
}

button {
  background: var(--primary);
  border: 0;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font: inherit;
  height: 38px;
  padding: 0 14px;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  background: #e9eef8;
  color: var(--text);
}

button.ghost {
  background: transparent;
  color: var(--primary);
}

button.danger {
  background: var(--danger);
}

.hidden {
  display: none !important;
}

.message {
  color: var(--muted);
  margin-top: 10px;
  min-height: 22px;
}

.message.ok {
  color: var(--ok);
}

.message.error {
  color: var(--danger);
}

.toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.student-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  padding: 12px 0;
}

.student-row:first-child {
  border-top: 0;
}

.student-title {
  font-weight: 700;
}

.student-meta {
  color: var(--muted);
  font-size: 12px;
}

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

.progress-empty {
  color: var(--muted);
}

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

.student-report-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 14px;
}

.subheading {
  font-size: 15px;
  margin: 18px 0 10px;
}

.profile-card {
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.profile-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.profile-head h3 {
  font-size: 17px;
  margin: 0 0 3px;
}

.profile-head p,
.profile-empty {
  color: var(--muted);
  margin: 0;
}

.profile-state {
  background: #e5f3ff;
  border: 1px solid #bfddff;
  border-radius: 999px;
  color: #0c55bd;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  white-space: nowrap;
}

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

.profile-stats div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
}

.profile-stats strong {
  display: block;
  font-size: 20px;
  line-height: 1;
}

.profile-stats span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 5px;
}

.profile-summary {
  background: white;
  border-left: 4px solid var(--primary);
  margin: 0 0 12px;
  padding: 10px 12px;
}

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

.profile-grid h4,
.profile-last strong {
  display: block;
  font-size: 13px;
  margin: 0 0 7px;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.profile-tags span {
  background: #eef3fb;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #31415c;
  font-size: 12px;
  padding: 5px 9px;
}

.profile-follow {
  background: #fff9eb;
  border: 1px solid #f4dfab;
  border-radius: 7px;
  margin: 12px 0;
  padding: 10px 12px;
}

.profile-follow p,
.profile-last p {
  color: var(--muted);
  margin: 4px 0 0;
}

.profile-last > div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-width: 0;
  padding: 10px;
}

.progress-item {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  grid-template-columns: 100px 1fr 90px;
  padding: 10px 12px;
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: 1fr;
  }

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

  .student-actions {
    flex-wrap: wrap;
  }

  .profile-stats,
  .profile-grid,
  .profile-last {
    grid-template-columns: 1fr;
  }
}
