:root {
  --bg: #070a12;
  --bg2: rgba(255, 255, 255, 0.04);
  --card: rgba(14, 28, 54, 0.65);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --line: rgba(255, 255, 255, 0.12);
  --ok: #2ee6c2;
  --warn: #ffd166;
  --crit: #ff4d86;
  --radius: 14px;
  --gap: 16px;
  --pad: 14px;
  --shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  --blur: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

body.compact {
  --gap: 12px;
  --pad: 12px;
}

body.compact {
  font-size: 13px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font: 14px/1.35 var(--sans);
  color: var(--text);
  background: radial-gradient(1200px 700px at 20% 0%, rgba(46, 230, 194, 0.1), transparent 55%),
    radial-gradient(1000px 600px at 80% 20%, rgba(255, 77, 134, 0.09), transparent 55%),
    radial-gradient(900px 500px at 40% 100%, rgba(255, 209, 102, 0.08), transparent 55%), var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  background: rgba(7, 10, 18, 0.6);
  border-bottom: 1px solid var(--line);
}

.topbar-inner,
.subbar-inner {
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-inner {
  height: 56px;
}

body.compact .topbar-inner {
  height: 50px;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-right: 4px;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: var(--muted);
}

.dot.ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(46, 230, 194, 0.22), 0 0 18px rgba(46, 230, 194, 0.42);
}
.dot.warn {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.2), 0 0 18px rgba(255, 209, 102, 0.35);
}
.dot.crit {
  background: var(--crit);
  box-shadow: 0 0 0 3px rgba(255, 77, 134, 0.2), 0 0 18px rgba(255, 77, 134, 0.35);
}

.live-text {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.search {
  flex: 1;
  max-width: 520px;
  min-width: 220px;
}

.search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  outline: none;
}

.search input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

body.compact .btn {
  padding: 8px 10px;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.btn:active {
  transform: translateY(0.5px);
}

.btn.secondary {
  color: var(--muted);
}

.btn.danger {
  border-color: rgba(255, 77, 134, 0.35);
}

.subbar {
  border-bottom: 1px solid var(--line);
  background: rgba(7, 10, 18, 0.35);
}

.subbar-inner {
  padding-block: 10px;
  align-items: flex-start;
  gap: 14px;
}

.tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab {
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
}

body.compact .tab {
  padding: 7px 10px;
}

.tab[aria-selected="true"] {
  color: var(--text);
  border-color: rgba(46, 230, 194, 0.4);
  background: rgba(46, 230, 194, 0.08);
}

.chips {
  margin-left: auto;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

body.compact .chip {
  padding: 6px 9px;
}

body.compact .chip {
  font-size: 12px;
}

body.compact .live-text {
  font-size: 12px;
}

.chip strong {
  color: var(--text);
  font-weight: 600;
}

.wrap {
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  padding-inline: 24px;
  padding-block: 18px 28px;
}

body.compact .wrap {
  padding-block: 12px 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}

.span-2 {
  grid-column: span 2;
}
.span-4 {
  grid-column: span 4;
}
.span-6 {
  grid-column: span 6;
}
.span-8 {
  grid-column: span 8;
}
.span-12 {
  grid-column: span 12;
}

.card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}

.card .hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--pad);
  border-bottom: 1px solid var(--line);
  gap: 10px;
}

body.compact .card .hd {
  padding-block: calc(var(--pad) - 2px);
}

.card .hd h2 {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.card .bd {
  padding: var(--pad);
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.tag.ok {
  border-color: rgba(46, 230, 194, 0.35);
  color: rgba(46, 230, 194, 0.95);
  background: rgba(46, 230, 194, 0.09);
}
.tag.warn {
  border-color: rgba(255, 209, 102, 0.35);
  color: rgba(255, 209, 102, 0.95);
  background: rgba(255, 209, 102, 0.09);
}
.tag.crit {
  border-color: rgba(255, 77, 134, 0.35);
  color: rgba(255, 77, 134, 0.95);
  background: rgba(255, 77, 134, 0.09);
}

.summary {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 10px;
}

.big {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.1px;
}

body.compact .big {
  font-size: 16px;
}

.sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.compact .sub {
  margin-top: 4px;
  font-size: 12px;
}

.muted {
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

body.compact .kpi-grid {
  gap: 8px;
}

.kpi {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  padding: 10px 10px;
  background: rgba(255, 255, 255, 0.02);
}

body.compact .kpi {
  padding: 9px 9px;
}

.kpi .label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  color: var(--muted);
}

.kpi .val {
  margin-top: 6px;
  font-weight: 700;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  padding: 9px 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  vertical-align: middle;
}

body.compact .table th,
body.compact .table td {
  padding-block: 7px;
}

body.compact .table th {
  font-size: 11px;
}

body.compact .table td {
  font-size: 12.5px;
}

body.compact .event .desc {
  -webkit-line-clamp: 1;
}

.table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

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

.mono {
  font-family: var(--mono);
}

.events {
  display: grid;
  gap: 10px;
}

.event {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

body.compact .event {
  padding: 9px;
}

.ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-weight: 800;
}

.ico.ok {
  color: rgba(46, 230, 194, 0.98);
  border-color: rgba(46, 230, 194, 0.35);
  background: rgba(46, 230, 194, 0.07);
}
.ico.warn {
  color: rgba(255, 209, 102, 0.98);
  border-color: rgba(255, 209, 102, 0.35);
  background: rgba(255, 209, 102, 0.07);
}
.ico.crit {
  color: rgba(255, 77, 134, 0.98);
  border-color: rgba(255, 77, 134, 0.35);
  background: rgba(255, 77, 134, 0.07);
}

.event .title {
  font-weight: 700;
  margin: 0;
  font-size: 13.5px;
}

.event .meta {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12.5px;
}

.event .desc {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12.8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.split-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.box {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  border-radius: calc(var(--radius) - 4px);
  padding: 10px;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(46, 230, 194, 0.9), rgba(46, 230, 194, 0.45));
}

.bar.warn > i {
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.9), rgba(255, 209, 102, 0.45));
}
.bar.crit > i {
  background: linear-gradient(90deg, rgba(255, 77, 134, 0.9), rgba(255, 77, 134, 0.45));
}

.chart {
  height: 260px;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.chart canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.fade {
  transition: opacity 160ms ease;
}
.flash {
  opacity: 0.72;
}

.login-wrap {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.login-card .hd {
  padding: 16px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-card h1 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  color: var(--muted);
}

.login-card .bd {
  padding: 16px;
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.field {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  outline: none;
}

.error {
  color: rgba(255, 77, 134, 0.95);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .topbar-inner,
  .subbar-inner,
  .wrap {
    padding-inline: 16px;
  }
  .search {
    display: none;
  }
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .span-2 {
    grid-column: span 3;
  }
  .span-4,
  .span-6,
  .span-8,
  .span-12 {
    grid-column: span 6;
  }
  .split-2 {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .chips {
    justify-content: flex-start;
    margin-left: 0;
  }
  .subbar-inner {
    flex-direction: column;
    align-items: stretch;
  }
}
