﻿/* ── Stats Grid ────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

    .stat-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
    }

.stat-blue {
    background: #eff6ff;
}

    .stat-blue::before {
        background: var(--info);
    }

.stat-green {
    background: #f0fdf4;
}

    .stat-green::before {
        background: var(--success);
    }

.stat-purple {
    background: #f5f3ff;
}

    .stat-purple::before {
        background: var(--primary);
    }

.stat-orange {
    background: #fffbeb;
}

    .stat-orange::before {
        background: var(--warning);
    }

.stat-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.stat-denom {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

.stat-change {
    font-size: 12px;
    margin-top: 4px;
}

    .stat-change.positive {
        color: var(--success);
    }

    .stat-change.neutral {
        color: var(--text-muted);
    }

.stat-sparkline {
    position: absolute;
    bottom: 10px;
    right: 10px;
    opacity: .4;
}

    .stat-sparkline svg {
        width: 60px;
        height: 30px;
    }

.sparkline {
    color: var(--text-muted);
}

.progress-bar-mini {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 6px;
}

.progress-fill-mini {
    height: 100%;
    background: var(--warning);
    border-radius: 2px;
}

/* ── Dashboard Mid ─────────────────────────────────────────── */
.dashboard-mid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

    .dashboard-mid .card .session-list {
        overflow-x:auto;
        max-height:190px;
    }

        .dashboard-mid .card .session-list::-webkit-scrollbar {
            width: 6px;
        }

        .dashboard-mid .card .session-list::-webkit-scrollbar-track {
            background: transparent;
        }

        .dashboard-mid .card .session-list::-webkit-scrollbar-thumb {
            background: var(--border-dark);
            border-radius: 10px;
        }

/* Session List */
.session-list {
    padding: 8px 0;
}

.session-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
}

    .session-item:last-child {
        border-bottom: none;
    }

.session-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.session-info {
    flex: 1;
}

.session-name {
    font-size: 14px;
    font-weight: 600;
}

.session-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.session-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.status-green {
    background: #d1fae5;
    color: #059669;
}

.status-blue {
    background: #dbeafe;
    color: #2563eb;
}

.status-gray {
    background: #f1f5f9;
    color: #64748b;
}

.status-orange {
    background: #fef3c7;
    color: #d97706;
}

.status-red {
    background: #fee2e2;
    color: #dc2626;
}

/* Lab Bars */
.lab-bars {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lab-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lab-bar-label {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 90px;
    font-size: 13px;
    white-space: nowrap;
}

.lab-color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lab-bar-track {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.lab-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .6s ease;
}

.lab-bar-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    width: 35px;
    text-align: right;
}

/* Quick Actions */
.quick-actions {
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.qa-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1.5px solid transparent;
}

    .qa-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,.1);
    }

.qa-icon {
    font-size: 20px;
}

.qa-blue {
    background: #eff6ff;
    color: var(--info);
    border-color: #bfdbfe;
}

.qa-green {
    background: #f0fdf4;
    color: var(--success);
    border-color: #bbf7d0;
}

.qa-purple {
    background: #f5f3ff;
    color: var(--primary);
    border-color: #ddd6fe;
}

.qa-orange {
    background: #fffbeb;
    color: var(--warning);
    border-color: #fde68a;
}

.qa-teal {
    background: #f0fdfa;
    color: #0d9488;
    border-color: #99f6e4;
}

.qa-red {
    background: #fff1f2;
    color: var(--danger);
    border-color: #fecdd3;
}

/* ── Report Section ─────────────────────────────────────── */
.report-section {
    margin-top: 8px;
}

.tab-skeleton {
    width: 100px;
    height: 36px;
    border-radius: 20px;
    background: var(--border);
    animation: pulse 1.4s ease-in-out infinite;
}

.tab-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 8px 0;
}

/* Report Loading */
.report-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%,100% {
        opacity: 1;
    }

    50% {
        opacity: .45;
    }
}

/* Report Empty / Placeholder */
.report-empty {
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.report-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 48px 20px;
    color: var(--text-muted);
}

.rp-icon {
    font-size: 36px;
}

.rp-text {
    font-size: 14px;
}

/* Summary Bar */
.report-summary-bar {
    display: flex;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.rsb-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    border-right: 1px solid var(--border);
}

    .rsb-item:last-child {
        border-right: none;
    }

.rsb-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.rsb-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
}

.rsb-highlight {
    color: var(--primary);
}

/* Report Card & Table */
.report-card {
    padding: 0 !important;
    overflow: hidden;
    margin-bottom: 16px;
}

.report-table-wrapper {
    overflow-x: auto;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .report-table thead tr {
        background: #f8f9fc;
        border-bottom: 2px solid var(--border);
    }

    .report-table th {
        padding: 12px 14px;
        text-align: left;
        font-weight: 700;
        color: var(--text-muted);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        white-space: nowrap;
    }

    .report-table tbody tr {
        border-bottom: 1px solid var(--border);
        transition: background 0.12s;
    }

        .report-table tbody tr:last-child {
            border-bottom: none;
        }

        .report-table tbody tr:hover {
            background: #f8f9fc;
        }

        .report-table tbody tr.row-complete {
            background: #f0fdf4;
        }

            .report-table tbody tr.row-complete:hover {
                background: #e8faf0;
            }

    .report-table td {
        padding: 12px 14px;
        vertical-align: middle;
    }

/* Column widths */
.col-roll {
    width: 44px;
    color: var(--text-muted);
    font-weight: 600;
}

.col-name {
    min-width: 140px;
}

.col-lab {
    min-width: 130px;
}

.col-overall {
    min-width: 110px;
}

.col-status {
    min-width: 110px;
    white-space: nowrap;
}

/* Student name cell */
.student-name-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.student-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ede9fe;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

/* Lab TH */
.lab-th-inner {
    display: flex;
    align-items: center;
    gap: 5px;
}

.lab-dot-sm {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Lab Cell */
.lab-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lab-progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.lab-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.lab-cell-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lab-fraction {
    font-size: 11px;
    color: var(--text-muted);
}

.lab-pct {
    font-size: 11px;
    font-weight: 700;
}

/* Overall Cell */
.overall-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.overall-ring-bg {
    flex: 1;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.overall-ring-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.overall-pct {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    min-width: 36px;
    text-align: right;
}

/* Status Pills */
.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.pill-complete {
    background: #d1fae5;
    color: #065f46;
}

.pill-progress {
    background: #dbeafe;
    color: #1e40af;
}

.pill-pending {
    background: #fef3c7;
    color: #92400e;
}

/* Lab Legend Cards */
.lab-legend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 4px;
}

.legend-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.legend-card-top {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.legend-stat {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 2px;
}

.legend-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.legend-bar-track {
    width: 100%;
    height: 5px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.legend-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ── Pagination ─────────────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: #f8f9fc;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    flex-wrap: wrap;
    gap: 10px;
}

.pagination-info {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .page-btn:hover:not(:disabled) {
        border-color: var(--primary);
        color: var(--primary);
        background: #f5f3ff;
    }

    .page-btn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

.page-btn-active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-size-select {
    height: 32px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
}

    .page-size-select:focus {
        outline: none;
        border-color: var(--primary);
    }

@media (max-width: 600px) {
    .pagination-bar {
        justify-content: center;
    }

    .pagination-info:first-child {
        display: none;
    }
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-mid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-mid {
        grid-template-columns: 1fr;
    }

    .report-summary-bar {
        flex-wrap: wrap;
    }

    .rsb-item {
        min-width: 50%;
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 600px) {
    .rsb-item {
        min-width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
