.app {
  display: grid;
  grid-template-columns: 244px 1fr;
  gap: 34px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 34px 24px 70px;
}

.nav__links--static { display: flex; }

.app__side {
  position: sticky;
  top: 96px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 18px 16px;
}
.app__side-title {
  color: var(--muted-2);
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: .66rem;
  margin: 0 0 14px 10px;
}
.side-nav { display: grid; gap: 3px; }
.side-nav__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: .9rem;
  transition: background .2s ease, color .2s ease;
}
.side-nav__item:hover { background: rgba(56, 189, 248, .07); color: #fff; }
.side-nav__item.is-active {
  background: linear-gradient(100deg, rgba(56, 189, 248, .16), rgba(99, 102, 241, .08));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .32);
}
.side-nav__count {
  font-family: var(--mono);
  font-size: .68rem;
  font-style: normal;
  color: var(--brand);
  background: rgba(56, 189, 248, .12);
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 999px;
  padding: 2px 8px;
}
.app__side-foot {
  margin-top: 18px;
  padding: 14px 12px 4px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  line-height: 1.9;
  font-size: .7rem;
}

.app__main { min-width: 0; }
.app__head {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 26px;
}
.app__head h1 { font-size: 1.7rem; margin-bottom: 6px; }
.app__sub { color: var(--muted-2); }
.app__head-actions { display: flex; align-items: center; gap: 12px; }

.kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, .55), transparent);
}
.kpi__label { display: block; font-size: .78rem; color: var(--muted-2); margin-bottom: 10px; }
.kpi__val { display: block; font-size: 1.72rem; letter-spacing: -.03em; }
.kpi__val small { font-size: .85rem; color: var(--muted); font-weight: 500; }
.kpi__sub { color: var(--muted-2); font-size: .68rem; }

.app__cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; margin-bottom: 18px; }
.app__cols--three { grid-template-columns: repeat(3, 1fr); }
.app__panel { margin-bottom: 0; }
.app__cols--three .app__panel { height: 100%; }

.chart { position: relative; padding: 18px; height: 200px; }
.chart__grid {
  position: absolute;
  inset: 18px;
  background-image: linear-gradient(rgba(148, 178, 220, .1) 1px, transparent 1px);
  background-size: 100% 25%;
  border-radius: 6px;
}
.chart__svg { position: relative; width: 100%; height: 100%; overflow: visible; }

.routes { display: grid; gap: 14px; padding: 18px; }
.routes li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; color: var(--muted); }
.routes .meter__bar { grid-column: 1 / -1; }

.meter__bar i { transition: width .8s cubic-bezier(.2, .8, .2, 1); }

.table--wide .table__row { grid-template-columns: 1.15fr 1fr .8fr 1.05fr .9fr .85fr .9fr; }
.table--wide .table__row > span { min-width: 0; }
.btn--tiny {
  padding: 5px 11px;
  font-size: .74rem;
  border-radius: 999px;
}
.row-actions { display: flex; gap: 6px; }
.row-actions button {
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.row-actions button:hover { border-color: var(--brand); color: #fff; background: rgba(56, 189, 248, .12); }
.row-actions button[data-act="stop"]:hover { border-color: #f87171; color: #fca5a5; background: rgba(248, 113, 113, .1); }

.flash { animation: flash .9s ease; }
@keyframes flash {
  0% { background: rgba(56, 189, 248, .22); }
  100% { background: transparent; }
}

.keylist { display: grid; gap: 12px; padding: 18px; }
.keylist li { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); }
.usage { display: grid; gap: 16px; padding: 18px; }
.usage > div { display: grid; gap: 8px; }
.usage .mono { color: var(--muted-2); font-size: .72rem; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .app__cols { grid-template-columns: 1fr; }
  .app__cols--three { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .app__side { position: static; }
  .side-nav { grid-template-columns: repeat(2, 1fr); }
  .table--wide .table__row { grid-template-columns: 1fr .9fr .8fr; }
  .table--wide .table__row > *:nth-child(2),
  .table--wide .table__row > *:nth-child(4) { display: none; }
  .nav__links--static a:not(.btn) { display: none; }
}

@media (max-width: 620px) {
  .kpis, .app__cols--three, .side-nav { grid-template-columns: 1fr; }
}
