/* ═══════════════════════════════════════════════════════════
   ROADMAP BATCH 5 — Teacher dashboard
   ═══════════════════════════════════════════════════════════ */

/* Hub tile (inherits .subject-card, just tint the icon) */
.subj-teacher .subj-icon-wrap {
  background: var(--blue);
  color: var(--surface);
}

/* ── Shared screen container ── */
#screen-teacher .screen-inner {
  padding: var(--sp-4) var(--sp-4) var(--sp-8);
  max-width: 720px;
  margin: 0 auto;
}

.teacher-header {
  margin-bottom: var(--sp-5);
}
.teacher-title {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -.5px;
  color: var(--dark);
  margin: 0 0 var(--sp-1);
}
.teacher-subtitle {
  font-size: .82rem;
  color: var(--gray-1);
  margin: 0;
  line-height: 1.5;
}
.teacher-join-code {
  display: inline-block;
  background: var(--yellow-l);
  border: 2px solid var(--dark);
  padding: 2px 8px;
  border-radius: var(--radius-s);
  font-family: monospace;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--dark);
  margin: 0 4px;
}
.teacher-class-actions {
  margin-top: var(--sp-3);
}
.btn-small {
  padding: 6px 14px;
  font-size: .75rem;
}

/* ── Cards ── */
.teacher-card {
  background: var(--surface);
  border: var(--px-border);
  box-shadow: var(--px-shadow);
  border-radius: var(--radius);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.teacher-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
  gap: var(--sp-3);
}
.teacher-card-title {
  font-size: .95rem;
  font-weight: 800;
  color: var(--dark);
  margin: 0;
}
.teacher-card-hint {
  font-size: .75rem;
  color: var(--gray-1);
  margin: 0 0 var(--sp-3);
  line-height: 1.5;
}
.teacher-create-btn {
  padding: 8px 16px;
  font-size: .8rem;
}
.teacher-loading,
.teacher-empty {
  padding: var(--sp-4);
  text-align: center;
  font-size: .82rem;
  color: var(--gray-1);
  background: var(--gray-5);
  border-radius: var(--radius-s);
}
.teacher-hint {
  font-size: .72rem;
  color: var(--gray-2);
  text-align: center;
  line-height: 1.6;
  margin-top: var(--sp-5);
}

/* ── Class list rows ── */
.teacher-class-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.teacher-class-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--gray-5);
  border: 2px solid var(--dark);
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
}
.teacher-class-row:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--px-shadow-s);
}
.teacher-class-main {
  flex: 1;
  min-width: 0;
}
.teacher-class-name {
  font-weight: 800;
  font-size: .88rem;
  color: var(--dark);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.teacher-class-meta {
  font-size: .7rem;
  color: var(--gray-1);
}
.teacher-class-code {
  font-family: monospace;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--dark);
  background: var(--yellow-l);
  padding: 4px 10px;
  border: 2px solid var(--dark);
  border-radius: var(--radius-s);
  font-size: .82rem;
}
.teacher-class-arrow {
  color: var(--gray-1);
  font-weight: 800;
  font-size: 1rem;
}

/* ── Histogram ── */
.teacher-histogram {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.teacher-hist-row {
  display: grid;
  grid-template-columns: 70px 1fr 40px;
  align-items: center;
  gap: var(--sp-3);
}
.teacher-hist-label {
  font-size: .72rem;
  color: var(--gray-1);
  font-weight: 700;
}
.teacher-hist-bar-wrap {
  height: 12px;
  background: var(--gray-5);
  border: 2px solid var(--dark);
  border-radius: 2px;
  overflow: hidden;
}
.teacher-hist-bar {
  height: 100%;
  background: var(--green);
  transition: width .4s ease;
}
.teacher-hist-count {
  font-size: .78rem;
  font-weight: 800;
  color: var(--dark);
  text-align: right;
}

/* ── Roster ── */
.teacher-roster {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.teacher-roster-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--gray-5);
  border: 2px solid var(--dark);
  border-radius: var(--radius-s);
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
}
.teacher-roster-row:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--px-shadow-s);
}
.teacher-roster-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--dark);
  flex-shrink: 0;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.teacher-roster-avatar-fallback {
  background: var(--yellow);
  color: var(--dark);
  font-weight: 900;
}
.teacher-roster-main {
  flex: 1;
  min-width: 0;
}
.teacher-roster-name {
  font-weight: 800;
  font-size: .85rem;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.teacher-roster-meta {
  font-size: .68rem;
  color: var(--gray-1);
  margin: 2px 0 4px;
}
.teacher-roster-bar-wrap {
  height: 6px;
  background: var(--gray-5);
  border: 1px solid var(--dark);
  border-radius: 2px;
  overflow: hidden;
}
.teacher-roster-bar {
  height: 100%;
  background: var(--green);
  transition: width .5s ease;
}

/* ── Struggle list ── */
.teacher-struggle-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.teacher-struggle-row {
  padding: var(--sp-2) var(--sp-3);
  background: var(--red-l);
  border: 2px solid var(--dark);
  border-radius: var(--radius-s);
}
.teacher-struggle-word {
  font-weight: 800;
  color: var(--dark);
  font-size: .85rem;
}
.teacher-struggle-meta {
  font-size: .68rem;
  color: var(--gray-1);
  margin-top: 2px;
}

/* ── Student drill-down ── */
.teacher-student-headrow {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.teacher-student-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--dark);
  object-fit: cover;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.teacher-overall-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.teacher-overall-stat {
  text-align: center;
  padding: var(--sp-3);
  background: var(--gray-5);
  border: 2px solid var(--dark);
  border-radius: var(--radius-s);
}
.teacher-overall-big {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--dark);
  line-height: 1;
}
.teacher-overall-label {
  font-size: .62rem;
  color: var(--gray-1);
  margin-top: 4px;
  line-height: 1.4;
}

