*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 16px; color: #111; background: #fafafa; }

body {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e0e0e0;
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
}

.sidebar h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.sidebar h1 a {
  color: inherit;
  text-decoration: none;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: #444;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}

.sidebar nav a:hover {
  background: #f0f0f0;
  color: #111;
}

.sidebar nav a.active {
  background: #e8f5e9;
  color: #2e7d32;
  font-weight: 600;
}

.sidebar .spacer {
  flex: 1;
}

.sidebar .sidebar-footer {
  font-size: 0.75rem;
  color: #999;
  padding: 0.5rem 0.75rem;
}

.sidebar .sidebar-footer a {
  color: #999;
  text-decoration: none;
}

.sidebar .sidebar-footer a:hover {
  color: #666;
}

/* ── Main content ──────────────────────────────────────── */
.main {
  flex: 1;
  max-width: 720px;
  padding: 2rem 1.5rem;
  overflow-y: auto;
}

h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: #555; }
p { color: #444; line-height: 1.5; margin-bottom: 1rem; }

input, button { font-size: 1rem; padding: 0.625rem 1rem; border-radius: 8px; }
input { width: 100%; border: 1px solid #ccc; background: #fff; margin-bottom: 0.75rem; }
input:focus { outline: none; border-color: #6b5; box-shadow: 0 0 0 3px rgba(102, 187, 85, 0.2); }
button { cursor: pointer; border: none; font-weight: 600; transition: background 0.15s; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: #6b5; color: #fff; }
button.primary:hover:not(:disabled) { background: #5a4; }
button.secondary { background: #e8e8e8; color: #333; }
button.secondary:hover:not(:disabled) { background: #ccc; }

.form-row { display: flex; gap: 0.5rem; align-items: flex-start; }
.form-row input { flex: 1; margin-bottom: 0; }
.form-row button { flex: 0 0 auto; }

hr { border: none; border-top: 1px solid #ddd; margin: 1.5rem 0; }

.card { background: #fff; border: 1px solid #e0e0e0; border-radius: 10px; padding: 1rem; margin-bottom: 1rem; }

pre { background: #f0f0f0; border: 1px solid #ddd; border-radius: 8px; padding: 1rem; overflow-x: auto; font-size: 0.8125rem; line-height: 1.4; margin-bottom: 1rem; }

.nav-links { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.nav-links a { text-decoration: none; font-weight: 600; padding: 0.5rem 1rem; border-radius: 8px; background: #6b5; color: #fff; font-size: 0.875rem; white-space: nowrap; }
.nav-links a:hover { background: #5a4; }

.spinner { display: inline-block; width: 1.25rem; height: 1.25rem; border: 2px solid #ccc; border-top-color: #6b5; border-radius: 50%; animation: spin 0.6s linear infinite; margin-right: 0.5rem; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.875rem; }
.alert.info { background: #e3f2fd; color: #1565c0; }
.alert.success { background: #e8f5e9; color: #2e7d32; }
.alert.error { background: #fce4ec; color: #c62828; }

.hidden { display: none !important; }

.status { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: #666; margin-bottom: 0.75rem; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e0e0e0; padding: 1rem; }
  .sidebar h1 { margin-bottom: 0.75rem; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; gap: 0.25rem; }
  .sidebar .spacer { display: none; }
  .sidebar .sidebar-footer { display: none; }
  .main { padding: 1rem; }
}