/* Auto-Cuan Unified AI Cockpit Styles (PR 2: Layout Terpadu & Auto-Sync Ticker) */

/* Main Cockpit Grid */
.unified-cockpit-shell {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  box-sizing: border-box;
}

.unified-cockpit-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .unified-cockpit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
}

.unified-primary-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.unified-chat-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 1024px) {
  .unified-chat-col {
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
  }
}

/* Cockpit Header & Search Bar */
.unified-top-bar {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 4px;
}

.unified-input-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.unified-input-wrapper {
  flex: 1 1 240px;
  position: relative;
}

.unified-ticker-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 3px 9px;
  border-radius: 9999px;
}

/* Card Shell */
.unified-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  box-sizing: border-box;
}

/* #rankingTableWrap gets its scrollbox from premium-workstation-core.css /
   -v6.css on index.html, but analisis-saham.html never loads that bundle —
   so the Ranking Harian tab there had no overflow/max-height at all and the
   sticky <thead> in analisis-saham-runtime.js's renderRankingTable() stuck to
   the browser viewport instead of the table panel. Declared here (shared by
   both pages) so the table scrolls the same way everywhere regardless of
   which host page's stylesheet bundle is loaded. Values match the dashboard's
   own #rankingTableWrap rule in premium-workstation-v6.css. */
#rankingTableWrap {
  overflow: auto;
  max-height: min(66vh, 720px);
}

.unified-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
}

/* Interactive Chart Area */
.unified-chart-box {
  position: relative;
  width: 100%;
  min-height: 280px;
}

.unified-chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 6px 14px;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Sub-tab Switcher */
.unified-subtabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.unified-subtab-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--motion-fast, 180ms) var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1));
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.unified-subtab-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.04);
}

.unified-subtab-btn.active {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.unified-subtab-btn.vision-tab.active {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

/* Chat Messages Container */
.unified-chat-messages {
  overflow-y: auto;
  overscroll-behavior-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 240px;
  max-height: 480px;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .unified-chat-messages {
    max-height: calc(100vh - 280px);
    min-height: 360px;
  }
}

/* Chat composer wrapper */
.unified-chat-composer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.2);
}

.unified-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.unified-prompt-chip {
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all var(--motion-fast, 180ms) var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1));
  white-space: nowrap;
}

.unified-prompt-chip:hover {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}

/* ===== ANALISIS SAHAM SUB-TAB STRIP (POLA PORTFOLIO) ===== */
/* PR1 layout fix (measured via CDP): the header is `position: sticky; top: 0`
   and 61px tall. The tab strip was also `position: sticky; top: 61px`, which
   DOUBLE-counted the header height on first paint: with scrollY = 0 the strip
   sat at y=122 instead of y=61, opening a 61px black void directly under the
   header (headerBottom=61, tabTop=122, gap=61).
   Root cause: the scroll container is <body>, not #page-analisis. A sticky
   element whose `top` is a positive offset in a non-scrolled flex parent gains
   that offset as a static shift. The correct value is `top: 0` — the sticky
   header (z-index 50) already sits above the strip (z-index 20) while
   scrolling, so no manual offset is needed. */
:root { --analisis-header-h: 61px; }
#page-analisis {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
.analisis-tab-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 12px;
  margin-top: 0;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(rgba(11, 14, 20, 0.98) 80%, transparent);
  scrollbar-width: none;
}
.analisis-tab-strip::-webkit-scrollbar { display: none; }

.analisis-tab {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #17202e;
  color: #94a3b8;
  border-radius: 12px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.18s ease;
}

.analisis-tab:hover {
  color: #f1f5f9;
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.2);
}

.analisis-tab.active {
  background: #10b981;
  border-color: #10b981;
  color: #04251c;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.analisis-tab-panel {
  display: none;
  width: 100%;
}

.analisis-tab-panel.active {
  display: block;
}

/* ===== PR1 LAYOUT FIX: dropdown & search containers ===== */
/* The broker date dropdown wrapper is injected ABOVE the panel content and
   had no containing block, so it stacked over the "Broker Summary" heading.
   Give it its own row, isolation, and a stacking context below the sticky
   tab strip (z-index 20). */
#brokerDateSelectWrap {
  position: relative;
  z-index: 10;
  width: 100%;
  isolation: isolate;
}

/* The Sinyal Intelijen search bar is covered by the sticky tab strip on
   scroll because it had no scroll offset compensation. Reserve room equal to
   the header + strip so the input's top edge stays visible. */
