.dashboard-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(12, 147, 174, 0.34), transparent 28rem),
    radial-gradient(circle at 78% 8%, rgba(100, 82, 202, 0.22), transparent 36rem),
    linear-gradient(150deg, #06101d 0%, #071425 34%, #0b1730 66%, #070816 100%);
}

.console-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: 320px;
  padding: 1.15rem;
  border-right: 1px solid rgba(51, 226, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(3, 8, 20, 0.97), rgba(5, 8, 22, 0.98)),
    rgba(4, 9, 20, 0.96);
  box-shadow: 18px 0 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.menu-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.console-brand {
  flex: 1;
  padding: 0.78rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
}

.sidebar-close {
  display: none;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #f4f8ff;
  background: rgba(255, 255, 255, 0.06);
  font-size: 1.35rem;
}

.menu-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 1rem;
}

.wallet-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  color: #cbd8ea;
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.9rem;
}

.menu-search {
  position: relative;
  margin-bottom: 1rem;
}

.menu-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.menu-search input {
  min-height: 58px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.055);
  font-size: 1rem;
}

.console-nav {
  display: grid;
  gap: 0.58rem;
  margin-top: 0.35rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.console-nav a {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 56px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  color: #f1f6ff;
  background: rgba(255, 255, 255, 0.04);
}

.console-nav a span {
  display: grid;
  width: 24px;
  place-items: center;
  color: var(--cyan);
}

.console-nav a:hover,
.console-nav a.active {
  border-color: rgba(35, 231, 255, 0.4);
  background: rgba(35, 231, 255, 0.08);
  box-shadow: 0 0 28px rgba(35, 231, 255, 0.08);
}

.sidebar-footer {
  display: grid;
  gap: 0.85rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.footer-balances {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.logout-wide {
  width: 100%;
  min-height: 54px;
}

.console-shell {
  min-height: 100vh;
  margin-left: 320px;
}

.console-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 96px;
  padding: 1rem 1.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(110deg, rgba(6, 28, 43, 0.93), rgba(9, 12, 30, 0.94)),
    rgba(8, 10, 24, 0.9);
  backdrop-filter: blur(18px);
}

.console-kicker {
  margin: 0 0 0.24rem;
  color: #90e7f2;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.24em;
}

.console-topbar h1 {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.05;
}

.sidebar-toggle {
  display: none;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(35, 231, 255, 0.25);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 1.3rem;
}

.console-walletbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.balance-pill,
.network-pill,
.wallet-button,
.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  padding: 0.48rem 0.78rem;
  color: #eef6ff;
  background: rgba(255, 255, 255, 0.055);
  font-weight: 760;
  white-space: nowrap;
}

.balance-pill:first-child,
.token-balance-label {
  border-color: rgba(255, 196, 61, 0.38);
  color: #ffe9a8;
  background: rgba(255, 196, 61, 0.09);
}

.network-pill {
  border-color: rgba(40, 232, 165, 0.35);
  color: #d1ffe9;
  background: rgba(40, 232, 165, 0.08);
}

.network-pill.warning,
.state-pill.warning {
  border-color: rgba(255, 196, 61, 0.46);
  color: #ffe7a2;
}

.network-pill.danger,
.state-pill.danger {
  border-color: rgba(255, 108, 141, 0.58);
  color: #ffd1da;
}

.wallet-button {
  min-width: 152px;
  justify-content: center;
  border-radius: 8px;
  border-color: rgba(152, 166, 199, 0.22);
}

.wallet-button.muted { color: var(--muted); }

.console-main {
  width: min(100%, 1540px);
  margin: 0 auto;
  padding: 1.7rem;
}

.page-grid,
.metric-grid,
.quick-action-grid,
.ghb-grid,
.two-col-grid,
.package-card-grid,
.income-type-grid {
  display: grid;
  gap: 1rem;
}

.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.two-col-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.quick-action-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.package-card-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.income-type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.panel-card,
.metric-card,
.profile-hero,
.action-tile,
.tree-stage,
.route-panel,
.referral-card,
.package-card-ui,
.income-type-card,
.matrix-card {
  position: relative;
  border: 1px solid rgba(35, 231, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(34, 50, 82, 0.86), rgba(19, 24, 52, 0.8)),
    rgba(255, 255, 255, 0.035);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.panel-card::after,
.metric-card::after,
.profile-hero::after,
.action-tile::after,
.route-panel::after,
.referral-card::after,
.package-card-ui::after,
.income-type-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 196, 61, 0.14);
  border-radius: inherit;
  pointer-events: none;
  mask-image: linear-gradient(135deg, transparent, black 35%, transparent 82%);
}

.profile-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  min-height: 218px;
  padding: 1.65rem;
  background:
    linear-gradient(125deg, rgba(20, 94, 121, 0.46), rgba(39, 57, 111, 0.64), rgba(53, 46, 100, 0.62)),
    rgba(255, 255, 255, 0.04);
}

