* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #18181b;
  --border: #232326;
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.08);
  --accent-hover: #2563eb;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --radius: 8px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ─── Layout ───────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}
.sidebar-brand span { color: var(--accent); }

.sidebar-section {
  padding: 16px 20px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  margin: 1px 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  border: none;
  background: none;
  width: calc(100% - 16px);
  text-align: left;
  font-family: inherit;
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}
.nav-item .icon { width: 16px; text-align: center; font-size: 14px; opacity: 0.7; }
.nav-item.active .icon { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}
.sidebar-footer button {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 0;
  font-family: inherit;
}
.sidebar-footer button:hover { color: var(--text); }

.main-content {
  flex: 1;
  padding: 32px 40px;
  max-width: 1100px;
  min-width: 0;
}

/* ─── Typography ───────────────────────────────────────── */
h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.4px; margin-bottom: 24px; }
h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
h3 { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.muted { color: var(--text-2); }

/* ─── Cards ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

/* ─── Buttons ──────────────────────────────────────────── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.btn-primary, button:not(.btn-secondary):not(.btn-danger):not(.btn-ghost):not(.auth-tab):not(.nav-item) {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover, button:not(.btn-secondary):not(.btn-danger):not(.btn-ghost):not(.auth-tab):not(.nav-item):hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: #252529; }
.btn-danger {
  background: transparent;
  color: var(--red);
  border-color: #3b1a1a;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.08); }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: none;
  padding: 5px 8px;
}
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Forms ────────────────────────────────────────────── */
input, textarea, select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { min-height: 80px; resize: vertical; }
select { cursor: pointer; }

label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 14px;
}
label.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
label.inline input { width: auto; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

/* ─── Tables ───────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
th {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-3);
  background: var(--surface);
  position: sticky;
  top: 0;
}
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: var(--surface-2); }

/* ─── Tags & status ────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.active  { background: var(--green); box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }
.status-dot.inactive { background: var(--text-3); }
.status-dot.verified { background: var(--green); box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }
.status-dot.unverified { background: var(--yellow); }
.status-dot.connected { background: var(--green); box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }

.model-label {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}

/* ─── Utilities ────────────────────────────────────────── */
.row { display: flex; gap: 12px; align-items: center; }
.hidden { display: none !important; }
.error-text { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 4px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  overflow: auto;
  font-size: 12px;
  max-height: 400px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.5;
  color: var(--text-2);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
}

.method {
  font-weight: 600;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.method.GET    { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }
.method.POST   { background: rgba(34, 197, 94, 0.1);  color: #4ade80; }
.method.PUT    { background: rgba(234, 179, 8, 0.1);  color: #facc15; }
.method.DELETE { background: rgba(239, 68, 68, 0.1);  color: #f87171; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
}
.empty-state p { margin-top: 8px; font-size: 13px; }

/* ─── Auth ─────────────────────────────────────────────── */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}
.auth-card h1 {
  text-align: center;
  margin-bottom: 4px;
  font-size: 20px;
}
.auth-card .subtitle {
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 24px;
}
.auth-tabs {
  display: flex;
  margin-bottom: 20px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text-3);
  border: none;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.auth-tab:first-child { border-right: 1px solid var(--border); }
.auth-tab.active {
  background: var(--surface);
  color: var(--text);
}

/* ─── API docs ─────────────────────────────────────────── */
.endpoint {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.endpoint summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  transition: background 0.1s;
}
.endpoint summary:hover { background: var(--surface-2); }
.endpoint summary::-webkit-details-marker { display: none; }
.endpoint[open] summary { border-bottom: 1px solid var(--border); }
.endpoint-body { padding: 16px; }
.endpoint .path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text); }
.endpoint .desc { margin-left: auto; color: var(--text-3); font-size: 12px; }

/* ─── Agent cards ──────────────────────────────────────── */
.agent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.agent-card:hover { border-color: #333; }
.agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.agent-name {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.agent-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 10px;
}
.agent-meta span { display: flex; align-items: center; gap: 4px; }
.agent-section-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-3);
  margin: 10px 0 6px;
}
.agent-card pre {
  margin: 0;
  max-height: 100px;
  font-size: 11px;
  padding: 10px;
}