#intelSearchBarContainer {
  scroll-margin-top: calc(var(--analisis-header-h) + 44px);
  position: relative;
  z-index: 10;
}

/* ===== INDEPENDENT TAB SEARCH BARS ===== */
.tab-independent-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab-independent-search input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: #f1f5f9;
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  transition: all var(--motion-fast, 180ms) var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1));
}

.tab-independent-search input:focus {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.tab-independent-search button {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--motion-fast, 180ms) var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1));
  white-space: nowrap;
}

.tab-independent-search button:hover {
  background: rgba(16, 185, 129, 0.28);
  border-color: rgba(16, 185, 129, 0.5);
  color: #a7f3d0;
}

@media (max-width: 640px) {
  .tab-independent-search input {
    width: 100px;
    font-size: 11px;
    padding: 5px 8px;
  }
  .tab-independent-search button {
    padding: 5px 10px;
    font-size: 11px;
  }
}

/* =========================================================================
   TABLE & CONTAINER SCROLL BOUNDING (Fixed Heights & Containment)
   Guarantees that tables and data containers scroll internally within their
   own boxes and never hijack the page/window scrolling across all 9 pages.
   ========================================================================= */
#rankingTableWrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(66vh, 560px);
  scrollbar-width: thin;
  overscroll-behavior-y: contain;
}

#portTableWrap,
.table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(66vh, 520px);
  scrollbar-width: thin;
  overscroll-behavior-y: contain;
}

#trTableWrap,
#trBacktestTradesWrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(66vh, 580px);
  scrollbar-width: thin;
  overscroll-behavior-y: contain;
}

#screenerTableWrap,
#nkScreenerTableWrap,
#dtScreenerTableWrap {
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(66vh, 560px);
  scrollbar-width: thin;
  overscroll-behavior-y: contain;
}

#sektorDetailTable {
  overflow-x: auto;
  overflow-y: auto;
  max-height: min(66vh, 560px);
  scrollbar-width: thin;
  overscroll-behavior-y: contain;
}

#newsPageContainer {
  overflow-y: auto;
  max-height: min(70vh, 640px);
  scrollbar-width: thin;
  overscroll-behavior-y: contain;
}

#analisisResult {
  overflow-y: auto;
  max-height: min(70vh, 640px);
  scrollbar-width: thin;
  overscroll-behavior-y: contain;
}

#unifiedAiChartResultWrap {
  overflow-y: auto;
  max-height: min(66vh, 560px);
  scrollbar-width: thin;
  overscroll-behavior-y: contain;
}

.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
  overscroll-behavior-y: contain;
}
.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 4px;
}
.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}.analisis-tab-strip {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 6px !important;
  margin-bottom: 16px !important;
  background: rgba(15, 23, 42, 0.78) !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-radius: 14px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 6px 18px rgba(2, 6, 23, 0.28) !important;
  overflow-x: auto;
  scrollbar-width: none;
}

@media (min-width: 1024px) {
  .analisis-tab-strip {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
  }
}

.analisis-tab {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  padding: 7px 13px !important;
  min-height: 36px !important;
  border-radius: 10px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.01em !important;
  color: #94a3b8 !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  white-space: nowrap !important;
  cursor: pointer;
  transition: background-color var(--motion-fast, 180ms) var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1)),
              color var(--motion-fast, 180ms) var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1)),
              border-color var(--motion-fast, 180ms) var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1)),
              box-shadow var(--motion-fast, 180ms) var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1)) !important;
  flex-shrink: 0 !important;
}

.analisis-tab:hover {
  color: #f1f5f9 !important;
  background: rgba(30, 41, 59, 0.72) !important;
  border-color: rgba(148, 163, 184, 0.18) !important;
}

.analisis-tab.active {
  color: #34d399 !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 78, 59, 0.32)) !important;
  border-color: rgba(16, 185, 129, 0.48) !important;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  font-weight: 700 !important;
}

/* Search Bar & Popular Ticker Chips Refinement */
#analisisChartHeader .unified-top-bar,
.unified-top-bar {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(11, 15, 25, 0.94)) !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-radius: 14px !important;
  padding: 12px 16px !important;
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.28) !important;
}

#analisisInput,
#bandarTickerSearchInput,
#intelSearchInput,
#insiderRosterTickerInput,
#rankingSearchInput {
  font-family: var(--font-mono, 'Geist Mono', monospace) !important;
  font-variant-numeric: tabular-nums !important;
  letter-spacing: 0.03em !important;
  border-radius: 10px !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  background: rgba(15, 23, 42, 0.88) !important;
  color: #f8fafc !important;
  transition: border-color var(--motion-fast, 180ms) var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1)),
              box-shadow var(--motion-fast, 180ms) var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1)) !important;
}

