:root{
  --bg:#0b1220; --panel:#101a33; --panel2:#0f1a2f;
  --text:#e8f0ff; --muted:#9bb0d6; --line:#223458;
  --brand:#3ddc97; --info:#7aa2ff; --warn:#ffd166; --bad:#ff5c7a;
  --radius:16px; --shadow:0 10px 30px rgba(0,0,0,.35);
  --mono: ui-monospace, Consolas, monospace;
  --sans: system-ui, Segoe UI, Arial;
}

*{box-sizing:border-box}
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:var(--sans); line-height:1.55;
}

/* LAYOUT */
.course-layout{
  max-width:1200px; margin:auto; padding:18px;
  display:grid; grid-template-columns: 320px 1fr; gap:16px;
}
@media(max-width: 900px){
  .course-layout{grid-template-columns:1fr}
}

/* SIDEBAR */
.sidebar{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:14px;
  position: sticky;
  top: 14px;
  height: calc(100vh - 28px);
  overflow:auto;
}
@media(max-width: 900px){
  .sidebar{position:relative; height:auto}
}

.sidebar .brand{
  display:flex; gap:12px; align-items:center;
  padding:10px; border:1px solid var(--line);
  background:var(--panel2); border-radius:14px;
}
.sidebar .brand-badge{
  width:44px; height:44px; border-radius:12px;
  display:grid; place-items:center;
  background:rgba(61,220,151,.12);
  color:var(--brand); font-weight:800;
}
.sidebar .brand-title{font-weight:800}
.sidebar .brand-sub{color:var(--muted); font-size:12px; margin-top:2px}

.sidebar h3{
  margin:14px 0 8px; font-size:13px; color:var(--muted);
}

/* PROGRESSO */
.progress{
  border:1px solid var(--line);
  background:var(--panel2);
  border-radius:14px;
  padding:10px;
}
.progress-top{
  display:flex; justify-content:space-between; align-items:center;
  font-size:12px; color:var(--muted);
}
.progress-bar{
  height:10px; border-radius:999px; margin-top:8px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.06);
  overflow:hidden;
}
.progress-bar > div{
  height:100%;
  width:0%;
  background:var(--brand);
  border-radius:999px;
}

/* LINKS DO MENU */
.menu a{
  display:flex; justify-content:space-between; gap:10px;
  text-decoration:none; color:var(--text);
  padding:10px; border-radius:12px;
  border:1px solid transparent;
}
.menu a:hover{background:var(--panel2); border-color:var(--line)}
.menu a.active{background:rgba(122,162,255,.12); border-color:rgba(122,162,255,.35)}
.menu a.done .tag{background:rgba(61,220,151,.14); color:var(--brand); border-color:rgba(61,220,151,.35)}
.tag{
  font-size:11px; padding:3px 8px; border-radius:999px;
  border:1px solid var(--line); background:var(--panel2); color:var(--muted);
}

/* CONTENT */
.content{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
}
.content header{
  background:linear-gradient(180deg,var(--panel),transparent);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
  margin-bottom:14px;
}
.content header h1{margin:0; font-size:20px}
.content header p{margin:6px 0 0; color:var(--muted); font-size:13px}

.card,.note,.info,.danger,.ascii{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px; margin:10px 0;
  background:var(--panel2);
}
.note{border-left:4px solid var(--warn)}
.info{border-left:4px solid var(--info)}
.danger{border-left:4px solid var(--bad)}
.ascii{font-family:var(--mono); font-size:12.5px; white-space:pre; overflow:auto}

/* NAV (Anterior/Próxima) */
.nav-nextprev{
  display:flex; gap:10px; justify-content:space-between; flex-wrap:wrap;
  border-top:1px dashed var(--line);
  padding-top:14px; margin-top:18px;
}
.nav-btn{
  flex:1;
  min-width: 220px;
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--panel2);
  color:var(--text);
  text-decoration:none;
  font-weight:700;
}
.nav-btn:hover{filter:brightness(1.05)}
.nav-btn small{display:block; color:var(--muted); font-weight:600; margin-top:4px}
.nav-btn.primary{
  border-color:rgba(61,220,151,.35);
  background:rgba(61,220,151,.10);
}