
:root {
  --navy: #192943;
  --blue: #2869d7;
  --blue-light: #edf4ff;
  --text: #24334a;
  --muted: #8290a3;
  --bg: #f5f7fb;
  --white: #ffffff;
  --border: #e8edf4;
  --shadow: 0 8px 28px rgba(27, 48, 78, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: "DM Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 255px;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 27px 18px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 5px 34px;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--navy);
  color: white;
  font-weight: 800;
  font-size: 13px;
}

.brand b, .brand small,
.profile b, .profile small,
.stat-card small, .stat-card b,
.stat-card span, .game-score small,
.game-score b {
  display: block;
}

.brand b { font-size: 15px; }
.brand small {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 700;
}

.side-label, .section-kicker {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 800;
  color: #98a5b6;
}

.side-label { padding: 0 10px 13px; }
.nav-menu { display: grid; gap: 6px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  color: #748196;
  border-radius: 9px;
  font-weight: 600;
  transition: .2s;
}

.nav-link span {
  width: 20px;
  text-align: center;
  font-size: 18px;
}

.nav-link:hover, .nav-link.active {
  color: var(--blue);
  background: var(--blue-light);
}

.sidebar-bottom { margin-top: auto; }

.progress-mini {
  background: #f6f8fc;
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 11px;
  margin-bottom: 19px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 10px;
}

.progress-head b { color: var(--blue); }
.progress-mini small { color: var(--muted); font-size: 10px; }

.progress-track {
  height: 6px;
  background: #e7edf5;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 9px;
}

.progress-track i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--blue);
  border-radius: inherit;
  transition: .3s;
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px 0;
  border-top: 1px solid var(--border);
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9f1ff;
  color: var(--blue);
  font-weight: 800;
}

.profile b { font-size: 11px; }
.profile small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

/* MAIN */
.main {
  margin-left: 255px;
  min-height: 100vh;
  padding: 0 36px;
}

.topbar {
  height: 69px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  margin-bottom: 31px;
}

