@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500;600&display=swap');

:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-code: 'Fira Code', monospace;

  /* Color Palette - Clean Full-Screen Dark App Theme */
  --bg-dark: #090d16;
  --bg-sidebar: #0f172a;
  --bg-workspace: #0b0f19;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-input: rgba(15, 23, 42, 0.7);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.4);

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.25);

  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: white;
  text-decoration: underline;
}

/* Teacher "preview as a year group" banner - sits above the navbar on every
   page while active (see js/auth.js renderPreviewBanner). */
.preview-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.55rem 1.5rem;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.22), rgba(245, 158, 11, 0.12));
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
}

.preview-banner-text {
  font-size: 0.85rem;
  color: var(--text-main);
}

.preview-banner-text strong {
  color: var(--accent-amber);
}

.preview-banner-exit {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.preview-banner-exit:hover {
  background: var(--accent-amber);
  border-color: var(--accent-amber);
  color: var(--bg-dark);
}

/* Navbar - Clean App Header Bar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 60px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-right: 8px;
}

/* Header Navigation Tabs */
.header-nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-nav-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-nav-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.header-nav-btn.active {
  background: rgba(99, 102, 241, 0.18);
  color: var(--primary-light);
  border-color: rgba(99, 102, 241, 0.35);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-map-btn {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-map-btn:hover {
  color: var(--primary-light);
  border-color: var(--border-hover);
  background: rgba(99, 102, 241, 0.12);
  text-decoration: none;
}

.nav-map-btn svg {
  width: 18px;
  height: 18px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 12px 4px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

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

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.825rem;
  font-weight: 600;
  line-height: 1.2;
}

.user-role {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-google {
  background: #ffffff;
  color: #1e293b;
  font-weight: 600;
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-google:hover {
  background: #f8fafc;
  transform: translateY(-2px);
}

.btn-google img {
  width: 24px;
  height: 24px;
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: var(--accent-rose);
  color: white;
}

.btn-emerald {
  background: var(--accent-emerald);
  color: white;
}

.btn-emerald:hover {
  background: #0d9d6f;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Simple Page Container (teacher portal) */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
  flex: 1;
}

/* Section Navigation (teacher portal) - left sidebar, collapses to a
   horizontal scrolling bar under the navbar on narrow viewports */
.dashboard-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.sidebar-nav {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 4px 10px 6px;
}

.dashboard-content {
  min-width: 0;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-align: left;
  flex-shrink: 0;
}

.tab-icon {
  font-size: 1rem;
  line-height: 1;
  width: 20px;
  flex-shrink: 0;
  text-align: center;
}

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

.tab-btn.active {
  color: white;
  background: var(--primary);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

/* Below ~880px: sidebar becomes a sticky horizontal scroller under the navbar */
@media (max-width: 880px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-nav {
    position: sticky;
    top: 60px;
    z-index: 40;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 6px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sidebar-nav::-webkit-scrollbar {
    height: 5px;
  }

  .sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
  }

  .sidebar-group {
    flex-direction: row;
    gap: 4px;
    flex-shrink: 0;
  }

  .sidebar-group-label {
    display: none;
  }

  .sidebar-group:not(:last-child)::after {
    content: "";
    width: 1px;
    align-self: stretch;
    background: var(--border-color);
    margin: 0 4px;
    flex-shrink: 0;
  }

  .tab-btn {
    width: auto;
  }
}

/* Page Containers */
.container-fluid {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.container-boxed {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
  flex: 1;
}

/* Auth / Landing Screen */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}

.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.auth-logo {
  width: 70px;
  height: 70px;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.auth-title {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* Grid Views */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
}

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

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.card-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  white-space: nowrap;
}

.card-description {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Pupil submission cards (teacher portal grid) - compact variant of .card */
.project-card {
  padding: 1.1rem 1.25rem;
}

.project-card .card-header {
  margin-bottom: 8px;
}

.project-card .card-title {
  font-size: 1.02rem;
}

.project-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.9rem;
}

.project-card .card-description {
  font-size: 0.82rem;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: auto;
}

.project-actions-primary {
  display: flex;
  gap: 6px;
}

.icon-btn {
  padding: 6px 9px;
}

/* Scratch game submission tiles (Year 5) - thumbnail sits above the usual .project-card content */
.scratch-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.scratch-card .card-header {
  margin-bottom: 6px;
}

/* Year 5 hub landing page (year5.html) - playful, colourful hero + two big topic tiles */
.hub-hero {
  position: relative;
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(6, 182, 212, 0.16) 50%, rgba(16, 185, 129, 0.22));
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.hub-hero::before,
.hub-hero::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  z-index: 0;
}

.hub-hero::before {
  background: var(--accent-cyan);
  top: -90px;
  left: -70px;
}

.hub-hero::after {
  background: var(--accent-amber);
  bottom: -110px;
  right: -70px;
}

.hub-emoji-row {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 1.1rem;
  font-size: 2.4rem;
  margin-bottom: 0.75rem;
}

.hub-emoji-row span {
  display: inline-block;
  animation: hub-float 3s ease-in-out infinite;
}

.hub-emoji-row span:nth-child(2) { animation-delay: 0.4s; }
.hub-emoji-row span:nth-child(3) { animation-delay: 0.8s; }
.hub-emoji-row span:nth-child(4) { animation-delay: 1.2s; }

@keyframes hub-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(-6deg); }
}

.hub-title {
  position: relative;
  z-index: 1;
  font-size: 2.1rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary-light), var(--accent-cyan), var(--accent-emerald));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 0.5rem;
}

.hub-subtitle {
  position: relative;
  z-index: 1;
  color: var(--text-muted);
  font-size: 1.02rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
  max-width: 900px;
  margin: 0 auto;
}

.hub-tile {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 2.5rem 2rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, border-color 0.25s ease;
}

.hub-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
}

