:root {
  color-scheme: dark;
  --bg: #061019;
  --panel: rgba(17, 34, 49, .78);
  --panel-strong: #102536;
  --line: rgba(164, 218, 255, .14);
  --text: #edf8ff;
  --muted: #8da7ba;
  --cyan: #36d6ff;
  --blue: #2588ff;
  --danger: #ff7185;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 78% -10%, rgba(28, 136, 255, .18), transparent 38rem),
    radial-gradient(circle at 8% 35%, rgba(54, 214, 255, .08), transparent 32rem),
    var(--bg);
}
a { color: var(--cyan); text-decoration: none; }
a:hover { color: white; }
button, input, select { font: inherit; }
button, .button-link { min-height: 42px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 16, 25, .84);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 720; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(54, 214, 255, .35);
  border-radius: 22px;
  color: white;
  background: linear-gradient(145deg, #1676e8, #13bfe5);
  box-shadow: 0 16px 50px rgba(21, 142, 240, .24);
  font-weight: 850;
  letter-spacing: -.05em;
}
.brand-mark.small { width: 42px; height: 42px; border-radius: 12px; font-size: .8rem; }

.page-shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 44px 0 72px; }
.hero-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.hero-row h1 { margin: 4px 0 0; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1; letter-spacing: -.045em; }
.detail-title h1 { font-size: clamp(1.55rem, 3vw, 2.4rem); word-break: break-all; }
.eyebrow { margin: 0; color: var(--cyan); font-size: .76rem; font-weight: 780; letter-spacing: .15em; text-transform: uppercase; }
.muted { color: var(--muted); line-height: 1.6; }
.live-badge, .tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(54, 214, 255, .22);
  border-radius: 999px;
  padding: 7px 11px;
  color: #a9ecff;
  background: rgba(29, 153, 202, .1);
  font-size: .78rem;
  font-weight: 680;
}
.live-badge i { width: 7px; height: 7px; border-radius: 50%; background: #52efb4; box-shadow: 0 0 14px #52efb4; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.metric, .panel, .filter-bar, .login-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(19, 42, 60, .78), rgba(8, 26, 40, .7));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .18);
}
.metric { display: flex; flex-direction: column; gap: 7px; min-height: 124px; padding: 22px; }
.metric strong { font-size: 2rem; letter-spacing: -.04em; }
.metric span { color: var(--muted); font-size: .86rem; }

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 180px auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 22px;
  padding: 16px;
}
label { display: flex; flex-direction: column; gap: 7px; color: var(--muted); font-size: .78rem; font-weight: 650; }
input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  padding: 0 13px;
  color: var(--text);
  background: rgba(3, 13, 22, .72);
}
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(54, 214, 255, .12); }
button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 720;
}
.primary { color: #00131d; background: linear-gradient(135deg, var(--cyan), #54a7ff); }
.primary:hover { filter: brightness(1.08); }
.quiet { border-color: var(--line); color: var(--text); background: rgba(255, 255, 255, .035); }
.quiet:hover { border-color: rgba(54, 214, 255, .4); }
.compact { min-height: 44px; }

.panel { overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 1rem; }
.panel-heading span { color: var(--muted); font-size: .82rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 22px; border-bottom: 1px solid rgba(164, 218, 255, .08); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
td { font-size: .88rem; }
td small { display: block; margin-top: 4px; color: var(--muted); }
td code, .breadcrumbs code { color: #b9d7e8; }
.row-link { font-weight: 700; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; min-height: 64px; padding: 0 22px; color: var(--muted); font-size: .82rem; }
.pagination > :last-child { text-align: right; }
.empty-state { padding: 58px 22px; text-align: center; color: var(--muted); }
.empty-state h3 { margin: 0 0 8px; color: var(--text); }
.compact-empty { padding: 28px; }

.breadcrumbs { display: flex; gap: 10px; margin-bottom: 22px; color: var(--muted); font-size: .84rem; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.metadata-panel dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.metadata-panel dl div { padding: 16px 22px; border-bottom: 1px solid rgba(164, 218, 255, .07); }
.metadata-panel dt { margin-bottom: 5px; color: var(--muted); font-size: .74rem; }
.metadata-panel dd { margin: 0; font-size: .9rem; word-break: break-word; }
.events-panel { margin-top: 18px; }
.event-list { max-height: 66vh; margin: 0; padding: 12px 22px 22px 58px; overflow: auto; }
.event-list li { padding: 9px 12px; border-bottom: 1px solid rgba(164, 218, 255, .07); color: #70899c; }
.event-list code { color: #c8deea; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }

.login-body { display: grid; place-items: center; padding: 28px; }
.login-shell { width: min(430px, 100%); }
.login-card { padding: 34px; }
.login-card .brand-mark { margin-bottom: 28px; }
.login-card h1 { margin: 5px 0 8px; font-size: 2.3rem; letter-spacing: -.04em; }
.stack { display: grid; gap: 17px; margin-top: 26px; }
.alert { margin-top: 20px; border-radius: 11px; padding: 12px 14px; font-size: .86rem; }
.alert.error { border: 1px solid rgba(255, 113, 133, .3); color: #ffb4c0; background: rgba(173, 40, 63, .16); }

@media (max-width: 960px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar { padding: 0 18px; }
  .page-shell { width: min(100% - 28px, 1440px); padding-top: 28px; }
  .hero-row { align-items: flex-start; flex-direction: column; }
  .metric-grid, .filter-bar { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .metadata-panel dl { grid-template-columns: 1fr; }
  .login-card { padding: 25px; }
}
