@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Heebo', sans-serif;
  background: #f1eeed;
  color: #2d2d2d;
  min-height: 100vh;
  margin: 0;
}

/* ── Search + filter row ── */
.search-filter-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.btn-icon{
  height: 25px;
  padding-left: 10px;
}
.search-filter-row .search-bar {
  flex: 1;
  margin-bottom: 0;
}
.search-filter-select {
  flex-shrink: 0;
  width: 140px;
  font-size: 0.85rem;
  padding: 10px 12px 10px 30px;
  border: 2px solid #e8e4ff;
  border-radius: 12px;
  background: #fff;
  color: #2d2d2d;
  cursor: pointer;
}
.search-filter-select:focus {
  outline: none;
  border-color: #6c63ff;
  box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}

/* ── Dev quick-login panel ── */
.dev-panel-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9333ea;
  letter-spacing: 0.03em;
  padding: 6px 10px;
  background: #faf5ff;
  border: 1px dashed #d8b4fe;
  border-radius: 8px 8px 0 0;
  border-bottom: none;
}
.dev-panel-label + .form-select {
  border-radius: 0 0 8px 8px;
  border-color: #d8b4fe;
  font-size: 0.875rem;
}

/* ── Auth pages ── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: #fff;
  border-radius: 24px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(108, 99, 255, 0.13);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-img {
  height: 90px;
  margin-bottom: 8px;
}

.brand-name {
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6c63ff, #19b98a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.brand-tagline {
  font-size: 0.88rem;
  color: #9ca3af;
  margin: 4px 0 0;
}

.auth-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #041273;
  margin-bottom: 24px;
}

.error-msg {
  color: #dc2626;
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-bottom: 4px;
}

.auth-footer-text {
  text-align: center;
  font-size: 0.88rem;
  color: #6b7280;
  margin-top: 20px;
  margin-bottom: 0;
}

.auth-footer-text a {
  color: #6c63ff;
  text-decoration: none;
  font-weight: 600;
}

/* ── Form controls ── */
.form-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: #041273;
  margin-bottom: 6px;
}

.form-control {
=-p8-]n rder: 1px solid #d8dce8;
  border-radius: 12px;
  padding: 10px 14px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: #fdfcff;
}

.form-control:focus {
  border-color: #4f6bff;
  box-shadow: 0 0 0 4px rgba(79, 107, 255, 0.12);
}

/* ── Buttons ── */
.btn {
  font-family: 'Heebo', sans-serif;
  font-weight: 600;
  border-radius: 12px;
  padding: 10px 24px;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

/* ── Back-navigation link button (used in detail views) ── */
.td-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  padding-bottom: 12px; font-size: 0.78rem; color: #9ca3af;
}
.td-back-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: #041273; font-weight: 700; font-size: 0.78rem; font-family: inherit;
  display: inline-flex; align-items: center; gap: 4px;
}
.td-back-btn:hover { text-decoration: underline; }
img.live-arrow-icon { width: 32px; height: 32px; display: inline-block; transition: transform 0.18s ease; }
.td-back-btn:hover img.live-arrow-icon { transform: translateX(-4px); }

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: #ee8918;
  color: #041273;
  box-shadow: 0 4px 14px rgba(238, 137, 24, 0.30);
}
.btn-primary:disabled {
  background: #041273;
  
}
.btn-primary img{
  height: 20px;
  padding-left: 10px;
}
.btn-primary:hover {
  background: #d97a10;
  box-shadow: 0 6px 18px rgba(238, 137, 24, 0.42);
  color: #fff;
}

.btn-outline-secondary {
  background: transparent;
  border: 2px solid #d1d5db;
  color: #6b7280;
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-outline-secondary:hover {
  background: #f3f4f6;
  color: #374151;
}

/* ── Section card ── */
.section-card {
  /* background: #FAF7F2; */
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 4px 24px rgba(108, 99, 255, 0.08);
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #041273;
  margin-bottom: 20px;
}

.form-select {
  border: 2px solid #d8dce8;
  border-radius: 12px;
  padding: 10px 14px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.95rem;
  background-color: #faf9f8;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select:focus {
  border-color: #4f6bff;
  box-shadow: 0 0 0 4px rgba(79, 107, 255, 0.12);
}

.btn-outline-primary {
  background: transparent;
  border: 2px solid #6c63ff;
  color: #6c63ff;
  font-family: 'Heebo', sans-serif;
  font-weight: 600;
}

.btn-outline-primary:hover {
  background: #f0eeff;
  color: #6c63ff;
}

.btn-outline-danger {
  background: transparent;
  border: 2px solid #fca5a5;
  color: #dc2626;
  font-family: 'Heebo', sans-serif;
  font-weight: 600;
}

.btn-outline-danger:hover {
  background: #fef2f2;
  border-color: #dc2626;
  color: #dc2626;
}

/* ── Search bar ── */
.search-bar {
  position: relative;
  margin-bottom: 20px;
}

.search-bar-input {
  width: 100%;
  padding: 10px 40px 10px 40px;
  border: 2px solid #F5F7FC;
  border-radius: 12px;
  font-family: 'Heebo', sans-serif;
  font-size: 0.95rem;
  background: #fdfcff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.search-bar-input:focus {
  border-color: #041273;
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

.search-bar-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  /* opacity: 0.4; */
}

.search-clear-btn {
  display: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border: none;
  background: #d1d5db;
  color: #4b5563;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}

.search-clear-btn:hover {
  background: #9ca3af;
  color: #fff;
}

.search-empty {
  text-align: center;
  color: #9ca3af;
  padding: 32px 0;
  font-size: 0.95rem;
}

/* ── Task card ── */
.task-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-right: 4px solid #e8e4ff;
  transition: box-shadow 0.2s, transform 0.15s;
  position: relative;
}

.task-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.11);
  transform: scale(1.01);
}

