:root {
  --bg: #0f1115; --surface: #1a1d24; --surface-2: #232730;
  --border: #2a2f3a; --text: #e8eaed; --text-muted: #9aa0a6;
  --accent: #4f8cff; --success: #2ed573; --danger: #ff4757;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 32px; width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; letter-spacing: -0.02em; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.auth-card label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
input, textarea, select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  padding: 10px 12px; border-radius: 8px; font-size: 14px; font-family: inherit; width: 100%;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 100px; }
button { background: var(--surface); color: var(--text); border: 1px solid var(--border);
  padding: 10px 16px; border-radius: 8px; cursor: pointer; font-size: 14px;
  font-family: inherit; transition: background 0.15s, border-color 0.15s; }
button:hover { background: var(--surface-2); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: white; font-weight: 500; }
button.primary:hover { background: #3d7aff; }
button.ghost { background: transparent; }
.muted { color: var(--text-muted); font-size: 14px; }
.small { font-size: 12px; }
.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 18px; letter-spacing: -0.01em; }
main { max-width: 900px; margin: 0 auto; padding: 24px 16px;
  display: flex; flex-direction: column; gap: 32px; }
section { display: flex; flex-direction: column; gap: 12px; }
.section-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-header h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card { background: var(--surface); border: 1px solid var(--border); padding: 16px; border-radius: 10px; }
.card-list { display: flex; flex-direction: column; gap: 8px; }
.integration-card { background: var(--surface); border: 1px solid var(--border);
  padding: 16px; border-radius: 10px; display: flex; justify-content: space-between;
  align-items: center; gap: 12px; }
.integration-card .meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.integration-card .label { font-weight: 500; }
.integration-card .sub { font-size: 12px; color: var(--text-muted); }
.empty { text-align: center; color: var(--text-muted); padding: 40px 16px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.green { background: var(--success); }
.dot.red { background: var(--danger); }
.btn-row { display: flex; gap: 8px; }
@media (max-width: 600px) {
  main { padding: 16px 12px; gap: 20px; }
  .topbar { padding: 12px 16px; }
}

dialog { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; max-width: 480px; width: 90%; color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,0.65); }
dialog h3 { font-size: 16px; margin-bottom: 4px; }
dialog input { margin-top: 12px; }
.kind-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.kind-btn { display: flex; flex-direction: column; align-items: flex-start; padding: 12px; gap: 4px; text-align: left; cursor: pointer; }
.kind-btn:hover:not(:disabled) { border-color: var(--accent); }
.kind-btn .kind-name { font-weight: 500; }
.kind-btn .kind-sub { font-size: 12px; color: var(--text-muted); }
.kind-btn.disabled { opacity: 0.4; }
@media (max-width: 600px) { .kind-grid { grid-template-columns: 1fr; } }
