/* WTT Sponsor Radar: worldtradingtournament.com brand (purple → cyan → pink, Montserrat) on a bright, clean canvas. */
:root {
  --purple: #9b3dff;
  --purple-ink: #7a1fe0;
  --cyan: #00b8d9;
  --pink: #e14bff;
  --gold: #f5b700;
  --brand-grad: linear-gradient(100deg, #9b3dff 0%, #00b8d9 52%, #e14bff 100%);
  --btn-grad: linear-gradient(120deg, #b14bff 0%, #8b2cf5 100%);
  --tint: linear-gradient(120deg, rgba(155, 61, 255, 0.09), rgba(0, 184, 217, 0.08));
  --ink: #0b0c10;
  --text: #22232b;
  --muted: #6b7080;
  --hairline: #ebebf0;
  --paper: #fff;
  --soft: #fafafc;
  --soft-2: #f3f3f7;
  --good: #15803d;
  --good-bg: #e9f9ef;
  --warn: #b45309;
  --warn-bg: #fff6e5;
  --bad: #dc2626;
  --bad-bg: #fdecec;
  --info: #0e7490;
  --info-bg: #e6f8fb;
  --glow: 0 12px 30px -12px rgba(139, 44, 245, 0.55);
  --lift: 0 24px 60px -30px rgba(40, 20, 90, 0.28);
  --head: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--body); background: var(--paper); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; }
body::before, body::after { content: ''; position: fixed; z-index: -1; border-radius: 50%; filter: blur(70px); pointer-events: none; }
body::before { width: 520px; height: 520px; left: -160px; top: 60px; background: radial-gradient(circle, rgba(155, 61, 255, 0.13), transparent 70%); }
body::after { width: 560px; height: 560px; right: -200px; top: 300px; background: radial-gradient(circle, rgba(0, 184, 217, 0.11), transparent 70%); }

a { color: var(--purple-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--head); color: var(--ink); margin: 0; line-height: 1.1; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; text-transform: uppercase; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
.grad-text { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-family: var(--head); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; color: var(--muted); margin-bottom: 10px; }
.eyebrow::before { content: ''; width: 28px; height: 2px; background: var(--brand-grad); border-radius: 2px; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 22px 14px; background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(18px); border-right: 1px solid var(--hairline); }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { height: 22px; }
.brand small { display: block; font-family: var(--head); font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--hairline); padding-left: 12px; }
.nav-label { font-family: var(--head); font-size: 10px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: #a1a1aa; padding: 0 12px 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 500; transition: color 0.2s, background 0.2s; }
.nav a:hover { color: var(--ink); background: var(--soft-2); text-decoration: none; }
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a.active { color: var(--ink); background: var(--tint); font-weight: 600; }
.nav a.active svg { color: var(--purple); }
.nav a.active::before { content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-grad); }
.nav .count { margin-left: auto; font-size: 10.5px; font-weight: 700; min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 99px; background: var(--soft-2); color: var(--muted); }
.nav a.active .count { background: var(--btn-grad); color: #fff; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.side-foot .btn { width: 100%; }
.run-card { display: grid; gap: 6px; padding: 14px; border-radius: 16px; border: 1px solid var(--hairline); background: var(--soft); font-size: 12px; color: var(--muted); }
.run-card b { color: var(--ink); font-size: 13px; }

.main { min-width: 0; padding: 28px 36px 64px; max-width: 1400px; width: 100%; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--hairline); }
.topbar p { margin: 8px 0 0; color: var(--muted); max-width: 640px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; white-space: nowrap; padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: 13.5px; color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--hairline); transition: box-shadow 0.2s, transform 0.15s, background 0.2s; }
.btn:hover { box-shadow: inset 0 0 0 1px #c9c9d4; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--btn-grad); color: #fff; box-shadow: none; }
.btn.primary:hover { box-shadow: var(--glow); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn.ghost { box-shadow: none; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--soft-2); color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.busy { pointer-events: none; opacity: 0.7; }
.btn.busy::after { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards & grid ---------- */
.card { background: rgba(255, 255, 255, 0.9); border: 1px solid var(--hairline); border-radius: 18px; }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 0; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 16px; align-content: start; }
.mt { margin-top: 16px; }

.kpi { padding: 20px 22px; position: relative; overflow: hidden; }
.kpi .lbl { font-family: var(--head); font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.kpi .val { font-family: var(--head); font-size: 34px; font-weight: 800; color: var(--ink); margin-top: 8px; line-height: 1; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 8px; }
.kpi::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--brand-grad); opacity: 0.85; }

/* Funnel bars */
.funnel { display: grid; gap: 10px; padding: 18px 22px 22px; }
.funnel-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 44px; gap: 12px; align-items: center; font-size: 13px; }
.funnel-row .track { height: 10px; border-radius: 99px; background: var(--soft-2); overflow: hidden; }
.funnel-row .fill { height: 100%; border-radius: 99px; background: var(--brand-grad); min-width: 4px; }
.funnel-row b { text-align: right; font-family: var(--head); }

