:root{
  --bg:#0b1220;
  --card:#121b2e;
  --border:#223255;
  --text:#e7eefc;
  --muted:#9fb0d0;
  --shadow: 0 10px 30px rgba(0,0,0,.30);
}

*{ box-sizing:border-box; }
body{
  margin:0;
  background: radial-gradient(1200px 600px at 10% -10%, #1a2b55 0%, rgba(26,43,85,0) 60%),
              radial-gradient(1000px 500px at 110% 0%, #2b1a55 0%, rgba(43,26,85,0) 55%),
              var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell;
}

.wrap{
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom: 14px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.logo{
  width:44px; height:44px;
  border-radius:14px;
  background: linear-gradient(135deg, #3a72ff, #9a57ff);
  box-shadow: var(--shadow);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  letter-spacing: .6px;
}

.titleRow{
  display:flex;
  align-items:center;
  gap:10px;
}

.mslogo{
  height: 26px;
  width: auto;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  padding: 3px 6px;
}

.title{ font-size:22px; font-weight:900; letter-spacing:.3px; }
.subtitle{ font-size:12px; color:var(--muted); margin-top:4px; }

.statusBox{
  text-align:right;
  min-width: 340px;
}

.badgeRow{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
  margin-bottom:6px;
}

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  font-weight:900;
  letter-spacing:.5px;
  white-space:nowrap;
}

.badge .lbl{
  opacity: .85;
  font-weight: 900;
  letter-spacing: .3px;
}

.badge .dot{
  width:10px; height:10px;
  border-radius:999px;
  display:inline-block;
}

.badge.up{ background:#102d1c; border-color:#2a7a45; color:#c9ffe0; }
.badge.up .dot{ background:#41d97a; }

.badge.down{ background:#3b0f14; border-color:#a33a46; color:#ffd1d7; }
.badge.down .dot{ background:#ff5d6c; }

.badge.unk{ background:#1b1f2a; border-color:#4a5676; color:#e8eeff; }
.badge.unk .dot{ background:#9fb0d0; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}

.card{
  background: rgba(18,27,46,0.90);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.span2{ grid-column: span 2; }

.cardHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}

.cardTitle{
  font-size: 15px;
  font-weight: 900;
  color: #d7e4ff;
}

.small{ font-size: 12px; }
.muted{ color: var(--muted); }

.big{
  font-size: 34px;
  font-weight: 950;
  margin-top: 8px;
}

.mid{
  font-size: 18px;
  font-weight: 900;
}

.traffic{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.pill{
  flex: 1 1 220px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(10,18,36,0.6);
}

.table{
  margin-top: 10px;
  width: 100%;
  overflow:auto;
  border:1px solid var(--border);
  border-radius: 14px;
}

.row{
  display:grid;
  grid-template-columns: 80px 210px 210px 110px 1fr;
  gap:10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.row.head{
  border-top: none;
  background: rgba(10,18,36,0.8);
  font-weight: 900;
  color:#cfe0ff;
}

.reason{ font-size: 12px; line-height: 1.25; color:#dbe7ff; }

.mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

.iftop{
  margin:0;
  max-height: 360px;
  overflow:auto;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  background: rgba(10,18,36,0.65);
  color: #e7eefc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.25;
}

.btn{
  background: rgba(58,114,255,0.15);
  border: 1px solid rgba(58,114,255,0.45);
  color: #dbe7ff;
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 800;
  cursor:pointer;
}
.btn:hover{ background: rgba(58,114,255,0.25); }

@media (max-width: 900px){
  .topbar{ flex-direction:column; align-items:flex-start; }
  .statusBox{ text-align:left; min-width:auto; }
  .badgeRow{ justify-content:flex-start; }
  .grid{ grid-template-columns: 1fr; }
  .span2{ grid-column: span 1; }
  .row{ grid-template-columns: 70px 1fr; }
  .row > div:nth-child(2),
  .row > div:nth-child(3),
  .row > div:nth-child(4),
  .row > div:nth-child(5){ grid-column: 2; }
}
