:root{
  --bg:#0c111b;
  --card:#121a2a;
  --card2:#0f1626;
  --text:#e7eefc;
  --muted:#a9b6d6;
  --line:rgba(255,255,255,.10);
  --accent:#7aa2ff;
  --ok:#35d39a;
  --warn:#ffc857;
  --bad:#ff6b6b;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1100px 520px at 20% 0%, rgba(122,162,255,.15), transparent 50%),
              radial-gradient(900px 520px at 90% 30%, rgba(53,211,154,.10), transparent 45%),
              var(--bg);
  color:var(--text);
}

.topbar{
  display:flex; gap:18px; align-items:center; justify-content:space-between;
  padding:16px 18px; border-bottom:1px solid var(--line);
  position:sticky; top:0; backdrop-filter: blur(10px);
  background: rgba(12,17,27,.75);
  z-index:10;
}

.brand{display:flex; gap:12px; align-items:center}
.logo{font-size:30px}
.title{font-weight:800; letter-spacing:.2px}
.subtitle{color:var(--muted); font-size:13px; margin-top:2px}

.userbox{min-width:320px}
.small{display:block; font-size:12px; color:var(--muted); margin-bottom:6px}
.row-inline{display:flex; gap:10px}
.input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
  color:var(--text);
  outline:none;
}

.statusline{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px}
.pill{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
}
.pill-ok{border-color: rgba(53,211,154,.5)}
.pill-warn{border-color: rgba(255,200,87,.55)}
.pill-bad{border-color: rgba(255,107,107,.55)}

.layout{
  max-width:1150px;
  margin:18px auto;
  padding:0 14px 24px;
  display:grid;
  gap:14px;
  grid-template-columns: 1fr;
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  box-shadow: 0 10px 35px rgba(0,0,0,.25);
}

.card-head{padding:14px 16px 8px}
.card-head h2{margin:0 0 6px 0}
.card-head h3{margin:0 0 6px 0}
.muted{color:var(--muted)}
.tiny{font-size:12px}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  padding:0 16px 16px;
}
@media (max-width: 980px){
  .grid2{grid-template-columns:1fr}
  .userbox{min-width:260px}
}

.viz{
  background: rgba(0,0,0,.12);
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
}
.legend{display:flex; gap:14px; flex-wrap:wrap; color:var(--muted); font-size:12px; margin-top:10px}
.dot{display:inline-block; width:10px; height:10px; border-radius:999px; margin-right:6px; vertical-align:middle}
.dot-now{background: var(--accent)}
.dot-prev{background: rgba(255,255,255,.45)}

.kpi-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap:10px;
}
.kpi{
  background: rgba(0,0,0,.12);
  border:1px solid var(--line);
  border-radius:16px;
  padding:10px 12px;
}
.kpi .k{font-size:12px; color:var(--muted)}
.kpi .v{font-size:18px; font-weight:800; margin-top:2px}
.kpi .h{font-size:12px; color:var(--muted); margin-top:6px; line-height:1.25}

.note{
  margin-top:12px;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(255,255,255,.06);
  border:1px dashed rgba(255,255,255,.15);
  color:var(--muted);
  line-height:1.35;
}

.controls{padding:0 16px 16px}
.textarea{
  width:100%;
  resize:vertical;
  border-radius:16px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
  color:var(--text);
  padding:12px;
  outline:none;
  min-height:120px;
}

.actions{display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-top:12px}
.btn{
  border:none;
  border-radius:14px;
  padding:10px 12px;
  background: var(--accent);
  color:#081022;
  font-weight:800;
  cursor:pointer;
}
.btn:hover{filter:brightness(1.05)}
.btn:active{transform:translateY(1px)}
.btn-ghost{
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
  color:var(--text);
  font-weight:700;
}

.divider{height:1px; background:var(--line); margin:0 16px}

.analysis{padding:12px 16px 16px}
.analysis h3{margin:0 0 8px 0}
.analysis .box{
  background: rgba(0,0,0,.12);
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  margin-top:10px;
}
.tags{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px}
.tag{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
  color:var(--muted);
}
.bargrid{display:grid; gap:8px; margin-top:10px}
.barrow{display:grid; grid-template-columns: 160px 1fr 56px; align-items:center; gap:10px}
@media (max-width: 520px){
  .barrow{grid-template-columns:1fr}
}
.meter{
  height:10px; border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
  position:relative;
  overflow:hidden;
}
.meter > span{
  display:block; height:100%;
  background: linear-gradient(90deg, rgba(122,162,255,.85), rgba(53,211,154,.85));
  width:50%;
}
.meter .zero{
  position:absolute; top:-2px; bottom:-2px; width:2px;
  left:50%;
  background: rgba(255,255,255,.45);
}
.num{text-align:right; font-variant-numeric: tabular-nums; color:var(--muted); font-size:12px}

.log{padding:0 16px 16px}
.entry{
  background: rgba(0,0,0,.12);
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  margin-top:10px;
}
.entry b{color:var(--text)}
.entry .meta{color:var(--muted); font-size:12px; margin-top:4px}
.entry .text{margin-top:8px; line-height:1.35}
.entry .smallgrid{display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:8px; margin-top:10px}
.smallpill{
  font-size:12px; padding:8px 10px; border-radius:14px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
  color:var(--muted);
}
.footer{max-width:1150px; margin:0 auto; padding:0 14px 18px}