/* ---------- Chips, pills ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--soft-2); color: var(--muted); white-space: nowrap; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.brand { background: var(--tint); color: var(--purple-ink); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter { border: 0; cursor: pointer; padding: 7px 14px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--soft-2); color: var(--muted); }
.filter.on { background: var(--ink); color: #fff; }

.score { display: inline-flex; align-items: center; gap: 8px; font-family: var(--head); font-weight: 800; font-size: 13px; min-width: 92px; }
.score .bar { flex: 1; height: 6px; border-radius: 99px; background: var(--soft-2); overflow: hidden; min-width: 48px; }
.score .bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand-grad); }
.ring { --v: 0; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--purple) calc(var(--v) * 1%), var(--soft-2) 0); flex: none; }
.ring span { width: 58px; height: 58px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-family: var(--head); font-weight: 800; font-size: 20px; color: var(--ink); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-family: var(--head); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; transition: background 0.15s; }
tbody tr.click:hover { background: var(--soft); }
.co b { display: block; color: var(--ink); font-weight: 600; }
.co small { color: var(--muted); font-size: 12px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-family: var(--head); margin-bottom: 4px; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
input, select, textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--hairline); background: #fff; color: var(--ink); font-size: 13.5px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(155, 61, 255, 0.12); }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--hairline); }
.toolbar input[type='search'] { max-width: 280px; }
.toolbar select { width: auto; }

/* Strategy picker */
.strategies { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.strategy { text-align: left; cursor: pointer; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--hairline); background: #fff; transition: border-color 0.15s, box-shadow 0.15s; }
.strategy b { display: block; font-family: var(--head); font-size: 13px; color: var(--ink); }
.strategy small { color: var(--muted); font-size: 12px; }
.strategy:hover { border-color: #cfcfe0; }
.strategy.on { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(155, 61, 255, 0.12); background: linear-gradient(#fff, #fff) padding-box; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--soft); border: 1px solid var(--hairline); border-radius: 16px; padding: 12px; min-height: 360px; display: flex; flex-direction: column; gap: 10px; }
.col.over { border-color: var(--purple); background: #faf6ff; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 4px 6px; font-family: var(--head); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; }
.col-head .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; background: var(--brand-grad); }
.deal { background: #fff; border: 1px solid var(--hairline); border-radius: 12px; padding: 12px; cursor: grab; display: grid; gap: 6px; transition: box-shadow 0.15s; }
.deal:hover { box-shadow: var(--lift); }
.deal b { color: var(--ink); }
.deal .chip { white-space: normal; }

/* ---------- Drawer ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(11, 12, 16, 0.28); opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 40; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: #fff; border-left: 1px solid var(--hairline); transform: translateX(100%); transition: transform 0.25s ease; z-index: 41; overflow-y: auto; }
.drawer.open { transform: none; box-shadow: -30px 0 80px -40px rgba(40, 20, 90, 0.4); }
.d-head { position: sticky; top: 0; z-index: 2; display: flex; gap: 16px; align-items: center; padding: 22px 26px; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid var(--hairline); }
.d-head h2 { font-size: 20px; }
.d-body { padding: 8px 26px 40px; }
.section { padding: 20px 0; border-bottom: 1px solid var(--hairline); }
.section:last-child { border-bottom: 0; }
.section > h3 { margin-bottom: 12px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.qa { display: grid; gap: 10px; }
.qa div { padding: 10px 12px; border-radius: 10px; background: var(--soft); }
.qa small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }
.breakdown { display: grid; gap: 8px; }
.breakdown .row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 50px; gap: 10px; align-items: center; font-size: 12.5px; }
.breakdown .row .track { height: 8px; border-radius: 99px; background: var(--soft-2); overflow: hidden; }
.breakdown .row .track i { display: block; height: 100%; background: var(--brand-grad); border-radius: 99px; }
.breakdown .row small { grid-column: 2 / 4; color: var(--muted); margin-top: -4px; }
.sources { display: grid; gap: 6px; font-size: 12.5px; }
.sources a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email { border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.email-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: var(--soft); font-size: 12.5px; }
.email-head b { font-family: var(--head); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.email input { border: 0; border-bottom: 1px solid var(--hairline); border-radius: 0; font-weight: 600; }
.email textarea { border: 0; border-radius: 0; min-height: 150px; }
.email.sent .email-head { background: var(--good-bg); }
.note { padding: 12px 14px; border-radius: 12px; background: var(--tint); font-size: 13px; }
.err { padding: 10px 12px; border-radius: 10px; background: var(--bad-bg); color: var(--bad); font-size: 12.5px; }

/* ---------- Toasts / progress ---------- */
.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: var(--lift); max-width: 380px; animation: up 0.2s ease; }
.toast.bad { background: var(--bad); }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.progress { height: 6px; border-radius: 99px; background: var(--soft-2); overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand-grad); transition: width 0.4s; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); padding: 34px; display: grid; gap: 16px; box-shadow: var(--lift); }
.login-card img { height: 26px; justify-self: start; }
.login h1 { font-size: 26px; }

@media (max-width: 1100px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .strategies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
  .sidebar .nav { flex-direction: row; overflow-x: auto; width: 100%; }
  .nav-label, .side-foot { display: none; }
  .main { padding: 20px 16px 48px; }
  .g-4, .g-2, .strategies, .kv { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 24px; }
}
