/* Cheecore Education - Reusable UI Components: Stats, Cards, Tables, Badges, Modals, Course Cards, Timeline */

/* ===== Stats Grid ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 18px 16px 14px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: all var(--transition);
    position: relative;
}
.stat-card:hover { box-shadow: var(--shadow); border-color: var(--gray-200); }
.stat-card-clickable { cursor: pointer; }
.stat-card-clickable:hover { transform: translateY(-2px); }
.stat-icon {
    position: absolute;
    top: 12px; right: 12px;
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    opacity: 0.70;
}
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.indigo { background: #E0E7FF; color: #4338CA; }
.stat-icon.gray { background: var(--gray-100); color: var(--gray-600); }
.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    padding-right: 40px;
}
.stat-label {
    font-size: 13px;
    color: var(--gray-700);
    font-weight: 500;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.stat-label .bi { display: inline-flex !important; flex-direction: column !important; gap: 0 !important; line-height: 1.25 !important; }
.stat-label .bi .zh { font-size: 13px; font-weight: 600; }
.stat-label .bi .en { font-size: 10.5px; font-weight: 400; color: #9CA3AF; word-break: break-word; white-space: normal; }

/* ===== Cards ===== */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--gray-100);
    transition: all var(--transition);
}
.card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 14px;
    color: var(--gray-800);
    display: flex;
    flex-direction: column;
}
.card h3 .en {
    font-size: 11px;
    font-weight: 400;
    color: #6B7280;
}
.card-text {
    white-space: pre-line;
    font-size: 14px;
    color: var(--gray-700);
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* ===== Tables ===== */
.table-wrap {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}
.table-wrap .table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
}
.table-wrap .table-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}
table {
    width: 100%;
    border-collapse: collapse;
}
table th {
    text-align: left;
    padding: 11px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--gray-50);
    border-bottom: 1.5px solid var(--gray-200);
    white-space: nowrap;
}
table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-50);
    font-size: 13px;
    max-width: 260px;
    word-break: break-word;
    vertical-align: middle;
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: #FAFAFE; }

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.badge-success { background: var(--success-light); color: #065F46; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-info { background: var(--primary-light); color: #3730A3; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-danger, .badge-red { background: var(--danger-light); color: #991B1B; }
.badge-sm { padding: 1px 7px; font-size: 10px; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}
.detail-grid.single-col { grid-template-columns: 1fr; }
@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
}

/* ===== Score Display ===== */
.score-big {
    display: inline-flex;
    align-items: baseline;
    font-size: 44px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.score-big span {
    font-size: 17px;
    color: var(--gray-400);
    font-weight: 500;
    margin-left: 3px;
}

/* ===== Feedback Box ===== */
.feedback-box {
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-top: 16px;
}
.feedback-box h4 {
    color: var(--warning);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}
.feedback-text {
    white-space: pre-line;
    word-break: break-word;
    font-size: 14px;
}

/* ===== File Preview ===== */
.file-preview-static {
    background: var(--gray-50);
    border-radius: var(--radius);
}
.file-preview {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 16px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-line;
    word-break: break-word;
}
.file-preview-scroll {
    max-height: 500px;
}
.file-preview-content {
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 14px;
    border-radius: 8px;
    font-size: 14px;
}
.file-preview-sm {
    max-height: 200px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ===== Modal / Dialog ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-overlay.show { display: flex; }
.modal-dialog {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.15s ease;
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-dialog.wide { max-width: 640px; }
.modal-dialog.modal-detail { max-width: 700px; max-height: 85vh; overflow-y: auto; }
.modal-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}
.modal-detail-header h3 { margin: 0 !important; }
.modal-detail-body { padding: 20px; }
.modal-dialog h3 {
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-5);
    color: var(--gray-900);
}
.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: var(--space-6);
}

