/* ═══════════════════════════════════════════════════════════════
   InsiderSignal — Bloomberg Terminal Stylesheet
   Font: IBM Plex Mono  |  Palette: #000 / #FF6200 / #00CC55
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #000000;
  --bg1:         #0a0a0a;
  --bg2:         #111111;
  --bg3:         #1a1a1a;
  --bg4:         #242424;
  --border:      #2a2a2a;
  --border2:     #3a3a3a;

  /* Bloomberg orange */
  --orange:      #FF6200;
  --orange-dim:  #cc4e00;
  --orange-bg:   rgba(255, 98, 0, 0.1);
  --orange-glow: rgba(255, 98, 0, 0.06);

  /* Positive / negative */
  --green:       #00cc55;
  --green-dim:   #009940;
  --green-bg:    rgba(0, 204, 85, 0.08);
  --red:         #ff3344;
  --red-dim:     #cc2233;
  --red-bg:      rgba(255, 51, 68, 0.08);

  /* Data colours */
  --yellow:      #ffd700;
  --blue:        #4d9fff;
  --cyan:        #00d4d4;
  --purple:      #b066ff;

  --text:        #e0e0e0;
  --text-muted:  #888888;
  --text-dim:    #555555;
  --text-orange: #FF6200;

  --mono:  'IBM Plex Mono', 'Courier New', monospace;
  --sans:  'IBM Plex Sans', sans-serif;
  --radius: 2px;

  /* Bloomberg orange top/bottom bar height */
  --bar-h: 26px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── FUNCTION KEY BAR ─────────────────────────────────────────────── */
.fkbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--bar-h);
  background: var(--orange);
  display: flex;
  align-items: center;
  z-index: 1000;
  user-select: none;
}
.fkbar-left {
  display: flex;
  align-items: stretch;
  height: 100%;
  flex: 1;
}
.fk-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: #000;
  text-decoration: none;
  border-right: 1px solid rgba(0,0,0,0.2);
  transition: background 0.1s;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border-top: none; border-bottom: none; border-left: none;
}
.fk-btn .fk-num {
  background: rgba(0,0,0,0.25);
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
}
.fk-btn:hover, .fk-btn.active {
  background: rgba(0,0,0,0.2);
  color: #000;
}
.fkbar-right {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  color: #000;
  gap: 16px;
  white-space: nowrap;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #000;
  display: inline-block;
  animation: blink 1.4s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

/* ── BOTTOM STATUS BAR ────────────────────────────────────────────── */
.statusbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bar-h);
  background: var(--bg3);
  border-top: 1px solid var(--orange-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 11px;
  color: var(--text-muted);
  z-index: 1000;
}
.statusbar .status-item { display: flex; gap: 6px; align-items: center; }
.status-sep { color: var(--text-dim); }

/* ── PAGE BODY OFFSET ─────────────────────────────────────────────── */
.page-body {
  padding-top: calc(var(--bar-h) + 0px);
  padding-bottom: calc(var(--bar-h) + 8px);
  min-height: 100vh;
}

/* ── HEADER BAND ──────────────────────────────────────────────────── */
.header-band {
  background: var(--bg1);
  border-bottom: 2px solid var(--orange);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.header-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}
.header-meta {
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.header-meta .big {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
  display: block;
}

/* ── TICKER TAPE ──────────────────────────────────────────────────── */
.tape-wrap {
  overflow: hidden;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  height: 24px;
  display: flex;
  align-items: center;
}
.tape-inner {
  display: flex;
  gap: 0;
  white-space: nowrap;
  animation: tape 30s linear infinite;
}
.tape-inner:hover { animation-play-state: paused; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tape-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  font-size: 11px;
  border-right: 1px solid var(--border);
}
.tape-ticker { color: var(--orange); font-weight: 600; }
.tape-val    { color: var(--text); }
.tape-chg.pos { color: var(--green); }
.tape-chg.neg { color: var(--red); }

/* ── LAYOUT ───────────────────────────────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.container {
  padding: 0 16px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* ── SECTION LABEL ────────────────────────────────────────────────── */
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--orange);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-label .slabel-right {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 10px;
}

/* ── STATS ROW ────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  background: var(--bg1);
  border-bottom: 2px solid var(--border);
}
.stat-box {
  padding: 10px 16px;
  border-right: 1px solid var(--border);
  transition: background 0.1s;
}
.stat-box:last-child { border-right: none; }
.stat-box:hover { background: var(--bg2); }
.sb-label {
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.sb-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--orange);
  line-height: 1.2;
  margin-top: 2px;
}
.sb-value.pos  { color: var(--green); }
.sb-value.neg  { color: var(--red); }
.sb-value.neu  { color: var(--text); }
.sb-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ── BLOOMBERG-STYLE TABLES ───────────────────────────────────────── */
.bb-table-wrap {
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
}
.bb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.bb-table thead tr {
  background: var(--bg3);
  border-bottom: 1px solid var(--orange-dim);
}
.bb-table th {
  padding: 7px 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border-right: 1px solid var(--border);
}
.bb-table th:last-child { border-right: none; }
.bb-table th:hover { background: var(--bg4); color: #fff; }
.bb-table th.sort-asc::after  { content: ' ▲'; font-size: 9px; }
.bb-table th.sort-desc::after { content: ' ▼'; font-size: 9px; }
.bb-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.08s;
}
.bb-table tbody tr:nth-child(even) { background: var(--bg1); }
.bb-table tbody tr:hover { background: var(--orange-glow); }
.bb-table td {
  padding: 7px 12px;
  white-space: nowrap;
  border-right: 1px solid var(--border);
  vertical-align: middle;
}
.bb-table td:last-child { border-right: none; }