#analisisInput:focus,
#bandarTickerSearchInput:focus,
#intelSearchInput:focus,
#insiderRosterTickerInput:focus,
#rankingSearchInput:focus {
  border-color: rgba(16, 185, 129, 0.65) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16) !important;
  outline: none !important;
}

/* Popular Ticker Pills in Top Bar */
.unified-top-bar button[onclick*="quickAnalisis"] {
  font-family: var(--font-mono, 'Geist Mono', monospace) !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  border-radius: 8px !important;
  padding: 4px 10px !important;
  background: rgba(30, 41, 59, 0.75) !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  color: #cbd5e1 !important;
  transition: background-color var(--motion-fast, 180ms) var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1)),
              border-color var(--motion-fast, 180ms) var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1)),
              color var(--motion-fast, 180ms) var(--ease-standard, cubic-bezier(0.4, 0, 0.2, 1)) !important;
}

.unified-top-bar button[onclick*="quickAnalisis"]:hover {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: rgba(16, 185, 129, 0.42) !important;
  color: #34d399 !important;
}

@media (max-width: 640px) {
  .unified-top-bar {
    padding: 10px 12px !important;
  }
  .unified-top-bar .flex-1.flex.flex-wrap {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .unified-top-bar .flex-1.flex.flex-wrap > .relative {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  #analisisInput {
    width: 100% !important;
    min-width: 100% !important;
    min-height: 44px !important;
    font-size: 15px !important;
    padding: 10px 14px !important;
    box-sizing: border-box !important;
  }
  #btnJalankanAnalisis {
    min-height: 44px !important;
    padding: 10px 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
  }
  .unified-top-bar button[onclick*="openAiApiKeyModal"] {
    min-height: 44px !important;
    padding: 10px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
  }
}

/* --- PHASE 7: SUB-TAB BANDARMOLOGI & BROKER HUNTER (#panel-tab-bandarmologi, #panel-tab-hunter) --- */
#panel-tab-bandarmologi .unified-card,
#panel-tab-hunter .unified-card,
#panel-tab-intel .unified-card,
#panel-tab-insider .unified-card,
#panel-tab-ranking .unified-card,
#panel-tab-pattern .unified-card {
  background: rgba(15, 23, 42, 0.86) !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.32) !important;
}

/* TanStack-grade density on Broker Summary, Akumulasi, and Broker Hunter tables */
.broker-summary-table,
#bandarmologiContent table,
#brokerHunterContent table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-variant-numeric: tabular-nums !important;
}

.broker-summary-table thead th,
#bandarmologiContent table thead th,
#brokerHunterContent table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  padding: 8px 8px !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: #94a3b8 !important;
  background-color: #0f172a !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22) !important;
  white-space: nowrap !important;
}

.broker-summary-table tbody td,
#bandarmologiContent table tbody td,
#brokerHunterContent table tbody td {
  padding: 7px 8px !important;
  font-size: 11.5px !important;
  line-height: 1.35 !important;
  font-variant-numeric: tabular-nums !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08) !important;
  vertical-align: middle !important;
}

.broker-summary-table thead th,
.broker-summary-table tbody td {
  padding: 7px 6px !important;
  font-size: 11px !important;
}

/* Numeric right-aligned cells use crisp monospace figures */
.broker-summary-table tbody td.text-right,
#bandarmologiContent table tbody td.text-right,
#brokerHunterContent table tbody td.text-right {
  font-family: var(--font-mono, 'Geist Mono', monospace) !important;
  font-variant-numeric: tabular-nums !important;
}

.broker-summary-table tbody tr:hover,
#bandarmologiContent table tbody tr:hover,
#brokerHunterContent table tbody tr:hover {
  background-color: rgba(30, 41, 59, 0.55) !important;
}

/* Institutional Accumulation Green & Distribution Red Badges / Bars */
#bandarmologiContent .text-emerald-400,
#brokerHunterContent .text-emerald-400,
#bandarmologiContent .text-emerald-300,
#brokerHunterContent .text-emerald-300 {
  color: #34d399 !important;
  font-weight: 600 !important;
}

#bandarmologiContent .text-rose-400,
#brokerHunterContent .text-rose-400,
#bandarmologiContent .text-rose-300,
#brokerHunterContent .text-rose-300 {
  color: #fb7185 !important;
  font-weight: 600 !important;
}

