:root {
  --bg: #0b0d12;          --surface: #12151c;    --surface-2: #181c26;
  --border: #232838;      --text: #e8ebf3;       --muted: #8b93a7;
  --accent: #6c8cff;      --accent-2: #a78bfa;   --success: #34d399;
  --warn: #fbbf24;        --danger: #f87171;
  --radius: 16px;         --shadow: 0 8px 30px rgba(0,0,0,.35);
  --font: 'Inter', system-ui, sans-serif;
}

[data-theme="light"] {
  --bg: #f6f7fb;          --surface: #ffffff;    --surface-2: #f0f2f8;
  --border: #e4e7f0;      --text: #141826;       --muted: #667085;
  --shadow: 0 8px 30px rgba(20,24,38,.08);
}

* { box-sizing: border-box; }

body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font);
  display: flex; height: 100vh; overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
#sidebar {
  width: 240px; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 24px; z-index: 10;
}
.brand {
  font-size: 1.25rem; font-weight: 600; display: flex; align-items: center; gap: 12px; margin-bottom: 40px;
}
.brand svg { color: var(--accent); }
.nav-links { display: flex; flex-direction: column; gap: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px; color: var(--muted);
  text-decoration: none; border-radius: 12px; font-weight: 500; transition: all 0.15s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--surface-2); color: var(--text);
}
.nav-item.active svg { color: var(--accent); }
.spacer { flex-grow: 1; }

#view {
  flex: 1; overflow-y: auto; padding: 40px; 
  max-width: 1100px; margin: 0 auto; width: 100%;
}

/* Components */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-2px); }

h1, h2, h3 { margin-top: 0; font-weight: 600; }
.view-header { margin-bottom: 32px; }

.btn {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  padding: 10px 16px; border-radius: 8px; cursor: pointer; font-family: var(--font);
  font-weight: 500; display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--border); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border: none; box-shadow: 0 4px 12px rgba(108, 140, 255, 0.3);
}
.btn-primary:hover { opacity: 0.9; }
.btn-icon { padding: 10px; }

/* Toasts */
#toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 12px; z-index: 100; }
.toast {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 16px 20px; border-radius: 12px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px; animation: slideIn 0.3s ease forwards;
}
.toast.error { border-left: 4px solid var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Mobile Bottom Nav */
@media (max-width: 768px) {
  body { flex-direction: column; }
  #sidebar { 
    width: 100%; border-right: none; border-top: 1px solid var(--border);
    order: 2; padding: 12px; flex-direction: row; justify-content: space-around;
    height: 70px; align-items: center; padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .brand, .nav-item span, .spacer, #theme-toggle { display: none; }
  .nav-links { display: flex; flex-direction: row; width: 100%; justify-content: space-around; gap: 0; }
  .nav-item { padding: 10px; border-radius: 50%; }
  #view { padding: 24px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}