:root {
  --sidebar-bg: #1e293b;
  --sidebar-muted: #94a3b8;
  --surface: #f1f5f9;
  --card: #ffffff;
  --line: #dbe5f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
}

[data-theme="dark"] {
  --sidebar-bg: #0b1220;
  --sidebar-muted: #93a4bf;
  --surface: #0f172a;
  --card: #111827;
  --line: #253047;
  --text: #e2e8f0;
  --muted: #a3b1c6;
  --accent: #60a5fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  background: var(--surface);
  color: var(--text);
}

.layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #fff;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.menu {
  display: grid;
  gap: 8px;
}

.menu a {
  color: var(--sidebar-muted);
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 10px;
  display: block;
}

.menu a.active,
.menu a:hover {
  background: rgba(148, 163, 184, 0.15);
  color: #fff;
}

.content {
  padding: 18px 22px 30px;
}

.topbar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.topbar h1 {
  margin: 0;
  font-size: 1.55rem;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 12px;
}

.card h3 {
  margin: 0 0 8px;
}

.card p,
p {
  color: var(--muted);
}

ul,
ol {
  line-height: 1.7;
}

.kv {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px;
}

.k { font-weight: 700; }

a { color: #0369a1; text-decoration: none; }

.theme-toggle {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .kv { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
