:root {
  --bg1: #f6f3ff;
  --bg2: #ede7ff;
  --card: #ffffff;
  --ink: #1f2340;
  --muted: #5f6783;
  --line: #e7defd;
  --accent: #6d28d9;
  --accent-2: #8b5cf6;
  --accent-3: #c4b5fd;
  --success: #15803d;
  --success-soft: #eaf8ef;
  --warning: #b45309;
  --warning-soft: #fff5df;
  --danger: #b91c1c;
  --danger-soft: #fee8e8;
  --soft: #faf8ff;
  --shadow: 0 18px 42px rgba(76, 29, 149, 0.12);
  --radius: 20px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.16), transparent 32%),
    linear-gradient(180deg, var(--bg1) 0%, #ffffff 22%, var(--bg2) 100%);
  color: var(--ink);
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(109,40,217,.09);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 0;
}
.brand {
  font-weight: 800;
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.nav a {
  color: var(--ink);
  font-weight: 600;
}
.nav-cta {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(109,40,217,.18);
}
.nav-cta:hover { text-decoration: none; }
.main-area { padding: 28px 0 44px; }
.hero, .card, .panel, .mini-stat, .lab-shell-header, .lab-frame-wrap, .auth-card, .feature-card, .stage-card, .summary-card, .focus-card, .labs-section {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(109,40,217,.08);
}
.hero {
  padding: 34px;
  margin-bottom: 22px;
}
.hero.purple-hero {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 55%, #7c3aed 100%);
  color: #fff;
  border: 0;
}
.hero.purple-hero p,
.hero.purple-hero .muted,
.hero.purple-hero .section-subcopy { color: rgba(255,255,255,.94); }
.hero.purple-hero .kicker {
  background: rgba(255,255,255,.14);
  color: #fff;
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
}
.hero h1 { margin: 8px 0 14px; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.1; }
.hero p { color: var(--muted); font-size: 1.05rem; line-height: 1.7; max-width: 760px; }
.hero-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top: 20px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.card, .panel, .summary-card, .focus-card, .labs-section, .feature-card, .stage-card { padding: 24px; }
.card h2, .panel h2, .panel h3, .feature-card h2, .feature-card h3, .stage-card h3 { margin-top: 0; }
.metric {
  font-size: 2rem;
  font-weight: 800;
  margin: 8px 0;
}
.muted { color: var(--muted); }
.btn, button, .btn-soft-link, .btn-primary {
  display: inline-block;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(109,40,217,.16);
}
.btn-secondary { background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%); color:#fff; }
.btn-danger { background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%); color:#fff; }
.btn-soft, .btn-soft-link {
  background: #f1edff;
  color: #5b21b6;
  box-shadow: none;
}
form { margin: 0; }
label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font: inherit;
  margin-bottom: 14px;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(139,92,246,.12);
}
textarea { min-height: 100px; resize: vertical; }
.auth-wrap {
  min-height: calc(100vh - 210px);
  display: grid;
  place-items: center;
}
.auth-card {
  width: min(520px, 100%);
  padding: 34px;
}
.auth-card h1 { margin: 8px 0 10px; }
.auth-intro { color: var(--muted); margin-bottom: 22px; line-height: 1.7; }
.help-text { color: var(--muted); font-size: .92rem; margin-top: -4px; margin-bottom: 16px; }
.flash {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-weight: 700;
}
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #dbeafe; color: #1d4ed8; }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
th, td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th { background: #f8f6ff; }
.badge, .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  background: #ede9fe;
  color: #5b21b6;
}
.badge-green, .chip-status-completed { background: var(--success-soft); color: var(--success); }
.badge-grey, .chip-status-not_started { background: #eef2f7; color: #334155; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.chip-status-in_progress { background: var(--warning-soft); color: var(--warning); }
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.site-footer {
  background: #1f123d;
  color: rgba(255,255,255,.9);
  margin-top: 32px;
  padding: 34px 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap: 24px;
}
.footer-brand {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.site-footer h3 { margin-top: 0; color: #fff; }
.site-footer p, .site-footer li { line-height: 1.7; color: rgba(255,255,255,.86); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #ddd6fe; }
.lab-card h3 { margin-bottom: 8px; }
.kicker {
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 800;
}
.stats-grid, .summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
.mini-stat, .summary-card { padding: 22px; }
.mini-label, .summary-meta { color: var(--muted); font-weight: 700; font-size: .95rem; }
.mini-value { font-size: 2rem; font-weight: 800; margin-top: 8px; }
.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.lab-tile, .lab-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: #fcfbff;
}
.lab-top, .summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.lab-icon, .summary-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.lab-status-row { margin-top: auto; margin-bottom: 16px; }
.lab-shell-header {
  padding: 24px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.lab-shell-header h1 { margin: 6px 0 8px; }
.lab-frame-wrap { padding: 14px; }
.lab-frame {
  width: 100%;
  min-height: 82vh;
  border: 0;
  border-radius: 14px;
  background: #fff;
}
.admin-lab-layout {
  grid-template-columns: minmax(300px, 380px) 1fr;
  align-items: start;
}
.progress-bar {
  width: 100%;
  height: 12px;
  background: #ece9ff;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
}
.student-shell { display:grid; gap:24px; }
.focus-meta { display:flex; flex-wrap:wrap; gap:10px; margin-bottom: 18px; }
.lab-card-footer { margin-top:auto; display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.empty-note {
  padding:16px 18px;
  border-radius:14px;
  background:#faf8ff;
  border:1px dashed #d8cdfc;
  color:var(--muted);
}
.section-copy {
  max-width: 760px;
  line-height: 1.8;
  color: var(--muted);
}
.feature-card h3, .stage-card h3 { color: var(--accent); }
.list-tight { margin: 0; padding-left: 18px; color: var(--muted); }
.list-tight li { margin-bottom: 8px; }
@media (max-width: 900px) {
  .admin-lab-layout, .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar, .lab-shell-header { flex-direction: column; gap: 10px; }
  .nav { justify-content: flex-start; }
  .hero, .card, .panel, .auth-card, .feature-card, .stage-card, .summary-card, .focus-card, .labs-section { padding: 20px; }
}
