/* Dashboards, meters, and lists. */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }
.stat { border: 1px solid var(--border); padding: 1rem; display: grid; gap: 0.1rem; color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--border-strong); }
.stat-value { font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-muted); font-size: 0.9em; }
.stat-hint { color: var(--text-muted); font-size: 0.8em; }

.quick { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-bottom: var(--gap); }
.stack-gap { margin: 0.75rem 0; }

.cells { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cell { width: 3.1rem; height: 3.1rem; border: 1px solid var(--border); display: grid; place-content: center; text-align: center; line-height: 1.15; }
.cell-code { font-size: 0.7rem; color: var(--text-muted); }
.cell-n { font-weight: 700; font-variant-numeric: tabular-nums; }
.tag-line { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }

.meter-row { margin-bottom: 0.65rem; }
.meter-row .row { gap: 0.5rem; margin-bottom: 0.15rem; }

.plain-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.plain-list li { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.plain-list li:last-child { border-bottom: 0; }
.plain-list .grow { flex: 1; min-width: 8rem; }
.item-title { font-weight: 600; }
.item-meta { color: var(--text-muted); font-size: 0.9em; }

.ordered-list.compact li { padding: 0.25rem 0; font-size: 0.95em; }

/* A little life: tiles and cards rise in, bars grow. All of it is switched off by reduced-motion. */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes grow { from { transform: scaleX(0); } }
.dashboard .card, .dashboard .stat { animation: rise 0.3s ease-out both; }
.stats > :nth-child(2) { animation-delay: 0.04s; }
.stats > :nth-child(3) { animation-delay: 0.08s; }
.stats > :nth-child(4) { animation-delay: 0.12s; }
.stats > :nth-child(5) { animation-delay: 0.16s; }
.meter > span { transform-origin: left; animation: grow 0.6s ease-out both; }

/* ---- live view ---- */
.minimap { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 0.4rem; }
.pm { width: 0.8rem; height: 0.8rem; border: 1px solid var(--border); }
.pm.answered { background: var(--meter); border-color: var(--meter); }
.pm.flagged { background: var(--warn); border-color: var(--warn); }
.pm.seen { background: color-mix(in srgb, var(--meter) 18%, transparent); }
.pm.here { outline: 2px solid var(--focus); outline-offset: 1px; }
.lcd-small { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.lcd-small.low { color: var(--bad); }
.presence { display: inline-flex; align-items: center; gap: 0.4rem; }
.presence-dot { width: 0.55rem; height: 0.55rem; background: var(--text-muted); }
.presence.active { color: var(--good); }
.presence.active .presence-dot { background: var(--good); }
.presence.idle { color: var(--warn); }
.presence.idle .presence-dot { background: var(--warn); }
.presence.away { color: var(--bad); }
.presence.away .presence-dot { background: var(--bad); }

/* the teacher board */
/* one row of figures across the top: equal tiles, labels never wrap to a second line */
.stats.strip { grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); margin-bottom: var(--gap); }
.stats.strip .stat { padding: 0.6rem 0.9rem; }
.stats.strip .stat-value { font-size: 1.7rem; }
.stats.strip .stat-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats.compact .stat { padding: 0.5rem 0.8rem; }
.stack-col { display: grid; gap: 0.75rem; align-content: start; min-width: 0; }
.stack-col > .card, .stack-col > div > .card { margin-bottom: 0; }
.next-up { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card .empty { padding: 0.6rem 0; text-align: left; margin: 0; }

/* student: the next exam, big */
.hero { padding: 1.3rem 1.4rem; border-color: var(--accent); }
.hero-main { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
.hero-kicker { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85em; color: var(--text-muted); font-weight: 600; }
.hero-title { font-size: 1.6rem; margin: 0.3rem 0 0.2rem; }
.hero-action .btn { font-size: 1.1em; padding: 0.7rem 1.6rem; }
.hero .plain-list { margin-top: 1rem; border-top: 1px solid var(--border); }
.result-bar { display: block; max-width: 10rem; margin-top: 0.3rem; }

/* ---- live: a summary line, a column per question, a tile per student (quiet ones first) ---- */
.live-summary { display: flex; align-items: center; gap: 0.5rem 1.4rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.live-count strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.live-refresh { margin-left: auto; font-size: 0.85em; }
.live-cells { gap: 0.3rem; }
.live-cells .cell { position: relative; overflow: hidden; width: 2.8rem; height: 3.6rem; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 0.3rem 0; }
.cell-fill { position: absolute; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--meter) 22%, transparent); transition: height 0.4s var(--ease-out); }
.live-cells .cell-n, .live-cells .cell-code { position: relative; }
.live-cells .cell.busy { border-color: var(--accent); }
.live-cells .cell.busy .cell-n { color: var(--accent); }
.live-legend { font-size: 0.85em; margin: 0.6rem 0 0; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.6rem; }
.live-row { display: grid; gap: 0.4rem; padding: 0.8rem 0.9rem; border: 1px solid var(--border); border-left: 4px solid var(--good); border-radius: var(--radius); }
.live-row.idle { border-left-color: var(--warn); }
.live-row.away { border-left-color: var(--bad); }
.live-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.live-top .presence { font-size: 0.85em; }
.live-where { font-size: 0.9em; color: var(--text-muted); }
.live-facts { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; font-size: 0.88em; color: var(--text-muted); }
