:root {
  --bg: #10140f;
  --panel: #181e16;
  --line: #2b3627;
  --ink: #e8f0e3;
  --muted: #8ea086;
  --accent: #c6f25a;
  --accent-ink: #1a220c;
  --danger: #ff6b4a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 10% -10%, #24301c 0%, transparent 55%), var(--bg);
  color: var(--ink);
  font-family: "Noto Sans SC", sans-serif;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.topbar, main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 0 18px;
  gap: 16px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
}

h1, h2 {
  margin: 0;
  font-weight: 700;
}

h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 18px; }

.top-actions, .form-actions, .panel-head.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

button, input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  height: 42px;
  padding: 0 16px;
  letter-spacing: 0.02em;
}

.primary {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.hidden { display: none !important; }

.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 26px;
  font-weight: 500;
}

.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  padding-bottom: 48px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px;
}

.panel-head {
  margin-bottom: 16px;
}

.panel-head p, label {
  color: var(--muted);
  font-size: 13px;
}

.panel-head.row {
  justify-content: space-between;
}

.form {
  display: grid;
  gap: 12px;
  align-content: start;
}

label {
  display: grid;
  gap: 6px;
}

label small {
  color: var(--accent);
  font-size: 12px;
  line-height: 1.4;
}

input, select {
  height: 42px;
  border: 1px solid var(--line);
  background: #12170f;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 18px, calc(100% - 11px) 18px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

input:focus, select:focus {
  border-color: var(--accent);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.table-wrap {
  overflow: auto;
}

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

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

td {
  font-family: "IBM Plex Mono", "Noto Sans SC", monospace;
  font-size: 14px;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.link {
  background: none;
  border: 0;
  height: auto;
  padding: 0;
  color: var(--accent);
}

.link.danger { color: var(--danger); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 0;
}

@media (max-width: 900px) {
  .topbar, .metrics, .layout, .panel-head.row, .top-actions {
    display: grid;
  }
  .metrics, .layout, .grid-2 {
    grid-template-columns: 1fr;
  }
  .top-actions { width: 100%; }
  button { width: 100%; }
}
