@import url("https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Geist+Mono:wght@100..900&display=swap");

:root {
  --font: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --bg: #061522;
  --panel: rgba(8, 24, 40, 0.34);
  --glass: blur(22px) saturate(1.4);
  --border: rgba(200, 225, 255, 0.18);
  --border-strong: rgba(210, 230, 255, 0.34);
  --text: #c4d4e8;
  --bright: #eef4fb;
  --muted: #7f97ad;
  --accent: #4eb3ff;
  --accent-soft: rgba(78, 179, 255, 0.16);
  --green: #3ecf8e;
  --red: #ef5b5b;
  --amber: #e8a838;
  --radius: 14px;
  --side: 248px;
  --rail: 340px;
}

* { box-sizing: border-box; margin: 0; padding: 0; scrollbar-width: thin; scrollbar-color: rgba(126, 210, 255, 0.45) rgba(8, 28, 48, 0.35); }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.app {
  --bg-image: none;
  --bg-overlay: rgba(3, 10, 20, 0.52);
  display: flex;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}
.app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  filter: blur(2px) saturate(0.85);
  transform: scale(1.05);
  pointer-events: none;
}
.app::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--bg-overlay), var(--bg-overlay)),
    linear-gradient(100deg, rgba(3, 12, 24, 0.28) 0%, rgba(3, 12, 24, 0.08) 42%, rgba(3, 12, 24, 0.4) 100%);
}
.side, .main, .rail { position: relative; z-index: 1; }

