@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ═══════════════════════════════════════════
   VARIABLES CSS
═══════════════════════════════════════════ */
:root {
  --navy:        #00205d;
  --navy-dark:   #001540;
  --navy-mid:    #002f8a;
  --blue:        #0057b8;
  --blue-light:  #3d7dd8;
  --accent:      #00a3e0;
  --accent2:     #00c4b4;
  --gold:        #f0a500;
  --surface:     #f8fafc;
  --surface2:    #ffffff;
  --border:      #e2e8f0;
  --text:        #1a2340;
  --text-sub:    #64748b;
  --text-light:  #94a3b8;

  --s-sm:  0 2px 8px rgba(0,0,0,.05);
  --s-md:  0 4px 16px rgba(0,0,0,.07);
  --s-lg:  0 8px 32px rgba(0,0,0,.09);
  --s-xl:  0 16px 48px rgba(0,0,0,.12);

  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;

  --sidebar-w: 268px;
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════
   BARRA DE PROGRESO GLOBAL
═══════════════════════════════════════════ */
#global-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--navy), var(--accent), var(--accent2));
  z-index: 9999;
  transition: width 0.4s ease;
}

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--navy-dark);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.sb-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sb-logo-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,87,184,.4);
}

.sb-logo-text { flex: 1; min-width: 0; }
.sb-logo-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  line-height: 1.3;
}
.sb-logo-sub {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  margin-top: 2px;
}

.sb-section {
  padding: 16px 12px 4px;
}
.sb-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.3);
  padding: 0 8px;
  margin-bottom: 6px;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}
.sb-item:hover {
  background: rgba(255,255,255,.07);
}
.sb-item.active {
  background: linear-gradient(135deg, rgba(0,87,184,.5), rgba(0,163,224,.3));
  border: 1px solid rgba(0,163,224,.25);
}
.sb-item.done .sb-item-icon::after {
  content: '';
  position: absolute;
  top: 2px; right: 2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent2);
}

.sb-item-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(255,255,255,.3);
  width: 22px;
  flex-shrink: 0;
  text-align: center;
}
.sb-item.active .sb-item-code { color: var(--accent); }

.sb-item-icon {
  font-size: 16px;
  position: relative;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sb-item-name {
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255,255,255,.65);
  line-height: 1.3;
  flex: 1;
}
.sb-item.active .sb-item-name { color: #fff; font-weight: 600; }

/* Sidebar progress bar */
.sb-footer {
  margin-top: auto;
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sb-progress-label {
  font-size: 11px;
  color: rgba(255,255,255,.4);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}
.sb-progress-track {
  height: 4px;
  background: rgba(255,255,255,.1);
  border-radius: 99px;
  overflow: hidden;
}
.sb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--accent));
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* Overlay mobile */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 999;
}

/* Hamburger */
#hamburger {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 1100;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--navy);
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  box-shadow: var(--s-md);
}
#hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

/* ═══════════════════════════════════════════
   CONTENT AREA
═══════════════════════════════════════════ */
#content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.page {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  animation: fadeInUp 0.35s ease forwards;
}
.page.active { display: flex; }

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

/* ═══════════════════════════════════════════
   HERO BAND
═══════════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy-mid) 60%, var(--blue) 100%);
  padding: 48px 56px 44px;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,163,224,.15), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -40px; left: 20%;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,196,180,.1), transparent 70%);
  pointer-events: none;
}

.hero-breadcrumb {
  font-size: 12px;
  color: rgba(255,255,255,.45);
  letter-spacing: .04em;
  margin-bottom: 16px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 99px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: rgba(255,255,255,.8);
  margin-bottom: 20px;
}

.hero-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  background: linear-gradient(135deg, #fff 40%, rgba(0,196,180,.9));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.hero-sub {
  font-size: 15px;
  color: rgba(255,255,255,.6);
  max-width: 600px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 99px;
  font-size: 12px;
  color: rgba(255,255,255,.75);
}

/* ═══════════════════════════════════════════
   PAGE BODY
═══════════════════════════════════════════ */
.page-body {
  flex: 1;
  padding: 44px 56px;
  max-width: 1060px;
  width: 100%;
}

