/* ==========================================================================
   IELTS CORE TEACHER WORKSPACE & GRADING STUDIO - MODERN SAAS STYLES
   ========================================================================== */

* {
  box-sizing: border-box;
}

body.teacher-app-body {
  margin: 0;
  padding: 0;
  background: #f8fafc;
  color: #0f172a;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] body.teacher-app-body {
  background: #090d16;
  color: #f1f5f9;
}

/* 1. TEACHER APP LAYOUT */
.teacher-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* 2. LEFT SIDEBAR */
.teacher-sidebar {
  width: 260px;
  min-width: 260px;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  user-select: none;
  z-index: 50;
}

html[data-theme="dark"] .teacher-sidebar {
  background: #0b1320;
  border-color: #1e293b;
}

.teacher-sidebar-top {
  padding: 18px 18px 14px;
  border-bottom: 1px solid #f1f5f9;
}

html[data-theme="dark"] .teacher-sidebar-top {
  border-color: #1e293b;
}

.teacher-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 12px;
}

.teacher-brand-mark {
  width: 34px;
  height: 34px;
  background: #1468f3;
  color: #ffffff;
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  box-shadow: 0 4px 12px rgba(20, 104, 243, 0.3);
}

.teacher-brand-text {
  display: flex;
  flex-direction: column;
}

.teacher-brand-name {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

html[data-theme="dark"] .teacher-brand-name {
  color: #f8fafc;
}

.teacher-brand-tag {
  font-size: 10px;
  font-weight: 800;
  color: #1468f3;
  letter-spacing: 0.05em;
}

/* Primary Action Button in Sidebar */
.teacher-sidebar-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #1468f3;
  color: #ffffff;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(20, 104, 243, 0.25);
  transition: all 0.15s ease;
}

.teacher-sidebar-cta:hover {
  background: #0c57d3;
  box-shadow: 0 4px 14px rgba(20, 104, 243, 0.38);
  transform: translateY(-1px);
}

.teacher-sidebar-cta:active {
  transform: translateY(0);
}

.teacher-sidebar-cta .material-symbols-outlined {
  font-size: 18px;
}

html[data-theme="dark"] .teacher-sidebar-cta {
  background: #2563eb;
  color: #ffffff;
}

html[data-theme="dark"] .teacher-sidebar-cta:hover {
  background: #1d4ed8;
}

/* Sidebar Nav */
.teacher-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.teacher-nav-group-title {
  font-size: 10.5px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.06em;
  padding: 8px 10px 4px;
}

.teacher-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  background: transparent;
  border: 0;
  width: 100%;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.teacher-nav-item .material-symbols-outlined {
  font-size: 18px;
  color: #64748b;
  transition: color 0.15s;
}

.teacher-nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.teacher-nav-item:hover .material-symbols-outlined {
  color: #1468f3;
}

html[data-theme="dark"] .teacher-nav-item {
  color: #94a3b8;
}

html[data-theme="dark"] .teacher-nav-item:hover {
  background: #1e293b;
  color: #f8fafc;
}

.teacher-nav-item.active {
  background: #eff6ff;
  color: #1468f3;
  font-weight: 700;
}

.teacher-nav-item.active .material-symbols-outlined {
  color: #1468f3;
}

html[data-theme="dark"] .teacher-nav-item.active {
  background: rgba(20, 104, 243, 0.15);
  color: #60a5fa;
}

html[data-theme="dark"] .teacher-nav-item.active .material-symbols-outlined {
  color: #60a5fa;
}

.teacher-nav-badge {
  margin-left: auto;
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.teacher-nav-badge-amber {
  background: #fef3c7;
  color: #b45309;
}

/* Sidebar User Footer */
.teacher-sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}

html[data-theme="dark"] .teacher-sidebar-user {
  border-color: #1e293b;
}

.teacher-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1468f3;
  color: #ffffff;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.teacher-user-meta {
  flex: 1;
  min-width: 0;
}

