/* ============================================================
   Nova — dashboard
   ============================================================ */

body.dash {
  background: var(--bg-soft);
  font-size: 14px;
}

/* ------------------------------------------------------------ sidebar */

.dash-side {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: 248px;
  padding: 18px 14px 16px;
  background: #fff;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.dash-brand {
  padding: 4px 10px 20px;
  gap: 8px;
}
.dash-brand .brand-mark {
  width: 25px;
  height: 25px;
  border-radius: 7px;
}
.dash-brand .brand-mark svg {
  width: 15px;
  height: 15px;
}
.dash-brand .brand-word {
  font-size: 20px;
}
.dash-env {
  margin-left: auto;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.dash-nav {
  display: grid;
  gap: 2px;
  align-content: start;
}
.dash-nav-label {
  padding: 14px 10px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.dash-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
  transition: background 0.15s, color 0.15s;
}
.dash-nav-link .icon {
  width: 16px;
  height: 16px;
  opacity: 0.55;
}
.dash-nav-link:hover {
  background: var(--bg-soft);
  color: var(--ink);
}
.dash-nav-link.is-active {
  background: var(--blurple-50);
  color: var(--blurple-700);
  font-weight: 600;
}
.dash-nav-link.is-active .icon {
  opacity: 1;
  color: var(--blurple);
}
.dash-side-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.dash-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
}
.dash-user strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.dash-user div span {
  display: block;
  font-size: 10.5px;
  color: var(--faint);
  line-height: 1.3;
}
.dash-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(140deg, #8b85ff, #635bff);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  flex: none;
}
.dash-avatar--top {
  width: 30px;
  height: 30px;
}
.dash-side-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--green-soft);
  font-size: 10.5px;
  font-weight: 500;
  color: #0c7a52;
}
.dash-side-status .live-dot {
  width: 5px;
  height: 5px;
}

/* -------------------------------------------------------------- shell */

.dash-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: 248px;
}
.dash-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 62px;
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  border-bottom: 1px solid var(--line);
}
.dash-crumb {
  font-size: 12.5px;
  color: var(--faint);
  white-space: nowrap;
}
.dash-crumb span {
  margin: 0 6px;
  opacity: 0.6;
}
.dash-crumb strong {
  color: var(--slate);
  font-weight: 500;
}
.dash-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.dash-testmode {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dash-ticker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: #fff;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dash-ticker-label {
  color: var(--faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.dash-ticker strong {
  font-weight: 650;
  color: var(--ink);
}
.dash-ticker > span:last-child {
  font-size: 10.5px;
  font-weight: 600;
}
.dash-ticker .live-dot {
  width: 5px;
  height: 5px;
}
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition: background 0.16s, color 0.16s, border-color 0.16s;
  flex: none;
}
.icon-btn:hover {
  background: var(--bg-soft);
  border-color: var(--line);
  color: var(--ink);
}
.icon-btn .icon {
  width: 16px;
  height: 16px;
}
.notif-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink);
  border: 1.5px solid #fff;
}
.dash-menu-btn {
  display: none;
}

.dash-main {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 26px 40px;
}
.dash-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.dash-page-head h1 {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.2;
}
.dash-page-head p {
  margin-top: 5px;
  font-size: 13px;
  color: var(--muted);
}
.dash-page-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(330px, 1fr);
  gap: 18px;
  align-items: start;
}
.dash-col-main,
.dash-col-side {
  display: grid;
  gap: 18px;
  min-width: 0;
}

/* --------------------------------------------------------------- cards */

.dash-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 1px 2px rgba(10, 37, 64, 0.03);
  min-width: 0;
}
.dash-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.dash-card-head h2 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.dash-card-head p {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
}
.dash-card-head .badge {
  font-size: 10px;
  padding: 3px 8px;
}

/* chart */
.chart-card {
  padding-bottom: 14px;
}
.range-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: var(--bg-soft);
}
.range-tabs button {
  padding: 5px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.16s, color 0.16s;
}
.range-tabs button.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.chart-headline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.chart-headline > strong {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.chart-headline .badge {
  font-size: 10.5px;
  padding: 3px 8px;
}
.chart-highlow {
  margin-left: auto;
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.chart-highlow strong {
  color: var(--slate);
  font-weight: 600;
}
#dashChart {
  width: 100%;
  height: 236px;
  margin-top: 6px;
}
.chart-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  font-size: 10.5px;
  color: var(--faint);
}
.chart-foot > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart-foot .live-dot {
  width: 5px;
  height: 5px;
}

