:root{
  --bg0:#0b1220;
  --bg1:#0f1a30;
  --card: rgba(255,255,255,.06);
  --card2: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.70);
  --border: rgba(255,255,255,.12);
  --shadow: 0 18px 50px rgba(0,0,0,.35);
  --accent:#7c3aed;
  --accent2:#22c55e;
  --warn:#f59e0b;
  --danger:#ef4444;
  --codeBg: rgba(0,0,0,.28);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 10%, rgba(124,58,237,.28), transparent 60%),
              radial-gradient(900px 500px at 80% 20%, rgba(34,197,94,.18), transparent 50%),
              linear-gradient(180deg, var(--bg0), var(--bg1));
  color: var(--text);
}

.bg{
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.08) 1px, transparent 0);
  background-size: 22px 22px;
  opacity: .25;
}

.container{max-width: 1120px; margin: 0 auto; padding: 0 18px;}

.topbar{
  position: sticky; top:0; z-index: 30;
  backdrop-filter: blur(10px);
  background: rgba(11,18,32,.55);
  border-bottom: 1px solid var(--border);
}
.topbar__inner{display:flex; align-items:center; justify-content:space-between; padding: 14px 0;}
.brand{display:flex; align-items:center; gap:12px; text-decoration:none; color: var(--text); font-weight: 700; letter-spacing: .2px;}
.brand__logo{font-size: 22px; filter: drop-shadow(0 8px 14px rgba(124,58,237,.25));}
.brand__text{font-size: 15px}
.topbar__meta{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end;}
.pill{
  font-size: 12px;
  color: rgba(255,255,255,.82);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  padding: 6px 10px;
  border-radius: 999px;
}

.layout{display:grid; grid-template-columns: 260px 1fr; gap: 18px; padding: 18px 0 28px;}
.sidebar{
  position: sticky; top: 74px;
  align-self: start;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
}
.sidebar__title{font-weight:700; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.75); margin: 6px 6px 10px;}
.nav{display:flex; flex-direction:column; gap:8px;}
.nav__link{
  display:block;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration:none;
  color: rgba(255,255,255,.86);
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease;
}
.nav__link:hover{background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10)}
.nav__link--active{background: rgba(124,58,237,.20); border-color: rgba(124,58,237,.35)}
.nav__sep{height:1px; background: rgba(255,255,255,.10); margin: 6px 0;}

.sidebar__box{margin-top: 14px; padding: 12px; border-radius: 14px; background: rgba(0,0,0,.20); border: 1px solid rgba(255,255,255,.10)}
.sidebar__boxTitle{font-weight:700; margin-bottom: 6px}

.content{
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
}

h1{font-size: 26px; margin: 10px 0 8px}
h2{font-size: 18px; margin: 18px 0 8px}
h3{font-size: 15px; margin: 14px 0 8px; color: rgba(255,255,255,.90)}

p{line-height: 1.65; color: rgba(255,255,255,.86)}
.muted{color: var(--muted)}

.grid{display:grid; grid-template-columns: repeat(12, 1fr); gap: 14px;}
.col-12{grid-column: span 12}
.col-8{grid-column: span 8}
.col-6{grid-column: span 6}
.col-4{grid-column: span 4}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.20);
}
.card--gradient{
  background: linear-gradient(180deg, rgba(124,58,237,.14), rgba(255,255,255,.04));
}
.card__title{font-weight:700; margin: 0 0 8px}

.badge{display:inline-flex; align-items:center; gap:8px; padding: 6px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); font-size: 12px; color: rgba(255,255,255,.85)}
.badge--ok{border-color: rgba(34,197,94,.30); background: rgba(34,197,94,.10)}
.badge--warn{border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.12)}
.badge--danger{border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.12)}

pre, code{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;}
code{background: rgba(0,0,0,.25); padding: 2px 6px; border-radius: 8px; border: 1px solid rgba(255,255,255,.08);}
pre{
  background: var(--codeBg);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 12px;
  overflow:auto;
  line-height: 1.55;
}

.kpi{display:flex; align-items:baseline; justify-content:space-between; gap:10px}
.kpi__value{font-size: 22px; font-weight: 800}
.kpi__label{color: rgba(255,255,255,.70); font-size: 12px}

.chartWrap{height: 320px}
.chartWrap--sm{height: 260px}
.chartWrap canvas{width:100% !important; height:100% !important}

.exercise{display:grid; grid-template-columns: repeat(12, 1fr); gap: 14px; align-items:end}
.field{grid-column: span 4; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.10); border-radius: 16px; padding: 12px}
.field label{display:block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.78); margin-bottom: 8px}
.field input[type="number"],
.field input[type="text"]{
  width: 100%;
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.92);
  border-radius: 12px;
  padding: 10px 10px;
  outline: none;
}
.field input[type="range"]{width:100%}
.help{margin-top: 8px; font-size: 12px; color: rgba(255,255,255,.65); line-height: 1.35}
.callout{
  grid-column: span 12;
  background: linear-gradient(180deg, rgba(34,197,94,.12), rgba(255,255,255,.04));
  border: 1px solid rgba(34,197,94,.22);
  border-radius: 16px;
  padding: 12px;
  color: rgba(255,255,255,.86);
}

.footer{margin-top: 18px; border-top: 1px solid var(--border); background: rgba(11,18,32,.55);}
.footer__inner{display:flex; justify-content:space-between; align-items:flex-start; gap: 12px; padding: 18px 0;}
.footer__title{font-weight:800}

@media (max-width: 980px){
  .layout{grid-template-columns: 1fr}
  .sidebar{position: relative; top: 0}
  .topbar__meta{display:none}
  .field{grid-column: span 12}
}

a{color: rgba(167,139,250,.95)}
a:hover{color: rgba(196,181,253,.95)}

.table{width:100%; border-collapse:separate; border-spacing:0; overflow:hidden; border-radius: 16px; border: 1px solid rgba(255,255,255,.12)}
.table th,.table td{padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.10); vertical-align:top}
.table th{background: rgba(255,255,255,.06); text-align:left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.80)}
.table tr:last-child td{border-bottom:none}

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity .2s;
  border: 1px solid rgba(255,255,255,.1);
}
.btn:hover{opacity:.9; color:#fff}