/* ===== Course Cards ===== */
.course-section {
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-xs);
}
.course-section + .course-section { margin-top: 20px; }
.course-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}
.course-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.course-card-grid > * { min-width: 0; }
@media (max-width: 1024px) { .course-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .course-card-grid { grid-template-columns: 1fr; } }
.course-card {
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}
.course-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}
.course-card.is-completed { opacity: 0.55; }
.course-card .cc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.course-card .cc-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.4;
}
.course-card .cc-title a { color: inherit; text-decoration: none; }
.course-card .cc-title a:hover { color: var(--primary); }
.course-card .cc-divider {
    height: 1px;
    background: var(--gray-100);
    margin-bottom: 10px;
}
.course-card .cc-meta {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-bottom: 8px;
    flex: 1;
}
.course-card .cc-meta span { white-space: nowrap; }
.course-card .cc-meta i { font-style: normal; opacity: 0.35; }
.course-card .cc-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 8px;
}
.course-card .cc-stat {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 11px;
    color: var(--gray-600);
}
.course-card .cc-stat strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
}
.course-card .cc-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
    margin-top: auto;
}
.course-card .cc-foot a {
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.course-card .cc-foot a:hover { opacity: 0.8; }

/* ===== Lesson Timeline ===== */
.lesson-timeline { display: flex; flex-direction: column; gap: 8px; }
.lesson-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    border: 1.5px solid var(--gray-100);
    border-radius: var(--radius);
    transition: all var(--transition);
    flex-wrap: wrap;
}
.lesson-row:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-xs);
}
.lesson-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}
.lesson-num.done { background: var(--success-light); color: var(--success); }
.lesson-num.active { background: var(--primary-light); color: var(--primary); }
.lesson-num.pending { background: var(--gray-100); color: var(--gray-400); }
.lesson-info { flex: 1; min-width: 0; }
.lesson-info .title { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.lesson-info .sub { font-size: 11px; color: var(--gray-500); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.lesson-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.lesson-title { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.lesson-meta { font-size: 11px; color: var(--gray-500); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ===== Report Styles ===== */
.report-header-block {
    background: linear-gradient(135deg, #1E1B4B, #4338CA);
    color: #fff;
    padding: 36px 28px;
    text-align: center;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.report-header-block h1 { color: #fff; }
.report-lesson {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    margin-bottom: 14px;
    overflow: hidden;
}
.report-lesson-header {
    background: var(--gray-50);
    padding: 14px 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    transition: background var(--transition);
}
.report-lesson-header:hover { background: var(--gray-100); }
.report-lesson-body { padding: 18px; display: none; }
.report-lesson-body.open { display: block; }

.report-student-name { margin: 0; color: #fff; }
.report-course-meta { margin: 8px 0 0; opacity: 0.9; }
.report-teacher-meta { margin: 4px 0 0; font-size: 13px; opacity: 0.7; }
.report-body { padding: 24px; }
.report-lesson-status { font-size: 12px; color: var(--gray-500); }
.report-generate-section { margin-top: 24px; text-align: center; }
.report-generate-hint { font-size: 12px; color: var(--gray-500); margin-top: 8px; }
.card-report-preview { max-width: 900px; margin: 0 auto; }
.report-url {
    font-size: 12px;
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
}

.card-form { max-width: 800px; }
.feedback-text-content { white-space: pre-line; word-break: break-word; }
.followup-card { margin-top: 12px; padding: 12px; background: var(--gray-50); border-radius: var(--radius); white-space: pre-line; word-break: break-word; }
.btn-auto { width: auto; }

.perf-header { margin: 20px 0 12px; }
.perf-student-title { margin-bottom: 8px; }
.perf-sub-status { font-size: 12px; color: var(--gray-500); font-weight: 400; }

/* Performance Dropdown Grid (student evaluation) */
.perf-dropdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}
.perf-dropdown-grid .form-group {
    margin-bottom: 0;
}
.perf-dropdown-grid .form-group label {
    font-size: 11px;
    margin-bottom: 3px;
    color: var(--gray-500);
    font-weight: 600;
}
.perf-dropdown-grid .form-select-inline,
.perf-dropdown-grid select {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}

.student-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 12px;
    transition: all var(--transition);
}
.student-card.evaluated {
    border-left-color: var(--success);
    background: #FAFFFA;
}
.student-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
}

/* ===== Progress Bar ===== */
.progress-bar {
    height: 7px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}
.progress-bar .fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.progress-bar .fill.green { background: var(--success); }
.progress-bar .fill.orange { background: var(--warning); }
.progress-bar .fill.red { background: var(--danger); }

/* ===== File Upload Queue ===== */
.file-list {
    margin-bottom: 8px;
}
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 6px;
    font-size: 13px;
    transition: all var(--transition);
}
.file-item:hover { border-color: var(--primary-light); }
.file-item a { text-decoration: none; }
.file-item a:hover { text-decoration: underline; }
.file-item .file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
.file-item .file-icon {
    font-size: 20px;
    flex-shrink: 0;
}
.file-item .file-name {
    font-weight: 600;
    color: var(--gray-800);
    word-break: break-word;
}
.file-item .file-size {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 1px;
}
.file-item .file-delete {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0 4px;
    flex-shrink: 0;
    transition: color var(--transition);
}
.file-item .file-delete:hover { color: var(--danger); }
.file-uploading {
    opacity: 0.6;
    animation: upload-pulse 1.2s ease-in-out infinite;
}
@keyframes upload-pulse {
    0%, 100% { opacity: 0.45; }
    50% { opacity: 0.8; }
}
.file-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}
.upload-status {
    font-size: 12px;
    color: var(--gray-500);
}
.upload-progress-wrap {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
}
.file-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 6px;
    font-size: 13px;
    transition: all var(--transition);
}
.file-queue-item:hover { border-color: var(--primary-light); }
.file-queue-item a { text-decoration: none; }
.file-queue-item a:hover { text-decoration: underline; }

.btn-del-corr {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 4px;
}
.btn-del-corr:hover { color: #B91C1C; }

.corr-file-success {
    background: #ECFDF5;
}


/* ===== TA Grid ===== */
.ta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

/* ===== Follow-up Form ===== */
.followup-form { max-width: 900px; }
.followup-form textarea {
    min-height: 100px;
    line-height: 1.7;
}

/* ===== View-specific Layouts ===== */
.two-col-main {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 900px) {
    .two-col-main { grid-template-columns: 1fr; }
}

/* ===== Tabs ===== */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: var(--space-5);
}
.tab-nav button {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    font-family: inherit;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.35;
}
.tab-nav button .en {
    font-size: 0.78em;
    font-weight: 400;
    opacity: 0.6;
}
.tab-nav button:hover {
    color: var(--gray-700);
}
.tab-nav button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }


/* ===== Quick Actions ===== */
.quick-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}
.quick-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}
.quick-action:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
}

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: var(--space-4);
    padding: 12px 16px;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
}
.filter-bar select,
.filter-bar input {
    padding: 7px 12px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}