.broker-summary-panel {
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-radius: 12px !important;
  background: rgba(15, 23, 42, 0.72) !important;
  overflow: hidden !important;
}

/* --- PHASE 8: SUB-TAB SINYAL INTELIJEN & PATTERN RADAR (#panel-tab-intel, #panel-tab-pattern) --- */
#intelCardHargaModal,
#intelCardSilentForeign,
#intelCardRitelCutloss,
#intelCardConcentrationRatio,
#patternSubTabContainer .rounded-xl {
  background: #0f172a !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  border-radius: 12px !important;
  padding: 16px !important;
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.26) !important;
  transition: border-color 0.16s ease, box-shadow 0.16s ease !important;
}

#intelCardHargaModal:hover,
#intelCardSilentForeign:hover,
#intelCardRitelCutloss:hover,
#intelCardConcentrationRatio:hover {
  border-color: rgba(148, 163, 184, 0.3) !important;
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.36) !important;
}

/* High-contrast status badges inside Sinyal Intelijen & Pattern Radar */
#bandarmologiIntelContent span[class*="rounded-md"][class*="border"],
#bandarmologiIntelContent span[class*="rounded-lg"][class*="border"],
#patternSubTabContainer span[class*="rounded"][class*="border"] {
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  font-variant-numeric: tabular-nums !important;
}

#bandarmologiIntelContent table thead th,
#patternSubTabContainer table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  padding: 8px 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  background-color: #0f172a !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22) !important;
}

#bandarmologiIntelContent table tbody td,
#patternSubTabContainer table tbody td {
  padding: 8px 10px !important;
  font-size: 12px !important;
  font-variant-numeric: tabular-nums !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08) !important;
}

/* --- PHASE 9: SUB-TAB JEJARING INSIDER & RANKING HARIAN (#panel-tab-insider, #panel-tab-ranking) --- */
#insiderRosterSection,
#insiderGraphSection,
#insiderDetailPanel {
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-radius: 12px !important;
  background: rgba(15, 23, 42, 0.78) !important;
}

#insiderRosterSection table thead th,
#rankingTableWrap table thead th {
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
  padding: 8px 10px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: #94a3b8 !important;
  background-color: #0f172a !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22) !important;
}

#insiderRosterSection table tbody td,
#rankingTableWrap table tbody td {
  padding: 8px 10px !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  font-variant-numeric: tabular-nums !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08) !important;
}

#rankingTableWrap table tbody td.text-right,
#insiderRosterSection table tbody td.text-right {
  font-family: var(--font-mono, 'Geist Mono', monospace) !important;
  font-variant-numeric: tabular-nums !important;
}

#rankingTableWrap table tbody tr:hover,
#insiderRosterSection table tbody tr:hover {
  background-color: rgba(30, 41, 59, 0.55) !important;
}

/* =========================================================================
   WCAG AA LIGHT MODE OVERRIDES FOR /analisis-saham (html.light)
   ========================================================================= */
html.light,
html.light body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html.light .app-header {
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
}

html.light .app-header h1,
html.light .app-header a,
html.light .app-header .text-white,
html.light .app-header span.text-white {
  color: #0f172a !important;
}

html.light .app-header p,
html.light .app-header .text-gray-400 {
  color: #475569 !important;
}

html.light .analisis-tab-strip {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

html.light .analisis-tab {
  color: #475569 !important;
  background: transparent !important;
  border-color: transparent !important;
}

html.light .analisis-tab:hover {
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.75) !important;
  border-color: #cbd5e1 !important;
}

html.light .analisis-tab.active {
  color: #047857 !important;
  background: #ffffff !important;
  border-color: rgba(5, 150, 105, 0.48) !important;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08) !important;
}

html.light #analisisChartHeader .unified-top-bar,
html.light .unified-top-bar {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

html.light #analisisInput,
html.light #bandarTickerSearchInput,
html.light #intelSearchInput,
html.light #insiderRosterTickerInput,
html.light #rankingSearchInput {
  background: #f8fafc !important;
  border: 1px solid #94a3b8 !important;
  color: #0f172a !important;
}

html.light .unified-top-bar button[onclick*="quickAnalisis"] {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}

html.light .unified-top-bar button[onclick*="quickAnalisis"]:hover {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  color: #047857 !important;
}

