/* ─── Admin Dashboard ────────────────────────────────────────────── */

/* ─── Heatmap ─────────────────────────────────────────────────────── */
.heatmap {
    overflow-x: auto;
}

.heatmap-grid {
    display: grid;
    gap: 2px;
}

.heatmap-header {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

.heatmap-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    color: var(--text);
}

.heatmap-name.inactive {
    color: var(--danger);
}

.heatmap-cell {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    transition: transform 0.15s ease;
    cursor: default;
}

.heatmap-cell:hover {
    transform: scale(1.2);
}

.hm-0 { background: var(--bg-input); }
.hm-1 { background: #c6e48b; }
.hm-2 { background: #7bc96f; }
.hm-3 { background: #239a3b; }

[data-theme="dark"] .hm-0 { background: var(--bg-input); }
[data-theme="dark"] .hm-1 { background: #1a4d2e; }
[data-theme="dark"] .hm-2 { background: #1f7a3f; }
[data-theme="dark"] .hm-3 { background: #27ae50; }

/* ─── Performance Table ───────────────────────────────────────────── */
.perf-table {
    width: 100%;
    border-collapse: collapse;
}

.perf-table th {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
    text-align: left;
    border-bottom: 2px solid var(--border);
    transition: color 0.15s ease;
}

.perf-table th:hover {
    color: var(--primary);
}

.perf-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.perf-table tr:hover td {
    background: var(--bg-input);
}

[data-theme="dark"] .perf-table tr:hover td {
    background: rgba(124, 92, 255, 0.06);
}

.acc-red    { color: var(--danger); font-weight: 700; }
.acc-yellow { color: var(--accent-dark); font-weight: 700; }
.acc-green  { color: var(--secondary); font-weight: 700; }

.needs-help-badge {
    display: inline-block;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

tr.expandable {
    cursor: pointer;
}

/* ─── Student Detail Expand ───────────────────────────────────────── */
.student-detail {
    background: var(--bg-input);
    padding: 16px;
    border-radius: var(--radius-sm);
    animation: detailFadeIn 0.25s ease;
}

@keyframes detailFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.detail-bar {
    display: flex;
    align-items: center;
    height: 16px;
    margin-bottom: 8px;
}

.detail-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.detail-bar-label {
    font-size: 0.7rem;
    color: var(--text-light);
    min-width: 100px;
    flex-shrink: 0;
}

.detail-bar-value {
    font-family: var(--font-stats);
    font-weight: 700;
    font-size: 0.8rem;
    margin-left: 8px;
    white-space: nowrap;
}

/* ─── Live Indicator ──────────────────────────────────────────────── */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 600;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.8); }
}

/* ─── Class Tabs ──────────────────────────────────────────────────── */
.class-tabs {
    display: flex;
    overflow-x: auto;
    border-bottom: 2px solid var(--border);
    gap: 0;
}

.class-tab {
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
    user-select: none;
    margin-bottom: -2px;
}

.class-tab:hover {
    color: var(--text);
}

.class-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ─── Responsive (#159) ──────────────────────────────────────────── */
@media (max-width: 767px) {
    .heatmap-cell { width: 24px; height: 24px; }
    .heatmap-name { max-width: 80px; font-size: 0.65rem; }
    .perf-table { font-size: 0.75rem; }
    .perf-table th, .perf-table td { padding: 6px 8px; }
}

/* ─── Dark Mode Exam Badges (#161) ───────────────────────────────── */
[data-theme="dark"] .exam-badge-green { background: rgba(0,255,136,0.15); color: var(--secondary); }
[data-theme="dark"] .exam-badge-gray { background: rgba(255,255,255,0.08); color: var(--text-muted); }
[data-theme="dark"] .exam-badge-blue { background: rgba(84,160,255,0.15); color: var(--info); }
[data-theme="dark"] .exam-badge-gold { background: rgba(255,215,0,0.15); color: var(--accent); }
