:root {
  --bg: #edf4ff;
  --ink: #0c1732;
  --muted: #66738a;
  --line: #d8e3f4;
  --panel: rgba(255,255,255,.92);
  --blue: #2563eb;
  --cyan: #06b6d4;
  --green: #08a66d;
  --red: #ef4444;
  --orange: #f59e0b;
  --purple: #7c3aed;
  --shadow: 0 18px 42px rgba(15, 23, 42, .12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(6,182,212,.18), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(124,58,237,.15), transparent 28%),
    linear-gradient(180deg, #f7fbff, var(--bg));
}
a { color: inherit; text-decoration: none; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  padding: 24px 18px;
  color: white;
  background: linear-gradient(180deg, #101827, #111c32 60%, #07111f);
  box-shadow: 12px 0 30px rgba(15,23,42,.16);
}
.logo { display: flex; align-items: center; gap: 10px; font-size: 23px; margin-bottom: 28px; }
.logo span, .nav-ico {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #34d399, #38bdf8);
  color: #07111f;
  font-weight: 900;
}
.nav-ico { width: 24px; height: 24px; font-size: 12px; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 8px; color: #dbeafe; font-weight: 750; }
.sidebar a.active, .sidebar a:hover { background: rgba(255,255,255,.10); color: #fff; }
.side-status {
  margin-top: 28px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255,255,255,.07);
}
.side-status span { color: #93c5fd; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.side-status b { display: block; margin: 6px 0; }
.side-status small { color: #cbd5e1; line-height: 1.5; }
.main { margin-left: 250px; padding: 28px 32px; }
.hero {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid rgba(37,99,235,.18);
  background:
    linear-gradient(135deg, rgba(255,255,255,.95), rgba(239,246,255,.9)),
    linear-gradient(90deg, rgba(6,182,212,.18), rgba(124,58,237,.14));
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.scanner-hero { background: linear-gradient(135deg, #f0fdfa, #eff6ff 58%, #faf5ff); }
.signal-hero { background: linear-gradient(135deg, #eff6ff, #f0fdfa); }
.kicker { display: inline-block; color: var(--purple); font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 34px; line-height: 1.08; margin-bottom: 8px; }
h2 { font-size: 24px; margin-bottom: 14px; }
p { color: var(--muted); }
.btn, button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 14px;
  font-weight: 850;
  cursor: pointer;
}
.btn.primary {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-color: transparent;
  color: white;
}
.btn.glow { box-shadow: 0 14px 28px rgba(37,99,235,.25); }
.btn.ok { background: #ecfdf5; border-color: #a7f3d0; color: var(--green); }
.btn.danger { background: #fff1f2; border-color: #fecdd3; color: var(--red); }
.btn.small { padding: 8px 11px; font-size: 13px; }
.btn.ghost { color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: var(--shadow);
}
.stat-card b { display: block; font-size: 20px; }
.stat-card small { color: var(--muted); }
.donut, .score-ring {
  --value: 0;
  --score: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ring) calc(var(--value) * 1%), #e8eef8 0);
  position: relative;
}
.score-ring { --value: var(--score); width: 62px; height: 62px; }
.score-ring.big { width: 92px; height: 92px; }
.donut::after, .score-ring::after { content: ""; position: absolute; inset: 9px; background: #fff; border-radius: 50%; }
.donut span, .score-ring span { position: relative; z-index: 1; font-weight: 950; font-size: 19px; }
.amber { --ring: var(--orange); }
.green { --ring: var(--green); }
.red { --ring: var(--red); }
.blue { --ring: var(--blue); }
.panel {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.70);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.filters { display: grid; grid-template-columns: 170px 160px 160px minmax(220px, 1fr) auto auto; gap: 12px; align-items: end; }
label { display: grid; gap: 6px; font-weight: 800; color: #334155; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px; font: inherit; background: white; }
.queue-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.queue-head p { margin: 0; }
.bulk-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.select-all { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.signal-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.research-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 16px 36px rgba(15,23,42,.10);
}
.research-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--green));
}
.research-card.approved::before { background: linear-gradient(90deg, #10b981, #22c55e); }
.research-card.rejected::before { background: linear-gradient(90deg, #ef4444, #f97316); }
.card-topline, .symbol-line, .card-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.symbol-line h3 { margin-bottom: 3px; font-size: 20px; }
.symbol-line p, .card-footer small { margin: 0; color: var(--muted); }
.pill { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 900; font-style: normal; }
.pill.pending_approval { background: #fff7ed; color: #b45309; }
.pill.approved { background: #ecfdf5; color: #047857; }
.pill.rejected { background: #fff1f2; color: #be123c; }
.trade-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.chip { display: block; padding: 10px; border-radius: 8px; font-weight: 900; font-size: 13px; }
.chip.buy { background: #e0f2fe; color: #0369a1; }
.chip.target { background: #dcfce7; color: #047857; }
.chip.target2 { background: #f0fdf4; color: #15803d; }
.chip.sl { background: #ffe4e6; color: #be123c; }
.reason { min-height: 46px; line-height: 1.45; color: #53647e; }
.empty-card { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; background: white; }
.scanner-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .95fr); gap: 16px; }
.query-card { min-height: 310px; }
.scan-form { display: grid; gap: 14px; }
.method-grid { display: grid; gap: 10px; }
.method-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--line);
}
.method-card b { grid-row: span 2; width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; color: white; }
.method-card h3 { margin: 0; }
.method-card p { margin: 2px 0 0; }
.m1 b { background: var(--blue); } .m2 b { background: var(--purple); } .m3 b { background: var(--cyan); } .m4 b { background: var(--orange); } .m5 b { background: var(--green); }
.facility-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.facility-grid div {
  min-height: 130px;
  padding: 16px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  box-shadow: var(--shadow);
}
.facility-grid div:nth-child(2) { background: linear-gradient(135deg, #7c3aed, #ec4899); }
.facility-grid div:nth-child(3) { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.facility-grid div:nth-child(4) { background: linear-gradient(135deg, #059669, #14b8a6); }
.facility-grid p { color: rgba(255,255,255,.86); }
.trade-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.trade-tile {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 8px;
  padding: 16px;
  color: white;
  box-shadow: var(--shadow);
}
.trade-tile span { font-size: 12px; font-weight: 900; opacity: .86; }
.trade-tile b { font-size: 24px; margin-top: 8px; }
.trade-tile.buy { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.trade-tile.target { background: linear-gradient(135deg, #059669, #22c55e); }
.trade-tile.target2 { background: linear-gradient(135deg, #0f766e, #2dd4bf); }
.trade-tile.sl { background: linear-gradient(135deg, #dc2626, #fb7185); }
.trade-tile.score { background: linear-gradient(135deg, #4f46e5, #8b5cf6); align-items: center; }
.evidence-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.evidence-strip div { padding: 14px; border-radius: 8px; background: white; border: 1px solid var(--line); box-shadow: 0 10px 22px rgba(15,23,42,.06); }
.evidence-strip b { display: block; }
.evidence-strip span { color: var(--muted); font-size: 13px; }
.track-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.track-grid div { padding: 14px; border-radius: 8px; background: linear-gradient(180deg, #ffffff, #f8fbff); border: 1px solid var(--line); }
.track-grid b { display: block; font-size: 14px; min-height: 20px; }
.track-grid span { color: var(--muted); font-size: 12px; font-weight: 800; }
.outcome-form { display: grid; grid-template-columns: 180px minmax(260px, 1fr) auto; gap: 12px; align-items: end; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(360px, .8fr); gap: 16px; }
.chart-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chart-note { margin: -6px 0 10px; color: var(--muted); font-size: 13px; }
.chart-box { height: 540px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: white; }
.chart-empty {
  min-height: 380px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 35%, rgba(37,99,235,.12), transparent 32%),
    linear-gradient(135deg, #f8fbff, #eef6ff);
}
.chart-empty b { font-size: 24px; }
.chart-empty p { max-width: 520px; margin: 8px auto 0; }
.snapshot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.snapshot-card { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: white; }
.snapshot-card img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #e5e7eb; }
.snapshot-card figcaption { padding: 12px; }
.snapshot-card b { display: block; }
.snapshot-card span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.snapshot-card p { margin: 8px 0 0; }
.pattern-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; background: linear-gradient(135deg, #fff, #f0f9ff); }
.pattern-card b { display: block; color: var(--blue); }
.pattern-card p { margin: 6px 0 0; }
.quality-list { display: grid; gap: 10px; }
.quality-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.quality-row b { display: block; }
.quality-row p { margin: 5px 0 0; }
.quality-row span {
  justify-self: end;
  padding: 7px 9px;
  border-radius: 8px;
  font-weight: 900;
  font-size: 12px;
  background: #eef2ff;
  color: var(--blue);
}
.quality-row.pass { border-left: 5px solid var(--green); }
.quality-row.fail { border-left: 5px solid var(--red); }
.quality-row.pass span { background: #dcfce7; color: #047857; }
.quality-row.fail span { background: #ffe4e6; color: #be123c; }
.score-explain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.score-explain > div {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
}
.score-explain .score-ring { margin-bottom: 8px; }
.audit-list { display: grid; gap: 10px; }
.audit-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.audit-card b { display: block; }
.audit-card span { color: var(--muted); font-size: 13px; }
.audit-card code { overflow: auto; color: #334155; }
.checks { display: grid; gap: 8px; margin-bottom: 16px; }
.check { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.check span { display: inline-block; min-width: 48px; font-size: 12px; font-weight: 950; }
.check.pass span { color: var(--green); }
.check.fail span { color: var(--red); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
pre { overflow: auto; max-height: 360px; background: #0f172a; color: #dbeafe; padding: 14px; border-radius: 8px; font-size: 12px; }
.alert { padding: 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 800; }
.alert.success { background: #dcfce7; color: #166534; }
.alert.warning { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.alert.danger { background: #ffe4e6; color: #9f1239; border: 1px solid #fecdd3; }
.checkline { display: flex; align-items: center; gap: 8px; font-weight: 850; color: var(--muted); }
.checkline input { width: auto; }
.password-panel { max-width: 760px; }
.table { width: 100%; border-collapse: collapse; background: white; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: 12px; text-align: left; vertical-align: top; }
.login-body { min-height: 100vh; display: grid; place-items: center; background: #101827; }
.login-panel { width: min(430px, calc(100vw - 30px)); background: white; border-radius: 8px; padding: 28px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; background: var(--blue); color: white; font-weight: 900; margin-bottom: 14px; }
.login-form { display: grid; gap: 12px; }
@media (max-width: 1200px) {
  .sidebar { position: static; width: auto; }
  .main { margin-left: 0; padding: 18px; }
  .stats-grid, .signal-card-grid, .filters, .scanner-layout, .facility-grid, .trade-summary, .evidence-strip, .two-col, .grid-3, .track-grid, .outcome-form, .snapshot-grid, .quality-row, .score-explain, .audit-card { grid-template-columns: 1fr; }
  .hero, .queue-head { align-items: flex-start; flex-direction: column; }
}
