:root {
  --bg: #f8fafd;
  --panel: #f2f6fc;
  --ink: #1f1f1f;
  --ink-soft: #5f6368;
  --card: #ffffff;
  --line: #dde3ea;
  --brand: #1a73e8;
  --brand-deep: #0b57d0;
  --accent: #e8f0fe;
  --shadow: 0 2px 8px rgba(60, 64, 67, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Roboto", "Roboto Flex", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 0% 0%, #eef4fd 0%, transparent 36%),
    radial-gradient(circle at 100% 20%, #f1f6ff 0%, transparent 30%),
    var(--bg);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 330px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, var(--panel) 0%, #f7f9fc 100%);
  color: #1f1f1f;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  overflow: auto;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-row h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.brand-row .material-symbols-rounded {
  color: var(--brand);
  font-size: 1.3rem;
}

.brand p {
  margin: 2px 0 10px;
  color: var(--ink-soft);
}

.overall-progress-wrap {
  margin: 8px 0 14px;
}

.overall-progress-text {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  margin-bottom: 12px;
}

.module {
  margin: 14px 0;
}

.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.module-title {
  font-weight: 700;
  margin: 8px 0;
  color: #3c4043;
  font-size: 0.94rem;
}

.module-pct {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e9eef6;
  overflow: hidden;
}

.progress-track.thin {
  height: 5px;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), #6da3ff);
}

.lesson-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: #3c4043;
  border-radius: 999px;
  padding: 7px 10px;
  margin: 4px 0;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.lesson-leading {
  font-size: 1rem;
  color: #9aa0a6;
}

.lesson-leading.done {
  color: #188038;
}

.lesson-leading.saved {
  color: #c26401;
}

.lesson-name {
  flex: 1;
}

.lesson-link:hover {
  background: #eef3fd;
}

.lesson-link.active {
  background: var(--accent);
  border-color: #c6dafc;
  color: var(--brand-deep);
}

.content {
  padding: 20px min(3vw, 38px) 28px;
  overflow: auto;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.menu-btn {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
}

.crumbs {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.topbar-chip {
  margin-left: auto;
  border: 1px solid #c8d8f8;
  color: var(--brand-deep);
  background: #edf3fe;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.hero-card {
  background: linear-gradient(120deg, #e8f0fe, #f2f6ff 58%, #ffffff 165%);
  color: #1f1f1f;
  border-radius: 24px;
  border: 1px solid #d6e3fc;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.hero-card h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.hero-card p {
  margin: 8px 0 0;
  color: #4a4f54;
}

.dashboard-card,
.checkpoint-card,
.video-panel,
.lesson-body {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.metric-box {
  border: 1px solid var(--line);
  background: #f9fbff;
  border-radius: 14px;
  padding: 10px;
}

.metric-label {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.metric-value {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 4px;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dashboard-actions button,
.import-label,
.lesson-controls button,
.quiz-submit {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  color: #1f1f1f;
}

.import-label {
  display: inline-flex;
  align-items: center;
}

#import-input {
  display: none;
}

.confidence-wrap,
.notes-wrap {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.confidence-wrap select,
.notes-wrap textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  width: 100%;
}

.resource-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.resource-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cad8f2;
  border-radius: 999px;
  background: #f5f9ff;
  color: var(--brand-deep);
  text-decoration: none;
  padding: 6px 12px;
  font-size: 0.86rem;
}

.resource-chip.muted {
  color: var(--ink-soft);
  border-color: var(--line);
  background: #fff;
}

.video-panel h3,
.checkpoint-card h3 {
  margin: 0 0 8px;
}

.video-frame-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 12px;
  overflow: hidden;
}

.video-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.lesson-body {
  line-height: 1.65;
}

.lesson-body img {
  max-width: 100%;
  border-radius: 12px;
}

.lesson-body pre {
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  background: #f4f8fa;
}

.lesson-body a {
  color: #0c6e9a;
}

.lesson-controls {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.lesson-controls button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.quiz-meta {
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.quiz-question {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin: 10px 0;
}

.quiz-q-title {
  font-weight: 500;
  margin-bottom: 8px;
}

.quiz-option {
  display: flex;
  gap: 8px;
  margin: 6px 0;
}

.reflection-wrap {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.reflection-wrap p {
  margin: 6px 0;
  color: var(--ink-soft);
}

.reflection-wrap textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  font: inherit;
}

.hidden {
  display: none;
}

@media (max-width: 1080px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 20;
    width: min(88vw, 340px);
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-btn {
    display: inline-flex;
  }

  .content {
    padding-top: 14px;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .topbar-chip {
    margin-left: 0;
  }
}
