:root {
  --bg: #0e0f12;
  --bg-elevated: #16181d;
  --bg-hover: #1e2128;
  --border: #262a33;
  --text: #e8e9ec;
  --text-dim: #9297a3;
  --text-faint: #61656f;
  --accent: #6d8bff;
  --accent-soft: rgba(109, 139, 255, 0.12);
  --radius: 8px;
  --topbar-h: 56px;
  --sidebar-w: 220px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }

/* Topbar */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-mark {
  color: var(--accent);
  font-size: 16px;
}

.logo-text {
  font-weight: 600;
  letter-spacing: 0.2px;
  font-size: 15px;
}

.topbar-right {
  position: relative;
}

.user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 5px 8px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.user-trigger:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #0e0f12;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.user-name {
  color: var(--text-dim);
}

.chevron {
  color: var(--text-faint);
  transition: transform 0.15s ease;
}

.user-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.user-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
}

.user-menu.open {
  display: flex;
}

.user-menu-item {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
}

.user-menu-item:hover {
  background: var(--bg-hover);
}

.user-menu-item--muted {
  color: var(--text-dim);
}

.user-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 2px;
}

/* Shell */
.app-shell {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 13.5px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.content {
  flex: 1;
  padding: 28px 32px;
}

/* Placeholder page content */
.page-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}

.page-sub {
  color: var(--text-dim);
  font-size: 13.5px;
  margin: 0 0 24px;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
