/* =============================================
   TaskPortal — Main Stylesheet
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

/* ── CSS Variables ──────────────────────────── */
:root {
  --bg:       #0a0b14;
  --bg2:      #0f1120;
  --bg3:      #161828;
  --surface:  #1c1f35;
  --surface2: #232640;
  --border:   rgba(255,255,255,0.07);
  --border2:  rgba(255,255,255,0.13);

  --accent:   #6c63ff;
  --accent2:  #a78bfa;
  --accent3:  #38bdf8;
  --green:    #34d399;
  --yellow:   #fbbf24;
  --red:      #f87171;
  --pink:     #f472b6;

  --text:     #f1f2f7;
  --text2:    #9ca3c0;
  --text3:    #5c6082;

  --radius:   14px;
  --radius-sm:8px;
  --shadow:   0 8px 40px rgba(0,0,0,0.5);
  --shadow-lg:0 20px 80px rgba(0,0,0,0.6);

  --assignment: #6c63ff;
  --project:    #38bdf8;
  --exam:       #f87171;
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; border: none; outline: none; }
input, textarea, select {
  font-family: inherit;
  outline: none;
}

/* ── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 99px; }

/* ── Typography ─────────────────────────────── */
h1,h2,h3,h4,h5 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

/* ── Page Loader ────────────────────────────── */
#page-loader {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s, visibility 0.5s;
}
#page-loader.hidden { opacity: 0; visibility: hidden; }
.loader-logo {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulse 1s ease-in-out infinite;
}
.loader-bar {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent3));
  animation: loadBar 1.2s ease-in-out forwards;
}
@keyframes loadBar { from { width: 0; } to { width: 100%; } }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* ── Background Grid ────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(108,99,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108,99,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  pointer-events: none;
  animation: blobMove 12s ease-in-out infinite alternate;
}
.bg-blob-1 { width: 600px; height: 600px; background: var(--accent); top: -200px; right: -200px; }
.bg-blob-2 { width: 400px; height: 400px; background: var(--accent3); bottom: -100px; left: -100px; animation-delay: -4s; }
@keyframes blobMove {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(30px,20px) scale(1.05); }
}

