/* =======================================================
   INSIDER FLOW & OWNERSHIP INTELLIGENCE
   Smart Running Trade - Ultra-Clean Terminal Theme
   ======================================================= */

.insider-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.insider-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.insider-drawer {
  position: fixed;
  top: 0;
  right: 44px;
  bottom: 0;
  width: 920px;
  max-width: calc(100vw - 44px);
  height: 100vh;
  background: #070c1e;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.85);
  z-index: 9995;
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + 44px));
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  color: #f1f5f9;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  user-select: none;
  overflow: hidden;
}

body.sidebar-hidden .insider-drawer {
  right: 0 !important;
  max-width: 100vw;
}

.insider-drawer.open {
  transform: translateX(0);
}

/* Header */
.insider-header {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #090f26;
  flex-shrink: 0;
}

.insider-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.insider-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: insiderLivePulse 2s infinite;
}

@keyframes insiderLivePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.insider-title-main {
  font-size: 13px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.insider-title-sub {
  font-size: 10px;
  color: #64748b;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  margin-top: 1px;
}

.insider-btn-close {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
}

.insider-btn-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Controls: Search Bar & Filter Chips */
.insider-controls {
  padding: 12px 20px;
  background: #080d22;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.insider-search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.insider-input-wrap {
  position: relative;
  flex: 1;
}

.insider-search-input {
  width: 100%;
  height: 36px;
  background: #030614;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  padding: 0 12px;
  font-size: 12px;
  color: #f8fafc;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.insider-search-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.insider-search-input::placeholder {
  color: #475569;
  font-family: 'JetBrains Mono', monospace;
}

.insider-btn-action {
  height: 36px;
  padding: 0 14px;
  background: #0284c7;
  border: 1px solid #38bdf8;
  border-radius: 4px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  transition: all 0.15s ease;
}

.insider-btn-action:hover {
  background: #0369a1;
}

.insider-btn-reset {
  height: 36px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  transition: all 0.15s ease;
}

.insider-btn-reset:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

/* Chips & Type Tabs */
.insider-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.insider-type-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.insider-type-tab {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  cursor: pointer;
  transition: all 0.15s ease;
}

.insider-type-tab:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.insider-type-tab.active {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.45);
}

.insider-figures-chips {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.insider-figures-chips::-webkit-scrollbar {
  display: none;
}

.insider-figure-pill {
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.insider-figure-pill:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.insider-figure-pill.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #030712;
  font-weight: 800;
}

/* Metrics Strip */
.insider-metrics-strip {
  padding: 8px 20px;
  background: #05091a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  flex-shrink: 0;
}

.insider-metric-cell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 6px 10px;
}

.metric-hdr {
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.5px;
}

.metric-val {
  font-size: 12.5px;
  font-weight: 800;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  color: #f8fafc;
  margin-top: 2px;
}