.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== Section Header ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    gap: var(--space-3);
}
.section-header h3 {
    font-size: var(--text-md);
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}
.section-title { font-size: 14px; font-weight: 700; color: var(--gray-700); margin-bottom: 12px; }

/* ===== Student Rows ===== */
.student-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}
.student-row:last-child { border-bottom: none; }
.student-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
/* ===== Checkbox List ===== */
.checkbox-list {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 10px;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2px;
}
.checkbox-list label {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s;
    white-space: nowrap;
}
.checkbox-list label input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    flex-shrink: 0;
}
.checkbox-list label:hover { background: var(--primary-light); color: var(--primary); }
.checkbox-list .student-email { color: var(--gray-400); font-size: 11px; margin-left: 4px; overflow: hidden; text-overflow: ellipsis; }
.student-search { width: 100%; padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: var(--radius); margin-bottom: 8px; font-size: 13px; font-family: inherit; transition: border-color 0.2s; }
.student-search:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-light); }
.checkbox-list-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 12px; color: var(--gray-500); }
.checkbox-list-header .select-all { cursor: pointer; color: var(--primary); font-size: 12px; user-select: none; }
.checkbox-list-header .select-all:hover { text-decoration: underline; }
.modal-wide { width: 500px; }
.cell-wrap { max-width: 200px; white-space: normal; word-break: break-word; }
.cell-wrap-wide { max-width: 220px; white-space: normal; word-break: break-word; }
.cell-nowrap { white-space: nowrap; }
.perf-card { margin-bottom: 6px; padding: 6px; background: var(--gray-50); border-radius: 4px; }

/* ===== Vertical Timeline (Admin Follow-up Detail) ===== */
.tl-vert {
    position: relative;
    padding-left: 28px;
}
.tl-vert::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--gray-200);
    border-radius: 1px;
}
.tl-node {
    position: relative;
    margin-bottom: 10px;
}
.tl-node:last-child { margin-bottom: 0; }
.tl-dot {
    position: absolute;
    left: -24px;
    top: 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2.5px solid var(--gray-300);
    background: #fff;
    z-index: 2;
    flex-shrink: 0;
}
.tl-dot.green  { border-color: var(--success); background: var(--success-light); }
.tl-dot.blue   { border-color: var(--primary); background: var(--primary-light); }
.tl-dot.orange { border-color: var(--warning); background: var(--warning-light); }
.tl-dot.red    { border-color: var(--danger); background: var(--danger-light); }
.tl-dot.gray   { border-color: var(--gray-400); background: var(--gray-100); }
.tl-card {
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius);
    padding: 10px 14px;
    box-shadow: var(--shadow-xs);
}
.tl-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.tl-card-head .tl-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-800);
}
.tl-card-head .tl-time {
    font-size: 11px;
    color: var(--gray-500);
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}
.tl-card-body {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--gray-50);
    font-size: 12px;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.tl-card-body.text-muted { color: var(--gray-400); font-style: italic; }