/* ── Auth Page ──────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.6s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes slideUp {
  from { opacity:0; transform: translateY(40px); }
  to   { opacity:1; transform: translateY(0); }
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2rem;
  justify-content: center;
}
.auth-logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.auth-logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-title {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
  text-align: center;
}
.auth-subtitle {
  color: var(--text2);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}
.auth-tabs {
  display: flex;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.5rem;
}
.auth-tab {
  flex: 1;
  padding: 0.6rem;
  text-align: center;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active {
  background: var(--accent);
  color: white;
  font-weight: 600;
}

/* ── Form Elements ──────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}
.form-control {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.2);
}
.form-control::placeholder { color: var(--text3); }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%239ca3c0' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
textarea.form-control { resize: vertical; min-height: 100px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 30px rgba(108,99,255,0.5);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-secondary:hover { background: var(--bg3); border-color: var(--accent); }
.btn-danger {
  background: rgba(248,113,113,0.15);
  color: var(--red);
  border: 1px solid rgba(248,113,113,0.3);
}
.btn-danger:hover { background: rgba(248,113,113,0.25); }
.btn-success {
  background: rgba(52,211,153,0.15);
  color: var(--green);
  border: 1px solid rgba(52,211,153,0.3);
}
.btn-success:hover { background: rgba(52,211,153,0.25); }
.btn-full { width: 100%; }
.btn-sm { padding: 0.45rem 1rem; font-size: 0.85rem; }
.btn-icon {
  width: 38px; height: 38px;
  padding: 0;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
}
.btn-icon:hover { color: var(--text); border-color: var(--accent); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ── Alert / Toast ──────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fadeIn 0.3s ease;
}
.alert-error  { background: rgba(248,113,113,0.15); border: 1px solid rgba(248,113,113,0.3); color: var(--red); }
.alert-success{ background: rgba(52,211,153,0.15);  border: 1px solid rgba(52,211,153,0.3);  color: var(--green); }
.alert-info   { background: rgba(56,189,248,0.15);  border: 1px solid rgba(56,189,248,0.3);  color: var(--accent3); }

#toast-container {
  position: fixed;
  top: 1.5rem; right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.toast {
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--shadow);
  animation: toastIn 0.4s cubic-bezier(0.16,1,0.3,1) both;
  min-width: 260px;
}
.toast.removing { animation: toastOut 0.3s ease forwards; }
.toast-success { background: var(--surface); border-left: 3px solid var(--green); }
.toast-error   { background: var(--surface); border-left: 3px solid var(--red); }
.toast-info    { background: var(--surface); border-left: 3px solid var(--accent); }
@keyframes toastIn  { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:translateX(0)} }
@keyframes toastOut { from{opacity:1;transform:translateX(0)} to{opacity:0;transform:translateX(20px)} }

/* ── App Layout ─────────────────────────────── */
.app { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────── */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.sidebar-logo {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sidebar-user {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.sidebar-avatar {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  border: 2px solid var(--accent);
}
.sidebar-user-name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-role {
  font-size: 0.76rem;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.role-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.role-badge.teacher { background: rgba(108,99,255,0.2); color: var(--accent2); }
.role-badge.student { background: rgba(56,189,248,0.2); color: var(--accent3); }

.sidebar-nav { flex: 1; padding: 1rem 0.8rem; overflow-y: auto; }
.nav-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  padding: 0.8rem 0.7rem 0.4rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(108,99,255,0.2), transparent);
  color: var(--accent2);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-item .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
}

.sidebar-footer {
  padding: 1rem 0.8rem;
  border-top: 1px solid var(--border);
}

/* ── Main Content ───────────────────────────── */
.main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 65px;
  background: rgba(10,11,20,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  position: sticky;
  top: 0; z-index: 50;
  gap: 1rem;
}
.topbar-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

.content {
  flex: 1;
  padding: 2rem;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* ── Page sections (tabs) ───────────────────── */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.35s ease; }

/* ── Stats Cards ────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) both;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--border2); }
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--card-color, var(--accent)) 0%, transparent 60%);
  opacity: 0.07;
}
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  background: rgba(255,255,255,0.06);
}
.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-label { font-size: 0.82rem; color: var(--text2); }

/* ── Section Header ─────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}
.section-title {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ── Task Cards ─────────────────────────────── */
.tasks-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  cursor: pointer;
  transition: all 0.25s;
  animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) both;
  position: relative;
  overflow: hidden;
}
.task-card::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--type-color, var(--accent));
  border-radius: 0 2px 2px 0;
}
.task-card:hover {
  border-color: var(--border2);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}
.task-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.task-type-badge.assignment { background: rgba(108,99,255,0.2); color: var(--assignment); }
.task-type-badge.project    { background: rgba(56,189,248,0.2); color: var(--project); }
.task-type-badge.exam       { background: rgba(248,113,113,0.2); color: var(--exam); }

.task-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-family: 'Syne', sans-serif;
}
.task-desc {
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text3);
}
.task-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.due-badge {
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.due-badge.overdue  { background: rgba(248,113,113,0.15); color: var(--red); }
.due-badge.soon     { background: rgba(251,191,36,0.15);  color: var(--yellow); }
.due-badge.ok       { background: rgba(52,211,153,0.15);  color: var(--green); }
.submitted-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--green);
  font-weight: 500;
}

