/* ===== RESULTS DASHBOARD ===== */

/* Panel spacing */
#results-dashboard .panel__header {
    margin-bottom: 16px;
}

#results-dashboard .panel__header .lead {
    margin-top: 6px;
    font-size: 14px;
}

/* Header actions */
.results-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.results-header-actions .btn {
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
}

.results-header-actions .btn.ghost {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #64748b;
}

.results-header-actions .btn.ghost:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.results-header-actions .btn.secondary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.results-header-actions .btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Filters Bar */
.results-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.rfilter-wrap {
    position: relative;
}

.rfilter-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1200;
    min-width: 280px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 0;
}

.rfilter-wrap.open .rfilter-panel {
    display: block;
}

.rfilter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.rfilter-panel-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.rfilter-panel-search i {
    color: #64748b;
    font-size: 13px;
}

.rfilter-panel-search input {
    border: none;
    outline: none;
    font-size: 13px;
    width: 100%;
    background: transparent;
}

.rfilter-panel-options {
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
}

.rfilter-panel-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #334155;
    transition: background 0.12s;
}

.rfilter-panel-options label:hover {
    background: #f1f5f9;
}

.rfilter-panel-options input[type="checkbox"],
.rfilter-panel-options input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .rfilter-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        min-width: auto;
        max-height: 70vh;
    }
}

.results-filters-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.results-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 120px;
}

.results-filter-group label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.results-filter-group label i {
    font-size: 13px;
    color: #3b82f6;
}

.results-filter-input,
.results-filter-select {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.results-filter-input:hover,
.results-filter-select:hover {
    border-color: #cbd5e1;
    background: #fafbfc;
}

.results-filter-input:focus,
.results-filter-select:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.results-filter-input::placeholder {
    color: #64748b;
}

.results-filter-select {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* Searchable Select */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select__input {
    padding: 12px 36px 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
}

.searchable-select__input:hover {
    border-color: #cbd5e1;
    background: #fafbfc;
}

.searchable-select__input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    cursor: text;
}

.searchable-select__input::placeholder {
    color: var(--text);
    font-weight: 500;
    transition: color 0.2s;
}

.searchable-select.open .searchable-select__input::placeholder {
    color: #c0c7d0;
}

.searchable-select__arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #64748b;
    pointer-events: none;
    transition: transform 0.2s;
}

.searchable-select.open .searchable-select__arrow {
    transform: translateY(-50%) rotate(180deg);
}

.searchable-select__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.searchable-select.open .searchable-select__dropdown {
    display: block;
    animation: dropdownIn 0.2s ease;
}

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

.searchable-select__option {
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s;
}

.searchable-select__option:first-child {
    border-radius: 12px 12px 0 0;
}

.searchable-select__option:last-child {
    border-radius: 0 0 12px 12px;
}

.searchable-select__option:hover {
    background: #f1f5f9;
}

.searchable-select__option.selected {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    color: #4f46e5;
    font-weight: 600;
}

.searchable-select__option.hidden {
    display: none;
}

.searchable-select__no-results {
    padding: 16px;
    font-size: 14px;
    color: #64748b;
    text-align: center;
}

.results-filter-clear {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-end;
    font-family: inherit;
}

.results-filter-clear:hover {
    color: #ef4444;
    border-color: #fca5a5;
    background: #fef2f2;
}

@media (max-width: 900px) {
    .results-filters-row {
        gap: 12px;
    }
    .results-filter-group {
        min-width: 120px;
    }
}

@media (max-width: 600px) {
    .results-filters-bar {
        padding: 20px;
        border-radius: 16px;
    }
    .results-filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    .results-filter-group {
        min-width: 0;
    }
    /* On narrow cards the decorative progress ring overlaps the wrapped label
       ("Promedio general"); the value is already shown as text, so hide it. */
    .rstat-ring {
        display: none;
    }
}

/* Let the label wrap instead of colliding with the ring */
.rstat-body {
    min-width: 0;
}

/* Stats Grid */
.results-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.results-stat-card {
    position: relative;
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: all 0.3s ease;
}

.results-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15,23,42,0.08);
}

