:root {
  --primary: #4f46e5;
  --sky: #06b6d4;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --dark: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --soft: #f8fafc;
  --white: #fff;
  --line: #e2e8f0;
  --shadow: 0 22px 55px rgba(15, 23, 42, 0.1);
  --radius: 26px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(79, 70, 229, 0.16), transparent 28%),
    radial-gradient(
      circle at 92% 10%,
      rgba(34, 197, 94, 0.13),
      transparent 25%
    ),
    radial-gradient(
      circle at 50% 96%,
      rgba(6, 182, 212, 0.14),
      transparent 30%
    ),
    #f8fafc;
  color: var(--text);
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}
.topbar-inner {
  width: calc(100% - 40px);
  max-width: 1380px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--dark);
  font-weight: 1000;
}
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--primary), var(--sky));
  display: grid;
  place-items: center;
  box-shadow: 0 14px 30px rgba(79, 70, 229, 0.28);
}
.topnav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.topnav a,
.btn {
  border: 0;
  text-decoration: none;
  padding: 12px 17px;
  border-radius: 16px;
  font-weight: 900;
  background: #fff;
  color: var(--text);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.07);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.primary-link,
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--sky));
  color: white !important;
}
.danger-link,
.btn.danger {
  background: #fee2e2;
  color: #991b1b !important;
}
.btn.success {
  background: #dcfce7;
  color: #166534;
}
.btn.warn {
  background: #fef3c7;
  color: #92400e;
}
.container {
  width: calc(100% - 40px);
  max-width: 1180px;
  margin: 0 auto;
}
.landing {
  padding: 54px 0;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: center;
}
.hero-card,
.card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 32px;
  box-shadow: var(--shadow);
  padding: 34px;
}
.hero-card h1 {
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.03;
  margin: 18px 0 14px;
  color: var(--dark);
}
.hero-card p,
.muted {
  color: var(--muted);
  line-height: 1.7;
}
.kicker,
.badge {
  display: inline-flex;
  padding: 8px 13px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 1000;
  font-size: 13px;
}
.badge.green {
  background: #dcfce7;
  color: #166534;
}
.badge.orange {
  background: #fef3c7;
  color: #92400e;
}
.lab-window {
  background: #0f172a;
  color: #dbeafe;
  border-radius: 28px;
  padding: 24px;
  min-height: 330px;
  box-shadow: var(--shadow);
}
.dot span {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 6px;
  background: #fb7185;
}
.dot span:nth-child(2) {
  background: #fbbf24;
}
.dot span:nth-child(3) {
  background: #34d399;
}
.code-text {
  font-family: Consolas, monospace;
  white-space: pre-wrap;
  line-height: 1.8;
  margin-top: 18px;
}
.auth-wrap {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
  padding: 30px;
}
.auth-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.auth-left {
  background: linear-gradient(135deg, var(--primary), var(--sky));
  color: #fff;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-left h1 {
  font-size: 42px;
  line-height: 1.06;
}
.auth-right {
  background: #fff;
  padding: 42px;
}
.form-group {
  margin-bottom: 15px;
}
.label {
  display: block;
  margin-bottom: 8px;
  font-weight: 900;
  color: #1e293b;
}
.form-control {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  font: inherit;
  background: #fff;
}
.alert-box {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 16px;
}
.alert-error {
  background: #fee2e2;
  color: #991b1b;
}
.alert-success {
  background: #dcfce7;
  color: #166534;
}
.app-shell {
  width: calc(100% - 40px);
  max-width: 1380px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
  padding: 26px 0;
}
.side-rail {
  position: sticky;
  top: 92px;
  height: max-content;
  min-height: calc(100vh - 120px);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.75);
}
.student-mini {
  display: flex;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, #eef2ff, #ecfeff);
  border-radius: 22px;
  padding: 14px;
  margin-bottom: 18px;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--primary), var(--sky));
  display: grid;
  place-items: center;
  color: white;
  font-size: 24px;
}
.student-mini b {
  display: block;
  color: var(--dark);
}
.student-mini small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}
.side-rail a {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #334155;
  font-weight: 900;
  border-radius: 17px;
  padding: 13px 14px;
  margin-bottom: 8px;
  transition: 0.2s;
}
.side-rail a span {
  font-size: 21px;
}
.side-rail a:hover,
.side-rail a.active {
  background: linear-gradient(135deg, #eef2ff, #ecfeff);
  color: #3730a3;
  transform: translateX(4px);
}
.main-area {
  min-width: 0;
}
.page-hero {
  background: linear-gradient(135deg, var(--primary), var(--sky));
  color: white;
  border-radius: 32px;
  padding: 30px;
  box-shadow: 0 24px 60px rgba(79, 70, 229, 0.23);
  margin-bottom: 20px;
}
.page-hero h1,
.page-hero h2 {
  color: white;
  margin: 0 0 8px;
}
.page-hero p {
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.7;
  margin: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.stat-card {
  background: #fff;
  border-radius: 26px;
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid #edf2f7;
}
.stat-card small {
  display: block;
  color: var(--muted);
  font-weight: 1000;
  text-transform: uppercase;
}
.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  color: var(--dark);
}
.mission-card {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 20px;
  align-items: center;
}
.bot-bubble {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #92400e;
  border-radius: 24px;
  padding: 18px;
  font-weight: 900;
  line-height: 1.7;
}
.progress {
  height: 14px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--sky), var(--green));
}
.lab-card {
  background: #fff;
  border-radius: 30px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid #edf2f7;
}
.lab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.panel {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
}
.editor {
  width: 100%;
  min-height: 280px;
  border: 0;
  border-radius: 18px;
  background: #0f172a;
  color: #dbeafe;
  font-family: Consolas, monospace;
  font-size: 15px;
  line-height: 1.65;
  padding: 16px;
  outline: none;
}
.output {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  min-height: 190px;
  padding: 18px;
  overflow: auto;
}
.console {
  font-family: Consolas, monospace;
  background: #0f172a;
  color: #dbeafe;
  border-radius: 12px;
  padding: 10px;
  margin: 8px 0;
  text-align: left;
}
.alert-note {
  background: #fef3c7;
  color: #92400e;
  border-radius: 12px;
  padding: 10px;
  margin: 8px 0;
  text-align: left;
  font-weight: 900;
}
.coach {
  margin-top: 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #92400e;
  border-radius: 18px;
  padding: 14px;
  font-weight: 900;
  line-height: 1.6;
}
.feedback {
  display: none;
  margin-top: 14px;
  border-radius: 18px;
  padding: 14px;
  font-weight: 1000;
}
.feedback.good {
  display: block;
  background: #dcfce7;
  color: #166534;
}
.feedback.bad {
  display: block;
  background: #fee2e2;
  color: #991b1b;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.map {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.map button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 15px;
  background: #e2e8f0;
  color: #64748b;
  font-weight: 1000;
  cursor: pointer;
}
.map button.active {
  background: linear-gradient(135deg, var(--primary), var(--sky));
  color: white;
}
.map button.done {
  background: #dcfce7;
  color: #166534;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.tab {
  border: 3px solid transparent;
  background: white;
  border-radius: 24px;
  padding: 18px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}
