:root {
  --navy-950: #08152f;
  --navy-900: #0b1a38;
  --navy-850: #102244;
  --navy-800: #14284d;
  --blue: #263e67;
  --orange: #f26a21;
  --orange-soft: #ff8a4c;
  --cream: #f4f6fa;
  --white: #ffffff;
  --ink: #17213a;
  --muted: #7d8799;
  --line: #e7eaf0;
  --green: #22a06b;
  --red: #c84b50;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: block; }
.main-content { min-width: 0; min-height: 100vh; background: linear-gradient(180deg, #edf1f7 0, #f6f7fa 340px, #edf1f7 100%); }
.top-brand { display: flex; align-items: center; gap: 10px; margin-right: 28px; color: var(--navy-950); text-decoration: none; font-family: "Manrope", sans-serif; font-size: 18px; font-weight: 700; }
.top-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 28px 18px 20px;
  color: white;
  background: var(--navy-950);
  border-right: 1px solid rgba(255,255,255,.04);
  z-index: 20;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 0 10px 34px;
  color: white; text-decoration: none;
  font-family: "Manrope", sans-serif; font-size: 20px; font-weight: 700;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--orange); transform: rotate(45deg);
  box-shadow: 0 8px 22px rgba(242,106,33,.22);
}
.brand-mark span { width: 14px; height: 14px; border: 2px solid white; border-radius: 50%; }
.brand-mark + span { letter-spacing: -.3px; }
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  height: 48px; display: flex; align-items: center; gap: 12px;
  padding: 0 13px; border-radius: 9px;
  color: #9daac2; text-decoration: none; font-size: 14px; font-weight: 600;
  transition: .18s ease;
}
.nav-item svg { width: 19px; height: 19px; fill: currentColor; }
.nav-item:hover { color: white; background: rgba(255,255,255,.05); }
.nav-item.active { color: white; background: var(--navy-800); box-shadow: inset 3px 0 var(--orange); }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding: 10px 8px; }
.environment { display: flex; align-items: center; gap: 8px; color: #aeb8ca; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #5ed29a; box-shadow: 0 0 0 3px rgba(94,210,154,.12); }
.status-dot.testnet { background: var(--orange-soft); box-shadow: 0 0 0 3px rgba(255,138,76,.12); }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #8e9bb2; }

.topbar {
  height: 96px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 38px;
  background: linear-gradient(110deg, var(--navy-950) 0%, #0d2043 72%, #142b52 100%);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 10px 28px rgba(8,21,47,.10);
}
.top-brand { grid-column: 1; }
.topbar-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 7px;
}
.network-pill {
  position: fixed;
  left: 50%;
  top: 48px;
  transform: translate(-50%, -50%);
  z-index: 45;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border-radius: 8px;
  color: #c2ccdc;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}
.topbar h1 { margin: 2px 0 0; font-family: "Manrope", sans-serif; font-size: 24px; letter-spacing: -.6px; color: white; }
.eyebrow { margin: 0; color: #93a3be; font-size: 11px; line-height: 1.2; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
.wallet-button, .primary-button {
  border: 0; display: flex; align-items: center; justify-content: center;
  background: var(--orange); color: white; font-weight: 700;
  box-shadow: 0 8px 18px rgba(242,106,33,.18);
  transition: .18s ease;
}
.wallet-button { height: 42px; gap: 8px; padding: 0 16px; border-radius: 8px; font-size: 13px; }
.wallet-button svg { width: 17px; height: 17px; fill: currentColor; }
.wallet-button:hover, .primary-button:hover { background: #dc5d1c; transform: translateY(-1px); }
.wallet-button:disabled, .primary-button:disabled { opacity: .65; cursor: wait; transform: none; }
.menu-button {
  display: none;
  background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.10);
}

.notice {
  margin: 18px 38px 0; min-height: 44px; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 8px 14px; border-radius: 8px;
  background: #fff2ef; color: #9a3e39; border: 1px solid #f3cdc6; font-size: 13px;
}
.notice[hidden] { display: none; }
.notice.info { background: #eef5ff; color: #345a8c; border-color: #d5e3f7; }
.notice button { border: 0; background: transparent; color: inherit; font-size: 20px; }

.hero {
  margin: 26px 38px 20px; min-height: 164px;
  display: flex; align-items: center; justify-content: space-between;
  overflow: hidden; position: relative;
  padding: 30px 34px;
  border-radius: 14px;
  color: white;
  background:
    radial-gradient(circle at 75% 20%, rgba(71,112,174,.24), transparent 18%),
    linear-gradient(120deg, #0b1a38 0%, #10284e 58%, #17335f 100%);
  box-shadow: 0 14px 30px rgba(24,47,89,.10);
}
.hero::after {
  content: ""; position: absolute; right: -52px; bottom: -92px;
  width: 270px; height: 270px; border: 1px solid rgba(255,255,255,.07); border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(255,255,255,.025), 0 0 0 68px rgba(255,255,255,.018);
}
.hero-copy, .hero-action { position: relative; z-index: 2; }
.hero-label { display: flex; align-items: center; gap: 8px; color: #bdc8da; font-size: 11px; text-transform: uppercase; letter-spacing: 1.1px; font-weight: 700; }
.hero h2 { margin: 10px 0 7px; font-family: "Manrope", sans-serif; font-size: 29px; letter-spacing: -.8px; }
.hero p { margin: 0; color: #abb7cb; font-size: 14px; }
.scan-price { display: inline-flex; align-items: baseline; gap: 7px; margin-top: 13px; color: #fff; font-family: "Manrope", sans-serif; font-size: 19px; font-weight: 700; }
.scan-price small { color: #abb7cb; font-family: "DM Sans", sans-serif; font-size: 10px; font-weight: 600; }
.hero-action { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.primary-button { width: 174px; height: 48px; gap: 12px; border-radius: 9px; }
.primary-button svg { width: 17px; height: 17px; fill: currentColor; }
.hero-action small { text-align: center; }
.hero-action small { color: #8392ac; font-size: 10px; }

.balance-grid { margin: 0 38px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.balance-card, .panel {
  background: white; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 5px 18px rgba(31,46,77,.035);
}
.balance-card { min-height: 176px; padding: 18px 20px 14px; }
.card-heading { display: flex; align-items: center; gap: 10px; }
.card-heading > div { min-width: 0; }
.card-heading p { margin: 0 0 2px; font-size: 13px; font-weight: 700; }
.card-heading div > span { color: #9aa3b2; font-size: 10px; }
.token-icon { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; font-weight: 700; }
.token-icon.trx { color: white; background: #d94653; }
.token-icon.usdt { color: white; background: #28a745; }
.token-icon.wallet-icon { background: #edf1f7; color: #5a6880; }
.wallet-icon svg { width: 18px; height: 18px; fill: currentColor; }
.connection-badge { margin-left: auto; align-self: flex-start; padding: 5px 7px; border-radius: 5px; background: #edf4f1; color: #26815b; font-size: 9px; font-weight: 700; }
.connection-badge.disconnected { background: #f1f3f6; color: #9aa3b2; }
.connection-badge.connected { background: rgba(34,160,107,.16); color: #78ddb3; }
.balance-value { height: 66px; display: flex; align-items: baseline; gap: 7px; padding-top: 12px; }
.balance-value > span:not(.placeholder) { font-family: "Manrope", sans-serif; font-size: 27px; letter-spacing: -.8px; }
.balance-value small { color: #9aa3b2; font-size: 11px; font-weight: 700; }
.placeholder { color: #bac2ce; }
.address-value { height: 66px; display: flex; align-items: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: "Manrope", sans-serif; font-size: 16px; }
.card-footer { min-height: 24px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #f0f2f5; padding-top: 10px; color: #9aa3b2; font-size: 9px; }
.card-footer span:last-child { text-align: right; }
.text-button { border: 0; background: transparent; color: var(--orange); font-size: 11px; font-weight: 700; padding: 4px; }

.content-grid { margin: 16px 38px 26px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .85fr); gap: 16px; }
.panel { min-height: 330px; padding: 20px; }
.panel-header { height: 46px; display: flex; align-items: flex-start; justify-content: space-between; }
.panel-header h3 { margin: 4px 0 0; font-family: "Manrope", sans-serif; font-size: 16px; }
.empty-state { height: 244px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-icon, .lock-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: #f1f3f7; color: #9aa5b7; }
.empty-icon svg, .lock-icon svg { width: 21px; height: 21px; fill: currentColor; }
.empty-state h4, .permission-lock h4 { margin: 12px 0 6px; font-size: 13px; }
.empty-state p, .permission-lock p { max-width: 330px; margin: 0; color: #9aa3b2; font-size: 11px; line-height: 1.65; }
.activity-list { max-height: 250px; overflow-y: auto; }
.activity-list[hidden] { display: none; }
.activity-row { min-height: 58px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid #f0f2f5; }
.activity-row:last-child { border-bottom: 0; }
.activity-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #edf4f1; color: #26815b; font-size: 15px; font-weight: 700; }
.activity-icon.sent { background: #fff2ef; color: #c35d4e; }
.activity-icon.activity { background: #f1f3f7; color: #7c8798; }
.activity-copy { min-width: 0; }
.activity-title { overflow: hidden; color: #27334b; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.activity-detail { overflow: hidden; margin-top: 3px; color: #9aa3b2; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.activity-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: #9aa3b2; font-size: 9px; white-space: nowrap; }
.activity-link { color: var(--orange); font-size: 9px; font-weight: 700; text-decoration: none; }
.activity-link:hover { text-decoration: underline; }
.locked-pill { padding: 6px 8px; border-radius: 5px; background: #f1f3f6; color: #929baa; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.permission-lock { height: 174px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border-bottom: 1px solid #f0f2f5; }
.permission-details { margin: 10px 0 0; }
.permission-details div { min-height: 29px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #f7f8fa; }
.permission-details div:last-child { border-bottom: 0; }
.permission-details dt { color: #a0a8b6; font-size: 9px; }
.permission-details dd { margin: 0; color: #6f7888; font-size: 9px; font-weight: 700; }
.page-footer { height: 54px; display: flex; justify-content: space-between; align-items: center; padding: 0 38px; color: #a2aaba; font-size: 10px; }

.switch-wallet-button {
  width: 100%; height: 48px; margin-top: 12px;
  border: 2px solid var(--orange); border-radius: 9px;
  background: linear-gradient(135deg, var(--orange), #dc5d1c);
  color: white;
  font-size: 13px; font-weight: 800;
  letter-spacing: .1px;
  box-shadow: 0 8px 18px rgba(242,106,33,.24);
  transition: .18s ease;
}
.switch-wallet-button:hover {
  border-color: #ff9d67;
  background: linear-gradient(135deg, #ff7a35, #d95617);
  color: white;
  transform: translateY(-1px);
}
.switch-wallet-button:active { transform: translateY(0); }

.wallet-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; opacity: 0; visibility: hidden; pointer-events: none; transition: .18s ease; }
.wallet-modal.open { opacity: 1; visibility: visible; pointer-events: auto; }
.wallet-modal-backdrop { position: absolute; inset: 0; background: rgba(4,12,28,.72); backdrop-filter: blur(6px); }
.wallet-modal-sheet { position: relative; width: min(420px, calc(100% - 28px)); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: white; box-shadow: 0 24px 70px rgba(4,12,28,.35); padding: 20px; }
.wallet-modal-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.wallet-modal-header h3 { margin: 4px 0 0; font-family: "Manrope", sans-serif; font-size: 18px; }
.wallet-modal-close { width: 34px; height: 34px; border: 0; border-radius: 8px; background: #f1f3f7; color: #68748a; font-size: 20px; }
.wallet-options { display: grid; gap: 8px; }
.wallet-options button { min-height: 68px; display: flex; align-items: center; gap: 12px; text-align: left; border: 1px solid #e5e9f0; border-radius: 10px; background: #fbfcfd; padding: 10px 12px; color: #1b2740; }
.wallet-options button:hover { border-color: #cbd3df; background: #f5f7fa; }
.wallet-options button:disabled { opacity: .6; cursor: wait; }
.wallet-options strong, .wallet-options small { display: block; }
.wallet-options strong { font-size: 13px; }
.wallet-options small { margin-top: 3px; color: #8792a4; font-size: 10px; }
.wallet-option-icon { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: #3375cc; color: white; font-weight: 800; }
.wallet-option-icon.tron { background: #d94653; }
.wallet-option-icon.wc { background: #2d72de; }
@media (max-width: 760px) { .wallet-modal-sheet { align-self: end; margin-bottom: 12px; } }

@media (max-width: 760px) {
  .topbar {
    height: 72px;
    grid-template-columns: auto 1fr auto;
    padding: 0 14px;
  }
  .top-brand { grid-column: 1; margin-right: 0; }
  .topbar-actions { grid-column: 3; margin-left: 0; }
  .wallet-button { width: 42px; min-width: 42px; padding: 0; }
  .wallet-button span { display: none; }
  .hero { margin: 16px 14px; min-height: 230px; padding: 24px 20px; }
  .hero h2 { font-size: 24px; }
  .hero-action { width: 100%; align-items: stretch; }
  .primary-button { width: 100%; }
  .balance-grid { margin: 0 14px; grid-template-columns: 1fr; }
  .content-grid { margin: 14px 14px 20px; grid-template-columns: 1fr; }
  .notice { margin: 12px 14px 0; }
  .page-footer { padding: 0 14px; }
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > span:last-child, .nav-item span, .environment span:last-child { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar-footer { justify-content: center; }
  .environment { display: none; }
  .balance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-card { grid-column: span 2; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .app-shell { display: block; }
  .top-brand { margin-right: 18px; }
  .balance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-card { grid-column: span 2; }
}

.account-card {
  background: white;
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 5px 18px rgba(31,46,77,.035);
}
.account-card .card-heading p { color: var(--ink); }
.account-card .card-heading div > span,
.account-card .card-footer { color: #9daac2; }
.account-card .card-footer { border-top-color: #f0f2f5; }
.account-card .wallet-icon { background: #edf1f7; color: #5a6880; }
.account-card .connection-badge.disconnected { background: #f1f3f6; color: #9aa3b2; }
.account-card .connection-badge.connected { background: #edf4f1; color: #26815b; }
