* , *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--surface-bg);
  color: var(--text-primary);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }
::selection { background: rgba(109,40,245,0.18); }

/* Background ambient blobs */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-aurora span {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}
.bg-aurora span:nth-child(1) { width: 480px; height: 480px; background: #8b5cf6; top: -160px; left: -120px; }
.bg-aurora span:nth-child(2) { width: 420px; height: 420px; background: #06b6d4; top: 40%; right: -140px; }
.bg-aurora span:nth-child(3) { width: 360px; height: 360px; background: #f472b6; bottom: -160px; left: 30%; opacity: 0.18; }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface-sidebar);
  border-right: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-4);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-2) var(--space-5);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--surface-border-soft);
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 17px;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 17px; line-height: 1.1; }
.brand-name span { display: block; font-family: var(--font-body); font-weight: 500; font-size: 11px; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 2px; }

.nav-group { margin-bottom: var(--space-5); }
.nav-group-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 2px;
  position: relative;
  transition: background .15s ease, color .15s ease;
}
.nav-link .ic { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.75; }
.nav-link:hover { background: var(--surface-card-alt); color: var(--text-primary); }
.nav-link.active {
  color: var(--brand-violet);
  background: var(--brand-gradient-soft);
}
.nav-link.active .ic { opacity: 1; }
.nav-link .badge-count {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--surface-border-soft);
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--surface-border-soft);
}
.wallet-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  color: #fff;
}
.wallet-pill .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; opacity: 0.85; }
.wallet-pill .amount { font-family: var(--font-display); font-size: 19px; font-weight: 800; }

/* Main column */
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--surface-border);
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title h1 { font-size: 19px; }
.topbar-title .crumb { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: var(--space-4); }

.search-box {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--surface-card-alt);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  color: var(--text-muted);
  font-size: 13px;
  width: 240px;
}
.search-box input { border: none; background: transparent; outline: none; flex: 1; color: var(--text-primary); }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--surface-border);
  background: var(--surface-card);
  color: var(--text-secondary);
  position: relative;
}
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 1.5px solid #fff; }

.profile-chip { display: flex; align-items: center; gap: var(--space-2); padding: 4px 10px 4px 4px; border-radius: var(--radius-pill); border: 1px solid var(--surface-border); background: var(--surface-card); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12.5px; flex-shrink: 0;
}
.profile-chip .who { line-height: 1.15; }
.profile-chip .who .name { font-weight: 700; font-size: 12.5px; }
.profile-chip .who .role { font-size: 10.5px; color: var(--text-muted); }

.content {
  padding: var(--space-6);
  flex: 1;
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: var(--space-5); flex-wrap: wrap; gap: var(--space-3); }
.page-head h2 { font-size: 22px; }
.page-head .sub { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

@media (max-width: 1080px) {
  .sidebar { display: none; }
  .search-box { display: none; }
}
