:root {
  --bg: #101312;
  --panel: #191e1c;
  --panel-2: #202823;
  --line: #334139;
  --text: #edf3ed;
  --muted: #a5b4aa;
  --accent: #d4f56a;
  --accent-2: #49c6a2;
  --danger: #ff6b57;
  --warn: #e9b949;
  --ok: #4ade80;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Aptos", "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: var(--accent);
  text-decoration: none;
}

.topbar {
  align-items: center;
  background: #0c0f0e;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr auto;
  min-height: 64px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 3;
}

.brand {
  align-items: center;
  color: var(--text);
  display: inline-flex;
  font-weight: 800;
  gap: 10px;
  letter-spacing: .02em;
}

.brand-mark {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: inline-block;
  height: 18px;
  transform: skew(-18deg);
  width: 28px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

nav a,
.icon-button,
.button,
button {
  background: #253028;
  border: 1px solid #3d4c42;
  color: var(--text);
  cursor: pointer;
  display: inline-block;
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
}

nav a:hover,
.icon-button:hover,
.button:hover,
button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.secondary {
  background: transparent;
}

.shell {
  margin: 0 auto;
  max-width: 1180px;
  padding: 32px 20px 64px;
}

.page-head {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--accent-2);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .14em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

h1,
h2 {
  line-height: 1.05;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.4rem);
}

h2 {
  font-size: 1.1rem;
}

.metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metrics article,
.panel,
.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
}

.metrics article {
  min-height: 98px;
  padding: 16px;
}

.metrics span {
  color: var(--muted);
  display: block;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metrics strong {
  display: block;
  font-size: 1.2rem;
  margin-top: 12px;
  overflow-wrap: anywhere;
}

.hash {
  font-size: .78rem !important;
}

.panel {
  margin-top: 18px;
  overflow: hidden;
}

.panel > header {
  align-items: center;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.panel > p,
.form-panel form {
  padding: 16px;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: .76rem;
  text-transform: uppercase;
}

.badge,
.state {
  border: 1px solid var(--line);
  color: var(--accent);
  display: inline-block;
  font-size: .78rem;
  font-weight: 800;
  padding: 4px 8px;
  text-transform: uppercase;
}

.badge.warning,
.state.warn {
  color: var(--warn);
}

.badge.error {
  color: var(--danger);
}

.state.ok {
  color: var(--ok);
}

.stack {
  display: grid;
  gap: 14px;
}

.grid-form {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  color: var(--muted);
  display: grid;
  font-size: .82rem;
  font-weight: 800;
  gap: 6px;
  text-transform: uppercase;
}

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

input,
select,
textarea {
  background: #0e1211;
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
  width: 100%;
}

textarea {
  resize: vertical;
}

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

.button-row {
  padding: 16px;
}

.alert,
.notice {
  border: 1px solid;
  font-weight: 700;
  padding: 12px 14px;
}

.alert {
  background: #2d1713;
  border-color: #7f3529;
  color: #ffb0a5;
}

.notice {
  background: #15271e;
  border-color: #2f6d48;
  color: #a7f3c8;
}

pre {
  background: #0b0e0d;
  color: #d9e8da;
  margin: 0;
  max-height: 560px;
  overflow: auto;
  padding: 16px;
}

.inline-pre {
  background: transparent;
  max-height: 120px;
  padding: 0;
  white-space: pre-wrap;
}

.auth-page {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: 20px;
}

.auth-panel {
  margin: 0 auto;
  max-width: 440px;
  padding: 28px;
  width: 100%;
}

.auth-brand {
  margin-bottom: 28px;
}

.auth-panel h1 {
  font-size: 2.6rem;
}

@media (max-width: 860px) {
  .topbar,
  .page-head {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    gap: 12px;
    padding: 16px;
  }

  nav {
    justify-content: flex-start;
  }

  .metrics,
  .grid-form {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}
