/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0f1e;
  --bg2: #111827;
  --bg3: #1e293b;
  --surface: #1e2d45;
  --surface2: #243447;
  --border: rgba(99,179,237,0.15);
  --accent: #38bdf8;
  --accent2: #818cf8;
  --accent3: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --text: #f0f6ff;
  --text2: #94a3b8;
  --text3: #64748b;
  --student-accent: #38bdf8;
  --teacher-accent: #818cf8;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 30px rgba(56,189,248,0.15);
}

html { height: 100%; }
body {
  font-family: 'Heebo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
}

/* ===== PAGES ===== */
.page { display: none; min-height: 100vh; }
.page.active { display: block; }
#page-login { display: flex; }

/* ===== LOGIN PAGE ===== */
#page-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: fixed; inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse at 20% 30%, rgba(56,189,248,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 70%, rgba(129,140,248,0.08) 0%, transparent 60%),
              #0a0f1e;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: float 8s ease-in-out infinite;
}
.orb1 { width: 400px; height: 400px; background: rgba(56,189,248,0.07); top: -100px; right: -100px; animation-delay: 0s; }
.orb2 { width: 300px; height: 300px; background: rgba(129,140,248,0.07); bottom: -50px; left: -50px; animation-delay: -3s; }
.orb3 { width: 200px; height: 200px; background: rgba(52,211,153,0.05); top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -6s; }

.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(56,189,248,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-20px) scale(1.05); }
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(400px, 92vw);
  background: rgba(30,45,69,0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 40px 32px;
  box-shadow: var(--shadow), 0 0 60px rgba(56,189,248,0.05);
  animation: cardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.app-logo { text-align: center; margin-bottom: 36px; }

.logo-icon {
  font-size: 52px;
  display: block;
  margin-bottom: 8px;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.logo-text {
  font-size: 36px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.logo-sub {
  color: var(--text2);
  font-size: 14px;
  margin-top: 4px;
}

.login-buttons { display: flex; flex-direction: column; gap: 14px; }

.btn-role {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg3);
  color: var(--text);
  font-family: 'Heebo', sans-serif;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: right;
  position: relative;
  overflow: hidden;
}

.btn-role::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s;
}

.btn-role.student::before { background: linear-gradient(135deg, rgba(56,189,248,0.1), transparent); }
.btn-role.teacher::before { background: linear-gradient(135deg, rgba(129,140,248,0.1), transparent); }

.btn-role:hover::before { opacity: 1; }
.btn-role:hover { border-color: rgba(99,179,237,0.4); transform: translateY(-2px); box-shadow: var(--shadow); }

.btn-role.student:hover { box-shadow: 0 8px 30px rgba(56,189,248,0.2); }
.btn-role.teacher:hover { box-shadow: 0 8px 30px rgba(129,140,248,0.2); }

.role-icon { font-size: 26px; }
.role-label { flex: 1; }
.role-arrow { color: var(--text3); font-size: 18px; }

/* ===== MODALS ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  align-items: flex-end;
  justify-content: center;
}

.modal.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@media (min-width: 480px) {
  .modal { align-items: center; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 28px 28px 0 0;
  padding: 28px 24px 40px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 480px) {
  .modal-box {
    border-radius: 28px;
    padding: 32px 28px;
  }
}

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

.modal-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--bg3);
  border: none;
  color: var(--text2);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--danger); color: white; }

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 13px 15px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Heebo', sans-serif;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  direction: rtl;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.1);
}

.form-group select option { background: var(--bg3); }
.form-group textarea { resize: vertical; }

.form-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; min-height: 18px; }

.btn-primary {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  border: none;
  border-radius: var(--radius-sm);
  color: #0a0f1e;
  font-family: 'Heebo', sans-serif;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(56,189,248,0.3); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  width: 100%;
  padding: 13px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Heebo', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ===== APP HEADER ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(10,15,30,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-back {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text2);
  font-family: 'Heebo', sans-serif;
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.header-back:hover { border-color: var(--danger); color: var(--danger); }

.header-info { text-align: center; }
.header-name { display: block; font-weight: 700; font-size: 15px; }
.header-class { font-size: 12px; color: var(--accent); background: rgba(56,189,248,0.1); padding: 2px 8px; border-radius: 10px; }
.header-title { font-size: 17px; font-weight: 700; }
.header-logo { font-size: 24px; }

/* ===== STUDENT AREA ===== */
.student-content { padding: 20px 16px; max-width: 600px; margin: 0 auto; }

.student-welcome { margin-bottom: 24px; }
.student-welcome h2 { font-size: 26px; font-weight: 800; }
.student-subtitle { color: var(--text2); font-size: 14px; margin-top: 4px; }

.tasks-list { display: flex; flex-direction: column; gap: 14px; }

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  animation: cardIn 0.4s ease both;
}

