.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  backdrop-filter: blur(14px);
  background: rgba(5, 6, 12, 0.55);
  border-bottom: 1px solid var(--panel-border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 2px; }
.logo-dot { width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent), var(--accent-2)); }
.nav { display: flex; gap: 22px; color: var(--text-dim); font-size: 14px; }
.nav a { position: relative; padding: 4px 2px; color: var(--text-dim);
  transition: color .2s ease; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 2px; border-radius: 2px; transform: scaleX(0); transform-origin: center;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: transform .25s ease; }
.nav a.active, .nav a:hover, .nav a:focus-visible { color: var(--text); }
.nav a.active::after, .nav a:hover::after { transform: scaleX(1); }
.status-pill { display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--panel-border);
  background: var(--panel); color: var(--text-dim); }

.layout { max-width: 1200px; margin: 0 auto; padding: 28px; }

.hero { position: relative; display: grid; place-items: center;
  min-height: 460px; margin-bottom: 12px; }
.planet-canvas { width: 100%; max-width: 720px; height: 460px; display: block; }
.hero-caption { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; }
.hero-caption h1 { font-size: 30px; }
.hero-caption p { color: var(--text-dim); margin-top: 6px; }

.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px; margin: 24px 0; }
.metric { position: relative; padding: 18px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--panel-border); box-shadow: var(--shadow); overflow: hidden;
  transition: transform .25s ease, border-color .25s ease; }
.metric:hover { transform: translateY(-3px); border-color: rgba(120, 140, 255, 0.38); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric .label { color: var(--text-dim); font-size: 13px; }
.metric .value { font-size: 30px; font-weight: 700; margin-top: 8px; line-height: 1;
  font-variant-numeric: tabular-nums; }
.metric .value .unit { font-size: 15px; color: var(--text-dim); margin-left: 3px; font-weight: 600; }
.metric .spark-wrap { margin-top: 12px; height: 38px; }

.trend { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  white-space: nowrap; }
.trend.up { color: var(--ok); background: rgba(56,232,160,.13); }
.trend.down { color: var(--accent-3); background: rgba(255,92,168,.13); }

/* ---- Графики и панели ---- */
.charts { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin: 8px 0 4px; }
.panel { padding: 18px 20px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--panel-border); box-shadow: var(--shadow); }
.panel-wide { grid-column: 1 / -1; }
#panel-throughput { grid-column: 1; grid-row: 1; }
#panel-resources { grid-column: 2; grid-row: 1; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.panel-sub { color: var(--text-dim); font-size: 13px; margin-top: 4px; }
.panel-sub .big { font-size: 24px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; }
.live-tag { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--accent); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(56,232,208,.7); animation: pulse-teal 1.8s infinite; }

.area-host { width: 100%; height: 220px; }
.area-svg { width: 100%; height: 100%; display: block; }
.grid-line { stroke: rgba(255,255,255,0.05); stroke-width: 1; }
.area-stroke { filter: drop-shadow(0 0 6px rgba(56,232,208,.35)); }
.area-fill, .area-stroke { transition: d .9s cubic-bezier(.4,0,.2,1); }
.area-head { filter: drop-shadow(0 0 6px rgba(255,255,255,.8)); }

.donut-row { display: flex; align-items: center; gap: 16px; }
.donut-host { width: 160px; flex: 0 0 160px; }
.donut-svg { width: 100%; height: auto; display: block; }
.donut-seg { transition: stroke-dasharray .8s cubic-bezier(.4,0,.2,1),
  stroke-dashoffset .8s cubic-bezier(.4,0,.2,1); }
.donut-total { fill: var(--text); font-size: 26px; font-weight: 700; }
.donut-sub { fill: var(--text-dim); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; flex: 1; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.legend .lg-label { color: var(--text-dim); }
.legend .lg-val { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

.gauge-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.gauge { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gauge-host { width: 110px; }
.gauge-svg { width: 100%; height: auto; display: block; }
.gauge-val { transition: stroke-dasharray .8s cubic-bezier(.4,0,.2,1), stroke .4s ease; }
.gauge-num { font-size: 26px; font-weight: 700; }
.gauge-label { color: var(--text-dim); font-size: 12px; text-align: center; }

.section-title { font-size: 18px; margin: 28px 0 16px; color: var(--text); }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { padding: 18px; border-radius: var(--radius); background: var(--panel);
  border: 1px solid var(--panel-border); box-shadow: var(--shadow);
  transition: transform .25s ease, border-color .25s ease; }
.card:hover { transform: translateY(-4px); border-color: rgba(120, 140, 255, 0.4); }
.card .card-head { display: flex; align-items: center; justify-content: space-between; }
.card .card-name { font-weight: 600; }
.card .badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; }
.badge.ok { background: rgba(56,232,160,.15); color: var(--ok); }
.badge.warn { background: rgba(255,207,92,.15); color: var(--warn); }
.badge.err { background: rgba(255,107,107,.15); color: var(--err); }
.card .desc { color: var(--text-dim); font-size: 13px; margin: 10px 0 8px; }
.card-spark { height: 34px; margin: 4px 0 12px; }
.card-stats { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-stats > div { display: flex; flex-direction: column; gap: 2px; }
.card-stats .s-val { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.card-stats .s-lbl { color: var(--text-dim); font-size: 11px; }
.bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.06); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .8s cubic-bezier(.4,0,.2,1); }

.activity-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.activity-feed li { display: flex; gap: 12px; align-items: center; padding: 12px 16px;
  border-radius: 12px; background: var(--panel); border: 1px solid var(--panel-border);
  border-left: 3px solid var(--text-dim); }
.activity-feed li.kind-ok { border-left-color: var(--ok); }
.activity-feed li.kind-warn { border-left-color: var(--warn); }
.activity-feed li.kind-err { border-left-color: var(--err); }
.activity-feed .ai-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
  background: currentColor; }
.activity-feed li.kind-ok .ai-dot { color: var(--ok); }
.activity-feed li.kind-warn .ai-dot { color: var(--warn); }
.activity-feed li.kind-err .ai-dot { color: var(--err); }
.activity-feed .ai-text { color: var(--text); font-size: 14px; }
.activity-feed .t { color: var(--text-dim); font-size: 12px; margin-left: auto; white-space: nowrap; }

@media (max-width: 920px) {
  .charts { grid-template-columns: 1fr; }
  #panel-throughput, #panel-resources { grid-column: 1; grid-row: auto; }
}
@media (max-width: 720px) {
  /* Топбар переносит навигацию под бренд и статус. */
  .topbar { flex-wrap: wrap; gap: 10px 16px; padding: 12px 18px; }
  .nav { order: 3; flex-basis: 100%; gap: 18px; overflow-x: auto;
    padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .status-pill { margin-left: auto; }
}
@media (max-width: 640px) {
  .hero { min-height: 360px; }
  .planet-canvas { height: 340px; }
  .layout { padding: 18px; }
  .hero-caption h1 { font-size: 24px; }
  .donut-row { flex-direction: column; align-items: stretch; }
  .donut-host { align-self: center; }
  .metrics { gap: 12px; margin: 18px 0; }
  .metric .value { font-size: 26px; }
}
@media (max-width: 420px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric .spark-wrap { display: none; }
  .planet-canvas { height: 280px; }
  .brand { letter-spacing: 1px; font-size: 14px; }
  .section-title { margin: 22px 0 12px; }
}