/* Follow-up Timeline Item */
.fu-timeline-item {
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--gray-50);
}
.fu-timeline-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}
.fu-lesson-badge {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800);
    background: var(--gray-200);
    padding: 2px 10px;
    border-radius: 12px;
}
.fu-label-sm {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    width: 100%;
}
.fu-text {
    font-size: 13px;
    color: var(--gray-700);
    white-space: pre-line;
    word-break: break-word;
    width: 100%;
}

/* ===== Status Info Card (Student Sidebar) ===== */
.status-info-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--gray-100);
    border-left: 4px solid var(--gray-300);
    overflow: hidden;
    transition: all var(--transition);
}
.status-info-card.status-none {
    border-left-color: var(--gray-300);
}
.status-info-card.status-pending {
    border-left-color: #D97706;
}
.status-info-card.status-graded {
    border-left-color: var(--success);
}

.status-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px 0;
}
.status-card-header .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-none .status-card-header .status-dot { background: var(--gray-300); }
.status-pending .status-card-header .status-dot { background: #D97706; }
.status-graded .status-card-header .status-dot { background: var(--success); }

.status-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-card-body {
    padding: 8px 18px 16px;
}

.status-badge-row {
    margin-bottom: 6px;
}

.status-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.status-score {
    margin: 4px 0 12px;
}

.status-score .score-big {
    font-size: 36px;
}

.status-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}

.status-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.status-meta-label {
    color: var(--gray-500);
    font-size: 12px;
}

.status-meta-value {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 13px;
}

/* ===== File Reference List (Student Sidebar) ===== */
.file-ref-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.file-ref-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-100);
    transition: all var(--transition);
}
.file-ref-item:hover {
    border-color: var(--primary-light);
}

.file-ref-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.file-ref-info {
    flex: 1;
    min-width: 0;
}

.file-ref-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-800);
    word-break: break-word;
}

.file-ref-size {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 1px;
}

/* ===== Preview Block (Student Sidebar) ===== */
.preview-block {
    margin-bottom: 14px;
}
.preview-block:last-child {
    margin-bottom: 0;
}
.preview-block + .preview-block {
    padding-top: 14px;
    border-top: 1px solid var(--gray-100);
}

.preview-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.preview-text {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.7;
}

/* ===== Single Column Layout (Student Assignment) ===== */
.single-col {
    max-width: 780px;
}

/* ===== Assignment Two-Column Layout ===== */
.assignment-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
}
.assignment-layout > .status-bar {
    grid-column: 1 / -1;
}
.assignment-main {
    min-width: 0;
}
.assignment-side {
    position: sticky;
    top: 20px;
}

/* Section Label */
.section-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
    letter-spacing: 0.3px;
    margin-bottom: 8px;
    margin-top: 24px;
}
.section-label:first-child {
    margin-top: 0;
}
.section-label-highlight {
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    padding: 6px 12px;
    background: rgba(37, 99, 235, 0.08);
    border-left: 3px solid var(--primary);
    border-radius: 0 4px 4px 0;
}

/* Card internals */
.card-body {
    padding: 0;
}
.card-divider {
    border: none;
    border-top: 1px solid var(--gray-100);
    margin: 18px 0;
}
.card-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    .assignment-layout {
        grid-template-columns: 1fr;
    }
    .assignment-side {
        position: static;
    }
}

/* ===== Status Bar (Student Assignment) ===== */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
    border-left: 4px solid var(--gray-300);
    box-shadow: var(--shadow-xs);
    flex-wrap: wrap;
}
.status-bar.status-none  { border-left-color: var(--gray-300); }
.status-bar.status-pending { border-left-color: #D97706; }
.status-bar.status-graded { border-left-color: var(--success); }

.status-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.status-bar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-none  .status-bar-dot { background: var(--gray-300); }
.status-pending .status-bar-dot { background: #D97706; }
.status-graded .status-bar-dot { background: var(--success); }

.status-bar-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-600);
}

.status-bar-score {
    font-size: 22px;
    font-weight: 800;
    color: var(--success);
    margin-left: 6px;
}

.status-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--gray-500);
    flex-wrap: wrap;
}

.status-bar-sep {
    color: var(--gray-300);
    user-select: none;
}

