@import url("https://fonts.googleapis.com/css2?family=Patrick+Hand&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #ffffff;
  --card: #ffffff;
  --text: #0b1f4d;
  --muted: #566480;
  --brand: #0b1f4d;
  --brand2: #224b8f;
  --border: rgba(11, 31, 77, 0.25);
  --shadow: 0 12px 0 rgba(11, 31, 77, 0.12);
  --sketch-shadow: 0 6px 0 rgba(11, 31, 77, 0.16);
  --radius: 18px;
  --paper: repeating-linear-gradient(90deg,
      rgba(11, 31, 77, 0.03) 0,
      rgba(11, 31, 77, 0.03) 1px,
      transparent 1px,
      transparent 8px),
    repeating-linear-gradient(180deg,
      rgba(11, 31, 77, 0.02) 0,
      rgba(11, 31, 77, 0.02) 1px,
      transparent 1px,
      transparent 10px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Patrick Hand", "Trebuchet MS", "Comic Sans MS", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  background-image: var(--paper);
  color: var(--text);
  min-height: 100vh;
  letter-spacing: 0.012em;
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  padding: 36px 24px 90px;
  max-width: 1200px;
  margin: 0 auto;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 2px dashed var(--border);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.footer {
  border-top: 2px dashed var(--border);
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: #fffdf8;
}

.top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 6px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  box-shadow: var(--sketch-shadow);
}

.section {
  padding: 20px 24px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-cards {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.btn {
  border: 2px solid var(--text);
  border-radius: 18px;
  box-shadow: var(--sketch-shadow);
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
}

.btn.ghost {
  border: 2px dashed var(--border);
  background: rgba(11, 31, 77, 0.06);
  color: var(--brand);
}

.input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--text);
  border-radius: 16px;
  font-size: 15px;
  font-family: inherit;
  box-shadow: inset 0 3px 0 rgba(11, 31, 77, 0.06);
}

.muted {
  color: var(--muted);
  font-size: 15px;
}

.progress-wrap {
  margin: 14px 0 18px;
  display: grid;
  gap: 8px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.progress-track {
  height: 10px;
  width: 100%;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  border-radius: inherit;
  transition: width 0.3s ease;
}

.course-summary {
  margin-top: 18px;
}

.summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.summary-metrics {
  display: grid;
  grid-auto-flow: column;
  gap: 16px;
}

.metric {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
  min-width: 110px;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.card-title {
  display: grid;
  gap: 6px;
}

.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
}

.content-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.content-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.empty-state {
  padding: 18px;
  border-radius: 12px;
  border: 1px dashed rgba(15, 23, 42, 0.18);
  background: rgba(15, 23, 42, 0.02);
  text-align: center;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #ffffff;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.data-table th {
  background: rgba(15, 23, 42, 0.04);
  color: var(--muted);
  font-weight: 600;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr.row-click {
  cursor: pointer;
  transition: background 0.2s ease;
}

.data-table tbody tr.row-click:hover {
  background: rgba(37, 99, 235, 0.06);
}

.stat-card h2 {
  font-size: 28px;
  margin: 4px 0;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(15, 23, 42, 0.08);
  background: #e2e8f0;
}

.avatar-small {
  width: 56px;
  height: 56px;
}

.timeline {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.timeline-road {
  position: relative;
  padding: 28px 20px 20px 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.04), rgba(15, 23, 42, 0.02));
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  grid-template-columns: 1fr;
}

.timeline-road::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 24px;
  bottom: 24px;
  width: 16px;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='160' viewBox='0 0 16 160'%3E%3Cpath d='M8 0 C 2 20, 14 40, 8 60 S 2 100, 8 120 S 14 140, 8 160' fill='none' stroke='%232563eb' stroke-opacity='0.45' stroke-width='3' stroke-linecap='round' stroke-dasharray='6 10'/%3E%3C/svg%3E");
  background-repeat: repeat-y;
  background-size: 16px 160px;
  pointer-events: none;
  opacity: 0.8;
}

.timeline-road .timeline-card {
  background: #ffffff;
  position: relative;
  z-index: 1;
  margin-left: 56px;
}

.timeline-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.timeline-road .timeline-card::before {
  content: "";
  position: absolute;
  left: -36px;
  top: 26px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.08);
}

.timeline-road .timeline-card:nth-child(even) {
  margin-left: 84px;
}

