/* Reports page overrides */
.reports-container {
    max-width: 1080px;
    height: auto;
    min-height: 100vh;
}

/* ── Filter bar ── */
.filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.78em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
}

.pill-group {
    display: flex;
    gap: 4px;
}

.pill {
    padding: 5px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    color: #6b6b6b;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.pill.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

/* ── Subject dropdown ── */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 0.85em;
    cursor: pointer;
    min-width: 160px;
    transition: border-color 0.15s;
}

.dropdown-toggle:hover {
    border-color: #ccc;
}

.dropdown-toggle svg {
    margin-left: auto;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    max-height: 280px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    z-index: 100;
    padding: 6px 0;
}

.dropdown-menu.open {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-size: 0.85em;
    color: #333;
    cursor: pointer;
    transition: background 0.1s;
    user-select: none;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item input[type="checkbox"] {
    accent-color: #1a1a1a;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.dropdown-actions {
    display: flex;
    gap: 8px;
    padding: 6px 14px;
    border-top: 1px solid #eee;
    margin-top: 4px;
}

.dropdown-actions button {
    background: none;
    border: none;
    color: #6b6b6b;
    font-size: 0.82em;
    cursor: pointer;
    padding: 2px 0;
}

.dropdown-actions button:hover {
    color: #1a1a1a;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-range input {
    padding: 5px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85em;
    color: #333;
    background: #fff;
}

.date-range span {
    color: #999;
    font-size: 0.85em;
}

#apply-btn {
    padding: 6px 20px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    align-self: flex-end;
}

#apply-btn:hover {
    background: #333;
}

#clear-btn {
    padding: 6px 14px;
    background: none;
    color: #999;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.15s;
    align-self: flex-end;
}

#clear-btn:hover {
    color: #333;
    border-color: #ccc;
}

/* ── Dashboard ── */
.dashboard {
    padding: 24px;
    overflow-y: auto;
}

.loading {
    text-align: center;
    padding: 60px;
    color: #999;
    font-size: 0.95em;
}

/* ── Stat cards ── */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 18px 16px;
    text-align: center;
}

.stat-card.accent {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
}

.stat-card.accent .stat-label {
    color: rgba(255, 255, 255, 0.7);
}

.stat-card.good .stat-number { color: #2d9d5a; }
.stat-card.bad .stat-number { color: #dc4c3e; }

.stat-number {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.8em;
    color: #999;
}

/* ── Sections ── */
.section {
    margin-bottom: 28px;
}

.section h2 {
    font-size: 1em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* ── Progress bar ── */
.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.88em;
    color: #6b6b6b;
}

.progress-header span:first-child {
    font-weight: 600;
    color: #1a1a1a;
}

.progress-track {
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #2d9d5a;
    border-radius: 5px;
    transition: width 0.4s ease;
    width: 0;
}

/* ── Two column layout ── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

@media (max-width: 700px) {
    .two-col { grid-template-columns: 1fr; }
}

/* ── Tables ── */
.dashboard .table-wrap {
    max-height: 350px;
    overflow: auto;
    border: 1px solid #eee;
    border-radius: 8px;
}

.dashboard table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87em;
}

.dashboard th {
    background: #fafafa;
    font-weight: 600;
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b6b6b;
    padding: 8px 12px;
    text-align: left;
    border-bottom: 2px solid #eee;
    position: sticky;
    top: 0;
}

.dashboard td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.dashboard tbody tr:hover td {
    background: #fafafa;
}

/* ── Chart boxes ── */
.chart-box {
    position: relative;
    max-width: 380px;
    margin: 0 auto;
}

.chart-box.wide {
    max-width: 100%;
}

@media (max-width: 600px) {
    .filter-bar { padding: 12px 16px; }
    .dashboard { padding: 16px; }
    .stat-cards { grid-template-columns: repeat(3, 1fr); }
}
