:root {
  color-scheme: dark;
  --bg: #0f172a;
  --card: #141c2a;
  --card-soft: #111827;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: #334155;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-cool: #8b5cf6;
  --success: #0a7c45;
  --danger: #ad2020;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.landing-page {
  background:
    radial-gradient(circle at 50% 38%, rgba(245, 158, 11, 0.12), transparent 28%),
    radial-gradient(circle at 52% 58%, rgba(139, 92, 246, 0.1), transparent 24%),
    #000000;
  min-height: 100vh;
}

.landing-screen {
  align-items: center;
  background: transparent;
  cursor: default;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
}

.loading-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 280px;
  width: min(360px, 80vw);
}

.loading-orbit {
  filter: drop-shadow(0 0 26px rgba(245, 158, 11, 0.24));
  max-width: 76vw;
}

.loader-rails {
  animation: loader-spin 1.4s linear infinite;
}

.loader-ticks {
  animation: loader-spin 5s linear infinite reverse;
  stroke: #475569;
  stroke-linecap: round;
  stroke-width: 2;
}

.loader-value {
  fill: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 42px;
  font-weight: 800;
}

.loader-caption {
  fill: #94a3b8;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.landing-screen.is-stalled .loader-caption {
  fill: #f87171;
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.access-panel {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid #334155;
  border-radius: 8px;
  color: #ffffff;
  left: 50%;
  padding: 20px;
  position: fixed;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(320px, calc(100% - 32px));
}

.access-panel input {
  background: #000000;
  border-color: #333333;
  color: #ffffff;
}

.access-status {
  color: #ff8b8b;
  font-weight: 800;
  margin: 12px 0 0;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.admin-page {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 1)),
    #0f172a;
  color: var(--text);
  min-height: 100vh;
}

.site-header {
  padding: 32px 0 24px;
  background: linear-gradient(135deg, #13214b, #2548f5);
  color: white;
}

.header-content {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 0;
}

h2 {
  margin-bottom: 10px;
}

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.site-header .eyebrow {
  color: rgba(255, 255, 255, 0.75);
}

.badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 13px;
  white-space: nowrap;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  margin: 0 0 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.intro-card {
  margin-top: -12px;
}

.dashboard-layout {
  display: grid;
  gap: 28px;
  grid-template-columns: 260px minmax(0, 1fr);
  margin: 0 auto;
  max-width: 1480px;
  min-height: 100vh;
  padding: 24px;
}

.admin-sidebar {
  align-self: stretch;
  background: rgba(20, 28, 42, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 0;
  min-height: calc(100vh - 48px);
  padding: 22px;
  position: sticky;
  top: 24px;
}

.admin-sidebar h1 {
  font-size: 30px;
  line-height: 1;
  margin: 0;
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav-item {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  justify-content: flex-start;
  min-height: 44px;
  padding: 11px 12px;
  text-align: left;
}

.admin-nav-item:hover {
  background: rgba(148, 163, 184, 0.08);
}

.admin-nav-item.is-active {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.38);
  color: #f8fafc;
}

.admin-content {
  min-width: 0;
  padding-top: 0;
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.is-active {
  display: block;
}

.wallet-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
}

.link-form {
  align-items: end;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(220px, 420px) auto;
  margin-bottom: 18px;
}

.compact-status {
  margin: 0 0 18px;
}

label span {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  font-size: 15px;
  outline: none;
  background: #1f2937;
  color: var(--text);
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

button,
.button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #0f172a;
  font-weight: 800;
  padding: 14px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
}

button:hover,
.button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button {
  background: rgba(148, 163, 184, 0.12);
  color: var(--accent);
}

.secondary-button:hover {
  background: rgba(148, 163, 184, 0.18);
}

.status {
  border-radius: 14px;
  padding: 14px 16px;
  margin: 20px 0;
  font-weight: 700;
}

.status.info {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
}

.status.error {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.asset-panel {
  display: none;
}

.asset-panel.is-active {
  display: block;
}

.tabs-card {
  margin-bottom: 0;
}

.tab-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-button {
  background: rgba(148, 163, 184, 0.12);
  color: var(--accent);
  min-width: 112px;
}

.tab-button.is-active {
  background: var(--accent);
  color: #0f172a;
}

.balance-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 16px 40px rgba(20, 30, 55, 0.06);
  margin: 22px 0;
}

.balance-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.rate-pill {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
  white-space: nowrap;
}

.balance-amount {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  margin-bottom: 8px;
}

.usd-value {
  color: var(--success);
  font-size: 20px;
  font-weight: 900;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.summary-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.summary-grid dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-grid dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.warning-text {
  color: var(--warning);
  font-weight: 800;
}

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

.address {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.table-wrap {
  overflow-x: auto;
}

.table-card {
  margin-top: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 13px 10px;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hash,
.addr-short {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.address-actions {
  align-items: center;
  display: flex;
  gap: 6px;
  min-width: 190px;
}

.mini-button {
  background: rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  color: var(--accent);
  font-size: 12px;
  min-height: 28px;
  padding: 5px 8px;
}

.mini-button:hover {
  background: rgba(148, 163, 184, 0.18);
}

.direction-in {
  color: #34d399;
  font-weight: 800;
}

.direction-out {
  color: #f87171;
  font-weight: 800;
}

.direction-self {
  color: var(--warning);
  font-weight: 800;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 36px;
}

.error-details {
  white-space: pre-wrap;
  background: #111827;
  color: #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
}

.site-footer {
  padding: 28px 0 42px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 820px) {
  .header-content,
  .table-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .wallet-form,
  .link-form,
  .grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .balance-head {
    flex-direction: column;
  }
}