.hub-tile--indigo {
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.32), rgba(6, 182, 212, 0.2));
}
.hub-tile--indigo::before {
  background: linear-gradient(90deg, var(--primary-light), var(--accent-cyan));
}

.hub-tile--amber {
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.32), rgba(244, 63, 94, 0.2));
}
.hub-tile--amber::before {
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-rose));
}

.hub-tile--emerald {
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.32), rgba(6, 182, 212, 0.2));
}
.hub-tile--emerald::before {
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-cyan));
}

.hub-tile:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--border-hover);
}

.hub-tile--indigo:hover {
  box-shadow: 0 16px 40px -10px rgba(99, 102, 241, 0.5);
}

.hub-tile--amber:hover {
  box-shadow: 0 16px 40px -10px rgba(245, 158, 11, 0.5);
}

.hub-tile--emerald:hover {
  box-shadow: 0 16px 40px -10px rgba(16, 185, 129, 0.5);
}

.hub-tile-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-rose);
  color: white;
}

.hub-tile-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin-bottom: 0.25rem;
}

.hub-tile--indigo .hub-tile-icon-wrap {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4), rgba(99, 102, 241, 0) 70%);
  animation: hub-pulse 2.8s ease-in-out infinite;
}

.hub-tile--amber .hub-tile-icon-wrap {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.4), rgba(245, 158, 11, 0) 70%);
  animation: hub-pulse 2.8s ease-in-out infinite;
  animation-delay: 0.6s;
}

.hub-tile--emerald .hub-tile-icon-wrap {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.4), rgba(16, 185, 129, 0) 70%);
  animation: hub-pulse 2.8s ease-in-out infinite;
  animation-delay: 1.2s;
}

@keyframes hub-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.12); opacity: 1; }
}

.hub-tile-icon {
  font-size: 3rem;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hub-tile:hover .hub-tile-icon {
  transform: scale(1.15) rotate(-8deg);
}

.hub-tile-title {
  font-size: 1.3rem;
  font-weight: 800;
}

.hub-tile-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.hub-tile-cta {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(4px);
  transition: var(--transition);
}

.hub-tile--indigo .hub-tile-cta { color: var(--primary-light); }
.hub-tile--amber .hub-tile-cta { color: var(--accent-amber); }
.hub-tile--emerald .hub-tile-cta { color: var(--accent-emerald); }

.hub-tile:hover .hub-tile-cta {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .hub-emoji-row span,
  .hub-tile-icon-wrap {
    animation: none;
  }
  .hub-tile,
  .hub-tile-icon,
  .hub-tile-cta {
    transition: none;
  }
}

/* Year 5 hub - rotating "did you know" fact strip */
.hub-fact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 900px;
  margin: 2.5rem auto 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.hub-fact-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.hub-fact-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-amber);
  margin-bottom: 2px;
}

