:root {
  --bg: #071018;
  --panel: #0d1722;
  --line: rgba(148, 178, 198, 0.16);
  --text: #eef5fa;
  --muted: #8fa6b8;
  --yellow: #f7c948;
  --teal: #2fd3a8;
  --font: "Manrope", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(47, 211, 168, 0.1), transparent 55%),
    radial-gradient(800px 380px at 90% 0%, rgba(247, 201, 72, 0.08), transparent 50%),
    var(--bg);
}

html[data-theme="light"] {
  --bg: #eef3f8;
  --panel: #ffffff;
  --line: rgba(16, 36, 56, 0.12);
  --text: #122033;
  --muted: #5d7386;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

.rx-shell {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 24, 0.92);
  backdrop-filter: blur(12px);
}

.rx-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
}

.rx-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: max-content;
}
.rx-mark {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--text);
  line-height: 0;
}
.rx-brand-text { display: grid; line-height: 1.05; }
.rx-brand-text strong {
  letter-spacing: 0.1em;
  font-size: 0.95rem;
}
.rx-brand-text em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rx-icon, .rx-cta, .rx-group-btn, .page-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
}
.rx-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: none;
}
.rx-cta {
  margin-inline-start: auto;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: var(--yellow);
  color: #1a1400;
  font-weight: 700;
  border: 0;
}

.rx-nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.rx-link, .rx-group-btn {
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  border: 0;
}
.rx-link:hover, .rx-group-btn:hover, .rx-link.is-active, a.is-active {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}
.rx-group { position: relative; }
.rx-submenu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  padding: 0.4rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}
.rx-group:hover .rx-submenu, .rx-group:focus-within .rx-submenu { display: grid; }
.rx-submenu a {
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  color: var(--muted);
}
.rx-submenu a:hover { background: rgba(247, 201, 72, 0.08); color: var(--text); }

.rx-drawer {
  display: none;
  position: fixed;
  inset: 0 auto 0 0;
  width: min(320px, 90vw);
  background: rgba(8, 16, 24, 0.98);
  border-right: 1px solid var(--line);
  padding: 1rem;
  z-index: 60;
}
.rx-drawer.open { display: block; }
.rx-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.rx-drawer-body { display: grid; gap: 0.35rem; }
.rx-drawer .rx-submenu {
  position: static;
  display: grid;
  box-shadow: none;
  background: transparent;
  border: 0;
  padding: 0 0 0 0.6rem;
}
.rx-drawer .rx-group-btn { text-align: left; width: 100%; }

.page {
  width: min(1100px, calc(100% - 2rem));
  margin: 1.25rem auto 2.5rem;
}
.page-hero {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.2rem;
}
.page-hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.02em;
}
.page-hero p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.5;
}

.toolbar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.toolbar input, .toolbar select, .field-box {
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0 0.85rem;
  min-width: 0;
}
.toolbar input { flex: 1; min-width: 220px; }
.page-btn {
  height: 42px;
  padding: 0 0.95rem;
  border-radius: 12px;
}
.page-btn.primary {
  background: var(--yellow);
  color: #1a1400;
  border: 0;
  font-weight: 700;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.card, .panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(13, 23, 34, 0.88);
  padding: 0.95rem;
}
.card h3, .panel h2 { margin: 0 0 0.35rem; font-size: 1rem; }
.card p, .muted, .meta { color: var(--muted); line-height: 1.45; }
.meta { font-size: 0.82rem; font-family: var(--mono); }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(13, 23, 34, 0.88);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
th {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.02);
}
tr:hover td { background: rgba(247, 201, 72, 0.04); }
tr { cursor: pointer; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat-row .card b {
  display: block;
  font-size: 1.4rem;
  font-family: var(--mono);
  margin-top: 0.25rem;
}

.stack { display: grid; gap: 0.75rem; }
.two-col {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 0.9rem;
}
@media (max-width: 900px) {
  .rx-nav-desktop { display: none; }
  .rx-icon { display: inline-grid; place-items: center; }
  .two-col { grid-template-columns: 1fr; }
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(47, 211, 168, 0.12);
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 600;
}
.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
}
footer.rx-foot {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  color: var(--muted);
  font-size: 0.8rem;
}
