:root {
  --bg: #0b1020;
  --panel: #121a2f;
  --panel-2: #18233f;
  --text: #edf2ff;
  --muted: #9aa7c7;
  --line: #2a3659;
  --accent: #61dafb;
  --green: #39d98a;
  --orange: #ffb84d;
  --red: #ff6b6b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #08101d 0%, var(--bg) 100%);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: .92; }

.wrap {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(8, 16, 29, 0.8);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
}

.brand {
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
}

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

.page-shell {
  padding: 24px 0 40px;
}

.card {
  background: rgba(18, 26, 47, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
}

.inset { background: rgba(24, 35, 63, 0.9); }

.hero {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

.hero h1, .profile-header h1 {
  margin: 4px 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.hero p, .section-header p, .muted {
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .75rem;
  color: var(--accent);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: white;
  background: transparent;
  cursor: pointer;
}

.button-primary {
  background: var(--accent);
  color: #08101d;
  font-weight: 700;
  border-color: transparent;
}

.button-small {
  padding: 8px 12px;
  font-size: .9rem;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.flash-success { background: rgba(57, 217, 138, 0.12); border-color: rgba(57, 217, 138, 0.4); }
.flash-warning { background: rgba(255, 184, 77, 0.12); border-color: rgba(255, 184, 77, 0.4); }
.flash-danger { background: rgba(255, 107, 107, 0.12); border-color: rgba(255, 107, 107, 0.4); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 24px 0 16px;
}
.section-header.compact { margin-top: 0; }
.section-header h2 { margin: 0; }
.section-header p { margin: 0; }

.listing-grid,
.inventory-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.listing-card,
.item-card {
  display: grid;
  gap: 12px;
}

.item-thumb {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}
.item-thumb.small {
  width: 56px;
  height: 56px;
}

.listing-meta {
  display: grid;
  gap: 6px;
}

.pill {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .75rem;
  border: 1px solid var(--line);
}
.pill-sell { background: rgba(57, 217, 138, 0.12); color: var(--green); }
.pill-buy { background: rgba(255, 184, 77, 0.12); color: var(--orange); }
.pill-muted { color: var(--muted); }

.price {
  font-size: 1.1rem;
  font-weight: 700;
}

.profile-header {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
}

.profile-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
}

.stat-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.stat {
  display: grid;
  gap: 6px;
}
.stat span { color: var(--muted); font-size: .9rem; }
.stat strong { font-size: 1.6rem; }

.dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.2fr .8fr;
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-grid.inline-form { grid-template-columns: 1fr; margin-top: 12px; }
.form-grid .full { grid-column: 1 / -1; }
label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: .92rem;
}
input, select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0f1730;
  color: white;
}

.stack-list {
  display: grid;
  gap: 10px;
}
.row-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(24, 35, 63, 0.6);
}
.row-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.empty-state {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(100vw - 20px, 1200px);
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