.tab.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #eef2ff, #ecfeff);
}
.option {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  border-radius: 16px;
  padding: 14px;
  margin: 10px 0;
  text-align: left;
  font-weight: 900;
  cursor: pointer;
}
.option.selected {
  background: #e0e7ff;
  border-color: var(--primary);
}
.piece {
  border: 0;
  background: white;
  border-radius: 15px;
  padding: 12px 15px;
  margin: 6px;
  font-weight: 1000;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  color: #3730a3;
}
.drop {
  min-height: 70px;
  background: #eef2ff;
  border: 2px dashed #a5b4fc;
  border-radius: 18px;
  padding: 14px;
  font-family: Consolas, monospace;
  font-weight: 900;
  margin-top: 12px;
}
.hidden {
  display: none;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
}
.table th,
.table td {
  padding: 14px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.table th {
  background: #f8fafc;
}
.footer {
  text-align: center;
  color: var(--muted);
  padding: 26px 0;
}
.project-preview {
  background: #fff;
  border-radius: 22px;
  border: 1px solid var(--line);
  padding: 22px;
  min-height: 150px;
}
.badge-trophy {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border-radius: 24px;
  padding: 22px;
  text-align: center;
  font-weight: 1000;
}
.badge-trophy .icon {
  font-size: 46px;
  display: block;
  margin-bottom: 8px;
}
@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .side-rail {
    position: static;
    min-height: auto;
  }
  .grid,
  .grid-2,
  .mission-card,
  .lab-grid,
  .tabs,
  .landing,
  .auth-card {
    grid-template-columns: 1fr;
  }
  .auth-left {
    display: none;
  }
}
@media (max-width: 700px) {
  .topbar-inner,
  .container,
  .app-shell {
    width: calc(100% - 24px);
  }
  .topnav a {
    padding: 10px 12px;
  }
  .hero-card,
  .card,
  .page-hero,
  .lab-card {
    padding: 22px;
  }
  .side-rail a b {
    font-size: 14px;
  }
}
/* FORM ADMIN */
.card form {
  display: grid;
  gap: 14px;
}

