/* ── Teacher dashboard (#teacher) ── */

.t-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 0 48px;
  animation: heroEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  color: rgba(255, 255, 255, 0.7);
}

/* Tiles: icon, name and one line; a tile opens to full width to show its card */
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; grid-auto-flow: row dense; }
.t-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  min-width: 0;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.t-card:not(.open):hover { border-color: rgba(167, 139, 250, 0.5); background: rgba(255, 255, 255, 0.1); transform: translateY(-2px); }
.t-card.open { grid-column: 1 / -1; }
.t-card:not(.open) .t-card-head { height: 100%; } /* tiles in a row share one height */
.t-card-head {
  all: unset; box-sizing: border-box; width: 100%; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 18px; border-radius: 20px; position: relative;
}
.t-card-head:focus-visible { outline: 2px solid #a78bfa; outline-offset: 2px; }
.t-card.open .t-card-head { flex-direction: row; align-items: center; padding: 18px 22px 0; }
.t-card-icon { display: inline-flex; align-items: center; flex-shrink: 0; }
.t-card-icon .ico { width: 24px; height: 24px; }
.t-card-titles { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.t-card-head h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.t-card-about { font-family: var(--font-mono); font-size: 11px; line-height: 1.4; color: rgba(255, 255, 255, 0.55); }
.t-card-chev { position: absolute; top: 18px; right: 16px; opacity: 0.5; transition: transform 0.25s; }
.t-card-chev .ico { width: 18px; height: 18px; }
.t-card.open .t-card-chev { position: static; transform: rotate(90deg); opacity: 0.8; }
.t-card-body { display: none; padding: 16px 22px 22px; }
.t-card.open .t-card-body { display: block; animation: contentIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both; }
@media (max-width: 480px) {
  .t-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .t-card-head { padding: 14px; }
  .t-card-head h3 { font-size: 16px; }
  .t-card.open .t-card-head { padding: 14px 16px 0; }
  .t-card-body { padding: 14px 16px 18px; }
}

.t-muted { font-size: 13px; color: rgba(255, 255, 255, 0.6); line-height: 1.45; }
.t-faint { opacity: 0.5; }
.t-label {
  font-size: 11px;
  opacity: 0.6;
  font-family: var(--font-mono);
  display: block;
  margin-bottom: 8px;
}
.t-footnote {
  font-size: 11px;
  opacity: 0.55;
  font-family: var(--font-mono);
  margin-top: 6px;
}
.t-divider {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.t-display {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  min-height: 40px;
  margin-bottom: 14px;
  white-space: pre-wrap;
  line-height: 1.5;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.t-input,
.t-select {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  margin-bottom: 10px;
  outline: none;
}
.t-input {
  min-height: 72px;
  font-family: var(--font-body);
  font-size: 14px;
  resize: vertical;
}
.t-select option { background: #1a1a2e; color: #fff; }
.t-select.inline { flex: 1; min-width: 110px; width: auto; margin-bottom: 0; }
.t-input:focus, .t-select:focus { border-color: rgba(167, 139, 250, 0.7); }

.t-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.t-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  color: #fff;
  cursor: pointer;
}
.t-btn:disabled { opacity: 0.6; cursor: default; }
.t-btn.primary { background: #1a4de8; }
.t-btn.success { background: #16a34a; }
.t-btn.teal { background: #0d9488; }
.t-btn.danger { background: #dc2626; }
.t-btn.ghost {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}
.t-btn.small { font-size: 11px; padding: 4px 10px; border-radius: 8px; margin-top: 8px; }

.t-list {
  font-size: 13px;
  max-height: 220px;
  overflow-y: auto;
  margin: 2px 0 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 8px 12px;
}
.t-list.tall { max-height: 280px; }
.t-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.t-row strong { color: #fff; }
.t-row-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.t-score { font-family: var(--font-mono); color: #a78bfa; }
.t-icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  border-radius: 6px;
  opacity: 0.7;
}
.t-icon-btn:hover { opacity: 1; background: rgba(220, 38, 38, 0.25); }

.t-code-result { margin-top: 12px; font-family: var(--font-mono); font-size: 14px; color: #a78bfa; }
.t-code { color: #fff; font-size: 18px; letter-spacing: 2px; }

.t-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.t-stat {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.t-stat-val { font-family: var(--font-serif); font-size: 22px; font-weight: 700; color: #fff; }
.t-stat-label { font-size: 11px; opacity: 0.6; margin-top: 2px; }
.t-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.t-chip {
  background: rgba(26, 77, 232, 0.25);
  border: 1px solid rgba(26, 77, 232, 0.4);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: #c4b5fd;
}

.t-sub-toggle { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; justify-content: center; }
.t-sub-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}
.t-sub-btn.active { background: rgba(255, 255, 255, 0.95); color: #1a1714; }

.t-feedback { padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.t-feedback .t-footnote { margin: 0 0 4px; }
.t-feedback-msg { color: rgba(255, 255, 255, 0.85); line-height: 1.45; white-space: pre-wrap; }

/* Database usage meters */
.t-meter { margin-bottom: 8px; }
.t-meter-top { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; opacity: 0.8; margin-bottom: 4px; }
.t-meter-track { height: 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); overflow: hidden; }
.t-meter-fill { height: 100%; border-radius: 999px; transition: width 0.6s var(--ease-out); }
.t-meter-fill.ok { background: #22c55e; }
.t-meter-fill.warn { background: #eab308; }
.t-meter-fill.bad { background: #ef4444; }

/* ── Study Habits card ──
   One series per chart: accent #a78bfa marks the column the title is about, gray #7d7699 the rest
   (both checked ≥ 3:1 against the dark card). Text stays in the card's text colours. */
#teacher-study-body { position: relative; color: rgba(255, 255, 255, 0.75); }
.sh-next { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); }
.sh-next-date { font-family: var(--font-serif); font-size: 18px; font-weight: 700; color: #fff; }
.sh-cumulative { display: inline-block; margin-top: 4px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: #fde68a; border: 1px solid rgba(253, 230, 138, 0.35); border-radius: 999px; padding: 2px 8px; }
.sh-next-count { text-align: right; font-family: var(--font-mono); }
.sh-next-count strong { display: block; font-size: 26px; line-height: 1; color: #fff; }
.sh-next-count span { font-size: 10px; opacity: 0.6; }
.sh-schedule { margin: 10px 0 0; font-size: 12px; }
.sh-schedule summary { cursor: pointer; font-family: var(--font-mono); font-size: 11px; opacity: 0.7; }
.sh-sched-row { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; }
.sh-sched-row .t-label { display: flex; align-items: center; gap: 6px; margin: 0; opacity: 0.8; }
.sh-unmove { background: none; border: none; color: #c4b5fd; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.sh-filter { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 12px; }
.sh-range {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  color: rgba(255, 255, 255, 0.75); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14);
}
.sh-range.on { color: #1c1430; background: #fff; border-color: #fff; }
.sh-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.sh-tile { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); min-width: 0; }
.sh-tile-label { font-family: var(--font-mono); font-size: 10px; opacity: 0.6; }
.sh-tile-value { font-size: 20px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-tile-sub { font-family: var(--font-mono); font-size: 10px; opacity: 0.55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-block { margin-top: 18px; }
.sh-title { font-size: 14px; font-weight: 700; color: #fff; }
.sh-sub { font-family: var(--font-mono); font-size: 10px; opacity: 0.55; margin: 2px 0 6px; }
.sh-chart { width: 100%; height: auto; display: block; overflow: visible; }
.sh-grid { stroke: rgba(255, 255, 255, 0.1); stroke-width: 1; }
.sh-axis { fill: rgba(255, 255, 255, 0.55); font-family: var(--font-mono); font-size: 9px; }
.sh-bar { fill: #7d7699; transition: filter 0.15s; }
.sh-bar.hi { fill: #a78bfa; }
.sh-hit { fill: transparent; cursor: default; outline: none; }
.sh-hit:hover, .sh-hit:focus-visible { fill: rgba(255, 255, 255, 0.06); }
.sh-mark { fill: #fff; font-family: var(--font-mono); font-size: 9px; font-weight: 700; }
.sh-mark-line { stroke: rgba(255, 255, 255, 0.6); stroke-width: 1; }
.sh-tip {
  position: absolute; z-index: 5; pointer-events: none; max-width: 260px; padding: 6px 10px; border-radius: 8px;
  background: #fff; color: #1c1430; font-family: var(--font-mono); font-size: 11px; font-weight: 600; line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.sh-units { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.sh-unit-row { display: grid; grid-template-columns: minmax(64px, auto) 1fr auto; align-items: center; gap: 10px; }
.sh-unit-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.sh-unit-track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.sh-unit-fill { display: block; height: 100%; border-radius: 999px; background: #7d7699; }
.sh-unit-fill.hi { background: #a78bfa; }
.sh-unit-val { font-family: var(--font-mono); font-size: 10px; opacity: 0.7; white-space: nowrap; }
.sh-table-wrap { margin-top: 16px; }
.sh-table-wrap summary { cursor: pointer; font-family: var(--font-mono); font-size: 11px; opacity: 0.7; }
.sh-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-family: var(--font-mono); font-size: 11px; }
.sh-table th, .sh-table td { text-align: left; padding: 4px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.sh-table th { opacity: 0.6; font-weight: 600; }
.sh-table tr.test td { color: #fff; font-weight: 700; }

/* ── Units card ── */
.u-list { display: flex; flex-direction: column; gap: 6px; }
.u-level {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  opacity: 0.6; margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.u-level:first-of-type { margin-top: 4px; }
.u-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
}
.u-row.current { background: rgba(255, 255, 255, 0.08); border-color: rgba(167, 139, 250, 0.35); }
.u-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.u-name { font-weight: 700; color: #fff; }
.u-meta { font-family: var(--font-mono); font-size: 11px; opacity: 0.55; }
.u-status { margin-left: auto; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; }
.u-row.current .u-status { color: #c4b5fd; opacity: 1; }
.u-toggle { min-width: 118px; }
.t-btn.small { padding: 7px 12px; font-size: 11px; }
.t-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Student Accounts card ── */
.acct-created { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(253, 230, 138, 0.08); border: 1px solid rgba(253, 230, 138, 0.3); }
.acct-roster { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.acct-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); }
.acct-row-name { font-weight: 700; color: #fff; min-width: 90px; }
.acct-row-user { font-family: var(--font-mono); font-size: 11px; opacity: 0.7; flex: 1; }
.acct-row-pin { font-family: var(--font-mono); font-size: 11px; color: #fde68a; }

/* Public Lists tile */
.pub-row { border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; padding: 8px 12px; margin-bottom: 6px; }
.pub-row summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.pub-name { font-weight: 700; }
.pub-meta { font-size: 12px; opacity: 0.65; }
.pub-words { margin-top: 8px; font-size: 13px; }
.pub-words td { vertical-align: top; }

/* A clicked tile fills the dashboard; the other tiles step aside until "All tiles" */
.t-grid.has-full { display: block; }
.t-grid.has-full > .t-card:not(.open) { display: none; }
.t-grid.has-full > .t-card.open { min-height: calc(100vh - 160px); animation: tileFull 0.35s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes tileFull { from { opacity: 0; transform: scale(0.98); } }
.t-card.open .t-card-head { cursor: default; }
.t-card.open .t-card-head h3 { font-size: 26px; }
.t-card.open .t-card-chev { display: none; }
.t-back { display: none; }
.t-card.open .t-back {
  display: inline-flex; align-items: center; gap: 6px; margin: 16px 0 0 22px; padding: 7px 12px 7px 8px; border-radius: 999px; cursor: pointer;
  font: 700 12px var(--font-mono); color: #fff; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18);
}
.t-card.open .t-back:hover { background: rgba(255, 255, 255, 0.16); }
.t-card.open .t-back .ico { width: 15px; height: 15px; }

/* Game Limits tile */
.lim-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lim-chip {
  appearance: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 8px 12px; border-radius: 999px;
  font: 600 12px var(--font-mono); color: rgba(255, 255, 255, 0.8); background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.16);
}
.lim-chip svg { width: 15px; height: 15px; }
.lim-chip:hover { background: rgba(255, 255, 255, 0.12); }
.lim-chip.on { background: #dc2626; border-color: #dc2626; color: #fff; }
.lim-chip.all.on { background: #991b1b; border-color: #991b1b; }
.lim-days .lim-chip.on { background: #1a4de8; border-color: #1a4de8; }
.lim-mode { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); margin-bottom: 12px; flex-wrap: wrap; }
.lim-mode-btn { appearance: none; display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 9px; padding: 8px 14px; cursor: pointer; font: 700 12px var(--font-mono); color: rgba(255, 255, 255, 0.7); background: transparent; }
.lim-mode-btn .ico { width: 15px; height: 15px; }
.lim-mode-btn.on { background: #fff; color: #1c1430; }
.lim-panel[hidden] { display: none; }
.lim-panel .t-select { min-width: 220px; }
.lim-date { margin-top: 8px; max-width: 260px; }
.lim-date[hidden] { display: none; }
.lim-times { display: flex; flex-wrap: wrap; gap: 12px; }
.lim-times label { display: flex; align-items: center; gap: 8px; font: 600 12px var(--font-mono); color: rgba(255, 255, 255, 0.75); }
.lim-times .t-input { width: auto; margin: 0; }
#lim-add .ico { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; }
.lim-list { display: flex; flex-direction: column; gap: 8px; }
.lim-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); }
.lim-row.active { border-color: rgba(220, 38, 38, 0.55); background: rgba(220, 38, 38, 0.1); }
.lim-row-main { flex: 1; min-width: 0; }
.lim-row-games { font-weight: 700; }
.lim-row-when { font: 12px var(--font-mono); color: rgba(255, 255, 255, 0.65); margin-top: 2px; }
.lim-pill { font: 700 10px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.75); white-space: nowrap; }
.lim-row.active .lim-pill { background: #dc2626; color: #fff; }
.lim-row .t-btn.small { margin-top: 0; white-space: nowrap; }
@media (max-width: 560px) { .lim-row { flex-wrap: wrap; } .lim-row-main { flex-basis: 100%; } }