.task-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  transition: width 0.25s;
}

.task-card.submitted::before { background: var(--accent3); }
.task-card.overdue::before { background: var(--danger); }

.task-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(56,189,248,0.3); }

.task-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.task-card-name { font-weight: 700; font-size: 16px; }

.task-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-pending { background: rgba(248,113,113,0.15); color: var(--danger); }
.badge-submitted { background: rgba(52,211,153,0.15); color: var(--accent3); }
.badge-graded { background: rgba(56,189,248,0.15); color: var(--accent); }
.badge-overdue { background: rgba(248,113,113,0.15); color: var(--danger); }
.badge-late { background: rgba(251,191,36,0.15); color: var(--warning); }

.task-card-desc { color: var(--text2); font-size: 13px; margin-bottom: 10px; line-height: 1.5; }

.task-card-footer { display: flex; justify-content: space-between; align-items: center; }
.task-date { font-size: 12px; color: var(--text3); }
.task-grade { font-size: 14px; font-weight: 700; color: var(--accent); }

.task-submit-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  border: none;
  border-radius: 20px;
  color: #0a0f1e;
  font-family: 'Heebo', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.task-submit-btn:hover { transform: scale(1.05); }
.task-submit-btn.resubmit { background: linear-gradient(135deg, var(--accent3), #059669); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 16px; }

/* ===== TEACHER AREA ===== */
.teacher-nav {
  display: flex;
  gap: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.teacher-nav::-webkit-scrollbar { display: none; }

.nav-tab {
  flex: 1;
  min-width: 70px;
  padding: 14px 8px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text3);
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tab.active { color: var(--accent2); border-bottom-color: var(--accent2); }
.nav-tab:hover:not(.active) { color: var(--text2); }

.teacher-tab { display: none; padding: 16px; max-width: 700px; margin: 0 auto; }
.teacher-tab.active { display: block; }

.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.tab-header h2 { font-size: 20px; font-weight: 800; }

.btn-add {
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--accent2), #6366f1);
  border: none;
  border-radius: 20px;
  color: white;
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-add:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(129,140,248,0.3); }

/* CLASS CARDS */
.class-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  animation: cardIn 0.3s ease both;
}

.class-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.class-card-name { font-size: 18px; font-weight: 800; }
.class-card-count { font-size: 12px; color: var(--text3); }

.class-card-actions { display: flex; gap: 8px; }

.btn-icon {
  width: 34px; height: 34px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon.danger:hover { border-color: var(--danger); color: var(--danger); }

/* STUDENT ROWS */
.student-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg3);
  border-radius: 8px;
  margin-bottom: 6px;
  gap: 12px;
}
.student-row-name { flex: 1; font-weight: 600; font-size: 14px; }
.student-row-id { font-size: 12px; color: var(--text3); }

/* כפתור חזרה במודאל כניסת תלמיד */
.btn-back {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: var(--radius-sm);
  color: var(--text3);
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-back:hover { border-color: var(--accent); color: var(--accent); }

/* hint טקסט בכניסת תלמיד */
.student-login-hint {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 16px;
  text-align: center;
  padding: 10px;
  background: rgba(56,189,248,0.06);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56,189,248,0.15);
}
.student-login-hint strong { color: var(--accent); }

/* TASK ROW (teacher) */
.teacher-task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  animation: cardIn 0.3s ease both;
}

