/* EdgefulFinder — design system
   Dark macro-terminal aesthetic. Polarity: blue = bullish, red = bearish,
   slate = neutral. Density is deliberately high: this is a scanning surface. */

:root {
  --bull: #3b82f6;
  --bear: #ef4444;
  --flat: #94a3b8;
  --accent: #22d3ee;
  --panel: #0f172a;
  --line: #1e293b;
}

* { box-sizing: border-box; }

body {
  background:
    radial-gradient(1100px 600px at 12% -8%, rgba(59, 130, 246, 0.10), transparent 55%),
    radial-gradient(900px 500px at 92% 0%, rgba(34, 211, 238, 0.07), transparent 50%),
    #070b14;
  background-attachment: fixed;
}

/* ------------------------------- panels ------------------------------- */

.panel {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(10, 16, 32, 0.92));
  border: 1px solid var(--line);
  border-radius: 14px;
}

.panel-flat {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.panel-hover { transition: border-color .18s ease, transform .18s ease; }
.panel-hover:hover { border-color: #2f4a72; transform: translateY(-1px); }

/* ----------------------------- typography ----------------------------- */

.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.label-xs { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #64748b; font-weight: 600; }

/* ------------------------------- tones -------------------------------- */

.tone-bull { color: var(--bull); }
.tone-bear { color: var(--bear); }
.tone-flat { color: var(--flat); }

.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .18rem .55rem; border-radius: 999px;
  font-size: .7rem; font-weight: 600; letter-spacing: .02em;
  border: 1px solid transparent; white-space: nowrap;
}
.chip-bull { background: rgba(59, 130, 246, .14); color: #93c5fd; border-color: rgba(59, 130, 246, .35); }
.chip-bear { background: rgba(239, 68, 68, .14); color: #fca5a5; border-color: rgba(239, 68, 68, .35); }
.chip-flat { background: rgba(148, 163, 184, .12); color: #cbd5e1; border-color: rgba(148, 163, 184, .3); }
.chip-accent { background: rgba(34, 211, 238, .12); color: #67e8f9; border-color: rgba(34, 211, 238, .35); }

/* ------------------------------ gauge -------------------------------- */

.gauge-wrap { position: relative; width: 100%; max-width: 260px; margin: 0 auto; }
.gauge-svg { width: 100%; height: auto; display: block; }

/* ----------------------------- sidebar ------------------------------- */

.nav-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .7rem; border-radius: 9px;
  font-size: .82rem; color: #94a3b8;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: rgba(30, 41, 59, .6); color: #e2e8f0; }
.nav-item.active { background: rgba(59, 130, 246, .13); color: #bfdbfe; border-color: rgba(59, 130, 246, .3); }
.nav-item.locked { opacity: .45; }

/* ------------------------------ tables ------------------------------- */

.data-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.data-table th {
  text-align: left; padding: .5rem .6rem; color: #64748b;
  font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); font-weight: 700;
  position: sticky; top: 0; background: #0b1220; z-index: 1;
}
.data-table td { padding: .5rem .6rem; border-bottom: 1px solid rgba(30, 41, 59, .6); }
.data-table tbody tr:hover { background: rgba(30, 41, 59, .35); }

/* ------------------------------- bars ------------------------------- */

.bar-track { height: 6px; border-radius: 999px; background: rgba(30, 41, 59, .9); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }
.bar-fill-bull { background: linear-gradient(90deg, #1d4ed8, #60a5fa); }
.bar-fill-bear { background: linear-gradient(90deg, #b91c1c, #f87171); }
.bar-fill-flat { background: linear-gradient(90deg, #475569, #94a3b8); }

/* ------------------------------ buttons ----------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .55rem 1.05rem; border-radius: 9px; font-size: .85rem;
  font-weight: 600; border: 1px solid transparent; cursor: pointer;
  transition: filter .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(1.12); }
.btn-primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; }
.btn-ghost { background: rgba(30, 41, 59, .7); color: #cbd5e1; border-color: var(--line); }
.btn-accent { background: linear-gradient(135deg, #0891b2, #06b6d4); color: #05202a; }
.btn-sm { padding: .35rem .7rem; font-size: .75rem; }

/* ------------------------------- inputs ----------------------------- */

.input, .select {
  width: 100%; padding: .5rem .7rem; border-radius: 9px;
  background: rgba(7, 11, 20, .8); border: 1px solid var(--line);
  color: #e2e8f0; font-size: .85rem; outline: none;
}
.input:focus, .select:focus { border-color: #2563eb; }
.select option { background: #0f172a; }

/* ----------------------------- risk dial ---------------------------- */

.risk-dial {
  position: relative; width: 100%; max-width: 240px; height: 120px;
  margin: 0 auto; overflow: hidden;
}
.risk-dial-track {
  position: absolute; inset: 0; border-radius: 240px 240px 0 0;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 28%, #94a3b8 50%, #38bdf8 72%, #3b82f6 100%);
  -webkit-mask: radial-gradient(circle at 50% 100%, transparent 52%, #000 53%);
  mask: radial-gradient(circle at 50% 100%, transparent 52%, #000 53%);
  opacity: .55;
}
.risk-dial-needle {
  position: absolute; left: 50%; bottom: 0; width: 3px; height: 88px;
  transform-origin: 50% 100%; border-radius: 3px; margin-left: -1.5px;
  transition: transform .5s ease;
}
.risk-dial-needle.tone-bull { background: #3b82f6; box-shadow: 0 0 10px rgba(59,130,246,.6); }
.risk-dial-needle.tone-bear { background: #ef4444; box-shadow: 0 0 10px rgba(239,68,68,.6); }
.risk-dial-needle.tone-flat { background: #94a3b8; box-shadow: 0 0 10px rgba(148,163,184,.5); }
.risk-dial-hub {
  position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px;
  margin-left: -7px; border-radius: 50%; background: #0f172a;
  border: 2px solid var(--line);
}

/* ------------------------------ skeleton ---------------------------- */

.skeleton {
  background: linear-gradient(90deg, rgba(30,41,59,.5) 25%, rgba(51,65,85,.6) 50%, rgba(30,41,59,.5) 75%);
  background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: 6px;
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ------------------------------ scrollbar --------------------------- */

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: #0a1020; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* ------------------------------ toast ------------------------------- */

#toast {
  position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 80;
  display: flex; flex-direction: column; gap: .5rem;
}

/* ------------------------------ responsive -------------------------- */

@media (max-width: 1024px) {
  .sidebar-collapse { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar-collapse.open { transform: translateX(0); }
}
