.teacher-body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    var(--ink);
  background-size: 28px 28px;
}

.teacher-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1440px, calc(100% - 48px));
  height: 88px;
  margin: 0 auto;
  color: white;
}

.teacher-header .brand small {
  color: rgba(255, 255, 255, 0.58);
}

.teacher-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.75rem;
  font-weight: 800;
}

.teacher-header-actions a,
.teacher-logout {
  padding: 9px 13px;
  color: white;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.teacher-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto 40px;
}

.teacher-login {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  min-height: calc(100vh - 138px);
  padding: 40px clamp(20px, 6vw, 90px);
  color: white;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 103, 70, 0.22), transparent 25rem),
    radial-gradient(circle at 85% 75%, rgba(127, 211, 255, 0.13), transparent 24rem);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
}

.login-copy {
  position: relative;
  max-width: 620px;
}

.login-copy h1 {
  margin: 0;
  font: 900 clamp(3.2rem, 7vw, 6.8rem)/0.98 var(--display);
  letter-spacing: -0.08em;
}

.login-copy > p {
  max-width: 490px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 1rem;
  line-height: 1.8;
}

.signal-board {
  display: flex;
  align-items: end;
  gap: 9px;
  height: 65px;
  margin-top: 48px;
}

.signal-board span {
  display: block;
  width: 15px;
  background: var(--coral);
  border: 2px solid white;
  border-radius: 4px;
  animation: signal 1.2s ease-in-out infinite alternate;
}

.signal-board span:nth-child(1) { height: 20%; }
.signal-board span:nth-child(2) { height: 45%; animation-delay: 0.12s; background: var(--mango); }
.signal-board span:nth-child(3) { height: 70%; animation-delay: 0.24s; background: var(--sky); }
.signal-board span:nth-child(4) { height: 100%; animation-delay: 0.36s; background: var(--mint); }

@keyframes signal {
  to { opacity: 0.45; transform: scaleY(0.7); transform-origin: bottom; }
}

.login-card {
  position: relative;
  width: min(440px, 100%);
  justify-self: end;
  padding: clamp(28px, 4vw, 48px);
  color: var(--ink);
  background: var(--cream);
  border: 3px solid white;
  border-radius: 20px 20px 34px 22px;
  box-shadow: 10px 12px 0 var(--coral);
  transform: rotate(0.8deg);
}

.card-tab {
  position: absolute;
  top: -17px;
  right: 25px;
  padding: 7px 15px;
  background: var(--mango);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 900;
}

.login-card h2 {
  margin: 0 0 28px;
  font: 900 2rem var(--display);
}

.login-card label {
  display: block;
  margin: 17px 0 8px;
  font-size: 0.72rem;
  font-weight: 900;
}

.login-card input {
  width: 100%;
  min-height: 53px;
  padding: 0 15px;
  color: var(--ink);
  background: white;
  border: 2px solid var(--ink);
  border-radius: 11px;
  outline: 0;
}

.login-card input:focus {
  box-shadow: 4px 4px 0 var(--sky);
}

.login-card .primary-button {
  width: 100%;
  margin-top: 26px;
}