.hub-fact-text {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.5;
  transition: opacity 0.4s ease;
}

.hub-fact-text.hub-fact-fade {
  opacity: 0;
}

/* Year 5 hub - "what you can do here" feature highlight strip */
.hub-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.25rem;
  max-width: 900px;
  margin: 2.5rem auto 3rem;
}

.hub-feature {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.hub-feature:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
}

.hub-feature-icon {
  font-size: 2rem;
}

.hub-feature-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.hub-feature-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* VEX IQ Robotics guide page (year6-vexiq.html) */
.vexiq-hero {
  text-align: center;
  padding: 2.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(244, 63, 94, 0.14));
  margin-bottom: 2rem;
}

.vexiq-hero-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.vexiq-hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.vexiq-hero-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 560px;
  margin: 0 auto;
}

/* Quick links out to the real VEX tools pupils need to open */
.vexiq-quicklinks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.1rem;
  max-width: 820px;
  margin: 0 auto 2rem auto;
}

.vexiq-quicklink {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: linear-gradient(160deg, rgba(99, 102, 241, 0.18), rgba(6, 182, 212, 0.1));
  color: var(--text-main);
  transition: var(--transition);
}

.vexiq-quicklink:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  text-decoration: none;
  box-shadow: 0 12px 30px -10px rgba(99, 102, 241, 0.4);
}

.vexiq-quicklink-icon {
  font-size: 1.9rem;
  flex-shrink: 0;
}

.vexiq-quicklink-title {
  display: block;
  font-weight: 700;
  font-size: 0.98rem;
}

.vexiq-quicklink-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.vexiq-quicklink-arrow {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.vexiq-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.vexiq-nav a {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.vexiq-nav a:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
  background: rgba(99, 102, 241, 0.12);
  text-decoration: none;
}

/* Group headings that split the guide into "Learn the Basics" (a numbered
   path) and "Quick Reference" (look-up-when-needed, not sequential) */
.vexiq-group-title {
  max-width: 820px;
  margin: 0 auto 1.25rem auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.vexiq-group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* Shared "text content" card used by both the stepper and the reference grid */
.vexiq-card {
  padding: 1.6rem 1.8rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  scroll-margin-top: 80px;
}

.vexiq-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}

.vexiq-card-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.vexiq-card-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.vexiq-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.vexiq-card ul {
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.75;
}

.vexiq-card ul li strong {
  color: var(--text-main);
}

/* Numbered step path (Getting Started -> Building -> Programming -> Sensors) */
.vexiq-stepper {
  max-width: 820px;
  margin: 0 auto 2.75rem auto;
}

.vexiq-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 1.1rem;
  position: relative;
  padding-bottom: 1.75rem;
}

.vexiq-step:last-child {
  padding-bottom: 0;
}

.vexiq-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 44px;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.vexiq-step-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* Sensors are shown as small scannable cards rather than a plain bullet list */
.vexiq-sensor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.85rem;
  margin-top: 0.25rem;
}

.vexiq-sensor-card {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
}

.vexiq-sensor-icon {
  display: block;
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.vexiq-sensor-name {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.vexiq-sensor-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Troubleshooting and Safety sit side by side as look-up reference cards */
.vexiq-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  max-width: 820px;
  margin: 0 auto 2.5rem auto;
  align-items: start;
}

.vexiq-fix {
  padding: 0.8rem 0.95rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  margin-bottom: 0.6rem;
}

.vexiq-fix:last-child {
  margin-bottom: 0;
}

.vexiq-fix-problem {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--accent-rose);
  margin-bottom: 3px;
}

.vexiq-fix-solution {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding-left: 22px;
}

/* Filter Controls */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

/* Roster search + year-group filter row (Pupils tab) */
.roster-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  background: var(--bg-card);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.year-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.year-filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

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

.year-filter-pill.active {
  color: white;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Pupil roster table row hover */
#roster-table-body tr {
  transition: background-color 0.15s ease;
}

#roster-table-body tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1rem;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-md);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ==========================================================================
   Hallmark · macrostructure: bespoke overlay (single-page redesign) · tone: atmospheric
   theme: existing app system (Outfit/Inter, indigo anchor) — preserved, not replaced
   enrichment: E6 Animated Loop, hand-built SVG emblem (Tier A/B) · studied: no
   Post-login Welcome Overlay — shown once per sign-in, above the IDE/teacher shell.
   ========================================================================== */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-welcome-overlay, 260ms) var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
  padding: 1.5rem;
}