.teacher-task-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.teacher-task-name { font-weight: 700; font-size: 16px; }
.teacher-task-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.teacher-task-class { font-size: 12px; background: rgba(129,140,248,0.15); color: var(--accent2); padding: 3px 10px; border-radius: 20px; }
.teacher-task-date { font-size: 12px; color: var(--text3); }
.teacher-task-desc { font-size: 13px; color: var(--text2); margin-bottom: 8px; }

/* SUBMISSION CARDS */
.submission-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
  animation: cardIn 0.3s ease both;
}
.submission-card:hover { border-color: var(--accent2); transform: translateY(-1px); }
.submission-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.submission-student { font-weight: 700; font-size: 15px; }
.submission-task { font-size: 13px; color: var(--text2); }
.submission-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.submission-time { font-size: 12px; color: var(--text3); }
.grade-badge { font-size: 13px; font-weight: 700; color: var(--accent3); background: rgba(52,211,153,0.1); padding: 3px 10px; border-radius: 20px; }
.no-grade-badge { font-size: 12px; color: var(--warning); background: rgba(251,191,36,0.1); padding: 3px 10px; border-radius: 20px; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  animation: cardIn 0.3s ease both;
}
.stat-number { font-size: 32px; font-weight: 900; }
.stat-label { font-size: 12px; color: var(--text2); margin-top: 4px; }

.stat-card.blue .stat-number { color: var(--accent); }
.stat-card.purple .stat-number { color: var(--accent2); }
.stat-card.green .stat-number { color: var(--accent3); }
.stat-card.yellow .stat-number { color: var(--warning); }

.stats-class-section { margin-top: 20px; }
.stats-class-title { font-weight: 700; font-size: 15px; margin-bottom: 10px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; font-size: 12px; }

.progress-bar-wrap { margin-bottom: 10px; }
.progress-bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.progress-bar-track { background: var(--bg3); border-radius: 4px; height: 8px; overflow: hidden; }
.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.6s ease;
}

/* SUBMIT OPTIONS */
.submit-options { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }

.submit-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Heebo', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: right;
}
.submit-option:hover { border-color: var(--accent); background: rgba(56,189,248,0.05); }
.submit-option span:first-child { font-size: 24px; }

.submit-status { text-align: center; font-size: 14px; margin-top: 12px; color: var(--text2); min-height: 20px; }
.submit-task-desc { color: var(--text2); font-size: 14px; margin-bottom: 16px; line-height: 1.5; }

.submit-preview img { width: 100%; border-radius: 10px; max-height: 300px; object-fit: contain; background: var(--bg3); }
.submit-preview .file-preview { padding: 14px; background: var(--bg3); border-radius: 10px; font-size: 14px; color: var(--accent); }

/* VIEW SUBMISSION */
#view-submission-content img { width: 100%; border-radius: 12px; }
#view-submission-content .file-link { color: var(--accent); text-decoration: underline; font-size: 14px; }
.sub-info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.sub-info-label { color: var(--text3); }
.sub-info-value { font-weight: 600; }

/* CLASS SELECT ROW */
.class-select-row { display: flex; align-items: center; gap: 10px; padding: 0 0 12px; }
.class-select-row label { font-size: 13px; color: var(--text2); white-space: nowrap; }
.class-select-row select {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'Heebo', sans-serif;
  font-size: 14px;
  outline: none;
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 13px 22px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(52,211,153,0.4); color: var(--accent3); }
.toast.error { border-color: rgba(248,113,113,0.4); color: var(--danger); }

/* CAMERA */
#camera-preview { border: 2px solid var(--accent); }

.camera-controls { display: flex; gap: 10px; margin-top: 10px; }
.camera-controls button { flex: 1; }

/* LOADING */
.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--bg3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