#taskList:hover .task-card,
#studentList:hover .task-card,
#classList:hover .task-card {
  opacity: 0.55;
  transition: opacity 0.15s, box-shadow 0.2s, transform 0.15s;
}

#taskList:hover .task-card:hover,
#studentList:hover .task-card:hover,
#classList:hover .task-card:hover {
  opacity: 1;
}

.task-card-clickable {
  cursor: pointer;
}

.class-open-arrow {
  font-size: 1.1rem;
  color: #c4b5fd;
  transition: color 0.15s, transform 0.15s;
  line-height: 1;
}

.task-card-clickable:hover .class-open-arrow {
  transform: translateX(-3px);
}

.task-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}

.task-card:hover .task-actions {
  opacity: 1;
}

.task-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 1rem;
  border: none;
  background: #f5f3ff;
  color: #6c63ff;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.task-action-btn:hover {
  background: #ede9ff;
  transform: scale(1.08);
}

.task-action-delete {
  background: #fff1f1;
  color: #dc2626;
}

.task-action-delete:hover {
  background: #fee2e2;
}

.task-card-title {
  font-weight: 700;
  font-size: 1rem;
  color: #041273;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-ai-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.85;
}

.task-card-meta {
  font-size: 0.82rem;
  color: #9ca3af;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge-subject,
.badge-grade,
.badge-saved,
.badge-gender {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.6;
}

.badge-subject {
  background: #ede9ff;
  color: #6c63ff;
}

.badge-grade {
  background: #d1fae5;
  color: #065f46;
}

.badge-test {
  background: #fef3c7;
  color: #92400e;
}
.badge-review {
  background: #ede9ff;
  color: #6c63ff;
  cursor: help;
}

.badge-saved {
  background: #fef9c3;
  color: #92400e;
}

.badge-gender {
  background: #fce7f3;
  color: #9d174d;
}

.badge-class {
  background: #e0f2fe;
  color: #0369a1;
}


@keyframes pulse-dot {
  0%, 100% { opacity: 1;   transform: scale(1);    }
  50%       { opacity: 0.5; transform: scale(0.65); }
}

.badge-all-done {
  background: #ede9fe;
  color: #5b21b6;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #c4b5fd;
}

.badge-expiry {
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #fed7aa;
}

.badge-end-time {
  background: #f0fdf4;
  color: #166534;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #bbf7d0;
}

.badge-expired {
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #fecaca;
}

.badge-pending {
  background: #fefce8;
  color: #854d0e;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #fde68a;
}

.session-pending-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #854d0e;
  margin-bottom: 10px;
}