.metric-val.green { color: #34d399; }
.metric-val.red { color: #f87171; }
.metric-val.cyan { color: #38bdf8; }
.metric-val.amber { color: #fbbf24; }

/* Body Scroll Container */
.insider-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Shareholder Cards Row (For Name Searches) */
.insider-cards-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.insider-block-hdr {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  display: flex;
  justify-content: space-between;
}

.insider-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.insider-stock-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.insider-stock-card:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.insider-stock-card.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-ticker {
  font-size: 13px;
  font-weight: 900;
  color: #38bdf8;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.card-pct {
  font-size: 12px;
  font-weight: 800;
  color: #fbbf24;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.card-holder {
  font-size: 10.5px;
  color: #e2e8f0;
  font-weight: 600;
  margin-top: 4px;
  white-space: normal;
  word-break: break-word;
}

.card-issuer {
  font-size: 9.5px;
  color: #64748b;
  margin-top: 2px;
  white-space: normal;
  word-break: break-word;
}

/* Modern Tabular Feed - Anti-Collision & Responsive */
.insider-table-wrap {
  background: #050817;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow-x: auto;
  overflow-y: visible;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.insider-feed-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  table-layout: auto !important;
  font-size: 11.5px;
  text-align: left;
}

.insider-feed-table thead tr {
  background: #080d22;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.insider-feed-table th {
  background: #080d22;
  padding: 9px 12px;
  font-size: 9.5px;
  color: #64748b;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
}

.insider-feed-table tbody tr {
  height: auto !important;
  min-height: 48px;
  contain: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.insider-feed-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.insider-feed-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  vertical-align: middle;
  contain: none !important;
  white-space: normal;
}

/* Person Name & Badges Container */
.insider-person-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 220px;
  max-width: 320px;
}

.insider-person-title {
  font-weight: 700;
  color: #f8fafc;
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
  cursor: pointer;
  transition: color 0.15s ease;
}

.insider-person-title:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.insider-badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Clean Terminal Badges */
.tag-action {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 800;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  letter-spacing: 0.5px;
  text-align: center;
  min-width: 48px;
  white-space: nowrap;
}

.tag-action.beli {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.tag-action.jual {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.tag-action.transfer {
  background: rgba(6, 182, 212, 0.14);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.tag-role {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 8.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  white-space: nowrap;
}

.tag-role.pengendali {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.tag-role.komisaris {
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.3);
}

.tag-role.direksi {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

/* Empty & Loading States */
.insider-state-block {
  padding: 50px 20px;
  text-align: center;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.insider-state-title {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

.insider-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spinLoader 0.75s linear infinite;
}

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}

/* =======================================================
   INSIDER DRAWER - LIGHT THEME (MODE SIANG)
   ======================================================= */
body.theme-light .insider-drawer-backdrop {
  background: rgba(15, 23, 42, 0.45);
}

body.theme-light .insider-drawer {
  background: #ffffff;
  border-left: 1px solid #cbd5e1;
  box-shadow: -12px 0 36px rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

body.theme-light .insider-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .insider-title-main {
  color: #0f172a;
  font-weight: 900;
}

body.theme-light .insider-title-sub {
  color: #0f172a;
  font-weight: 700;
}

body.theme-light .insider-btn-close {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 800;
}

body.theme-light .insider-btn-close:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
}

body.theme-light .insider-controls {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .insider-search-input {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

body.theme-light .insider-search-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

body.theme-light .insider-search-input::placeholder {
  color: #64748b;
}

body.theme-light .insider-btn-action {
  background: #0284c7;
  border-color: #0369a1;
  color: #ffffff;
}

body.theme-light .insider-btn-action:hover {
  background: #0369a1;
}

body.theme-light .insider-btn-all,
body.theme-light .insider-btn-reset {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 700;
}

body.theme-light .insider-type-tab {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 700;
}

body.theme-light .insider-type-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}

body.theme-light .insider-type-tab.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

body.theme-light .insider-figure-pill {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-weight: 700;
}

body.theme-light .insider-figure-pill:hover {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}

body.theme-light .insider-figure-pill.active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #ffffff;
}

body.theme-light .insider-metrics-strip {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .insider-metric-cell {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

body.theme-light .insider-metric-cell .metric-hdr {
  color: #0f172a;
  font-weight: 800;
}

body.theme-light .insider-metric-cell .metric-val {
  color: #0f172a;
  font-weight: 900;
}

body.theme-light .insider-scroll-area {
  background: #f1f5f9;
  scrollbar-color: #cbd5e1 transparent;
}

body.theme-light .insider-block-hdr {
  color: #0f172a;
  font-weight: 900;
}

body.theme-light .insider-stock-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.theme-light .insider-stock-card:hover {
  background: #f8fafc;
  border-color: #38bdf8;
}

body.theme-light .card-investor-name {
  color: #0f172a !important;
  font-weight: 900;
}

body.theme-light .card-holder {
  color: #0f172a;
  font-weight: 700;
}

body.theme-light .card-issuer {
  color: #0f172a;
  font-weight: 600;
}

body.theme-light .insider-table-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.theme-light .insider-feed-table {
  background: #ffffff;
}

body.theme-light .insider-feed-table thead tr {
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
}

body.theme-light .insider-feed-table th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 900;
  border-bottom: 1px solid #cbd5e1;
}

body.theme-light .insider-feed-table td {
  border-bottom: 1px solid #f1f5f9;
  color: #0f172a;
  font-weight: 700;
}

body.theme-light .insider-feed-table tbody tr:hover td {
  background: #f8fafc;
}

body.theme-light .insider-holder-cell .holder-name {
  color: #0f172a;
  font-weight: 800;
}

body.theme-light .insider-date-cell {
  color: #0f172a;
  font-weight: 600;
}

body.theme-light .insider-val-cell {
  color: #b45309;
  font-weight: 800;
}

body.theme-light .insider-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.theme-light .insider-card-title {
  color: #0f172a;
  font-weight: 900;
}

body.theme-light .insider-state-block {
  color: #0f172a;
}

body.theme-light .insider-loading-spinner {
  border-color: #e2e8f0;
  border-top-color: #0284c7;
}

/* Semantic Classes for Insider Feed Table */
.insider-ticker-link {
  font-weight: 900;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  cursor: pointer;
}

.insider-cell-date {
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
}

.insider-person-name {
  font-weight: 600;
  color: #f1f5f9;
  cursor: pointer;
}

.insider-lot-sub {
  font-size: 9.5px;
  color: #64748b;
}

.insider-cell-price {
  text-align: right;
  font-family: var(--font-mono, monospace);
  color: #cbd5e1;
}

.insider-cell-pct {
  text-align: right;
  font-family: var(--font-mono, monospace);
  color: #94a3b8;
}

/* Light Theme Overrides for Insider Cells */
body.theme-light .insider-cell-date {
  color: #0f172a !important;
  font-weight: 700;
}

body.theme-light .insider-person-name {
  color: #0f172a !important;
  font-weight: 800;
}

body.theme-light .insider-lot-sub {
  color: #0f172a !important;
  font-weight: 600;
}

body.theme-light .insider-cell-price {
  color: #0f172a !important;
  font-weight: 700;
}

body.theme-light .insider-cell-pct {
  color: #0f172a !important;
  font-weight: 700;
}