/* Cell types */
.td-ticker {
  color: var(--orange);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.td-pos { color: var(--green); font-weight: 600; }
.td-neg { color: var(--red); font-weight: 600; }
.td-neu { color: var(--text); }
.td-muted { color: var(--text-muted); }

/* Role badges */
.role-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border-radius: 1px;
}
.rt-ceo { background: #ff6200; color: #000; }
.rt-cfo { background: #ffd700; color: #000; }
.rt-coo { background: #4d9fff; color: #000; }
.rt-dir { background: #00cc55; color: #000; }
.rt-evp { background: #b066ff; color: #000; }
.rt-oth { background: #333; color: #888; }

/* RVOL bar */
.rvol-bar-wrap { display: flex; align-items: center; gap: 6px; }
.rvol-bar {
  height: 8px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--orange-dim), var(--orange));
  min-width: 4px;
  max-width: 80px;
}
.rvol-val { font-weight: 600; color: var(--orange); min-width: 36px; }

/* Cluster dots */
.cluster-dots { display: flex; gap: 2px; }
.cdot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border2);
}
.cdot.lit { background: var(--orange); box-shadow: 0 0 4px var(--orange-dim); }

/* ── FILTER PANEL ─────────────────────────────────────────────────── */
.filter-panel {
  background: var(--bg1);
  border-bottom: 2px solid var(--border);
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.fp-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 110px;
}
.fp-label {
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.fp-control {
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.fp-control:focus { border-color: var(--orange); }
.fp-control option { background: var(--bg3); }
.fp-range { width: 100%; accent-color: var(--orange); }
.fp-range-val {
  font-size: 11px;
  color: var(--orange);
  text-align: right;
}
.fp-checkgroup {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fp-check {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-muted);
  padding: 3px 7px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--bg3);
  transition: all 0.1s;
}
.fp-check input { accent-color: var(--orange); cursor: pointer; }
.fp-check:has(input:checked) {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-bg);
}

/* ── BUTTONS ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: var(--radius);
  border: none;
  transition: all 0.1s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-orange {
  background: var(--orange);
  color: #000;
}
.btn-orange:hover { background: #ff7a30; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--orange); color: var(--orange); }

/* ── TWO-COLUMN LAYOUT ────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.two-col > * {
  border-right: 1px solid var(--border);
}
.two-col > *:last-child { border-right: none; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ── CHART CONTAINERS ─────────────────────────────────────────────── */
.chart-box {
  padding: 12px 16px;
  height: 220px;
  position: relative;
}
.chart-title {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

/* ── PAGINATOR ────────────────────────────────────────────────────── */
.paginator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}
.pag-btns { display: flex; gap: 4px; }
.pag-btn {
  padding: 3px 9px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  border-radius: var(--radius);
}
.pag-btn:hover { border-color: var(--orange); color: var(--orange); }
.pag-btn.active { background: var(--orange); color: #000; border-color: var(--orange); }
.pag-btn:disabled { opacity: 0.3; cursor: default; }

/* ── SECTOR TABLE ─────────────────────────────────────────────────── */
.sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0;
  border-top: 1px solid var(--border);
}
.sector-card {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.sector-card:hover { background: var(--bg2); }
.sc-name { font-size: 11px; color: var(--orange); font-weight: 600; margin-bottom: 6px; }
.sc-bar-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin: 4px 0 6px;
}
.sc-bar-fill {
  height: 3px;
  background: var(--orange);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.sc-stats {
  display: flex;
  gap: 16px;
  font-size: 11px;
}
.sc-stat-label { color: var(--text-dim); }
.sc-stat-val   { color: var(--text); }
.sc-stat-val.pos { color: var(--green); }
.sc-stat-val.neg { color: var(--red); }

/* ── AD SLOTS ─────────────────────────────────────────────────────── */
.ad-slot {
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  text-align: center;
}
.ad-label {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ── UTILITY ──────────────────────────────────────────────────────── */
.mono  { font-family: var(--mono); }
.orange { color: var(--orange); }
.muted  { color: var(--text-muted); }
.bold   { font-weight: 700; }
.right  { text-align: right; }

/* Scrollbar */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange-dim); }

/* ── RESPONSIVE ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .fk-btn .fk-label { display: none; }
  .header-band { flex-direction: column; align-items: flex-start; }
  .filter-panel { gap: 8px; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .bb-table th, .bb-table td { padding: 6px 8px; font-size: 11px; }
}
