    /* TEACHER DASHBOARD */
    .teacher-hero {
      padding-bottom: 24px;
    }

    .session-state {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-top: 14px;
      padding: 8px 18px;
      border-radius: 999px;
      background: var(--card-bg);
      border: 2px solid var(--card-border);
      color: var(--muted);
      font-size: 13px;
      font-weight: 800;
    }

    .live-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--green);
      box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
    }

    .dashboard {
      display: grid;
      grid-template-columns: minmax(360px, 390px) 1fr;
      gap: 24px;
    }

    .qrbox {
      text-align: center;
      position: sticky;
      top: 90px;
      height: max-content;
      background: var(--card-bg);
      border: 2px solid var(--card-border);
      padding: 24px 20px;
      box-sizing: border-box;
      width: 100%;
    }

    .qrimg {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 300px;
      height: 300px;
      max-width: 100%;
      margin: 16px auto;
      padding: 12px;
      background: #ffffff;
      border-radius: var(--radius-lg);
      border: 2px solid var(--card-border);
      box-shadow: var(--shadow-md);
      box-sizing: border-box;
      overflow: hidden;
    }

    .qrimg svg,
    .qrimg img,
    .qrimg canvas {
      width: 100% !important;
      height: 100% !important;
      max-width: 100% !important;
      max-height: 100% !important;
      object-fit: contain;
      display: block;
      margin: auto;
    }

    #teacher .joincode,
    .teacher-joincode {
      font-family: 'JetBrains Mono', monospace;
      font-size: 44px;
      font-weight: 900;
      letter-spacing: 8px;
      color: #38bdf8;
      margin: 8px 0 16px;
    }

    .notice {
      padding: 16px;
      border-radius: var(--radius-md);
      background: rgba(99, 102, 241, 0.15);
      border: 2px solid rgba(99, 102, 241, 0.3);
      color: #a5b4fc;
      font-size: 13px;
      font-weight: 700;
      line-height: 1.6;
      margin-top: 18px;
      text-align: left;
    }

    .dashboard-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      flex-wrap: wrap;
    }

    .dashboard-head h2 {
      font-family: 'Rubik', 'Inter', -apple-system, sans-serif;
      margin: 0;
      font-size: 26px;
      font-weight: 900;
    }

    #teacher .controls,
    .teacher-controls {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      margin-top: 24px;
    }

    .start-btn.running {
      background: linear-gradient(135deg, #059669, #10b981);
      color: #ffffff;
      pointer-events: none;
    }

    .table-wrap {
      overflow-x: auto;
      margin-top: 16px;
      border-radius: var(--radius-md);
      border: 2px solid var(--card-border);
      background: var(--card-bg);
    }

    #teacher .table,
    .teacher-table {
      width: 100%;
      min-width: 780px;
      border-collapse: collapse;
    }

    #teacher .table th,
    #teacher .table td,
    .teacher-table th,
    .teacher-table td {
      padding: 16px 14px;
      text-align: left;
      border-bottom: 1px solid var(--card-border);
      font-size: 14px;
      vertical-align: middle;
    }

    #teacher .table th,
    .teacher-table th {
      color: var(--muted);
      font-size: 11px;
      font-weight: 900;
      text-transform: uppercase;
      letter-spacing: 1px;
      background: var(--card-bg-subtle);
    }

    #teacher .bar,
    .teacher-bar {
      height: 10px;
      min-width: 120px;
      background: var(--card-border);
      border-radius: 999px;
      overflow: hidden;
    }

    #teacher .bar i,
    .teacher-bar i {
      display: block;
      height: 100%;
      background: linear-gradient(90deg, #6366f1, #38bdf8);
      transition: width 0.3s ease;
    }

    #teacher .correct,
    .teacher-correct {
      color: #34d399;
      font-weight: 800;
    }

    #teacher .wrong,
    .teacher-wrong {
      color: #fb7185;
      font-weight: 800;
    }

    #teacher .status,
    .teacher-status {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      font-weight: 900;
      padding: 5px 12px;
      border-radius: 999px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    #teacher .status.waiting,
    .teacher-status.waiting {
      background: rgba(245, 158, 11, 0.18);
      color: #fbbf24;
      border: 1px solid rgba(245, 158, 11, 0.4);
    }

    #teacher .status.answering,
    .teacher-status.answering {
      background: rgba(99, 102, 241, 0.18);
      color: #818cf8;
      border: 1px solid rgba(99, 102, 241, 0.4);
    }

    #teacher .status.finished,
    .teacher-status.finished {
      background: rgba(16, 185, 129, 0.18);
      color: #34d399;
      border: 1px solid rgba(16, 185, 129, 0.4);
    }

    #teacher .empty,
    .teacher-empty {
      color: var(--muted);
      padding: 36px !important;
      text-align: center !important;
      font-weight: 700;
    }

    .student-card {
      margin-top: 16px;
      border: 2px solid var(--card-border);
      border-radius: var(--radius-lg);
      padding: 20px;
      background: var(--card-bg);
    }

    .student-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 16px;
    }

    .student-name {
      font-weight: 800;
      font-size: 16px;
      color: var(--ink);
    }

    .mini-grid {
      display: grid;
      grid-template-columns: repeat(20, 1fr);
      gap: 5px;
      margin-top: 16px;
    }

    .mini-q {
      height: 12px;
      border-radius: 4px;
      background: #334155;
      transition: all 0.2s ease;
    }

    .mini-q.correct {
      background: var(--green);
    }

    .mini-q.wrong {
      background: var(--red);
    }

    .mini-q.current {
      background: var(--brand-indigo);
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
    }

    /* Whole-table flash is disabled to avoid full-table blinking */
    .live-flash {
      animation: none !important;
    }



    /* =========================================================
       TEACHER CONTROL BAR & MODERN HEADER
    ========================================================= */
    .teacher-control-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 24px;
      padding: 12px 18px;
      background: var(--card-bg, #111827);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-lg);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
      position: relative;
    }

    [data-theme="light"] .teacher-control-bar {
      background: #ffffff;
      border-color: #e2e8f0;
      box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    }

    .teacher-bar-left,
    .teacher-bar-right {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
    }

    .teacher-tab-nav {
      display: inline-flex;
      background: var(--card-bg-subtle, rgba(15, 23, 42, 0.6));
      padding: 4px;
      border-radius: var(--radius-full, 999px);
      border: 1px solid var(--card-border);
      gap: 4px;
      align-items: center;
      max-width: 100%;
    }

    [data-theme="light"] .teacher-tab-nav {
      background: #f1f5f9;
      border-color: #e2e8f0;
    }

    .teacher-tab-btn {
      padding: 8px 18px;
      border-radius: var(--radius-full, 999px);
      font-weight: 700;
      font-size: 13px;
      border: none;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      display: inline-flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
      user-select: none;
    }

    .teacher-tab-btn:hover {
      color: var(--ink);
      background: rgba(255, 255, 255, 0.06);
    }

    [data-theme="light"] .teacher-tab-btn:hover {
      color: #0f172a;
      background: rgba(0, 0, 0, 0.04);
    }

    .teacher-tab-btn.active {
      background: var(--brand-indigo);
      color: #ffffff !important;
      box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
    }

    .teacher-live-statusbar {
      display: flex;
      justify-content: center;
      margin-bottom: 20px;
    }

    @media (max-width: 980px) {
      .teacher-control-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
      }

      .teacher-bar-left,
      .teacher-bar-right {
        width: 100%;
      }

      .teacher-bar-left .btn,
      .teacher-bar-right .btn {
        width: 100%;
        justify-content: center;
      }

      .teacher-tab-nav {
        width: 100%;
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-radius: var(--radius-md);
        padding: 4px;
        box-sizing: border-box;
      }

      .teacher-tab-nav::-webkit-scrollbar {
        display: none;
      }

      .teacher-tab-btn {
        flex: 0 0 auto;
        padding: 8px 14px;
        font-size: 12.5px;
      }
    }


    /* Teacher Content Manager */
    .teacher-content-container {
      max-width: 1000px;
      margin: 0 auto;
    }

    .teacher-content-hero {
      padding: 26px;
      margin-bottom: 20px;
    }

    .teacher-topic-selector {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .teacher-topic-pill {
      padding: 8px 16px;
      border-radius: 999px;
      border: 1px solid var(--card-border);
      background: var(--card-bg-subtle);
      color: var(--muted);
      font-weight: 700;
      font-size: 13px;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .teacher-topic-pill:hover {
      border-color: var(--brand-indigo);
      color: var(--ink);
    }

    .teacher-topic-pill.active {
      background: var(--brand-indigo);
      color: #fff;
      border-color: var(--brand-indigo);
    }

    /* ========================================================
       MODERN TEACHER TOPICS SELECTOR & GRID (LMS STYLE)
       ======================================================== */
    .teacher-topics-section {
      display: flex;
      flex-direction: column;
      gap: 16px;
      width: 100%;
    }

    .teacher-topics-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
      width: 100%;
    }

    .teacher-topics-title-wrap {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .teacher-topics-title {
      font-size: 16px;
      font-weight: 800;
      color: var(--ink, #0f172a);
      margin: 0;
      letter-spacing: -0.2px;
    }

    .teacher-topics-count-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 26px;
      height: 24px;
      padding: 0 8px;
      border-radius: 999px;
      background: var(--card-bg-subtle, rgba(0, 0, 0, 0.05));
      border: 1px solid var(--card-border, #e2e8f0);
      color: var(--brand-indigo, #6366f1);
      font-size: 12px;
      font-weight: 800;
    }

    .teacher-topics-actions {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 10px;
    }

    .teacher-topics-search-wrap {
      position: relative;
      display: flex;
      align-items: center;
      min-width: 180px;
    }

    .teacher-topics-search-icon {
      position: absolute;
      left: 10px;
      width: 14px;
      height: 14px;
      color: var(--muted, #64748b);
      pointer-events: none;
    }

    .teacher-topics-search-input {
      width: 100%;
      height: 36px;
      padding: 0 12px 0 32px;
      border-radius: 10px;
      border: 1px solid var(--card-border, #e2e8f0);
      background: var(--card-bg, #ffffff);
      color: var(--ink, #0f172a);
      font-size: 13px;
      transition: all 0.15s ease;
      box-sizing: border-box;
    }

    .teacher-topics-search-input:focus {
      outline: none;
      border-color: var(--brand-indigo, #6366f1);
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
    }

    .teacher-topics-filter-chips {
      display: flex;
      align-items: center;
      gap: 4px;
      background: var(--card-bg-subtle, #f8fafc);
      padding: 3px;
      border-radius: 10px;
      border: 1px solid var(--card-border, #e2e8f0);
    }

    .topic-filter-chip {
      padding: 4px 10px;
      border-radius: 7px;
      border: none;
      background: transparent;
      color: var(--muted, #64748b);
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.15s ease;
      white-space: nowrap;
    }

    .topic-filter-chip:hover {
      color: var(--ink, #0f172a);
    }

    .topic-filter-chip.active {
      background: var(--card-bg, #ffffff);
      color: var(--brand-indigo, #6366f1);
      box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
    }

    .teacher-add-topic-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 7px 14px;
      font-size: 12.5px;
      font-weight: 700;
      border-radius: 10px;
      white-space: nowrap;
    }

    .teacher-topics-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      width: 100%;
      box-sizing: border-box;
    }

    @media (min-width: 1440px) {
      .teacher-topics-grid {
        grid-template-columns: repeat(4, 1fr);
      }
    }

    @media (max-width: 1100px) {
      .teacher-topics-grid {
        grid-template-columns: repeat(3, 1fr);
      }
    }

    @media (max-width: 780px) {
      .teacher-topics-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (max-width: 520px) {
      .teacher-topics-grid {
        grid-template-columns: 1fr;
        gap: 10px;
      }
      .teacher-topics-actions {
        width: 100%;
      }
      .teacher-topics-search-wrap {
        width: 100%;
      }
      .teacher-topics-filter-chips {
        width: 100%;
        justify-content: space-between;
      }
      .teacher-add-topic-btn {
        width: 100%;
        justify-content: center;
      }
    }

    .teacher-topic-card {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 14px 16px;
      border-radius: 16px;
      border: 1px solid var(--card-border, #e2e8f0);
      background: var(--card-bg, #ffffff);
      box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.04));
      cursor: pointer;
      transition: all 0.16s ease;
      min-height: 112px;
      position: relative;
      text-align: left;
      user-select: none;
      box-sizing: border-box;
    }

    .teacher-topic-card:hover {
      border-color: var(--brand-indigo, #6366f1);
      transform: translateY(-1px);
      box-shadow: 0 4px 10px -2px rgba(99, 102, 241, 0.1);
    }

    .teacher-topic-card:focus-visible {
      outline: none;
      border-color: var(--brand-indigo, #6366f1);
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
    }

    .teacher-topic-card.active {
      border-color: var(--brand-indigo, #6366f1);
      background: rgba(99, 102, 241, 0.05);
      box-shadow: 0 0 0 1.5px var(--brand-indigo, #6366f1), 0 4px 12px -2px rgba(99, 102, 241, 0.14);
    }

    .topic-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
    }

    .topic-num-badge {
      font-family: 'JetBrains Mono', monospace;
      font-size: 11.5px;
      font-weight: 800;
      color: var(--muted, #64748b);
      background: var(--card-bg-subtle, rgba(0, 0, 0, 0.04));
      padding: 2px 7px;
      border-radius: 7px;
      letter-spacing: 0.5px;
      border: 1px solid var(--card-border, rgba(0, 0, 0, 0.06));
    }

    .teacher-topic-card.active .topic-num-badge {
      background: var(--brand-indigo, #6366f1);
      color: #ffffff;
      border-color: var(--brand-indigo, #6366f1);
    }

    .topic-active-pill {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 11px;
      font-weight: 800;
      color: var(--brand-indigo, #6366f1);
      background: rgba(99, 102, 241, 0.12);
      padding: 2px 8px;
      border-radius: 6px;
      letter-spacing: 0.2px;
    }

    .topic-active-pill .topic-check-icon {
      width: 12px;
      height: 12px;
      stroke-width: 3;
    }

    .topic-card-body {
      display: flex;
      flex-direction: column;
      flex-grow: 1;
      justify-content: space-between;
    }

    .topic-card-title {
      margin: 0 0 10px 0;
      font-size: 13.5px;
      font-weight: 700;
      line-height: 1.35;
      color: var(--ink, #0f172a);
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
      word-break: break-word;
    }

    .teacher-topic-card.active .topic-card-title {
      font-weight: 800;
      color: var(--ink, #0f172a);
    }

    .topic-card-meta {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: auto;
      padding-top: 2px;
    }

    .topic-status-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 11.5px;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .topic-status-badge.scheduled {
      color: var(--brand-indigo, #6366f1);
    }

    .topic-status-badge.unscheduled {
      color: var(--muted, #94a3b8);
    }

    .topic-status-badge.completed {
      color: #10b981;
    }

    .topic-status-badge.postponed {
      color: #f59e0b;
    }

    .topic-status-icon {
      width: 12px;
      height: 12px;
      flex-shrink: 0;
      stroke-width: 2.2;
    }

    .teacher-topics-empty {
      grid-column: 1 / -1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 36px 20px;
      background: var(--card-bg-subtle, #f8fafc);
      border: 1px dashed var(--card-border, #cbd5e1);
      border-radius: 16px;
      text-align: center;
    }

    .teacher-topics-empty .empty-icon {
      width: 32px;
      height: 32px;
      color: var(--muted, #94a3b8);
      margin-bottom: 8px;
    }

    .teacher-topics-empty .empty-title {
      font-size: 14px;
      font-weight: 800;
      color: var(--ink, #0f172a);
    }

    .teacher-topics-empty .empty-desc {
      font-size: 12.5px;
      color: var(--muted, #64748b);
      margin-top: 4px;
    }

    .teacher-materials-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 14px;
    }

    .teacher-materials-table th {
      text-align: left;
      font-size: 12px;
      font-weight: 800;
      color: var(--muted);
      padding: 10px 12px;
      border-bottom: 1px solid var(--card-border);
    }

    .teacher-materials-table td {
      padding: 12px;
      border-bottom: 1px solid var(--card-border);
      font-size: 13.5px;
      color: var(--ink);
    }

    .teacher-add-form {
      margin-top: 24px;
      padding-top: 20px;
      border-top: 1px solid var(--card-border);
    }

    @media (max-width: 768px) {
      .topic-nav-tabs {
        grid-template-columns: repeat(2, 1fr);
      }

      .course-topics-grid {
        grid-template-columns: 1fr;
      }

      .presentation-frame-wrap {
        height: 400px;
      }
    }


    .btn-icon {
      width: 16px;
      height: 16px;
      vertical-align: -2px;
      margin-left: 4px;
      margin-right: 4px;
      display: inline-block;
    }

    .btn .btn-icon:first-child {
      margin-left: 0;
      margin-right: 6px;
    }

    .btn .btn-icon:last-child {
      margin-left: 6px;
      margin-right: 0;
    }

    .section-icon {
      width: 20px;
      height: 20px;
      vertical-align: -3px;
      margin-right: 8px;
      display: inline-block;
      color: var(--brand-indigo);
    }

    .badge-icon {
      width: 14px;
      height: 14px;
      vertical-align: -2px;
      margin-right: 5px;
      display: inline-block;
    }

    .stat-icon-inline {
      width: 14px;
      height: 14px;
      vertical-align: -2px;
      margin-right: 3px;
      display: inline-block;
    }

    .spin-icon {
      width: 16px;
      height: 16px;
      vertical-align: -2px;
      margin-right: 6px;
      display: inline-block;
      animation: spin 1s linear infinite;
    }

    @keyframes spin {
      from {
        transform: rotate(0deg);
      }

      to {
        transform: rotate(360deg);
      }
    }





    /* Teacher One-Screen Dashboard */
    .teacher-dash-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 20px;
      margin-top: 20px;
    }

    @media (min-width: 1024px) {
      .teacher-dash-grid {
        grid-template-columns: 1.6fr 1fr;
      }
    }

    .teacher-stat-box {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 16px;
      padding: 18px 20px;
      display: flex;
      align-items: center;
      gap: 16px;
      transition: transform 0.15s ease;
    }

    .teacher-stat-box:hover {
      transform: translateY(-2px);
    }

    .teacher-quick-actions-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
      gap: 10px;
      margin-top: 14px;
    }

    .btn-quick-action {
      background: var(--card-bg-subtle);
      border: 1px solid var(--card-border);
      border-radius: 12px;
      padding: 14px 12px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      font-size: 12.5px;
      font-weight: 700;
      color: var(--ink);
      cursor: pointer;
      transition: all 0.15s ease;
      text-align: center;
    }

    .btn-quick-action:hover {
      background: rgba(99, 102, 241, 0.12);
      border-color: var(--brand-indigo);
      transform: translateY(-2px);
    }


    /* Question Analytics Bar */
    .accuracy-bar-wrap {
      width: 100%;
      height: 10px;
      border-radius: 5px;
      background: rgba(239, 68, 68, 0.25);
      overflow: hidden;
      display: flex;
      margin: 6px 0;
    }

    .accuracy-bar-fill {
      height: 100%;
      background: var(--green);
      transition: width 0.4s ease;
    }

    /* Phase 41: Teacher Mobile Adaptation */
    .teacher-add-mat-grid {
      display: grid;
      grid-template-columns: 1fr 2fr;
      gap: 14px;
    }

    @media (max-width: 768px) {
      .teacher-add-mat-grid {
        grid-template-columns: 1fr !important;
      }

      .teacher-control-bar {
        padding: 10px 12px;
        gap: 10px;
      }

      .teacher-tab-nav {
        display: none !important;
      }

      .qrbox {
        margin: 0 auto 20px;
        max-width: 100%;
        width: 100%;
      }

      .qrimg {
        width: min(260px, 80vw);
        height: min(260px, 80vw);
        margin: 14px auto;
      }

      .joincode {
        font-size: clamp(26px, 7vw, 38px);
        letter-spacing: 4px;
      }

      .controls {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 8px;
        margin-top: 14px;
      }

      .controls .btn {
        padding: 12px 14px;
        font-size: 13px;
        justify-content: center;
      }

      .dashboard-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
      }

      .dash-greeting {
        margin-bottom: 18px;
      }

      .dash-greeting h1 {
        font-size: 22px;
      }
    }

    @media (max-width: 480px) {
      .teacher-stat-box {
        padding: 14px;
        gap: 12px;
      }

      .teacher-quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
      }

      .qrimg {
        width: 160px;
        height: 160px;
      }
    }



    /* =========================================================
   TEACHER MODE COMPLETE MOBILE RESPONSIVENESS FIX
   ========================================================= */

    #teacher,
    #teacherDashboardView,
    #teacherLiveView,
    #teacherAnalyticsView,
    #teacherContentView,
    #teacherScheduleView,
    #teacherGradesView {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }

    .teacher-dash-grid {
      width: 100%;
      max-width: 100%;
      min-width: 0;
    }

    .teacher-dash-grid>div {
      width: 100% !important;
      max-width: 100% !important;
      min-width: 0 !important;
      box-sizing: border-box !important;
    }

    #teacher .card {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      box-sizing: border-box;
    }

    .teacher-card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      margin-bottom: 14px;
    }

    .teacher-live-empty-wrap {
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }

    #teacherDashRecentResults {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }

    @media (max-width: 768px) {
      .teacher-control-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 12px 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
      }

      .teacher-bar-left,
      .teacher-bar-right {
        width: 100% !important;
      }

      .teacher-bar-left .btn,
      .teacher-bar-right .btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        justify-content: center !important;
        white-space: normal !important;
        text-align: center !important;
      }

      .teacher-tab-nav {
        display: none !important;
      }

      .dashboard {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
      }

      .qrbox {
        position: static !important;
        max-width: 100% !important;
        width: 100% !important;
      }

      .table-wrap {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
      }
    }

    @media (max-width: 600px) {
      #teacher .card {
        padding: 16px 14px !important;
        border-radius: 14px !important;
      }

      .teacher-card-header,
      #teacherDashboardView .card>div:first-child {
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
      }

      .btn-teacher-live-start {
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
        box-sizing: border-box !important;
        text-align: center !important;
      }

      .teacher-dash-live-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
      }

      .teacher-dash-live-stats .stat {
        padding: 10px 4px !important;
        font-size: 11px !important;
        border-radius: 10px !important;
      }

      .teacher-dash-live-stats .stat b {
        font-size: 18px !important;
        margin-bottom: 2px !important;
      }

      .teacher-quick-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
      }

      .btn-quick-action {
        padding: 12px 6px !important;
        font-size: 11.5px !important;
        min-width: 0 !important;
      }

      #scheduleModal .modal-content,
      #topicQuizModal .modal-content,
      #quizQuestionModal .modal-content {
        max-width: calc(100vw - 20px) !important;
        width: 100% !important;
        padding: 18px 14px !important;
        box-sizing: border-box !important;
      }

      #scheduleModal form div[style*="grid-template-columns"],
      .teacher-modal-grid {
        grid-template-columns: 1fr !important;
      }
    }

    @media (max-width: 390px) {
      #teacherGreetingTitle {
        font-size: 20px !important;
      }

      #teacherGreetingSubtitle {
        font-size: 12.5px !important;
      }

      #teacherDashLessonsContainer .schedule-lesson-badge {
        font-size: 11px !important;
        padding: 2px 6px !important;
      }

      .teacher-dash-live-stats .stat b {
        font-size: 16px !important;
      }
    }

    /* =========================================================
   PHASE 34: TEACHER LIVE MONITORING PANEL & QR MODAL
   ========================================================= */

    /* Realtime Connection Indicator */
    .realtime-status-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 14px;
      border-radius: 999px;
      background: rgba(16, 185, 129, 0.12);
      border: 1.5px solid rgba(16, 185, 129, 0.35);
      color: var(--green, #10b981);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0.5px;
      margin-left: auto;
      transition: all 0.3s ease;
    }

    .realtime-status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--green, #10b981);
      box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
      animation: pulseDot 1.8s infinite;
    }

    @keyframes pulseDot {
      0% {
        transform: scale(0.9);
        opacity: 0.8;
      }

      50% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 12px rgba(16, 185, 129, 1);
      }

      100% {
        transform: scale(0.9);
        opacity: 0.8;
      }
    }

    .realtime-status-pill.reconnecting {
      background: rgba(245, 158, 11, 0.12);
      border-color: rgba(245, 158, 11, 0.35);
      color: #f59e0b;
    }

    .realtime-status-pill.reconnecting .realtime-status-dot {
      background: #f59e0b;
      box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
    }

    .realtime-status-pill.error,
    .realtime-status-pill.offline {
      background: rgba(244, 63, 94, 0.12);
      border-color: rgba(244, 63, 94, 0.35);
      color: #f43f5e;
    }

    .realtime-status-pill.error .realtime-status-dot,
    .realtime-status-pill.offline .realtime-status-dot {
      background: #f43f5e;
      box-shadow: 0 0 8px rgba(244, 63, 94, 0.8);
      animation: none;
    }

    /* Controls & Per-Question Selector */
    .per-question-select {
      padding: 6px 12px;
      font-size: 12px;
      font-weight: 700;
      border-radius: var(--radius-md, 8px);
      background: var(--card-bg);
      border: 1.5px solid var(--card-border);
      color: var(--ink);
      cursor: pointer;
    }

    /* Live Monitoring Table Container */
    .table-wrap.live-quiz-students-container {
      width: 100% !important;
      max-width: 100% !important;
      overflow-x: auto !important;
      -webkit-overflow-scrolling: touch !important;
      border-radius: var(--radius-md);
      border: 1px solid var(--card-border);
    }

    /* Live Monitoring Table */
    .live-monitoring-table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
    }

    .live-monitoring-table:not(.is-finished) {
      min-width: 780px;
    }

    /* Sticky columns for Live Monitoring mode */
    .live-monitoring-table:not(.is-finished) th:nth-child(1),
    .live-monitoring-table:not(.is-finished) td:nth-child(1) {
      position: sticky;
      left: 0;
      background: var(--card-bg);
      z-index: 3;
    }

    .live-monitoring-table:not(.is-finished) th:nth-child(2),
    .live-monitoring-table:not(.is-finished) td:nth-child(2) {
      position: sticky;
      left: 48px;
      background: var(--card-bg);
      z-index: 2;
      box-shadow: 2px 0 6px -2px rgba(0, 0, 0, 0.15);
    }

    .live-monitoring-table:not(.is-finished) thead th:nth-child(1),
    .live-monitoring-table:not(.is-finished) thead th:nth-child(2) {
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.04));
      z-index: 4;
    }

    .live-monitoring-table th {
      padding: 12px 14px;
      font-size: 11.5px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--muted);
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.03));
      border-bottom: 2px solid var(--card-border);
    }

    .live-monitoring-table td {
      padding: 12px 14px;
      font-size: 13.5px;
      border-bottom: 1px solid var(--card-border);
      vertical-align: middle;
    }

    .live-student-row {
      transition: background-color 0.4s ease;
    }

    .live-student-row.row-enter {
      animation: rowEnterAnim 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* Row-level subtle highlight (600ms, single iteration, light & dark theme) */
    .live-student-row.row-pulse {
      animation: rowSubtlePulse 0.6s ease-out 1 !important;
    }

    @keyframes rowSubtlePulse {
      0% {
        background-color: rgba(99, 102, 241, 0.16);
      }

      100% {
        background-color: transparent;
      }
    }

    [data-theme="dark"] .live-student-row.row-pulse {
      animation: rowSubtlePulseDark 0.6s ease-out 1 !important;
    }

    @keyframes rowSubtlePulseDark {
      0% {
        background-color: rgba(56, 189, 248, 0.14);
      }

      100% {
        background-color: transparent;
      }
    }

    @media (prefers-reduced-motion: reduce) {

      .live-student-row.row-enter,
      .live-student-row.row-pulse {
        animation: none !important;
        transition: none !important;
      }
    }

    /* Student avatar initial */
    .student-name-wrap {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .student-avatar-initial {
      width: 30px;
      height: 30px;
      border-radius: 8px;
      background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(56, 189, 248, 0.2));
      border: 1.5px solid rgba(99, 102, 241, 0.35);
      color: var(--brand-indigo, #818cf8);
      font-weight: 800;
      font-size: 13px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .student-group-pill {
      display: inline-block;
      font-size: 12px;
      font-weight: 700;
      padding: 3px 8px;
      border-radius: 6px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.06));
      color: var(--muted);
      border: 1px solid var(--card-border);
    }

    /* Status Badges */
    .status-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 10px;
      border-radius: 999px;
      font-size: 11.5px;
      font-weight: 800;
      letter-spacing: 0.3px;
      white-space: nowrap;
    }

    .status-badge.status-waiting {
      background: rgba(148, 163, 184, 0.15);
      color: #94a3b8;
      border: 1px solid rgba(148, 163, 184, 0.3);
    }

    .status-badge.status-answering {
      background: rgba(56, 189, 248, 0.15);
      color: #38bdf8;
      border: 1px solid rgba(56, 189, 248, 0.4);
    }

    .status-badge.status-saving {
      background: rgba(245, 158, 11, 0.15);
      color: #f59e0b;
      border: 1px solid rgba(245, 158, 11, 0.4);
    }

    .status-badge.status-finished {
      background: rgba(16, 185, 129, 0.15);
      color: #10b981;
      border: 1px solid rgba(16, 185, 129, 0.4);
    }

    .status-badge.status-disconnected {
      background: rgba(244, 63, 94, 0.15);
      color: #f43f5e;
      border: 1px solid rgba(244, 63, 94, 0.4);
    }

    /* Live Progress */
    .live-progress-wrap {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .live-progress-bar {
      flex: 1;
      height: 6px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.08));
      border-radius: 999px;
      overflow: hidden;
    }

    .live-progress-fill {
      height: 100%;
      background: linear-gradient(90deg, #38bdf8, #6366f1);
      border-radius: 999px;
      transition: width 0.3s ease;
    }

    .live-progress-percent {
      font-size: 11px;
      font-weight: 700;
      color: var(--muted);
      min-width: 32px;
    }

    /* =========================================================
   KAHOOT-STYLE EXPANDED QR PRESENTATION OVERLAY
   ========================================================= */
    .qr-expand-overlay {
      position: fixed;
      inset: 0;
      z-index: 9999;
      background: #090d16;
      background: rgba(0, 0, 0, 0.88);
      background: radial-gradient(circle at center 20%, #151d30 0%, #080c16 100%);
      backdrop-filter: blur(12px);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      animation: qrOverlayFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      box-sizing: border-box;
    }

    @keyframes qrOverlayFadeIn {
      from {
        opacity: 0;
        transform: scale(0.98);
      }

      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    .qr-expand-close {
      position: absolute;
      top: 24px;
      right: 24px;
      width: 46px;
      height: 46px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.12);
      border: 1.5px solid rgba(255, 255, 255, 0.22);
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
      z-index: 10000;
    }

    .qr-expand-close:hover {
      background: rgba(255, 255, 255, 0.28);
      transform: scale(1.08);
    }

    .qr-expand-close:active {
      transform: scale(0.95);
    }

    .qr-presentation-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      gap: clamp(14px, 2.5vh, 26px);
      box-sizing: border-box;
    }

    .qr-presentation-header {
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
    }

    .qr-presentation-label {
      font-family: 'Rubik', 'Inter', -apple-system, sans-serif;
      font-size: clamp(14px, 2vw, 20px);
      font-weight: 800;
      letter-spacing: 3px;
      text-transform: uppercase;
      color: rgba(255, 255, 255, 0.72);
    }

    .qr-presentation-code {
      font-family: 'JetBrains Mono', 'Rubik', monospace;
      font-size: clamp(44px, 7vw, 84px);
      font-weight: 900;
      letter-spacing: clamp(6px, 1.2vw, 14px);
      color: #ffffff;
      line-height: 1.1;
      text-shadow: 0 4px 24px rgba(56, 189, 248, 0.4);
    }

    .qr-presentation-qr-wrap {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .qr-expand-box {
      background: #ffffff;
      padding: clamp(14px, 2.4vw, 26px);
      border-radius: clamp(16px, 2.4vw, 24px);
      box-shadow: 0 25px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.15);
      display: flex;
      align-items: center;
      justify-content: center;
      width: min(56vw, 56vh);
      height: min(56vw, 56vh);
      max-width: 520px;
      max-height: 520px;
      aspect-ratio: 1 / 1;
      box-sizing: border-box;
    }

    .qr-expand-box svg,
    .qr-expand-box img {
      width: 100% !important;
      height: 100% !important;
      max-width: 100% !important;
      max-height: 100% !important;
      aspect-ratio: 1 / 1;
      object-fit: contain;
      display: block;
    }

    @media (max-width: 768px) {
      .qr-expand-overlay {
        padding: 16px;
      }

      .qr-expand-close {
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
      }

      .qr-presentation-wrap {
        gap: 16px;
      }

      .qr-presentation-label {
        font-size: 13px;
        letter-spacing: 2px;
      }

      .qr-presentation-code {
        font-size: 44px;
        letter-spacing: 5px;
      }

      .qr-expand-box {
        width: min(88vw, 88vh);
        height: min(88vw, 88vh);
        width: min(76vw, 50vh);
        height: min(76vw, 50vh);
        padding: 14px;
        border-radius: 16px;
      }
    }

    @media (max-height: 600px) and (orientation: landscape) {
      .qr-presentation-wrap {
        flex-direction: row;
        gap: 32px;
      }

      .qr-presentation-header {
        text-align: left;
        align-items: flex-start;
      }

      .qr-expand-box {
        width: min(65vh, 45vw);
        height: min(65vh, 45vw);
      }
    }

    /* =========================================================
   TEACHER QUIZ RESULTS & SUMMARY SYSTEM
   ========================================================= */

    .teacher-quiz-summary-stats {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
      margin-top: 14px;
      margin-bottom: 20px;
    }

    .teacher-quiz-summary-stats .stat {
      background: var(--card-bg-subtle);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-md);
      padding: 14px 16px;
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      transition: transform 0.2s ease, border-color 0.2s ease;
    }

    .teacher-quiz-summary-stats .stat:hover {
      border-color: var(--brand-indigo);
      transform: translateY(-2px);
    }

    .teacher-quiz-summary-stats .stat b {
      font-size: 20px;
      font-weight: 900;
      color: var(--ink);
      line-height: 1.2;
    }

    .teacher-quiz-summary-stats .stat .stat-label {
      font-size: 11.5px;
      color: var(--muted);
      font-weight: 700;
      margin-top: 4px;
      text-transform: uppercase;
      letter-spacing: 0.3px;
    }

    /* Results Table Styling */
    .teacher-quiz-results-table {
      width: 100%;
      border-collapse: collapse;
    }

    .teacher-quiz-results-table tr {
      transition: background-color 0.2s ease;
    }

    .teacher-quiz-results-table tbody tr:hover {
      background-color: var(--card-bg-subtle);
    }

    .result-correct-fraction {
      font-size: 14.5px;
      font-weight: 700;
      color: var(--ink);
    }

    .result-correct-fraction b {
      font-weight: 900;
      color: var(--green);
    }

    /* Percentage Pills */
    .result-pct-pill {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 4px 12px;
      border-radius: 999px;
      font-size: 13.5px;
      font-weight: 800;
      letter-spacing: 0.3px;
    }

    .result-pill-5 {
      background: rgba(16, 185, 129, 0.15);
      color: #10b981;
      border: 1px solid rgba(16, 185, 129, 0.35);
    }

    .result-pill-4 {
      background: rgba(6, 182, 212, 0.15);
      color: #06b6d4;
      border: 1px solid rgba(6, 182, 212, 0.35);
    }

    .result-pill-3 {
      background: rgba(245, 158, 11, 0.15);
      color: #f59e0b;
      border: 1px solid rgba(245, 158, 11, 0.35);
    }

    .result-pill-2 {
      background: rgba(244, 63, 94, 0.15);
      color: #f43f5e;
      border: 1px solid rgba(244, 63, 94, 0.35);
    }

    /* Grade Badges */
    .result-grade-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      font-size: 15px;
      font-weight: 900;
    }

    .grade-badge-5 {
      background: rgba(16, 185, 129, 0.2);
      color: #10b981;
      border: 2px solid #10b981;
    }

    .grade-badge-4 {
      background: rgba(99, 102, 241, 0.2);
      color: #6366f1;
      border: 2px solid #6366f1;
    }

    .grade-badge-3 {
      background: rgba(245, 158, 11, 0.2);
      color: #f59e0b;
      border: 2px solid #f59e0b;
    }

    .grade-badge-2 {
      background: rgba(244, 63, 94, 0.2);
      color: #f43f5e;
      border: 2px solid #f43f5e;
    }

    /* Detail Modal Grid */
    .sdm-stats-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
    }

    .sdm-q-box {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 8px 2px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 800;
      user-select: none;
      transition: transform 0.12s ease;
    }

    .sdm-q-box:hover {
      transform: scale(1.08);
    }

    .sdm-q-box.sdm-correct {
      background: rgba(16, 185, 129, 0.18);
      color: #10b981;
      border: 1px solid rgba(16, 185, 129, 0.4);
    }

    .sdm-q-box.sdm-wrong {
      background: rgba(244, 63, 94, 0.18);
      color: #f43f5e;
      border: 1px solid rgba(244, 63, 94, 0.4);
    }

    .sdm-q-box.sdm-unanswered {
      background: var(--card-bg);
      color: var(--muted);
      border: 1px solid var(--card-border);
      opacity: 0.5;
    }

    .sdm-q-num {
      font-size: 10px;
      opacity: 0.8;
      margin-bottom: 2px;
    }

    .sdm-q-icon {
      font-size: 13px;
      line-height: 1;
    }

    /* Responsive Mobile Cards for Results */
    @media (max-width: 768px) {
      .teacher-quiz-summary-stats {
        grid-template-columns: repeat(2, 1fr) !important;
      }

      .teacher-quiz-results-table.is-finished thead {
        display: none !important;
      }

      .teacher-quiz-results-table.is-finished,
      .teacher-quiz-results-table.is-finished tbody,
      .teacher-quiz-results-table.is-finished tr,
      .teacher-quiz-results-table.is-finished td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
      }

      .teacher-quiz-results-table.is-finished tr {
        margin-bottom: 12px !important;
        background: var(--card-bg-subtle) !important;
        border: 1px solid var(--card-border) !important;
        border-radius: var(--radius-md) !important;
        padding: 14px 16px !important;
        box-shadow: var(--shadow-sm) !important;
      }

      .teacher-quiz-results-table.is-finished td {
        padding: 5px 0 !important;
        border: none !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        text-align: right !important;
      }

      .teacher-quiz-results-table.is-finished td:before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--muted);
        font-size: 12.5px;
        text-align: left;
      }

      .sdm-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
      }

      .large-join-code {
        font-size: 30px;
        letter-spacing: 4px;
      }
    }

    /* =========================================================
   BQ24 TEACHER REDESIGN (SCREEN 5, 6 & 7 REFERENCE)
   ========================================================= */

    .teacher-today-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 14px;
      border-radius: 9999px;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      font-size: 12.5px;
      font-weight: 700;
      color: var(--ink);
    }

    /* 4 Stat Cards in a row (Screen 5) */
    .teacher-stats-four {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
      margin-bottom: 24px;
    }

    @media (max-width: 860px) {
      .teacher-stats-four {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (max-width: 500px) {
      .teacher-stats-four {
        grid-template-columns: 1fr;
      }
    }

    .teacher-stat-card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 14px;
      padding: 18px;
      display: flex;
      align-items: center;
      gap: 14px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .stat-icon-square {
      width: 44px;
      height: 44px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .stat-icon-square.icon-pink {
      background: #fdf2f8;
    }

    .stat-icon-square.icon-blue {
      background: #eff6ff;
    }

    .stat-icon-square.icon-cyan {
      background: #f0f9ff;
    }

    .stat-icon-square.icon-purple {
      background: #faf5ff;
    }

    .stat-label {
      font-size: 12px;
      color: var(--muted);
      font-weight: 600;
      margin-bottom: 2px;
    }

    .stat-val-row {
      display: flex;
      align-items: baseline;
      gap: 6px;
    }

    .stat-num {
      font-size: 22px;
      font-weight: 800;
      color: var(--ink);
    }

    .stat-unit {
      font-size: 12px;
      color: var(--muted);
      font-weight: 600;
    }

    /* 2-Column Grids (Screen 5) */
    .teacher-grid-two-col {
      display: grid;
      grid-template-columns: 1.45fr 1fr;
      gap: 20px;
    }

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

    .teacher-panel-card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 16px;
      padding: 22px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

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

    .panel-title {
      font-size: 16px;
      font-weight: 800;
      color: var(--ink);
      margin: 0;
    }

    .panel-link {
      background: none;
      border: none;
      color: #2563eb;
      font-size: 12.5px;
      font-weight: 700;
      cursor: pointer;
      padding: 0;
    }

    /* Today Curriculum List (Teacher) */
    .today-curriculum-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .curriculum-item-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 14px;
      background: var(--card-bg-subtle, #f8fafc);
      border: 1px solid var(--card-border, #e2e8f0);
      border-radius: 12px;
      gap: 12px;
    }

    .item-time-box {
      display: flex;
      align-items: center;
      gap: 6px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 12px;
      font-weight: 700;
      color: var(--ink);
      white-space: nowrap;
    }

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

    .item-title {
      font-size: 13.5px;
      font-weight: 700;
      color: var(--ink);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .item-group {
      font-size: 11.5px;
      color: var(--muted);
    }

    /* Quick 2x2 Buttons (Teacher) */
    .teacher-quick-2x2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }

    .teacher-btn-quick {
      background: var(--card-bg-subtle, #f8fafc);
      border: 1px solid var(--card-border, #e2e8f0);
      border-radius: 12px;
      padding: 14px 12px;
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 13px;
      font-weight: 700;
      color: var(--ink);
      cursor: pointer;
      transition: all 0.15s ease;
    }

    .teacher-btn-quick:hover {
      background: #ffffff;
      border-color: #2563eb;
      transform: translateY(-1px);
    }

    /* Recent Activity List */
    .recent-activity-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .activity-row {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 8px 0;
      border-bottom: 1px solid var(--card-border, #e2e8f0);
    }

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

    .activity-icon-box {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .activity-icon-box.icon-green {
      background: #dcfce7;
    }

    .activity-icon-box.icon-purple {
      background: #faf5ff;
    }

    .activity-icon-box.icon-blue {
      background: #eff6ff;
    }

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

    .activity-title {
      font-size: 13px;
      color: var(--ink);
    }

    .activity-sub {
      font-size: 11.5px;
      color: var(--muted);
    }

    .activity-time {
      font-size: 11.5px;
      color: var(--muted);
      white-space: nowrap;
    }

    /* Group Progress */
    .group-progress-list {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .group-progress-row {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .group-name {
      font-size: 13px;
      font-weight: 700;
      color: var(--ink);
      width: 120px;
      flex-shrink: 0;
    }

    .group-bar-track {
      flex: 1;
      height: 8px;
      background: #e2e8f0;
      border-radius: 9999px;
      overflow: hidden;
    }

    .group-bar-fill {
      height: 100%;
      border-radius: 9999px;
      transition: width 0.4s ease;
    }

    .group-pct {
      font-size: 13px;
      font-weight: 800;
      color: var(--ink);
      width: 40px;
      text-align: right;
      flex-shrink: 0;
    }

    /* Screen 6 & 7: Curriculum Controls & Table */
    .curriculum-controls-bar {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .curriculum-month-switcher {
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 10px;
      padding: 4px 8px;
    }

    .btn-circle-nav {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: none;
      background: transparent;
      color: var(--ink);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }

    .btn-circle-nav:hover {
      background: var(--card-bg-subtle, #f1f5f9);
    }

    .curriculum-month-label {
      font-size: 13.5px;
      font-weight: 700;
      color: var(--ink);
      min-width: 90px;
      text-align: center;
    }

    .curriculum-table-card {
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 16px;
      padding: 20px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

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

    .curriculum-table th {
      text-align: left;
      padding: 12px 14px;
      font-size: 12px;
      font-weight: 700;
      color: var(--muted);
      border-bottom: 2px solid var(--card-border);
    }

    .curriculum-table td {
      padding: 14px;
      font-size: 13.5px;
      border-bottom: 1px solid var(--card-border);
    }

    .curriculum-table tr:hover td {
      background: var(--card-bg-subtle, #f8fafc);
    }

    .btn-action-icon {
      background: transparent;
      border: 1px solid transparent;
      padding: 6px;
      border-radius: 6px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s ease;
    }

    .btn-action-icon:hover {
      background: var(--card-bg-subtle, #f1f5f9);
      border-color: var(--card-border, #e2e8f0);
    }

    .btn-action-icon.danger:hover {
      background: #fee2e2;
      border-color: #fca5a5;
    }

    .curriculum-mobile-list {
      display: none;
      flex-direction: column;
      gap: 10px;
    }

    .curriculum-mob-card {
      background: var(--card-bg-subtle, #f8fafc);
      border: 1px solid var(--card-border, #e2e8f0);
      border-radius: 12px;
      padding: 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .curriculum-mob-date {
      font-size: 12px;
      font-family: 'JetBrains Mono', monospace;
      color: #2563eb;
      font-weight: 700;
      margin-bottom: 3px;
    }

    .curriculum-mob-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--ink);
    }

    @media (max-width: 768px) {
      .curriculum-table-card .table-responsive {
        display: none;
      }

      .curriculum-mobile-list {
        display: flex;
      }
    }



    /* =========================================================
   TEACHER LIVE QUIZ 7-COLUMN CLEAN MONITORING TABLE
   Columns: № (48px) | Студент (180-220px) | Топ (120-150px) |
            Статус (120px) | Сұрақ (80px) | Прогресс (110-130px) | Нәтиже (90-110px)
   ========================================================= */

    .live-monitoring-table {
      width: 100%;
      table-layout: auto;
      border-collapse: separate;
      border-spacing: 0;
    }

    .live-monitoring-table th:nth-child(1),
    .live-monitoring-table td:nth-child(1) {
      width: 48px;
      max-width: 48px;
      text-align: center;
    }

    .live-monitoring-table th:nth-child(2),
    .live-monitoring-table td:nth-child(2) {
      min-width: 180px;
      max-width: 220px;
    }

    .live-monitoring-table th:nth-child(3),
    .live-monitoring-table td:nth-child(3) {
      width: 130px;
      max-width: 150px;
    }

    .live-monitoring-table th:nth-child(4),
    .live-monitoring-table td:nth-child(4) {
      width: 120px;
      text-align: center;
    }

    .live-monitoring-table th:nth-child(5),
    .live-monitoring-table td:nth-child(5) {
      width: 80px;
      text-align: center;
    }

    .live-monitoring-table th:nth-child(6),
    .live-monitoring-table td:nth-child(6) {
      width: 120px;
      min-width: 110px;
    }

    .live-monitoring-table th:nth-child(7),
    .live-monitoring-table td:nth-child(7) {
      width: 100px;
      min-width: 90px;
      text-align: center;
    }

    /* Result dash */
    .result-dash {
      color: var(--muted);
      font-weight: 700;
      font-size: 14px;
    }

    /* Text ellipsis for student name & group to prevent table blowout */
    .live-monitoring-table .student-name-text {
      max-width: 160px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .live-monitoring-table .student-group-pill {
      max-width: 130px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: inline-block;
    }

    /* Mobile responsive rules for Teacher Live controls and cards */
    @media (max-width: 768px) {
      .live-controls-bar {
        flex-wrap: wrap !important;
        gap: 8px !important;
      }

      .live-controls-bar button {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
      }

      .per-question-setting-wrap {
        margin-left: 0 !important;
        width: 100%;
        justify-content: space-between;
      }

      .teacher-quiz-summary-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
      }
    }


    /* =========================================================
   TEACHER LIVE 3-STATE ARCHITECTURE (Lobby -> Active -> Finished)
   ========================================================= */

    .teacher-live-section {
      width: 100%;
      animation: sectionFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes sectionFadeIn {
      from {
        opacity: 0;
        transform: translateY(6px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* LOBBY GRID: 2 columns on desktop (QR left, Lobby right) */
    .teacher-lobby-grid {
      display: grid;
      grid-template-columns: 360px 1fr;
      gap: 20px;
      align-items: stretch;
    }

    @media (max-width: 900px) {
      .teacher-lobby-grid {
        grid-template-columns: 1fr;
        gap: 16px;
      }
    }

    /* Lobby Participants Card */
    .lobby-participants-card {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      min-height: 440px;
    }

    .lobby-students-wrap {
      flex: 1;
      min-height: 200px;
      max-height: 380px;
      overflow-y: auto;
      padding: 4px;
    }

    .lobby-empty-placeholder {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      height: 100%;
      min-height: 220px;
      text-align: center;
      color: var(--muted);
    }

    .lobby-students-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 10px;
    }

    .lobby-student-chip {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 12px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.04));
      border: 1px solid var(--card-border);
      border-radius: var(--radius-md, 10px);
      animation: chipEnterAnim 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      transition: transform 0.15s ease, border-color 0.15s ease;
    }

    .lobby-student-chip:hover {
      border-color: var(--brand-cyan, #0284c7);
      transform: translateY(-1px);
    }

    @keyframes chipEnterAnim {
      from {
        opacity: 0;
        transform: scale(0.92);
      }

      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    .lobby-student-name {
      font-size: 13.5px;
      font-weight: 700;
      color: var(--ink);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 130px;
    }

    .lobby-student-group {
      font-size: 11px;
      color: var(--muted);
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 130px;
    }

    /* ACTIVE MONITORING VIEW */
    .active-monitoring-header-card {
      padding: 18px 22px;
    }

    .active-monitoring-table-card {
      padding: 18px 20px;
      width: 100%;
      box-sizing: border-box;
    }

    .active-join-code-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 12px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.05));
      border: 1px solid var(--card-border);
      border-radius: 999px;
      font-size: 12.5px;
      transition: all 0.15s ease;
    }

    .active-join-code-pill:hover {
      background: rgba(56, 189, 248, 0.1);
      border-color: var(--brand-cyan, #0284c7);
    }

    /* Global Question Progress Bar */
    .global-progress-bar {
      width: 100%;
      height: 8px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.08));
      border-radius: 999px;
      overflow: hidden;
    }

    .global-progress-fill {
      height: 100%;
      background: linear-gradient(90deg, #0284c7, #6366f1);
      border-radius: 999px;
      transition: width 0.4s ease;
    }

    /* Paused Warning Banner */
    .active-paused-banner {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      background: rgba(245, 158, 11, 0.14);
      border: 1.5px solid rgba(245, 158, 11, 0.4);
      border-radius: var(--radius-md, 10px);
      color: #d97706;
    }

    [data-theme="dark"] .active-paused-banner {
      background: rgba(245, 158, 11, 0.18);
      border-color: rgba(245, 158, 11, 0.45);
      color: #fbbf24;
    }

    /* FINISHED RESULTS VIEW */
    .finished-award-icon-circle {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      background: rgba(245, 158, 11, 0.15);
      border: 2px solid rgba(245, 158, 11, 0.35);
      color: #f59e0b;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto;
    }

    /* =========================================================
   TEACHER COMMAND CENTER 2.0 (DASHBOARD REDESIGN)
========================================================= */

    /* Hero Header & Today Pill */
    .teacher-hero-head {
      padding-bottom: 4px;
    }

    .teacher-today-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 14px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.05));
      border: 1px solid var(--card-border);
      border-radius: 999px;
      font-size: 13px;
      font-weight: 700;
      color: var(--ink);
    }

    /* Compact Summary Strip */
    .teacher-summary-strip {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      padding: 10px 14px;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-md, 12px);
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    }

    .summary-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.04));
      border: 1px solid var(--card-border);
      border-radius: 999px;
      font-size: 12.5px;
      color: var(--muted);
      font-weight: 600;
    }

    .summary-pill b {
      color: var(--ink);
      font-weight: 800;
    }

    .summary-pill i {
      width: 14px;
      height: 14px;
      color: var(--brand-blue, #2563eb);
    }

    /* Today's Lessons Card & List */
    .teacher-today-lessons-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    /* Compact Two-Column Timeline Layout for Teacher Dashboard Today's Lessons */
    .teacher-today-columns {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      width: 100%;
      align-items: start;
    }

    @media (max-width: 768px) {
      .teacher-today-columns {
        grid-template-columns: 1fr;
        gap: 14px;
      }
    }

    .today-group-col {
      display: flex;
      flex-direction: column;
      min-width: 0;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.02));
      border: 1px solid var(--card-border);
      border-radius: var(--radius-md, 12px);
      padding: 10px 12px;
      box-sizing: border-box;
    }

    .today-group-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-height: 42px;
      padding-bottom: 8px;
      margin-bottom: 8px;
      border-bottom: 1px solid var(--card-border);
      gap: 8px;
      box-sizing: border-box;
    }

    .today-group-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13.5px;
      font-weight: 800;
      color: var(--ink);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .today-group-icon {
      width: 16px;
      height: 16px;
      color: var(--brand-indigo, #3b82f6);
      flex-shrink: 0;
    }

    .today-group-badge {
      font-size: 11px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 999px;
      background: var(--card-bg, #1e293b);
      border: 1px solid var(--card-border);
      color: var(--muted);
      white-space: nowrap;
      flex-shrink: 0;
    }

    .today-timeline {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .today-timeline-item {
      display: flex;
      gap: 8px;
      position: relative;
    }

    .today-timeline-marker {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 12px;
      flex-shrink: 0;
      padding-top: 10px;
    }

    .today-timeline-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--muted, #94a3b8);
      flex-shrink: 0;
      transition: all 0.2s ease;
    }

    .today-timeline-dot.is-current {
      background: #10b981;
      box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
      transform: scale(1.2);
    }

    .today-timeline-dot.is-finished {
      background: var(--muted, #94a3b8);
      opacity: 0.45;
    }

    .today-timeline-line {
      flex: 1;
      width: 1px;
      background: var(--card-border);
      margin-top: 4px;
    }

    .today-timeline-item:last-child .today-timeline-line {
      display: none;
    }

    .today-lesson-card {
      flex: 1;
      min-width: 0;
      background: var(--card-bg, #1e293b);
      border: 1px solid var(--card-border);
      border-radius: var(--radius-sm, 8px);
      padding: 8px 10px;
      display: flex;
      flex-direction: column;
      gap: 4px;
      transition: border-color 0.15s ease, background 0.15s ease;
      box-sizing: border-box;
    }

    .today-lesson-card:hover {
      border-color: rgba(99, 102, 241, 0.4);
    }

    .today-lesson-card.is-current {
      border-color: rgba(16, 185, 129, 0.45);
      background: rgba(16, 185, 129, 0.04);
    }

    .today-lesson-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
    }

    .today-lesson-time-wrap {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 11.5px;
      font-weight: 800;
      color: var(--brand-cyan, #0284c7);
      white-space: nowrap;
    }

    .today-time-icon {
      width: 12px;
      height: 12px;
      color: var(--muted);
      flex-shrink: 0;
    }

    .today-lesson-num {
      font-size: 10.5px;
      font-weight: 800;
      padding: 1.5px 6px;
      background: rgba(99, 102, 241, 0.12);
      color: var(--brand-indigo, #6366f1);
      border-radius: 4px;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .today-lesson-body {
      display: flex;
      flex-direction: column;
      gap: 3px;
      min-width: 0;
    }

    .today-lesson-subject {
      font-size: 12.5px;
      font-weight: 700;
      color: var(--ink);
      line-height: 1.35;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      word-break: break-word;
    }

    .today-lesson-bottom {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      margin-top: 1px;
    }

    .today-lesson-room {
      font-size: 11px;
      color: var(--muted);
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .today-lesson-bottom .lesson-status-badge {
      padding: 2px 8px;
      font-size: 10.5px;
      font-weight: 700;
      gap: 4px;
    }

    .today-empty-group {
      padding: 16px 8px;
      text-align: center;
      color: var(--muted);
      font-size: 12px;
      font-style: italic;
    }

    /* Light Theme overrides */
    [data-theme="light"] .today-group-col {
      background: #f8fafc;
      border-color: #e2e8f0;
    }

    [data-theme="light"] .today-lesson-card {
      background: #ffffff;
      border-color: #e2e8f0;
    }

    [data-theme="light"] .today-group-badge {
      background: #ffffff;
      border-color: #cbd5e1;
      color: #64748b;
    }


    .teacher-lesson-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.03));
      border: 1px solid var(--card-border);
      border-radius: var(--radius-md, 12px);
      gap: 14px;
      flex-wrap: wrap;
      transition: all 0.15s ease;
    }

    .teacher-lesson-row:hover {
      border-color: rgba(37, 99, 235, 0.4);
      background: rgba(37, 99, 235, 0.03);
    }

    .lesson-time-col {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-family: 'JetBrains Mono', monospace;
      font-size: 13px;
      font-weight: 800;
      color: var(--brand-cyan, #0284c7);
      white-space: nowrap;
      min-width: 120px;
    }

    .lesson-clock-icon {
      width: 15px;
      height: 15px;
      color: var(--muted);
    }

    .lesson-main-info {
      flex: 1;
      min-width: 220px;
    }

    .lesson-subject-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 14px;
      color: var(--ink);
      word-break: break-word;
    }

    .lesson-order-tag {
      font-size: 11px;
      font-weight: 800;
      padding: 2px 7px;
      background: rgba(37, 99, 235, 0.12);
      color: var(--brand-blue, #2563eb);
      border-radius: 6px;
      white-space: nowrap;
    }

    .lesson-sub-meta {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 4px;
    }

    .lesson-group-pill {
      font-size: 11.5px;
      font-weight: 700;
      color: var(--ink);
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      padding: 1px 7px;
      border-radius: 6px;
    }

    .lesson-room-pill {
      font-size: 11px;
      color: var(--muted);
      font-weight: 600;
    }

    .lesson-status-col {
      flex-shrink: 0;
    }

    /* Status Badges */
    .lesson-status-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 12px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 800;
      white-space: nowrap;
    }

    .lesson-status-badge.badge-current {
      background: rgba(16, 185, 129, 0.15);
      border: 1px solid rgba(16, 185, 129, 0.35);
      color: #10b981;
    }

    .lesson-status-badge.badge-next {
      background: rgba(2, 132, 199, 0.14);
      border: 1px solid rgba(2, 132, 199, 0.35);
      color: #0284c7;
    }

    .lesson-status-badge.badge-upcoming {
      background: rgba(148, 163, 184, 0.12);
      border: 1px solid var(--card-border);
      color: var(--muted);
    }

    .lesson-status-badge.badge-finished {
      background: rgba(100, 116, 139, 0.1);
      border: 1px solid var(--card-border);
      color: var(--muted);
    }

    .live-dot-pulse {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #10b981;
      box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
      animation: dotPulseAnim 1.4s ease-in-out infinite;
    }

    @keyframes dotPulseAnim {

      0%,
      100% {
        transform: scale(1);
        opacity: 1;
      }

      50% {
        transform: scale(1.35);
        opacity: 0.6;
      }
    }

    /* Urgent Actionable Items */
    .urgent-actions-grid {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .urgent-action-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.03));
      border: 1px solid var(--card-border);
      border-radius: var(--radius-md, 12px);
      gap: 14px;
      flex-wrap: wrap;
      transition: all 0.15s ease;
    }

    .urgent-action-row:hover {
      border-color: rgba(245, 158, 11, 0.4);
    }

    .urgent-icon-col {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      border: 1px solid transparent;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .urgent-body-col {
      flex: 1;
      min-width: 220px;
    }

    .urgent-header-line {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }

    .urgent-category-badge {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 2px 7px;
      background: var(--card-bg);
      border: 1px solid var(--card-border);
      border-radius: 6px;
      color: var(--muted);
    }

    .urgent-title-text {
      font-size: 13.5px;
      font-weight: 700;
      color: var(--ink);
    }

    .urgent-sub-text {
      font-size: 12px;
      color: var(--muted);
      margin-top: 3px;
      line-height: 1.35;
    }

    .urgent-action-col {
      flex-shrink: 0;
    }

    /* Curriculum 3-Column Summary */
    .curriculum-summary-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 10px;
    }

    .curriculum-summary-col {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 10px 8px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.03));
      border: 1px solid var(--card-border);
      border-radius: 10px;
      text-align: center;
    }

    .cur-label {
      font-size: 11.5px;
      color: var(--muted);
      font-weight: 700;
    }

    .cur-val {
      font-size: 14.5px;
      font-weight: 800;
      color: var(--ink);
      margin-top: 2px;
    }

    /* Compact Quick Actions Toolbar */
    .teacher-quick-compact-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .btn-quick-compact {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 12px 14px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.03));
      border: 1px solid var(--card-border);
      border-radius: 10px;
      color: var(--ink);
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.15s ease;
      text-align: left;
    }

    .btn-quick-compact:hover {
      background: rgba(37, 99, 235, 0.08);
      border-color: var(--brand-blue, #2563eb);
      transform: translateY(-1px);
    }

    .btn-quick-compact i {
      width: 17px;
      height: 17px;
      flex-shrink: 0;
    }

    /* Mobile Responsiveness for Teacher Command Center */
    @media (max-width: 768px) {
      .teacher-summary-strip {
        justify-content: space-between;
      }

      .summary-pill {
        flex: 1 1 45%;
        justify-content: center;
      }

      .teacher-lesson-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
      }

      .lesson-status-col {
        align-self: flex-start;
      }

      .urgent-action-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
      }

      .urgent-action-col {
        width: 100%;
      }

      .urgent-action-col .btn {
        width: 100%;
        justify-content: center;
      }

      .teacher-quick-compact-grid {
        grid-template-columns: 1fr;
      }
    }

    /* =========================================================
       TEACHER LIVE QUIZ TOP HORIZONTAL MUSIC TOOLBAR (Phase 43)
       Clean, compact horizontal toolbar replacing top statusbar
       ========================================================= */
    .teacher-live-music-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      margin-bottom: 16px;
      padding: 8px 14px;
      background: var(--card-bg, #ffffff);
      border: 1px solid var(--card-border, #e2e8f0);
      border-radius: 12px;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
      min-height: 48px;
      box-sizing: border-box;
    }

    .music-toolbar-left {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
    }

    .music-toolbar-label {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 13px;
      font-weight: 700;
      color: var(--muted);
      white-space: nowrap;
    }

    .music-toolbar-icon {
      width: 15px;
      height: 15px;
      color: var(--primary, #6366f1);
      flex-shrink: 0;
    }

    /* Custom BQ24-styled Select dropdown */
    .music-select-custom {
      height: 34px;
      border-radius: 10px;
      background-color: var(--card-bg, #18181b);
      border: 1px solid var(--card-border, rgba(255, 255, 255, 0.12));
      color: var(--ink, #ffffff);
      font-size: 13px;
      font-weight: 600;
      padding: 0 32px 0 12px;
      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;
      cursor: pointer;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 10px center;
      background-size: 15px 15px;
      min-width: 145px;
    }

    .music-select-custom:hover {
      border-color: var(--primary, #6366f1);
    }

    .music-select-custom:focus {
      outline: none;
      border-color: var(--primary, #6366f1);
      box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    }

    .music-toolbar-right {
      display: inline-flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    /* Play / Pause Toggle Button */
    .btn-music-play {
      height: 34px;
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 0 14px;
      border-radius: 10px;
      font-size: 12.5px;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      user-select: none;
      white-space: nowrap;
    }

    .btn-music-play .btn-icon {
      width: 14px;
      height: 14px;
      flex-shrink: 0;
    }

    /* OFF State */
    .btn-music-play.is-off {
      background: var(--card-bg, #ffffff);
      border: 1px solid var(--card-border, #e2e8f0);
      color: var(--primary, #6366f1);
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    .btn-music-play.is-off:hover {
      background: var(--card-bg-subtle, rgba(99, 102, 241, 0.06));
      border-color: var(--primary, #6366f1);
      color: var(--primary, #6366f1);
      transform: translateY(-1px);
    }

    /* ON State */
    .btn-music-play.is-on {
      background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
      border: 1px solid #4338ca;
      color: #ffffff;
      box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35), 0 0 12px rgba(99, 102, 241, 0.25);
      animation: pulse-music-play 2.2s infinite ease-in-out;
    }

    @keyframes pulse-music-play {
      0%, 100% { box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35), 0 0 12px rgba(99, 102, 241, 0.25); }
      50% { box-shadow: 0 3px 12px rgba(99, 102, 241, 0.55), 0 0 18px rgba(99, 102, 241, 0.38); }
    }

    .btn-music-play.is-on:hover {
      filter: brightness(1.08);
      transform: translateY(-1px);
    }

    /* Volume Control with Mute & Slider */
    .music-toolbar-volume {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 3px 10px 3px 6px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.04));
      border: 1px solid var(--card-border);
      border-radius: 999px;
      height: 34px;
      box-sizing: border-box;
    }

    .btn-music-mute {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
      border: none;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      padding: 0;
      transition: color 0.15s ease, transform 0.15s ease;
      flex-shrink: 0;
    }

    .btn-music-mute i,
    .btn-music-mute svg {
      width: 15px;
      height: 15px;
    }

    .btn-music-mute:hover {
      color: var(--primary, #6366f1);
      transform: scale(1.1);
    }

    .btn-music-mute.is-muted {
      color: #ef4444;
    }

    .music-range-slider {
      -webkit-appearance: none;
      appearance: none;
      width: 75px;
      height: 4px;
      border-radius: 999px;
      background: linear-gradient(to right, #6366f1 0%, #6366f1 25%, var(--card-border) 25%, var(--card-border) 100%);
      outline: none;
      cursor: pointer;
      transition: background 0.15s ease;
    }

    .music-range-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 13px;
      height: 13px;
      border-radius: 50%;
      background: #6366f1;
      box-shadow: 0 0 5px rgba(99, 102, 241, 0.45);
      cursor: pointer;
      transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .music-range-slider::-webkit-slider-thumb:hover {
      transform: scale(1.25);
      box-shadow: 0 0 8px rgba(99, 102, 241, 0.65);
    }

    .music-range-slider::-moz-range-thumb {
      width: 13px;
      height: 13px;
      border-radius: 50%;
      background: #6366f1;
      border: none;
      box-shadow: 0 0 5px rgba(99, 102, 241, 0.45);
      cursor: pointer;
      transition: transform 0.15s ease, box-shadow 0.15s ease;
    }

    .music-volume-display {
      font-size: 11.5px;
      font-weight: 800;
      color: var(--muted);
      min-width: 32px;
      font-variant-numeric: tabular-nums;
    }

    /* Active monitoring compact pill */
    .active-music-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      background: var(--card-bg-subtle, rgba(255, 255, 255, 0.04));
      border: 1px solid var(--card-border);
      border-radius: 999px;
      font-size: 12px;
    }

    /* Mobile responsive layout */
    @media (max-width: 768px) {
      .teacher-live-music-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
      }
      .music-toolbar-left {
        justify-content: space-between;
      }
      .music-select-custom {
        flex: 1;
      }
      .music-toolbar-right {
        justify-content: space-between;
      }
      .btn-music-play {
        flex: 1;
        justify-content: center;
      }
    }

/* =========================================================
   GROUP RECENT RESULTS COMPONENT (Teacher Dashboard)
   Modern, card-based compact results list
   ========================================================= */

.group-results-card {
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg, 14px);
  margin-top: 18px;
}

.group-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--card-border);
}

.group-results-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-results-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--brand-violet, #6366f1);
  flex-shrink: 0;
}

.group-results-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
  line-height: 1.25;
}

.group-results-subtitle {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 500;
}

.group-results-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card-bg-subtle, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--card-border);
  padding: 4px 10px;
  border-radius: 999px;
}

.group-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Individual Result Item */
.group-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.group-result-item:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: var(--card-bg-subtle, rgba(255, 255, 255, 0.02));
}

/* 1. Student Identity */
.group-result-student {
  flex: 1 1 200px;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.group-result-student-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  word-break: break-word;
}

.group-result-student-group {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

/* 2. Primary Percentage Metric */
.group-result-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 0 8px;
  text-align: center;
}

.group-result-pct {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.group-result-score-label {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 3. Answers: Correct & Wrong */
.group-result-answers {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 140px;
}

.group-result-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-result-stat .stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
}

.group-result-stat.stat-correct .stat-icon {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green, #10b981);
}

.group-result-stat.stat-wrong .stat-icon {
  background: rgba(244, 63, 94, 0.12);
  color: var(--red, #f43f5e);
}

.group-result-stat .stat-details {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.group-result-stat .stat-value {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.group-result-stat .stat-label {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
}

/* 4. Timestamp */
.group-result-time {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  min-width: 105px;
  flex-shrink: 0;
}

.group-result-time .time-icon {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

.group-result-time .time-text {
  font-weight: 500;
}

/* 5. Status Badge */
.group-result-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 90px;
  flex-shrink: 0;
}

.result-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 6px;
  line-height: 1;
  border: 1px solid transparent;
}

.result-status-badge.status-passed {
  background: rgba(16, 185, 129, 0.10);
  color: var(--green, #10b981);
  border-color: rgba(16, 185, 129, 0.22);
}

.result-status-badge.status-retake {
  background: rgba(244, 63, 94, 0.10);
  color: var(--red, #f43f5e);
  border-color: rgba(244, 63, 94, 0.22);
}

/* Empty State */
.group-results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
  gap: 8px;
}

.group-results-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--card-bg-subtle, rgba(255, 255, 255, 0.04));
  color: var(--muted);
}

.group-results-empty-text {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
}

/* Responsive Breakpoints */
@media (max-width: 860px) {
  .group-result-item {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 14px;
  }
  .group-result-student {
    flex: 1 1 calc(100% - 100px);
  }
  .group-result-score {
    order: 2;
    margin-left: auto;
  }
  .group-result-answers {
    order: 3;
    flex: 1 1 auto;
  }
  .group-result-time {
    order: 4;
  }
  .group-result-status {
    order: 5;
    margin-left: auto;
  }
}

@media (max-width: 540px) {
  .group-result-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 8px;
  }
  .group-result-student {
    grid-column: 1 / 2;
  }
  .group-result-score {
    grid-column: 2 / 3;
    align-items: flex-end;
    text-align: right;
  }
  .group-result-answers {
    grid-column: 1 / 2;
    gap: 12px;
  }
  .group-result-time {
    grid-column: 1 / 2;
  }
  .group-result-status {
    grid-column: 2 / 3;
    justify-content: flex-end;
  }
}

/* =========================================================
   TEACHER GROUP DETAIL: STUDENTS TABLE
   Clean SaaS Data Table inside Group Detail card
   ========================================================= */

.group-students-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px 0;
  letter-spacing: -0.2px;
}

.group-students-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0;
}

.group-students-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.4;
  border: none;
}

/* Table Header */
.group-students-table thead th {
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  padding: 8px 12px 10px 12px;
  border-bottom: 1px solid var(--card-border);
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.group-students-table thead th.th-num {
  width: 40px;
  padding-left: 4px;
}

.group-students-table thead th.th-name {
  min-width: 200px;
}

.group-students-table thead th.th-group {
  width: 140px;
}

.group-students-table thead th.th-tests {
  width: 90px;
  text-align: center;
}

.group-students-table thead th.th-avg {
  width: 110px;
  text-align: right;
  padding-right: 6px;
}

/* Table Rows */
.group-students-table tbody tr {
  height: 42px;
  border-bottom: 1px solid var(--card-border);
  transition: background 150ms ease;
}

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

.group-students-table tbody tr:hover {
  background: var(--card-bg-subtle, rgba(255, 255, 255, 0.025));
}

.group-students-table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
}

/* Cell Specifics */
.group-students-table tbody td.td-num {
  width: 40px;
  padding-left: 4px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.group-students-table tbody td.td-name {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.group-students-table tbody td.td-group {
  white-space: nowrap;
}

.group-students-table .student-group-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--card-bg-subtle, rgba(99, 102, 241, 0.06));
  border: 1px solid var(--card-border);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.25;
}

.group-students-table tbody td.td-tests {
  text-align: center;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.group-students-table tbody td.td-avg {
  text-align: right;
  padding-right: 6px;
  font-variant-numeric: tabular-nums;
}

.group-students-table tbody td.td-avg b {
  font-weight: 600;
  font-size: 13.5px;
}

.group-students-table .empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 24px 12px;
  font-size: 13px;
}

/* =========================================================
   TOPIC ASSIGNMENT INTERACTIVE CALENDAR DATE PICKER (Phase 4 & 5)
========================================================= */
.bind-calendar-card {
  background: var(--card-bg-subtle, #f8fafc);
  border: 1px solid var(--card-border, #e2e8f0);
  border-radius: 16px;
  padding: 16px;
  margin-top: 6px;
  margin-bottom: 12px;
}

.bind-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.bind-calendar-month-label {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.bind-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  margin-bottom: 8px;
}

.bind-calendar-weekdays span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  padding: 4px 0;
}

.bind-calendar-weekdays span.weekend {
  color: #ef4444;
  opacity: 0.85;
}

.bind-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.bind-calendar-day {
  height: 40px;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  user-select: none;
}

.bind-calendar-day:hover:not(:disabled) {
  background: var(--card-bg, #ffffff);
  border-color: var(--card-border, #cbd5e1);
}

.bind-calendar-day.other-month {
  color: var(--muted);
  opacity: 0.35;
  cursor: default;
}

.bind-calendar-day.weekend:not(.selected) {
  color: #ef4444;
}

.bind-calendar-day.today:not(.selected) {
  border-color: var(--brand-blue, #2563eb);
  font-weight: 800;
}

.bind-calendar-day.today:not(.selected)::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand-blue, #2563eb);
}

.bind-calendar-day.selected {
  background: var(--brand-blue, #2563eb) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border-color: var(--brand-blue, #2563eb) !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
}

.bind-calendar-day.selected::after {
  display: none;
}

.bind-calendar-day:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.bind-calendar-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card-bg-subtle, #f8fafc);
  border: 1px solid var(--card-border, #e2e8f0);
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.2s ease;
}

.bind-calendar-preview.has-date {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--brand-blue, #2563eb);
}

.bind-calendar-preview.has-date .preview-text {
  color: var(--ink);
  font-weight: 800;
}

.bind-confirm-box {
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 16px;
  padding: 22px 18px;
  margin-bottom: 8px;
  text-align: center;
}

.bind-confirm-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
}

.bind-confirm-subtitle {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 440px;
  margin: 0 auto 18px;
}

@media (max-width: 480px) {
  .bind-calendar-day {
    height: 44px;
    min-height: 44px;
    font-size: 14px;
  }
}

/* ==========================================================================
   TEACHER TYPING RESULTS & ANALYTICS DASHBOARD
   ========================================================================== */

.teacher-typing-dashboard-wrap {
  width: 100%;
  animation: fadeIn 0.25s ease-out;
}

/* 1. Top 5 KPI Cards Grid */
.teacher-typing-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.teacher-typing-kpi-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--card-border, #e2e8f0);
  border-radius: var(--radius-lg, 16px);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.teacher-typing-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.teacher-typing-kpi-card .kpi-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.teacher-typing-kpi-card .kpi-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.teacher-typing-kpi-card .kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #64748b);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.teacher-typing-kpi-card .kpi-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink, #0f172a);
  line-height: 1.2;
}

.teacher-typing-kpi-card .kpi-sub {
  font-size: 11.5px;
  color: var(--muted, #64748b);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 2. Filters & Search Toolbar */
.teacher-typing-filters-card {
  padding: 16px 18px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
}

.teacher-typing-filters-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

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

.filters-row-top .filter-group-search {
  flex: 1 1 320px;
  min-width: 200px;
}

.filters-row-top .filter-group-sort {
  flex: 0 0 220px;
  min-width: 190px;
}

.filters-row-top .filter-group-btn {
  flex-shrink: 0;
}

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

.filters-row-bottom .filter-group {
  flex: 1 1 140px;
  min-width: 125px;
}

/* Fallback for single-row grid */
.teacher-typing-filters-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.8fr) minmax(130px, 1fr) minmax(115px, 0.9fr) minmax(130px, 1fr) minmax(120px, 0.9fr) minmax(170px, 1.3fr) auto;
  gap: 12px;
  align-items: flex-end;
}

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

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.filter-col-search {
  flex: 1 1 240px;
  min-width: 200px;
}

.filter-col-item {
  flex: 1 1 130px;
  min-width: 120px;
}

.filter-col-btn {
  flex-shrink: 0;
}

.filter-field-label,
.filter-col-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted, #64748b);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.filter-label-spacer {
  visibility: hidden;
}

/* Unified BQ24 Form Controls */
.teacher-typing-control,
.teacher-typing-filters-card .input-field {
  width: 100%;
  height: 40px !important;
  box-sizing: border-box;
  padding: 0 12px !important;
  background-color: #ffffff !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  border-radius: 10px !important;
  color: var(--ink, #0f172a) !important;
  font-size: 13.5px !important;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  line-height: normal;
}

.teacher-typing-control:hover,
.teacher-typing-filters-card .input-field:hover {
  border-color: #cbd5e1 !important;
}

.teacher-typing-control:focus,
.teacher-typing-filters-card .input-field:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
  background-color: #ffffff !important;
}

.teacher-typing-select,
.teacher-typing-filters-card select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  padding-right: 32px !important;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 11px center !important;
  background-size: 14px 14px !important;
}

.typing-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.typing-search-input-wrap .typing-search-icon {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--muted, #94a3b8);
  pointer-events: none;
}

.typing-search-input-wrap .typing-search-input {
  padding-left: 36px !important;
}

/* Harmonious Filter Reset Button */
.btn-filter-reset {
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--card-bg-subtle, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  color: var(--ink-secondary, #475569);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-sizing: border-box;
  flex-shrink: 0;
}

.btn-filter-reset:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: var(--ink, #0f172a);
}

.btn-filter-reset:active {
  transform: scale(0.98);
}

.btn-filter-reset .reset-icon {
  width: 14px;
  height: 14px;
}

/* Responsive Filters Breakpoints */
@media (max-width: 992px) {
  .filters-row-top,
  .filters-row-bottom {
    flex-wrap: wrap;
  }
  .filters-row-top .filter-group-sort {
    flex: 1 1 180px;
  }
  .filters-row-bottom .filter-group {
    flex: 1 1 140px;
  }
}

@media (max-width: 640px) {
  .filters-row-top,
  .filters-row-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .filters-row-top .filter-group-search,
  .filters-row-top .filter-group-sort,
  .filters-row-bottom .filter-group {
    width: 100%;
  }
  .filter-label-spacer {
    display: none;
  }
  .btn-filter-reset {
    width: 100%;
  }
}

/* 3. Table Styling & Full Desktop Fit */
.teacher-app-content {
  max-width: 1440px !important;
}

.teacher-typing-table-card {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--border, #e2e8f0);
  background: var(--card-bg, #ffffff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
}

.teacher-typing-table-card .table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.teacher-typing-table-card .table-responsive::-webkit-scrollbar {
  height: 6px;
}

.teacher-typing-table-card .table-responsive::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 999px;
}

.teacher-typing-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  table-layout: auto;
}

.teacher-typing-table th {
  background: var(--card-bg-subtle, #f8fafc);
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  white-space: nowrap;
}

.teacher-typing-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  color: var(--ink, #0f172a);
  vertical-align: middle;
}

.teacher-typing-table tbody tr:hover {
  background: rgba(37, 99, 235, 0.03);
}

/* Column Rules */
.teacher-typing-table th.th-num,
.teacher-typing-table td.col-num-cell {
  width: 34px;
  padding-left: 14px;
  text-align: center;
  font-weight: 700;
  color: var(--muted, #94a3b8);
  font-size: 12px;
}

.teacher-typing-table th.th-student,
.teacher-typing-table td.col-student-cell {
  min-width: 170px;
}

.teacher-typing-table th.th-wpm,
.teacher-typing-table td.col-wpm {
  width: 78px;
  white-space: nowrap;
}

.teacher-typing-table th.th-cpm,
.teacher-typing-table td.col-cpm {
  width: 50px;
  font-weight: 700;
}

.teacher-typing-table th.th-acc,
.teacher-typing-table td.col-acc {
  width: 68px;
  text-align: center;
}

.teacher-typing-table th.th-mistakes,
.teacher-typing-table td.col-mistakes {
  width: 46px;
  text-align: center;
  color: #ef4444;
  font-weight: 700;
}

.teacher-typing-table th.th-correct,
.teacher-typing-table td.col-correct {
  width: 76px;
  text-align: center;
  color: #10b981;
  font-weight: 700;
}

.teacher-typing-table th.th-duration,
.teacher-typing-table td.col-duration {
  width: 60px;
  text-align: center;
}

.teacher-typing-table th.th-lang,
.teacher-typing-table td.col-lang {
  width: 60px;
  text-align: center;
}

.teacher-typing-table th.th-date,
.teacher-typing-table td.col-date {
  width: 110px;
  font-size: 12px;
  color: var(--muted, #64748b);
  white-space: nowrap;
}

.teacher-typing-table th.th-action,
.teacher-typing-table td.col-action {
  width: 90px;
  text-align: center;
  padding-right: 14px;
  white-space: nowrap;
}

.teacher-student-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.student-mini-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-blue, #2563eb);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.student-meta-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.student-full-name {
  font-weight: 700;
  color: var(--ink, #0f172a);
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-group-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #64748b);
  background: rgba(100, 116, 139, 0.1);
  padding: 1px 6px;
  border-radius: 6px;
}

.wpm-highlight {
  font-size: 16px;
  font-weight: 800;
  color: #d97706;
}

.unit-sub {
  font-size: 11px;
  color: var(--muted, #94a3b8);
  font-weight: 500;
}

.typing-acc-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.typing-acc-pill.acc-high {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.typing-acc-pill.acc-med {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.typing-acc-pill.acc-low {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.badge-neutral {
  display: inline-block;
  padding: 2px 7px;
  background: var(--border, #e2e8f0);
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink, #0f172a);
}

.badge-lang {
  display: inline-block;
  padding: 2px 7px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
}

.btn-analyze {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid rgba(37, 99, 235, 0.2);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-analyze:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.teacher-table-footer {
  padding: 12px 18px;
  background: var(--card-bg-subtle, #f8fafc);
  border-top: 1px solid var(--border, #e2e8f0);
  font-size: 12.5px;
  color: var(--muted, #64748b);
  display: flex;
  justify-content: flex-end;
}

/* 4. Student Analysis Modal */
.teacher-student-analysis-card {
  max-width: 780px !important;
  width: 95% !important;
  border-radius: 20px !important;
}

.student-stat-triplet {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-triplet-box {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--card-bg, #ffffff);
}

.stat-triplet-box.best {
  border-color: rgba(217, 119, 6, 0.3);
  background: rgba(217, 119, 6, 0.04);
}

.stat-triplet-box.latest {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.04);
}

.stat-triplet-box.avg {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.04);
}

.triplet-badge {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted, #64748b);
  margin-bottom: 4px;
}

.triplet-main-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink, #0f172a);
}

.triplet-meta {
  font-size: 12.5px;
  color: var(--muted, #64748b);
  margin-top: 4px;
}

.triplet-date {
  font-size: 11.5px;
  color: var(--muted, #94a3b8);
  margin-top: 2px;
}

.is-best-attempt-row {
  background: rgba(217, 119, 6, 0.06) !important;
}

.badge-best-mini {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  color: #d97706;
  background: rgba(217, 119, 6, 0.15);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}

.teacher-typing-table.mini th {
  padding: 8px 10px;
  font-size: 11px;
}

.teacher-typing-table.mini td {
  padding: 8px 10px;
  font-size: 12.5px;
}