/* ── Modal ──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeOverlay 0.25s ease;
  overflow-y: auto;
}
@keyframes fadeOverlay { from{opacity:0} to{opacity:1} }
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 20px;
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.35s cubic-bezier(0.16,1,0.3,1) both;
  position: relative;
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-lg { max-width: 800px; }
@keyframes modalIn { from{opacity:0;transform:scale(0.92) translateY(20px)} to{opacity:1;transform:scale(1) translateY(0)} }
.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--red); color: white; border-color: var(--red); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ── File Upload ────────────────────────────── */
.file-drop {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.file-drop:hover, .file-drop.dragging {
  border-color: var(--accent);
  background: rgba(108,99,255,0.05);
}
.file-drop-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.file-drop-text { font-size: 0.88rem; color: var(--text2); }
.file-drop-text span { color: var(--accent2); font-weight: 500; }
.file-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 0.5rem;
}
.file-preview-icon { font-size: 1.5rem; }
.file-preview-name { font-size: 0.88rem; font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-size { font-size: 0.78rem; color: var(--text2); }
.file-remove { color: var(--red); cursor: pointer; font-size: 1.1rem; }

/* ── Target Selector ────────────────────────── */
.target-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.target-option {
  border: 2px solid var(--border2);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.target-option:hover { border-color: var(--accent); }
.target-option.selected { border-color: var(--accent); background: rgba(108,99,255,0.1); }
.target-option-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.target-option-label { font-size: 0.85rem; font-weight: 600; }
.target-option-desc { font-size: 0.75rem; color: var(--text2); margin-top: 2px; }

/* ── Student Selector ───────────────────────── */
.student-search {
  position: relative;
  margin-bottom: 0.75rem;
}
.student-search input {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  color: var(--text);
  font-size: 0.88rem;
}
.student-search-icon {
  position: absolute;
  left: 0.8rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  font-size: 0.9rem;
}
.student-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.student-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.student-item:last-child { border-bottom: none; }
.student-item:hover { background: var(--surface2); }
.student-item.selected { background: rgba(108,99,255,0.1); }
.student-checkbox {
  width: 18px; height: 18px;
  border: 2px solid var(--border2);
  border-radius: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: all 0.2s;
}
.student-item.selected .student-checkbox {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.student-name { font-size: 0.88rem; font-weight: 500; }
.student-id-badge { font-size: 0.75rem; color: var(--text3); margin-left: auto; }
.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(108,99,255,0.15);
  border-radius: 99px;
  font-size: 0.78rem;
  color: var(--accent2);
}
.tag-remove { cursor: pointer; color: var(--accent2); font-size: 0.8rem; }

/* ── Submission Detail ──────────────────────── */
.submission-list { display: flex; flex-direction: column; gap: 0.75rem; }
.submission-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  animation: slideUp 0.3s ease both;
}
.submission-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.sub-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.sub-info { flex: 1; }
.sub-name { font-size: 0.9rem; font-weight: 600; }
.sub-time { font-size: 0.75rem; color: var(--text3); }
.sub-status {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
}
.sub-status.submitted { background: rgba(56,189,248,0.15); color: var(--accent3); }
.sub-status.graded    { background: rgba(52,211,153,0.15);  color: var(--green); }
.sub-status.late      { background: rgba(251,191,36,0.15);  color: var(--yellow); }

.grade-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.grade-input-row input {
  width: 70px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  color: var(--text);
  font-size: 0.9rem;
  text-align: center;
}
.grade-display {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green);
}

/* ── Empty State ────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text2);
}
.empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-title { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.empty-desc  { font-size: 0.88rem; }

/* ── Notifications Panel ────────────────────── */
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  animation: dropDown 0.2s cubic-bezier(0.16,1,0.3,1);
}
@keyframes dropDown { from{opacity:0;transform:translateY(-8px)} to{opacity:1;transform:translateY(0)} }
.notif-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-header-title { font-weight: 700; font-size: 0.95rem; }
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: rgba(108,99,255,0.05); }
.notif-item-title { font-size: 0.88rem; font-weight: 600; margin-bottom: 2px; }
.notif-item-msg   { font-size: 0.8rem; color: var(--text2); }
.notif-item-time  { font-size: 0.72rem; color: var(--text3); margin-top: 4px; }
.notif-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); float: right; margin-top: 4px; }

/* ── Task Detail ────────────────────────────── */
.task-detail-type-bar {
  height: 4px;
  border-radius: 99px;
  margin-bottom: 1.5rem;
}
.task-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.task-info-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  text-align: center;
}
.task-info-label { font-size: 0.72rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.3rem; }
.task-info-value { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; }

