:root {
  --bg-0: #070d13;
  --bg-1: #0c1720;
  --bg-2: #11212e;
  --bg-3: #17293a;
  --bg-4: #1f3649;
  --bg-5: #2b465c;
  --surface: #13212d;
  --surface-2: #18293a;
  --surface-3: #1e3447;
  --border: #22394d;
  --border-bright: #2d4a64;
  --text: #ffffff;
  --text-muted: #b3c2d8;
  --text-dim: #7a8aa2;
  --green: #00e676;
  --green-bright: #2ef993;
  --green-dim: #0cb863;
  --red: #ff4778;
  --yellow: #ffcb3a;
  --blue: #3b9bff;
  --purple: #a35bff;
  --violet: #7c3aff;
  --orange: #ff8438;
  --cyan: #33d9ff;
  --gold: #ffd36a;
  --grad-hero: linear-gradient(135deg, #00e676 0%, #33d9ff 50%, #a35bff 100%);
  --grad-primary: linear-gradient(135deg, #00e676 0%, #0cb863 100%);
  --grad-danger: linear-gradient(135deg, #ff4778 0%, #b82659 100%);
  --grad-surface: linear-gradient(180deg, #1a2d3e 0%, #11212e 100%);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow-green: 0 0 0 1px rgba(0, 230, 118, 0.35), 0 8px 30px rgba(0, 230, 118, 0.25);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: var(--bg-0);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(124, 58, 255, 0.18), transparent 60%),
    radial-gradient(1000px 600px at 110% 20%, rgba(0, 230, 118, 0.12), transparent 60%),
    radial-gradient(900px 500px at 60% 120%, rgba(51, 217, 255, 0.1), transparent 60%);
  z-index: -1;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
  outline: none;
  border: none;
  background: none;
  color: inherit;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--bg-4);
  border-radius: 999px;
  border: 2px solid var(--bg-0);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bg-5);
}

.app {
  display: grid;
  grid-template-columns: 256px 1fr;
  grid-template-rows: 68px 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  min-height: 100vh;
}

.sidebar {
  grid-area: sidebar;
  background: linear-gradient(180deg, rgba(12, 23, 32, 0.95) 0%, rgba(7, 13, 19, 0.95) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  padding: 20px 22px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.6px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.sidebar-logo .logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--grad-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-0);
  box-shadow: 0 6px 14px rgba(0, 230, 118, 0.35);
}

.sidebar-logo .logo-text {
  background: linear-gradient(135deg, #ffffff 0%, #b3c2d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-section {
  padding: 14px 12px 6px;
}

.sidebar-section-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 6px 10px 10px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
  position: relative;
}

.sidebar-link:hover {
  background: rgba(45, 74, 100, 0.4);
  color: var(--text);
}

.sidebar-link.active {
  background: linear-gradient(90deg, rgba(0, 230, 118, 0.15), rgba(0, 230, 118, 0.03));
  color: var(--text);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
}

.sidebar-link .icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  flex-shrink: 0;
}

.sidebar-link:hover .icon,
.sidebar-link.active .icon {
  color: var(--green);
}

.sidebar-link .icon svg {
  width: 100%;
  height: 100%;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 12px 18px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.6;
}

.header {
  grid-area: header;
  background: rgba(12, 23, 32, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
  border: 1px solid transparent;
}

.header-back:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.header-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.header-title .pill {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--green);
  background: rgba(0, 230, 118, 0.12);
  border: 1px solid rgba(0, 230, 118, 0.3);
  border-radius: 999px;
  vertical-align: middle;
}

.wallet {
  display: flex;
  align-items: center;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.wallet-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 15px;
  color: var(--gold);
}

.wallet-balance .currency {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 4px;
}

.wallet-balance .amount {
  font-variant-numeric: tabular-nums;
}

.wallet-reset {
  padding: 10px 14px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  border-left: 1px solid var(--border);
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}

.wallet-reset:hover {
  background: var(--surface-3);
  color: var(--text);
}

.main {
  grid-area: main;
  overflow-y: auto;
  padding: 28px 32px 60px;
}

@media (max-width: 1000px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 60px 1fr;
    grid-template-areas:
      "header"
      "main";
  }
  .sidebar {
    display: none;
  }
  .main {
    padding: 20px 16px 40px;
  }
}
