:root {
  --ink: #f5f5f7;
  --muted: #a1a1aa;
  --line: #2a2a33;
  --card: #15151c;
  --blue: #6bb8ff;
  --green: #5ee0a0;
  --purple: #ac8cff;
  --red: #ff8d8d;
  color-scheme: dark;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #0b0b10;
  color: var(--ink);
  min-height: 100vh;
}
.topbar {
  height: 68px;
  padding: 0 clamp(22px, 5vw, 76px);
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(11, 11, 16, 0.9);
  backdrop-filter: blur(18px);
  z-index: 10;
}
.topbar a {
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-decoration: none;
}
.topbar a span {
  color: var(--blue);
}
.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.topbar button {
  margin-left: auto;
}
main {
  width: min(1320px, calc(100% - 44px));
  margin: 0 auto;
  padding: 54px 0 84px;
}
.login-card {
  width: min(680px, 100%);
  margin: 7vh auto;
  padding: clamp(30px, 6vw, 62px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 0, rgba(108, 98, 255, 0.2), transparent 36%),
    var(--card);
  box-shadow: 0 45px 120px rgba(0, 0, 0, 0.35);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}
.login-card h1,
.dashboard-head h1 {
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.95;
  letter-spacing: -0.065em;
  margin: 20px 0;
}
.login-card > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}
.login-card form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 36px;
}
.login-card label {
  font-size: 12px;
  color: var(--muted);
}
input,
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: #0d0d12;
  border: 1px solid #383842;
  border-radius: 12px;
  color: var(--ink);
  font: inherit;
  padding: 13px 14px;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(107, 184, 255, 0.12);
}
button {
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #0b0b10;
  font-weight: 800;
  padding: 13px 20px;
  cursor: pointer;
}
button:hover {
  transform: translateY(-1px);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 30px;
}
.dashboard-head h1 {
  font-size: clamp(48px, 7vw, 88px);
  margin-bottom: 14px;
}
.dashboard-head p {
  color: var(--muted);
}
.live-pill {
  border: 1px solid #2c4a3b;
  background: #10251d;
  border-radius: 999px;
  color: var(--green);
  padding: 10px 15px;
  font-size: 12px;
  white-space: nowrap;
}
.live-pill i {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 7px;
  box-shadow: 0 0 0 5px rgba(94, 224, 160, 0.1);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 9px rgba(94, 224, 160, 0);
  }
}
.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.metrics article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}
.metrics span,
.metrics small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.metrics strong {
  display: block;
  font-size: 42px;
  letter-spacing: -0.05em;
  margin: 12px 0 5px;
}
.tabs {
  display: flex;
  gap: 8px;
  margin: 32px 0 16px;
  overflow: auto;
}
.tabs button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tabs button.active {
  background: var(--ink);
  color: #0b0b10;
}
.tabs span {
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
  min-width: 22px;
  height: 22px;
  border-radius: 12px;
  background: rgba(127, 127, 127, 0.18);
  font-size: 11px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #101016;
  overflow: hidden;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 26px 28px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  margin: 5px 0 0;
  font-size: 28px;
  letter-spacing: -0.04em;
}
.panel-head p {
  margin: 0;
}
.student-panel-head > div > p:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.student-tools {
  display: flex;
  align-items: end;
  gap: 10px;
}
.student-tools label {
  color: var(--muted);
  font-size: 11px;
}
.student-tools input {
  width: 240px;
  margin-top: 6px;
}
.export {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.student-table-wrap {
  overflow: auto;
}
.student-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.student-table th {
  padding: 14px 28px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.student-table td {
  padding: 20px 28px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.student-table tr:last-child td {
  border-bottom: 0;
}
.student-table td:nth-child(2) code {
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.activity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.activity-tags span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d4d4d8;
  font-size: 11px;
}
.records {
  display: grid;
}
.record {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(220px, 1.4fr) minmax(
      270px,
      2fr
    );
  gap: 24px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.record:last-child {
  border-bottom: 0;
}
.record-identity h3 {
  margin: 0 0 6px;
  font-size: 18px;
}
.record-identity p,
.record-content p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.record-content strong {
  display: block;
  margin-bottom: 7px;
}
.record-grade {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 9px;
  align-items: end;
}
.record-grade label {
  font-size: 11px;
  color: var(--muted);
}
.record-grade input,
.record-grade textarea {
  margin-top: 6px;
}
.record-grade textarea {
  min-height: 68px;
  resize: vertical;
}
.record-grade button {
  border-radius: 12px;
  height: 43px;
}
.answers {
  margin-top: 10px;
}
.answers details {
  border-top: 1px solid var(--line);
  padding: 9px 0;
}
.answers summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}
.answers p {
  white-space: pre-wrap;
  margin-top: 8px;
  color: #d4d4d8;
}
.empty {
  padding: 70px 28px;
  text-align: center;
  color: var(--muted);
}
.status {
  min-height: 22px;
  color: var(--muted);
  margin: 16px 0;
}
.status.error {
  color: var(--red);
}
.saved {
  color: var(--green);
  font-size: 11px;
  margin-top: 7px;
}
@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 900px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .record {
    grid-template-columns: 1fr;
  }
  .record-grade {
    grid-template-columns: 80px 1fr auto;
  }
  .student-panel-head {
    align-items: flex-end;
  }
  .student-tools {
    flex-direction: column;
    align-items: stretch;
  }
  .student-tools input {
    width: 220px;
  }
}
@media (max-width: 680px) {
  .student-panel-head {
    display: block;
  }
  .student-tools {
    margin-top: 18px;
  }
  .student-tools input {
    width: 100%;
  }
  .student-table thead {
    display: none;
  }
  .student-table,
  .student-table tbody,
  .student-table tr,
  .student-table td {
    display: block;
  }
  .student-table tr {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
  }
  .student-table tr:last-child {
    border-bottom: 0;
  }
  .student-table td {
    display: grid;
    grid-template-columns: 105px 1fr;
    gap: 12px;
    padding: 6px 0;
    border: 0;
  }
  .student-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}
@media (max-width: 560px) {
  main {
    width: min(100% - 26px, 1320px);
    padding-top: 36px;
  }
  .topbar p {
    display: none;
  }
  .login-card {
    padding: 28px 22px;
  }
  .login-card form {
    grid-template-columns: 1fr;
  }
  .dashboard-head {
    display: block;
  }
  .live-pill {
    display: inline-block;
    margin-top: 8px;
  }
  .metrics {
    gap: 8px;
  }
  .metrics article {
    padding: 16px;
  }
  .metrics strong {
    font-size: 32px;
  }
  .panel-head {
    padding: 20px;
  }
  .record {
    padding: 21px 20px;
  }
  .record-grade {
    grid-template-columns: 1fr;
  }
  .record-grade button {
    width: 100%;
  }
  .student-table td {
    grid-template-columns: 92px 1fr;
  }
}

.quiz-tools { display: flex; align-items: end; gap: 12px; }
.quiz-tools label { color: var(--muted); font-size: 12px; }
#quiz-session-count { margin-top: 8px; color: var(--muted); font-size: 13px; }
#panel-quiz .panel-head { flex-wrap: wrap; gap: 20px; }
@media (max-width: 560px) {
  .quiz-tools { width: 100%; flex-direction: column; align-items: stretch; }
}