/* ── Attachment ─────────────────────────────── */
.attachment-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.attachment-card:hover { border-color: var(--accent); }
.attachment-icon { font-size: 1.8rem; }
.attachment-name { font-size: 0.88rem; font-weight: 600; }
.attachment-size { font-size: 0.75rem; color: var(--text3); }

/* ── Hamburger (mobile) ─────────────────────── */
.hamburger {
  display: none;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
}

/* ── Spinner ────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
@keyframes spin { to{transform:rotate(360deg)} }

/* ── Misc Utility ───────────────────────────── */
.hidden  { display: none !important; }
.text-muted { color: var(--text2); }
.text-sm    { font-size: 0.85rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ── Staggered animation delays ─────────────── */
.stat-card:nth-child(1){animation-delay:0.05s}
.stat-card:nth-child(2){animation-delay:0.1s}
.stat-card:nth-child(3){animation-delay:0.15s}
.stat-card:nth-child(4){animation-delay:0.2s}
.task-card:nth-child(1){animation-delay:0.05s}
.task-card:nth-child(2){animation-delay:0.1s}
.task-card:nth-child(3){animation-delay:0.15s}
.task-card:nth-child(4){animation-delay:0.2s}
.task-card:nth-child(5){animation-delay:0.25s}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .task-info-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 0 100vw rgba(0,0,0,0.5); }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .content { padding: 1.2rem; }
  .stats-grid { grid-template-columns: repeat(2,1fr); gap: 0.8rem; }
  .tasks-grid { grid-template-columns: 1fr; }
  .form-row  { grid-template-columns: 1fr; }
  .target-options { grid-template-columns: 1fr; }
  .modal { margin: 1rem; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 1.5rem; }
  .topbar { padding: 0 1rem; }
  .auth-card { padding: 2rem 1.5rem; }
}

/* ── Admin Styles ───────────────────────────── */
.role-badge.admin { background: rgba(251,191,36,0.2); color: var(--yellow); }

.approval-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.approval-badge.pending  { background: rgba(251,191,36,.15); color: var(--yellow); }
.approval-badge.approved { background: rgba(52,211,153,.15);  color: var(--green); }
.approval-badge.rejected { background: rgba(248,113,113,.15); color: var(--red); }

.admin-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.admin-tab {
  padding: .6rem 1.2rem;
  border-radius: 8px 8px 0 0;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  transition: all .2s;
  margin-bottom: -1px;
}
.admin-tab:hover { color: var(--text); background: var(--surface2); }
.admin-tab.active {
  color: var(--accent2);
  background: var(--surface);
  border-color: var(--border2);
  font-weight: 600;
}

.admin-section { display: none; }
.admin-section.active { display: block; animation: fadeIn .3s ease; }

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.user-table th {
  text-align: left;
  padding: .75rem 1rem;
  background: var(--bg2);
  color: var(--text2);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
}
.user-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.user-table tr:last-child td { border-bottom: none; }
.user-table tr:hover td { background: var(--surface2); }
.user-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  overflow-x: auto;
}

.inactive-row td { opacity: .45; }

.pending-task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  margin-bottom: 1rem;
  animation: slideUp .4s cubic-bezier(.16,1,.3,1) both;
}
.pending-task-card.pending  { border-left: 3px solid var(--yellow); }
.pending-task-card.approved { border-left: 3px solid var(--green);  }
.pending-task-card.rejected { border-left: 3px solid var(--red);    }

.pending-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .75rem;
}
.pending-card-actions {
  display: flex;
  gap: .5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
}
.admin-note-input {
  flex: 1;
  min-width: 180px;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: .45rem .8rem;
  color: var(--text);
  font-size: .85rem;
}
.admin-note-input::placeholder { color: var(--text3); }

.create-user-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  max-width: 600px;
}

.filter-tabs {
  display: flex;
  gap: .4rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}
.filter-tab {
  padding: .4rem 1rem;
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text2);
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .2s;
}
.filter-tab:hover { border-color: var(--accent); color: var(--text); }
.filter-tab.active { background: var(--accent); color: white; border-color: var(--accent); }
