:root {
  --bg: #0f172a;
  --card: #111827;
  --muted: #94a3b8;
  --text: #e2e8f0;
  --line: #1f2937;
  --accent: #22c55e;
}

body.light {
  --bg: #f8fafc;
  --card: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --line: #e2e8f0;
  --accent: #2563eb;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #22c55e, #06b6d4);
  color: #fff;
  font-weight: 700;
}
.brand h1 { margin: 0; font-size: 18px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 16px;
}
.sidebar { position: sticky; top: 74px; height: fit-content; }
.panel, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.panel { padding: 14px; }
.content { display: grid; gap: 14px; }
.card { padding: 18px; }

#searchInput {
  width: 100%;
  margin: 8px 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 10px;
}
.nav { display: grid; gap: 6px; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 8px;
}
.nav a:hover, .nav a.active {
  background: color-mix(in oklab, var(--accent) 20%, transparent);
  color: var(--text);
}

.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(90deg, #22c55e, #3b82f6);
}
.actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.stat span { color: var(--muted); font-size: 13px; display: block; }

.mock-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.mock-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.mock-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: transparent;
  color: var(--text);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.gallery img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  height: 150px;
  object-fit: cover;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 8px;
}
th { color: var(--muted); font-weight: 600; }
pre {
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #020617;
  color: #cbd5e1;
}
.timeline { margin: 0; padding-left: 18px; }
.timeline li { margin: 8px 0; }

.toast {
  position: fixed;
  right: 18px;
  bottom: 20px;
  background: #16a34a;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: all .2s;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero { grid-template-columns: 1fr; }
}
