:root {
  --bg-main: #040507;
  --bg-card: #101216;
  --bg-card-soft: #151821;
  --bg-elevated: radial-gradient(circle at top, #40312f, #0b0b0d 55%, #050506 100%);
  --stroke-subtle: rgba(255, 255, 255, 0.04);
  --stroke-strong: rgba(255, 255, 255, 0.08);
  --accent-gold: #f7c654;
  --accent-amber: #ffdd8b;
  --accent-green: #3ed68a;
  --accent-blue: #4c8fff;
  --text-primary: #f8f9ff;
  --text-secondary: #9aa0b8;
  --text-soft: #6c7288;
  --danger: #ff6666;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.7);
  --shadow-card: 0 18px 40px rgba(0, 0, 0, 0.6);
  --blur-heavy: 26px;
}

/* Global */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at left top, #22253c 0, #050609 45%, #020305 100%);
  color: var(--text-primary);
}

/* Layout shell */

.app-shell {
  display: grid;
  grid-template-columns: auto 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */

.sidebar {
  width: 76px;
  background: linear-gradient(to bottom, #07070a 0, #050506 40%, #050506 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0 12px;
  gap: 12px;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  flex: 1;
}

.sidebar-logo img {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 12px 30px rgba(0, 0, 0, 0.7);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-icon {
  border: none;
  outline: none;
  width: 44px;
  height: 44px;
  border-radius: 18px;
  background: transparent;
  color: #9297ac;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.nav-icon:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-amber);
  transform: translateY(-1px);
}

.nav-icon.active {
  background: radial-gradient(circle at top, #f6c453, #d18a2a 55%, #624115);
  color: #050505;
  box-shadow: 0 12px 30px rgba(246, 196, 83, 0.45);
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.sidebar-toggle {
  border: none;
  outline: none;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: #a0a5b9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    color 0.18s ease;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent-amber);
  transform: translateY(-1px);
}

.sidebar.collapsed {
  width: 64px;
}

/* Main area */

.main-area {
  display: flex;
  flex-direction: column;
  height: 100vh;
  backdrop-filter: blur(18px);
}

/* Topbar */

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 32px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  background: radial-gradient(circle at top left, rgba(246, 198, 83, 0.12), transparent 60%);
}

.page-title {
  margin: 0 0 2px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.page-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(22, 23, 35, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}

.search-box i {
  font-size: 18px;
  color: var(--text-soft);
  margin-right: 8px;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  padding: 10px 0;
}

.search-box input::placeholder {
  color: rgba(146, 151, 172, 0.7);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date span {
  font-size: 13px;
  color: var(--text-soft);
}

/* Wallet pill */

.wallet-pill {
  border: none;
  outline: none;
  border-radius: 999px;
  padding: 7px 14px 7px 10px;
  background: radial-gradient(circle at top, #3b3c5b, #181927 70%);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition:
    background 0.16s ease,
    transform 0.14s ease,
    box-shadow 0.16s ease;
}

.wallet-pill i {
  font-size: 16px;
}

.wallet-pill:hover {
  background: radial-gradient(circle at top, #4e4f72, #1c1d2c 70%);
  transform: translateY(-1px);
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.82);
}

.wallet-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #555a6f;
}

/* Content area */

.content-scroll {
  flex: 1;
  overflow: auto;
  padding: 20px 32px 32px;
}

/* Cards */

.card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--stroke-subtle);
  background: rgba(9, 11, 17, 0.96);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px 20px;
}

.card-elevated {
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 225, 157, 0.06);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.98),
    0 0 0 1px rgba(255, 215, 140, 0.14);
}

.card-soft {
  background: var(--bg-card-soft);
}

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

.card-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.card-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

.card-mini-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}

.card-body-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Tags & pills */

.tag {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tag-green {
  background: rgba(62, 214, 138, 0.16);
  color: #7cf0b3;
  border: 1px solid rgba(124, 240, 179, 0.3);
}

.tag-amber {
  background: rgba(246, 198, 83, 0.14);
  color: #ffdd8b;
  border: 1px solid rgba(246, 198, 83, 0.4);
}

.pill-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 6px;
}

/* Buttons */

.primary-btn,
.secondary-btn {
  border-radius: var(--radius-pill);
  border: none;
  outline: none;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  transition:
    background 0.18s ease,
    transform 0.16s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.primary-btn {
  background: linear-gradient(135deg, #f7c654, #f1942d);
  color: #120b05;
  box-shadow: 0 18px 46px rgba(244, 185, 82, 0.72);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 26px 60px rgba(244, 185, 82, 0.9);
}

.secondary-btn {
  background: rgba(21, 25, 40, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.secondary-btn:hover {
  background: rgba(32, 36, 54, 0.96);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.full-width {
  width: 100%;
}

/* Chips */

.chip {
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(16, 18, 28, 0.96);
  font-size: 11px;
  color: var(--text-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease;
}

.chip-light {
  background: rgba(255, 255, 255, 0.06);
}

.chip:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Grid & layout helpers */

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 24px;
}

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

.section-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
}

.section-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

/* Wallet card */

.wallet-main {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  align-items: flex-start;
  gap: 18px;
}

.wallet-summary {
  padding-right: 8px;
}

.wallet-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(198, 201, 218, 0.82);
}

.wallet-address {
  margin: 2px 0 10px;
  font-size: 13px;
}

.wallet-total {
  margin: 3px 0 2px;
  font-size: 28px;
  font-weight: 600;
}

.wallet-table {
  background: rgba(8, 9, 14, 0.86);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.wallet-table-header,
.wallet-table-row {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr;
  padding: 10px 14px;
  font-size: 12px;
}

.wallet-table-header {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
}

.wallet-table-row + .wallet-table-row {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.wallet-asset {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wallet-asset img {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.asset-name {
  margin: 0;
  font-size: 13px;
}

.asset-sub {
  margin: 0;
  font-size: 11px;
  color: var(--text-soft);
}

.wallet-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-size: 13px;
}

/* Swap card */

.swap-card {
  position: relative;
  overflow: hidden;
}

.swap-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 0, rgba(255, 255, 255, 0.12), transparent 60%);
  opacity: 0.6;
  pointer-events: none;
}

.swap-card > * {
  position: relative;
}

.swap-header {
  margin-bottom: 14px;
}

.swap-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.swap-row {
  display: flex;
}

.swap-side {
  flex: 1;
}

.swap-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.swap-side-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 228, 199, 0.9);
}

.swap-token-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(7, 6, 4, 0.72);
  border: 1px solid rgba(255, 225, 180, 0.16);
}

.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  border: none;
  outline: none;
  background: rgba(38, 28, 14, 0.98);
  color: #fef9ef;
  font-size: 13px;
  cursor: pointer;
}

.token-pill-alt {
  background: rgba(47, 33, 69, 0.96);
}

.token-pill img {
  width: 18px;
  height: 18px;
  border-radius: 999px;
}

.swap-token-input input {
  border: none;
  outline: none;
  background: transparent;
  color: #fef9ef;
  text-align: right;
  font-size: 18px;
}

.swap-token-input input::placeholder {
  color: rgba(247, 232, 208, 0.7);
}

.swap-helper {
  margin: 4px 4px 0;
  font-size: 11px;
  color: rgba(244, 226, 199, 0.76);
}

.swap-arrow {
  display: flex;
  justify-content: center;
}

.swap-arrow-btn {
  border-radius: 999px;
  width: 36px;
  height: 36px;
  border: none;
  outline: none;
  background: radial-gradient(circle at top, #f8c965, #f29b3a 70%);
  color: #18110b;
  box-shadow: 0 16px 40px rgba(245, 189, 92, 0.86);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transform: translateY(-6px);
}

.swap-footer {
  margin-top: 12px;
}

.swap-disclaimer {
  margin: 8px 0 0;
  font-size: 11px;
  color: rgba(247, 235, 215, 0.82);
}

/* Runtime & generic */

.runtime-grid {
  display: grid;
  grid-template-rows: auto auto;
  gap: 16px;
}

.runtime-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

/* Forms */

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 13px;
}

.field span {
  color: var(--text-secondary);
}

.field input,
.field select {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(16, 18, 27, 0.96);
  color: var(--text-primary);
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
}

.field input::placeholder {
  color: rgba(143, 149, 175, 0.72);
}

.field input:focus,
.field select:focus {
  border-color: rgba(246, 198, 83, 0.7);
  box-shadow: 0 0 0 1px rgba(246, 198, 83, 0.55);
}

.bullets {
  list-style: none;
  padding-left: 0;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.bullets li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 4px;
}

.bullets li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-amber);
}