.sec-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.sec-title::before {
  content: '';
  display: inline-block;
  width: 4px; height: 22px;
  background: linear-gradient(180deg, var(--blue), var(--accent));
  border-radius: 4px;
  flex-shrink: 0;
}

.sec-sub {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 24px;
  padding-left: 14px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}

/* ═══════════════════════════════════════════
   CARDS GRID
═══════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.cards-grid-3 { grid-template-columns: repeat(3, 1fr); }
.cards-grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface2);
  border-radius: var(--r-md);
  padding: 24px;
  box-shadow: var(--s-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--accent));
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--s-lg);
  border-color: rgba(0,87,184,.15);
}

.card-icon {
  font-size: 32px;
  margin-bottom: 14px;
  display: block;
}
.card-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 8px;
}
.card-desc {
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.6;
}
.card-tag {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 10px;
  background: rgba(0,87,184,.08);
  color: var(--blue);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   TABS
═══════════════════════════════════════════ */
.tabs-wrap { margin-bottom: 28px; }
.tabs-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 1px;
  border-bottom: 2px solid var(--border);
}
.tab-btn {
  padding: 9px 20px;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--surface);
  color: var(--text-sub);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
  margin-bottom: -2px;
}
.tab-btn:hover { background: #eef2ff; color: var(--navy); }
.tab-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: fadeSlide 0.25s ease;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   ACCORDION
═══════════════════════════════════════════ */
.accordion { margin-bottom: 8px; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--s-sm); }
.acc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
}
.acc-header:hover { background: #f1f5f9; }
.acc-header.open { background: #eff1f9; border-color: rgba(0,87,184,.2); border-radius: var(--r-md) var(--r-md) 0 0; }
.acc-title {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  display: flex; align-items: center; gap: 10px;
}
.acc-chevron {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: var(--text-sub);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}
.acc-header.open .acc-chevron { transform: rotate(180deg); background: var(--blue); color: #fff; }
.acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
}
.acc-body.open { max-height: 900px; }
.acc-content { padding: 16px 20px; font-size: 14px; line-height: 1.7; color: var(--text-sub); }

/* ═══════════════════════════════════════════
   EJERCICIOS EXPANDIBLES
═══════════════════════════════════════════ */
.ejercicio {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--s-sm);
}
.ej-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: var(--transition);
}
.ej-header:hover { background: #f8faff; }
.ej-meta { display: flex; align-items: center; gap: 12px; }
.ej-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
}
.ej-badge {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
}
.ej-arrow {
  font-size: 12px;
  color: var(--text-light);
  transition: transform 0.3s ease;
}
.ej-header.open .ej-arrow { transform: rotate(90deg); }
.ej-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
}
.ej-body.open { display: block; }
.ej-context {
  background: #f0f7ff;
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 14px 16px;
  margin: 16px 0 14px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
}
.ej-questions { margin-bottom: 16px; }
.ej-question {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text);
}
.ej-question-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.btn-sol {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.btn-sol:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,87,184,.3); }
.ej-solucion {
  display: none;
  margin-top: 14px;
  padding: 16px;
  background: #f0fff4;
  border: 1px solid #86efac;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
}
.ej-solucion.visible { display: block; animation: fadeSlide 0.25s ease; }

/* ═══════════════════════════════════════════
   FAQ
═══════════════════════════════════════════ */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  cursor: pointer;
  gap: 16px;
}
.faq-qtext {
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  line-height: 1.5;
}
.faq-icon {
  font-size: 18px;
  color: var(--blue);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-top: 1px;
}
.faq-q.open .faq-icon { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.faq-a.open { max-height: 400px; }
.faq-atext {
  padding-top: 10px;
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════
   TABLAS
═══════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-md);
  box-shadow: var(--s-sm);
  margin-bottom: 24px;
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
thead tr {
  background: var(--navy);
  color: #fff;
}
thead th {
  padding: 13px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: .02em;
  white-space: nowrap;
}
tbody tr { transition: background 0.15s ease; }
tbody tr:nth-child(even) { background: #f8fafb; }
tbody tr:hover { background: #eef4ff; }
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
  vertical-align: top;
}
tbody td:first-child { font-weight: 600; color: var(--navy); }

/* ═══════════════════════════════════════════
   FLUJO DE PROCESO
═══════════════════════════════════════════ */
.flow-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  min-width: 100px;
  position: relative;
}
.flow-step:not(:last-child)::after {
  content: '→';
  position: absolute;
  top: 20px;
  right: -14px;
  font-size: 20px;
  color: var(--blue);
  z-index: 1;
}
.flow-circle {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0,87,184,.3);
  position: relative;
  z-index: 2;
}
.flow-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
  margin-bottom: 4px;
}
.flow-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
  padding: 0 8px;
}