/* ===== Form Sections (TA Create/Edit Assignment & Follow-up) ===== */
.form-section {
    margin-bottom: 20px;
}

.form-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-100);
}

.form-section-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin: -8px 0 14px;
    line-height: 1.5;
}

/* ===== Form Actions Bar ===== */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

/* ===== Checkbox Label (inline) ===== */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    user-select: none;
}
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
}

/* ===== Flex Row End (for checkbox alignment in form-row) ===== */
.form-group.flex-row-end {
    display: flex;
    align-items: flex-end;
    padding-bottom: 2px;
}

/* ===== Student Card Header (Follow-up) ===== */
.student-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.student-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}
.student-card-done {
    font-size: 13px;
    color: var(--success);
    font-weight: 700;
    background: var(--success-light);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.student-card-sub {
    margin-left: auto;
}

/* ===== Homework Done Row (Follow-up) ===== */
.perf-hw-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-100);
}
.perf-hw-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    flex-shrink: 0;
}

/* ===== Radio Label ===== */
.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--gray-700);
    cursor: pointer;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--gray-200);
    background: #fff;
    transition: all var(--transition);
    user-select: none;
}
.radio-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.radio-label input[type="radio"] {
    accent-color: var(--primary);
    width: 14px;
    height: 14px;
    cursor: pointer;
    margin: 0;
}