.teacher-user-name {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .teacher-user-name {
  color: #f8fafc;
}

.teacher-user-handle {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3. MAIN WORKSPACE */
.teacher-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: #f8fafc;
}

html[data-theme="dark"] .teacher-main {
  background: #090d16;
}

/* Top Command Bar */
.teacher-topbar {
  height: 60px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  flex-shrink: 0;
  gap: 16px;
}

html[data-theme="dark"] .teacher-topbar {
  background: #0b1320;
  border-color: #1e293b;
}

.teacher-topbar-left {
  display: flex;
  flex-direction: column;
}

.teacher-topbar-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  color: #0f172a;
  letter-spacing: -0.02em;
}

html[data-theme="dark"] .teacher-topbar-title {
  color: #f8fafc;
}

.teacher-topbar-breadcrumb {
  font-size: 11.5px;
  color: #64748b;
}

.teacher-topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 14px;
  width: 320px;
  transition: all 0.15s;
}

.teacher-topbar-search:focus-within {
  background: #ffffff;
  border-color: #1468f3;
  box-shadow: 0 0 0 3px rgba(20, 104, 243, 0.15);
}

html[data-theme="dark"] .teacher-topbar-search {
  background: #0f172a;
  border-color: #1e293b;
}

.teacher-topbar-search input {
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13px;
  width: 100%;
  color: inherit;
}

.teacher-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Scrollable Body */
.teacher-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 80px;
}

/* 4. METRIC CARDS */
.teacher-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

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

@media (max-width: 640px) {
  .teacher-metric-grid { grid-template-columns: 1fr; }
}

.teacher-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  transition: all 0.15s ease;
}

.teacher-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] .teacher-stat-card {
  background: #0f172a;
  border-color: #1e293b;
}

.teacher-stat-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.teacher-stat-icon-wrap .material-symbols-outlined {
  font-size: 20px;
}