.teacher-unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--sp-2);
}
.teacher-unit-cell {
  padding: var(--sp-2);
  background: var(--gray-5);
  border: 2px solid var(--dark);
  border-radius: var(--radius-s);
  text-align: center;
}
.teacher-unit-num {
  font-weight: 800;
  font-size: .75rem;
  color: var(--dark);
  margin-bottom: 4px;
}
.teacher-unit-bar-wrap {
  height: 5px;
  background: var(--surface);
  border: 1px solid var(--dark);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.teacher-unit-bar {
  height: 100%;
  background: var(--green);
}
.teacher-unit-count {
  font-size: .62rem;
  color: var(--gray-1);
  font-weight: 600;
}

.teacher-r5-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.teacher-r5-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--gray-5);
  border: 2px solid var(--dark);
  border-radius: var(--radius-s);
}
.teacher-r5-lesson {
  font-weight: 700;
  font-size: .78rem;
  color: var(--dark);
}
.teacher-r5-score {
  font-weight: 900;
  font-size: .82rem;
  color: var(--green);
}
.teacher-r5-date {
  font-size: .65rem;
  color: var(--gray-1);
}

/* Modal error line used by the teacher create modal */
.teacher-create-err {
  color: var(--red-d);
  font-size: .72rem;
  min-height: 1em;
  margin: 0;
}

/* ── Teacher student view: actions, insights, activity strip ── */
.teacher-student-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  flex-wrap: wrap;
}
.teacher-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.teacher-insight {
  background: var(--surface);
  border: 2px solid var(--gray-4);
  border-radius: var(--radius-s);
  padding: var(--sp-2) var(--sp-3);
}
.teacher-insight-ok   { border-color: var(--green); }
.teacher-insight-warn { border-color: var(--yellow, #F8B800); background: #FFF8E1; }
.teacher-insight-info { border-color: var(--blue); }
.teacher-insight-label {
  font-size: .62rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-2);
}
.teacher-insight-value {
  font-size: .95rem;
  font-weight: 900;
  color: var(--dark);
  margin-top: 2px;
}
.teacher-insight-hint {
  font-size: .68rem;
  color: var(--gray-1);
  margin-top: 2px;
}
.teacher-activity-wrap { margin-top: var(--sp-3); }
.teacher-activity-label {
  font-size: .62rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gray-2);
  margin-bottom: 6px;
}
.teacher-activity-strip {
  display: flex;
  gap: 3px;
  overflow-x: auto;
}
.teacher-activity-cell {
  flex: 0 0 10px;
  width: 10px;
  height: 24px;
  border-radius: 2px;
}
.teacher-activity-cell.h0 { background: var(--gray-5); }
.teacher-activity-cell.h1 { background: #C8E6C9; }
.teacher-activity-cell.h2 { background: #81C784; }
.teacher-activity-cell.h3 { background: #43B047; }
.teacher-activity-cell.h4 { background: #2E7D32; }

/* Ping modal */
.teacher-ping-modal { max-width: 480px; }
.teacher-quote-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--sp-2);
}
.teacher-quote-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px dashed var(--gray-4);
  border-radius: var(--radius-s);
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.teacher-quote-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: .8rem;
  color: var(--dark);
  line-height: 1.4;
}
.teacher-quote-row:hover { background: var(--gray-6, #F7F7F7); }
.teacher-quote-row input { margin-top: 3px; flex-shrink: 0; }
.teacher-quote-text { flex: 1; }
.teacher-ping-err {
  color: var(--red-d);
  font-size: .72rem;
  min-height: 1em;
  margin: var(--sp-2) 0 0;
}

/* ── Student-side Class card in Settings ── */
.class-current-box {
  background: var(--green-l);
  border: 2px solid var(--dark);
  border-radius: var(--radius-s);
  padding: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.class-current-name {
  font-weight: 800;
  font-size: .92rem;
  color: var(--dark);
}
.class-current-teacher {
  font-size: .72rem;
  color: var(--gray-1);
  margin-top: 2px;
}
.class-join-input {
  font-family: monospace;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .teacher-overall-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-2);
  }
  .teacher-overall-big { font-size: 1.3rem; }
  .teacher-overall-label { font-size: .56rem; }
  .teacher-hist-row {
    grid-template-columns: 54px 1fr 30px;
    gap: var(--sp-2);
  }
  .teacher-class-code { font-size: .72rem; letter-spacing: 1px; padding: 3px 8px; }
  .teacher-title { font-size: 1.2rem; }
}