html.light .unified-card,
html.light #panel-tab-bandarmologi .unified-card,
html.light #panel-tab-hunter .unified-card,
html.light #panel-tab-intel .unified-card,
html.light #panel-tab-insider .unified-card,
html.light #panel-tab-ranking .unified-card,
html.light #panel-tab-pattern .unified-card,
html.light #intelCardHargaModal,
html.light #intelCardSilentForeign,
html.light #intelCardRitelCutloss,
html.light #intelCardConcentrationRatio,
html.light .broker-summary-panel,
html.light #insiderRosterSection,
html.light #insiderGraphSection,
html.light #insiderDetailPanel {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

/* Override dark utility backgrounds and inline #0f172a sticky bars inside /analisis-saham in Light Mode */
html.light #page-analisis .bg-slate-900,
html.light #page-analisis [style*="background-color: #0f172a"],
html.light #page-analisis [style*="background-color:#0f172a"],
html.light #page-analisis .bg-dark-900,
html.light #page-analisis .bg-dark-900\/80,
html.light #page-analisis .bg-dark-900\/60,
html.light #page-analisis .bg-dark-900\/50,
html.light #page-analisis .bg-dark-900\/40,
html.light #page-analisis .bg-dark-800,
html.light #page-analisis .bg-dark-800\/95,
html.light #page-analisis .bg-dark-800\/90,
html.light #page-analisis .bg-dark-800\/80,
html.light #page-analisis .bg-dark-800\/70,
html.light #page-analisis .bg-dark-800\/60,
html.light #page-analisis .bg-dark-700,
html.light #page-analisis .bg-dark-700\/60,
html.light #page-analisis .bg-dark-700\/50,
html.light #page-analisis .bg-dark-700\/40,
html.light #page-analisis .bg-dark-700\/30 {
  background-color: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

html.light .broker-summary-table thead th,
html.light #bandarmologiContent table thead th,
html.light #brokerHunterContent table thead th,
html.light #bandarmologiIntelContent table thead th,
html.light #insiderRosterSection table thead th,
html.light #rankingTableWrap table thead th,
html.light #page-analisis thead[style*="background-color"],
html.light #page-analisis th[style*="background-color"] {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border-bottom: 1px solid #cbd5e1 !important;
}

html.light .broker-summary-table tbody td,
html.light #bandarmologiContent table tbody td,
html.light #brokerHunterContent table tbody td,
html.light #bandarmologiIntelContent table tbody td,
html.light #insiderRosterSection table tbody td,
html.light #rankingTableWrap table tbody td {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html.light .broker-summary-table tbody tr:hover,
html.light #bandarmologiContent table tbody tr:hover,
html.light #brokerHunterContent table tbody tr:hover,
html.light #rankingTableWrap table tbody tr:hover,
html.light #insiderRosterSection table tbody tr:hover {
  background-color: #f1f5f9 !important;
}

/* Light Mode Text & Semantic Contrast Enforcement (WCAG AA >= 4.5:1) */
html.light #page-analisis .text-white,
html.light #page-analisis .text-gray-100,
html.light #page-analisis .text-gray-200 {
  color: #0f172a !important;
}

html.light #page-analisis .text-gray-300,
html.light #page-analisis .text-gray-400,
html.light #page-analisis .text-gray-500 {
  color: #334155 !important;
}

html.light #page-analisis .text-emerald-400,
html.light #page-analisis .text-emerald-300 {
  color: #064E3B !important;
}

html.light #page-analisis .text-rose-400,
html.light #page-analisis .text-rose-300 {
  color: #b91c1c !important;
}

html.light #page-analisis .text-amber-400,
html.light #page-analisis .text-amber-300 {
  color: #b45309 !important;
}

html.light #page-analisis .text-blue-400,
html.light #page-analisis .text-blue-300,
html.light #page-analisis .text-cyan-400,
html.light #page-analisis .text-cyan-300 {
  color: #1d4ed8 !important;
}

/* Multi-Lens Navigation Sub-Bar (9 Analisis Lenses) */
.analisis-lens-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 2px;
}
.analisis-lens-bar::-webkit-scrollbar {
  display: none;
}
.analisis-lens-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  min-height: 36px;
  box-sizing: border-box;
}
.analisis-lens-btn:hover {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
}
.analisis-lens-btn.active {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.08);
}
html.light .analisis-lens-btn {
  color: #475569;
  background: #f8fafc;
  border-color: #cbd5e1;
}
html.light .analisis-lens-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
  border-color: #94a3b8;
}
html.light .analisis-lens-btn.active {
  color: #065f46;
  background: #ecfdf5;
  border-color: #34d399;
}
