:root {
  --bg-base: #0a0418;
  --text: #ffffff;
  --muted: rgba(255,255,255,0.70);
  --muted-2: rgba(255,255,255,0.45);
  --border: rgba(255,255,255,0.08);
  --border-2: rgba(255,255,255,0.14);
  --accent: #c4b5fd;
  --accent-2: #a78bfa;
  --accent-3: #f0abfc;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", system-ui, sans-serif;
  background: var(--bg-base);
  min-height: 100vh;
}
/* Single-tone visible backdrop — purple/indigo family only, no rainbow.
   Three soft glows (top, bottom-right, bottom-left) over deep navy. */
body {
  background:
    radial-gradient(ellipse 70% 50% at 50% -5%,
      rgba(99, 102, 241, 0.40) 0%,
      transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 95%,
      rgba(139, 92, 246, 0.28) 0%,
      transparent 65%),
    radial-gradient(ellipse 50% 35% at 0% 80%,
      rgba(79, 70, 229, 0.22) 0%,
      transparent 65%),
    linear-gradient(180deg,
      #0d0825 0%,
      #0a071e 50%,
      #110a2b 100%);
  background-attachment: fixed;
}

.mono { font-family: "SF Mono", ui-monospace, "Menlo", monospace; }

.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; gap: 18px; padding: 18px; }

.sidebar {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 18px;
  height: calc(100vh - 36px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.30);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, #c4b5fd, #f0abfc);
  display: grid; place-items: center;
  font-family: "SF Mono", ui-monospace, monospace;
  font-weight: 700; font-size: 14px; color: #1a0a2e;
  box-shadow: 0 4px 12px rgba(196,181,253,0.3);
}
.brand-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted-2); padding: 14px 8px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--muted); text-decoration: none;
  font-size: 13px; font-weight: 500;
  transition: background 160ms, color 160ms;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(196,181,253,0.22), rgba(240,171,252,0.18));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item .badge {
  margin-left: auto; background: linear-gradient(135deg, #fb7185, #f0abfc);
  color: #fff; font-size: 10px; padding: 1px 7px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 8px rgba(251,113,133,0.5);
}

.sidebar-foot {
  margin-top: auto; padding: 12px 8px 4px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #c4b5fd, #f0abfc);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #1a0a2e;
}

.main { padding: 10px 14px 60px; max-width: 1320px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.title {
  font-size: 26px; font-weight: 600; letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.subtitle { font-size: 12px; color: var(--muted-2); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.14em; }

.btn {
  height: 36px; padding: 0 14px; border-radius: 10px;
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--border-2);
  background: #1a1030;
  color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 140ms, border-color 140ms, transform 100ms;
}
.btn:hover { background: #221542; border-color: rgba(255,255,255,0.22); }
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, #a78bfa, #c4b5fd);
  border-color: transparent; color: #1a0a2e; font-weight: 600;
  box-shadow: 0 4px 14px rgba(167,139,250,0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.btn svg { width: 14px; height: 14px; }

.card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 8px 32px rgba(0, 0, 0, 0.30);
  overflow: hidden;
}
.card-pad { padding: 20px; }
.card-head {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--muted-2); font-weight: 500;
}

.eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted-2); }
.kpi {
  font-size: 26px; font-weight: 600; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.delta-up { color: #6ee7b7; }
.delta-down { color: #fda4af; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted-2); font-weight: 500; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.20);
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
/* Cells that should wrap long text (e.g. alert messages, company names). */
.table td.wrap, .table td .wrap {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* Layout: keep tables inside their card without horizontal overflow. */
.card { overflow: hidden; }
.card .table { table-layout: auto; width: 100%; }
/* Card with a table: allow horizontal scroll INSIDE the card, never the page. */
.card .table-wrap { overflow-x: auto; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(255,255,255,0.04); cursor: pointer; }
.table .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.table td.wrap { white-space: normal; }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.bar-cell .bar { flex: 1; min-width: 60px; }
.bar-cell .pct { font-variant-numeric: tabular-nums; font-size: 11px; color: var(--muted-2); width: 40px; text-align: right; flex-shrink: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid;
}
.pill-buy { background: rgba(110,231,183,0.14); border-color: rgba(110,231,183,0.30); color: #6ee7b7; }
.pill-sell { background: rgba(253,164,175,0.14); border-color: rgba(253,164,175,0.30); color: #fda4af; }
.pill-hold { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.16); color: rgba(255,255,255,0.75); }
.pill-action { background: rgba(253,164,175,0.14); border-color: rgba(253,164,175,0.30); color: #fda4af; }
.pill-warn { background: rgba(252,211,77,0.14); border-color: rgba(252,211,77,0.30); color: #fcd34d; }
.pill-na { border-style: dashed; border-color: rgba(255,255,255,0.16); color: var(--muted-2); background: transparent; }

.factor-stack {
  display: flex;
  gap: 5px;
  align-items: center;
  min-width: 150px;
}
.factor-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}
.factor-up {
  background: rgba(110,231,183,0.10);
  border-color: rgba(110,231,183,0.22);
  color: #9af0cd;
}
.factor-down {
  background: rgba(253,164,175,0.10);
  border-color: rgba(253,164,175,0.22);
  color: #ffc0c8;
}

.input, .select {
  height: 36px; padding: 0 12px; border-radius: 10px;
  background: #1a1030;
  border: 1px solid var(--border-2);
  color: var(--text); font-size: 13px; outline: none;
}
.input::placeholder { color: var(--muted-2); }
.input:focus, .select:focus { border-color: var(--accent); background: #221542; }
.select option { background: #1a0a2e; color: var(--text); }
.search { position: relative; }
.search input { padding-left: 32px; width: 240px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--muted-2); }

.tabs {
  display: inline-flex;
  background: #150b28;
  border: 1px solid var(--border);
  border-radius: 10px; padding: 3px;
}
.tabs button {
  height: 28px; padding: 0 14px; border-radius: 7px;
  background: transparent; border: 0; color: var(--muted);
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background 140ms, color 140ms;
}
.tabs button:hover { color: var(--text); }
.tabs button.active {
  background: linear-gradient(135deg, rgba(196,181,253,0.25), rgba(240,171,252,0.20));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}

.bar { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, #c4b5fd, #f0abfc);
  border-radius: 3px;
}

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
a { color: inherit; }

/* Subtle glass divider */
.divider { height: 1px; background: var(--border); margin: 18px 0; }