.icon-blue { background: #eff6ff; color: #1468f3; }
.icon-emerald { background: #ecfdf5; color: #059669; }
.icon-purple { background: #f5f3ff; color: #7c3aed; }
.icon-amber { background: #fffbeb; color: #d97706; }

html[data-theme="dark"] .icon-blue { background: rgba(30, 64, 175, 0.25); color: #60a5fa; }
html[data-theme="dark"] .icon-emerald { background: rgba(6, 95, 70, 0.25); color: #34d399; }
html[data-theme="dark"] .icon-purple { background: rgba(91, 33, 182, 0.25); color: #c084fc; }
html[data-theme="dark"] .icon-amber { background: rgba(146, 64, 14, 0.25); color: #fbbf24; }

.teacher-stat-body {
  flex: 1;
}

.teacher-stat-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.teacher-stat-val {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

html[data-theme="dark"] .teacher-stat-val {
  color: #f8fafc;
}

.teacher-stat-meta {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

/* 5. TABS */
.teacher-tabs-container {
  margin-bottom: 18px;
}

.teacher-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 5px;
  width: fit-content;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
}

html[data-theme="dark"] .teacher-tabs {
  background: #0f172a;
  border-color: #1e293b;
}

.teacher-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.teacher-tab-btn .material-symbols-outlined {
  font-size: 16px;
}

.teacher-tab-btn:hover {
  color: #0f172a;
}

html[data-theme="dark"] .teacher-tab-btn:hover {
  color: #f8fafc;
}

.teacher-tab-btn.active {
  background: #1468f3 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(20, 104, 243, 0.25);
}

.teacher-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.teacher-tab-btn.active .teacher-tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* 6. PANELS & TABLES */
.teacher-panel {
  display: none;
}

.teacher-panel.active,
.teacher-panel:not([hidden]) {
  display: block;
  animation: panelFade 0.15s ease-out;
}

.teacher-panel[hidden] {
  display: none !important;
}

@keyframes panelFade {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.teacher-table-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04) !important;
  margin-bottom: 24px;
}

html[data-theme="dark"] .teacher-table-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

.teacher-table {
  width: 100% !important;
  border-collapse: collapse !important;
  text-align: left !important;
  font-size: 13.5px !important;
}

.teacher-table thead {
  display: table-header-group !important;
}

.teacher-table tbody {
  display: table-row-group !important;
}

.teacher-table tr {
  display: table-row !important;
}

.teacher-table th {
  display: table-cell !important;
  background: #f8fafc !important;
  padding: 13px 18px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: #64748b !important;
  border-bottom: 1px solid #e2e8f0 !important;
  white-space: nowrap !important;
}

html[data-theme="dark"] .teacher-table th {
  background: #0b1320 !important;
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}

.teacher-table td {
  display: table-cell !important;
  padding: 14px 18px !important;
  font-size: 13.5px !important;
  border-bottom: 1px solid #f1f5f9 !important;
  color: #1e293b !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
}

.teacher-table td:first-child,
.teacher-table th:first-child {
  white-space: normal !important;
  min-width: 260px !important;
}

html[data-theme="dark"] .teacher-table td {
  border-color: #1e293b !important;
  color: #cbd5e1 !important;
}

.teacher-table tr:hover td {
  background: #fbfcfe;
}

html[data-theme="dark"] .teacher-table tr:hover td {
  background: #131f33;
}

.teacher-table-filter-bar {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="dark"] .teacher-table-filter-bar {
  background: #0b1320 !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .assign-filter-status-btn {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #94a3b8 !important;
}

html[data-theme="dark"] .assign-filter-status-btn.is-active {
  background: #1e293b !important;
  border-color: #1468f3 !important;
  color: #60a5fa !important;
}

/* Modern Skill & Mode Badges */
.teacher-skill-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  letter-spacing: 0.02em !important;
}
.teacher-skill-badge.skill-reading {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1px solid #a7f3d0 !important;
}
.teacher-skill-badge.skill-listening {
  background: #eff6ff !important;
  color: #0284c7 !important;
  border: 1px solid #bfdbfe !important;
}
.teacher-skill-badge.skill-writing {
  background: #f5f3ff !important;
  color: #7c3aed !important;
  border: 1px solid #ddd6fe !important;
}
.teacher-skill-badge.skill-speaking {
  background: #fffbeb !important;
  color: #d97706 !important;
  border: 1px solid #fde68a !important;
}
.teacher-skill-badge.skill-custom {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

.teacher-mode-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
}
.teacher-mode-pill.mode-exam {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
}
.teacher-mode-pill.mode-practice {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
}

.teacher-deadline-cell {
  display: inline-flex !important;
  flex-direction: column !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #334155 !important;
  white-space: nowrap !important;
}
.teacher-deadline-cell.is-expired {
  color: #dc2626 !important;
}

.teacher-subs-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  background: #eff6ff !important;
  color: #1468f3 !important;
  border: 1px solid #bfdbfe !important;
}
.teacher-subs-badge.has-subs {
  background: #f0fdf4 !important;
  color: #15803d !important;
  border-color: #86efac !important;
}

.teacher-action-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #334155 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}
.teacher-action-btn:hover {
  background: #f8fafc !important;
  border-color: #1468f3 !important;
  color: #1468f3 !important;
}

.teacher-action-btn-danger {
  background: #ffffff !important;
  border: 1px solid #fecaca !important;
  border-radius: 8px !important;
  padding: 6px 10px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  color: #dc2626 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}
.teacher-action-btn-danger:hover {
  background: #fef2f2 !important;
  border-color: #dc2626 !important;
}

.teacher-quick-assign-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
@media (max-width: 1100px) {
  .teacher-quick-assign-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 700px) {
  .teacher-quick-assign-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.teacher-skill-action-card {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 14px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-align: center !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02) !important;
}
.teacher-skill-action-card:hover {
  transform: translateY(-2px) !important;
  border-color: #1468f3 !important;
  box-shadow: 0 6px 18px rgba(20, 104, 243, 0.12) !important;
}
body.night-mode .teacher-skill-action-card,
html[data-theme="dark"] .teacher-skill-action-card {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

.student-row-user {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.student-row-avatar {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: #eff6ff !important;
  color: #1468f3 !important;
  font-weight: 800 !important;
  font-size: 13.5px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid #bfdbfe !important;
  flex-shrink: 0 !important;
}

html[data-theme="dark"] .student-row-avatar {
  background: rgba(30, 64, 175, 0.3) !important;
  border-color: #1e40af !important;
  color: #60a5fa !important;
}

.student-row-name {
  display: block !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

html[data-theme="dark"] .student-row-name {
  color: #f8fafc !important;
}

.student-row-username {
  font-size: 11.5px !important;
  color: #64748b !important;
}

html[data-theme="dark"] .student-row-username {
  color: #94a3b8 !important;
}

/* Band Badges in Table */
.student-band-pill {
  display: inline-block !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.band-overall {
  background: #eff6ff !important;
  color: #1468f3 !important;
  border: 1px solid #bfdbfe !important;
}

.band-skill {
  background: #f8fafc !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="dark"] .band-overall {
  background: rgba(30, 64, 175, 0.3) !important;
  color: #60a5fa !important;
  border-color: #1e40af !important;
}

html[data-theme="dark"] .band-skill {
  background: #111c2e !important;
  color: #cbd5e1 !important;
  border-color: #1e293b !important;
}

/* Status Badges */
.status-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 3px 9px !important;
  border-radius: 999px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
}

.status-graded {
  background: #ecfdf5 !important;
  color: #047857 !important;
  border: 1px solid #a7f3d0 !important;
}

.status-pending {
  background: #fffbeb !important;
  color: #b45309 !important;
  border: 1px solid #fde68a !important;
}

.status-pro {
  background: #eff6ff !important;
  color: #1468f3 !important;
  border: 1px solid #bfdbfe !important;
}

.status-free {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #e2e8f0 !important;
}

/* 7. MODALS */
.teacher-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(5px) !important;
  z-index: 10001 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}

.teacher-modal-overlay.open,
.teacher-modal-overlay.show {
  display: flex !important;
}

.teacher-modal {
  background: #ffffff !important;
  border-radius: 16px !important;
  max-width: 580px !important;
  width: 100% !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  animation: modalFadeIn 0.15s ease-out !important;
  border: 1px solid #e2e8f0 !important;
  position: relative !important;
}

html[data-theme="dark"] .teacher-modal {
  background: #0f172a !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

.teacher-modal.wide {
  max-width: 820px !important;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.teacher-modal-head {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  border-bottom: 1px solid #f1f5f9 !important;
  padding: 18px 24px 14px !important;
  background: #ffffff !important;
  flex-shrink: 0 !important;
}

html[data-theme="dark"] .teacher-modal-head {
  background: #0f172a !important;
  border-color: #1e293b !important;
}

.teacher-modal-head h2 {
  font-size: 17px !important;
  font-weight: 800 !important;
  margin: 0 !important;
  color: #0f172a !important;
}

html[data-theme="dark"] .teacher-modal-head h2 {
  color: #f8fafc !important;
}

.teacher-modal-body {
  padding: 16px 22px !important;
  overflow-y: auto !important;
  flex: 1 !important;
}

.teacher-modal-foot {
  padding: 12px 22px !important;
  border-top: 1px solid #f1f5f9 !important;
  background: #f8fafc !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  flex-shrink: 0 !important;
}

html[data-theme="dark"] .teacher-modal-foot {
  background: #0b1320 !important;
  border-color: #1e293b !important;
}

.task-select-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 7px 12px !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  transition: all 0.15s ease !important;
}

.task-select-row:hover {
  border-color: #cbd5e1 !important;
}

.task-select-row.is-active {
  border-color: #1468f3 !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 1px #1468f3 !important;
}

.rubric-score-select {
  width: 100% !important;
  display: block !important;
  height: 42px !important;
  padding: 0 12px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  outline: none !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: all 0.15s ease !important;
}

.rubric-score-select:focus {
  border-color: #1468f3 !important;
  box-shadow: 0 0 0 3px rgba(20, 104, 243, 0.15) !important;
}

html[data-theme="dark"] .rubric-score-select {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

.task-preset-select {
  flex: 1 !important;
  height: 36px !important;
  padding: 0 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  outline: none !important;
  transition: all 0.15s ease !important;
}

.task-preset-select:disabled {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  color: #94a3b8 !important;
  cursor: not-allowed !important;
  opacity: 0.6 !important;
}

.task-preset-select:focus {
  border-color: #1468f3 !important;
  box-shadow: 0 0 0 3px rgba(20, 104, 243, 0.15) !important;
}

.modal-section-label {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #334155 !important;
  margin-bottom: 6px !important;
}

.modal-section-label small {
  font-size: 11px !important;
  font-weight: 500 !important;
  color: #64748b !important;
}

.teacher-modal-close {
  background: transparent !important;
  border: 0 !important;
  font-size: 24px !important;
  color: #475569 !important;
  cursor: pointer !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.teacher-modal-close:hover {
  color: #0f172a !important;
}

.rubric-select {
  width: 100% !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  font-size: 13px !important;
  color: #0f172a !important;
  font-family: inherit !important;
  outline: none !important;
}

html[data-theme="dark"] .rubric-select {
  background: #0b1320 !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

.rubric-select:focus {
  border-color: #1468f3 !important;
  box-shadow: 0 0 0 3px rgba(20, 104, 243, 0.15) !important;
}

/* 8. BUTTON HELPERS */
.teacher-btn-primary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
  background: #1468f3 !important;
  color: #ffffff !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  border: 1px solid #1468f3 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(20, 104, 243, 0.2) !important;
  transition: all 0.15s ease !important;
}

.teacher-btn-primary:hover {
  background: #0d52c7 !important;
  border-color: #0d52c7 !important;
}

.teacher-btn-secondary {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  border: 1px solid #cbd5e1 !important;
  cursor: pointer !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.15s ease !important;
}

.teacher-btn-secondary:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

html[data-theme="dark"] .teacher-btn-secondary {
  background: #111c2e !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .teacher-btn-secondary:hover {
  background: #1e293b !important;
}


@media (max-width: 768px) {
  .teacher-layout { flex-direction: column !important; }
  .teacher-sidebar {
    position: fixed !important;
    left: -280px !important;
    width: 270px !important;
    min-width: 270px !important;
    transition: left 0.3s ease !important;
    z-index: 9999 !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15) !important;
  }
  .teacher-sidebar.mobile-open {
    left: 0 !important;
  }
  .teacher-main { margin-left: 0 !important; width: 100% !important; }
  .teacher-topbar { padding: 10px 16px !important; height: auto !important; flex-wrap: wrap !important; gap: 8px !important; }
  .teacher-topbar-search { width: 100% !important; order: 3 !important; }
  .teacher-table-card { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
  .teacher-modal-overlay { padding: 8px !important; }
  .teacher-modal { max-width: 100% !important; max-height: 95vh !important; border-radius: 12px !important; }
  .teacher-modal.wide { max-width: 100% !important; }
  .skill-picker-pills { gap: 6px !important; }
  .skill-picker-pill { font-size: 11.5px !important; padding: 6px 10px !important; }
}

@media (max-width: 480px) {
  .teacher-topbar-actions { flex-wrap: wrap !important; gap: 6px !important; }
  .teacher-btn-primary, .teacher-btn-secondary { font-size: 12px !important; padding: 6px 12px !important; }
}
