/* ==========================================================================
   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: 'DM Sans', system-ui, -apple-system, sans-serif;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] body.teacher-app-body {
  background: #1b1b1d;
  color: #e1e2e5;
}

/* 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: #202021;
  border-color: #313234;
}

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

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

.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: #245bc7;
  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(36,91,199, 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: #e1e2e5;
}

.teacher-brand-tag {
  font-size: 10px;
  font-weight: 800;
  color: #245bc7;
  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: #245bc7;
  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(36,91,199, 0.25);
  transition: all 0.15s ease;
}

.teacher-sidebar-cta:hover {
  background: #2446a9;
  box-shadow: 0 4px 14px rgba(36,91,199, 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: #3f64ac;
  color: #e1e2e5;
}

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

/* 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: #245bc7;
}

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

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

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

.teacher-nav-item.active .material-symbols-outlined {
  color: #245bc7;
}

html[data-theme="dark"] .teacher-nav-item.active {
  background: rgba(63, 100, 172, 0.15);
  color: #8ba8cf;
}

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

.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: #313234;
}

.teacher-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #245bc7;
  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: #e1e2e5;
}

.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: #1b1b1d;
}

/* 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: #202021;
  border-color: #313234;
}

.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: #e1e2e5;
}

.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: #245bc7;
  box-shadow: 0 0 0 3px rgba(36,91,199, 0.15);
}

html[data-theme="dark"] .teacher-topbar-search {
  background: #252627;
  border-color: #313234;
}

.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: #252627;
  border-color: #313234;
}

.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: #245bc7; }
.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(55, 84, 150, 0.25); color: #8ba8cf; }
html[data-theme="dark"] .icon-emerald { background: rgba(19, 82, 64, 0.25); color: #4cbb93; }
html[data-theme="dark"] .icon-purple { background: rgba(96, 55, 160, 0.25); color: #b37fe6; }
html[data-theme="dark"] .icon-amber { background: rgba(126, 69, 34, 0.25); color: #dbb144; }

.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: #e1e2e5;
}

.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: #252627;
  border-color: #313234;
}

.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: #e1e2e5;
}

.teacher-tab-btn.active {
  background: #245bc7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(36,91,199, 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: #252627 !important;
  border-color: #313234 !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: #202021 !important;
  border-color: #313234 !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: #313234 !important;
  color: #d4d5d8 !important;
}

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

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

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

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

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

html[data-theme="dark"] .assign-filter-status-btn.is-active {
  background: #313234 !important;
  border-color: #3f64ac !important;
  color: #8ba8cf !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: #245bc7 !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: #245bc7 !important;
  color: #245bc7 !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: #245bc7 !important;
  box-shadow: 0 6px 18px rgba(36,91,199, 0.12) !important;
}
body.night-mode .teacher-skill-action-card,
html[data-theme="dark"] .teacher-skill-action-card {
  background: #252627 !important;
  border-color: #313234 !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: #245bc7 !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(55, 84, 150, 0.3) !important;
  border-color: #375496 !important;
  color: #8ba8cf !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: #e1e2e5 !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: #245bc7 !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(55, 84, 150, 0.3) !important;
  color: #8ba8cf !important;
  border-color: #375496 !important;
}

html[data-theme="dark"] .band-skill {
  background: #27282a !important;
  color: #d4d5d8 !important;
  border-color: #313234 !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: #245bc7 !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: #252627 !important;
  border-color: #313234 !important;
  color: #e1e2e5 !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: #252627 !important;
  border-color: #313234 !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: #e1e2e5 !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: #202021 !important;
  border-color: #313234 !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: #245bc7 !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 1px #245bc7 !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: #245bc7 !important;
  box-shadow: 0 0 0 3px rgba(36,91,199, 0.15) !important;
}

html[data-theme="dark"] .rubric-score-select {
  background-color: #313234 !important;
  border-color: #444548 !important;
  color: #e1e2e5 !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: #245bc7 !important;
  box-shadow: 0 0 0 3px rgba(36,91,199, 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: #202021 !important;
  border-color: #444548 !important;
  color: #e1e2e5 !important;
}

.rubric-select:focus {
  border-color: #245bc7 !important;
  box-shadow: 0 0 0 3px rgba(36,91,199, 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: #245bc7 !important;
  color: #ffffff !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  border: 1px solid #245bc7 !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(36,91,199, 0.2) !important;
  transition: all 0.15s ease !important;
}

.teacher-btn-primary:hover {
  background: #2446a9 !important;
  border-color: #2446a9 !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: #27282a !important;
  border-color: #444548 !important;
  color: #e1e2e5 !important;
}

html[data-theme="dark"] .teacher-btn-secondary:hover {
  background: #313234 !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; }
}

/* ===== Teacher workspace, October 2026: class link, homework picker, progress, marking ===== */
.teacher-app-body [hidden] { display: none !important; }
.teacher-app-body .muted { color: #64748b; }
html[data-theme="dark"] .teacher-app-body .muted { color: #94a3b8; }

.teacher-brand-logo { width: auto; height: 28px; flex-shrink: 0; display: block; }

/* Buttons used across the new parts */
.teacher-btn-primary, .teacher-btn-secondary { display: inline-flex !important; align-items: center !important; gap: 6px !important; text-decoration: none !important; }
.teacher-btn-primary:disabled, .teacher-btn-secondary:disabled { opacity: .55; cursor: not-allowed; }
.button.primary:disabled { opacity: .6; cursor: progress; }
.button.primary.is-danger, #confirmOkBtn.is-danger { background: #b91c1c !important; border-color: #b91c1c !important; color: #fff !important; }

/* Class link */
.teacher-class-link {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px 16px;
  background: #ffffff; border: 1px solid #dbe4f3; border-radius: 14px; padding: 14px 18px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.teacher-class-link-icon { width: 40px; height: 40px; border-radius: 10px; background: #eef3fc; color: #245bc7; display: flex; align-items: center; justify-content: center; }
.teacher-class-link-text strong { display: block; font-size: 14.5px; color: #0f172a; }
.teacher-class-link-text span { display: block; font-size: 12.5px; color: #64748b; margin-top: 2px; line-height: 1.45; }
.teacher-class-link-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.teacher-class-link-row code {
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; color: #1e3a8a; background: #f5f8fe;
  border: 1px solid #dbe4f3; border-radius: 8px; padding: 8px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; min-width: 0;
}
html[data-theme="dark"] .teacher-class-link { background: #252627; border-color: #313234; }
html[data-theme="dark"] .teacher-class-link-icon { background: rgba(63, 100, 172, .22); color: #8ba8cf; }
html[data-theme="dark"] .teacher-class-link-text strong { color: #f1f5f9; }
html[data-theme="dark"] .teacher-class-link-text span { color: #94a3b8; }
html[data-theme="dark"] .teacher-class-link-row code { background: #1c1d1e; border-color: #3a3b3e; color: #bcd0f0; }
@media (max-width: 1100px) {
  .teacher-class-link { grid-template-columns: auto 1fr; }
  .teacher-class-link-row { grid-column: 1 / -1; }
  .teacher-class-link-row code { flex: 1 1 200px; max-width: none; }
}

.pending-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid #bfdbfe; color: #2446a9; }
.pending-chip button { background: transparent; border: 0; color: #b91c1c; cursor: pointer; padding: 0; font-size: 15px; line-height: 1; }

/* Add-students modal */
.invite-option strong { display: block; font-size: 13.5px; color: #0f172a; }
.invite-option > span { display: block; font-size: 12.5px; color: #64748b; margin: 2px 0 10px; }
.invite-option .teacher-class-link-row code { flex: 1 1 auto; max-width: none; }
.invite-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: #94a3b8; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.invite-divider::before, .invite-divider::after { content: ""; flex: 1; height: 1px; background: #e2e8f0; }
html[data-theme="dark"] .invite-option strong { color: #f1f5f9; }
html[data-theme="dark"] .invite-divider::before, html[data-theme="dark"] .invite-divider::after { background: #3a3b3e; }

.teacher-form-error { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 12.5px; font-weight: 600; }
html[data-theme="dark"] .teacher-form-error { background: rgba(185, 28, 28, .14); border-color: rgba(248, 113, 113, .35); color: #fca5a5; }

/* Tables */
.table-empty { text-align: center !important; padding: 44px 20px !important; color: #64748b !important; white-space: normal !important; }
.table-empty .material-symbols-outlined { font-size: 34px; color: #94a3b8; display: block; margin-bottom: 6px; }
.table-empty strong { display: block; font-size: 15px; color: #0f172a; }
.table-empty p { margin: 4px auto 0; font-size: 13px; max-width: 460px; }
html[data-theme="dark"] .table-empty strong { color: #f1f5f9; }
.table-empty-text { padding: 24px; text-align: center; color: #64748b; }
.row-actions { display: inline-flex; align-items: center; gap: 6px; }
.overall-band { color: #1e40af; font-size: 14px; }
html[data-theme="dark"] .overall-band { color: #8ba8cf; }
.mini-progress { width: 110px; height: 6px; border-radius: 999px; background: #e8edf5; overflow: hidden; margin-bottom: 4px; }
.mini-progress span { display: block; height: 100%; border-radius: inherit; background: #245bc7; }
.mini-progress.large { width: 100%; height: 8px; }
html[data-theme="dark"] .mini-progress { background: #3a3b3e; }
html[data-theme="dark"] .mini-progress span { background: #6d8fd0; }
.homework-cell small, .progress-cell small { font-size: 12px; color: #475569; }
html[data-theme="dark"] .homework-cell small, html[data-theme="dark"] .progress-cell small { color: #b6b8bd; }

.hw-title { display: flex; align-items: flex-start; gap: 12px; }
.hw-title strong { display: block; font-size: 14px; color: #0f172a; }
.hw-title small { display: block; font-size: 12px; color: #64748b; margin-top: 2px; }
html[data-theme="dark"] .hw-title strong { color: #f1f5f9; }
.hw-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #eef3fc; color: #245bc7; }
.hw-icon .material-symbols-outlined { font-size: 19px; }
.hw-icon.skill-reading { background: #ecfdf5; color: #047857; }
.hw-icon.skill-listening { background: #f0f9ff; color: #0369a1; }
.hw-icon.skill-writing { background: #f5f3ff; color: #6d28d9; }
.hw-icon.skill-speaking { background: #fffbeb; color: #b45309; }
.hw-icon.skill-custom, .hw-icon.skill-lesson { background: #f1f5f9; color: #475569; }
html[data-theme="dark"] .hw-icon { background: #313234 !important; color: #c5cad3 !important; }
.teacher-skill-badge.skill-mock { background: #eef3fc !important; color: #1e40af !important; border: 1px solid #c7d6f3 !important; }
.teacher-skill-badge.skill-lesson { background: #f1f5f9 !important; color: #475569 !important; border: 1px solid #cbd5e1 !important; }
html[data-theme="dark"] .teacher-skill-badge { background: #313234 !important; border-color: #444548 !important; color: #d4d5d8 !important; }
.hw-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: #f1f5f9; color: #475569; }
.tag-amber { background: #fef3c7; color: #92400e; }
html[data-theme="dark"] .tag { background: #313234; color: #b6b8bd; }
html[data-theme="dark"] .tag-amber { background: rgba(217, 119, 6, .2); color: #fcd34d; }
.teacher-deadline-cell small { font-size: 11.5px; font-weight: 700; }

.status-ai { background: #eef3fc !important; color: #1e40af !important; border: 1px solid #c7d6f3 !important; }
.status-none { background: #f1f5f9 !important; color: #64748b !important; border: 1px solid #e2e8f0 !important; }
html[data-theme="dark"] .status-ai { background: rgba(63, 100, 172, .22) !important; color: #bcd0f0 !important; border-color: rgba(139, 168, 207, .3) !important; }
html[data-theme="dark"] .status-none { background: #313234 !important; color: #a1a5ad !important; border-color: #444548 !important; }
.late-note { display: block; font-size: 11px; color: #b45309; font-weight: 700; margin-top: 3px; }

/* Filter pills */
.assign-filter-status-btn { padding: 5px 12px; font-size: 12px; font-weight: 700; border-radius: 20px; border: 1px solid #cbd5e1; background: #ffffff; color: #334155; cursor: pointer; transition: all .15s; }
.assign-filter-status-btn.is-active { border-color: #245bc7; background: #eef3fc; color: #245bc7; }

/* Quick-start cards */
.teacher-quick-assign-grid { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
@media (max-width: 1280px) { .teacher-quick-assign-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
@media (max-width: 640px) { .teacher-quick-assign-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
.teacher-skill-action-card strong { font-size: 13.5px; color: #0f172a; }
.teacher-skill-action-card > span:last-child { font-size: 11.5px; color: #64748b; line-height: 1.35; }
html[data-theme="dark"] .teacher-skill-action-card strong { color: #f1f5f9; }
html[data-theme="dark"] .teacher-skill-action-card > span:last-child { color: #a1a5ad; }
.tq-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.tq-icon .material-symbols-outlined { font-size: 20px; }
.tq-reading { background: #ecfdf5; color: #047857; }
.tq-listening { background: #f0f9ff; color: #0369a1; }
.tq-writing { background: #f5f3ff; color: #6d28d9; }
.tq-speaking { background: #fffbeb; color: #b45309; }
.tq-mock { background: #eef3fc; color: #1e40af; }
.tq-custom { background: #f1f5f9; color: #475569; }
html[data-theme="dark"] .tq-icon { background: #313234; color: #c5cad3; }

/* Set-homework modal */
.assign-source-tabs { display: flex; gap: 6px; margin-bottom: 16px; background: #f1f5f9; padding: 4px; border-radius: 10px; }
.teacher-assign-source-tab { flex: 1; padding: 8px 12px; font-size: 13px; font-weight: 700; border: 0; border-radius: 8px; cursor: pointer; background: transparent; color: #64748b; }
.teacher-assign-source-tab.is-active { background: #ffffff; color: #245bc7; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
html[data-theme="dark"] .assign-source-tabs { background: #1c1d1e; }
html[data-theme="dark"] .teacher-assign-source-tab.is-active { background: #313234; color: #bcd0f0; }
.modal-section-label { margin-bottom: 8px; }
.assign-block { margin-top: 18px; }
.assign-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .assign-two-col { grid-template-columns: 1fr; } }
.field-label { font-size: 12px; font-weight: 700; color: #334155; display: block; margin-bottom: 4px; }
html[data-theme="dark"] .field-label { color: #c5cad3; }
.radio-line { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #0f172a; cursor: pointer; }
.radio-line input { accent-color: #245bc7; width: 16px; height: 16px; }
html[data-theme="dark"] .radio-line { color: #e2e4e8; }
.student-pick { max-height: 150px; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 8px; padding: 8px 12px; background: #f8fafc; }
.student-pick #assignStudentsList { display: flex; flex-direction: column; gap: 6px; }
html[data-theme="dark"] .student-pick { background: #1c1d1e; border-color: #3a3b3e; }

.material-cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.material-cat { padding: 6px 12px; border-radius: 999px; border: 1px solid #d5dce8; background: #fff; font-size: 12.5px; font-weight: 700; color: #334155; cursor: pointer; }
.material-cat small { font-weight: 600; color: #64748b; margin-left: 2px; }
.material-cat.is-active { border-color: #245bc7; background: #245bc7; color: #fff; }
.material-cat.is-active small { color: #dbe6fb; }
html[data-theme="dark"] .material-cat { background: #252627; border-color: #444548; color: #d4d5d8; }
html[data-theme="dark"] .material-cat.is-active { background: #3f64ac; border-color: #3f64ac; color: #fff; }
.material-search { position: relative; margin-bottom: 8px; }
.material-search .material-symbols-outlined { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 17px; color: #94a3b8; }
.material-search input { width: 100%; height: 36px; padding-left: 34px !important; font-size: 13px; border-radius: 8px; box-sizing: border-box; }
.material-list { max-height: 280px; overflow-y: auto; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.material-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.material-item:last-child { border-bottom: 0; }
.material-item:hover { background: #f8fafc; }
.material-item.is-picked { background: #eef3fc; }
.material-item input { width: 16px; height: 16px; accent-color: #245bc7; flex-shrink: 0; }
.material-item-text { flex: 1; min-width: 0; }
.material-item-text strong { display: block; font-size: 13px; color: #0f172a; font-weight: 700; }
.material-item-text small { display: block; font-size: 11.5px; color: #64748b; margin-top: 1px; }
.material-preview { color: #64748b; display: flex; padding: 4px; border-radius: 6px; }
.material-preview:hover { color: #245bc7; background: #eef3fc; }
.material-preview .material-symbols-outlined { font-size: 17px; }
.material-empty { padding: 22px; text-align: center; color: #64748b; font-size: 13px; margin: 0; }
html[data-theme="dark"] .material-list { background: #1c1d1e; border-color: #3a3b3e; }
html[data-theme="dark"] .material-item { border-color: #2c2d2f; }
html[data-theme="dark"] .material-item:hover { background: #252627; }
html[data-theme="dark"] .material-item.is-picked { background: rgba(63, 100, 172, .2); }
html[data-theme="dark"] .material-item-text strong { color: #f1f5f9; }
html[data-theme="dark"] .material-item-text small { color: #a1a5ad; }
.material-picked { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 12.5px; }
.material-picked > strong { color: #0f172a; margin-right: 4px; }
.picked-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 10px; border-radius: 999px; background: #eef3fc; border: 1px solid #c7d6f3; color: #1e3a8a; font-weight: 600; }
.picked-chip button { border: 0; background: transparent; color: #64748b; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
html[data-theme="dark"] .material-picked > strong { color: #f1f5f9; }
html[data-theme="dark"] .picked-chip { background: rgba(63, 100, 172, .2); border-color: rgba(139, 168, 207, .35); color: #dbe6fb; }

.writing-marking { margin-top: 14px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.writing-marking > strong { display: block; font-size: 13px; color: #0f172a; margin-bottom: 8px; }
.marking-option { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; }
.marking-option input { margin-top: 3px; accent-color: #245bc7; width: 16px; height: 16px; }
.marking-option b { display: block; font-size: 13px; color: #0f172a; }
.marking-option small { display: block; font-size: 12px; color: #64748b; margin-top: 2px; line-height: 1.45; }
html[data-theme="dark"] .writing-marking { background: #1c1d1e; border-color: #3a3b3e; }
html[data-theme="dark"] .writing-marking > strong, html[data-theme="dark"] .marking-option b { color: #f1f5f9; }

.deadline-preset-btn { padding: 5px 11px; font-size: 12px; font-weight: 700; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff; color: #334155; cursor: pointer; }
.deadline-preset-btn.is-active { border-color: #245bc7; background: #eef3fc; color: #245bc7; }
html[data-theme="dark"] .deadline-preset-btn { background: #252627; border-color: #444548; color: #d4d5d8; }
html[data-theme="dark"] .deadline-preset-btn.is-active { border-color: #3f64ac; background: rgba(63, 100, 172, .25); color: #bcd0f0; }

/* Files */
.file-drop { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 18px; text-align: center; background: #f8fafc; cursor: pointer; transition: border-color .15s, background .15s; }
.file-drop .material-symbols-outlined { font-size: 30px; color: #245bc7; display: block; }
.file-drop strong { display: block; font-size: 13.5px; color: #0f172a; margin-top: 2px; }
.file-drop > span:last-of-type { font-size: 12px; color: #64748b; }
.file-drop.is-over, .file-drop:focus-visible { border-color: #245bc7; background: #eef3fc; outline: none; }
html[data-theme="dark"] .file-drop { background: #1c1d1e; border-color: #444548; }
html[data-theme="dark"] .file-drop strong { color: #f1f5f9; }
.file-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.file-list.compact { flex-direction: row; flex-wrap: wrap; margin-top: 6px; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; font-size: 12.5px; }
.file-row .material-symbols-outlined { font-size: 18px; color: #245bc7; }
.file-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #0f172a; }
.file-row small { color: #64748b; }
.file-row.is-error { border-color: #fecaca; background: #fef2f2; }
.file-row.is-error .material-symbols-outlined, .file-row.is-error small { color: #b91c1c; }
.file-row button { border: 0; background: transparent; color: #64748b; font-size: 17px; cursor: pointer; line-height: 1; }
html[data-theme="dark"] .file-row { background: #252627; border-color: #3a3b3e; }
html[data-theme="dark"] .file-row-name { color: #f1f5f9; }
.file-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 260px; padding: 4px 9px; border-radius: 7px; border: 1px solid #d5dce8; background: #fff; color: #1e3a8a; font-size: 12px; font-weight: 600; text-decoration: none; }
.file-chip:hover { border-color: #245bc7; background: #eef3fc; }
.file-chip .material-symbols-outlined { font-size: 15px; }
.file-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip small { color: #64748b; font-weight: 500; }
html[data-theme="dark"] .file-chip { background: #252627; border-color: #444548; color: #bcd0f0; }

/* Marking modal */
.grading-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .grading-grid { grid-template-columns: 1fr; } }
.grading-answer { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px; max-height: 480px; overflow-y: auto; }
.grading-label { font-size: 11.5px; text-transform: uppercase; color: #64748b; letter-spacing: .04em; font-weight: 800; }
.grading-prompt { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px dashed #cbd5e1; font-size: 13px; color: #334155; line-height: 1.55; white-space: pre-wrap; }
.grading-prompt .grading-label { display: block; margin-bottom: 4px; }
.grading-essay { font-size: 13.5px; line-height: 1.7; color: #1e293b; white-space: pre-wrap; }
html[data-theme="dark"] .grading-answer { background: #1c1d1e; border-color: #3a3b3e; }
html[data-theme="dark"] .grading-essay, html[data-theme="dark"] .grading-prompt { color: #d4d5d8; }
.grading-band-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grading-band-box small { font-weight: 800; color: #166534; text-transform: uppercase; font-size: 10.5px; }
.grading-band-box #gradingCalculatedBand { font-size: 24px; font-weight: 900; color: #15803d; line-height: 1.1; }
.grading-band-box > span { font-size: 11px; color: #166534; font-weight: 700; text-align: right; }
html[data-theme="dark"] .grading-band-box { background: rgba(21, 128, 61, .14); border-color: rgba(74, 222, 128, .3); }
html[data-theme="dark"] .grading-band-box small, html[data-theme="dark"] .grading-band-box > span, html[data-theme="dark"] .grading-band-box #gradingCalculatedBand { color: #86efac; }
.grading-criteria { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.grading-criteria label { display: flex; flex-direction: column; gap: 4px; }
.grading-criteria label > span { font-size: 11.5px; font-weight: 800; color: #334155; text-transform: uppercase; letter-spacing: .03em; }
html[data-theme="dark"] .grading-criteria label > span { color: #c5cad3; }
.ai-suggest-btn { width: 100%; justify-content: center; }
.ai-suggest-note { margin-top: 8px; font-size: 12.5px; color: #1e40af; background: #eef3fc; border: 1px solid #c7d6f3; border-radius: 8px; padding: 8px 10px; }
.grading-ai-note { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; background: #eef3fc; border: 1px solid #c7d6f3; color: #1e3a8a; }
.grading-ai-note .material-symbols-outlined { font-size: 19px; margin-top: 1px; }
.grading-ai-note strong { display: block; font-size: 13px; }
.grading-ai-note span:not(.material-symbols-outlined) { display: block; font-size: 12.5px; margin-top: 2px; line-height: 1.45; }
html[data-theme="dark"] .grading-ai-note, html[data-theme="dark"] .ai-suggest-note { background: rgba(63, 100, 172, .2); border-color: rgba(139, 168, 207, .3); color: #dbe6fb; }

/* Assignment details */
.details-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.details-progress { flex: 1; min-width: 220px; }
.details-progress strong { font-size: 13.5px; color: #0f172a; }
html[data-theme="dark"] .details-progress strong { color: #f1f5f9; }
.details-prompt { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; font-size: 13px; line-height: 1.55; color: #334155; white-space: pre-wrap; }
.details-prompt strong { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin-bottom: 4px; }
.details-note { font-size: 12.5px; color: #475569; margin: 0 0 12px; }
html[data-theme="dark"] .details-prompt { background: #1c1d1e; border-color: #3a3b3e; color: #d4d5d8; }

/* Toasts */
.teacher-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100000; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.teacher-toast { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: 10px; background: #0f172a; color: #f8fafc; font-size: 13px; font-weight: 600; line-height: 1.45; box-shadow: 0 10px 30px rgba(15, 23, 42, .25); animation: teacherToastIn .2s ease-out; transition: opacity .3s, transform .3s; }
.teacher-toast .material-symbols-outlined { font-size: 18px; color: #86efac; }
.teacher-toast.is-error { background: #7f1d1d; }
.teacher-toast.is-error .material-symbols-outlined { color: #fecaca; }
.teacher-toast.is-info .material-symbols-outlined { color: #bcd0f0; }
.teacher-toast.is-leaving { opacity: 0; transform: translateY(6px); }
@keyframes teacherToastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .teacher-toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; } }
@media (prefers-reduced-motion: reduce) { .teacher-toast { animation: none; transition: none; } }
/* Fit fixes */
#assignFilterSkillSelect { width: auto !important; min-width: 150px; }
#panelStudents .teacher-table td, #panelStudents .teacher-table th { padding-left: 9px !important; padding-right: 9px !important; }
#panelStudents .teacher-table td:first-child, #panelStudents .teacher-table th:first-child { min-width: 180px !important; padding-left: 16px !important; }
#panelStudents .teacher-table td:last-child { padding-right: 14px !important; }
#panelStudents .mini-progress { width: 90px; }
#createAssignmentModal .field.input, #inviteStudentModal .field.input { padding-left: 12px; box-sizing: border-box; }
#inviteStudentModal #inviteUsernameInput { padding-left: 28px; }
#createAssignmentModal .material-search input { padding-left: 34px !important; }
/* Dark mode for the newer parts */
html[data-theme="dark"] .card-title { color: #f1f5f9 !important; }
html[data-theme="dark"] .teacher-deadline-cell { color: #d4d5d8 !important; }
html[data-theme="dark"] .teacher-deadline-cell.is-expired { color: #fca5a5 !important; }
html[data-theme="dark"] .teacher-action-btn { background: #2c2d2f !important; border-color: #444548 !important; color: #e2e4e8 !important; }
html[data-theme="dark"] .teacher-action-btn:hover { border-color: #6d8fd0 !important; color: #bcd0f0 !important; }
html[data-theme="dark"] .teacher-action-btn-danger { background: #2c2d2f !important; border-color: rgba(248, 113, 113, .35) !important; color: #fca5a5 !important; }
html[data-theme="dark"] .modal-section-label, html[data-theme="dark"] .modal-section-label span { color: #c5cad3 !important; }
html[data-theme="dark"] .pending-chip { background: #252627; border-color: #3f64ac; color: #bcd0f0; }
html[data-theme="dark"] #pendingInvitesBox { background: rgba(63, 100, 172, .16) !important; border-color: rgba(139, 168, 207, .3) !important; color: #dbe6fb !important; }
@media (max-width: 640px) {
  .teacher-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .teacher-stat-card { padding: 12px !important; gap: 10px !important; }
  .teacher-stat-icon-wrap { display: none !important; }
  .teacher-stat-val { font-size: 20px !important; }
}