:root {
  --bg: #0b0d0f;
  --panel: #14171a;
  --panel-border: #23272b;
  --text: #e9edf0;
  --muted: #8b949e;
  --accent: #00d9a3;
  --accent-dim: #0a3d31;
  --danger: #ff6b6b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.muted { color: var(--muted); font-size: 14px; }
.hidden { display: none !important; }
.error { color: var(--danger); }

/* Gate page */
.gate-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.gate-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 40px;
  width: 320px;
  text-align: center;
}
.gate-card form { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }

.brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 4px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.brand-name { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; }

/* App shell */
.app-body { margin: 0; }
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--panel);
  border-right: 1px solid var(--panel-border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar .brand { justify-content: flex-start; margin-bottom: 20px; padding-left: 6px; }
.sidebar-footer { margin-top: auto; padding: 6px; font-size: 12px; }

.nav-item {
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.nav-item:hover { background: #1c2024; }
.nav-item.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }

.content { flex: 1; padding: 32px 40px; max-width: 900px; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 20px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
}
.panel-header { display: flex; align-items: center; justify-content: space-between; }

input[type="text"], input[type="password"], input[type="number"], textarea {
  width: 100%;
  background: #0f1214;
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin: 6px 0 14px;
  font-family: inherit;
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
label { font-size: 13px; color: var(--muted); display: block; }
.hint { color: var(--accent); font-size: 12px; }

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: #04120d; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border: 1px solid var(--panel-border); color: var(--text); }
.btn.small { padding: 6px 12px; font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 16px 0; }
.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px;
}
.card .card-value { font-size: 26px; font-weight: 700; }
.card .card-label { color: var(--muted); font-size: 13px; margin-top: 4px; }

.stepper { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-weight: 600; }
.step-badge {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #04120d;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}

.jsonbox {
  background: #0f1214;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow: auto;
}

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--panel-border); }
th { color: var(--muted); font-weight: 500; }

.badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.sent { background: var(--accent-dim); color: var(--accent); }
.badge.error { background: #3a1414; color: var(--danger); }
.badge.skipped { background: #262626; color: var(--muted); }
.badge.found, .badge.verified { background: #1c2333; color: #7aa2ff; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: #333; border-radius: 24px; transition: 0.2s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; border-radius: 50%; transition: 0.2s; }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(18px); }

.competitor-row { display: flex; gap: 8px; }
.competitor-row input { flex: 1; }