.results-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.results-stat-card.gradient-blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.results-stat-card.gradient-green::before { background: linear-gradient(90deg, #22c55e, #4ade80); }
.results-stat-card.gradient-purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.results-stat-card.gradient-orange::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.rstat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 18px;
    flex-shrink: 0;
}

.gradient-blue .rstat-icon { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #2563eb; }
.gradient-green .rstat-icon { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #16a34a; }
.gradient-purple .rstat-icon { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #7c3aed; }
.gradient-orange .rstat-icon { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #d97706; }

.rstat-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.rstat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.rstat-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.rstat-ring {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.rstat-ring svg { 
    width: 100%; 
    height: 100%; 
    transform: rotate(-90deg); 
}

.rstat-ring-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 3.5;
}

.rstat-ring-fill {
    fill: none;
    stroke: #22c55e;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 1s ease;
}

/* Secondary Stats Row (Horizontal - 50/50) */
.results-secondary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.results-card-compact {
    border-radius: 16px;
}

.results-card-header.compact {
    padding: 14px 18px;
}

.results-card-header.compact h3 {
    font-size: 13px;
}

.results-card-header.compact h3 i {
    font-size: 14px;
}

.score-distribution.compact {
    padding: 14px 18px;
    gap: 10px;
}

.score-distribution.compact .distribution-bar-group {
    gap: 10px;
    grid-template-columns: 60px 1fr 30px;
}

.score-distribution.compact .dist-label {
    font-size: 13px;
}

.score-distribution.compact .dist-bar-track {
    height: 8px;
}

.score-distribution.compact .dist-count {
    font-size: 13px;
}

.question-analysis-list.compact {
    padding: 12px 18px;
    max-height: 160px;
    gap: 8px;
}

.question-analysis-list.compact .qa-item {
    padding: 10px 12px;
    gap: 10px;
}

.question-analysis-list.compact .qa-number {
    width: 26px;
    height: 26px;
    font-size: 13px;
    border-radius: 8px;
}

.question-analysis-list.compact .qa-item-question {
    font-size: 13px;
    -webkit-line-clamp: 1;
}

.question-analysis-list.compact .qa-item-stat {
    margin-top: 6px;
}

.question-analysis-list.compact .qa-item-pct {
    font-size: 13px;
}

.question-analysis-list.compact .qa-item-answered {
    font-size: 13px;
}

.question-analysis-list.compact .qa-empty {
    padding: 16px 12px;
}

.question-analysis-list.compact .qa-empty .muted {
    font-size: 13px;
}

.error-filter-input.compact {
    gap: 6px;
}

.error-filter-input.compact label {
    font-size: 13px;
}

.error-filter-input.compact .error-input-wrapper input {
    width: 40px;
    padding: 6px 4px;
    font-size: 13px;
}

.error-filter-input.compact .error-input-suffix {
    padding: 6px 8px 6px 0;
    font-size: 13px;
}

.live-activity-content.compact {
    padding: 12px 18px;
}

.live-activity-content.compact .live-student-row {
    padding: 8px 0;
    gap: 10px;
}

.live-activity-content.compact .live-student-avatar {
    width: 30px;
    height: 30px;
    font-size: 13px;
    border-radius: 8px;
}

.live-activity-content.compact .live-student-name {
    font-size: 13px;
}

.live-activity-content.compact .live-student-status {
    font-size: 13px;
    padding: 3px 8px;
}

/* Students Table Full Width */
.students-table-card.full-width {
    width: 100%;
}

/* Legacy Main Grid (hidden) */
.results-main-grid {
    display: none;
}

/* Results Cards */
.results-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.results-card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: linear-gradient(180deg, #fafbfc 0%, #ffffff 100%);
}

.results-card-header h3 {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    margin: 0;
}

.results-card-header h3 i {
    color: #3b82f6;
    font-size: 15px;
}

.results-card-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Error Threshold Filter */
.error-filter-input {
    display: flex;
    align-items: center;
    gap: 12px;
}

.error-filter-input label {
    font-size: 13px;
    color: #64748b;
    white-space: nowrap;
    font-weight: 500;
}

.error-input-wrapper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.error-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.error-input-wrapper input {
    width: 50px;
    padding: 10px 8px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    background: transparent;
}

.error-input-wrapper input:focus {
    outline: none;
}

.error-input-wrapper input::-webkit-outer-spin-button,
.error-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.error-input-wrapper input[type=number] {
    -moz-appearance: textfield;
}

.error-input-suffix {
    padding: 10px 14px 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    white-space: nowrap;
}

.error-threshold-select {
    padding: 8px 32px 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s ease;
}

.error-threshold-select:hover {
    border-color: #cbd5e1;
}

.error-threshold-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.results-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 16px;
    transition: all 0.2s ease;
}

.results-search:focus-within {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.results-search i { 
    color: #64748b; 
    font-size: 14px; 
}

.results-search input {
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 14px;
    outline: none;
    width: 180px;
    font-family: inherit;
    color: var(--text);
}

.results-sort select {
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 28px 8px 12px;
    font-size: 13px;
    font-weight: 500;
    background: #f8fafc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.2s ease;
}

.results-sort select:hover {
    border-color: #cbd5e1;
}

.results-sort select:focus {
    border-color: #3b82f6;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Students Table */
.students-table-container {
    overflow-x: auto;
}

.students-results-table {
    width: 100%;
    border-collapse: collapse;
}

.students-results-table th {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    text-align: left;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.students-results-table td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.students-results-table tbody tr {
    transition: all 0.2s ease;
    cursor: pointer;
}

.students-results-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02), rgba(99, 102, 241, 0.02));
}

.students-results-table tbody tr:hover td {
    border-color: transparent;
}

.students-results-table tbody tr:last-child td {
    border-bottom: none;
}

/* Student cell */
.student-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-avatar-sm {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 15px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.15);
    font-family: var(--font-body);
}

.student-name-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.student-name-col strong {
    font-weight: 700;
    color: var(--text);
    font-size: 15px;
    font-family: var(--font-body);
}

.student-name-col small {
    color: #64748b;
    font-size: 14px;
    font-family: var(--font-body);
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.completed {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #15803d;
}

.status-badge.in-progress {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
}

.status-badge i { 
    font-size: 7px; 
}

/* Progress bar in table */
.progress-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-mini-bar {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    background: #e2e8f0;
    overflow: hidden;
    min-width: 60px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.progress-mini-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.progress-mini-fill.excellent { background: linear-gradient(90deg, #22c55e, #4ade80); }
.progress-mini-fill.good { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.progress-mini-fill.average { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.progress-mini-fill.low { background: linear-gradient(90deg, #ef4444, #f87171); }

.progress-mini-text {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    min-width: 40px;
}

/* Score cell */
.score-cell {
    font-weight: 800;
    font-size: 15px;
}

.score-cell.excellent { color: #16a34a; }
.score-cell.good { color: #2563eb; }
.score-cell.average { color: #d97706; }
.score-cell.low { color: #dc2626; }

/* Time cell */
.time-cell {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #f8fafc;
    border-radius: 8px;
    width: fit-content;
}

.time-cell i { 
    font-size: 13px;
    color: #64748b;
}

/* Detail button */
.detail-btn {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: none;
    color: #2563eb;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    font-family: inherit;
}

.detail-btn:hover {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

/* Empty state */
.students-empty-results {
    padding: 40px 30px;
    text-align: center;
    display: none;
}

.students-empty-results.show {
    display: block;
}

.empty-results-illustration {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    position: relative;
}

.empty-results-illustration::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 24px;
    border: 2px dashed #cbd5e1;
    animation: rotate-slow 30s linear infinite;
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.empty-results-illustration i {
    font-size: 28px;
    color: #3b82f6;
}

.students-empty-results h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.students-empty-results p {
    color: #64748b;
    font-size: 13px;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.5;
}

.empty-hint {
    margin-top: 14px !important;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fefce8, #fef9c3);
    border: 1px solid #fde047;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px !important;
    font-weight: 500;
    color: #a16207 !important;
}

/* Score Distribution */
.score-distribution {
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.distribution-bar-group {
    display: grid;
    grid-template-columns: 75px 1fr 40px;
    align-items: center;
    gap: 14px;
}

.dist-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-align: right;
}

.dist-bar-track {
    height: 12px;
    border-radius: 6px;
    background: #f1f5f9;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dist-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s ease;
    min-width: 0;
}

.dist-bar-fill.excellent { background: linear-gradient(90deg, #22c55e, #4ade80); }
.dist-bar-fill.good { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.dist-bar-fill.average { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.dist-bar-fill.low { background: linear-gradient(90deg, #ef4444, #f87171); }

.dist-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
}

/* Question Analysis */
.question-analysis-list {
    padding: 20px 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 340px;
    overflow-y: auto;
}

.qa-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #fafbfc, #f8fafc);
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.qa-item:hover { 
    border-color: #e2e8f0;
    background: #f8fafc;
    transform: translateX(4px);
}

.qa-number {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.qa-number.hard { 
    background: linear-gradient(135deg, #fee2e2, #fecaca); 
    color: #dc2626; 
}

.qa-number.medium { 
    background: linear-gradient(135deg, #fef3c7, #fde68a); 
    color: #d97706; 
}

.qa-number.easy {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #16a34a;
}

.qa-item-content {
    flex: 1;
    min-width: 0;
}

.qa-item-question {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.qa-item-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.qa-item-bar {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    background: #e2e8f0;
    overflow: hidden;
}

.qa-item-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.qa-item-pct {
    font-size: 13px;
    font-weight: 700;
    color: #ef4444;
}

.qa-item-answered {
    font-size: 13px;
    color: #64748b;
    margin-left: 4px;
}

.qa-empty {
    padding: 32px 16px;
    text-align: center;
}

.qa-empty .muted {
    font-size: 14px;
    color: #64748b;
}

/* Side Column */
.results-side-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Live Activity Card - Standalone below table */
.live-activity-card {
    border-color: rgba(34,197,94,0.3) !important;
    border-width: 2px;
    margin-top: 16px;
}

.live-pulse {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    margin-right: 6px;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(34,197,94,0); }
}

.live-activity-content {
    padding: 20px 26px;
}

.live-student-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.live-student-row:last-child { 
    border-bottom: none; 
}

.live-student-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1d4ed8;
}

.live-student-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.live-student-status {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
}

.live-student-status.answering { 
    color: #2563eb; 
    background: rgba(59, 130, 246, 0.1);
}

.live-student-status.done { 
    color: #16a34a;
    background: rgba(34, 197, 94, 0.1);
}

/* Result Detail Modal */
.modal__content.large {
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal__content.extra-large {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
}

.result-detail-container {
    padding: 0;
}

/* New Large Header */
.result-detail-header-large {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 50%, #eef2ff 100%);
    border-bottom: 1px solid #e2e8f0;
}

.rd-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.result-detail-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    box-shadow: 0 8px 20px -4px rgba(59, 130, 246, 0.4);
}

.result-detail-info-large h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #1e293b;
}

.rd-student-summary {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

.rd-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #3b82f6;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}

.rd-overall-score {
    width: 96px;
    height: 96px;
    position: relative;
    flex-shrink: 0;
}

.rd-overall-score svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.rd-overall-score .ring-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 5;
}

.rd-overall-score .ring-fill {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease;
}

.rd-overall-score-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.rd-score-number {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.rd-score-label {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

/* Stats Cards */
.result-detail-stats-large {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 20px 32px;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
}

.rd-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #f8fafc;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.rd-stat-card:hover {
    background: #f1f5f9;
}

.rd-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 16px;
}

.rd-stat-card.correct .rd-stat-icon {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.rd-stat-card.incorrect .rd-stat-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.rd-stat-card.time .rd-stat-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.rd-stat-card.activities .rd-stat-icon {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.rd-stat-content {
    display: flex;
    flex-direction: column;
}

.rd-stat-card .rd-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.rd-stat-card .rd-stat-label {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

/* Activities Section */
.result-detail-activities {
    padding: 24px 32px;
}

.rd-activities-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.rd-activities-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.rd-activities-header h3 i {
    color: #3b82f6;
}

.rd-activities-hint {
    font-size: 13px;
    color: #64748b;
}

.rd-activities-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Activity Card */
.rd-activity-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s ease;
}

.rd-activity-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.rd-activity-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.rd-activity-header:hover {
    background: #f8fafc;
}

.rd-activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 16px;
}

.rd-activity-icon.completed {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #16a34a;
}

.rd-activity-icon.in-progress {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
}

.rd-activity-info {
    flex: 1;
    min-width: 0;
}

.rd-activity-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rd-activity-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.rd-activity-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rd-activity-meta i {
    font-size: 13px;
}

.rd-activity-score {
    font-size: 18px;
    font-weight: 700;
    margin-right: 8px;
}

.rd-activity-toggle {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #64748b;
    transition: transform 0.2s ease;
}

.rd-activity-card.expanded .rd-activity-toggle {
    transform: rotate(180deg);
}

.rd-activity-questions {
    display: none;
    padding: 0 16px 16px 16px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.rd-activity-card.expanded .rd-activity-questions {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .result-detail-header-large {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }
    
    .rd-header-left {
        flex-direction: column;
    }

    .rd-overall-score {
        margin: 0 auto;
    }
    
    .result-detail-stats-large {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px 20px;
    }
    
    .result-detail-activities {
        padding: 20px;
    }
    
    .rd-activity-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
}
.result-detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #f8fafc, #eff6ff);
}
.result-detail-avatar {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    flex-shrink: 0;
}
.result-detail-info { flex: 1; }
.result-detail-info h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}
.result-detail-info p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}
.result-detail-score-ring {
    margin-left: auto;
    width: 64px;
    height: 64px;
    position: relative;
    flex-shrink: 0;
}
.result-detail-score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.result-detail-score-ring .ring-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 4;
}
.result-detail-score-ring .ring-fill {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 188;
    transition: stroke-dashoffset 0.8s ease;
}
.result-detail-score-text {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 16px;
    font-weight: 800;
}

.result-detail-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border-bottom: 1px solid var(--border);
}
.rd-stat {
    background: var(--surface);
    padding: 16px;
    text-align: center;
}
.rd-stat-value {
    font-size: 22px;
    font-weight: 800;
    display: block;
}
.rd-stat-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    display: block;
    margin-top: 2px;
}
.rd-stat.correct .rd-stat-value { color: #16a34a; }
.rd-stat.incorrect .rd-stat-value { color: #dc2626; }
.rd-stat.time .rd-stat-value { color: #2563eb; }
.rd-stat.streak .rd-stat-value { color: #d97706; }

.result-detail-questions {
    padding: 24px 28px;
}
.result-detail-questions h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.rd-question-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.rd-question-item:last-child { border-bottom: none; }
.rd-q-number {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.rd-q-number.correct { background: rgba(34,197,94,0.1); color: #16a34a; }
.rd-q-number.incorrect { background: rgba(239,68,68,0.1); color: #dc2626; }
.rd-q-content { flex: 1; }
.rd-q-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.5;
}
.rd-q-answers {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rd-answer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 8px;
}
.rd-answer-row.user-correct {
    background: rgba(34,197,94,0.06);
    color: #16a34a;
}
.rd-answer-row.user-incorrect {
    background: rgba(239,68,68,0.06);
    color: #dc2626;
}
.rd-answer-row.correct-ref {
    background: rgba(59,130,246,0.06);
    color: #2563eb;
}
.rd-answer-label {
    font-weight: 600;
    font-size: 13px;
    min-width: 110px;
}
.rd-answer-value {
    font-weight: 500;
}

/* Visual result renderers */
.rd-q-visual { margin-top: 6px; }
.rv-icon { font-size: 14px; }
.rv-icon.correct { color: #16a34a; }
.rv-icon.incorrect { color: #dc2626; }

.rv-options { display: flex; flex-direction: column; gap: 4px; }
.rv-opt {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px; border-radius: 8px; font-size: 0.82rem;
    border: 1px solid #e2e8f0; background: #fff;
}
.rv-opt.correct { background: #dcfce7; border-color: #86efac; color: #166534; font-weight: 600; }
.rv-opt.incorrect { background: #fee2e2; border-color: #fca5a5; color: #991b1b; font-weight: 600; }
.rv-opt.correct-ref { border-color: #93c5fd; background: #eff6ff; color: #1e40af; }
.rv-opt-letter {
    width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
    font-size: 13px; font-weight: 700; background: #f1f5f9; color: #64748b; flex-shrink: 0;
}
.rv-opt.correct .rv-opt-letter { background: #166534; color: #fff; }
.rv-opt.incorrect .rv-opt-letter { background: #991b1b; color: #fff; }

.rv-tf { display: flex; gap: 8px; }
.rv-tf-btn {
    padding: 8px 16px; border-radius: 8px; font-size: 0.82rem; font-weight: 500;
    border: 1px solid #e2e8f0; background: #f8fafc; display: flex; align-items: center; gap: 6px;
}
.rv-tf-btn.correct { background: #dcfce7; border-color: #86efac; color: #166534; font-weight: 700; }
.rv-tf-btn.incorrect { background: #fee2e2; border-color: #fca5a5; color: #991b1b; font-weight: 700; }
.rv-tf-btn.correct-ref { border-color: #93c5fd; background: #eff6ff; }

.rv-blanks { display: flex; flex-direction: column; gap: 4px; }
.rv-blank-row {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; font-size: 0.82rem;
}
.rv-blank-row.correct { background: rgba(34,197,94,0.06); }
.rv-blank-row.incorrect { background: rgba(239,68,68,0.06); }
.rv-blank-num { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: #f1f5f9; }
.rv-blank-user { font-weight: 600; }
.rv-blank-row.incorrect .rv-blank-user { color: #dc2626; text-decoration: line-through; }
.rv-blank-correct { font-weight: 600; color: #16a34a; }
.rv-blank-row i { color: #64748b; font-size: 13px; }

.rv-order { display: flex; flex-direction: column; gap: 4px; }
.rv-order-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px;
    border: 1.5px solid #e2e8f0; font-size: 0.82rem; background: #fff;
}
.rv-order-item.correct { border-color: #86efac; background: #f0fdf4; }
.rv-order-item.incorrect { border-color: #fca5a5; background: #fef2f2; }
.rv-order-num { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: #f1f5f9; }
.rv-order-item.correct .rv-order-num { background: #166534; color: #fff; }
.rv-order-item.incorrect .rv-order-num { background: #991b1b; color: #fff; }

.rv-pairs { display: flex; flex-direction: column; gap: 4px; }
.rv-pair {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px;
    font-size: 0.82rem; border: 1px solid #e2e8f0; background: #fff;
}
.rv-pair.correct { background: #f0fdf4; border-color: #86efac; }
.rv-pair.incorrect { background: #fef2f2; border-color: #fca5a5; }
.rv-pair-left { font-weight: 600; color: #1e293b; }
.rv-pair-right { color: #475569; }
.rv-pair i { color: #64748b; font-size: 13px; }

.rv-categories { display: flex; flex-direction: column; gap: 10px; }
.rv-category { }
.rv-cat-name { font-size: 0.78rem; font-weight: 700; color: #475569; text-transform: uppercase; margin-bottom: 4px; }
.rv-cat-items { display: flex; flex-wrap: wrap; gap: 4px; }
.rv-cat-item {
    padding: 4px 10px; border-radius: 6px; font-size: 0.78rem; font-weight: 500;
    border: 1px solid #e2e8f0; background: #f8fafc;
}
.rv-cat-item.correct { background: #dcfce7; border-color: #86efac; color: #166534; }
.rv-cat-item.incorrect { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

.rv-crossword-grid { display: flex; flex-direction: column; gap: 1px; padding: 8px; background: #f1f5f9; border-radius: 10px; }
.rv-cw-row { display: flex; gap: 1px; }
.rv-cw-cell {
    width: 26px; height: 26px; display: grid; place-items: center;
    font-size: 13px; font-weight: 700; text-transform: uppercase;
    border-radius: 4px; background: #fff;
}
.rv-cw-cell.empty { background: transparent; }
.rv-cw-cell.filled { background: #dcfce7; color: #166534; }
.rv-cw-cell.incorrect { background: #fee2e2; color: #991b1b; }

.rv-word-list { display: flex; flex-direction: column; gap: 4px; }
.rv-word {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px;
    font-size: 0.82rem; background: #f8fafc; border: 1px solid #e2e8f0;
}
.rv-word.correct { background: #f0fdf4; border-color: #86efac; }
.rv-word.correct i { color: #16a34a; }
.rv-word.incorrect { background: #fef2f2; border-color: #fca5a5; }
.rv-word.incorrect i { color: #dc2626; }
.rv-word-text { font-weight: 600; color: #1e293b; }
.rv-word-clue { font-size: 0.8125rem; color: #64748b; flex: 1; }

.rv-mark-words p { font-size: 0.85rem; line-height: 1.8; color: #334155; }
.rv-mw { padding: 2px 4px; border-radius: 4px; font-weight: 600; }
.rv-mw.correct { background: #dcfce7; color: #166534; }
.rv-mw.incorrect { background: #fee2e2; color: #991b1b; text-decoration: line-through; }
.rv-mw.missed { background: #fef9c3; color: #854d0e; border-bottom: 2px dashed #f59e0b; }

.rv-timeline { display: flex; flex-direction: column; gap: 4px; padding-left: 12px; border-left: 2px solid #e2e8f0; }
.rv-timeline-item {
    display: flex; align-items: center; gap: 10px; padding: 6px 10px; font-size: 0.82rem;
    border-radius: 8px; position: relative;
}
.rv-timeline-item::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1;
    position: absolute; left: -17px;
}
.rv-timeline-item.correct::before { background: #16a34a; }
.rv-timeline-item.incorrect::before { background: #dc2626; }
.rv-tl-date { font-weight: 700; color: #3b82f6; min-width: 60px; }
.rv-tl-event { color: #334155; }

.rv-memory { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; background: #f0fdf4; font-size: 0.85rem; }
.rv-memory-icon { color: #7c3aed; font-size: 18px; }
.rv-memory-text { font-weight: 500; color: #166534; }

/* Flashcard result */
.rv-flashcard { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: #f8fafc; border: 1px solid #e2e8f0; }
.rv-flashcard-card { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; }
.rv-flashcard-side { color: #334155; }
.rv-flashcard-label { font-weight: 700; color: #64748b; margin-right: 4px; }
.rv-flashcard-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.rv-flashcard-badge.correct { background: #dcfce7; color: #166534; }
.rv-flashcard-badge.incorrect { background: #fee2e2; color: #991b1b; }

/* Open question result */
.rv-open-answer { font-size: 0.85rem; }
.rv-open-student { margin-bottom: 8px; }
.rv-open-label { font-weight: 700; color: #64748b; display: block; margin-bottom: 2px; font-size: 12px; }
.rv-open-student p { background: #f8fafc; padding: 8px 12px; border-radius: 8px; border: 1px solid #e2e8f0; margin: 0; }
.rv-open-sample p { background: #f0fdf4; padding: 8px 12px; border-radius: 8px; border: 1px solid #bbf7d0; margin: 0; color: #166534; }
.rv-open-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; margin-top: 6px; }
.rv-open-badge.pending { background: #fef3c7; color: #92400e; }

/* Dictation result */
.rv-dictation { font-size: 0.85rem; }
.rv-dict-row { margin-bottom: 6px; }
.rv-dict-label { font-weight: 700; color: #64748b; display: block; margin-bottom: 2px; font-size: 12px; }
.rv-dict-row.user p { background: #f8fafc; padding: 8px 12px; border-radius: 8px; border: 1px solid #e2e8f0; margin: 0; }
.rv-dict-row.reference p { background: #f0fdf4; padding: 8px 12px; border-radius: 8px; border: 1px solid #bbf7d0; margin: 0; color: #166534; }

/* Speak word result */
.rv-speak { font-size: 0.85rem; }
.rv-speak-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; margin-bottom: 4px; }
.rv-speak-row.correct { background: #dcfce7; color: #166534; }
.rv-speak-row.incorrect { background: #fee2e2; color: #991b1b; }
.rv-speak-row.correct-ref { background: #eff6ff; color: #1e40af; }

/* ===== Visual Result Summaries & Enhanced Indicators ===== */

/* Shared summary bar for pairs, categories, crossword, timeline, ordering */
.rv-pairs-summary,
.rv-categories-summary,
.rv-crossword-summary,
.rv-timeline-summary,
.rv-order-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    flex-wrap: wrap;
}

.rv-summary-correct {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #16a34a;
}
.rv-summary-correct i { color: #22c55e; }

.rv-summary-incorrect {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #dc2626;
}
.rv-summary-incorrect i { color: #ef4444; }

.rv-summary-total {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #64748b;
}
.rv-summary-total i { color: #64748b; }

/* Matching / Pairing icon */
.rv-pair-icon {
    font-size: 14px;
    flex-shrink: 0;
}
.rv-pair.correct .rv-pair-icon { color: #22c55e; }
.rv-pair.incorrect .rv-pair-icon { color: #ef4444; }

.rv-pair-correct-ref {
    font-size: 0.78rem;
    color: #2563eb;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 6px;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.rv-pair-correct-ref i { color: #3b82f6; font-size: 10px; }

/* Drag-drop category enhancements */
.rv-cat-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 4px;
}
.rv-cat-item-icon {
    font-size: 11px;
    margin-right: 2px;
    flex-shrink: 0;
}
.rv-cat-item.correct .rv-cat-item-icon { color: #22c55e; }
.rv-cat-item.incorrect .rv-cat-item-icon { color: #ef4444; }

/* Crossword wrap */
.rv-crossword-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Crossword word enhancements */
.rv-word-icon {
    font-size: 13px;
    flex-shrink: 0;
}
.rv-word.correct .rv-word-icon { color: #22c55e; }
.rv-word.incorrect .rv-word-icon { color: #ef4444; }

.rv-word-user {
    font-size: 0.78rem;
    color: #dc2626;
    background: #fee2e2;
    padding: 2px 8px;
    border-radius: 6px;
    text-decoration: line-through;
    margin-left: auto;
}

/* Timeline wrap & enhancements */
.rv-timeline-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rv-tl-num {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
    flex-shrink: 0;
}
.rv-timeline-item.correct .rv-tl-num { background: #dcfce7; color: #166534; }
.rv-timeline-item.incorrect .rv-tl-num { background: #fee2e2; color: #991b1b; }

.rv-tl-icon {
    font-size: 13px;
    margin-left: auto;
    flex-shrink: 0;
}
.rv-timeline-item.correct .rv-tl-icon { color: #22c55e; }
.rv-timeline-item.incorrect .rv-tl-icon { color: #ef4444; }

.rv-tl-correct-pos {
    font-size: 0.75rem;
    color: #2563eb;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.rv-tl-correct-pos i { color: #3b82f6; font-size: 10px; }

/* Ordering / Sequencing wrap & enhancements */
.rv-order-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rv-order-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 600px) {
    .rv-order-columns { grid-template-columns: 1fr; }
}

.rv-order-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rv-order-col-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 2px;
}
.rv-order-col-header i { font-size: 12px; color: #64748b; }

.rv-order-item.correct-ref {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1e40af;
}
.rv-order-item.correct-ref .rv-order-num {
    background: #3b82f6;
    color: #fff;
}

.rv-order-icon {
    font-size: 13px;
    margin-left: auto;
    flex-shrink: 0;
}
.rv-order-item.correct .rv-order-icon { color: #22c55e; }
.rv-order-item.incorrect .rv-order-icon { color: #ef4444; }

/* Memory detail layout */
.rv-memory-detail {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #faf5ff;
    border: 1px solid #e9d5ff;
}

.rv-memory-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.rv-memory-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6b21a8;
    background: #f3e8ff;
    padding: 5px 12px;
    border-radius: 8px;
}
.rv-memory-stat i {
    font-size: 13px;
    color: #a855f7;
}

.rv-memory-pairs {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 6px;
    border-top: 1px solid #e9d5ff;
}

.rv-memory-pair-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e9d5ff;
    font-size: 0.82rem;
    color: #581c87;
    font-weight: 500;
}
.rv-memory-pair-item i.rv-icon { font-size: 12px; }
.rv-memory-pair-item i.fa-arrows-left-right { color: #a78bfa; font-size: 11px; }

.rd-q-time {
    color: var(--muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

/* Responsive Results */
@media (max-width: 1200px) {
    .results-secondary-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .results-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .results-stat-card {
        padding: 24px 20px;
    }
    
    .rstat-value {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .results-secondary-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 700px) {
    .results-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .results-card-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .error-filter-input {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .result-detail-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-detail-header {
        flex-direction: column;
        text-align: center;
    }
    .result-detail-score-ring {
        margin-left: 0;
    }

    .students-results-table th,
    .students-results-table td {
        padding: 12px 10px;
        font-size: 0.82rem;
    }
    
    .th-time, .th-progress {
        display: none;
    }
    td:nth-child(3), td:nth-child(5) {
        display: none;
    }
    
    .student-avatar-sm {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
    
    .results-main-grid {
        grid-template-columns: 1fr;
    }
    
    .results-header-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .results-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .rstat-value { font-size: 22px; }
    .results-session-selector { flex-direction: column; }
    .selector-options { flex-wrap: wrap; }
    .results-tabs { gap: 4px; }
    .results-tab { padding: 10px 14px; font-size: 0.82rem; }
}

@media (max-width: 360px) {
    .results-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Export Confirmation Modal ===== */
.export-modal-content {
    max-width: 480px !important;
    border-radius: 24px;
    padding: 0 !important;
    overflow: hidden;
}

.export-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 24px 20px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-bottom: 1px solid #d1fae5;
}

.export-modal-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px -4px rgba(16, 185, 129, 0.4);
    flex-shrink: 0;
}

.export-modal-icon i {
    font-size: 22px;
    color: #fff;
}

.export-modal-header-text h2 {
    font-size: 18px;
    font-weight: 700;
    color: #065f46;
    margin: 0 0 4px;
}

.export-modal-header-text p {
    font-size: 13px;
    color: #047857;
    margin: 0;
}

.export-modal-body {
    padding: 20px 24px;
}

.export-section {
    margin-bottom: 18px;
}

.export-section:last-child {
    margin-bottom: 0;
}

.export-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 10px;
}

/* No Filters State */
.export-no-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    color: #64748b;
}

.export-no-filters i {
    color: #10b981;
    font-size: 14px;
}

/* Filter Tags */
.export-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.export-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
}

.export-filter-tag i {
    color: #3b82f6;
    font-size: 13px;
}

.export-filter-label {
    color: #64748b;
}

.export-filter-value {
    color: #1e293b;
    font-weight: 600;
}

/* Export Stats */
.export-stats-row {
    display: flex;
    gap: 8px;
}

.export-stat-card {
    flex: 1;
    padding: 16px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.export-stat-card:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

.export-stat-card .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}

.export-stat-card .stat-label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-top: 6px;
    font-weight: 500;
    text-transform: uppercase;
}

/* Columns Preview */
.export-columns-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.export-col-tag {
    padding: 6px 10px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

/* Footer */
.export-modal-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.btn-export-cancel {
    flex: 1;
}

.btn-export-confirm {
    flex: 2;
}

/* Responsive Export Modal */
@media (max-width: 500px) {
    .export-modal-header {
        padding: 20px;
    }
    
    .export-modal-body {
        padding: 16px 20px;
    }
    
    .export-stats-row {
        flex-wrap: wrap;
    }
    
    .export-stat-card {
        min-width: calc(50% - 4px);
    }
    
    .export-modal-footer {
        padding: 16px 20px;
        flex-direction: column;
    }
    
    .btn-export-cancel,
    .btn-export-confirm {
        flex: none;
        width: 100%;
    }
}

/* Results Tabs */
.results-tabs {
    display: flex;
    gap: 4px;
    padding: 0 0 16px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
}
.results-tab {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    border-radius: 8px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.results-tab:hover {
    background: #f1f5f9;
    color: #334155;
}
.results-tab.active {
    background: #3b82f6;
    color: white;
}

/* ===== GRADEBOOK ===== */

/* Group bar */
.gb-group-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius);
}
.gb-group-bar-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.gb-group-bar-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}
.gb-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.gb-chip:hover {
    border-color: #93c5fd;
    background: #f0f9ff;
    color: #1e40af;
}
.gb-chip.active {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

/* Welcome state */
.gb-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 30px;
    background: linear-gradient(160deg, #ffffff, #f8fafc, #f0f9ff);
    border-radius: 16px;
    border: 1.5px dashed #cbd5e1;
}
.gb-welcome-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}
.gb-welcome h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px;
}
.gb-welcome p {
    color: #64748b;
    font-size: 14px;
    max-width: 400px;
    margin: 0 0 24px;
}
.gb-welcome-features {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}
.gb-welcome-feat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}
.gb-welcome-feat i {
    color: #6366f1;
}

/* Config panel */
.gb-config-panel {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}
.gb-config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.gb-config-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.gb-config-header h3 i {
    color: #8b5cf6;
}
.gb-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}
.gb-cat-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.gb-cat-name-input {
    flex: 3;
    min-width: 140px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.15s;
}
.gb-cat-name-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08);
}
.gb-cat-weight-input {
    width: 64px;
    flex-shrink: 0;
    padding: 8px 8px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.15s;
}
.gb-cat-weight-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08);
}
.gb-cat-weight-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.gb-cat-weight-input { -moz-appearance: textfield; }
.gb-cat-pct {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    flex-shrink: 0;
}
.gb-cat-type-input {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    font-size: 13px;
    font-family: inherit;
    width: 120px;
    flex-shrink: 0;
    color: #475569;
    background: #fff;
    cursor: pointer;
}
.gb-cat-type-input:focus {
    outline: none;
    border-color: #8b5cf6;
}
.gb-cat-del {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: none;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.gb-cat-del:hover {
    background: #fee2e2;
    color: #dc2626;
}
.gb-empty-cats {
    padding: 24px 20px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    border: 1.5px dashed #e2e8f0;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.gb-empty-cats i {
    font-size: 1.2rem;
    color: #cbd5e1;
}
.gb-total-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}
.gb-total-value {
    font-size: 1rem;
    font-weight: 700;
    transition: color 0.2s;
}
.gb-loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-size: 14px;
}

/* No grades state */
.gb-no-grades {
    text-align: center;
    padding: 48px 24px;
    color: #64748b;
    border: 1.5px dashed #e2e8f0;
    border-radius: var(--radius);
    background: #fafbfc;
}
.gb-no-grades i {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
    color: #cbd5e1;
}
.gb-no-grades p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 4px;
}
.gb-no-grades span {
    font-size: 13px;
    color: #64748b;
}

/* Table area */
.gb-table-area {
    border-radius: var(--radius);
    margin-top: 20px;
}

/* Gradebook table */
.gradebook-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1.5px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    position: relative;
}

.gradebook-table-wrap::after {
    content: '';
    position: sticky;
    right: 0;
    top: 0;
    bottom: 0;
    width: 32px;
    pointer-events: none;
    background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
    float: right;
    margin-top: -100%;
    height: 100%;
    z-index: 3;
}
.gradebook-table.full {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}
.gradebook-table.full th {
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    padding: 12px 14px;
    text-align: center;
    font-weight: 600;
    color: #475569;
    border-bottom: 1.5px solid #e2e8f0;
    white-space: nowrap;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.gradebook-table.full th.gb-student-col {
    text-align: left;
    min-width: 180px;
    position: sticky;
    left: 0;
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    z-index: 2;
    text-transform: none;
    font-size: 0.83rem;
    letter-spacing: 0;
}
.gradebook-table.full th.gb-lesson-header {
    background: linear-gradient(to bottom, #f0fdf4, #dcfce7);
    color: #166534;
    font-weight: 700;
    border-left: 3px solid #22c55e;
}
.gradebook-table.full th.gb-lesson-header i {
    margin-right: 4px;
    font-size: 0.8125rem;
}
.gb-lesson-child-count {
    display: inline-block;
    margin-left: 4px;
    background: #bbf7d0;
    color: #166534;
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
}
.gradebook-table.full th.gb-child-col {
    background: linear-gradient(to bottom, #f0fdf4, #f8fafc);
    font-weight: 500;
    font-size: 0.72rem;
    color: #374151;
}
.gb-indent {
    display: inline-block;
    width: 10px;
    border-left: 2px solid #86efac;
    margin-right: 4px;
}
.gradebook-table.full td.gb-lesson-avg {
    background: #f0fdf4;
    border-left: 3px solid #22c55e;
}
.gradebook-table.full th.gb-final-col {
    background: linear-gradient(to bottom, #eef2ff, #e0e7ff);
    color: #3730a3;
    min-width: 80px;
}
.gradebook-table.full td {
    padding: 12px 14px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
}
.gradebook-table.full tr:hover td {
    background: #f8fafc;
}
.gradebook-table.full tr:hover td.gb-student-cell {
    background: #f1f5f9;
}
.gradebook-table.full td.gb-student-cell {
    text-align: left;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    border-right: 1px solid #f1f5f9;
}
.gradebook-table.full td.gb-student-cell strong {
    font-size: 0.85rem;
    color: #1e293b;
}
.gradebook-table.full td.gb-student-cell small {
    font-size: 0.72rem;
}
.gradebook-score {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.78rem;
    min-width: 42px;
    text-align: center;
}
.gradebook-score.high { background: #dcfce7; color: #166534; }
.gradebook-score.mid { background: #fef9c3; color: #854d0e; }
.gradebook-score.low { background: #fee2e2; color: #991b1b; }
.gradebook-score.pending { background: #f1f5f9; color: #64748b; font-weight: 400; }
.gradebook-score.final {
    font-size: 0.88rem;
    padding: 5px 12px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 700;
    border-radius: 10px;
}
.gradebook-score.final.high { background: #dcfce7; color: #166534; }
.gradebook-score.final.mid { background: #fef9c3; color: #854d0e; }
.gradebook-score.final.low { background: #fee2e2; color: #991b1b; }

/* Structure summary below table */
.gb-structure-summary {
    margin-top: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
}
.gb-structure-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 12px;
}
.gb-structure-header i {
    color: #3b82f6;
    font-size: 14px;
}
.gb-structure-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.gb-structure-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.gb-structure-pill:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}
.gb-structure-pill-weight {
    font-size: 1.1rem;
    font-weight: 700;
    color: #3b82f6;
    min-width: 36px;
}
.gb-structure-pill-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.gb-structure-pill-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e293b;
}
.gb-structure-pill-count {
    font-size: 0.8125rem;
    color: #64748b;
}

/* Category block (row + items) */
.gb-cat-block {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    padding: 12px 14px;
    transition: border-color 0.15s;
}
.gb-cat-block:hover {
    border-color: #e2e8f0;
}
.gb-cat-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    align-items: center;
}
.gb-cat-items-empty {
    font-size: 13px;
    color: #64748b;
    font-style: italic;
}
.gb-cat-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    background: #dbeafe;
    color: #1e40af;
    white-space: nowrap;
}
.gb-cat-item i {
    font-size: 13px;
    opacity: 0.7;
}
.gb-cat-item-points {
    width: 48px;
    padding: 2px 4px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    background: #fff;
    color: #334155;
    margin-left: 6px;
}
.gb-cat-item-points:focus {
    border-color: #3b82f6;
    outline: none;
}
.gb-cat-item-pct {
    font-size: 13px;
    color: #64748b;
    margin-left: 2px;
    min-width: 28px;
}
.gb-cat-items-total {
    padding: 4px 12px 8px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    text-align: right;
}
.gb-cat-item-remove {
    border: none;
    background: none;
    color: #1e40af;
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.gb-cat-item-remove:hover {
    opacity: 1;
    color: #dc2626;
}
.gb-cat-add-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1.5px dashed #cbd5e1;
    background: none;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.gb-cat-add-item:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: #f5f3ff;
}

/* Content picker overlay */
.gb-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.gb-picker-modal {
    background: #fff;
    border-radius: 16px;
    width: 520px;
    max-width: 95vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}
.gb-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #f1f5f9;
}
.gb-picker-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.gb-picker-header h3 i { color: #8b5cf6; }
.gb-picker-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.15s;
}
.gb-picker-close:hover { background: #fee2e2; color: #dc2626; }
.gb-picker-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border-bottom: 1px solid #f1f5f9;
}
.gb-picker-search i { color: #64748b; font-size: 13px; }
.gb-picker-search input {
    border: none;
    outline: none;
    font-size: 14px;
    flex: 1;
    font-family: inherit;
    color: #1e293b;
}
.gb-picker-search input::placeholder { color: #64748b; }
.gb-picker-filters {
    display: flex;
    gap: 6px;
    padding: 12px 22px;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
}
.gb-picker-filter {
    padding: 5px 12px;
    border-radius: 16px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.gb-picker-filter:hover { border-color: #8b5cf6; color: #8b5cf6; }
.gb-picker-filter.active { border-color: #8b5cf6; background: #8b5cf6; color: #fff; }
.gb-picker-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}
.gb-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s;
}
.gb-picker-item:hover { background: #f8fafc; }
.gb-picker-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #8b5cf6;
    flex-shrink: 0;
}
.gb-picker-item i { color: #64748b; font-size: 14px; flex-shrink: 0; }
.gb-picker-item-title { flex: 1; font-size: 13px; color: #1e293b; font-weight: 500; }
.gb-picker-item-badge {
    font-size: 13px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.gb-picker-item-badge.activity { background: #dbeafe; color: #1d4ed8; }
.gb-picker-item-badge.quiz { background: #ede9fe; color: #6d28d9; }
.gb-picker-item-badge.lesson { background: #dcfce7; color: #166534; }
.gb-picker-empty {
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
}
.gb-picker-empty i { font-size: 1.5rem; margin-bottom: 10px; display: block; }
.gb-picker-empty p { font-size: 13px; margin: 0; }
.gb-picker-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}
.gb-picker-selected-count { font-size: 13px; color: #64748b; font-weight: 500; }

@media (max-width: 640px) {
    .gb-group-bar { padding: 12px; }
    .gb-config-panel { padding: 16px; }
    .gb-cat-row { flex-wrap: wrap; padding: 10px; }
    .gb-cat-name-input { min-width: 100%; }
    .gb-picker-modal { width: 100%; max-width: 100%; max-height: 100vh; border-radius: 0; }
}