.card form label {
  font-weight: 700;
  color: #334155;
  margin-bottom: -6px;
}

.card form input[type="text"],
.card form input[type="number"],
.card form select,
.card form textarea {
  width: 100%;
  border: 1px solid #dbe3f0;
  border-radius: 16px;
  padding: 13px 15px;
  font-size: 15px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  outline: none;
}

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

.card form input:focus,
.card form select:focus,
.card form textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.card form input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.card table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.card table th {
  text-align: left;
  font-size: 14px;
  color: #334155;
  padding: 10px 12px;
}

.card table td {
  background: #f8fafc;
  padding: 14px 12px;
  vertical-align: middle;
  color: #334155;
}

.card table td:first-child {
  border-radius: 16px 0 0 16px;
}

.card table td:last-child {
  border-radius: 0 16px 16px 0;
}

.card table .btn {
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 14px;
  margin: 3px;
} /* FORM ADMIN */
.card form {
  display: grid;
  gap: 14px;
}

.card form label {
  font-weight: 700;
  color: #334155;
  margin-bottom: -6px;
}

.card form input[type="text"],
.card form input[type="number"],
.card form select,
.card form textarea {
  width: 100%;
  border: 1px solid #dbe3f0;
  border-radius: 16px;
  padding: 13px 15px;
  font-size: 15px;
  font-family: inherit;
  color: #1e293b;
  background: #fff;
  outline: none;
}

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

.card form input:focus,
.card form select:focus,
.card form textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.card form input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.card table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.card table th {
  text-align: left;
  font-size: 14px;
  color: #334155;
  padding: 10px 12px;
}

.card table td {
  background: #f8fafc;
  padding: 14px 12px;
  vertical-align: middle;
  color: #334155;
}

.card table td:first-child {
  border-radius: 16px 0 0 16px;
}

.card table td:last-child {
  border-radius: 0 16px 16px 0;
}

.card table .btn {
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 14px;
  margin: 3px;
}

body.modal-open {
  overflow: hidden;
}

.lab-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
}

.lab-modal-backdrop.show {
  display: flex;
  animation: labFadeIn 0.18s ease-out;
}

.lab-modal {
  position: relative;
  width: min(78vw, 900px);
  max-height: min(86vh, 760px);
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 26px;
  padding: 34px;
  box-shadow: 0 36px 90px rgba(15, 23, 42, 0.34);
  animation: labZoomIn 0.2s ease-out;
}

.lab-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.lab-modal-kicker {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: calc(100% - 54px);
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #eef2ff, #ecfeff);
  color: #3730a3;
  font-size: 13px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lab-modal h2 {
  margin: 0 54px 12px 0;
  color: #0f172a;
  font-size: 30px;
}

.lab-modal-body {
  color: #475569;
  line-height: 1.75;
  font-size: 16px;
}

.lab-modal-body code {
  display: block;
  margin-top: 12px;
  padding: 16px;
  border-radius: 16px;
  background: #0f172a;
  color: #dbeafe;
  white-space: pre-wrap;
  font-family: Consolas, monospace;
}

.lab-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

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

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

@media (max-width: 760px) {
  .lab-modal-backdrop {
    padding: 14px;
    align-items: flex-start;
  }

  .lab-modal {
    width: 100%;
    max-height: calc(100vh - 28px);
    margin-top: 8px;
    border-radius: 22px;
    padding: 24px;
  }

  .lab-modal h2 {
    font-size: 24px;
  }
}