.breadcrumb { color: var(--muted); font-size: 12px; }
.breadcrumb span { margin: 0 8px; color: #c4ccd7; }
.breadcrumb b { color: var(--text); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #7c899b;
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #36b987;
}

.icon-btn, .mobile-menu {
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
}

.mobile-menu { display: none; }

/* PAGE */
.page { display: none; animation: appear .3s ease; }
.page.active { display: block; }

@keyframes appear {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* BERANDA */
.hero {
  background: linear-gradient(120deg, #fff 0%, #f1f6ff 100%);
  border: 1px solid #e8eef8;
  border-radius: 17px;
  padding: 43px 45px;
  min-height: 300px;
  display: flex;
  align-items: center;
}

.hero-copy { max-width: 650px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
}

.eyebrow-line {
  width: 22px;
  height: 2px;
  background: var(--blue);
}

.hero h1 {
  margin: 19px 0 13px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.15;
  letter-spacing: -1.8px;
  color: var(--navy);
}

.hero h1 em { color: var(--blue); font-style: normal; }

.hero-copy > p {
  color: #758399;
  line-height: 1.8;
  max-width: 570px;
  font-size: 13px;
}

.student-info {
  margin-top: 21px;
  padding: 14px 17px;
  background: #edf4ff;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  max-width: 390px;
}

.student-info span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #8492a7;
}

.student-info h3 {
  margin: 6px 0;
  font-size: 16px;
  color: var(--navy);
}

.student-info p {
  margin: 0;
  font-size: 11px;
  color: #68768a;
}

.hero-actions { display: flex; gap: 10px; margin-top: 23px; }

.btn {
  border: 0;
  padding: 11px 17px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  transition: .2s;
}

.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: #1d55b7; transform: translateY(-1px); }
.btn-primary span { margin-left: 9px; }
.btn-quiet { background: #edf1f7; color: #53627a; }
.btn-quiet:hover { background: #e2e9f3; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 19px;
  margin-top: 25px;
  color: #8b98aa;
  font-size: 10px;
}

.welcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 34px 0 18px;
}

.welcome-row h2, .page-heading h1 { color: var(--navy); }
.welcome-row h2 { font-size: 21px; margin: 6px 0; }
.muted { color: var(--muted); line-height: 1.7; }

.date-chip, .pill {
  background: #edf4ff;
  color: var(--blue);
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
}

.date-chip span { margin: 0 5px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 17px 14px;
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 18px;
}

.stat-icon.blue { background: #eaf2ff; color: #3979df; }
.stat-icon.violet { background: #f1edff; color: #8667d8; }
.stat-icon.green { background: #e8f8f1; color: #32a77c; }
.stat-icon.amber { background: #fff5e5; color: #d99b35; }

.stat-card small { color: var(--muted); font-size: 10px; }
.stat-card b { margin: 4px 0; font-size: 17px; color: var(--navy); }
.stat-card span { color: #a0aaba; font-size: 9px; }

.home-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 18px;
}

/* PANEL */
.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel h3 {
  font-size: 16px;
  color: var(--navy);
  margin: 7px 0 10px;
}

.panel p { line-height: 1.7; }

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.continue-panel > p {
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 17px;
}

.objective-panel ul {
  padding-left: 18px;
  color: #77859a;
  line-height: 2;
  font-size: 12px;
}

.pill { display: inline-block; padding: 6px 9px; white-space: nowrap; }

.footer {
  border-top: 1px solid var(--border);
  margin-top: 38px;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #9aa6b5;
  font-size: 10px;
}

/* JUDUL HALAMAN */
.page-heading { margin: 12px 0 25px; }

.page-heading h1 {
  font-size: 29px;
  margin: 9px 0 7px;
}

.page-heading > p { font-size: 12px; }

/* MATERI */
.lesson-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 17px;
  align-items: start;
}

.lesson-list { padding: 15px; }

.lesson-list-title {
  display: block;
  font-size: 10px;
  letter-spacing: 1px;
  color: #96a2b2;
  padding: 5px 8px 13px;
}

.lesson-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 12px 9px;
  border-radius: 8px;
  color: var(--text);
  margin-bottom: 4px;
}

.lesson-item > span { color: #99a6b7; font-size: 11px; font-weight: 800; }
.lesson-item div { flex: 1; }
.lesson-item b, .lesson-item small { display: block; }
.lesson-item b { font-size: 11px; }
.lesson-item small { color: var(--muted); font-size: 9px; margin-top: 4px; }
.lesson-item i { color: #9aa7b8; font-style: normal; }

.lesson-item:hover, .lesson-item.selected {
  background: var(--blue-light);
  color: var(--blue);
}

.lesson-content { min-height: 350px; line-height: 1.8; }
.lesson-content h2 { color: var(--navy); margin: 10px 0 15px; }
.lesson-content h3 { margin-top: 20px; }
.lesson-content p, .lesson-content li { color: #718097; font-size: 13px; }
.lesson-content ul { padding-left: 20px; margin-top: 9px; }
.lesson-content li { margin: 7px 0; }

/* TUTORIAL */
.tutorial-layout {
  display: grid;
  grid-template-columns: 235px 1fr;
  gap: 17px;
  align-items: start;
}

.step-sidebar { position: sticky; top: 15px; }
.step-count { margin-bottom: 14px; }
.step-count b { font-size: 25px; color: var(--blue); }
.step-count span { font-size: 10px; color: var(--muted); }

.step-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 17px;
}

.step-nav button {
  border: 1px solid var(--border);
  background: white;
  color: #8794a6;
  padding: 9px 4px;
  border-radius: 6px;
  font-size: 11px;
}

.step-nav button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.step-nav button.completed {
  background: #e9f7f1;
  color: #299b72;
  border-color: #d2eee2;
}

.step-content h2 { color: var(--navy); margin: 8px 0 18px; }
.step-content > p { color: #738198; line-height: 1.8; font-size: 13px; margin: 15px 0; }

/* ILUSTRASI AREA AUTOCAD DIHILANGKAN */
.step-illustration {
  display: none !important;
}

.step-tip {
  background: #f1f6ff;
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  padding: 12px 14px;
  color: #61738d;
  font-size: 11px;
  line-height: 1.7;
}

.step-controls {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
}

/* CAD LAB */
.lab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.lab-panel h3 { margin-top: 7px; }
.small { font-size: 11px; }

.layer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.layer-row > div { flex: 1; }
.layer-row b, .layer-row small { display: block; }
.layer-row b { font-size: 12px; }
.layer-row small { font-size: 9px; color: var(--muted); margin-top: 4px; }

.layer-swatch { width: 13px; height: 13px; border-radius: 3px; }
.layer-swatch.white { background: #d8dfe9; border: 1px solid #9daabd; }
.layer-swatch.yellow { background: #f2c94c; }

.switch { position: relative; width: 34px; height: 19px; }
.switch input { opacity: 0; width: 0; height: 0; }

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: #cbd3df;
  transition: .2s;
}

.switch span:before {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: white;
  transition: .2s;
}

.switch input:checked + span { background: var(--blue); }
.switch input:checked + span:before { transform: translateX(15px); }

.drawing-preview {
  margin-top: 17px;
  background: #192943;
  border-radius: 8px;
  padding: 12px;
}

.drawing-preview svg { width: 100%; display: block; }

.preview-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: #d4deec;
  font-size: 9px;
  padding: 8px 0 2px;
}

.preview-legend span { display: flex; align-items: center; gap: 6px; }
.legend-white, .legend-yellow { width: 9px; height: 3px; display: inline-block; }
.legend-white { background: white; }
.legend-yellow { background: #f2c94c; }

.dimension-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.dim-btn {
  padding: 10px;
  border: 1px solid var(--border);
  background: white;
  color: #68778d;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
}

.dim-btn:hover, .dim-btn.active {
  border-color: #a9c7f7;
  background: var(--blue-light);
  color: var(--blue);
}

.dim-explain { background: #f6f8fc; border-radius: 9px; padding: 17px; }
.dim-symbol { font-size: 26px; color: var(--blue); margin-bottom: 7px; }
.dim-explain b { color: var(--navy); }
.dim-explain p { color: var(--muted); font-size: 11px; margin-top: 6px; }
.full { grid-column: 1 / -1; }

.height-control {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 17px 0;
}

.height-control input { flex: 1; accent-color: var(--blue); }
.height-control b { color: var(--blue); min-width: 45px; }

.height-preview {
  min-height: 110px;
  background: #192943;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
  gap: 9px;
}

.height-preview span { font-size: 28px; font-weight: 700; }
.height-preview small { color: #9aabc2; font-size: 9px; }

/* GAME */
.game-wrap { padding: 27px; }

.game-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.game-top h2 { color: var(--navy); margin: 12px 0 6px; }
.game-top p { font-size: 12px; }

.game-score {
  background: #f1f6ff;
  border-radius: 9px;
  padding: 12px 18px;
  text-align: center;
}

.game-score small { font-size: 9px; color: var(--muted); }
.game-score b { font-size: 20px; color: var(--blue); margin-top: 5px; }

.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 25px;
}

.match-label {
  display: block;
  font-size: 10px;
  color: #98a5b6;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.choice-list { display: grid; gap: 8px; }

.choice-list button {
  border: 1px solid var(--border);
  background: #fff;
  padding: 12px;
  border-radius: 7px;
  text-align: left;
  color: #586980;
  font-size: 11px;
}

.choice-list button.selected {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}

.choice-list button.matched {
  background: #e9f7f1;
  border-color: #ccebdc;
  color: #299b72;
}

.choice-list button:disabled { cursor: default; opacity: .8; }

.game-feedback {
  background: #f5f7fb;
  padding: 13px;
  border-radius: 7px;
  color: #718097;
  font-size: 11px;
  margin-top: 18px;
}

.game-actions { margin-top: 15px; }

/* KUIS */
.quiz-layout {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 16px;
  align-items: start;
}

.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.quiz-progress {
  height: 5px;
  background: #e9eef5;
  border-radius: 20px;
  margin: 18px 0 25px;
  overflow: hidden;
}

.quiz-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--blue);
  transition: .3s;
}

.quiz-main h2 {
  font-size: 18px;
  color: var(--navy);
  line-height: 1.5;
  margin-bottom: 18px;
}

.answer-list { display: grid; gap: 9px; }

.answer-list button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: #66758a;
  padding: 13px;
  text-align: left;
  font-size: 12px;
}

.answer-list button.selected {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
}

.answer-list button.correct {
  background: #e9f7f1;
  border-color: #bde6d3;
  color: #258e68;
}

.answer-list button.wrong {
  background: #fff0ef;
  border-color: #f3c9c5;
  color: #c35d55;
}

.quiz-feedback {
  font-size: 11px;
  color: #718097;
  margin-top: 13px;
  min-height: 18px;
}

.quiz-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 9px;
  margin-top: 22px;
}

.hidden { display: none !important; }

.quiz-aside { text-align: center; }
.quiz-aside > .section-kicker { text-align: left; }

.result-circle {
  width: 112px;
  height: 112px;
  border: 7px solid #e8f0ff;
  border-top-color: var(--blue);
  border-radius: 50%;
  margin: 25px auto 17px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.result-circle span { font-size: 26px; font-weight: 800; color: var(--blue); }
.result-circle small { font-size: 8px; color: var(--muted); }
.quiz-aside h3 { margin: 8px 0; }
.quiz-aside > p { margin-bottom: 18px; }

.result-detail {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  color: #8290a3;
  font-size: 11px;
}

.result-detail b { color: var(--navy); }

/* NOTIFIKASI */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--navy);
  color: white;
  padding: 12px 17px;
  border-radius: 8px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: .25s;
  z-index: 50;
}

.toast.show { opacity: 1; transform: translateY(0); }

/* DARK MODE */
body.dark {
  --bg: #111b2b;
  --white: #1b2940;
  --text: #e5ecf6;
  --muted: #9aa9bd;
  --border: #2b3a52;
  --navy: #e5edf8;
  --blue-light: #243b5e;
  --shadow: none;
}

body.dark .hero {
  background: linear-gradient(120deg, #1b2940, #203653);
  border-color: #30445f;
}

body.dark .student-info,
body.dark .progress-mini,
body.dark .dim-explain,
body.dark .game-feedback {
  background: #24344d;
}

body.dark .student-info h3,
body.dark .panel h3,
body.dark .lesson-content h2,
body.dark .quiz-main h2 {
  color: #e5edf8;
}

body.dark .btn-quiet,
body.dark .icon-btn,
body.dark .mobile-menu,
body.dark .dim-btn,
body.dark .answer-list button,
body.dark .choice-list button,
body.dark .lesson-item {
  background: #24344d;
  color: #d7e1ef;
  border-color: #354760;
}

body.dark .step-illustration,
body.dark .drawing-preview,
body.dark .height-preview {
  background-color: #101b2c;
}

body.dark .student-info p { color: #b6c4d6; }

/* RESPONSIVE */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 0 25px; }
  .sidebar { width: 230px; }
  .main { margin-left: 230px; }
}

@media (max-width: 800px) {
  .sidebar {
    transform: translateX(-100%);
    transition: .25s;
    box-shadow: var(--shadow);
  }

  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 0 18px; }
  .mobile-menu { display: block; }
  .topbar { gap: 12px; }

  .lesson-layout,
  .tutorial-layout,
  .quiz-layout {
    grid-template-columns: 1fr;
  }

  .step-sidebar { position: static; }
  .step-nav { grid-template-columns: repeat(7, 1fr); }
  .quiz-aside { display: none; }
}

@media (max-width: 560px) {
  .main { padding: 0 13px; }
  .topbar { height: 58px; margin-bottom: 20px; }
  .top-actions > span:not(.status-dot) { display: none; }
  .hero { padding: 27px 20px; }
  .hero h1 { font-size: 34px; }
  .hero-meta { gap: 10px; }

  .welcome-row { align-items: flex-start; gap: 10px; }

  .stat-grid,
  .home-bottom,
  .lab-grid,
  .match-grid {
    grid-template-columns: 1fr;
  }

  .full { grid-column: auto; }
  .stat-card { padding: 13px; }
  .page-heading h1 { font-size: 24px; }
  .panel { padding: 17px; }
  .game-top { flex-direction: column; }
  .step-nav { grid-template-columns: repeat(6, 1fr); }
  .footer { flex-direction: column; }
  .date-chip { font-size: 9px; }
}
