/* ==========================================================================
   EDUHOMEWORK ONLINE - MAIN STYLESHEET
   Design Tokens: Dark/Light Themes, Glassmorphism, Micro-animations
   ========================================================================== */

:root {
  /* Color Palette - Dark Theme (Default) */
  --bg-primary: #0b0f19;
  --bg-secondary: #131b2e;
  --bg-tertiary: #1c2742;
  
  --glass-bg: rgba(19, 27, 46, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-glow: rgba(99, 102, 241, 0.15);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #cbd5e1;

  /* Accent Colors */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #8b5cf6;
  --success: #10b981;
  --success-hover: #059669;
  --warning: #f59e0b;
  --warning-hover: #d97706;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --info: #06b6d4;

  /* Status Colors */
  --status-pending-bg: rgba(239, 68, 68, 0.15);
  --status-pending-color: #f87171;
  
  --status-review-bg: rgba(245, 158, 11, 0.15);
  --status-review-color: #fbbf24;
  
  --status-graded-bg: rgba(16, 185, 129, 0.15);
  --status-graded-color: #34d399;

  --status-late-bg: rgba(6, 182, 212, 0.15);
  --status-late-color: #38bdf8;

  /* Role Colors */
  --role-teacher: #8b5cf6;
  --role-student: #3b82f6;
  --role-parent: #10b981;

  /* Fonts & Shadows */
  --font-family: 'Prompt', 'Kanit', sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Overrides */
[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;

  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-glow: rgba(99, 102, 241, 0.08);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #334155;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1);
}

/* Global Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Background Blurs */
.bg-blur {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
}

.blur-1 {
  top: -100px;
  left: -100px;
  width: 450px;
  height: 450px;
  background: var(--primary);
}

.blur-2 {
  bottom: -150px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: var(--secondary);
}

.blur-3 {
  top: 40%;
  left: 30%;
  width: 350px;
  height: 350px;
  background: var(--info);
  opacity: 0.2;
}

/* Glass Panel Styling */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: var(--shadow-lg);
}

/* App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.brand-name {
  font-size: 22px;
  font-weight: 700;
  display: block;
  background: linear-gradient(90deg, #fff, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .brand-name {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

/* Role Switcher Bar */
.role-switcher-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-tertiary);
  padding: 6px 12px;
  border-radius: 40px;
  border: 1px solid var(--glass-border);
}

.switcher-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.role-pills {
  display: flex;
  gap: 6px;
}

.role-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.role-pill:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.role-pill.active#pill-teacher {
  background: var(--role-teacher);
  color: #fff;
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.4);
}

.role-pill.active#pill-student {
  background: var(--role-student);
  color: #fff;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

.role-pill.active#pill-parent {
  background: var(--role-parent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.4);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.05);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition);
}

.user-profile-badge:hover {
  border-color: var(--primary);
}

.user-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.user-name {
  font-size: 13px;
  font-weight: 600;
}

.user-role-tag {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 500;
  display: inline-block;
}