/* RESPONSIVE */
@media (max-width: 360px) {
  .login-card { padding: 28px 20px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ===== SUBMISSIONS – NEW STYLES ===== */

/* summary grid */
.sub-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.sub-stat {
  text-align: center;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.sub-stat-num { font-size: 22px; font-weight: 800; line-height: 1.1; }
.sub-stat-lbl { font-size: 10px; color: var(--text3); margin-top: 2px; }
.sub-stat.on-time  { background: rgba(52,211,153,0.08); border-color: rgba(52,211,153,0.25); }
.sub-stat.on-time .sub-stat-num  { color: var(--accent3); }
.sub-stat.late     { background: rgba(251,191,36,0.08);  border-color: rgba(251,191,36,0.25); }
.sub-stat.late .sub-stat-num     { color: var(--warning); }
.sub-stat.missing  { background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.25); }
.sub-stat.missing .sub-stat-num  { color: var(--danger); }
.sub-stat.avg      { background: rgba(129,140,248,0.08); border-color: rgba(129,140,248,0.25); }
.sub-stat.avg .sub-stat-num      { color: var(--accent2); }

/* badges */
.sub-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.sub-badge--submitted { background: rgba(52,211,153,0.15); color: var(--accent3); }
.sub-badge--late      { background: rgba(251,191,36,0.15);  color: var(--warning); }
.sub-badge--missing   { background: rgba(248,113,113,0.12); color: var(--danger); }

/* card variants */
.submission-card--submitted { border-right: 3px solid var(--accent3); }
.submission-card--late      { border-right: 3px solid var(--warning); }
.submission-card--missing   { opacity: 0.75; }

/* teacher note in student view */
.task-overdue-note {
  font-size: 12px;
  color: var(--warning);
  margin: 6px 0 0;
  padding: 5px 10px;
  background: rgba(251,191,36,0.07);
  border-radius: 6px;
  border: 1px solid rgba(251,191,36,0.2);
}
.teacher-note-box {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: rgba(129,140,248,0.07);
  border-radius: 10px;
  border: 1px solid rgba(129,140,248,0.2);
}
.teacher-note-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent2);
  display: block;
  margin-bottom: 4px;
}
.teacher-note-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
}

/* sub-task-row */
#sub-task-row { align-items: center; }


/* ===== CLICKABLE SUMMARY TILES ===== */
.clickable-stat {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.clickable-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
.clickable-stat:active { transform: scale(0.96); }

.stat-active {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

/* 5-column summary grid for teacher */
.sub-summary-grid--5 { grid-template-columns: repeat(5, 1fr); }
.sub-stat.ungraded { background: rgba(167,139,250,0.08); border-color: rgba(167,139,250,0.25); }
.sub-stat.ungraded .sub-stat-num { color: #a78bfa; }

/* ===== TASK OVERVIEW CARDS (teacher – class view) ===== */
.task-overview-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: fadeSlideIn 0.3s ease both;
}
.task-overview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  border-color: var(--accent);
}
.task-overview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}
.task-overview-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text1);
}
.task-overview-due {
  font-size: 12px;
  color: var(--text3);
  white-space: nowrap;
}
.task-overview-stats {
  display: flex;
  gap: 6px;
}
.tov-stat {
  flex: 1;
  text-align: center;
  padding: 7px 4px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.tov-num { display: block; font-size: 18px; font-weight: 800; line-height: 1.1; }
.tov-lbl { display: block; font-size: 10px; color: var(--text3); margin-top: 2px; }

.tov-stat.on-time  { background: rgba(52,211,153,0.08);  border-color: rgba(52,211,153,0.2);  }
.tov-stat.on-time .tov-num  { color: var(--accent3); }
.tov-stat.late     { background: rgba(251,191,36,0.08);  border-color: rgba(251,191,36,0.2);  }
.tov-stat.late .tov-num     { color: var(--warning); }
.tov-stat.missing  { background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.2); }
.tov-stat.missing .tov-num  { color: var(--danger); }
.tov-stat.ungraded { background: rgba(167,139,250,0.08); border-color: rgba(167,139,250,0.2); }
.tov-stat.ungraded .tov-num { color: #a78bfa; }
.tov-stat.avg      { background: rgba(129,140,248,0.08); border-color: rgba(129,140,248,0.2); }
.tov-stat.avg .tov-num      { color: var(--accent2); }