.profile-hero h2 {
  margin: 0.35rem 0 1rem;
  font-size: clamp(1.85rem, 5vw, 2.4rem);
  line-height: 1;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.profile-actions code,
.wallet-card-chip {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  padding: 0.68rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
}

.profile-icon,
.card-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(35, 231, 255, 0.28);
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(35, 231, 255, 0.09);
  font-size: 1.7rem;
}

.metric-card,
.route-panel,
.panel-card,
.referral-card,
.package-card-ui,
.income-type-card,
.matrix-card {
  padding: 1.15rem;
}

.metric-card {
  min-height: 158px;
  display: grid;
  align-content: space-between;
}

.metric-card span,
.small-label,
.card-label {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.78rem;
}

.card-icon {
  width: 50px;
  height: 50px;
  margin-left: auto;
  font-size: 1.25rem;
}

.state-row,
.button-row,
.form-row,
.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.state-row { margin-top: 1rem; }

.state-pill {
  min-height: 34px;
  border-color: rgba(40, 232, 165, 0.34);
  color: #d3ffed;
  background: rgba(40, 232, 165, 0.09);
}

.route-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.route-title h2 {
  margin: 0.15rem 0 0;
  font-size: clamp(2rem, 5vw, 2.7rem);
}

.quick-action-grid {
  margin-top: 1rem;
}

.action-tile {
  display: grid;
  align-content: space-between;
  min-height: 138px;
  padding: 1.05rem;
}

.action-tile-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--cyan);
  font-size: 1.35rem;
}

.action-tile strong {
  display: block;
  margin-top: 1.2rem;
  font-size: 1.12rem;
}

.action-tile small {
  color: var(--muted);
}

.referral-card {
  margin-top: 1rem;
  padding: 1.45rem;
  background:
    linear-gradient(145deg, rgba(46, 72, 118, 0.78), rgba(40, 38, 89, 0.78)),
    rgba(255, 255, 255, 0.04);
}

.referral-card h3 {
  margin: 0.8rem 0 0.45rem;
  font-size: clamp(1.75rem, 5vw, 2.3rem);
}

.referral-link-box {
  display: flex;
  align-items: center;
  min-height: 62px;
  margin: 0.8rem 0 1rem;
  border: 1px solid rgba(35, 231, 255, 0.24);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  color: #dffaff;
  background: rgba(35, 231, 255, 0.1);
  overflow-wrap: anywhere;
}

label { display: grid; gap: 0.35rem; color: #e2ebf8; }

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(167, 179, 200, 0.22);
  border-radius: 8px;
  padding: 0.72rem 0.85rem;
  color: var(--text);
  background: rgba(2, 6, 18, 0.72);
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(35, 231, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(35, 231, 255, 0.1);
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  margin-top: 0.7rem;
}

.ghb-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.ghb-migration-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 196, 61, 0.38);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  color: #fff3c7;
  background:
    linear-gradient(135deg, rgba(255, 196, 61, 0.16), rgba(35, 231, 255, 0.08)),
    rgba(8, 11, 28, 0.82);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.22);
}

.ghb-migration-banner strong {
  display: block;
  margin-bottom: 0.18rem;
  color: #fff7df;
}

.ghb-migration-banner p {
  margin: 0;
  color: #d7e4f7;
}

.lock-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid rgba(255, 196, 61, 0.46);
  border-radius: 999px;
  padding: 0.4rem 0.72rem;
  color: #ffe7a2;
  background: rgba(255, 196, 61, 0.12);
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.ghb-locked-button,
.ghb-locked-button:hover {
  border-color: rgba(255, 196, 61, 0.5);
  color: #ffe7a2;
  background:
    linear-gradient(135deg, rgba(255, 196, 61, 0.13), rgba(35, 231, 255, 0.08)),
    rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  cursor: not-allowed;
  opacity: 0.92;
  transform: none;
}

.ghb-locked-button[aria-disabled="true"] {
  pointer-events: auto;
}

.ghb-info-card {
  border-color: rgba(255, 196, 61, 0.24);
}

