:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: rgba(22, 24, 30, .74);
  --panel-2: rgba(255,255,255,.055);
  --line: rgba(255,255,255,.14);
  --line-strong: rgba(255,255,255,.24);
  --text: #f7f6f1;
  --muted: rgba(247,246,241,.62);
  --muted-2: rgba(247,246,241,.44);
  --accent: #ffb84d;
  --cyan: #70efff;
  --green: #7dffb0;
  --red: #ff766d;
  --blue: #8fb9ff;
  --violet: #c69aff;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body.monitor-page {
  margin: 0;
  min-height: 100svh;
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(112,239,255,.14), transparent 30%),
    radial-gradient(circle at 86% 6%, rgba(198,154,255,.16), transparent 31%),
    radial-gradient(circle at 70% 92%, rgba(255,184,77,.10), transparent 26%),
    linear-gradient(140deg, #08090d 0%, #11141b 50%, #09080d 100%);
}

.monitor-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .38;
  background-image:
    linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}

.monitor-shell {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.glass {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.045)),
    var(--panel);
  box-shadow: 0 30px 90px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: blur(24px);
}

.hidden { display: none !important; }
.dashboard {
  display: grid;
  gap: 18px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: .14em;
  font-weight: 900;
}
.muted { color: var(--muted); }

.monitor-login {
  width: min(560px, 100%);
  margin: min(16vh, 140px) auto 0;
  padding: clamp(24px, 4vw, 44px);
  border-radius: 34px;
}
.monitor-login h1,
.monitor-header h1,
.section-head h2 {
  margin: 0;
  line-height: .96;
  letter-spacing: -.055em;
}
.monitor-login h1 { font-size: clamp(42px, 7vw, 76px); }
.monitor-login label {
  display: block;
  margin: 28px 0 10px;
  color: var(--muted);
  font-weight: 800;
}
.login-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 16px;
  color: var(--text);
  background: rgba(255,255,255,.075);
  font: inherit;
  outline: none;
}
button {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 18px;
  color: var(--text);
  background: rgba(255,255,255,.08);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
button:hover { border-color: var(--line-strong); transform: translateY(-1px); }
#btnLogin, .ghost { background: #f7f6f1; color: #10131a; }
.danger { color: #ffd7d3; border-color: rgba(255,118,109,.35); background: rgba(255,118,109,.12); }
.status.error { color: var(--red); }

.monitor-header {
  position: sticky;
  top: 14px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border-radius: 30px;
}
.brand { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: #fff;
  background: radial-gradient(circle at 35% 25%, #fff, #67e8f9 12%, #222 46%, #000 100%);
  font-weight: 1000;
  letter-spacing: -.08em;
}
.monitor-header h1 { font-size: clamp(24px, 4vw, 38px); }
.header-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.06);
  font-weight: 800;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin: 16px 4px -2px;
}
.section-head h2 { font-size: clamp(30px, 4.9vw, 58px); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.card-grid.compact { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-card {
  min-height: 138px;
  padding: 22px;
  border-radius: 28px;
  position: relative;
  overflow: hidden;
}
.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 14px 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 24px var(--accent);
  opacity: .62;
}
.metric-card.cyan::after { background: var(--cyan); box-shadow: 0 0 24px var(--cyan); }
.metric-card.green::after { background: var(--green); box-shadow: 0 0 24px var(--green); }
.metric-card.red::after { background: var(--red); box-shadow: 0 0 24px var(--red); }
.metric-card.blue::after { background: var(--blue); box-shadow: 0 0 24px var(--blue); }
.metric-card.violet::after { background: var(--violet); box-shadow: 0 0 24px var(--violet); }
.metric-card span { display: block; color: var(--muted); font-weight: 900; }
.metric-card strong { display: block; margin: 10px 0 8px; font-size: clamp(34px, 5vw, 56px); line-height: .9; letter-spacing: -.06em; }
.metric-card small { color: var(--muted); font-weight: 750; }

.split-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 0;
  align-items: start;
}
.split-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel {
  border-radius: 28px;
  padding: 22px;
  min-height: 0;
  overflow: hidden;
}
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; }
.panel h3 { margin: 0; font-size: 24px; letter-spacing: -.03em; }

.bar-list, .tag-list, .event-list, .table-lite {
  display: grid;
  gap: 10px;
  min-height: 0;
}
.event-list {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}
.event-list::-webkit-scrollbar { width: 8px; }
.event-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255,255,255,.22);
}
.bar-row { display: grid; gap: 7px; }
.bar-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-weight: 850; }
.bar-track { height: 12px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--accent)); min-width: 3px; }
.tag-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tag {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  color: var(--muted);
  font-weight: 850;
}
.tag b { display: block; color: var(--text); font-size: 22px; }
.table-row, .event-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  font-weight: 780;
}
.table-row b, .event-item b { color: var(--text); }
.event-item { grid-template-columns: 1fr; }
.event-item small { color: var(--muted-2); overflow-wrap: anywhere; }
.event-item code { white-space: normal; overflow-wrap: anywhere; color: #ffd2cd; }
.empty { color: var(--muted); padding: 18px; border: 1px dashed var(--line); border-radius: 18px; }

@media (max-width: 1100px) {
  .card-grid, .card-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-grid, .split-grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .monitor-shell { width: min(100% - 16px, 100%); padding-top: 8px; }
  .monitor-header, .section-head { align-items: stretch; flex-direction: column; }
  .header-actions { justify-content: stretch; }
  .header-actions > * { flex: 1; }
  .login-row, .card-grid, .card-grid.compact { grid-template-columns: 1fr; }
  .metric-card { min-height: 128px; }
  .tag-list { grid-template-columns: 1fr; }
}