/* ===== Grade Dimensions Grid (Follow-up) ===== */
.perf-grades {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 4px;
}
@media (max-width: 768px) {
    .perf-grades {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 480px) {
    .perf-grades {
        grid-template-columns: repeat(2, 1fr);
    }
}

.perf-grade-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.perf-grade-item label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.perf-grade-item select {
    width: 100%;
    padding: 7px 10px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: #fff;
}
.perf-grade-item select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== Student Dashboard: Overdue Row ===== */
tr.row-overdue {
    background: #FEF2F2 !important;
}
tr.row-overdue:hover td {
    background: #FEE2E2 !important;
}

/* ===== New-Graded Dot Indicator ===== */
.dot-new {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #F59E0B;
    margin-left: 6px;
    vertical-align: middle;
    animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== Stat Icon: Yellow variant ===== */
.stat-icon.yellow { background: #FEF9C3; color: #A16207; }

/* ===== Dashboard: Today's Feedback Row ===== */
.dash-feedback-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: 0 4px;
}
.dash-feedback-item {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: 6px;
    border: 1px solid var(--gray-100);
}
.dash-fb-course {
    font-weight: 600;
    font-size: var(--text-sm);
    margin-bottom: 4px;
}
.dash-fb-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== Overdue Monitor: Severity Rows ===== */
tr.overdue-low { background: #FFFBEB !important; }
tr.overdue-low:hover td { background: #FEF3C7 !important; }
tr.overdue-mid { background: #FFF7ED !important; }
tr.overdue-mid:hover td { background: #FFEDD5 !important; }
tr.overdue-high { background: #FEF2F2 !important; }
tr.overdue-high:hover td { background: #FEE2E2 !important; }

/* ===== Overdue Badge: Severity Variants ===== */
.overdue-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
}
.overdue-badge-low { background: #FEF3C7; color: #92400E; }
.overdue-badge-mid { background: #FFEDD5; color: #9A3412; }
.overdue-badge-high { background: #FEE2E2; color: #991B1B; }

/* ===== Overdue Summary Stacked Bar ===== */
.overdue-summary-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--space-4);
    background: var(--gray-100);
}
.overdue-bar-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    min-width: 0;
    transition: width 0.3s ease;
}
.overdue-seg-low { background: #FBBF24; }
.overdue-seg-mid { background: #F97316; }
.overdue-seg-high { background: #EF4444; }

/* ===== Monitor Tabs ===== */
.monitor-tabs {
    display: flex;
    gap: 0;
    margin-bottom: var(--space-4);
    background: var(--gray-100);
    border-radius: 8px;
    padding: 3px;
}
.monitor-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--gray-500);
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}
.monitor-tab:hover { color: var(--gray-700); background: var(--gray-200); }
.monitor-tab.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.monitor-tab-icon { font-size: 16px; }

/* ===== Dashboard Two-Column Rows ===== */
.dash-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.dash-col { flex: 1; min-width: 320px; }
.dash-col-main { flex: 3; }
.dash-col-side { flex: 2; }

/* Card header with title + action */
.card-hd-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.card-hd-row h3 { margin-bottom: 0; }

/* ===== Mini Stats (compact inline stat indicators) ===== */
.dash-mini-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.dash-mini-stat {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 12px 8px;
    background: var(--gray-50);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: all var(--transition);
    border: 1px solid transparent;
}
a.dash-mini-stat:hover { background: #fff; border-color: var(--gray-200); box-shadow: var(--shadow-xs); }
.dash-mini-num { display: block; font-size: 22px; font-weight: 800; line-height: 1.2; color: var(--gray-900); }
.dash-mini-label { display: block; font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.dash-mini-green .dash-mini-num { color: #059669; }
.dash-mini-orange .dash-mini-num { color: #D97706; }
.dash-mini-red .dash-mini-num { color: #DC2626; }

/* ===== Compact Feedback List ===== */
.dash-feedback-compact {
    border-top: 1px solid var(--gray-100);
    padding-top: 10px;
}
.dash-fb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-50);
    flex-wrap: wrap;
}
.dash-fb-item:last-child { border-bottom: none; }
.dash-fb-course { font-weight: 600; color: var(--gray-800); }
.dash-fb-class { color: var(--gray-500); font-size: 12px; }
.dash-fb-ta { color: var(--gray-500); font-size: 12px; margin-left: auto; }
.dash-fb-time { color: var(--gray-400); font-size: 12px; white-space: nowrap; }

/* ===== Urgent List ===== */
.dash-urgent-list { display: flex; flex-direction: column; }
.dash-urgent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-50);
    text-decoration: none;
    color: inherit;
    gap: 10px;
    transition: background .1s;
}
.dash-urgent-item:hover { background: var(--gray-50); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 6px; }
.dash-urgent-item:last-child { border-bottom: none; }
.dash-urgent-info { min-width: 0; }
.dash-urgent-info strong { display: block; font-size: 13px; }
.dash-urgent-info span { display: block; }
.dash-urgent-meta { text-align: right; flex-shrink: 0; }
.dash-urgent-time { display: block; font-size: 12px; color: var(--danger); font-weight: 500; }

/* ===== Compact Tables ===== */
.table-sm { font-size: 13px; }
.table-sm th { padding: 6px 10px; font-size: 11px; }
.table-sm td { padding: 6px 10px; }

/* ===== Bar Cell (progress bar + text inline) ===== */
.dash-bar-cell { display: flex; align-items: center; gap: 8px; }

/* ===== Activity List ===== */
.dash-activity-list { display: flex; flex-direction: column; }
.dash-activity-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-50);
    font-size: 13px;
}
.dash-activity-item:last-child { border-bottom: none; }
.dash-activity-icon { font-size: 18px; line-height: 1; flex-shrink: 0; color: var(--primary); }
.dash-activity-body { flex: 1; min-width: 0; }
.dash-activity-time { font-size: 11px; color: var(--gray-400); white-space: nowrap; flex-shrink: 0; }

/* ===== System Monitor ===== */
.sys-section-title { font-size: 14px; }
.sys-card-padded { padding: 20px; }
.sys-stat-card { padding: 20px; text-align: center; }
.sys-stat-icon-lg { font-size: 28px; }
.sys-stat-value-lg { font-size: 24px; }
.sys-disk-stat { font-size: 20px; font-weight: 700; }
.sys-disk-bar { background: #E5E7EB; border-radius: 8px; height: 20px; overflow: hidden; }
.sys-disk-fill { height: 100%; border-radius: 8px; transition: width 0.5s; }
.sys-info-value { font-weight: 500; }
.sys-min-w200 { min-width: 200px; }
.sys-bar { background: #E5E7EB; border-radius: 6px; height: 10px; overflow: hidden; }
.sys-bar-fill { height: 100%; border-radius: 6px; transition: width 0.5s; }
.sys-cleanup-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sys-icon-ok { color: #10B981; }
.sys-icon-warn { color: #F59E0B; }
.sys-icon-danger { color: #EF4444; }

/* Responsive: stack columns on narrow screens */
@media (max-width: 768px) {
    .dash-row { flex-direction: column; }
    .dash-col-main, .dash-col-side { flex: 1; }
    .dash-mini-stats { flex-wrap: wrap; }
    .dash-mini-stat { flex: 1 1 40%; min-width: 70px; }
}

/* ===== Evaluation Tabs (Teacher Class Detail) ===== */
.eval-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: var(--space-5);
}
.eval-tabs .tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    font-family: inherit;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.35;
}
.eval-tabs .tab-btn .en {
    font-size: 0.78em;
    font-weight: 400;
    opacity: 0.6;
}
.eval-tabs .tab-btn:hover {
    color: var(--gray-700);
}
.eval-tabs .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== Gradebook Matrix Table ===== */
.matrix-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.gradebook-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 600px;
}
.gradebook-table th {
    text-align: center;
    padding: 10px 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--gray-50);
    border-bottom: 1.5px solid var(--gray-200);
    white-space: nowrap;
}
.gradebook-table td {
    padding: 0;
    border-bottom: 1px solid var(--gray-50);
    text-align: center;
    vertical-align: middle;
}
.gradebook-table tbody tr:hover td {
    background: #FAFAFE;
}
.gb-student {
    text-align: left !important;
    padding: 10px 14px !important;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
}
.gradebook-table tbody tr:hover .gb-student {
    background: #FAFAFE;
}
.gb-cell {
    width: 64px;
    min-width: 56px;
    max-width: 80px;
    height: 48px;
}
.gb-cell a, .gb-cell span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    padding: 4px;
}
.gb-graded a {
    color: var(--success);
    background: var(--success-light);
}
.gb-graded a:hover {
    background: #D1FAE5;
    color: #047857;
}
.gb-submitted a {
    color: #D97706;
    background: #FFFBEB;
}
.gb-submitted a:hover {
    background: #FEF3C7;
    color: #B45309;
}
.gb-empty span {
    color: var(--gray-300);
    font-weight: 400;
}

/* ===== Feedback Cards (Teacher Class Detail) ===== */
.feedback-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.feedback-card {
    background: #fff;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow-xs);
}
.feedback-card:hover {
    border-color: var(--gray-200);
    box-shadow: var(--shadow);
}
.feedback-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition);
}
.feedback-card-header:hover {
    background: var(--gray-50);
}
.fb-lesson-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}
.fb-lesson-title {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
    min-width: 0;
}
.fb-toggle-icon {
    font-size: 11px;
    color: var(--gray-400);
    transition: transform var(--transition);
    flex-shrink: 0;
}
.feedback-card-body {
    display: none;
    padding: 0 18px 18px;
    border-top: 1px solid var(--gray-100);
}
.feedback-card-body .fb-form {
    padding-top: 14px;
}
.feedback-card-body .fb-form .form-group {
    margin-bottom: var(--space-3);
}
.feedback-card-body .fb-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 90px;
    transition: border-color var(--transition);
}
.feedback-card-body .fb-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}

/* Responsive tweaks for evaluation pages */
@media (max-width: 768px) {
    .eval-tabs .tab-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
    .gradebook-table {
        font-size: 12px;
        min-width: 480px;
    }
    .gb-cell {
        width: 48px;
        min-width: 44px;
    }
    .feedback-card-header {
        padding: 12px 14px;
        gap: 8px;
    }
    .fb-lesson-title {
        font-size: 13px;
    }
}

/* ========== Teacher Dashboard: Breakdown List ========== */
.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--gray-800);
    transition: background 0.15s;
}
.breakdown-item:hover {
    background: var(--gray-50);
    text-decoration: none;
}
.breakdown-label {
    flex: 1;
    font-weight: 500;
}
.breakdown-count {
    color: #EA580C;
    font-weight: 600;
    font-size: 13px;
}
.breakdown-arrow {
    color: var(--gray-400);
    font-size: 14px;
}

