:root {
  --bg: #06111f;
  --panel: rgba(11, 18, 32, 0.92);
  --panel-soft: rgba(17, 24, 39, 0.96);
  --text: #e7eefc;
  --muted: #94a3b8;
  --border: rgba(148, 163, 184, 0.16);
  --primary: #6366f1;
  --accent: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --cyan: #06b6d4;
  --shadow: 0 20px 48px rgba(2, 8, 23, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.18), transparent 24%),
    linear-gradient(180deg, #020617 0%, #08111f 100%);
}

.app-shell {
  width: min(1400px, calc(100% - 28px));
  margin: 24px auto;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
}

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

.tag {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.16);
  color: #c7d2fe;
  font-size: 14px;
  font-weight: 700;
}

.sidebar h1,
.topbar h2,
.panel-header h3 {
  margin-top: 0;
}

.sidebar-text,
.muted,
.stat-card span,
.wallet-box span,
.insight-item p,
.allocation-row small {
  color: var(--muted);
}

.menu {
  display: grid;
  gap: 10px;
}

.menu-item,
button {
  font: inherit;
  border: none;
  cursor: pointer;
}

.menu-item {
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
}

.menu-item.active,
button {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: white;
}

button {
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
}

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

.wallet-box {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  background: var(--panel-soft);
  border: 1px solid var(--border);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #93c5fd;
  font-size: 14px;
  font-weight: 700;
}

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

input {
  width: 240px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
  color: var(--text);
  outline: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.stat-card strong {
  display: block;
  margin: 12px 0 6px;
  font-size: 30px;
}

.stat-card small {
  color: var(--muted);
}

.stat-card.highlight {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(6, 182, 212, 0.14));
}

.content-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.side-panels {
  display: grid;
  gap: 20px;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.asset-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.asset-symbol {
  color: var(--muted);
  font-size: 13px;
}

.positive { color: var(--accent); }
.negative { color: var(--danger); }

.allocation-list,
.insights {
  display: grid;
  gap: 12px;
}

.allocation-row,
.insight-item {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}

.bar {
  height: 8px;
  border-radius: 999px;
  margin-top: 10px;
  background: rgba(148, 163, 184, 0.12);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
}

.watchlist,
.transaction-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.watch-item,
.transaction-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel-soft);
}

.transaction-main strong,
.transaction-meta strong,
.watch-item strong {
  display: block;
}

.transaction-main span,
.transaction-meta span,
.watch-item span {
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.mua { background: rgba(34, 197, 94, 0.14); color: #86efac; }
.badge.ban { background: rgba(239, 68, 68, 0.14); color: #fca5a5; }
.badge.hoan-doi { background: rgba(6, 182, 212, 0.14); color: #67e8f9; }
.badge.nhan { background: rgba(245, 158, 11, 0.14); color: #fcd34d; }

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

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-grid,
  .bottom-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 16px, 1400px);
  }

  .topbar,
  .topbar-actions,
  .watch-item,
  .transaction-item,
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  input {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