.timeline-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.timeline-card.available {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.08);
}

.timeline-card.completed {
  border-color: rgba(22, 163, 74, 0.35);
  box-shadow: 0 10px 20px rgba(22, 163, 74, 0.08);
}

.timeline-card.completed::before {
  border-color: rgba(22, 163, 74, 0.6);
  box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.12);
}

.timeline-card.locked::before {
  border-color: rgba(15, 23, 42, 0.2);
  box-shadow: none;
}

.timeline-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.timeline-title {
  display: grid;
  gap: 6px;
}

.timeline-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--brand);
  background: linear-gradient(135deg, rgba(31, 58, 138, 0.12), rgba(37, 99, 235, 0.16));
}

.timeline-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

.calendar-roadmap {
  overflow-x: auto;
  padding-bottom: 12px;
}

.roadmap-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 20px;
  position: relative;
  padding: 14px 0 36px;
  width: max-content;
  min-width: 100%;
  background-image: repeating-linear-gradient(90deg,
      rgba(11, 31, 77, 0.4) 0,
      rgba(11, 31, 77, 0.4) 12px,
      transparent 12px,
      transparent 22px);
  background-size: 200px 4px;
  background-repeat: repeat-x;
  background-position: 0 36px;
}

.roadmap-node {
  display: grid;
  align-content: start;
  gap: 10px;
  position: relative;
  z-index: 1;
  transform: rotate(-0.6deg);
}

.roadmap-node:nth-child(even) {
  transform: rotate(0.8deg);
}

.roadmap-pin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text);
  background: var(--card);
  box-shadow: var(--sketch-shadow);
  margin-left: 12px;
  position: relative;
}

.roadmap-car {
  position: absolute;
  top: -18px;
  left: -6px;
  width: 36px;
  height: 18px;
  background: var(--brand2);
  border: 2px solid var(--text);
  border-radius: 6px;
  box-shadow: var(--sketch-shadow);
}

.roadmap-car::before,
.roadmap-car::after {
  content: "";
  position: absolute;
  bottom: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text);
}

.roadmap-car::before {
  left: 4px;
}

.roadmap-car::after {
  right: 4px;
}

.journey-map {
  position: relative;
  width: 100%;
  height: clamp(320px, 45vw, 560px);
  overflow: visible;
  padding: 12px 0;
}

.journey-map svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.journey-map svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.journey-stairs-line {
  fill: none;
  stroke: #0b1f4d;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.journey-stairs {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  padding: 18px 0;
}

.journey-step {
  position: absolute;
  left: 0;
  transform: none;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.journey-step::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 14px;
  background: #d7dbe3;
  border: 2px solid #b8bfcc;
  border-radius: 12px;
  box-shadow: 0 4px 0 rgba(11, 31, 77, 0.12);
}

.journey-step.current {
  transform: scale(1.04);
  z-index: 2;
}

.step-pin {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  position: absolute;
  right: 16px;
  bottom: 0;
  transform: translateY(50%);
}

.step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--text);
  background: #ffffff;
  box-shadow: 0 2px 0 rgba(11, 31, 77, 0.15);
}

.journey-step.current .step-dot {
  background: #1f3a8a;
}

.step-label {
  font-size: 13px;
  font-weight: 600;
  background: #ffffff;
  border: 2px dashed rgba(11, 31, 77, 0.25);
  border-radius: 999px;
  padding: 4px 10px;
  box-shadow: 0 6px 0 rgba(11, 31, 77, 0.08);
}

.step-info {
  position: absolute;
  top: -44px;
  left: 50%;
  transform: translate(-50%, -100%);
  padding: 10px 14px;
  border-radius: 16px;
  border: 2px dashed rgba(11, 31, 77, 0.2);
  background: #ffffff;
  box-shadow: 0 8px 0 rgba(11, 31, 77, 0.08);
  text-align: center;
  min-width: 220px;
}

.step-info strong {
  display: block;
  font-size: 14px;
}

.journey-step .journey-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -10px);
  padding: 10px 12px;
  border-radius: 14px;
  border: 2px dashed var(--border);
  background: var(--card);
  box-shadow: var(--sketch-shadow);
  min-width: 180px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
}

.journey-step:hover .journey-tooltip {
  opacity: 1;
  transform: translate(-50%, -20px);
}

.journey-sheet {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 60;
}

.journey-sheet.open {
  display: block;
}

