:root {
  --bg: #fff4dc;
  --sidebar: #ffffff;
  --card: #ffffff;
  --card-2: #f6ecd2;
  --primary: #3d5afe;
  --primary-rgb: 61, 90, 254;
  --secondary: #2a42d6;
  --pop: #ffd23f;
  --success: #15803d;
  --warning: #b45309;
  --danger: #dc2626;
  --text: #111111;
  --muted: #4b4b55;
  --border: #111111;
  --line: rgba(17, 17, 17, 0.16);
  --sh: #111111;
  --shadow: 3px 3px 0 var(--sh);
  --shadow-sm: 2px 2px 0 var(--sh);
  --radius: 10px;
  --radius-sm: 6px;
  --gradient: var(--primary);
  --sidebar-w: 216px;
  --topbar-h: 52px;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}
[data-theme="dark"] {
  --bg: #15121c;
  --sidebar: #1c1826;
  --card: #221d2e;
  --card-2: #2d2740;
  --primary: #5568ff;
  --primary-rgb: 85, 104, 255;
  --secondary: #8d9bff;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --text: #f6f4ff;
  --muted: #b9b4cb;
  --border: #ece9f7;
  --line: rgba(236, 233, 247, 0.16);
  --sh: #000000;
}
[data-accent="violet"] { --primary: #8b5cf6; --primary-rgb: 139, 92, 246; --secondary: #6d3fe0; }
[data-accent="emerald"] { --primary: #10b981; --primary-rgb: 16, 185, 129; --secondary: #0b8f64; }
[data-accent="amber"] { --primary: #f59e0b; --primary-rgb: 245, 158, 11; --secondary: #c47d06; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
ul { list-style: none; }
code, pre { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
::selection { background: rgba(var(--primary-rgb), 0.35); color: inherit; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.5rem, 3.4vw, 2.5rem); }
h2 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.gradient-text { color: var(--primary); }
.mono { font-family: ui-monospace, Consolas, monospace; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; } .gap-16 { gap: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }

/* App shell */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 12px;
  overflow-y: auto;
  z-index: 60;
  transition: transform 0.3s ease, width 0.3s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 700; font-size: 1.05rem; }
.sidebar-brand img { width: 28px; height: 28px; }
.nav-title { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 4px; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 0.85rem;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.nav-link i { width: 20px; text-align: center; }
.nav-link:hover { background: var(--card-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: rgba(var(--primary-rgb), 0.12); color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .nav-link span, .sidebar.collapsed .nav-title, .sidebar.collapsed .sidebar-brand span { display: none; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; transition: margin 0.3s ease; }
.sidebar.collapsed + .main { margin-left: 68px; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.content { padding: 20px; max-width: 1280px; margin: 0 auto; }
.page-head { margin-bottom: 18px; }
.page-head p { color: var(--muted); font-size: 0.85rem; }
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 55; }
.overlay.show { opacity: 1; pointer-events: auto; }