.welcome-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.welcome-card {
  position: relative;
  width: min(94vw, 760px);
  max-height: min(90vh, 880px);
  overflow-y: auto;
  background: #131c30;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6);
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1), opacity 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-overlay.active .welcome-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.welcome-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1), color 200ms cubic-bezier(0.16, 1, 0.3, 1), transform 100ms cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.welcome-close:active {
  transform: scale(0.94);
}

.welcome-close:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

.welcome-close svg {
  width: 18px;
  height: 18px;
}

/* Emblem banner */
.welcome-emblem {
  position: relative;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(99, 102, 241, 0.16), transparent 62%),
    var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

.emblem-rings {
  position: absolute;
  z-index: 0;
  inset: 0;
  margin: auto;
  width: 176px;
  height: 176px;
  overflow: visible;
}

.emblem-ring {
  fill: none;
  stroke-width: 1.5;
  opacity: 0;
  animation: welcome-ring-in 520ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 90ms);
  transform-box: fill-box;
  transform-origin: center;
}

.emblem-ring--outer { stroke: var(--primary-light); stroke-opacity: 0.55; }
.emblem-ring--inner { stroke: var(--accent-cyan); stroke-opacity: 0.4; }

.emblem-line {
  stroke: var(--primary-light);
  stroke-opacity: 0.3;
  stroke-width: 1;
  opacity: 0;
  animation: welcome-fade-in 420ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 160ms);
}

.emblem-node {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: welcome-node-in 420ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 220ms);
}

/* Soft ambient glow behind the crest - the one continuous loop in the emblem.
   The crest itself never animates beyond its one-shot entrance; a heraldic
   mark shouldn't spin or breathe. */
.emblem-glow {
  position: absolute;
  z-index: 1;
  inset: 0;
  margin: auto;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.32), transparent 70%);
  opacity: 0;
  animation:
    welcome-fade-in 500ms cubic-bezier(0.16, 1, 0.3, 1) 380ms forwards,
    welcome-glow-breathe 6s cubic-bezier(0.65, 0, 0.35, 1) 900ms infinite alternate;
}

.emblem-logo {
  position: relative;
  z-index: 2;
  height: 108px;
  width: auto;
  opacity: 0;
  transform: scale(0.85);
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45));
  animation: welcome-logo-in 480ms cubic-bezier(0.16, 1, 0.3, 1) 420ms forwards;
}

@keyframes welcome-ring-in {
  from { opacity: 0; transform: scale(0.82); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes welcome-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes welcome-node-in {
  from { opacity: 0; transform: scale(0.3); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes welcome-logo-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes welcome-glow-breathe {
  from { opacity: 0.55; }
  to   { opacity: 0.9; }
}

/* Body content */
.welcome-body {
  padding: 2.25rem 2.5rem 2.5rem;
}

.welcome-reveal {
  opacity: 0;
  animation: welcome-reveal 460ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 55ms + 120ms);
}

@keyframes welcome-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.welcome-eyebrow {
  font-family: var(--font-code);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 0.6rem;
}

.welcome-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.9rem, 3vw + 1rem, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 0 0 0.6rem;
}

.welcome-subhead {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0 0 2rem;
}

.welcome-tour-list {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.welcome-tour-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border-color);
}

.welcome-tour-item:first-child {
  border-top: none;
  padding-top: 0;
}

.welcome-tour-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-light);
}

.welcome-tour-icon svg {
  width: 20px;
  height: 20px;
}

.welcome-tour-title {
  display: block;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 2px;
}

.welcome-tour-desc {
  display: block;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.welcome-continue-card {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.28);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 2rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1), border-color 200ms cubic-bezier(0.16, 1, 0.3, 1), transform 100ms cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-continue-card:hover {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.45);
}

.welcome-continue-card:active {
  transform: scale(0.995);
}

.welcome-continue-card:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
}

.welcome-continue-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.16);
  color: var(--primary-light);
}

.welcome-continue-icon svg {
  width: 22px;
  height: 22px;
}

.welcome-continue-text {
  flex: 1;
  min-width: 0;
}

