:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.theme-dark {
  --bg: #0b1120;
  --card: #111827;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #6366f1;
  --border: #1f2937;
  --shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  font-family: "Inter", system-ui, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

.app {
  min-height: 100vh;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-weight: 700;
}

.title {
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  font-size: 12px;
}

.actions {
  display: flex;
  gap: 12px;
}

.content {
  display: grid;
  gap: 24px;
  padding: 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.25);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn:hover {
  transform: translateY(-1px);
}

.section {
  margin-top: 24px;
}

.error {
  color: #ef4444;
  margin-top: 8px;
}

.status {
  color: var(--muted);
  margin-top: 12px;
}

.muted {
  color: var(--muted);
}

.kb-list, .logs-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.kb-item, .log-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(148, 163, 184, 0.08);
}

.kb-item h4 {
  margin: 0 0 8px 0;
}

.log-item span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.hidden {
  display: none;
}