.session-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.session-section-divider:first-child { margin-top: 0; }
.session-section-divider::before,
.session-section-divider::after { content: ''; flex: 1; height: 1px; }
.session-section-divider.divider-submitted { color: #059669; }
.session-section-divider.divider-submitted::before,
.session-section-divider.divider-submitted::after { background: #d1fae5; }
.session-section-divider.divider-pending { color: #b45309; }
.session-section-divider.divider-pending::before,
.session-section-divider.divider-pending::after { background: #fde68a; }
.session-section-divider.divider-expired { color: #dc2626; }
.session-section-divider.divider-expired::before,
.session-section-divider.divider-expired::after { background: #fecaca; }

.session-pending-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  font-size: 0.88rem;
}

.btn-copy-pending-link {
  background: #fff;
  border: 1px solid #fde68a;
  color: #854d0e;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-copy-pending-link:hover { background: #fef9c3; }

.btn-copy-session-link {
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #6b7280;
  font-size: 0.82rem;
  width: 28px; height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.btn-copy-session-link:hover { background: #f3f4f6; border-color: #d1d5db; }

.badge-shared {
  font-size: 0.7rem;
  font-weight: 600;
  color: #059669;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  border-radius: 20px;
  padding: 1px 8px;
  white-space: nowrap;
}

.btn-pending-share {
  background: #ede9fe;
  border: 1px solid #c4b5fd;
  color: #5b21b6;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-pending-share:hover { background: #ddd6fe; }
.btn-pending-share::after { margin-right: 4px; margin-left: 0; }

.badge-grade-mismatch {
  font-size: 0.72rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 2px 8px;
  white-space: nowrap;
}

.badge-active-task {
  font-size: 0.72rem;
  font-weight: 600;
  color: #059669;
  background: #dcfce7;
  border-radius: 10px;
  padding: 2px 8px;
  white-space: nowrap;
}

.badge-submissions {
  font-size: 0.72rem;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 2px 8px;
  white-space: nowrap;
}

.badge-briefing {
  background: #ede9fe;
  color: #6d28d9;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.eval-hist-item {
  border-bottom: 1px solid #f0eeff;
  padding: 14px 0;
}
.eval-hist-item:last-child { border-bottom: none; }

.btn-eval-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.4;
  padding: 2px 4px;
  border-radius: 6px;
  transition: opacity 0.15s;
}
.btn-eval-delete:hover { opacity: 1; }
.btn-eval-delete:disabled { opacity: 0.2; cursor: default; }

.badge-manual-submit {
  background: #fff7ed;
  color: #b45309;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-unscored {
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #fed7aa;
  white-space: nowrap;
}

.badge-student-rating {
  background: #f0fdf4;
  color: #166534;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-no-submission {
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Session score widget ── */
.session-score-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}
.session-score-input {
  width: 68px;
  padding: 3px 6px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.82rem;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}
.session-score-input:focus { border-color: #6c63ff; }
.session-score-input.is-invalid { border-color: #ef4444; }
.session-score-wrap.score-confirmed .session-score-input {
  border-color: #10b981;
  background: #f0fdf4;
  color: #065f46;
  font-weight: 700;
}
.session-score-btn {
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}
.session-score-btn:hover { background: #5b54e0; }
.session-score-btn:disabled { background: #c4b5fd; cursor: default; }

/* ── Expired row actions ── */
.btn-score-zero {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-score-zero:hover { background: #fee2e2; }
.btn-reopen {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-reopen:hover { background: #dbeafe; }
.reopen-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e5e7eb;
  flex-wrap: wrap;
}

/* ── Deactivate inline confirm ── */
.deactivate-confirm-btns {
  display: inline-flex;
  gap: 6px;
  margin-right: 8px;
}
.btn-deactivate-confirm {
  background: #b91c1c;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-deactivate-cancel {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

/* ── Teacher note ── */
.session-note-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e8e4ff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.session-note-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #041273;
}
.session-note-input {
  width: 100%;
  border: 1.5px solid #e8e4ff;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-family: inherit;
  resize: vertical;
  min-height: 70px;
  outline: none;
  transition: border-color 0.15s;
  direction: rtl;
}
.session-note-input:focus { border-color: #6c63ff; }
.session-note-save {
  align-self: flex-start;
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  padding: 4px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.session-note-save:hover:not(:disabled) { background: #ddd6fe; }
.session-note-save:disabled { opacity: 0.6; cursor: default; }

/* ── Score email button ── */
.session-email-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0eeff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-send-score {
  border: none;
  border-radius: 8px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-send-score-new {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
}
.btn-send-score-new:hover:not(:disabled) { background: #ddd6fe; }
.btn-send-score-sent {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
  cursor: default;
}
.btn-send-score-update {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}
.btn-send-score-update:hover:not(:disabled) { background: #ffedd5; }
.btn-send-score:disabled { opacity: 0.7; cursor: default; }
#sendScoreModal .modal-dialog {
  max-width: 350px;
}
.send-score-modal-content {
  position: relative;
  overflow: hidden;
}
.send-score-modal-content .modal-footer {
  flex-wrap: nowrap;
  gap: 8px;
  padding: 10px 16px;
}
.send-score-modal-content .modal-footer > * {
  flex: 1;
  text-align: center;
  justify-content: center;
  height: 34px;
  padding: 0 10px;
  font-size: 0.84rem;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-family: inherit;
}
.btn-send-score-dismiss {
  background: none;
  border: 1.5px solid #d1d5db;
  color: #6b7280;
  transition: border-color 0.15s, color 0.15s;
}
.btn-send-score-dismiss:hover { border-color: #9ca3af; color: #374151; }
.send-score-modal-content::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 10px;
  width: 72px;
  height: 72px;
  background: url('/images/email.svg') no-repeat center / contain;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}
.btn-send-score-wa {
  background: #25d366;
  color: #fff;
  border: none;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-send-score-wa:hover { background: #1ebe57; color: #fff; }
.btn-send-score-confirm {
  background: #6c63ff;
  color: #fff;
  border: none;
  transition: background 0.15s;
}
.btn-send-score-confirm:hover:not(:disabled) { background: #5b54e0; }
.btn-send-score-confirm:disabled { opacity: 0.75; cursor: default; }
.score-sent-hint {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* ── Close task button ── */
.btn-close-task {
  background: #f0fdf4;
  color: #166534;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-close-task:hover:not(:disabled) { background: #dcfce7; }
.btn-close-task:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: default;
}
.btn-close-task.is-closed {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
  cursor: default;
}

/* ── Insights button ── */
.btn-csv {
  background: #f0fdf4;
  color: #166534;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  padding: 5px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-csv:hover { background: #dcfce7; color: #14532d; }

.btn-insights {
  background: #ede9fe;
  color: #6c63ff;
  border: 1.5px solid #c4b5fd;
  border-radius: 10px;
  padding: 5px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-insights:hover:not(:disabled) { background: #ddd6fe; }
.btn-insights:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: not-allowed;
}

/* ── Insights panel ── */
.insights-panel-wrap {
  background: #faf9ff;
  border-bottom: 1px solid #e8e4ff;
  padding: 20px 24px 16px;
}
.insights-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #6b7280;
  font-size: 0.9rem;
}
.insights-content { display: flex; flex-direction: column; gap: 14px; }
.insights-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.insights-title {
  font-size: 1rem;
  font-weight: 700;
  color: #041273;
}
.insights-avg-badge {
  background: #ede9fe;
  color: #5b21b6;
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 20px;
}
.insights-meta {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-right: auto;
}
.insights-overview {
  font-size: 0.93rem;
  color: #374151;
  line-height: 1.6;
  margin: 0;
}
.insights-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px) { .insights-cols { grid-template-columns: 1fr; } }
.insights-col {
  border-radius: 12px;
  padding: 12px 14px;
}
.insights-col ul {
  margin: 6px 0 0;
  padding-right: 18px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: #374151;
}
.insights-col-label {
  font-size: 0.8rem;
  font-weight: 700;
}
.insights-col-strengths {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.insights-col-strengths .insights-col-label { color: #065f46; }
.insights-col-gaps {
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.insights-col-gaps .insights-col-label { color: #92400e; }
.insights-recommendation {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #1e40af;
  line-height: 1.6;
}
.insights-rec-label {
  font-weight: 700;
  margin-left: 6px;
}

.session-expired-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 14px;
}

.session-expired-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #b91c1c;
  margin-bottom: 10px;
}

.session-expired-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 18px;
  font-size: 0.88rem;
}
.reopen-wrap { flex: 0 0 100%; }

/* ── Notifications ── */
.notif-bell-wrap {
  position: relative;
}
.btn-notif-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.notif-bell-img {
  display: block;
  transition: opacity 0.15s;
}
.btn-notif-bell:hover .notif-bell-img { opacity: 0.75; }
.btn-notif-bell:hover { background: #f3f4f6; }
.notif-badge {
 position: absolute;
    top: 10px;
    left: 30px;
    min-width: 18px;
    height: 18px;
    background: #041273;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 9px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  max-width: calc(100vw - 16px);
  background: #fff;
  border: 1px solid #e8e4ff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(108,99,255,0.13);
  z-index: 1050;
  overflow: hidden;
}
.notif-dropdown-header {
  padding: 12px 16px 10px;
  border-bottom: 1px solid #f0eeff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-dropdown-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #041273;
}
.notif-clear-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.notif-clear-btn:hover { background: #fee2e2; color: #dc2626; }
.notif-list {
  max-height: 340px;
  overflow-y: auto;
}
.notif-empty {
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
  padding: 28px 16px;
}
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f9f8ff;
  transition: background 0.12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f5f3ff; }
.notif-item.notif-unread { background: #faf9ff; }
.notif-dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6c63ff;
  margin-top: 5px;
}
.notif-dot.notif-dot-read {
  background: #e5e7eb;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-text {
  font-size: 0.85rem;
  color: #2d2d2d;
  line-height: 1.4;
  word-break: break-word;
}
.notif-item-time {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 3px;
}
.notif-open-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid #e8e4ff;
  color: #6c63ff;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
  align-self: center;
  transition: background 0.12s;
}
.notif-open-btn:hover { background: #ede9ff; }

/* ── Dashboard ── */
.dashboard-header {
  background: #fff;
  padding: 0 40px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid transparent;
  /* border-image: linear-gradient(90deg, #6c63ff, #19b98a) 1;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07); */
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── Dashboard layout: content + side panel ── */
.dashboard-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.side-panel {
  flex: 0 0 auto;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 92px;
  align-self: flex-start;
}

.side-tabs {
  background: #fff;
  border-radius: 14px;
  padding: 5px;
  box-shadow: 0 2px 12px rgba(108,99,255,0.07);
  display: flex;
  flex-direction: row;
  gap: 2px;
  flex-wrap: nowrap;
}

.dashboard-content {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
}

/* ── Stats panel ── */
.stats-panel {
  background: #fff;
  border-radius: 16px;
  padding: 18px 16px;
  box-shadow: 0 2px 12px rgba(108,99,255,0.07);
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.stats-total-btn {
  cursor: pointer;
  border-radius: 10px;
  padding: 6px 8px;
  margin: -6px -8px;
  transition: background 0.15s;
}
.stats-total-btn:hover { background: #f5f3ff; }
.stats-total-btn.stats-status-selected { background: #f0eeff; outline: 1px solid #c4b5fd; }

.stats-big-number {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
}
.stats-big-number.stats-color-tasks    { color: #6c63ff; }
.stats-big-number.stats-color-students { color: #059669; }
.stats-big-number.stats-color-classes  { color: #d97706; }

.stats-section-label {
  font-size: 0.78rem;
  color: #9ca3af;
  margin-top: 2px;
}

.stats-divider {
  border: none;
  border-top: 1px solid #f0eeff;
  margin: 0;
}

.stats-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-bar-label {
  font-size: 0.75rem;
  color: #6b7280;
  width: 42px;
  flex-shrink: 0;
  text-align: right;
}

.stats-bar-wrap {
  flex: 1;
  height: 6px;
  background: #f3f4f6;
  border-radius: 3px;
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.6s ease;
}

.stats-bar-purple { background: linear-gradient(90deg, #6c63ff, #a78bfa); }
.stats-bar-green  { background: linear-gradient(90deg, #059669, #34d399); }
.stats-bar-amber  { background: linear-gradient(90deg, #d97706, #fbbf24); }

.stats-bar-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: #9ca3af;
  width: 18px;
  flex-shrink: 0;
  text-align: start;
}

.stats-single-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-avg-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #d97706;
}

.stats-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.stats-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.stats-status-label {
  flex: 1;
  color: #6b7280;
}

.stats-status-count {
  font-weight: 700;
  color: #374151;
  font-size: 0.85rem;
}

.stats-status-filter {
  cursor: pointer;
  border-radius: 8px;
  padding: 5px 7px;
  margin: -5px -7px;
  transition: background 0.15s;
}

.stats-status-filter:hover:not(.stats-status-disabled) {
  background: #f5f3ff;
}

.stats-status-filter.stats-status-selected {
  background: #f0eeff;
  outline: 1px solid #c4b5fd;
}

.stats-status-filter.stats-status-disabled,
.stats-bar-filter.stats-status-disabled {
  opacity: 0.38;
  cursor: default;
  pointer-events: none;
}

.stats-bar-filter {
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.15s;
}

.stats-bar-filter:hover:not(.stats-status-disabled) { background: #f5f3ff; }
.stats-bar-filter.stats-status-selected { background: #f0eeff; outline: 1px solid #c4b5fd; }

.speech-bubble {
  position: relative;
  background: #f0eeff;
  border-radius: 16px;
  padding: 9px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #4c4899;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(108, 99, 255, 0.12);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -11px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 11px solid #f0eeff;
}

.brand-name-sm {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6c63ff, #19b98a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.header-logo-old {
  height: 52px;
  width: auto;
  object-fit: contain;
}
.header-logo {
  height: auto;
  max-width: 125px;
  object-fit: contain;
}
.header-teacher-name {
  font-size: 0.82rem;
  color: #9ca3af;
  font-weight: 500;
}

.dashboard-main {
  padding: 32px 40px;
}

.dashboard-welcome {
  font-size: 1.4rem;
  font-weight: 700;
  color: #041273;
  margin-bottom: 8px;
}

/* ── Sidebar navigation tabs ── */
.side-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-family: 'Heebo', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #9ca3af;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.side-tab:hover { background: #f5f3ff; color: #6c63ff; }

.side-tab-tasks.tab-btn-active    { background: #f0eeff; color: #6c63ff; font-weight: 700; }
.side-tab-students.tab-btn-active { background: #f0fdf9; color: #059669; font-weight: 700; }
.side-tab-classes.tab-btn-active  { background: #fffbeb; color: #d97706; font-weight: 700; }

.tab-icon  { font-size: 1rem; line-height: 1; flex-shrink: 0; }
.tab-label { font-size: 0.875rem; flex: 1; }

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #f3f4f6;
  color: #9ca3af;
  transition: background 0.15s, color 0.15s;
}

.side-tab-tasks.tab-btn-active .tab-count    { background: #ede9ff; color: #6c63ff; }
.side-tab-students.tab-btn-active .tab-count { background: #d1fae5; color: #059669; }
.side-tab-classes.tab-btn-active .tab-count  { background: #fef3c7; color: #d97706; }

/* ── Section header row (title + action button) ── */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.section-header-row .section-title { margin-bottom: 0; }

/* ── Coming soon badge ── */
.coming-soon-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: #6c63ff;
  color: #fff;
  border-radius: 20px;
  padding: 1px 7px;
  margin-right: 4px;
  vertical-align: middle;
}

/* ── Difficulty selector ── */
.difficulty-selector {
  display: flex;
  gap: 8px;
}

.diff-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: 12px;
  border: 2px solid #d8dce8;
  background: #faf9f8;
  color: #9ca3af;
  font-family: 'Heebo', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.diff-btn:hover {
  border-color: #4f6bff;
  box-shadow: 0 0 0 4px rgba(79, 107, 255, 0.12);
}

.diff-btn-active {
  background: #F5F7FC;
  /* border-color: #4e42bb; */
  color: #041273;
  font-weight: 700;
}

/* Feedback modal */
.feedback-section {
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
}
.feedback-strengths {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.feedback-improvements {
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.feedback-section-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: #041273;
  margin-bottom: 0.45rem;
}
.feedback-list {
  margin: 0;
  padding-right: 1.2rem;
  font-size: 0.875rem;
  line-height: 1.65;
}
.feedback-list li + li { margin-top: 0.2rem; }

/* Submit ready button */
.btn-submit-ready {
  animation: pulse-green 1.8s ease-in-out 2;
}

@keyframes pulse-green {
  0%   { box-shadow: 0 0 0 0 rgba(22,163,74,0.45); }
  50%  { box-shadow: 0 0 0 8px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

/* ── AI Refine panel ── */
.refine-panel-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  color: #041273;
}
.refine-panel-sub {
  font-size: 0.78rem;
  font-weight: 400;
  color: #9ca3af;
}

.refine-history {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: #d8d4ff transparent;
}

.refine-msg {
  padding: 7px 12px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.5;
  max-width: 85%;
}
.refine-msg-user {
  background: #6c63ff;
  color: #fff;
  align-self: flex-end;
  border-bottom-left-radius: 4px;
}
.refine-msg-ai {
  background: #f0eeff;
  color: #2d2d2d;
  align-self: flex-start;
  border-bottom-right-radius: 4px;
}
.refine-msg-thinking {
  background: #f0eeff;
  color: #a78bfa;
  align-self: flex-start;
  border-bottom-right-radius: 4px;
  font-style: italic;
}

.refine-input-row {
  display: flex;
  gap: 8px;
}
.refine-input-row .form-control { flex: 1; border-radius: 10px; }

/* Hebrew placeholders stay RTL even when the field itself is LTR (English tasks) */
#taskPassage[dir="ltr"]::placeholder,
#taskQuestion[dir="ltr"]::placeholder,
#taskExpected[dir="ltr"]::placeholder { direction: rtl; text-align: right; }

/* Simulate chat */
.simulate-chat-box {
  overflow-y: auto;
  min-height: 180px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fafafa;
}

.chat-row {
  display: flex;
}

.chat-row-student { justify-content: flex-start; }
.chat-row-ai      { justify-content: flex-end; }

[dir="ltr"] .chat-row-student { justify-content: flex-end; }
[dir="ltr"] .chat-row-ai      { justify-content: flex-start; }
[dir="ltr"] .chat-avatar      { margin-left: 0; margin-right: 8px; }

.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-student {
  background: #041273;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble-ai {
  background: #e9e9eb;
  color: #111;
  border-bottom-left-radius: 4px;
}

.chat-typing {
  color: #9ca3af;
  font-size: 0.85rem;
  font-style: italic;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: contain;
  background: #ede9ff;
  flex-shrink: 0;
  align-self: flex-end;
  margin-left: 8px;
}

/* ── Simulation step bar ── */
.sim-step-bar { display: flex; align-items: center; justify-content: center; padding: 4px 0 6px; }
.sim-step-item { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 50px; }
.sim-step-circle { width: 26px; height: 26px; border-radius: 50%; background: #e5e7eb; color: #9ca3af; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; transition: background 0.3s, color 0.3s; flex-shrink: 0; }
.sim-step-label { font-size: 0.68rem; color: #9ca3af; font-weight: 500; transition: color 0.3s; white-space: nowrap; }
.sim-step-connector { flex: 1; height: auto; margin-top: 2px; max-width: 50px; opacity: 0.2; transition: opacity 0.3s; }
.sim-step-item.step-active .sim-step-circle { background: #6c63ff; color: #fff; }
.sim-step-item.step-active .sim-step-label  { color: #6c63ff; font-weight: 700; }
.sim-step-item.step-done   .sim-step-circle { background: #059669; color: #fff; }
.sim-step-item.step-done   .sim-step-label  { color: #059669; }
.sim-step-connector.step-done               { opacity: 1; }

/* ── Animated typing dots (simulate + student shared) ── */
.typing-dots { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.typing-dot { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; will-change: transform, opacity; animation: typingBounce 1.2s infinite ease-in-out; }
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingBounce { 0%, 80%, 100% { transform: scale(0.75); opacity: 0.4; } 40% { transform: scale(1.2); opacity: 1; } }

/* ── Icon send button (simulate) ── */
.btn-send-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: #6c63ff; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.15s, opacity 0.15s; }
.btn-send-icon:hover:not(:disabled) { background: #5b54e0; }
.btn-send-icon:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-send-icon svg { width: 20px; height: 20px; stroke: #fff; display: block; }

/* ── Sim char count ── */
.sim-char-count { font-size: 0.78rem; color: #9ca3af; text-align: left; margin-top: 4px; transition: color 0.2s; }
.sim-char-count.count-ok { color: #059669; }

/* ── Plan badge ── */
.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.plan-badge-trial {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.plan-badge-pro {
  background: linear-gradient(135deg, #6c63ff, #a78bfa);
  color: #fff;
}

/* ── Trial banner ── */
.trial-banner {
  background: #fff;
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: 0 4px 24px rgba(108, 99, 255, 0.08);
  border-right: 4px solid #fcd34d;
  margin-bottom: 28px;
}

.trial-banner-title {
  font-weight: 700;
  font-size: 1rem;
  color: #041273;
}

.trial-banner-sub {
  font-size: 0.83rem;
  color: #9ca3af;
}

.trial-usage-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trial-usage-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #6b7280;
  width: 90px;
  flex-shrink: 0;
}

.usage-bar-wrap {
  flex: 1;
  height: 8px;
  background: #f3f4f6;
  border-radius: 6px;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.usage-bar-ok   { background: linear-gradient(90deg, #6c63ff, #a78bfa); }
.usage-bar-warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.usage-bar-full { background: linear-gradient(90deg, #dc2626, #ef4444); }

.trial-usage-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: #6b7280;
  width: 44px;
  text-align: start;
  flex-shrink: 0;
}

/* ── Plan popover ── */
.plan-popover {
  position: fixed;
  background: #fff;
  border-radius: 18px;
  padding: 20px 22px;
  min-width: 270px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.14);
  border: 1px solid #e8e4ff;
  z-index: 1050;
}

.plan-popover-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #041273;
}

.plan-popover-sub {
  font-size: 0.8rem;
  color: #888;
  margin: 4px 0 0;
}

.plan-popover-pro .plan-popover-title {
  color: #7c3aed;
}

.pro-features-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.pro-features-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #2d2d2d;
}

.pro-feature-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ede9fe;
  color: #7c3aed;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Assign modal ── */
.assign-student-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 4px;
}

.assign-student-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
  margin-bottom: 2px;
}
.assign-student-item:hover  { background: #f5f3ff; }
.assign-student-item.selected { background: #ede9ff; }

.assign-student-name   { font-size: 0.9rem; flex: 1; }
.assign-student-badges { display: flex; gap: 4px; flex-wrap: wrap; }

.assign-date-field { display: flex; flex-direction: column; gap: 5px; }

.assign-date-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #6b7280;
}

.assign-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assign-link-row {
  padding: 10px 12px;
  border: 1px solid #ede9fe;
  border-radius: 10px;
  background: #faf9ff;
}
.assign-link-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}
.assign-link-actions {
  display: flex;
  gap: 6px;
}
.assign-action-btn {
  flex: 1;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  border: none;
  font-family: inherit;
  text-decoration: none;
  transition: filter 0.15s;
}
.assign-action-btn:hover { filter: brightness(0.93); }
.assign-action-wa {
  background: #25d366;
  color: #fff;
}
.assign-action-copy {
  background: #ede9fe;
  color: #5b21b6;
  border: 1.5px solid #c4b5fd;
}
.assign-action-email {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1.5px solid #bfdbfe;
}
.assign-email-input {
  font-size: 0.8rem;
}
.assign-email-input.is-invalid {
  border-color: #dc3545;
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.btn-whatsapp:hover { background: #1ebe5d; color: #fff; }

.btn-email-one {
  background: #ede9fe;
  color: #5b21b6;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.btn-email-one:hover { background: #ddd6fe; }

.quick-chip {
  background: #f0eeff;
  color: #6c63ff;
  border-radius: 20px;
  padding: 3px 10px 3px 8px;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.quick-chip-remove {
  background: none;
  border: none;
  color: #a78bfa;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
}

/* ── Session cards (submissions viewer) ── */
.session-card {
  padding: 10px 18px;
}

.session-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.session-card-toggle {
  cursor: pointer;
  user-select: none;
}
.session-card-toggle:hover { background: #f9f8ff; }

.session-card-body { padding-top: 4px; }

.session-chevron {
  font-size: 0.8rem;
  color: #a78bfa;
  flex-shrink: 0;
}

.session-summary-preview {
  font-size: 0.78rem;
  color: #6b7280;
  font-style: italic;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-student-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #2d2d2d;
}

.btn-student-card {
  background: none;
  border: none;
  padding: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: #2d2d2d;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.btn-student-card:hover {
  color: #6c63ff;
  text-decoration-color: #6c63ff;
}

/* ── Student card modal ── */
.student-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0eeff;
  margin-bottom: 16px;
}
.student-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ede9ff;
  color: #6c63ff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.student-card-info { flex: 1; }
.student-card-name { font-size: 1.2rem; font-weight: 700; color: #2d2d2d; }
.student-card-stats {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}
.student-stat { text-align: center; }
.student-stat-value { font-size: 1.4rem; font-weight: 700; color: #6c63ff; }
.student-stat-label { font-size: 0.75rem; color: #9ca3af; }
.student-card-notes {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.87rem;
  color: #92400e;
  margin-bottom: 16px;
}
.student-notes-label { font-weight: 600; }
.student-card-sessions { display: flex; flex-direction: column; gap: 0; }
.student-session-row {
  padding: 14px 0;
  border-bottom: 1px solid #f3f4f6;
}
.student-session-row:last-child { border-bottom: none; }
.student-session-title { font-weight: 600; font-size: 0.92rem; color: #2d2d2d; }
.student-session-subject {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  color: #7c3aed;
  background: #f5f3ff;
  border-radius: 10px;
  padding: 1px 8px;
  margin-right: 6px;
  vertical-align: middle;
}
.btn-open-task-session {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-open-task-session:hover { border-color: #6c63ff; color: #6c63ff; }
.student-session-summary {
  font-size: 0.84rem;
  color: #6b7280;
  margin: 6px 0 0;
  line-height: 1.5;
}
.student-session-note {
  font-size: 0.82rem;
  color: #7c3aed;
  margin: 4px 0 0;
}
.student-session-score {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.score-high    { background: #dcfce7; color: #166534; }
.score-mid     { background: #fef9c3; color: #854d0e; }
.score-low     { background: #fee2e2; color: #991b1b; }
.score-pending { background: #f3f4f6; color: #9ca3af; }

.session-date {
  font-size: 0.8rem;
  color: #9ca3af;
}

.session-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #041273;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}

.session-ai-summary {
  font-size: 0.88rem;
  color: #4b5563;
  background: #f8f7ff;
  border-right: 3px solid #a78bfa;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 10px;
  line-height: 1.6;
}

.sessions-score-progress {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c63ff;
  background: #ede9ff;
  border-radius: 10px;
  padding: 2px 9px;
  white-space: nowrap;
}
.sessions-score-progress.all-scored {
  color: #065f46;
  background: #d1fae5;
}

.session-final-answer {
  font-size: 0.93rem;
  line-height: 1.7;
  color: #374151;
  background: #fff;
  border: 1px solid #e8e4ff;
  border-radius: 10px;
  padding: 10px 14px;
  white-space: pre-wrap;
  margin-bottom: 10px;
}

.session-feedback-summary {
  font-size: 0.88rem;
  color: #6b7280;
  font-style: italic;
  margin-bottom: 8px;
}

.session-feedback-block {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
}

.session-strengths    { background: #f0fdf4; }
.session-improvements { background: #fffbeb; }

.session-feedback-label {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.session-feedback-list {
  margin: 0;
  padding-right: 18px;
  font-size: 0.85rem;
  color: #374151;
  line-height: 1.7;
}

.btn-session-chat-toggle {
  background: #f0eeff;
  border: none;
  color: #6c63ff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-session-chat-toggle:hover { background: #e4dfff; }

.session-chat-wrap { margin-top: 12px; }

.session-chat-box {
  background: #fdfcff;
  border: 1px solid #e8e4ff;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d8d4ff transparent;
}

.session-chat-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
}
.session-chat-ai      { justify-content: flex-start; }
.session-chat-student { justify-content: flex-end; }

.session-chat-avatar {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.session-chat-bubble {
  max-width: 80%;
  padding: 7px 12px;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.55;
}
.session-chat-bubble-ai      { background: #f0eeff; color: #2d2d2d; border-bottom-right-radius: 4px; }
.session-chat-bubble-student { background: #6c63ff; color: #fff;    border-bottom-left-radius: 4px; }

/* ── Task expandable card ── */
.task-card-expandable .task-card-header {
  cursor: pointer;
}

.task-chevron {
  display: inline-block;
  font-size: 0.75rem;
  color: #a78bfa;
  transition: transform 0.22s ease;
}

.task-card-expandable.expanded .task-chevron {
  transform: rotate(180deg);
}

.task-expand-area {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.task-card-expandable.expanded .task-expand-area {
  max-height: 200px;
}

.task-expand-inner {
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid #f0eeff;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.task-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #e0d9ff;
  background: #f5f3ff;
  color: #4c3d9e;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.task-expand-btn:hover {
  background: #ede9ff;
  border-color: #c4b5fd;
  color: #3730a3;
}

.task-expand-btn-disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

/* ── Student expandable card ── */
.student-card-main {
  cursor: pointer;
}

.student-chevron {
  display: inline-block;
  font-size: 0.75rem;
  color: #c4b5fd;
  transition: transform 0.22s ease;
  line-height: 1;
  flex-shrink: 0;
}

.student-card.expanded .student-chevron {
  transform: rotate(180deg);
}

.student-details {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.student-card.expanded .student-details {
  max-height: 300px;
}

.student-details-inner {
  padding-top: 14px;
  margin-top: 12px;
  border-top: 1px solid #f0eeff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.student-detail-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.88rem;
  color: #4b5563;
  line-height: 1.5;
}

/* ── Join code ── */
.join-code-badge {
  display: inline-block;
  font-family: monospace;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: #6c63ff;
  background: #f0eeff;
  padding: 10px 22px;
  border-radius: 14px;
  border: 2px dashed #c4b5fd;
}

.join-code-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-code-generate {
  background: linear-gradient(135deg, #6c63ff, #a78bfa);
  color: #fff;
  border: none;
  font-weight: 600;
  border-radius: 12px;
  padding: 9px 20px;
  font-size: 0.9rem;
  box-shadow: 0 3px 10px rgba(108, 99, 255, 0.28);
  transition: box-shadow 0.15s, transform 0.15s;
}

.btn-code-generate:hover {
  box-shadow: 0 5px 16px rgba(108, 99, 255, 0.42);
  color: #fff;
  transform: translateY(-1px);
}

.btn-copy-link {
  background: linear-gradient(135deg, #19b98a, #34d399);
  color: #fff;
  border: none;
  font-weight: 600;
  border-radius: 12px;
  padding: 10px 20px;
  font-size: 0.9rem;
  box-shadow: 0 3px 10px rgba(25, 185, 138, 0.28);
  transition: box-shadow 0.15s, transform 0.15s;
}

.btn-copy-link:hover {
  box-shadow: 0 5px 16px rgba(25, 185, 138, 0.42);
  color: #fff;
  transform: translateY(-1px);
}

.btn-code-regenerate {
  background: transparent;
  border: 2px solid #e8e4ff;
  color: #9ca3af;
  font-weight: 600;
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.btn-code-regenerate:hover {
  border-color: #c4b5fd;
  color: #6c63ff;
  background: #f5f3ff;
}

/* ── Modal centering fix for Bootstrap RTL ── */
.modal-dialog {
  margin-left: auto !important;
  margin-right: auto !important;
}

.simulate-task-summary {
  background: #f0eeff;
  border-right: 4px solid #6c63ff;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
  flex-shrink: 0;
}
.sim-summary-compact {
  max-height: 120px;
  font-size: 0.82rem;
  padding: 8px 12px;
}
.simulate-task-summary[dir="ltr"] {
  border-right: none;
  border-left: 4px solid #6c63ff;
  text-align: left;
}

.simulate-summary-passage {
  color: #2d2d2d;
  margin-bottom: 6px;
}

.simulate-summary-question {
  color: #4b4b8f;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #d8d4ff;
}

/* ── Shared eval rating styles (used in task.html and task-create.html) ── */
.eval-section { display: flex; flex-direction: column; gap: 10px; }
.eval-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.eval-required { color: #ef4444; }
.eval-optional { font-weight: 400; color: #9ca3af; text-transform: none; letter-spacing: 0; }
.eval-verdict-row { display: flex; gap: 10px; }
.btn-eval-verdict {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-eval-verdict:hover { border-color: #6c63ff; background: #f5f3ff; }
.btn-eval-verdict.active { border-color: #6c63ff; background: #ede9ff; }
.btn-eval-verdict[data-val="good"].active   { border-color: #16a34a; background: #f0fdf4; }
.btn-eval-verdict[data-val="issues"].active { border-color: #d97706; background: #fffbeb; }
.btn-eval-verdict[data-val="bad"].active    { border-color: #dc2626; background: #fef2f2; }
.verdict-icon { font-size: 1.6rem; line-height: 1; }
.verdict-text { font-size: 0.82rem; font-weight: 600; color: #374151; }
.eval-tags-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-eval-tag {
  font-size: 0.82rem;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 20px;
  padding: 5px 13px;
  cursor: pointer;
  color: #374151;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-eval-tag:hover { border-color: #6c63ff; }
.btn-eval-tag-issue.active { background: #fef2f2; border-color: #f87171; color: #b91c1c; font-weight: 600; }
.btn-eval-tag-pos.active   { background: #f0fdf4; border-color: #4ade80; color: #166534; font-weight: 600; }
.eval-done-msg { text-align: center; font-size: 1rem; font-weight: 600; color: #059669; padding: 16px 0; }
.btn-eval-verdict[data-bev="helped"].active    { border-color: #16a34a; background: #f0fdf4; }
.btn-eval-verdict[data-bev="didnt_help"].active { border-color: #d97706; background: #fffbeb; }
.btn-eval-verdict[data-bev="revealed"].active   { border-color: #dc2626; background: #fef2f2; }
.btn-eval-bev-depth {
  flex: 1; padding: 8px 10px; background: #f9fafb;
  border: 1.5px solid #e5e7eb; border-radius: 10px;
  font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.btn-eval-bev-depth:hover { border-color: #6c63ff; }
.btn-eval-bev-depth.active { border-color: #6c63ff; background: #ede9ff; font-weight: 700; }

/* ── Gen eval card (task-create.html, advisor only) ── */
.gen-eval-header { margin-bottom: 20px; }
.gen-eval-title  { font-size: 1.05rem; font-weight: 700; color: #041273; margin-bottom: 4px; }
.gen-eval-sub    { font-size: 0.87rem; color: #6b7280; line-height: 1.5; }

/* ── Modal header — global style ── */
.modal-header {
  background: #ff9500;
  color: #041273;
  border-bottom: none;
}
.modal-title { color: #041273; font-weight: 700; }
.modal-header .btn-close { filter: none; opacity: 0.6; }
.modal-header .btn-close:hover { opacity: 1; }

.icon-wait { width: 2em; height: 1em; vertical-align: -0.15em; display: inline-block; }
.icon-wait-lg { width: 2rem; height: 2rem; display: inline-block; }
.btn-primary .icon-wait,
.btn-primary .icon-wait-lg,
.btn-success .icon-wait,
.btn-success .icon-wait-lg { filter: brightness(0) invert(1); }