.user-role-tag.teacher { background: rgba(139, 92, 246, 0.2); color: #c084fc; }
.user-role-tag.student { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.user-role-tag.parent { background: rgba(16, 185, 129, 0.2); color: #34d399; }

/* Navigation Tabs Bar */
.main-nav {
  background: rgba(15, 23, 42, 0.4);
  border-top: 1px solid var(--glass-border);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  padding: 0 24px;
  overflow-x: auto;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  padding: 14px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: var(--transition);
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

[data-theme="light"] .nav-tab.active {
  color: var(--primary);
}

.badge-count {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

/* App Main Container */
.app-main {
  max-width: 1280px;
  margin: 30px auto 60px;
  padding: 0 24px;
}

/* Page Section Switching */
.page-section {
  display: none;
  animation: fadeIn 0.4s ease-in-out forwards;
}

.page-section.active {
  display: block;
}

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

/* Page Title Headers */
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title i {
  color: var(--primary);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* PAGE 1 STYLES: Hero & Role Selection */
.hero-container {
  text-align: center;
  max-width: 750px;
  margin: 20px auto 40px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--primary);
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 14px;
}

.gradient-text {
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
}

.role-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.role-card {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.role-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.teacher-card:hover { border-color: var(--role-teacher); }
.student-card:hover { border-color: var(--role-student); }
.parent-card:hover { border-color: var(--role-parent); }

.role-avatar-wrapper {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 20px;
}

.role-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.role-icon-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid var(--bg-primary);
}

.teacher-card .role-icon-badge { background: var(--role-teacher); }
.student-card .role-icon-badge { background: var(--role-student); }
.parent-card .role-icon-badge { background: var(--role-parent); }

.role-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.role-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  min-height: 40px;
}

.role-features {
  list-style: none;
  text-align: left;
  width: 100%;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-sub);
}

.role-features li {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-features i {
  color: var(--success);
  font-size: 12px;
}

.btn {
  font-family: var(--font-family);
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  padding: 12px 24px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}

.btn-block { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4); }

.btn-teacher { background: var(--role-teacher); color: #fff; width: 100%; }
.btn-teacher:hover { background: #7c3aed; }

.btn-student { background: var(--role-student); color: #fff; width: 100%; }
.btn-student:hover { background: #2563eb; }

.btn-parent { background: var(--role-parent); color: #fff; width: 100%; }
.btn-parent:hover { background: #059669; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-hover); }

.btn-secondary { background: var(--bg-tertiary); color: var(--text-main); border: 1px solid var(--glass-border); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

.btn-outline-light { background: transparent; border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; }
.btn-outline-light:hover { background: rgba(255, 255, 255, 0.15); }

.btn-line-notify { background: #00b900; color: #fff; }
.btn-line-notify:hover { background: #009900; }

.btn-email-notify { background: #0284c7; color: #fff; }
.btn-email-notify:hover { background: #0369a1; }

.login-modal-box {
  max-width: 480px;
  margin: 0 auto;
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 14px;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-control-sm {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 13px;
}

.form-row {
  display: flex;
  gap: 14px;
}

.col-6 { flex: 1; }

/* PAGE 2 STYLES: Urgent Banner & Schedule */
.urgent-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(245, 158, 11, 0.2));
  border: 1px solid rgba(239, 68, 68, 0.4);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
}

.urgent-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.pulse-anim {
  animation: pulse 1.5s infinite;
}

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

.urgent-content { flex: 1; }
.urgent-content h4 { font-size: 16px; font-weight: 700; color: #fca5a5; margin-bottom: 2px; }
.urgent-content p { font-size: 13px; color: var(--text-sub); }

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px 20px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.search-input-wrap {
  position: relative;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
}

.search-input-wrap input {
  padding-left: 34px;
  width: 100%;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.hw-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hw-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.subject-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.subject-math { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.subject-science { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.subject-thai { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.subject-english { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.subject-social { background: rgba(236, 72, 153, 0.2); color: #f472b6; }

.due-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.due-badge.urgent { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.due-badge.normal { background: var(--bg-tertiary); color: var(--text-muted); }

.hw-card-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hw-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.hw-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
  font-size: 12px;
  color: var(--text-muted);
}

.teacher-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* PAGE 3 STYLES: Homework Submission */
.submission-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .submission-layout { grid-template-columns: 1fr; }
}

.card-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.card-section-title i { color: var(--primary); }

.assignment-meta-box {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--glass-border);
}

.meta-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}

.meta-label { color: var(--text-muted); }
.meta-value { font-weight: 600; }

.meta-desc {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--glass-border);
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
}

/* Dropzone styling */
.dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.04);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.dropzone:hover, .dropzone.dragover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
}

.dropzone-icon {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 12px;
}

.dropzone-content h4 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.highlight-link { color: var(--primary); text-decoration: underline; }
.dropzone-hint { font-size: 12px; color: var(--text-muted); }

.hidden-file-input { display: none; }

.file-preview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 12px;
}

.file-preview-card.hidden { display: none; }

.file-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.file-icon {
  font-size: 28px;
  color: var(--primary);
}

.file-name { font-size: 14px; font-weight: 600; }
.file-size { font-size: 12px; color: var(--text-muted); }

.upload-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-primary);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--success);
  transition: width 0.3s ease;
}

.icon-btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn-danger:hover { background: var(--danger); color: #fff; }

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

.history-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.history-hw-title { font-size: 14px; font-weight: 600; }
.history-time { font-size: 11px; color: var(--text-muted); }

.history-file { font-size: 12px; color: var(--text-sub); display: flex; align-items: center; gap: 6px; }

/* PAGE 4 STYLES: Parent Summary & Grading */
.parent-summary-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-bottom: 30px;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.summary-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.parent-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.summary-title-wrap h3 { font-size: 18px; font-weight: 700; }
.summary-title-wrap p { font-size: 13px; color: var(--text-muted); }

.parent-actions { display: flex; gap: 10px; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  padding: 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.metric-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.metric-icon.blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.metric-icon.red { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.metric-icon.gold { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.metric-value { font-size: 20px; font-weight: 800; display: block; }
.metric-label { font-size: 12px; color: var(--text-muted); display: block; }

.table-card { padding: 24px; }

.table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.status-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.legend-item { display: flex; align-items: center; gap: 6px; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-red { background: var(--danger); }
.dot-yellow { background: var(--warning); }
.dot-green { background: var(--success); }
.dot-blue { background: var(--info); }

.table-responsive { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.data-table th {
  background: var(--bg-tertiary);
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--glass-border);
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--glass-border);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.pending { background: var(--status-pending-bg); color: var(--status-pending-color); }
.status-pill.review { background: var(--status-review-bg); color: var(--status-review-color); }
.status-pill.graded { background: var(--status-graded-bg); color: var(--status-graded-color); }
.status-pill.late { background: var(--status-late-bg); color: var(--status-late-color); }

.score-badge {
  font-weight: 700;
  font-size: 15px;
}

.score-badge.high { color: var(--success); }
.score-badge.mid { color: var(--warning); }
.score-badge.none { color: var(--text-muted); }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover { color: var(--danger); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
}

.grading-info-box {
  background: var(--bg-tertiary);
  padding: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
}

.grading-info-box h4 { font-size: 15px; margin-bottom: 4px; color: var(--primary); }

.submitted-note-preview {
  margin-top: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-left: 3px solid var(--primary);
  font-style: italic;
  color: var(--text-sub);
}

/* Toast Notification System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  min-width: 280px;
  animation: slideInRight 0.3s ease forwards;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.info { border-left: 4px solid var(--primary); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.danger { border-left: 4px solid var(--danger); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Role Visibility Enforcements */
body.role-student .teacher-only { display: none !important; }
body.role-parent .teacher-only { display: none !important; }
body.role-parent .student-only { display: none !important; }

/* Responsive tweaks */
@media (max-width: 768px) {
  .header-container { flex-direction: column; align-items: stretch; gap: 12px; }
  .role-switcher-container { justify-content: center; }
  .page-header-row { flex-direction: column; align-items: flex-start; }
  .search-input-wrap { width: 100%; min-width: auto; }
}