/* Intent preview blocks */

.intent-preview {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(8, 24, 20, 0.96);
  border: 1px solid rgba(63, 214, 138, 0.5);
}

.intent-label {
  margin: 0 0 4px;
  font-size: 12px;
  color: #7cf0b3;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.intent-text {
  margin: 0;
  font-size: 12px;
  color: #c6fbe0;
}

/* Allocations */

.alloc-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1.4fr);
  gap: 18px;
}

.alloc-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alloc-label {
  margin: 0;
  font-size: 13px;
}

.alloc-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(32, 36, 52, 0.9);
  overflow: hidden;
}

.alloc-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f7c654, #f58b3e);
}

.alloc-value {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
}

/* View sections */

.view-section {
  display: none;
  animation: fadeIn 0.22s ease-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
  backdrop-filter: blur(8px);
}

.modal-backdrop.show {
  display: flex;
}

.modal {
  width: 360px;
  max-width: 90vw;
  border-radius: 20px;
  background: #111320;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-card);
  padding: 16px 18px 18px;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 17px;
}

.icon-btn {
  border-radius: 999px;
  width: 28px;
  height: 28px;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-subtitle {
  margin: 8px 0 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.wallet-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wallet-option {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(18, 20, 33, 0.94);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.16s ease;
}

.wallet-option img {
  width: 26px;
  height: 26px;
  border-radius: 999px;
}

.wallet-option-name {
  margin: 0;
  font-size: 14px;
}

.wallet-option-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-soft);
}

.wallet-option:hover {
  background: rgba(29, 32, 51, 0.98);
  border-color: rgba(246, 198, 83, 0.7);
  transform: translateY(-1px);
}

/* Responsive */

@media (max-width: 1024px) {
  .topbar {
    grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.2fr);
    grid-template-rows: auto auto;
  }

  .topbar-center {
    grid-column: 1 / -1;
    order: 3;
  }

  .grid-2,
  .two-column {
    grid-template-columns: minmax(0, 1fr);
  }

  .content-scroll {
    padding: 16px 18px 24px;
  }
}

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

  .topbar {
    padding-inline: 16px;
  }

  .wallet-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .card {
    border-radius: 18px;
  }

  .alloc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