/* ========== Stat Card Danger ========== */
.stat-card-danger {
    border-left: 3px solid #EF4444;
}
.stat-card-danger:hover {
    background: #FEF2F2;
}

/* ========== CC Eval Status ========== */
.cc-eval-status {
    padding: 6px 0 10px;
    font-size: 12px;
}

/* ========== Evaluation Form ========== */
.eval-student-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--gray-25, #FAFBFC);
}
.eval-student-card h4.eval-student-name {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
}
.eval-student-card textarea {
    min-height: 80px;
}

/* ========== Evaluation Display (class_detail Tab 2) ========== */
.eval-student-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.eval-student-item {
    border-bottom: 1px solid var(--gray-100);
    padding-bottom: 12px;
}
.eval-student-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.eval-student-item .eval-student-name {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}
.eval-text {
    color: var(--gray-700);
    line-height: 1.6;
    font-size: 13px;
}

/* ========== Card Title ========== */
.card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-100);
}

/* ========== Star Rating (Eval Widget) ========== */
.eval-hint {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 16px;
    padding: 8px 12px;
    background: rgba(37, 99, 235, 0.04);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}
.eval-cat-group {
    margin-bottom: 12px;
}
.eval-cat-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--gray-100);
}
.eval-star-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
}
.eval-star-label {
    font-size: 13px;
    color: var(--gray-700);
    flex: 1;
}
.eval-stars {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.eval-star-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--gray-300);
    cursor: pointer;
    padding: 0 1px;
    transition: color 0.15s, transform 0.15s;
    line-height: 1;
}
.eval-star-btn.active,
.eval-star-btn.hover {
    color: #f59e0b;
}
.eval-star-btn:hover {
    transform: scale(1.2);
}
.dim-inactive {
    opacity: 0.45;
}
.eval-mini-chip {
    display: inline-block;
    padding: 1px 7px;
    background: rgba(37,99,235,0.08);
    color: var(--primary);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin: 1px;
}