/* transactions */
.tx-card {
  padding-bottom: 16px;
}
.tx-filters {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: var(--bg-soft);
}
.tx-filters button {
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.16s, color 0.16s;
}
.tx-filters button.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.tx-table {
  margin-top: 2px;
}
.tx-head {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 0.9fr 0.75fr 0.75fr;
  gap: 12px;
  padding: 8px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--faint);
}
.tx-col-amount {
  text-align: right;
}
.tx-list {
  display: block;
}
.tx-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 0.9fr 0.75fr 0.75fr;
  gap: 12px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid #f2f5f9;
  transition: background 0.14s;
}
.tx-row:hover {
  background: #fafcff;
}
.tx-row:last-child {
  border-bottom: 0;
}
.tx-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.tx-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  flex: none;
}
.tx-icon .icon {
  width: 14px;
  height: 14px;
}
.tx-icon--in {
  background: var(--green-soft);
  color: #0c7a52;
}
.tx-icon--out {
  background: #eef1ff;
  color: var(--blurple);
}
.tx-icon--purchase {
  background: #fff4e0;
  color: #b26b00;
}
.tx-icon--yield {
  background: #e8f8ff;
  color: #0b84b8;
}
.tx-icon--faucet {
  background: var(--bg-soft);
  color: var(--muted);
}
.tx-main div {
  min-width: 0;
}
.tx-name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}
.tx-sub {
  display: block;
  font-size: 10.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.tx-date {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.tx-status {
  justify-self: start;
}
.tx-status.badge {
  font-size: 9.5px;
  padding: 2px 7px;
}
.tx-amount {
  text-align: right;
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}
.tx-amount.is-in {
  color: #0c7a52;
}
.tx-empty {
  padding: 34px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
}
.tx-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--faint);
}
.tx-foot .link-arrow {
  font-size: 12px;
}

/* balance */
.balance-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(155deg, #0d2c4e 0%, #0a2540 58%, #071a2e 100%);
  color: #fff;
  box-shadow: 0 24px 50px -28px rgba(10, 37, 64, 0.55);
}
.balance-card::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -60px;
  width: 300px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 91, 255, 0.5), transparent 65%);
  pointer-events: none;
}
.balance-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 100% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 90% 70% at 100% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}
.balance-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #9fb0c4;
}
.balance-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 500;
  color: #6ee7b7;
}
.balance-live .live-dot {
  width: 5px;
  height: 5px;
  background: #2ecc9a;
}
.balance-live .live-dot::after {
  border-color: #2ecc9a;
}
.balance-nova {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 14px;
}
.balance-nova > span:first-child {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.balance-unit {
  font-size: 12px;
  font-weight: 600;
  color: #9fb0c4;
}
.balance-usd {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  font-size: 12.5px;
  color: #8fa2b7;
  font-variant-numeric: tabular-nums;
}
.balance-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.balance-stats span {
  display: block;
  font-size: 10.5px;
  color: #8fa2b7;
}
.balance-stats strong {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.balance-address {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #b8c4d2;
  font-size: 11px;
  text-align: left;
  transition: background 0.16s, border-color 0.16s;
}
.balance-address:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.balance-address > .icon {
  width: 14px;
  height: 14px;
  flex: none;
  opacity: 0.8;
}
.balance-address .mono {
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.balance-copy {
  opacity: 0.6;
}
.balance-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* send */
.send-card .field {
  margin-bottom: 12px;
}
.send-card .input {
  height: 40px;
  font-size: 13px;
}
.amount-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.amount-wrap .input {
  padding-right: 104px;
  font-variant-numeric: tabular-nums;
}
.amount-unit {
  position: absolute;
  right: 12px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--faint);
  letter-spacing: 0.04em;
  pointer-events: none;
}
.amount-max {
  position: absolute;
  right: 48px;
  padding: 3px 7px;
  border: 1px solid #ddd9ff;
  border-radius: 5px;
  background: var(--blurple-50);
  color: var(--blurple);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.amount-max:hover {
  background: var(--blurple-100);
}
.send-fee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 2px 0 14px;
  font-size: 10.5px;
  color: var(--faint);
}
.send-fee strong {
  color: var(--slate);
  font-weight: 600;
}
.send-card .btn[type='submit'] {
  height: 42px;
}

/* api keys */
.keys-card .icon-btn {
  width: 28px;
  height: 28px;
}
.key-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 7px;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  background: #fafcff;
}
.key-label {
  flex: none;
  width: 70px;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.key-value {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.key-value.is-masked {
  letter-spacing: 0.08em;
  color: var(--muted);
}
.key-actions {
  display: flex;
  gap: 2px;
}
.keys-note {
  margin-top: 9px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--faint);
}

/* faucet */
.faucet-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}
.faucet-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--blurple-50);
  border: 1px solid #e8e5ff;
  color: var(--blurple);
  flex: none;
}
.faucet-icon .icon {
  width: 16px;
  height: 16px;
}
.faucet-card div {
  flex: 1;
  min-width: 0;
}
.faucet-card h2 {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.faucet-card p {
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--muted);
}
.faucet-card .btn {
  flex: none;
}

