
:root{
  --bg:#070b18;
  --panel:rgba(255,255,255,0.06);
  --panel2:rgba(255,255,255,0.04);
  --border:rgba(255,255,255,0.10);
  --text:rgba(255,255,255,0.92);
  --muted:rgba(255,255,255,0.68);
  --brand:#18c2d6;
  --btn:rgba(24,194,214,0.18);
  --shadow: 0 18px 60px rgba(0,0,0,0.45);
  --radius:18px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 30% 20%, rgba(24,194,214,0.18), transparent 55%),
              radial-gradient(900px 600px at 80% 70%, rgba(110,76,255,0.16), transparent 55%),
              var(--bg);
  color:var(--text);
}
a{color:inherit}
.header{
  padding:26px 18px 12px;
  text-align:center;
}
.header h1{
  margin:0;
  font-size:44px;
  letter-spacing:0.2px;
  color:var(--brand);
  font-weight:800;
}
.header p{margin:8px 0 0; color:var(--muted)}
.container{
  max-width:1280px;
  margin:0 auto;
  padding: 12px 18px 28px;
}
.shell{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap:18px;
  align-items:start;
}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.sidebar{padding:16px}
.sidebar h2{margin:4px 0 10px; font-size:18px}
.search{
  width:100%;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background:rgba(0,0,0,0.25);
  color:var(--text);
  outline:none;
}
.class-list{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height: 70vh;
  overflow:auto;
  padding-right:6px;
}
.btn-class{
  text-align:left;
  width:100%;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color:var(--text);
  cursor:pointer;
  transition: transform .08s ease, background .2s ease;
}
.btn-class:hover{transform: translateY(-1px); background: rgba(255,255,255,0.06)}
.btn-class.active{border-color: rgba(24,194,214,0.55); background: rgba(24,194,214,0.10)}
.main{padding:18px}
.topline{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center; justify-content:space-between;
}
.titleblock h2{margin:0; font-size:26px}
.titleblock .sub{color:var(--muted); margin-top:6px}
.metric-tabs{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.tab{
  padding:8px 10px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,0.04);
  cursor:pointer;
  font-size:13px;
}
.tab.active{border-color: rgba(24,194,214,0.55); background: rgba(24,194,214,0.10)}
.grid2{
  margin-top:16px;
  display:grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap:14px;
}
.panel{padding:14px}
.panel h3{margin:0 0 10px; font-size:16px}
.inputs{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
.field label{display:block; font-size:12px; color:var(--muted); margin-bottom:6px}
.field input{
  width:100%;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color:var(--text);
}
.actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}
.btn{
  padding:9px 12px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color:var(--text);
  cursor:pointer;
}
.btn.primary{background: var(--btn); border-color: rgba(24,194,214,0.45)}
.kpi{
  font-size:40px;
  font-weight:800;
  margin:4px 0 4px;
}
.small{color:var(--muted); font-size:13px}
.section{margin-top:12px}
.kv{
  display:grid;
  grid-template-columns: 110px 1fr;
  gap:10px;
  margin-top:8px;
}
.kv .k{color:var(--muted); font-size:12px}
.kv .v{font-size:13px; line-height:1.45}
.bullets{margin:8px 0 0 18px; color:var(--text)}
.bullets li{margin:6px 0; color:var(--text)}
@media (max-width: 980px){
  .shell{grid-template-columns:1fr}
  .grid2{grid-template-columns:1fr}
  .class-list{max-height: 240px}
}



/* Formula formatting */
#metricFormula{
  white-space: normal;
  word-break: break-word;
}
.formula-code{
  display:block;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:12px;
  background: rgba(0,0,0,0.18);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Tabs readability */
.metric-tabs{
  gap:10px;
  flex-wrap: wrap;
}
.metric-tabs .tab{
  padding:10px 12px;
  font-size: 13px;
  line-height: 1.2;
  white-space: normal;
  text-align:left;
  min-height: 40px;
}
.metric-tabs .tab.active{
  box-shadow: 0 0 0 1px rgba(0, 255, 255, 0.35) inset;
}

/* Dashboard */
.dashboard .ts{
  width:100%;
  min-height: 120px;
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.35;
}
.dashboard .chart{
  width: 100%;
  border-radius: 14px;
  background: rgba(0,0,0,0.10);
  border: 1px solid rgba(255,255,255,0.06);
}
.muted{ color: var(--muted); }

/* Print only metric panel */
@media print{
  body{ background:#fff !important; color:#000 !important; }
  .sidebar, #classSearch, .metric-tabs, .dashboard{ display:none !important; }
  .container, .shell, .main{ box-shadow:none !important; }
  .card{ background:#fff !important; border:1px solid #ddd !important; }
  .btn, .actions{ display:none !important; }
}