.login-error {
  min-height: 18px;
  margin: 15px 0 0;
  color: var(--coral-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.dashboard {
  min-height: calc(100vh - 132px);
  padding: clamp(24px, 4vw, 52px);
  background: #f7f3e9;
  border: 2px solid white;
  border-radius: 28px;
  box-shadow: 9px 10px 0 var(--coral);
}

.dashboard-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.dashboard-heading h1 {
  margin: 0;
  font: 900 clamp(2.5rem, 5vw, 4.5rem)/1 var(--display);
  letter-spacing: -0.06em;
}

.dashboard-heading p {
  margin: 10px 0 0;
  color: var(--muted);
}

.dashboard-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: #207650;
  background: #dff8eb;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
}

.live-indicator i {
  width: 8px;
  height: 8px;
  background: var(--mint);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(89, 213, 165, 0.2);
  animation: live 1.3s ease infinite;
}

@keyframes live {
  50% { box-shadow: 0 0 0 1px rgba(89, 213, 165, 0.2); }
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 13px;
  margin-top: 34px;
}

.metric-card {
  position: relative;
  min-height: 130px;
  padding: 18px;
  border: 2px solid var(--ink);
  border-radius: 15px;
  box-shadow: 4px 5px 0 var(--ink);
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -26px;
  width: 80px;
  height: 80px;
  border: 14px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
}

.metric-card.coral { background: var(--coral); color: white; }
.metric-card.yellow { background: var(--lemon); }
.metric-card.blue { background: var(--sky); }
.metric-card.green { background: var(--mint); }
.metric-card.pink { background: var(--pink); }

.metric-card span,
.metric-card strong,
.metric-card small {
  position: relative;
  z-index: 1;
  display: block;
}

.metric-card span {
  font-size: 0.7rem;
  font-weight: 900;
}

.metric-card strong {
  margin-top: 8px;
  font: 900 2.8rem/1 var(--display);
}

.metric-card small {
  margin-top: 5px;
  font-size: 0.6rem;
  font-weight: 800;
  opacity: 0.67;
}

.student-board {
  margin-top: 25px;
  padding: 22px;
  background: white;
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: 5px 6px 0 var(--ink);
}

.board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 18px;
}

.board-heading h2 {
  margin: 0;
  font: 900 1.35rem var(--display);
}

.board-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.65rem;
}

.board-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.board-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.board-legend i,
.status-pill i {
  width: 8px;
  height: 8px;
  background: #c8ced9;
  border-radius: 50%;
}

.board-legend i.working,
.status-pill.working i { background: var(--blue); }
.board-legend i.published,
.status-pill.published i { background: var(--mint); }
.board-legend i.attention,
.status-pill.attention i { background: var(--coral); }

.student-table-wrap {
  max-height: 620px;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid #edf0f4;
  border-radius: 11px;
}

.student-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.student-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 10px 12px;
  color: var(--muted);
  background: #f4f5f7;
  border-bottom: 1px solid var(--line);
  font-size: 0.62rem;
  text-align: left;
}

.student-table td {
  padding: 12px;
  border-bottom: 1px solid #edf0f4;
  vertical-align: middle;
}

.student-table tr:last-child td {
  border-bottom: 0;
}

.student-table tr:hover td {
  background: #fffaf0;
}

.student-code-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.student-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--lemon);
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  font: 900 0.66rem var(--display);
}

.student-code-cell strong,
.student-code-cell small {
  display: block;
}

.student-code-cell small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.58rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  color: var(--muted);
  background: #f1f3f6;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 900;
}

.status-pill.working {
  color: #1f5cbf;
  background: #e9f1ff;
}

.status-pill.published {
  color: #207650;
  background: #dff8eb;
}

.status-pill.attention {
  color: #b53c29;
  background: #ffe9e4;
}

.table-action {
  padding: 6px 9px;
  color: var(--ink);
  background: white;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  font-size: 0.58rem;
  font-weight: 900;
  cursor: pointer;
}

.table-action:hover {
  color: white;
  background: var(--ink);
}

.empty-project {
  color: #9aa1af;
}

@media (max-width: 1000px) {
  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 780px) {
  .teacher-header,
  .teacher-shell {
    width: calc(100% - 24px);
  }

  .teacher-login {
    grid-template-columns: 1fr;
    gap: 45px;
  }

  .login-card {
    justify-self: start;
  }

  .dashboard-heading,
  .board-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 520px) {
  .teacher-header-actions span {
    display: none;
  }

  .teacher-login,
  .dashboard {
    padding: 22px;
  }

  .login-copy h1 {
    font-size: 3.1rem;
  }

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

  .dashboard-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