/* ========== Eval Entry Card (Assignment Page Sidebar) ========== */
.eval-entry-card {
    text-align: center;
    padding: 24px 20px;
}
.eval-entry-desc {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 18px;
    line-height: 1.6;
}
.eval-entry-btn {
    width: 100%;
    font-size: 15px;
    padding: 12px 20px;
    font-weight: 700;
}

/* ========== Standalone Evaluation Page ========== */
.eval-page-container {
    max-width: 720px;
}

.eval-lesson-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-xs);
    margin-bottom: 24px;
}

.eval-lesson-icon {
    font-size: 36px;
    line-height: 1;
    flex-shrink: 0;
}

.eval-lesson-info {
    flex: 1;
    min-width: 0;
}

.eval-lesson-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.4;
}

.eval-lesson-meta {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.eval-saved-badge {
    flex-shrink: 0;
    padding: 4px 12px;
    background: #ECFDF5;
    color: #059669;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Category Card */
.eval-category-card {
    margin-bottom: 20px;
}

.eval-cat-heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gray-100);
}

/* Dimension Row */
.eval-dimensions {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.eval-dim-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.eval-dim-row:hover {
    background: var(--gray-50);
}

.eval-dim-label {
    flex: 1;
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
    min-width: 0;
}

.eval-dim-label .bi {
    display: inline-flex !important;
    flex-direction: column !important;
    gap: 1px !important;
    line-height: 1.3 !important;
}

.eval-dim-label .bi .zh {
    font-size: 14px;
    font-weight: 600;
}

.eval-dim-label .bi .en {
    font-size: 11px;
    font-weight: 400;
    color: #9CA3AF;
}

.eval-dim-row .eval-stars {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.eval-dim-row .eval-star-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--gray-200);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.12s, transform 0.12s;
}

.eval-dim-row .eval-star-btn.active,
.eval-dim-row .eval-star-btn.hover {
    color: #F59E0B;
}

.eval-dim-row .eval-star-btn:hover {
    transform: scale(1.15);
}

.eval-dim-score {
    width: 36px;
    text-align: right;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-500);
    flex-shrink: 0;
}

/* Comment Card */
.eval-comment-card {
    margin-bottom: 20px;
}

.eval-comment-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.7;
    resize: vertical;
    min-height: 100px;
    transition: border-color var(--transition);
    box-sizing: border-box;
}

.eval-comment-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,0.08);
}

/* Save Bar */
.eval-save-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0 40px;
}

.eval-status-text {
    font-size: 13px;
    color: var(--gray-500);
}

@media (max-width: 768px) {
    .eval-lesson-card {
        flex-wrap: wrap;
        gap: 12px;
    }
    .eval-dim-row {
        gap: 10px;
        padding: 12px 8px;
    }
    .eval-dim-label .bi .zh {
        font-size: 13px;
    }
    .eval-dim-row .eval-star-btn {
        font-size: 24px;
    }
    .eval-save-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .eval-save-bar .btn {
        width: 100%;
    }
}

/* ========== Eval Bars (Teacher/TA My Evals) ========== */
.eval-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.eval-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.eval-bar-label {
    width: 160px;
    font-size: 13px;
    color: var(--gray-700);
    text-align: right;
    flex-shrink: 0;
}
.eval-bar-track {
    flex: 1;
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}
.eval-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s;
}
.eval-bar-score {
    font-weight: 700;
    color: var(--primary);
    min-width: 36px;
}
.eval-bar-max {
    color: var(--gray-400);
    font-weight: 400;
}
.eval-bar-n {
    font-size: 12px;
    color: var(--gray-400);
    min-width: 30px;
}
.eval-comments-title {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 14px;
}
.eval-comments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}
.eval-comment-item {
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
}
.eval-comment-date {
    font-size: 11px;
    color: var(--gray-400);
    margin-bottom: 4px;
}
