/* =====================================================================
   Teacher Dark Mode Overrides
   Quality Dashboard (.tq-*) + Certification (.tcert-*, .tccourse-*,
   .tcmod-*, .tcchap-*, .tcquiz-*)
   ===================================================================== */

/* ── Quality Dashboard: Hero ── */
[data-theme="dark"] .tq-hero {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .tq-score-ring {
    background: conic-gradient(var(--ring-color) calc(var(--pct) * 3.6deg), #334155 0);
}
[data-theme="dark"] .tq-score-inner {
    background: #1e293b;
}
[data-theme="dark"] .tq-score-num {
    color: #e2e8f0;
}
[data-theme="dark"] .tq-score-of {
    color: #94a3b8;
}
[data-theme="dark"] .tq-provisional-badge {
    background: rgba(254,249,195,.12);
    color: #fbbf24;
}
[data-theme="dark"] .tq-cert-badge {
    /* Override inline bg/color via specificity boost */
}
[data-theme="dark"] .tq-cert-next {
    color: #94a3b8;
}

/* ── Quality Dashboard: Tier Progress ── */
[data-theme="dark"] .tq-tier-progress-label {
    color: #94a3b8;
}
[data-theme="dark"] .tq-tier-progress-pct {
    color: #cbd5e1;
}
[data-theme="dark"] .tq-tier-progress-bar {
    background: #334155;
}

/* ── Quality Dashboard: Component Cards ── */
[data-theme="dark"] .tq-comp-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .tq-comp-header h3 {
    color: #e2e8f0;
}
[data-theme="dark"] .tq-comp-sub {
    color: #94a3b8;
}
[data-theme="dark"] .tq-comp-pts {
    color: #e2e8f0;
}
[data-theme="dark"] .tq-comp-max {
    color: #94a3b8;
}
[data-theme="dark"] .tq-progress-bar {
    background: #334155;
}
[data-theme="dark"] .tq-comp-detail {
    color: #94a3b8;
}
[data-theme="dark"] .tq-comp-icon[style*="background:#eff6ff"] {
    background: rgba(37,99,235,.15) !important;
}
[data-theme="dark"] .tq-comp-icon[style*="background:#fef9c3"] {
    background: rgba(202,138,4,.15) !important;
}
[data-theme="dark"] .tq-comp-icon[style*="background:#f0fdf4"] {
    background: rgba(22,163,74,.15) !important;
}
[data-theme="dark"] .tq-comp-icon[style*="background:#fdf2f8"] {
    background: rgba(219,39,119,.15) !important;
}

/* ── Stars breakdown ── */
[data-theme="dark"] .tq-star-label {
    color: #94a3b8;
}
[data-theme="dark"] .tq-star-bar {
    background: #334155;
}
[data-theme="dark"] .tq-star-cnt {
    color: #94a3b8;
}

/* ── Tags ── */
[data-theme="dark"] .tq-tag {
    background: #334155;
    color: #cbd5e1;
}

/* ── Reviews ── */
[data-theme="dark"] .tq-review-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .tq-review-date {
    color: #94a3b8;
}
[data-theme="dark"] .tq-review-text {
    color: #cbd5e1;
}
[data-theme="dark"] .tq-review-by {
    color: #94a3b8;
}

/* ── Bar Chart ── */
[data-theme="dark"] .tq-chart-wrap {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .tq-bar-value {
    color: #cbd5e1;
}
[data-theme="dark"] .tq-bar-label {
    color: #94a3b8;
}

/* ── Evaluation Cards ── */
[data-theme="dark"] .tq-eval-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .tq-eval-student {
    color: #e2e8f0;
}
[data-theme="dark"] .tq-eval-date {
    color: #94a3b8;
}
[data-theme="dark"] .tq-eval-view-btn {
    background: rgba(37,99,235,.15);
    color: #60a5fa;
    border-color: rgba(37,99,235,.3);
}
[data-theme="dark"] .tq-eval-view-btn:hover {
    background: rgba(37,99,235,.25);
}
[data-theme="dark"] .tq-eval-score-item {
    background: #0f172a;
    border-color: #1e293b;
}
[data-theme="dark"] .tq-eval-score-label {
    color: #94a3b8;
}
[data-theme="dark"] .tq-eval-score-bar {
    background: #334155;
}
[data-theme="dark"] .tq-eval-vn {
    color: #94a3b8;
}
[data-theme="dark"] .tq-eval-vn strong {
    color: #cbd5e1;
}
/* Flag backgrounds in dark mode */
[data-theme="dark"] .tq-eval-flag[style*="background:#fef2f2"],
[data-theme="dark"] .tq-eval-flag[style*="background: #fef2f2"] {
    background: rgba(220,38,38,.15) !important;
    border-color: rgba(220,38,38,.3) !important;
}
[data-theme="dark"] .tq-eval-flag[style*="background:#fefce8"],
[data-theme="dark"] .tq-eval-flag[style*="background: #fefce8"] {
    background: rgba(202,138,4,.15) !important;
    border-color: rgba(202,138,4,.3) !important;
}
[data-theme="dark"] .tq-eval-flag[style*="background:#f0fdf4"],
[data-theme="dark"] .tq-eval-flag[style*="background: #f0fdf4"] {
    background: rgba(22,163,74,.15) !important;
    border-color: rgba(22,163,74,.3) !important;
}
[data-theme="dark"] .tq-eval-flag[style*="background:#f9fafb"],
[data-theme="dark"] .tq-eval-flag[style*="background: #f9fafb"] {
    background: rgba(107,114,128,.15) !important;
    border-color: rgba(107,114,128,.3) !important;
}
/* Flag reasons background */
[data-theme="dark"] .tq-eval-flags[style*="background:#fef2f2"] {
    background: rgba(220,38,38,.1) !important;
}
[data-theme="dark"] .tq-eval-flags[style*="background:#fefce8"] {
    background: rgba(202,138,4,.1) !important;
}
[data-theme="dark"] .tq-eval-flags[style*="background:#f0fdf4"] {
    background: rgba(22,163,74,.1) !important;
}
[data-theme="dark"] .tq-eval-flags[style*="background:#f9fafb"] {
    background: rgba(107,114,128,.1) !important;
}

/* Impact badges */
[data-theme="dark"] .tq-eval-impact[style*="background:#f0fdf4"] {
    background: rgba(22,163,74,.15) !important;
}
[data-theme="dark"] .tq-eval-impact[style*="background:#fef2f2"] {
    background: rgba(220,38,38,.15) !important;
}

/* ── Coaching Tips ── */
[data-theme="dark"] .tq-coaching-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .tq-coaching--great {
    background: rgba(22,163,74,.1);
    border-color: rgba(22,163,74,.3);
}
[data-theme="dark"] .tq-coaching--great p {
    color: #cbd5e1;
}
[data-theme="dark"] .tq-coaching-area {
    color: #e2e8f0;
}
[data-theme="dark"] .tq-coaching-bar {
    background: #334155;
}
[data-theme="dark"] .tq-coaching-tip {
    color: #cbd5e1;
}

/* ── VN Summary ── */
[data-theme="dark"] .tq-vn-item {
    background: rgba(124,58,237,.1);
    border-color: rgba(124,58,237,.25);
}
[data-theme="dark"] .tq-vn-label {
    color: #94a3b8;
}
[data-theme="dark"] .tq-vn-tip {
    color: #cbd5e1;
}

/* ── Teacher Ranking ── */
[data-theme="dark"] .tq-ranking-list {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .tq-rank-row:hover {
    background: #0f172a;
}
[data-theme="dark"] .tq-rank-row--me {
    background: rgba(37,99,235,.12);
}
[data-theme="dark"] .tq-rank-row--me:hover {
    background: rgba(37,99,235,.2);
}
[data-theme="dark"] .tq-rank-avatar {
    background: #334155;
}
[data-theme="dark"] .tq-rank-avatar span {
    color: #94a3b8;
}
[data-theme="dark"] .tq-rank-name {
    color: #e2e8f0;
}
[data-theme="dark"] .tq-rank-tier-label {
    color: #94a3b8;
}
[data-theme="dark"] .tq-rank-row[style*="border-top"] {
    border-color: #334155 !important;
}

/* ── Cert Modules (on quality dashboard) ── */
[data-theme="dark"] .tq-module-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .tq-module-card h4 {
    color: #e2e8f0;
}
[data-theme="dark"] .tq-module--passed {
    border-color: rgba(22,163,74,.3);
    background: rgba(22,163,74,.08);
}
[data-theme="dark"] .tq-module-progress-badge {
    background: rgba(37,99,235,.15);
    color: #60a5fa;
}
[data-theme="dark"] .tq-module-progress-badge--pending {
    background: #334155;
    color: #94a3b8;
}
[data-theme="dark"] .tq-module-score {
    color: #94a3b8;
}
[data-theme="dark"] .tq-module-check {
    color: #22c55e;
}

/* ── Achievement Badges ── */
[data-theme="dark"] .tq-badge-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .tq-badge-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
[data-theme="dark"] .tq-badge-card--earned {
    background: rgba(251,191,36,.08);
    border-color: rgba(251,191,36,.25);
}
[data-theme="dark"] .tq-badge-icon-wrap {
    background: #334155;
    color: #94a3b8;
}
[data-theme="dark"] .tq-badge-icon--earned {
    background: rgba(180,83,9,.15);
    color: #fbbf24;
}
[data-theme="dark"] .tq-badge-name {
    color: #e2e8f0;
}
[data-theme="dark"] .tq-badge-desc {
    color: #94a3b8;
}
[data-theme="dark"] .tq-badge-earned-label {
    background: rgba(22,163,74,.12);
    color: #22c55e;
    border-color: rgba(22,163,74,.3);
}
[data-theme="dark"] .tq-badge-progress-bar {
    background: #334155;
}
[data-theme="dark"] .tq-badge-progress-text {
    color: #94a3b8;
}

/* ── Feedback Preview & Button ── */
[data-theme="dark"] .tq-eval-feedback {
    background: #0f172a;
    border-color: #334155;
}
[data-theme="dark"] .tq-eval-feedback-preview {
    color: #94a3b8;
}
[data-theme="dark"] .tq-eval-feedback-btn {
    background: rgba(37,99,235,.15);
    color: #60a5fa;
    border-color: rgba(37,99,235,.3);
}
[data-theme="dark"] .tq-eval-feedback-btn:hover {
    background: rgba(37,99,235,.25);
}

/* ── Feedback Modal ── */
[data-theme="dark"] .tq-fb-modal {
    background: rgba(0,0,0,0.7);
}
[data-theme="dark"] .tq-fb-modal-inner {
    background: #1e293b;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
[data-theme="dark"] .tq-fb-modal-header {
    border-bottom-color: #334155;
}
[data-theme="dark"] .tq-fb-modal-header h3 {
    color: #e2e8f0;
}
[data-theme="dark"] .tq-fb-modal-meta {
    color: #94a3b8;
}
[data-theme="dark"] .tq-fb-modal-close {
    background: #334155;
    color: #94a3b8;
}
[data-theme="dark"] .tq-fb-modal-close:hover {
    background: #475569;
    color: #e2e8f0;
}
[data-theme="dark"] .tq-fb-modal-body {
    color: #cbd5e1;
}

/* ── Language Toggle ── */
[data-theme="dark"] .tq-fb-lang-toggle {
    border-color: #334155;
}
[data-theme="dark"] .tq-fb-lang-btn {
    background: #0f172a;
    color: #94a3b8;
}
[data-theme="dark"] .tq-fb-lang-btn--active {
    background: #2563eb;
    color: #fff;
}

/* ── Feedback Sections ── */
[data-theme="dark"] .tq-fb-section-header--blue {
    background: rgba(37,99,235,.15);
    color: #60a5fa;
}
[data-theme="dark"] .tq-fb-section-header--green {
    background: rgba(22,163,74,.15);
    color: #4ade80;
}
[data-theme="dark"] .tq-fb-section-header--amber {
    background: rgba(202,138,4,.15);
    color: #fbbf24;
}
[data-theme="dark"] .tq-fb-section-header--red {
    background: rgba(220,38,38,.15);
    color: #f87171;
}
[data-theme="dark"] .tq-fb-section-header--purple {
    background: rgba(147,51,234,.15);
    color: #c084fc;
}


/* =====================================================================
   Certification Overview (.tcert-*)
   ===================================================================== */

/* ── Hero ── */
[data-theme="dark"] .tcert-hero {
    background: #0f172a;
}
[data-theme="dark"] .tcert-hero h1 {
    color: #f1f5f9;
}
[data-theme="dark"] .tcert-hero p {
    color: rgba(255,255,255,.65);
}
[data-theme="dark"] .tcert-progress-bar-track {
    background: rgba(255,255,255,.12);
}
[data-theme="dark"] .tcert-progress-bar-wrap span {
    color: rgba(255,255,255,.55);
}
[data-theme="dark"] .tcert-hero-badge-label {
    background: rgba(230,57,70,.2);
    color: #f87171;
}

/* ── Module Cards ── */
[data-theme="dark"] .tcert-module-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .tcert-module-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    border-color: #475569;
}
[data-theme="dark"] .tcert-module-card--complete {
    border-color: rgba(230,57,70,.3);
}
[data-theme="dark"] .tcert-module-card--in-progress {
    border-color: rgba(69,123,157,.35);
}
[data-theme="dark"] .tcert-module-card--expired {
    border-color: rgba(220,38,38,.3);
    background: rgba(220,38,38,.05);
}
[data-theme="dark"] .tcert-module-card--complete .tcert-module-icon {
    background: rgba(230,57,70,.12);
}
[data-theme="dark"] .tcert-module-card--in-progress .tcert-module-icon {
    background: rgba(69,123,157,.15);
}
[data-theme="dark"] .tcert-module-card--locked .tcert-module-icon {
    background: #334155;
    color: #64748b;
}
[data-theme="dark"] .tcert-module-card--expired .tcert-module-icon {
    background: rgba(220,38,38,.12);
}

[data-theme="dark"] .tcert-module-body h3 {
    color: #e2e8f0;
}
[data-theme="dark"] .tcert-module-body p {
    color: #94a3b8;
}
[data-theme="dark"] .tcert-module-score {
    color: #94a3b8;
}

/* Status pills */
[data-theme="dark"] .tcert-module-status-pill--complete {
    background: rgba(230,57,70,.12);
}
[data-theme="dark"] .tcert-module-status-pill--in-progress {
    background: rgba(69,123,157,.15);
}
[data-theme="dark"] .tcert-module-status-pill--locked {
    background: #334155;
    color: #64748b;
}
[data-theme="dark"] .tcert-module-status-pill--expired {
    background: rgba(220,38,38,.15);
}
[data-theme="dark"] .tcert-module-status-pill--expiring {
    background: rgba(202,138,4,.15);
    color: #fbbf24;
}

[data-theme="dark"] .tcert-validity-info {
    color: #64748b;
}
[data-theme="dark"] .tcert-expiry-warn {
    color: #f87171;
}

/* ── Section Divider ── */
[data-theme="dark"] .tcert-section-divider {
    border-top-color: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .tcert-section-divider p {
    color: #94a3b8;
}

/* ── Elite Requirements Card ── */
[data-theme="dark"] .tcert-elite-card {
    background: linear-gradient(135deg, rgba(230,57,70,.06) 0%, #1e293b 100%);
    border-color: rgba(230,57,70,.2);
}
[data-theme="dark"] .tcert-elite-icon {
    background: rgba(230,57,70,.12);
}
[data-theme="dark"] .tcert-elite-body strong {
    color: #e2e8f0;
}
[data-theme="dark"] .tcert-elite-body li {
    color: #94a3b8;
}


/* =====================================================================
   Certification Course Page (.tccourse-*)
   ===================================================================== */

/* ── Chapter Cards ── */
[data-theme="dark"] .tccourse-chapter-card {
    background: #1e293b;
    border-color: #334155;
    color: inherit;
}
[data-theme="dark"] .tccourse-chapter-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    border-color: #475569;
}
[data-theme="dark"] .tccourse-chapter--done {
    border-color: rgba(16,185,129,.3);
}
[data-theme="dark"] .tccourse-chapter--current {
    border-color: rgba(220,38,38,.35);
}
[data-theme="dark"] .tccourse-chapter-num {
    background: #334155;
    color: #64748b;
}
[data-theme="dark"] .tccourse-chapter--done .tccourse-chapter-num {
    background: rgba(16,185,129,.15);
    color: #34d399;
}
[data-theme="dark"] .tccourse-chapter--current .tccourse-chapter-num {
    background: rgba(220,38,38,.12);
}
[data-theme="dark"] .tccourse-chapter-body h3 {
    color: #e2e8f0;
}
[data-theme="dark"] .tccourse-chapter-body p {
    color: #94a3b8;
}
[data-theme="dark"] .tccourse-chapter-meta {
    color: #64748b;
}
[data-theme="dark"] .tccourse-review-btn {
    color: #64748b;
    border-color: #334155;
}


/* =====================================================================
   Certification Module Content (.tcmod-*)
   ===================================================================== */

[data-theme="dark"] .tcmod-header h1 {
    color: #e2e8f0;
}
[data-theme="dark"] .tcmod-header p {
    color: #94a3b8;
}

/* Status badges */
[data-theme="dark"] .tcmod-status-badge--passed {
    background: rgba(16,185,129,.15);
    color: #34d399;
}
[data-theme="dark"] .tcmod-status-badge--failed {
    background: rgba(202,138,4,.15);
    color: #fbbf24;
}

/* Content body */
[data-theme="dark"] .tcmod-content {
    background: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
[data-theme="dark"] .tcmod-content h2 {
    color: #e2e8f0;
    border-top-color: #334155;
}
[data-theme="dark"] .tcmod-content h3 {
    color: #e2e8f0;
}
[data-theme="dark"] .tcmod-content strong {
    color: #e2e8f0;
}
[data-theme="dark"] .tcmod-content th {
    background: #0f172a;
    color: #e2e8f0;
}
[data-theme="dark"] .tcmod-content td {
    border-top-color: #334155;
    color: #cbd5e1;
}
[data-theme="dark"] .tcmod-content blockquote {
    background: rgba(220,38,38,.06);
    border-left-color: var(--primary);
}


/* =====================================================================
   Certification Chapter Reader (.tcchap-*)
   ===================================================================== */

[data-theme="dark"] .tcchap-header h1 {
    color: #e2e8f0;
}

[data-theme="dark"] .tcchap-status-badge {
    /* Generic override */
}
[data-theme="dark"] .tcchap-status--done {
    background: rgba(16,185,129,.15);
    color: #34d399;
}

[data-theme="dark"] .tcchap-nav-link {
    color: #94a3b8;
}
[data-theme="dark"] .tcchap-nav-link:hover {
    color: #e2e8f0;
}
[data-theme="dark"] .tcchap-next-preview {
    color: #64748b;
}


/* =====================================================================
   Certification Quiz (.tcquiz-*)
   ===================================================================== */

[data-theme="dark"] .tcquiz-header h1 {
    color: #e2e8f0;
}
[data-theme="dark"] .tcquiz-header p {
    color: #64748b;
}

/* Status pills */
[data-theme="dark"] .tcquiz-passed-pill {
    background: rgba(16,185,129,.15);
    color: #34d399;
}
[data-theme="dark"] .tcquiz-failed-pill {
    background: rgba(202,138,4,.15);
    color: #fbbf24;
}
[data-theme="dark"] .tcquiz-expired-pill {
    background: rgba(220,38,38,.15);
    color: #f87171;
}

/* Question cards */
[data-theme="dark"] .tcquiz-question {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
[data-theme="dark"] .tcquiz-question-text {
    color: #e2e8f0;
}

/* Type hint */
[data-theme="dark"] .tcquiz-type-hint {
    background: rgba(230,57,70,.08);
    border-color: rgba(230,57,70,.15);
}

/* Options (multiple choice / multi-select) */
[data-theme="dark"] .tcquiz-option {
    border-color: #334155;
}
[data-theme="dark"] .tcquiz-option:hover {
    border-color: rgba(230,57,70,.4);
    background: rgba(230,57,70,.06);
}
[data-theme="dark"] .tcquiz-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(230,57,70,.1);
}
[data-theme="dark"] .tcquiz-option-label {
    color: #cbd5e1;
}
[data-theme="dark"] .tcquiz-option input:checked + .tcquiz-option-label {
    color: #e2e8f0;
}
[data-theme="dark"] .tcquiz-option input[type="checkbox"] {
    border-color: #475569;
}

/* Ordering */
[data-theme="dark"] .tcquiz-order-item {
    border-color: #334155;
    background: #1e293b;
}
[data-theme="dark"] .tcquiz-order-item:hover {
    border-color: #475569;
}
[data-theme="dark"] .tcquiz-order-item.tcquiz-drag-over {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(69,123,157,.2);
}
[data-theme="dark"] .tcquiz-order-handle {
    color: #475569;
}
[data-theme="dark"] .tcquiz-order-text {
    color: #cbd5e1;
}
[data-theme="dark"] .tcquiz-arrow-up,
[data-theme="dark"] .tcquiz-arrow-down {
    border-color: #334155;
    color: #64748b;
}
[data-theme="dark"] .tcquiz-arrow-up:hover,
[data-theme="dark"] .tcquiz-arrow-down:hover {
    border-color: var(--accent);
    color: #e2e8f0;
}

/* Categorize */
[data-theme="dark"] .tcquiz-cat-pool {
    border-color: #334155;
}
[data-theme="dark"] .tcquiz-cat-pool.tcquiz-drop-hover {
    background: rgba(69,123,157,.08);
}
[data-theme="dark"] .tcquiz-cat-pool-label {
    color: #64748b;
}
[data-theme="dark"] .tcquiz-cat-pool:empty::after {
    color: #475569;
}
[data-theme="dark"] .tcquiz-cat-item {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .tcquiz-cat-item:hover {
    border-color: #475569;
}
[data-theme="dark"] .tcquiz-cat-item.tcquiz-item-selected {
    border-color: var(--accent);
    background: rgba(37,99,235,.1);
}
[data-theme="dark"] .tcquiz-cat-bucket {
    border-color: #334155;
}
[data-theme="dark"] .tcquiz-cat-bucket-zone {
    background: #0f172a;
}
[data-theme="dark"] .tcquiz-cat-bucket-zone:empty::after {
    color: #475569;
}
[data-theme="dark"] .tcquiz-cat-bucket-zone.tcquiz-drop-hover {
    background: rgba(69,123,157,.1);
}

/* True/False */
[data-theme="dark"] .tcquiz-tf-card {
    border-color: #334155;
    color: #cbd5e1;
}
[data-theme="dark"] .tcquiz-tf-true:hover {
    border-color: #16a34a;
    background: rgba(22,163,74,.08);
}
[data-theme="dark"] .tcquiz-tf-false:hover {
    border-color: #dc2626;
    background: rgba(220,38,38,.08);
}
[data-theme="dark"] .tcquiz-tf-true:has(input:checked) {
    border-color: #16a34a;
    background: rgba(22,163,74,.12);
    color: #4ade80;
}
[data-theme="dark"] .tcquiz-tf-false:has(input:checked) {
    border-color: #dc2626;
    background: rgba(220,38,38,.12);
    color: #f87171;
}

/* Matching */
[data-theme="dark"] .tcquiz-match-item {
    border-color: #334155;
    background: #1e293b;
}
[data-theme="dark"] .tcquiz-match-item:hover {
    border-color: #475569;
}
[data-theme="dark"] .tcquiz-match-item.tcquiz-m-selected {
    border-color: var(--accent);
    background: rgba(37,99,235,.1);
}
[data-theme="dark"] .tcquiz-match-item.tcquiz-m-paired {
    border-color: #16a34a;
    background: rgba(22,163,74,.1);
}
[data-theme="dark"] .tcquiz-match-text {
    color: #cbd5e1;
}


/* =====================================================================
   Shared / Cross-page overrides
   ===================================================================== */

/* Breadcrumb (defined in cert-overview but used across cert pages) */
[data-theme="dark"] .teacher-breadcrumb {
    color: #64748b;
}
[data-theme="dark"] .teacher-breadcrumb a {
    color: #60a5fa;
}
[data-theme="dark"] .teacher-breadcrumb a:hover {
    color: #e2e8f0;
}

/* Cert badge display variants (on hero) */
[data-theme="dark"] .tcert-badge--none {
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.35);
    border-color: rgba(255,255,255,.08);
}

/* Inline style overrides for cert-badge backgrounds via specificity */
[data-theme="dark"] .tq-cert-badge[style*="background:#f3f4f6"] {
    background: #334155 !important;
}
[data-theme="dark"] .tq-cert-badge[style*="background:#eff6ff"] {
    background: rgba(37,99,235,.15) !important;
}
[data-theme="dark"] .tq-cert-badge[style*="background:#f0fdf4"] {
    background: rgba(22,163,74,.15) !important;
}
[data-theme="dark"] .tq-cert-badge[style*="background:#faf5ff"] {
    background: rgba(147,51,234,.15) !important;
}

/* ── Missing cert-overview badge variants ── */
[data-theme="dark"] .tcert-badge--certified { background: rgba(220,38,38,.15); color: #fca5a5; }
[data-theme="dark"] .tcert-badge--elite     { background: rgba(251,191,36,.15); color: #fbbf24; }
[data-theme="dark"] .tcert-req--met         { color: #6ee7b7; }

/* ── Missing cert-course (.tccourse-*) ── */
[data-theme="dark"] .tccourse-hero          { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .tccourse-badge-label   { color: #fca5a5; }
[data-theme="dark"] .tccourse-meta          { color: #94a3b8; }
[data-theme="dark"] .tccourse-ring-label    { color: #e2e8f0; }
[data-theme="dark"] .tccourse-start-btn     { background: #dc2626; color: #fff; }
[data-theme="dark"] .tccourse-quiz-cta      { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .tccourse-quiz-cta--locked { background: #0f172a; border-color: #334155; opacity: .6; }
[data-theme="dark"] .tccourse-quiz-icon     { background: rgba(220,38,38,.15); color: #f87171; }
[data-theme="dark"] .tccourse-quiz-text     { color: #cbd5e1; }
[data-theme="dark"] .tccourse-quiz-text strong { color: #e2e8f0; }

/* ── Missing cert-chapter (.tcchap-*) ── */
[data-theme="dark"] .tcchap-chapter-label   { color: #94a3b8; }
[data-theme="dark"] .tcchap-meta            { color: #64748b; }
[data-theme="dark"] .tcchap-footer          { background: #0f172a; border-top-color: #334155; }

/* ── Missing cert-quiz (.tcquiz-*) ── */
[data-theme="dark"] .tcquiz-footer          { border-top-color: #334155; }
[data-theme="dark"] .tcquiz-order-num       { background: #334155; color: #e2e8f0; }
[data-theme="dark"] .tcquiz-cat-bucket-label { background: #334155; color: #e2e8f0; }
[data-theme="dark"] .tcquiz-match-num       { background: #334155; color: #e2e8f0; }
[data-theme="dark"] .tcquiz-match-letter    { background: #334155; color: #e2e8f0; }

/* ── Lesson Prep dark mode ─────────────────────────────────── */
[data-theme="dark"] .tch-prep-student-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .tch-prep-stat { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .tch-prep-stat-number { color: #e2e8f0; }
[data-theme="dark"] .tch-prep-lesson-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .tch-prep-vocab-table th { background: #0f172a; color: #94a3b8; border-color: #334155; }
[data-theme="dark"] .tch-prep-vocab-table td { border-color: #1e293b; color: #cbd5e1; }
[data-theme="dark"] .tch-prep-note { background: #0f172a; border-color: #7c3aed; }
[data-theme="dark"] .tch-prep-note-date { color: #64748b; }
[data-theme="dark"] .tch-prep-empty { color: #64748b; }
[data-theme="dark"] .tch-prep-section-title { color: #e2e8f0; }
[data-theme="dark"] .tch-prep-btn--secondary { background: #334155; color: #e2e8f0; border-color: #475569; }

/* Focus Area banner (quality dashboard) */
[data-theme="dark"] .tq-focus-area { background: linear-gradient(135deg, #1e1b2e, #1e293b) !important; border-color: #4c1d95 !important; }
[data-theme="dark"] .tq-focus-area > div:last-child > div:first-child { color: #fca5a5 !important; }
[data-theme="dark"] .tq-focus-area > div:last-child > div:last-child { color: #94a3b8 !important; }
[data-theme="dark"] .tq-focus-area > div:first-child { background: #1e1b2e !important; color: #f87171 !important; }

/* ── Challenges page dark mode ───────────────────── */
[data-theme="dark"] .ch-page { color: #e2e8f0; }
[data-theme="dark"] .ch-card { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .ch-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.2); }
[data-theme="dark"] .ch-card--completed { background: linear-gradient(180deg, #052e16 0%, #1e293b 40%); border-color: #15803d; }
[data-theme="dark"] .ch-card-name { color: #e2e8f0; }
[data-theme="dark"] .ch-card-desc { color: #94a3b8; }
[data-theme="dark"] .ch-card-icon { background: #2d1f1f; }
[data-theme="dark"] .ch-card--completed .ch-card-icon { background: #052e16; }
[data-theme="dark"] .ch-bar-track { background: #334155; }
[data-theme="dark"] .ch-progress-nums { color: #e2e8f0; }
[data-theme="dark"] .ch-progress-unit,
[data-theme="dark"] .ch-pct { color: #94a3b8; }
[data-theme="dark"] .ch-empty { color: #94a3b8; }
[data-theme="dark"] .ch-info-banner { background: #1e2a4a; border-color: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .ch-month-btn { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .ch-month-btn:hover { background: #334155; border-color: #475569; }
[data-theme="dark"] .ch-month-btn--disabled { opacity: 0.4; }
[data-theme="dark"] .ch-stat-box { background: rgba(255,255,255,0.08); }

/* ── Birthday Banner ──────────────────────────────────────────── */
[data-theme="dark"] .dash-birthday-banner {
    background: linear-gradient(135deg, #1e293b 0%, #1e3a5f 30%, #1e293b 60%, #0f172a 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
[data-theme="dark"] .dash-birthday-inner {
    /* padding/text-align inherit; no color override needed */
}
[data-theme="dark"] .dash-birthday-content h2 {
    color: #fbbf24;
}
[data-theme="dark"] .dash-birthday-content p {
    color: #e2e8f0;
}
[data-theme="dark"] .dash-birthday-close {
    color: #94a3b8;
}
[data-theme="dark"] .dash-birthday-close:hover {
    color: #e2e8f0;
}

/* ── Lesson Prep: Profile Card ────────────────────────────────── */
[data-theme="dark"] .tch-prep-profile-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .tch-prep-profile-name {
    color: #e2e8f0;
}
[data-theme="dark"] .tch-prep-profile-id {
    color: #64748b;
}
[data-theme="dark"] .tch-prep-stat-pill {
    background: #334155;
    color: #94a3b8;
}
[data-theme="dark"] .tch-prep-stat-pill strong {
    color: #e2e8f0;
}
[data-theme="dark"] .tch-prep-view-link {
    color: #a78bfa;
}
[data-theme="dark"] .tch-prep-view-link:hover {
    background: rgba(124,58,237,.15);
}

/* ── Lesson Prep: Sections ────────────────────────────────────── */
[data-theme="dark"] .tch-prep-section {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .tch-prep-section-header h2 {
    color: #e2e8f0;
}
[data-theme="dark"] .tch-prep-section-header .tch-prep-subtitle {
    color: #64748b;
}

/* ── Lesson Prep: Recent Lessons ──────────────────────────────── */
[data-theme="dark"] .tch-prep-lesson-item {
    background: #0f172a;
    border-color: #334155;
}
[data-theme="dark"] .tch-prep-lesson-date {
    color: #94a3b8;
}
[data-theme="dark"] .tch-prep-lesson-summary {
    color: #cbd5e1;
}
[data-theme="dark"] .tch-prep-lesson-meta span {
    color: #64748b;
}

/* ── Lesson Prep: Learning Profile Cards ──────────────────────── */
[data-theme="dark"] .tch-prep-lp-card {
    background: #0f172a;
    border-color: #334155;
}
[data-theme="dark"] .tch-prep-lp-label {
    color: #64748b;
}
[data-theme="dark"] .tch-prep-lp-value {
    color: #e2e8f0;
}
[data-theme="dark"] .tch-prep-lp-sub {
    color: #64748b;
}

/* ── Lesson Prep: SRS Dots ────────────────────────────────────── */
[data-theme="dark"] .tch-prep-srs-dot {
    background: #334155;
}
[data-theme="dark"] .tch-prep-srs-dot--filled {
    background: #a78bfa;
}

/* ── Lesson Prep: Course Progress ─────────────────────────────── */
[data-theme="dark"] .tch-prep-course-item {
    border-bottom-color: #334155;
}
[data-theme="dark"] .tch-prep-course-name {
    color: #e2e8f0;
}
[data-theme="dark"] .tch-prep-progress-bar {
    background: #334155;
}
[data-theme="dark"] .tch-prep-progress-label {
    color: #94a3b8;
}

/* ── Lesson Prep: Notes ───────────────────────────────────────── */
[data-theme="dark"] .tch-prep-note-item {
    border-bottom-color: #334155;
}
[data-theme="dark"] .tch-prep-note-text {
    color: #cbd5e1;
}

/* ── Lesson Prep: Buttons ─────────────────────────────────────── */
[data-theme="dark"] .tch-prep-btn--outline {
    background: transparent;
    color: #a78bfa;
    border-color: rgba(124,58,237,.4);
}
[data-theme="dark"] .tch-prep-btn--outline:hover {
    background: rgba(124,58,237,.15);
}

/* ── Lesson Prep: AI Score Card ───────────────────────────────── */
[data-theme="dark"] .tch-prep-ai-score-card {
    background: linear-gradient(135deg, #1e293b, rgba(124,58,237,.12));
    border-color: rgba(124,58,237,.25);
}
[data-theme="dark"] .tch-prep-ai-score-label {
    color: #e2e8f0;
}
[data-theme="dark"] .tch-prep-ai-score-sub {
    color: #64748b;
}

/* ── Schedule (Booking → Schedule tab) ─────────────────────────── */
[data-theme="dark"] .teacher-schedule-info strong { color: #f1f5f9; }
[data-theme="dark"] .teacher-schedule-info span { color: #cbd5e1; }
[data-theme="dark"] .schedule-booking-time { color: #f1f5f9; }
[data-theme="dark"] .schedule-booking-ampm { color: #cbd5e1; }
[data-theme="dark"] .schedule-booking-student { color: #e2e8f0; }
[data-theme="dark"] .schedule-booking-dur { color: #cbd5e1; }
[data-theme="dark"] .schedule-legend { color: #cbd5e1; }
[data-theme="dark"] .schedule-status-pill--confirmed   { background: rgba(59,130,246,.18); color: #60a5fa; }
[data-theme="dark"] .schedule-status-pill--completed   { background: rgba(34,197,94,.18); color: #4ade80; }
[data-theme="dark"] .schedule-status-pill--rescheduled { background: rgba(245,158,11,.18); color: #fbbf24; }
[data-theme="dark"] .schedule-status-pill--cancelled   { background: #1e293b; color: #94a3b8; }
[data-theme="dark"] .schedule-booking--cancelled       { background: #0f172a; border-left-color: #475569; opacity: .65; }

/* =================================================================
   Teacher dashboard family — comprehensive dark-mode pass (May 2026)
   Cards, sidebar, student detail, schedule, badges, icon tiles
   ================================================================= */

/* Sidebar + nav */
[data-theme="dark"] .teacher-sidebar { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .teacher-sidebar-profile {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: #334155;
}
[data-theme="dark"] .teacher-nav-item { color: #cbd5e1; }
[data-theme="dark"] .teacher-nav-item:hover { background: #1e293b; color: #f1f5f9; }
[data-theme="dark"] .teacher-nav-item.active {
    background: rgba(220,38,38,.12);
    color: #fca5a5;
}

/* Card surfaces */
[data-theme="dark"] .teacher-stat-card,
[data-theme="dark"] .teacher-schedule-list,
[data-theme="dark"] .teacher-announcements-list,
[data-theme="dark"] .teacher-lesson-card,
[data-theme="dark"] .teacher-feedback-card,
[data-theme="dark"] .teacher-action-card,
[data-theme="dark"] .teacher-table-wrap,
[data-theme="dark"] .teacher-student-card,
[data-theme="dark"] .teacher-empty {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}

/* Stat icon tiles — translucent pastel on dark */
[data-theme="dark"] .teacher-stat-icon--hours    { background: rgba(29,78,216,.15);  color: #93c5fd; }
[data-theme="dark"] .teacher-stat-icon--lessons  { background: rgba(6,95,70,.15);    color: #6ee7b7; }
[data-theme="dark"] .teacher-stat-icon--students { background: rgba(146,64,14,.18);  color: #fcd34d; }
[data-theme="dark"] .teacher-stat-icon--coins    { background: rgba(153,27,27,.18);  color: #fca5a5; }
[data-theme="dark"] .tch-stat-icon--assess       { background: rgba(219,39,119,.18); color: #f9a8d4; }

/* Student detail (sd-*) */
[data-theme="dark"] .sd-profile,
[data-theme="dark"] .sd-course-item,
[data-theme="dark"] .sd-lessons,
[data-theme="dark"] .sd-activity-timeline {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .sd-note-item {
    background: rgba(245,158,11,.10);
    border-color: rgba(245,158,11,.28);
}
[data-theme="dark"] .sd-note-text { color: #fcd34d; }
[data-theme="dark"] .sd-balance-icon--blue  { background: rgba(59,130,246,.18); color: #93c5fd; }
[data-theme="dark"] .sd-balance-icon--green { background: rgba(16,185,129,.18); color: #6ee7b7; }
[data-theme="dark"] .sd-balance-icon--red   { background: rgba(239,68,68,.18);  color: #fca5a5; }
[data-theme="dark"] .sd-lp-icon--blue   { background: rgba(59,130,246,.15);  color: #93c5fd; }
[data-theme="dark"] .sd-lp-icon--purple { background: rgba(139,92,246,.15);  color: #c4b5fd; }
[data-theme="dark"] .sd-lp-icon--amber  { background: rgba(245,158,11,.15);  color: #fcd34d; }
[data-theme="dark"] .sd-lp-icon--green  { background: rgba(16,185,129,.15);  color: #6ee7b7; }
[data-theme="dark"] .sd-mastered-badge--vocab   { background: rgba(30,64,175,.18);  color: #93c5fd; }
[data-theme="dark"] .sd-mastered-badge--grammar { background: rgba(91,33,182,.18);  color: #c4b5fd; }
[data-theme="dark"] .sd-handoff-badge--pending  { background: rgba(202,138,4,.16);  color: #fcd34d; }
[data-theme="dark"] .sd-handoff-badge--assigned { background: rgba(22,163,74,.16);  color: #86efac; }

/* Schedule day cells + booking pills */
[data-theme="dark"] .schedule-day {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .schedule-booking--confirmed   { background: rgba(37,99,235,.15);  border-color: rgba(37,99,235,.32); }
[data-theme="dark"] .schedule-booking--completed   { background: rgba(22,163,74,.15);  border-color: rgba(22,163,74,.32); }
[data-theme="dark"] .schedule-booking--rescheduled { background: rgba(202,138,4,.15);  border-color: rgba(202,138,4,.32); }

/* Schedule modal */
[data-theme="dark"] .schedule-modal { background: #1e293b; color: #e2e8f0; }
[data-theme="dark"] .schedule-modal-student,
[data-theme="dark"] .schedule-modal-details {
    background: #0f172a;
    border-color: #334155;
}

/* Level badge */
[data-theme="dark"] .badge-level {
    background: rgba(59,130,246,.16);
    color: #93c5fd;
    border-color: rgba(59,130,246,.32);
}