/* ═══════════════════════════════════════════
   CALLOUTS
═══════════════════════════════════════════ */
.callout {
  padding: 14px 18px;
  border-radius: var(--r-sm);
  margin-bottom: 18px;
  font-size: 13.5px;
  line-height: 1.65;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.callout-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.callout.info  { background: #eff6ff; border-left: 3.5px solid #3b82f6; color: #1e3a5f; }
.callout.warn  { background: #fffbeb; border-left: 3.5px solid #f59e0b; color: #78350f; }
.callout.success { background: #f0fdf4; border-left: 3.5px solid #22c55e; color: #14532d; }
.callout.danger  { background: #fff1f2; border-left: 3.5px solid #f43f5e; color: #881337; }
.callout.navy  { background: #eff1f9; border-left: 3.5px solid var(--navy); color: var(--navy-dark); }

/* ═══════════════════════════════════════════
   INFO GRID (estadísticas)
═══════════════════════════════════════════ */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.info-card {
  background: var(--surface2);
  border-radius: var(--r-md);
  padding: 20px 22px;
  box-shadow: var(--s-sm);
  border: 1px solid var(--border);
  text-align: center;
  transition: var(--transition);
}
.info-card:hover { transform: translateY(-2px); box-shadow: var(--s-md); }
.info-card-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 36px;
  line-height: 1;
  background: linear-gradient(135deg, var(--navy), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.info-card-label {
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 500;
}

/* ═══════════════════════════════════════════
   TOPIC MAP (Inicio)
═══════════════════════════════════════════ */
.topic-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}
.topic-tile {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.topic-tile::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--blue), var(--accent));
}
.topic-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--s-md);
  border-color: rgba(0,87,184,.2);
}
.topic-tile-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 6px;
}
.topic-tile-icon { font-size: 24px; margin-bottom: 8px; }
.topic-tile-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
  line-height: 1.35;
}

/* ═══════════════════════════════════════════
   SIMULADOR
═══════════════════════════════════════════ */
.sim-wrap {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--s-sm);
  margin-bottom: 28px;
}
.sim-header {
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  display: flex;
  align-items: center;
  gap: 10px;
}
.sim-header-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}
.sim-body { padding: 24px; }

