:root {
  --bg: #0a0b0f;
  --bg2: #0e1016;
  --panel: #14171f;
  --panel2: #191d27;
  --line: #232834;
  --line2: #2c333f;
  --text: #eef1f7;
  --muted: #8a94a8;
  --accent: #7c9dff;
  --accent2: #a78bfa;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --r: 16px;
  --shadow: 0 10px 40px rgba(0,0,0,.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(124,157,255,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(167,139,250,.10), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
button { font: inherit; cursor: pointer; border: none; border-radius: 11px; transition: .15s ease; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.4px; }

/* LOGIN */
.login { min-height: 100vh; display: grid; place-items: center; }
.login-card {
  width: min(380px, 92vw); background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line); border-radius: 22px; padding: 40px 30px; text-align: center; box-shadow: var(--shadow);
}
.logo-lg { font-weight: 800; font-size: 30px; letter-spacing: -1px; }
.logo-lg span, .logo span { color: var(--accent); }
.login-card input {
  width: 100%; margin: 20px 0 12px; padding: 13px 15px; background: var(--panel2);
  border: 1px solid var(--line2); color: var(--text); border-radius: 12px; outline: none; font-size: 15px;
}
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,157,255,.15); }
.btn-primary { width: 100%; padding: 13px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #07101f; font-weight: 700; }
.btn-primary:hover { filter: brightness(1.07); }
.err { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 16px; }

/* APP LAYOUT */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo { font-weight: 800; font-size: 22px; letter-spacing: -.5px; padding: 4px 10px 18px; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px;
  background: transparent; color: var(--muted); text-align: left; font-weight: 500;
}
.nav-item i { font-style: normal; width: 20px; text-align: center; opacity: .8; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line2); }
.side-foot { display: flex; flex-direction: column; gap: 10px; padding: 12px 6px 4px; border-top: 1px solid var(--line); }
.sync { display: flex; align-items: center; gap: 8px; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.btn-ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line2); padding: 9px 14px; }
.btn-ghost:hover { border-color: var(--accent); color: #fff; }
.btn-ghost.small { padding: 7px 10px; font-size: 13px; }

.main { padding: 26px 30px 60px; max-width: 1200px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; gap: 16px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -20px; top: -20px; width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle, rgba(124,157,255,.16), transparent 70%); }
.kpi .n { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.kpi .l { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; margin-top: 6px; }

/* CARDS */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.card { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #07101f; font-size: 18px; }
.card-head .who { font-weight: 700; font-size: 16px; }
.card-head .st { font-size: 12px; }
.st.on { color: var(--good); } .st.off { color: var(--bad); }
.row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row .v { font-weight: 700; }
.row .v.hot { color: var(--accent); }

/* BARS */
.panel-block { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.bars { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 40px; align-items: center; gap: 12px; }
.bar-track { background: var(--panel2); border-radius: 7px; height: 20px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bar-fill { background: linear-gradient(90deg, var(--accent), var(--accent2)); height: 100%; width: 0; border-radius: 7px; transition: width .5s ease; }

.empty { color: var(--muted); padding: 40px; text-align: center; border: 1px dashed var(--line2); border-radius: var(--r); line-height: 1.7; }
h2 { margin: 0 0 4px; font-size: 17px; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; }
  .sidebar .logo { padding: 4px 8px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item span { display: none; }
  .side-foot { flex-direction: row; border: none; margin-left: auto; }
  .main { padding: 18px; }
}
