/* thales-XYZ-v1 stats UI — XYZircd dark dashboard style */

:root {
  --bg: #0a0b0d;
  --bg-elevated: #111318;
  --card: #15181e;
  --card-border: #232833;
  --card-hover: #1a1e27;
  --text: #e8eaed;
  --text-muted: #8b929e;
  --text-dim: #5c6570;
  --green: #00d26a;
  --green-dim: #00a854;
  --green-soft: rgba(0, 210, 106, 0.12);
  --green-glow: rgba(0, 210, 106, 0.25);
  --row-alt: #1a1d24;
  --row-head: #1e222b;
  --danger: #ff5c5c;
  --ok: #00d26a;
  --radius: 14px;
  --radius-sm: 8px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Fira Code", ui-monospace, monospace;
  --max: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 210, 106, 0.06), transparent 50%),
    var(--bg);
}

a { color: var(--green); text-decoration: none; transition: color 0.15s; }
a:hover { color: #3dff9a; }

code, .mono {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--green);
}

/* ── top nav ─────────────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), #00a0ff);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #04120a;
  box-shadow: 0 0 16px var(--green-glow);
}
.brand span.sub {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: var(--green-soft); }
.nav-links a.active {
  color: var(--green);
  background: var(--green-soft);
}

/* ── layout ──────────────────────────────────────────── */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.hero {
  margin-bottom: 1.5rem;
}
.hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.hero h1 em {
  font-style: normal;
  color: var(--green);
}
.hero p {
  margin: 0;
  color: var(--text-muted);
  max-width: 52ch;
  font-size: 0.95rem;
}

/* ── cards / grid ────────────────────────────────────── */
.grid {
  display: grid;
  gap: 1rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.card-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
}

.statbox {
  text-align: left;
  padding: 1.1rem 1.2rem;
}
.statbox .n {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.statbox .l {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.statbox .peak {
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── tables ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}
table.data th,
table.data td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
  vertical-align: top;
}
table.data th {
  background: var(--row-head);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
table.data th:first-child { border-radius: var(--radius-sm) 0 0 0; }
table.data th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
table.data tbody tr:nth-child(even) td { background: rgba(255,255,255,0.015); }
table.data tbody tr:hover td { background: var(--green-soft); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.mode {
  font-family: var(--mono);
  color: var(--green);
  font-weight: 600;
  white-space: nowrap;
}

table.details th {
  width: 9rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--card-border);
  padding: 0.55rem 0.75rem 0.55rem 0;
}
table.details td {
  border-bottom: 1px solid var(--card-border);
  padding: 0.55rem 0;
}
table.details tr:last-child th,
table.details tr:last-child td { border-bottom: none; }

/* ── bits ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-ok {
  color: var(--ok);
  background: var(--green-soft);
}
.badge-off {
  color: var(--danger);
  background: rgba(255, 92, 92, 0.12);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary {
  background: var(--green);
  color: #04120a;
}
.btn-primary:hover { background: #3dff9a; color: #04120a; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--card-border);
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); }

.search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.search input {
  flex: 1;
  max-width: 280px;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
}
.search input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

h2.section {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
h3.section {
  margin: 1.25rem 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text);
}

.muted { color: var(--text-muted); font-size: 0.88rem; }
.topic {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.live-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.85rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.live-bar strong { color: var(--text); font-weight: 600; }

canvas#chart {
  width: 100% !important;
  max-width: 100%;
  height: 220px !important;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.member-list li {
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.85rem;
}
.member-list li a { color: var(--text); }
.member-list li a:hover { color: var(--green); }

/* footer */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-dim);
  font-size: 0.8rem;
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--green); }