.mini-card {
  padding: 0.95rem;
  border: 1px solid rgba(35, 231, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.mini-card dl,
.package-card-ui dl,
.income-type-card dl,
.matrix-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.8rem;
  margin: 0.9rem 0 0;
}

.mini-card dt,
.package-card-ui dt,
.income-type-card dt,
.matrix-card dt {
  color: var(--muted);
}

.mini-card dd,
.package-card-ui dd,
.income-type-card dd,
.matrix-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.package-card-ui h3,
.income-type-card h3 {
  margin-bottom: 0.25rem;
}

.package-price {
  display: block;
  margin: 0.35rem 0 0.8rem;
  color: var(--gold);
  font-size: 1.65rem;
  font-weight: 900;
}

.package-card-ui .button-row,
.income-type-card .button-row {
  margin-top: 1rem;
}

.tree-toolbar {
  display: grid;
  grid-template-columns: 1fr 160px 180px auto auto;
  gap: 0.8rem;
  align-items: end;
  margin-bottom: 1rem;
}

.tree-stage { overflow: hidden; }

.tree-scroll {
  min-height: 520px;
  overflow: auto;
  padding: 1.2rem;
}

.tree-canvas {
  min-width: 760px;
  transform-origin: top center;
}

.tree-level { display: flex; justify-content: center; gap: 1rem; }

.tree-branch {
  display: grid;
  justify-items: center;
  gap: 1.1rem;
  min-width: 190px;
}

.tree-children {
  display: flex;
  gap: 1rem;
  position: relative;
}

.tree-children::before {
  content: "";
  position: absolute;
  top: -0.6rem;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(35, 231, 255, 0.7), transparent);
}

.tree-node {
  width: 180px;
  min-height: 154px;
  padding: 0.72rem;
  border: 1px solid rgba(35, 231, 255, 0.36);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(20, 31, 55, 0.96), rgba(8, 14, 30, 0.9));
  box-shadow: 0 0 28px rgba(35, 231, 255, 0.1);
}

.tree-node.empty {
  border-style: dashed;
  color: var(--muted);
}

.tree-node header {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.tree-node dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.24rem 0.4rem;
  margin: 0.6rem 0 0;
  font-size: 0.76rem;
}

.tree-node dt { color: var(--muted); }
.tree-node dd { margin: 0; }

.tree-list {
  display: none;
  gap: 0.8rem;
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.compact-tree .tree-node { width: 140px; min-height: 112px; }
.compact-tree .tree-node dl { display: none; }
.compact-tree .tree-branch { min-width: 150px; }

.claimed-mask {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 0.35rem;
}

.claimed-mask span {
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.claimed-mask span.on {
  border-color: rgba(40, 232, 165, 0.45);
  background: rgba(40, 232, 165, 0.22);
}

.sidebar-backdrop { display: none; }
.console-mobile-nav { display: none; }

@media (max-width: 1180px) {
  .metric-grid,
  .quick-action-grid,
  .income-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tree-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .console-sidebar {
    width: min(94vw, 520px);
    transform: translateX(-105%);
    transition: transform 180ms ease;
    border-right: 0;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.52);
  }
  .console-sidebar.open { transform: translateX(0); }
  .sidebar-close { display: inline-grid; place-items: center; }
  .sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(3px);
  }
  .console-shell {
    margin-left: 0;
    padding-bottom: 82px;
  }
  .sidebar-toggle { display: inline-flex; }
  .console-topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    min-height: auto;
    padding: 1.1rem 0.95rem 1rem;
  }
  .console-topbar > div:first-of-type {
    flex: 1;
    min-width: 210px;
  }
  .console-walletbar {
    width: 100%;
    justify-content: flex-start;
  }
  .console-main { padding: 0.95rem; }
  .metric-grid,
  .two-col-grid,
  .income-type-grid {
    grid-template-columns: 1fr;
  }
  .quick-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-hero,
  .route-title {
    flex-direction: column;
    align-items: flex-start;
  }
  .profile-hero {
    min-height: 260px;
    padding: 1.45rem;
  }
  .copy-field { grid-template-columns: 1fr; }
  .tree-list { display: grid; }
  .console-mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 32;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 9, 21, 0.98);
    backdrop-filter: blur(18px);
  }
  .console-mobile-nav a,
  .console-mobile-nav button {
    display: grid;
    place-items: center;
    gap: 0.2rem;
    min-height: 70px;
    border: 0;
    color: #d7e5f8;
    background: transparent;
    font-size: 0.78rem;
  }
  .console-mobile-nav span {
    color: #f2f6ff;
    font-size: 1.25rem;
  }
  .console-mobile-nav a.active {
    color: var(--cyan);
    background: rgba(35, 231, 255, 0.08);
  }
  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
    min-width: 0;
    width: 100%;
  }
  .table-wrap thead { display: none; }
  .table-wrap tr {
    margin-bottom: 0.85rem;
    border: 1px solid rgba(35, 231, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
  }
  .table-wrap td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
}

@media (max-width: 520px) {
  .console-walletbar > * {
    width: auto;
    justify-content: center;
  }
  .console-walletbar .wallet-button {
    width: 100%;
  }
  .metric-card {
    min-height: 176px;
    padding: 1.25rem;
  }
  .metric-card strong { font-size: 1.55rem; }
  .quick-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-tile { min-height: 132px; }
  .tree-canvas { min-width: 620px; }
  .tree-scroll { min-height: 420px; }
}