.journey-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 31, 77, 0.4);
}

.journey-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  border-top: 2px dashed var(--border);
  border-radius: 18px 18px 0 0;
  padding: 16px 18px 22px;
  display: grid;
  gap: 12px;
}

.journey-sheet-body {
  display: grid;
  gap: 10px;
}

.journey-sheet-row {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 2px solid rgba(11, 31, 77, 0.12);
  background: rgba(11, 31, 77, 0.03);
}

.journey-sheet-close {
  justify-self: end;
}


@media (max-width: 720px) {
  .journey-map {
    height: 400px;
    padding: 8px 0;
  }

  .journey-step {
    height: 40px;
    width: var(--step-width, 86%);
  }

  .step-pin {
    right: 12px;
  }

  .step-dot {
    width: 14px;
    height: 14px;
  }

  .journey-step .journey-tooltip {
    min-width: 150px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .step-info {
    min-width: 190px;
    padding: 8px 12px;
  }
}

@media (max-width: 640px) {
  .journey-tooltip {
    display: none;
  }
}

.roadmap-pin::before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(11, 31, 77, 0.15);
  top: 5px;
  left: 5px;
}

.roadmap-node.current .roadmap-pin {
  background: var(--brand2);
  border-color: var(--brand);
}

.roadmap-node.current .roadmap-pin::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(11, 31, 77, 0.35);
}

.roadmap-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 2px dashed var(--border);
  background: var(--card);
  box-shadow: var(--sketch-shadow);
  position: relative;
}

.roadmap-card::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(11, 31, 77, 0.12);
  border-radius: 16px;
  pointer-events: none;
  transform: rotate(-0.4deg);
}

.roadmap-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calendar-progress {
  height: 10px;
  background: rgba(11, 31, 77, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.calendar-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
}

.calendar-entries {
  display: grid;
  gap: 10px;
}

.calendar-entry {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 2px solid rgba(11, 31, 77, 0.12);
  background: rgba(11, 31, 77, 0.03);
  transform: rotate(-0.3deg);
}

@media (max-width: 720px) {
  .page {
    padding: 28px 16px 70px;
  }

  .calendar-entry {
    flex-direction: column;
    align-items: flex-start;
  }

  .roadmap-track {
    grid-auto-columns: minmax(220px, 1fr);
  }
}

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.1);
  color: var(--muted);
}

.status-pill.available {
  background: rgba(37, 99, 235, 0.12);
  color: #1e40af;
}

.status-pill.completed {
  background: rgba(22, 163, 74, 0.14);
  color: #166534;
}

.status-pill.locked {
  background: rgba(15, 23, 42, 0.08);
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-content {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  transform: translateY(8px);
  transition: transform 0.2s ease;
}

.modal-backdrop.open .modal-content {
  transform: translateY(0);
}

.modal-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 12px;
}

.results-hero {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(31, 58, 138, 0.12), rgba(37, 99, 235, 0.2));
  border: 1px solid rgba(37, 99, 235, 0.28);
}

.results-hero::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.2), transparent 60%);
}

.hero-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.hero-name {
  font-weight: 700;
  color: var(--brand);
}

.hero-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.score-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--brand2) var(--score, 0%), rgba(15, 23, 42, 0.12) 0);
}

.score-ring>div {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.score-value {
  display: grid;
  gap: 4px;
}

.score-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.results-list {
  display: grid;
  gap: 10px;
}

.results-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 14px;
}

.results-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toast-container {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 60;
}

.toast {
  padding: 10px 16px;
  border-radius: 999px;
  background: #1f2937;
  color: #ffffff;
  font-size: 13px;
  box-shadow: var(--shadow);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast-success {
  background: #16a34a;
}

.toast-error {
  background: #dc2626;
}

.toast.hide {
  opacity: 0;
  transform: translateY(6px);
}

@media (max-width: 720px) {
  .page {
    padding: 20px 16px 60px;
  }

  .navbar-inner {
    padding: 12px 16px;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
  }

  .grid-cards {
    grid-template-columns: 1fr;
  }

  .summary-metrics {
    grid-auto-flow: row;
    width: 100%;
  }

  .timeline-road::before {
    left: 16px;
  }

  .timeline-road .timeline-card,
  .timeline-road .timeline-card:nth-child(even) {
    margin-left: 36px;
  }

  .timeline-road .timeline-card::before {
    left: -28px;
  }
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}