/* ═══════════════════════════════════════════
   QUIZ
═══════════════════════════════════════════ */
.quiz-wrap {
  max-width: 720px;
}
.quiz-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  margin-bottom: 8px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--accent));
  border-radius: 99px;
  transition: width 0.4s ease;
}
.quiz-counter {
  font-size: 12.5px;
  color: var(--text-sub);
  margin-bottom: 28px;
  font-family: 'JetBrains Mono', monospace;
}
.quiz-q {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: 24px;
}
.quiz-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.quiz-opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--transition);
  background: var(--surface2);
  font-size: 14px;
  color: var(--text);
  text-align: left;
}
.quiz-opt:hover:not(.disabled) {
  border-color: var(--blue);
  background: #eff6ff;
}
.quiz-opt.correct  { border-color: #22c55e; background: #f0fdf4; color: #15803d; }
.quiz-opt.wrong    { border-color: #f43f5e; background: #fff1f2; color: #be123c; }
.quiz-opt.disabled { cursor: not-allowed; opacity: .75; }
.quiz-opt-letter {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--navy);
  flex-shrink: 0;
}
.quiz-opt.correct .quiz-opt-letter { background: #22c55e; border-color: #22c55e; color: #fff; }
.quiz-opt.wrong .quiz-opt-letter   { background: #f43f5e; border-color: #f43f5e; color: #fff; }

.quiz-feedback {
  display: none;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  line-height: 1.65;
  margin-bottom: 20px;
  animation: fadeSlide 0.25s ease;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.fb-correct { background: #f0fdf4; border-left: 4px solid #22c55e; color: #14532d; }
.quiz-feedback.fb-wrong   { background: #fff1f2; border-left: 4px solid #f43f5e; color: #881337; }

.btn-next-q {
  display: none;
  padding: 11px 24px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.btn-next-q:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,87,184,.3); }
.btn-next-q.show { display: inline-flex; align-items: center; gap: 6px; }

/* Quiz result */
.quiz-result { text-align: center; padding: 20px 0; display: none; }
.quiz-result.show { display: block; animation: fadeInUp 0.4s ease; }
.quiz-score-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 72px;
  line-height: 1;
  background: linear-gradient(135deg, var(--navy), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.quiz-score-label { font-size: 16px; color: var(--text-sub); margin-bottom: 24px; }
.quiz-result-bar { height: 12px; border-radius: 99px; background: var(--border); overflow: hidden; margin-bottom: 28px; }
.quiz-result-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 1s ease 0.3s;
}
.quiz-msg { font-size: 18px; font-weight: 600; color: var(--navy); margin-bottom: 24px; }
.btn-restart {
  padding: 12px 28px;
  background: var(--surface2);
  border: 2px solid var(--navy);
  color: var(--navy);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
}
.btn-restart:hover { background: var(--navy); color: #fff; }

/* ═══════════════════════════════════════════
   PAGE FOOTER NAV
═══════════════════════════════════════════ */
.page-footer {
  padding: 24px 56px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
  gap: 16px;
}
.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  border: 2px solid var(--navy);
}
.btn-nav-outline { background: transparent; color: var(--navy); }
.btn-nav-outline:hover { background: var(--navy); color: #fff; }
.btn-nav-fill { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-nav-fill:hover { background: var(--navy-mid); box-shadow: 0 4px 14px rgba(0,32,93,.3); }
.btn-nav:disabled, .btn-nav[disabled] { opacity: .35; cursor: not-allowed; pointer-events: none; }
.page-counter { font-size: 13px; color: var(--text-sub); font-family: 'JetBrains Mono', monospace; }

/* ═══════════════════════════════════════════
   MISC UTILITIES
═══════════════════════════════════════════ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
}
.tag-blue  { background: #dbeafe; color: #1d4ed8; }
.tag-green { background: #dcfce7; color: #15803d; }
.tag-amber { background: #fef3c7; color: #92400e; }
.tag-red   { background: #ffe4e6; color: #be123c; }
.tag-navy  { background: #e0e7ff; color: var(--navy); }

.highlight {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 60%, var(--accent) 100%);
  color: #fff;
  padding: 24px;
  border-radius: var(--r-md);
  margin-bottom: 24px;
}
.highlight-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  margin-bottom: 8px;
}
.highlight-text { font-size: 14px; color: rgba(255,255,255,.8); line-height: 1.7; }

.mono { font-family: 'JetBrains Mono', monospace; }

ul.styled, ol.styled { padding-left: 0; list-style: none; }
ul.styled li, ol.styled li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  line-height: 1.55;
}
ul.styled li:last-child, ol.styled li:last-child { border-bottom: none; }
ul.styled li::before {
  content: '▸';
  color: var(--blue);
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 3px;
}
ol.styled { counter-reset: ol-counter; }
ol.styled li { counter-increment: ol-counter; }
ol.styled li::before {
  content: counter(ol-counter);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Two-col layout */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 24px; }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 1024px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #sidebar-overlay.show { display: block; }
  #hamburger { display: flex; }
  #content { margin-left: 0; }
  .hero { padding: 48px 24px 36px; }
  .page-body { padding: 28px 24px; }
  .page-footer { padding: 20px 24px; }
  .cards-grid-3, .cards-grid-2 { grid-template-columns: 1fr 1fr; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .hero { padding: 64px 20px 28px; }
  .hero-title { font-size: 22px; }
  .page-body { padding: 20px 16px; }
  .page-footer { flex-wrap: wrap; padding: 16px; }
  .cards-grid, .cards-grid-3, .cards-grid-2 { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .flow-wrap { flex-direction: column; align-items: center; }
  .flow-step:not(:last-child)::after { content: '↓'; right: auto; top: auto; bottom: -14px; }
  .quiz-score-num { font-size: 52px; }
  .tabs-nav { gap: 4px; }
  .tab-btn { padding: 7px 12px; font-size: 12.5px; }
}