.welcome-continue-title {
  display: block;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.welcome-continue-sub {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.welcome-continue-chevron {
  flex-shrink: 0;
  display: flex;
  color: var(--text-dim);
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-continue-chevron svg {
  width: 18px;
  height: 18px;
}

.welcome-continue-card:hover .welcome-continue-chevron {
  transform: translateX(3px);
}

.welcome-footer {
  display: flex;
  justify-content: flex-end;
}

.welcome-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 26px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 200ms cubic-bezier(0.16, 1, 0.3, 1), transform 100ms cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-cta svg {
  width: 18px;
  height: 18px;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-cta:hover {
  background: var(--primary-hover);
  transform: translateY(-1.5px);
}

.welcome-cta:hover svg {
  transform: translateX(3px);
}

.welcome-cta:active {
  transform: translateY(0) scale(0.98);
}

.welcome-cta:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .welcome-emblem { height: 170px; }
  .emblem-rings { width: 138px; height: 138px; }
  .emblem-glow { width: 104px; height: 104px; }
  .emblem-logo { height: 86px; }
  .welcome-body { padding: 1.75rem 1.5rem 2rem; }
  .welcome-title { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-overlay,
  .welcome-card {
    transition-duration: 150ms;
  }
  .emblem-ring, .emblem-line, .emblem-node, .welcome-reveal {
    animation-duration: 150ms !important;
    animation-delay: 0ms !important;
    transform: none !important;
  }
  .emblem-glow {
    animation: welcome-fade-in 150ms linear forwards !important;
    opacity: 0.7 !important;
  }
  .emblem-logo {
    animation: welcome-fade-in 150ms linear forwards !important;
    transform: none !important;
  }
}

/* Form inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.925rem;
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

/* Status Pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.status-online {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-offline {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Read-only Multi-File Project Viewer (teacher & student classwork cards) */
.filesview-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.filesview-tab {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-code);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

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

.filesview-tab.active {
  background: #1e293b;
  color: #6366f1;
  border-color: #6366f1;
  font-weight: 600;
}

.filesview-code {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: var(--font-code);
  font-size: 0.825rem;
  line-height: 1.55;
  color: #a5b4fc;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Run Preview Modal (fullscreen overlay for teacher "Run Project") */
.preview-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 15, 0.92);
  backdrop-filter: blur(6px);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.preview-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.preview-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.preview-modal-body {
  flex: 1;
  min-height: 0;
  padding: 16px;
  display: flex;
}

.preview-modal-body .ide-preview-frame {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Dashboard Greeting (teacher portal) */
.dashboard-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.dashboard-greeting {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.dashboard-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.dashboard-date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Stats Overview Bar (teacher portal dashboard) */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.3rem;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-color);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.stat-icon {
  font-size: 1.4rem;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.15);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Stat card accent variants */
.stat-card--cyan::before { background: var(--accent-cyan); }
.stat-card--cyan .stat-icon { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }

.stat-card--indigo::before { background: var(--primary); }
.stat-card--indigo .stat-icon { background: rgba(99, 102, 241, 0.15); color: var(--primary-light); }

.stat-card--purple::before { background: var(--accent-purple); }
.stat-card--purple .stat-icon { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }

.stat-card--status::before { background: var(--accent-rose); }
.stat-card--status .stat-icon { background: rgba(244, 63, 94, 0.15); }
.stat-card--status .stat-value { color: var(--accent-rose); }

.stat-card--status.is-enabled::before { background: var(--accent-emerald); }
.stat-card--status.is-enabled .stat-icon { background: rgba(16, 185, 129, 0.15); }
.stat-card--status.is-enabled .stat-value { color: var(--accent-emerald); }

/* Search input (roster / submissions filter bars) */
.search-input-wrap {
  position: relative;
  min-width: 220px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 0.9rem;
  pointer-events: none;
}

.search-input-wrap .form-input {
  padding-left: 34px;
}

.pupil-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.25);
  white-space: nowrap;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  grid-column: 1 / -1;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--text-dim);
}

.empty-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.empty-desc {
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 1.5rem auto;
  font-size: 0.9rem;
}

/* ---------- Teacher: Course A-F assignment grid ---------- */

.course-assign-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.course-assign-row:last-child {
  border-bottom: none;
}

.course-assign-year {
  min-width: 90px;
  font-weight: 600;
  font-size: 0.9rem;
}

.course-assign-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.course-assign-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.course-assign-chip.checked {
  border-color: var(--primary-light);
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.12);
}

.course-assign-chip.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
