:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1e222b;
  --border: #2a2f3a;
  --text: #e6e8ee;
  --muted: #8b93a3;
  --accent: #5b8def;
  --green: #3fbf6f;
  --red: #e5534b;
  --amber: #d9a441;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Login */
.login-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  width: 300px;
  text-align: center;
}
.login-card h1 { font-size: 18px; margin: 0 0 8px; }
.login-card input {
  width: 100%;
  margin: 16px 0 8px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}
.login-card button {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
}
.error-text { color: var(--red); min-height: 18px; font-size: 12px; }

/* App shell */
.app { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.topbar h1 { font-size: 15px; margin: 0; font-weight: 600; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.tab-btn.active { background: var(--panel-2); color: var(--text); }
.ws-status { color: var(--red); font-size: 10px; }
.ws-status.connected { color: var(--green); }

.tab-panel { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.tab-panel.active { display: flex; }

.toolbar {
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.toolbar input {
  flex: 1;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}
button {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 13px;
}
button.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }

.split { flex: 1; display: flex; overflow: hidden; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
.log-table { flex: 1.4; overflow-y: auto; display: block; }
.log-table thead, .mock-table thead { text-align: left; color: var(--muted); }
.log-table th, .mock-table th { padding: 8px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); }
.log-table td, .mock-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.log-table tbody tr:hover, .mock-table tbody tr:hover { background: var(--panel-2); cursor: pointer; }
.log-table tbody tr.selected { background: var(--panel-2); }

.badge { padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge.mocked { background: rgba(217,164,65,0.2); color: var(--amber); }
.badge.status-2xx { color: var(--green); }
.badge.status-4xx, .badge.status-5xx { color: var(--red); }

.detail-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  border-left: 1px solid var(--border);
  background: var(--panel);
}
.detail-panel h3 { font-size: 13px; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.detail-panel pre {
  background: var(--panel-2);
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}

.mock-table { padding: 0 20px; overflow-y: auto; }

.setup-card { padding: 24px; max-width: 720px; overflow-y: auto; }
.setup-card h2 { font-size: 15px; margin-top: 28px; }
.setup-card ul { line-height: 1.7; }
.button-link {
  display: inline-block;
  padding: 8px 14px;
  background: var(--accent);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
}

/* Modal for mock create/edit */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  width: 480px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal h2 { margin-top: 0; font-size: 16px; }
.modal label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 4px; }
.modal input, .modal select, .modal textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-family: inherit;
}
.modal textarea { font-family: ui-monospace, monospace; font-size: 12px; min-height: 80px; }
.modal .row { display: flex; gap: 12px; }
.modal .row > div { flex: 1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