.dash-disclaimer {
  max-width: 760px;
  margin: 28px auto 0;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--faint);
}

/* loading shimmer */
.is-loading {
  color: transparent !important;
  background: linear-gradient(90deg, #eef2f7 25%, #f7fafc 50%, #eef2f7 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* ------------------------------------------------------- responsive */

@media (max-width: 1240px) {
  .dash-col-side {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
  .dash-col-side .balance-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-col-main {
    order: 1;
  }
  .dash-col-side {
    order: 2;
    grid-template-columns: 1fr 1fr;
  }
  .dash-col-side .balance-card {
    grid-column: 1 / -1;
  }
  .dash-col-side .send-card {
    grid-row: span 2;
  }
}

@media (max-width: 980px) {
  .dash-side {
    transform: translateX(-100%);
    transition: transform 0.26s var(--ease);
    box-shadow: 24px 0 60px -30px rgba(10, 37, 64, 0.4);
  }
  .dash-side.is-open {
    transform: none;
  }
  .dash-shell {
    margin-left: 0;
  }
  .dash-menu-btn {
    display: grid;
  }
  .dash-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(10, 37, 64, 0.42);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s, visibility 0.22s;
  }
  .dash-overlay.is-open {
    opacity: 1;
    visibility: visible;
  }
  .balance-nova > span:first-child {
    font-size: 32px;
  }
}

@media (max-width: 720px) {
  .dash-top {
    padding: 0 16px;
    gap: 8px;
  }
  .dash-main {
    padding: 20px 16px 32px;
  }
  .dash-testmode,
  .dash-ticker-label,
  .dash-crumb span,
  .dash-crumb {
    display: none;
  }
  .dash-crumb strong {
    font-size: 12.5px;
  }
  .dash-page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .dash-page-actions {
    width: 100%;
  }
  .dash-page-actions .btn {
    flex: 1;
  }
  .dash-col-side {
    grid-template-columns: 1fr;
  }
  .dash-col-side .send-card {
    grid-row: auto;
  }
  .tx-head {
    grid-template-columns: minmax(0, 1fr) 0.8fr;
  }
  .tx-col-date,
  .tx-col-status {
    display: none;
  }
  .tx-row {
    grid-template-columns: minmax(0, 1fr) 0.8fr;
  }
  .tx-date,
  .tx-status {
    display: none;
  }
  .tx-foot .link-arrow {
    display: none;
  }
  .chart-highlow {
    width: 100%;
    margin-left: 0;
    order: 3;
  }
  #dashChart {
    height: 200px;
  }
  .dash-card-head {
    flex-wrap: wrap;
  }
}

@media (max-width: 460px) {
  .dash-ticker {
    padding: 5px 9px;
  }
  .chart-headline > strong {
    font-size: 22px;
  }
  .balance-nova > span:first-child {
    font-size: 28px;
  }
  .dash-card {
    padding: 16px;
  }
}
