:root{
  --bg:#070b12;
  --panel:#101722;
  --panel2:#131d2b;
  --line:#26364f;
  --text:#f7f8fb;
  --muted:#a7b3c7;
  --green:#31e981;
  --blue:#46a3ff;
  --purple:#b56cff;
}

*{box-sizing:border-box}

body{
  margin:0;
  background:radial-gradient(circle at top left,#102033,#070b12 45%);
  color:var(--text);
  font-family:Inter,Segoe UI,Arial,sans-serif;
}

.sidebar{
  position:fixed;
  inset:0 auto 0 0;
  width:230px;
  background:rgba(8,14,23,.94);
  border-right:1px solid var(--line);
  padding:24px 16px;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.brand{
  font-size:26px;
  font-weight:900;
  color:#fff;
}

.brand span{color:var(--green)}
.brand small{display:block;font-size:13px;color:var(--muted)}

.nav,.tab,button{cursor:pointer}

.nav{
  width:100%;
  border:0;
  background:transparent;
  color:var(--text);
  padding:14px 12px;
  border-radius:12px;
  text-align:left;
  font-weight:800;
}

.nav.active,.nav:hover{
  background:linear-gradient(135deg,#1ead62,#145734);
}

.profile{
  margin-top:auto;
  background:#101b2b;
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  display:grid;
  gap:6px;
}

.profile span{color:var(--muted);font-size:13px}

.app{
  margin-left:230px;
  min-height:100vh;
}

.hero{
  padding:36px 40px 22px;
  display:flex;
  justify-content:space-between;
  gap:24px;
  align-items:center;
  border-bottom:1px solid rgba(255,255,255,.06);
}

.eyebrow{
  color:var(--green);
  font-weight:900;
  letter-spacing:2px;
}

.hero h1{
  font-size:42px;
  line-height:1;
  margin:0 0 14px;
}

.hero p{color:#d7deeb}

.kpis{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  background:rgba(16,23,34,.88);
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  min-width:520px;
}

.kpis div{
  padding:20px;
  border-right:1px solid var(--line);
}

.kpis div:last-child{border-right:0}
.kpis span{display:block;color:var(--muted);font-size:13px}
.kpis b{font-size:24px}

.tabs{
  position:sticky;
  top:0;
  z-index:5;
  background:rgba(7,11,18,.88);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
  padding:14px 28px;
  display:flex;
  gap:10px;
}

.tab{
  background:#111a28;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:999px;
  padding:11px 18px;
  font-weight:800;
}

.tab.active{
  background:var(--green);
  color:#06100b;
}

.page{
  display:none;
  padding:26px 34px;
}

.page.active{display:block}

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

.toolbar h2{min-width:220px}

.toolbar button,
.notes button,
#saveTracking{
  border:1px solid var(--line);
  background:#101724;
  color:var(--text);
  border-radius:12px;
  padding:10px 14px;
  font-weight:800;
}

.ghost{margin-left:auto}

.layout{
  display:grid;
  grid-template-columns:1fr 520px;
  gap:22px;
}

.month-card,
.session-panel,
.card{
  background:linear-gradient(180deg,rgba(19,29,43,.96),rgba(12,18,29,.96));
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:0 20px 70px rgba(0,0,0,.25);
}

.month-card{padding:18px}

.weekdays,
.calendar-grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:8px;
}

.weekdays span{
  text-align:center;
  color:var(--muted);
  font-weight:800;
  padding:8px;
}

.day{
  min-height:96px;
  border-radius:16px;
  border:1px solid var(--line);
  background:#0e1623;
  color:var(--text);
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:space-between;
  padding:12px;
  text-align:left;
}

.day:hover{
  transform:translateY(-2px);
  border-color:var(--green);
}

.day b{font-size:19px}
.day small{color:var(--muted);font-weight:800}

.day.run{box-shadow:inset 0 0 0 1px rgba(70,163,255,.3)}
.day.gym{box-shadow:inset 0 0 0 1px rgba(181,108,255,.35)}
.day.foot{box-shadow:inset 0 0 0 1px rgba(49,233,129,.35)}
.day.rest{opacity:.75}

.legend{
  padding:16px 4px 0;
  color:var(--muted);
}

.dot{
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:50%;
  margin-left:10px;
}

.dot.run{background:var(--blue)}
.dot.gym{background:var(--purple)}
.dot.foot{background:var(--green)}
.dot.rest{background:#667085}

.session-panel{
  padding:22px;
  position:sticky;
  top:84px;
  height:max-content;
}

.session-head{
  border-left:5px solid var(--green);
  padding:4px 0 14px 16px;
}

.session-head.run{border-color:var(--blue)}
.session-head.gym{border-color:var(--purple)}
.session-head.foot{border-color:var(--green)}
.session-head.rest{border-color:#667085}

.session-head span{
  text-transform:capitalize;
  color:var(--muted);
}

.session-head b{
  display:block;
  font-size:18px;
}

.session-head h2{
  font-size:28px;
  margin:12px 0 8px;
}

.tip{
  background:rgba(49,233,129,.09);
  border:1px solid rgba(49,233,129,.25);
  padding:14px;
  border-radius:14px;
  margin:12px 0;
}

.checklist{
  display:grid;
  gap:12px;
  margin-top:18px;
}

.checklist label{
  display:flex;
  gap:12px;
  align-items:flex-start;
  background:#0b111b;
  border:1px solid rgba(255,255,255,.06);
  border-radius:12px;
  padding:13px;
}

.checklist input{
  width:20px;
  height:20px;
  accent-color:var(--green);
}

.notes{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  margin-top:16px;
}

.notes input,
.tracking-grid input{
  background:#0b111b;
  border:1px solid var(--line);
  border-radius:12px;
  color:var(--text);
  padding:13px;
}

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

.card{padding:22px}

.machine-icon{
  font-size:36px;
  width:64px;
  height:64px;
  border-radius:18px;
  background:rgba(49,233,129,.12);
  display:grid;
  place-items:center;
  margin-bottom:12px;
}

.machine p{
  color:#dbe4f3;
  line-height:1.55;
}

.protocol-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:18px;
}

.tracking-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:14px;
  max-width:700px;
}

.tracking-grid label{
  display:grid;
  gap:8px;
  color:var(--muted);
}

#trackingOutput{
  background:#0b111b;
  border:1px solid var(--line);
  border-radius:14px;
  padding:18px;
  margin-top:20px;
  max-width:700px;
}

@media(max-width:1100px){
  .sidebar{position:static;width:auto}
  .app{margin-left:0}
  .hero,.layout{grid-template-columns:1fr;display:grid}
  .kpis{min-width:0;grid-template-columns:repeat(2,1fr)}
  .session-panel{position:static}
  .hero h1{font-size:34px}
}

@media(max-width:700px){
  .page{padding:16px}
  .calendar-grid,.weekdays{gap:5px}
  .day{min-height:76px;padding:8px}
  .day small{font-size:10px}
  .kpis{grid-template-columns:1fr}
  .protocol-grid,.tracking-grid{grid-template-columns:1fr}
}
