.report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.report-tab {
    padding: 9px 16px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    cursor: pointer;
}
.report-tab:hover { border-color: var(--primary); }
.report-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

#reportStats { margin: 16px 16px 22px; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }
#reportStats .student-stat.warn strong { color: #d64545; }
#reportStats .student-stat.good strong { color: var(--success); }

.report-filters { align-items: center; }

.filter-group {
    display: inline-flex;
    white-space: nowrap;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.85rem;
}
.filter-group input,
.filter-group select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    color: var(--text);
    background: var(--surface);
}
.filter-group input[type="number"] { width: 72px; }

.report-section { margin: 0 0 24px; }
.report-section h3 { margin: 0 16px 10px; font-size: 1rem; }
.report-section > .muted { margin: 8px 16px 0; }
.report-table th, .report-table td { white-space: nowrap; }
.report-table td.num, .report-table th.num { text-align: right; }
.report-table tfoot td { font-weight: 700; background: var(--background); }

.pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--background);
    color: var(--muted);
}
.pill.good { background: #e3f6ee; color: var(--success); }
.pill.bad  { background: #fdeaea; color: #d64545; }
.pill.mid  { background: #fff4de; color: #b87500; }

.print-title { display: none; }

@media print {
    .no-print,
    .student-header,
    .demo-warning,
    .toast { display: none !important; }

    body { background: #fff; }
    .student-panel { box-shadow: none; border: 0; padding: 0; }
    .print-title { display: block; margin: 0 0 12px; font-size: 1.1rem; font-weight: 700; }
    .table-wrapper { overflow: visible; }
    .report-table th, .report-table td { white-space: normal; font-size: 11px; }
    .report-section { break-inside: avoid-page; }
}

@media (max-width: 900px) {
    #reportStats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .filter-group { white-space: normal; flex: 1 1 100%; justify-content: space-between; }
    .filter-group input, .filter-group select { flex: 1 1 auto; max-width: 62%; }
}