.side {
  width: var(--side);
  flex: none;
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  background: rgba(5, 16, 28, 0.46);
  border-right: 1px solid var(--border);
  backdrop-filter: var(--glass);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.06);
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 6px 14px; }
.brand img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
.brand__title { color: var(--bright); font-weight: 640; letter-spacing: -0.02em; }
.brand__tag { color: var(--muted); font-size: 12px; }
.side__scroll { overflow: auto; min-height: 0; flex: 1; }
.nav-label { margin: 14px 8px 6px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.program, .nav button, .confs button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  text-align: left; border: 1px solid transparent; background: transparent;
  border-radius: 10px; padding: 9px 10px; color: var(--text);
}
.program { border-color: var(--border); background: rgba(8, 22, 38, 0.55); margin-bottom: 8px; }
.program img { width: 32px; height: 32px; object-fit: contain; }
.program span { color: var(--bright); font-weight: 620; }
.program.is-open, .nav button.is-active, .confs button.is-active {
  background: var(--accent-soft); border-color: rgba(78, 179, 255, 0.4); color: var(--bright);
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button:hover, .confs button:hover, .program:hover { background: rgba(255,255,255,0.04); }
.confs { display: flex; flex-direction: column; gap: 4px; }
.confs button { height: 46px; }
.confs img { height: 26px; width: 108px; object-fit: contain; object-position: left center; }

.picker { margin: 0 0 8px; border: 1px solid var(--border-strong); border-radius: 12px; background: rgba(6, 16, 28, 0.95); overflow: hidden; }
.picker input { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent; padding: 8px 10px; outline: none; }
.picker__list { max-height: 280px; overflow: auto; }
.picker__list button { display: flex; gap: 8px; align-items: center; width: 100%; border: 0; background: transparent; padding: 7px 10px; text-align: left; }
.picker__list button:hover, .picker__list button.is-current { background: var(--accent-soft); }
.picker__list img { width: 22px; height: 22px; object-fit: contain; }
.picker__list small { display: block; color: var(--muted); font-size: 11px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 14px; padding: 14px 22px 6px; }
.top__product { color: var(--bright); font-weight: 620; white-space: nowrap; }
.top__search { position: relative; flex: 1; max-width: 560px; }
.top__search input { width: 100%; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: rgba(6, 18, 32, 0.72); padding: 0 52px 0 12px; outline: none; }
.top__search input:focus { border-color: rgba(78, 179, 255, 0.7); }
.top__search kbd { position: absolute; right: 8px; top: 8px; font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; }
.crumb { margin-left: auto; color: var(--bright); font-size: 14px; white-space: nowrap; }
.stage { padding: 8px 22px 32px; }

.hits { position: absolute; z-index: 6; top: 46px; left: 0; right: 0; max-height: 380px; overflow: auto; background: rgba(6, 16, 28, 0.97); border: 1px solid var(--border-strong); border-radius: 12px; }
.hits button { display: flex; gap: 8px; width: 100%; border: 0; background: transparent; padding: 8px 12px; text-align: left; align-items: center; }
.hits button:hover, .hits button.is-active { background: var(--accent-soft); }
.hits img { width: 26px; height: 26px; object-fit: contain; }
.hits small { display: block; color: var(--muted); }

.hero { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 12px; }
.hero__brand { display: flex; gap: 12px; align-items: center; min-width: 280px; }
.hero__logo { height: 28px; width: auto; max-height: 28px; object-fit: contain; flex: none; }
.hero__mark { width: 48px; height: 48px; object-fit: contain; flex: none; }
.hero h2 { color: var(--bright); font-size: 26px; letter-spacing: -0.03em; font-weight: 640; }
.hero p { color: var(--muted); margin-top: 3px; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 640px; }
.chip {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(4, 14, 28, 0.45); padding: 4px;
}
.chip img { width: 100%; height: 100%; object-fit: contain; }
.chip.is-selected, .chip:hover { border-color: var(--accent); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi, .panel, .dc-delta, .dc-holes {
  background: rgba(8, 24, 40, 0.32);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.kpi { padding: 12px 14px; }
.kpi b { display: block; color: var(--bright); font-size: 26px; letter-spacing: -0.03em; font-weight: 640; }
.kpi span { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
.panel__head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.panel__title { color: var(--bright); font-weight: 620; }
.panel__sub { color: var(--muted); font-size: 12px; }
.table-wrap { overflow: auto; max-height: 460px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(200, 225, 255, 0.08); white-space: nowrap; }
th { position: sticky; top: 0; background: rgba(7, 20, 34, 0.96); color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 560; }
th button { border: 0; background: transparent; color: inherit; padding: 0; letter-spacing: inherit; text-transform: inherit; font-size: inherit; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr.is-selected { background: rgba(78, 179, 255, 0.1); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.who { display: flex; align-items: center; gap: 8px; }
.who img, .avatar { width: 32px; height: 32px; object-fit: contain; flex: none; }
.avatar, .shot-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: var(--bright);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.head { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,0.05); }

.map { position: relative; height: 320px; margin: 10px; border-radius: 12px; overflow: hidden; background: #040e1c; border: 1px solid rgba(100, 170, 255, 0.28); }
.map .land { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.map__pin { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(180, 220, 255, 0.45); background: rgba(4, 14, 28, 0.6); padding: 2px; }
.map__pin img { width: 100%; height: 100%; object-fit: contain; }
.map__pin.is-home { box-shadow: 0 0 0 2px var(--accent); z-index: 2; }

.risk { display: inline-flex; align-items: center; gap: 6px; }
.risk i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: block; }
.risk.high i { background: var(--red); }
.risk.med i { background: var(--amber); }
.risk.low i { background: var(--green); }

.btn { border: 1px solid var(--border-strong); background: rgba(8, 22, 38, 0.7); color: var(--bright); border-radius: 9px; padding: 6px 10px; font-size: 12px; }
.btn:hover { border-color: var(--accent); }
.btn[disabled] { opacity: 0.55; cursor: default; }

.swaps { margin-top: 14px; }
.lab-scenario, .lab-board { margin-top: 14px; }
.lab-hole { padding: 14px 16px; margin-bottom: 10px; border-left: 3px solid var(--border); }
.lab-hole.is-hole { border-left-color: var(--amber); }
.lab-hole__head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.lab-hole__head strong { color: var(--bright); font-size: 15px; margin-right: 8px; }
.lab-hole__head .panel__sub { display: block; margin-top: 4px; }
.lab-pos { display: inline-block; min-width: 34px; text-align: center; margin-right: 8px; padding: 2px 8px; border-radius: 999px; font: 600 12px var(--mono); color: #061522; background: var(--pos); }
.lab-hole__money { display: grid; grid-template-columns: auto auto; gap: 2px 8px; align-items: baseline; text-align: right; font-family: var(--mono); }
.lab-hole__money b { color: var(--bright); font-size: 14px; }
.lab-hole__money span { color: var(--muted); font-size: 11px; text-align: left; }
.lab-hole__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lab-col__title { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.lab-person { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 8px; align-items: center; width: 100%; padding: 5px 6px; border-radius: 10px; min-width: 0; }
.lab-person:hover { background: var(--accent-soft); }
.lab-person > span { min-width: 0; }
.lab-person strong, .lab-person em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-person strong { color: var(--bright); font-size: 13px; font-weight: 600; }
.lab-person em { font-style: normal; color: var(--muted); font-size: 11px; font-family: var(--mono); }
.lab-target { display: flex; align-items: center; gap: 6px; }
.lab-target .btn { flex: none; font-size: 11px; padding: 4px 8px; }
.is-veiled, .lab-target.is-veiled { filter: blur(6px); pointer-events: none; user-select: none; }
tr.is-veiled, tr.is-veiled td { filter: none; pointer-events: auto; user-select: auto; }
tr.is-veiled td { filter: blur(6px); }
.btn.hollow { background: transparent; border-style: dashed; color: #8aa0b8; opacity: 1; cursor: default; }
.lab-none { color: var(--muted); font-size: 12px; margin: 6px; }
@media (max-width: 1100px) { .lab-hole__cols { grid-template-columns: 1fr; } }
.swap {
  display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 92px auto;
  gap: 10px; align-items: center; padding: 10px 12px; margin-bottom: 8px;
}
.swap__side { display: flex; gap: 8px; align-items: center; min-width: 0; }
.swap__side strong, .swap__side span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.swap__sign { color: var(--muted); text-align: center; }
.up { color: var(--green); }
.down { color: var(--red); }
.swap__boom { text-align: right; font-family: var(--mono); font-size: 12px; }
.swap__boom span { display: block; }

.rail {
  width: var(--rail); flex: none; min-height: 100vh;
  border-left: 1px solid var(--border); background: rgba(5, 14, 26, 0.88);
  backdrop-filter: blur(16px); padding: 16px;
}
.rail__top { display: flex; justify-content: space-between; align-items: center; }
.rail__x { border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.shot { width: 132px; height: 132px; object-fit: cover; border-radius: 16px; margin: 10px 0; background: rgba(255,255,255,0.05); }
.rail h3 { color: var(--bright); font-size: 24px; letter-spacing: -0.03em; }
.rail .pos { color: var(--accent); margin-top: 2px; font-weight: 600; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.fact { padding: 8px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); }
.fact span { display: block; color: var(--muted); font-size: 11px; }
.fact b { color: var(--bright); font-weight: 580; }
.note { margin-top: 14px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.who small { display: block; color: var(--accent); font-size: 10px; letter-spacing: 0.06em; }
.up { color: #3dde7a; }
.down { color: #ff6b7a; }
.est { margin-left: 4px; color: var(--muted); font-size: 10px; }
.call { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 12px; }
.call.up { background: rgba(61,222,122,0.12); }
.call.down { background: rgba(255,107,122,0.12); }
.call.protect { color: #c9a6ff; background: rgba(140,90,255,0.16); }
.call.hold { color: var(--muted); background: rgba(255,255,255,0.04); }
.dc-delta, .dc-holes { display: block; width: 100%; margin-bottom: 12px; padding: 14px 16px; border-radius: 16px; text-align: left; color: inherit; }
.dc-delta__title { color: var(--bright); font-weight: 600; margin-bottom: 10px; }
.dc-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dc-metrics b { display: block; color: var(--bright); font-size: 18px; letter-spacing: -0.03em; }
.dc-metrics span, .dc-holes span { color: var(--muted); font-size: 12px; }
.dc-holes b { display: block; color: var(--bright); font-weight: 560; margin-bottom: 4px; }
.dc-cockpit { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr); gap: 12px; align-items: start; }
.dc-hold { margin: 8px 12px 12px; color: var(--muted); }
.ring { position: relative; min-height: 340px; }
.ring svg { width: 100%; height: 340px; filter: drop-shadow(0 16px 28px rgba(0, 220, 255, 0.16)); }
.ring__glass {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 118px; height: 118px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: rgba(6, 18, 36, 0.55);
  border: 1px solid rgba(46, 230, 255, 0.45);
  backdrop-filter: blur(18px) saturate(1.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 0 28px rgba(46, 230, 255, 0.22);
  pointer-events: none;
}
.ring__glass b { color: var(--bright); font-size: 18px; letter-spacing: -0.03em; }
.ring__glass span { color: var(--muted); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.ring__glass small { color: var(--accent); margin-top: 4px; font-size: 11px; }
.sheet {
  position: fixed; left: calc(var(--side) + 14px); right: 14px; bottom: 10px;
  height: min(46vh, 460px); z-index: 40; display: flex; flex-direction: column;
  padding: 0 16px 14px; border-radius: 16px;
  background: rgba(6, 16, 28, 0.48);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  box-shadow: 0 -16px 56px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.sheet[hidden] { display: none !important; }
.sheet__bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 8px; gap: 12px; }
.sheet__tabs { display: flex; gap: 2px; }
.sheet__tabs button { border: 0; background: transparent; color: var(--muted); padding: 6px 10px; border-bottom: 2px solid transparent; }
.sheet__tabs button.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 640; }
.sheet__x { border: 0; background: transparent; color: var(--muted); font-size: 22px; }
.sheet__body { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 10px; min-height: 0; overflow: auto; }
.sheet__body--stack { grid-template-columns: 1fr; }
.ws {
  border: 1px solid rgba(200, 225, 255, 0.12); border-radius: 12px; padding: 12px;
  background: rgba(8, 22, 38, 0.35);
}
.ws h3 { color: var(--bright); font-size: 16px; }
.ws h4 { color: var(--bright); font-size: 13px; margin-bottom: 6px; }
.ws p { color: var(--text); font-size: 13px; line-height: 1.45; }
.ws__meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.ws__id { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.ws__id img, .ws__id .avatar { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.sim { margin-top: 8px; }
.sim__row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.sim__row strong { color: var(--bright); }
.sim input { width: 100%; accent-color: #4eb3ff; }
.ws-range { color: var(--bright); font-size: 22px; letter-spacing: -0.03em; margin: 4px 0; }
.ws-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.ws-stat { padding: 8px; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(200,225,255,0.1); }
.ws-stat span { display: block; color: var(--muted); font-size: 11px; }
.ws-stat b { color: var(--bright); }
.donut { width: 220px; height: 220px; margin: 12px auto; border-radius: 50%; display: grid; place-items: center; }
.donut div { width: 132px; height: 132px; border-radius: 50%; background: #071422; display: grid; place-items: center; text-align: center; }
.donut b { color: var(--bright); font-size: 20px; }
.donut span { color: var(--muted); font-size: 11px; }
.donut-key { list-style: none; margin: 8px 0 0; padding: 0; }
.donut-key li { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--text); font-size: 13px; }
.donut-key i { width: 8px; height: 8px; border-radius: 99px; }
.donut-key span { flex: 1; }
.donut-key b { font-weight: 560; }
.statline { margin-top: 12px; color: var(--bright); font-size: 14px; font-weight: 560; }
.season-list { margin: 8px 0 0; padding: 0; list-style: none; }
.season-list li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.season-list b { color: var(--text); font-weight: 500; text-align: right; }
.empty { padding: 18px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1100px) {
  .layout, .kpis, .dc-metrics, .dc-cockpit { grid-template-columns: 1fr 1fr; }
  .layout { grid-template-columns: 1fr; }
  .swap { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .side { width: 100%; height: auto; position: relative; }
  .nav, .confs { flex-direction: row; flex-wrap: wrap; }
  .nav button, .confs button, .program { width: auto; }
  .rail { width: 100%; min-height: 0; border-left: 0; border-top: 1px solid var(--border); }
  .crumb, .top__product { display: none; }
  .hero { flex-direction: column; align-items: flex-start; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .stage, .top { padding-inline: 14px; }
  .sheet { left: 10px; right: 10px; height: min(58vh, 520px); }
  .sheet__body { grid-template-columns: 1fr; }
}
.is-conf-locked #programBtn { cursor: default; pointer-events: none; }
.is-conf-locked #picker { display: none; }
.is-identity-veiled .who,
.chip.is-identity-veiled,
.map__pin.is-identity-veiled {
  filter: blur(6px);
}
tr.is-identity-veiled { cursor: default; }
tr.is-identity-veiled .who,
.chip.is-identity-veiled,
.map__pin.is-identity-veiled { pointer-events: none; user-select: none; }
.is-conf-locked #confBtn .v4-ctx-select__chev { display: none; }
.is-conf-locked.is-solis #confBtn { cursor: pointer; }
.is-conf-locked.is-solis #confBtn .v4-ctx-select__chev { display: inline-flex; }
