/* ============================================
   Shell — TopNav, page wrapper
   ============================================ */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(11,11,18,0.72);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line-1);
}
.topnav::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124,92,255,0.3), transparent);
  opacity: 0.6;
}
.topnav-left { display: flex; align-items: center; gap: 28px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 6px;
  border-radius: var(--r-3);
  transition: background var(--dur-2) var(--ease-out);
}
.brand:hover { background: rgba(255,255,255,0.04); }
.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.015em;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
  padding: 7px 12px;
  border-radius: var(--r-3);
  font-size: 13px;
  color: var(--text-3);
  transition: all var(--dur-2) var(--ease-out);
}
.nav-link:hover { color: var(--text-1); background: rgba(255,255,255,0.04); }
.nav-link.active { color: var(--text-1); background: rgba(255,255,255,0.06); box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset; }

.topnav-right { display: flex; align-items: center; gap: 12px; }

.quota {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-full);
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  color: var(--text-3);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.quota-text { white-space: nowrap; }
.quota-text b { color: var(--text-1); font-weight: 600; }
.quota-bar { width: 32px; height: 4px; border-radius: 99px; background: rgba(255,255,255,0.06); overflow: hidden; }
.quota-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--violet-400), var(--violet-300));
  box-shadow: 0 0 6px var(--violet-glow);
}

.user-menu {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px;
  padding: 0 8px 0 4px;
  border-radius: var(--r-3);
  border: 1px solid transparent;
  color: var(--text-2);
  transition: all var(--dur-2) var(--ease-out);
}
.user-menu:hover { background: rgba(255,255,255,0.04); border-color: var(--line-1); }
.uname { font-size: 13px; }
.avatar {
  width: 24px; height: 24px;
  border-radius: 99px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--violet-500), var(--violet-700));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  box-shadow: 0 0 0 1px rgba(124,92,255,0.3), 0 0 12px var(--violet-glow-soft);
}
.avatar.lg { width: 36px; height: 36px; font-size: 14px; }

.user-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 240px;
  padding: 6px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-4);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 1px 0 rgba(255,255,255,0.04) inset;
  display: flex; flex-direction: column;
  animation: enter-up 200ms var(--ease-out);
}
.user-pop-head { display: flex; align-items: center; gap: 10px; padding: 10px; }
.user-pop-divider { height: 1px; background: var(--line-1); margin: 4px 0; }
.user-pop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-2);
  font-size: 13px; color: var(--text-2); text-align: left;
  transition: all var(--dur-2) var(--ease-out);
}
.user-pop-item:hover { background: rgba(255,255,255,0.05); color: var(--text-1); }
.user-pop-item.danger { color: var(--danger); }
.user-pop-item.danger:hover { background: rgba(248,113,113,0.10); color: #fca5a5; }

/* — Page container — */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 32px 80px;
  width: 100%;
}

.page-header { margin-bottom: 28px; }
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--violet-300);
  margin-bottom: 8px;
}
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-header-row > div:first-child { min-width: 0; flex: 1; }
.page-subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-actions { flex-shrink: 0; }
.page-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-1);
  background: linear-gradient(180deg, #fff 0%, #c8c8d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-subtitle { color: var(--text-3); font-size: 14px; margin-top: 6px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* — Toast stack — */
.toast-stack {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast-stack > * { pointer-events: auto; }

/* — Stripe thumbnail — */
.stripe-thumb {
  border-radius: var(--r-3);
  overflow: hidden;
  background: #0a0a14;
  border: 1px solid var(--line-1);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
}
