/* ---------- App shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  max-width: 100vw;
}

.shell__sidebar {
  background: var(--bg-base);
  border-right: 1px solid var(--border-hairline);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.shell__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  padding: 4px 6px;
}

.shell__brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand-gradient);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 14px;
}

.shell__nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.shell__nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast);
}

.shell__nav-item:hover {
  background: var(--surface-card);
  color: var(--text-primary);
}

.shell__nav-item.is-active {
  background: var(--brand-primary-soft);
  color: var(--text-primary);
}

.shell__nav-item--admin {
  color: #c9b6ff;
}

.shell__nav-icon {
  width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.shell__profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: left;
}

.shell__profile:hover {
  background: var(--surface-card-hover);
}

.shell__profile-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shell__profile-text strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell__profile-text span {
  font-size: 11.5px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell__avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-display);
  font-size: 12.5px;
}

.shell__avatar--sm {
  width: 34px;
  height: 34px;
  min-width: 34px;
  font-size: 13px;
}

.shell__avatar--lg {
  width: 56px;
  height: 56px;
  font-size: 22px;
}

.shell__logout {
  color: var(--text-tertiary);
  font-size: 12.5px;
  padding: 6px 10px;
  text-align: left;
}

.shell__logout:hover {
  color: var(--danger);
}

/* ---------- Wallet identity top bar ---------- */
.shell__main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
}

.wallet-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 24px;
  border-bottom: 1px solid var(--border-hairline);
  position: sticky;
  top: 0;
  background: rgba(8, 9, 12, 0.85);
  backdrop-filter: blur(14px);
  z-index: 15;
}

.wallet-topbar__identity {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  min-width: 0;
  padding: 4px 6px 4px 4px;
  border-radius: var(--radius-full);
  transition: background var(--dur-fast) var(--ease-out);
}

.wallet-topbar__identity:hover {
  background: var(--surface-card);
}

.wallet-topbar__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.wallet-topbar__text strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.wallet-topbar__text .mono {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--surface-card-hover);
  color: var(--text-primary);
}

.icon-btn--tiny {
  width: 26px;
  height: 26px;
}

.wallet-menu {
  position: relative;
}

.wallet-menu__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 180px;
  z-index: 20;
  box-shadow: var(--shadow-raised);
}

.wallet-menu__item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-secondary);
  text-align: left;
}

.wallet-menu__item:hover {
  background: var(--surface-card);
  color: var(--text-primary);
}

.wallet-menu__item--danger:hover {
  color: var(--danger);
}

.shell__content {
  padding: 24px 28px 96px;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
  display: none;
}

/* ---------- Page structure ---------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.page-eyebrow {
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.page-header h1 {
  font-size: 22px;
}

.section-block {
  margin-top: 26px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h3 {
  font-size: 15px;
  font-weight: 600;
}

.link-more {
  font-size: 13px;
  color: var(--brand-primary);
  font-weight: 500;
}

.back-link {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin-bottom: 14px;
  display: inline-block;
}

.back-link:hover {
  color: var(--text-primary);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

/* ---------- Auth pages ---------- */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  box-shadow: var(--shadow-card);
}

.auth-card h2 {
  font-size: 21px;
}

.auth-sub {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin-top: 5px;
  line-height: 1.5;
}

.auth-row {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 16px;
}

.auth-link {
  font-size: 13px;
  color: var(--brand-primary);
}

.auth-switch {
  text-align: center;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 20px;
}

.auth-switch a {
  color: var(--brand-primary);
  font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .shell__sidebar {
    display: none;
  }

  .wallet-topbar {
    padding: 14px 16px;
  }

  .shell__content {
    padding: 18px 16px 100px;
    max-width: 100%;
  }

  .page-header h1 {
    font-size: 20px;
  }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 66px;
    background: rgba(12, 13, 17, 0.94);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--border-hairline);
    box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, 0.5);
    z-index: 30;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-tertiary);
    font-size: 10.5px;
    font-weight: 500;
    position: relative;
    transition: color var(--dur-fast) var(--ease-out);
  }

  .bottom-nav__item.is-active {
    color: var(--text-primary);
    font-weight: 600;
  }

  .bottom-nav__icon {
    display: flex;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    transition: background var(--dur-fast) var(--ease-out);
  }

  .bottom-nav__item.is-active .bottom-nav__icon {
    color: var(--brand-primary);
    background: var(--brand-primary-soft);
  }

  .bottom-nav__item:active .bottom-nav__icon {
    transform: scale(0.92);
  }
}
