/* ==========================================================================
   Stockbit Pro Slide-Over Broksum Drawer Styles (Dark Theme Unified)
   Authentic 5-Widget Bandarmology & Trade Flow Panel
   Seamlessly matched with Smart Running Trade & Market Movers
   ========================================================================== */

.broksum-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

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

.broksum-drawer {
  position: fixed;
  top: 0;
  right: 44px;
  width: 880px;
  max-width: calc(100vw - 56px);
  height: 100vh;
  background: #080d22;
  border-left: 1px solid rgba(56, 189, 248, 0.25);
  color: #f8fafc;
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 45px rgba(0, 0, 0, 0.8);
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  overflow: hidden;
}

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

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

/* Header */
.drawer-header {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(51, 65, 85, 0.55);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.drawer-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drawer-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-ticker {
  font-size: 22px;
  font-weight: 900;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.drawer-stock-badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.sa-header-badge {
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  user-select: none;
  line-height: 1.2;
}

.sa-badge-sy {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.sa-badge-uma {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.sa-badge-fca {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.drawer-header-quote {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-left: 2px;
  margin-right: 4px;
}

.drawer-quote-price {
  font-size: 19px;
  font-weight: 900;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, monospace;
  letter-spacing: -0.02em;
  color: #f8fafc;
  transition: color 0.18s ease, transform 0.18s ease;
}

.drawer-quote-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  padding: 2.5px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  letter-spacing: 0.2px;
  line-height: 1.2;
  transition: all 0.2s ease;
}

.drawer-quote-badge.up {
  background: rgba(34, 197, 94, 0.16);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.drawer-quote-badge.down {
  background: rgba(239, 68, 68, 0.16);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.drawer-quote-badge.neutral {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

@keyframes priceTickPulseGreen {
  0% { transform: scale(1.06); filter: brightness(1.3); text-shadow: 0 0 10px rgba(34, 197, 94, 0.6); }
  100% { transform: scale(1); filter: brightness(1); text-shadow: none; }
}

@keyframes priceTickPulseRed {
  0% { transform: scale(1.06); filter: brightness(1.3); text-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
  100% { transform: scale(1); filter: brightness(1); text-shadow: none; }
}

.price-tick-flash-green {
  animation: priceTickPulseGreen 0.35s ease-out;
}

.price-tick-flash-red {
  animation: priceTickPulseRed 0.35s ease-out;
}

.drawer-badge-stockbit {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.drawer-header-mcap-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.6);
  font-size: 10.5px;
  color: #94a3b8;
  white-space: nowrap;
}

.drawer-subtitle {
  display: none !important;
}

.drawer-close-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s;
}

.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

/* ==========================================================================
   Stock Search Bar
   ========================================================================== */
.drawer-search-bar {
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(11, 17, 44, 0.9);
  border: 1px solid rgba(51, 65, 85, 0.65);
  border-radius: 8px;
  padding: 6px 12px;
  transition: all 0.2s;
}

.search-input-wrap:focus-within {
  border-color: #10b981;
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.search-icon {
  font-size: 14px;
  color: #94a3b8;
}

.drawer-stock-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
}

.drawer-stock-input::placeholder {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  font-size: 12px;
  color: #64748b;
  text-transform: none;
}

.search-submit-btn {
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.search-submit-btn:hover {
  background: #059669;
}

/* Quick Nav Tabs */
.drawer-nav-tabs {
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  padding: 6px 14px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
}

.nav-tab-pill {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  background: rgba(11, 17, 44, 0.7);
  color: #94a3b8;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.nav-tab-pill:hover {
  background: rgba(51, 65, 85, 0.35);
  color: #f8fafc;
}

.nav-tab-pill.active {
  border-color: #10b981;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
}

/* Content Area */
.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #050816;
}

/* Custom Sleek Scrollbar */
.drawer-content::-webkit-scrollbar,
.drawer-nav-tabs::-webkit-scrollbar,
.tradebook-container::-webkit-scrollbar,
.broksum-table-wrap::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.drawer-content::-webkit-scrollbar-track,
.drawer-nav-tabs::-webkit-scrollbar-track,
.tradebook-container::-webkit-scrollbar-track,
.broksum-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.drawer-content::-webkit-scrollbar-thumb,
.drawer-nav-tabs::-webkit-scrollbar-thumb,
.tradebook-container::-webkit-scrollbar-thumb,
.broksum-table-wrap::-webkit-scrollbar-thumb {
  background: rgba(51, 65, 85, 0.6);
  border-radius: 4px;
}

.drawer-content::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.8);
}

/* Common Card Style (Dark Mode Stockbit Pro Style) */
.sb-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.sb-card-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sb-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}

.sb-info-icon {
  font-size: 12px;
  color: #94a3b8;
  cursor: help;
}

.sb-menu-dots {
  color: #94a3b8;
  cursor: pointer;
  font-size: 14px;
}

/* Sub controls bar */
.sb-control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.sb-segmented-pills {
  display: flex;
  background: rgba(11, 17, 44, 0.8);
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 8px;
  padding: 2px;
}

.sb-seg-btn {
  background: none;
  border: none;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.sb-seg-btn.active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.sb-date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #34d399;
  cursor: pointer;
}

.sb-date-nav span {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  user-select: none;
  transition: background 0.15s;
}

.sb-date-nav span:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sb-dropdown-select {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #f8fafc;
  background: #0b112c;
  border: 1px solid rgba(51, 65, 85, 0.65);
  border-radius: 6px;
  cursor: pointer;
}

/* ==========================================================================
   Widget 1: Trade Flow Specifics
   ========================================================================== */
.trade-flow-chart-wrap {
  height: 220px;
  width: 100%;
  position: relative;
}

.trade-flow-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 11px;
  font-weight: 700;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-price { color: #38bdf8; }
.legend-buy { color: #34d399; }
.legend-sell { color: #f87171; }

.legend-box {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.legend-box.price { background: #38bdf8; }
.legend-box.buy { background: #34d399; }
.legend-box.sell { background: #f87171; }

/* Realtime Live Badges */
.tf-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1px 6px;
  border-radius: 4px;
  transition: all 0.2s;
}

.tf-live-badge.tick-flash {
  background: rgba(16, 185, 129, 0.35);
  border-color: #10b981;
  transform: scale(1.05);
}

.pulse-dot-green {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulseGreen 1.4s infinite;
}

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

/* Trade Book (Price & Time Views) */
.tradebook-container {
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  border-radius: 6px;
  border: 1px solid rgba(51, 65, 85, 0.55);
  background: rgba(11, 17, 44, 0.6);
}

.tradebook-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.tradebook-table th {
  padding: 6px 6px;
  text-align: right;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(51, 65, 85, 0.55);
  font-size: 10px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.tradebook-table th.th-left { text-align: left; }
.tradebook-table th.th-center { text-align: center; }

.tradebook-table td {
  padding: 5px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid rgba(51, 65, 85, 0.25);
  text-align: right;
  color: #f8fafc;
}

.tradebook-table td.td-left { text-align: left; }
.tradebook-table td.td-center { text-align: center; }

.tradebook-price-col {
  color: #38bdf8;
  font-weight: 800;
}

.ratio-bar-mini {
  display: inline-flex;
  height: 6px;
  width: 55px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(51, 65, 85, 0.35);
  vertical-align: middle;
}

.ratio-bar-mini .rb-buy { background: #10b981; }
.ratio-bar-mini .rb-sell { background: #ef4444; }

/* Tooltip for Trade Flow Canvas */
.tradeflow-tooltip {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(51, 65, 85, 0.6);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  pointer-events: none;
  z-index: 10;
  display: flex;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

/* Bandarmology Spectrum Gauge Bar */
.sb-spectrum-gauge {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spectrum-bar-wrap {
  position: relative;
  height: 10px;
  display: flex;
  border-radius: 5px;
  overflow: hidden;
  gap: 2px;
}

.spectrum-seg {
  flex: 1;
  height: 100%;
}

.spectrum-seg.seg-1 { background: #dc2626; } /* Big Dist */
.spectrum-seg.seg-2 { background: #ef4444; }
.spectrum-seg.seg-3 { background: #f87171; }
.spectrum-seg.seg-4 { background: #64748b; } /* Neutral */
.spectrum-seg.seg-5 { background: #4ade80; }
.spectrum-seg.seg-6 { background: #10b981; } /* Big Acc */

.spectrum-needle {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 3px;
  background: #a855f7; /* Bright Purple needle */
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left 0.4s ease;
  box-shadow: 0 0 6px rgba(168, 85, 247, 0.9);
}

.spectrum-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}

/* ==========================================================================
   Widget 2: Broker Flow Specifics
   ========================================================================== */
.broker-flow-chart-wrap {
  height: 220px;
  width: 100%;
}

.timeframe-pill-bar {
  display: flex;
  gap: 4px;
}

.tf-pill {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(51, 65, 85, 0.55);
  background: rgba(11, 17, 44, 0.7);
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.tf-pill:hover {
  background: rgba(51, 65, 85, 0.35);
  color: #f8fafc;
}

.tf-pill.active {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: #10b981;
}

.broker-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.broker-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.chip-domestic { background: rgba(124, 58, 237, 0.18); color: #c084fc; border: 1px solid rgba(124, 58, 237, 0.45); }
.chip-bumn { background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.45); }
.chip-foreign { background: rgba(239, 68, 68, 0.18); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.45); }
.chip-price { background: rgba(2, 132, 199, 0.18); color: #38bdf8; border: 1px solid rgba(2, 132, 199, 0.45); }
.chip-add { background: rgba(15, 23, 42, 0.6); color: #94a3b8; border: 1px dashed rgba(51, 65, 85, 0.75); }

/* Chip Price Dimmed State */
.broker-chip.dimmed {
  opacity: 0.4;
  filter: grayscale(0.8);
  border-style: dashed;
}

/* ==========================================================================
   Widget 3: Broker Summary Table
   ========================================================================== */
.broksum-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.broksum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.broksum-table th {
  padding: 6px 4px;
  text-align: right;
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 1px solid rgba(51, 65, 85, 0.55);
  background: rgba(15, 23, 42, 0.95);
  font-size: 10.5px;
}

.broksum-table th.th-left {
  text-align: left;
}

.broksum-table th.th-center {
  text-align: center;
}

.broksum-table td {
  padding: 5px 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid rgba(51, 65, 85, 0.25);
  color: #f8fafc;
}

.broker-tag {
  display: inline-block;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
}

.broker-tag.tag-domestic { color: #c084fc; } /* Purple */
.broker-tag.tag-bumn { color: #34d399; }     /* Green */
.broker-tag.tag-foreign { color: #f87171; }  /* Red */

.val-buy { color: #34d399; text-align: right; }
.val-sell { color: #f87171; text-align: right; }
.val-price { color: #34d399; text-align: right; }
.val-sell-price { color: #f87171; text-align: right; }

/* ==========================================================================
   Widget 4: Broker Distribution (Sankey Ribbon Diagram)
   ========================================================================== */
.sankey-labels-bar {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  font-size: 12px;
}

.sankey-label-buyer { color: #34d399; }
.sankey-label-seller { color: #f87171; }

.sankey-svg-wrap {
  width: 100%;
  min-height: 350px;
  height: auto;
  background: rgba(11, 17, 44, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.45);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.sankey-buyer-row,
.sankey-seller-row {
  transition: fill 0.15s ease;
}

.sankey-buyer-group:hover .sankey-buyer-row,
.sankey-seller-group:hover .sankey-seller-row {
  fill: rgba(255, 255, 255, 0.05);
}

.sankey-legend-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 11px;
  font-weight: 600;
}

.sankey-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #94a3b8;
}

.sankey-dot-domestic { width: 8px; height: 8px; border-radius: 50%; background: #c084fc; }
.sankey-dot-bumn { width: 8px; height: 8px; border-radius: 50%; background: #34d399; }
.sankey-dot-foreign { width: 8px; height: 8px; border-radius: 50%; background: #f87171; }

/* Sankey Ribbon Hover Effects */
path.sankey-ribbon {
  transition: fill-opacity 0.2s ease, stroke-width 0.2s ease;
  cursor: pointer;
}

path.sankey-ribbon:hover {
  fill-opacity: 0.85 !important;
  stroke-width: 1.5 !important;
}

/* ==========================================================================
   Widget 5: Foreign-Domestic Activity
   ========================================================================== */
.fd-metrics-card {
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(11, 17, 44, 0.6);
  color: #f8fafc;
}

.fd-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}

.fd-row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding-top: 6px;
  border-top: 1px solid rgba(51, 65, 85, 0.35);
}

.fd-chart-wrap {
  height: 180px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 40px;
  padding: 20px 0;
}

.fd-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 70px;
  color: #94a3b8;
}

.fd-bar-stack {
  width: 100%;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.fd-share-footer {
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(11, 17, 44, 0.6);
  color: #f8fafc;
}

/* Add Broker Modal for Broker Flow */
.bf-add-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bf-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(4px);
}

.bf-modal-box {
  position: relative;
  width: 380px;
  max-width: 92vw;
  background: #0b112c;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.6), 0 8px 10px -6px rgba(0,0,0,0.4);
  overflow: hidden;
  z-index: 1;
  border: 1px solid rgba(51, 65, 85, 0.65);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
}

/* Broker Selector Modal (Stockbit Pro Replica) */
.broker-modal-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 8px;
}

.broker-modal-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 8px;
  padding: 6px 10px;
  gap: 6px;
}

.broker-modal-search-icon {
  font-size: 12px;
  opacity: 0.7;
}

.broker-modal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-size: 12px;
}

.broker-modal-input::placeholder {
  color: #64748b;
}

.broker-modal-cancel-btn {
  font-size: 12px;
  color: #10b981;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  user-select: none;
}

.broker-modal-cancel-btn:hover {
  color: #34d399;
}

.broker-modal-tabs {
  display: flex;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  padding: 0 12px;
  gap: 8px;
}

.broker-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.broker-tab-btn:hover {
  color: #f8fafc;
}

.broker-tab-btn.active {
  color: #10b981;
  border-bottom-color: #10b981;
  font-weight: 700;
}

.broker-modal-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px 0;
}

.broker-modal-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  cursor: pointer;
  border-bottom: 1px solid rgba(51, 65, 85, 0.25);
  gap: 12px;
  transition: background 0.15s;
}

.broker-modal-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.broker-modal-code {
  font-weight: 800;
  font-size: 12.5px;
  font-family: var(--font-mono, monospace);
  min-width: 28px;
}

.broker-modal-name {
  font-size: 11.5px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Add Broker (+) Button on Broker Distribution */
.dist-add-broker-btn {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.15s, background-color 0.15s;
  box-shadow: 0 1px 4px rgba(16, 185, 129, 0.35);
}

.dist-add-broker-btn:hover {
  background: #059669;
  transform: scale(1.12);
}

/* Stockbit Pro Style Dual-Month Date Range Picker Modal */
.sb-date-picker-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sb-date-picker-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(4px);
}

.sb-date-picker-dialog {
  position: relative;
  width: 580px;
  max-width: 95vw;
  background: #0b112c;
  border-radius: 14px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(51, 65, 85, 0.6);
  padding: 16px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #f8fafc;
  user-select: none;
}

.sb-dp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.sb-dp-nav-group {
  display: flex;
  gap: 4px;
}

.sb-dp-nav-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.sb-dp-nav-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-color: #10b981;
}

.sb-dp-months-title {
  display: flex;
  gap: 80px;
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  justify-content: space-around;
  flex: 1;
}

.sb-dp-calendar-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 580px) {
  .sb-dp-calendar-wrap {
    grid-template-columns: 1fr;
  }
  .sb-dp-m2-title {
    display: none;
  }
}

.sb-dp-month-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.35);
  border-radius: 10px;
  padding: 10px;
}

.sb-dp-month-header {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 8px;
}

.sb-dp-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
}

.sb-dp-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.sb-dp-day {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  color: #cbd5e1;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.12s;
  position: relative;
}

.sb-dp-day.empty {
  cursor: default;
  pointer-events: none;
}

.sb-dp-day:not(.empty):hover {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.sb-dp-day.start-date {
  background: #10b981 !important;
  color: #ffffff !important;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.sb-dp-day.end-date:not(.single-picked) {
  background: transparent !important;
  border: 2px solid #10b981 !important;
  color: #10b981 !important;
  font-weight: 800;
}

.sb-dp-day.in-range {
  background: rgba(16, 185, 129, 0.16) !important;
  border-radius: 4px;
  color: #6ee7b7;
}

/* Quick Range Presets Grid (2 rows x 5 columns) */
.sb-dp-presets-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px 0;
  border-top: 1px solid rgba(51, 65, 85, 0.4);
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

@media (max-width: 580px) {
  .sb-dp-presets-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.sb-dp-preset-btn {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.5);
  color: #94a3b8;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sb-dp-preset-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.sb-dp-preset-btn.active {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
  font-weight: 700;
}

/* Footer */
.sb-dp-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
}

.sb-dp-summary {
  font-size: 11.5px;
  color: #94a3b8;
}

.sb-dp-summary strong {
  color: #10b981;
}

.sb-dp-actions {
  display: flex;
  gap: 8px;
}

.sb-dp-cancel-btn {
  background: transparent;
  border: 1px solid rgba(100, 116, 139, 0.5);
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.sb-dp-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
}

.sb-dp-apply-btn {
  background: #10b981;
  border: 1px solid #10b981;
  color: #ffffff;
  padding: 6px 18px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.sb-dp-apply-btn:hover {
  background: #059669;
  border-color: #059669;
}

/* Loading state */
.drawer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 250px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
}

.drawer-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(51, 65, 85, 0.4);
  border-top-color: #10b981;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   STOCK ACTIVITY ADDITIONS (Flow, Shareholders, Insider, Cron)
   Clean Monochrome Dark Pro Aesthetic
   ========================================================================== */

.drawer-badge-stockbit {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.drawer-emiten-title {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-top: 2px;
}

.activity-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.activity-segmented {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.activity-seg-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.activity-seg-btn:hover {
  color: #fff;
}

.activity-seg-btn.active {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.activity-dropdown,
.activity-select {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.activity-dropdown:hover,
.activity-select:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.activity-dropdown:focus,
.activity-select:focus {
  border-color: #38bdf8;
}

.activity-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: #0b112c;
}

.activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  text-align: left;
}

.activity-table th {
  background: rgba(15, 23, 42, 0.95);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.activity-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  white-space: nowrap;
}

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

.activity-table td.pos { color: #10b981; }
.activity-table td.neg { color: #ef4444; }

.sh-comp-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sh-comp-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.sh-comp-name {
  font-weight: 700;
  color: #f8fafc;
}

.sh-comp-val {
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
}

.sh-comp-pct {
  font-weight: 800;
  color: #f8fafc;
  font-family: var(--font-mono, monospace);
  margin-left: 6px;
}

.sh-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.sh-progress-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.sh-num-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
}

.sh-num-date {
  color: #94a3b8;
  font-weight: 600;
}

.sh-num-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, monospace);
}

.sh-num-total {
  font-weight: 800;
  color: #f8fafc;
}

.sh-num-delta {
  font-weight: 700;
  font-size: 10.5px;
}

.sh-num-delta.up { color: #10b981; }
.sh-num-delta.down { color: #ef4444; }

.insider-badge-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  margin-left: 4px;
}

.insider-act-pill {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
  text-align: center;
}

.insider-act-pill.buy {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.insider-act-pill.sell {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.activity-cron-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  color: #94a3b8;
  flex-shrink: 0;
}

.activity-cron-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.activity-cron-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
}

/* Corporate Action Widgets & Badges */
.corpaction-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.corpaction-kpi-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}
.corpaction-kpi-label {
  font-size: 9px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.corpaction-kpi-val {
  font-size: 15px;
  font-weight: 900;
  color: #f8fafc;
  font-family: var(--font-mono, monospace);
  margin: 3px 0 1px 0;
}
.corpaction-kpi-sub {
  font-size: 9.5px;
  color: #64748b;
}

.corpaction-badge-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-family: var(--font-mono, monospace);
}
.corpaction-badge-tag.badge-dividend {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.corpaction-badge-tag.badge-rightissue {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}
.corpaction-badge-tag.badge-stocksplit {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.corpaction-badge-tag.badge-rups {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.corpaction-badge-tag.badge-warrant {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.corpaction-badge-tag.badge-bonus {
  background: rgba(236, 72, 153, 0.18);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.4);
}

.corpaction-status-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  font-family: var(--font-mono, monospace);
}
.corpaction-status-pill.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
}
.corpaction-status-pill.past {
  background: rgba(255, 255, 255, 0.05);
  color: #64748b;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Order Book (Clean Standard Broksum Style)
   ========================================================================== */
.ob-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 12px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
}

.ob-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.ob-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ob-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #f8fafc;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  letter-spacing: 0.3px;
}

.ob-power-bar-wrap {
  margin-bottom: 10px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 4px;
  padding: 6px 10px;
  border: 1px solid rgba(51, 65, 85, 0.4);
  font-family: var(--font-mono, "JetBrains Mono", monospace);
}

.ob-power-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 600;
  margin-bottom: 4px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
}

.ob-power-bar {
  height: 5px;
  width: 100%;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  background: rgba(239, 68, 68, 0.8);
}

.ob-power-bid {
  background: #10b981;
  height: 100%;
  transition: width 0.2s ease;
}

.ob-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-radius: 6px;
}

.ob-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
}

.ob-table th {
  padding: 6px 6px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(51, 65, 85, 0.55);
  text-transform: uppercase;
}

.ob-table td {
  padding: 4px 6px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid rgba(51, 65, 85, 0.25);
  color: #f8fafc;
  white-space: nowrap;
  vertical-align: middle;
  position: relative;
}

.ob-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.ob-cell-bid-price {
  font-weight: 700;
  color: #34d399;
  text-align: right;
  border-right: 1px solid rgba(51, 65, 85, 0.4);
}

.ob-cell-offer-price {
  font-weight: 700;
  color: #f87171;
  text-align: left;
  border-left: 1px solid rgba(51, 65, 85, 0.4);
}

.ob-cell-lot {
  font-weight: 600;
}

.ob-bar-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
  opacity: 0.22;
  transition: width 0.15s ease;
}

.ob-bar-bid {
  right: 0;
  background: #10b981;
}

.ob-bar-offer {
  left: 0;
  background: #ef4444;
}


.ob-row.tick-flash-buy {
  background: rgba(16, 185, 129, 0.18) !important;
  transition: background 0.12s ease;
}

.ob-row.tick-flash-sell {
  background: rgba(239, 68, 68, 0.18) !important;
  transition: background 0.12s ease;
}

.ob-mini-refresh-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0;
  margin: 0;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 3px;
  transition: color 0.15s ease, transform 0.2s ease;
  line-height: 1;
}

.ob-mini-refresh-btn:hover {
  color: #f1f5f9;
}

.ob-mini-refresh-btn:active {
  transform: rotate(180deg);
}

.ob-mini-refresh-btn.spinning svg {
  animation: obMiniSpin 0.6s linear infinite;
}

@keyframes obMiniSpin {
  100% { transform: rotate(360deg); }
}

/* =======================================================
   BROKSUM / STOCK ACTIVITY DRAWER - LIGHT THEME (MODE SIANG)
   ======================================================= */
body.theme-light .broksum-drawer-backdrop {
  background: rgba(15, 23, 42, 0.35);
}

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

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

body.theme-light .drawer-ticker {
  color: #0f172a;
  font-weight: 900;
}

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

body.theme-light .drawer-tabs-nav {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

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

body.theme-light .drawer-tab:hover {
  color: #0284c7;
}

body.theme-light .drawer-tab.active {
  color: #0284c7;
  border-bottom-color: #0284c7;
}

body.theme-light .drawer-body,
body.theme-light .drawer-content {
  background: #f8fafc !important;
  color: #0f172a !important;
}

body.theme-light .drawer-nav-tabs {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.theme-light .nav-tab-pill {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.theme-light .nav-tab-pill:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

body.theme-light .nav-tab-pill.active {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
}

body.theme-light .drawer-search-bar {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.theme-light .drawer-stock-input {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.theme-light .search-submit-btn {
  background: #0284c7 !important;
  color: #ffffff !important;
}

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

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

body.theme-light .sb-info-icon,
body.theme-light .sb-menu-dots {
  color: #0f172a !important;
}

body.theme-light .sb-segmented-pills {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
}

body.theme-light .sb-seg-btn {
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.theme-light .sb-seg-btn.active {
  background: #0284c7 !important;
  color: #ffffff !important;
}

body.theme-light .sb-date-nav {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.theme-light .sb-dropdown-select {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  font-weight: 700 !important;
}

body.theme-light .broksum-table-wrap,
body.theme-light .tradebook-container {
  background: #ffffff !important;
}

body.theme-light .broksum-table th,
body.theme-light .tradebook-table th {
  background: #f8fafc !important;
  color: #0f172a !important;
  font-weight: 900 !important;
  border-bottom: 1px solid #cbd5e1 !important;
}

body.theme-light .broksum-table td,
body.theme-light .tradebook-table td {
  color: #0f172a !important;
  font-weight: 700 !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

body.theme-light .broksum-table tr:hover td,
body.theme-light .tradebook-table tr:hover td {
  background: #f8fafc !important;
}

body.theme-light .fd-card-row {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

body.theme-light .activity-cron-bar {
  background: #ffffff !important;
  border-top: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

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

body.theme-light .widget-hdr {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
}

body.theme-light .bs-table th {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 900;
  border-bottom-color: #cbd5e1;
}

body.theme-light .bs-table td {
  border-bottom-color: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
}

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

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

/* Activity section general layout helpers */
.activity-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.activity-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  font-family: inherit;
}

.activity-subtitle {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.activity-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =======================================================
   SCRIPLESS VS WARKAT (STOCK ACTIVITY SHAREHOLDERS)
   ======================================================= */
.scripless-warkat-card {
  border-left: 3px solid #06b6d4 !important;
}

.sw-progress-wrap {
  width: 100%;
}

.sw-progress-bar-container {
  display: flex;
  width: 100%;
  height: 9px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.sw-bar-scripless {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4, #38bdf8);
  transition: width 0.3s ease;
}

.sw-bar-scrip {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  transition: width 0.3s ease;
}

.sw-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.sw-metric-box {
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sw-metric-box.scripless {
  border-color: rgba(6, 182, 212, 0.3);
}

.sw-metric-box.warkat.warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.06);
}

.sw-metric-box.warkat.clean {
  border-color: rgba(16, 185, 129, 0.3);
}

.sw-metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.3px;
}

.sw-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.sw-indicator-dot.scripless {
  background: #06b6d4;
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.6);
}

.sw-indicator-dot.warkat {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
}

.sw-metric-num {
  font-size: 15px;
  font-weight: 900;
  font-family: var(--font-mono, monospace);
  color: #f8fafc;
  margin-top: 3px;
}

.sw-metric-box.scripless .sw-metric-num {
  color: #38bdf8;
}

.sw-metric-box.warkat.warning .sw-metric-num {
  color: #fbbf24;
}

.sw-metric-box.warkat.clean .sw-metric-num {
  color: #34d399;
}

.sw-metric-sub {
  font-size: 10px;
  color: #64748b;
  font-family: var(--font-mono, monospace);
  margin-top: 1px;
}

.sw-alert-box {
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 11px;
  line-height: 1.5;
}

.sw-alert-box.warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fef3c7;
}

.sw-alert-box.success {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #d1fae5;
}

.sw-alert-title {
  font-size: 11.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.sw-alert-box.warning .sw-alert-title {
  color: #fbbf24;
}

.sw-alert-box.success .sw-alert-title {
  color: #34d399;
}

.sw-alert-desc {
  font-size: 10.5px;
  opacity: 0.92;
}

.sw-holders-table-wrap {
  background: rgba(11, 17, 44, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 4px;
}

.sw-holders-title {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  letter-spacing: 0.3px;
}

.sw-holders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}

.sw-holders-table th {
  padding: 6px 10px;
  text-align: left;
  font-size: 9.5px;
  color: #64748b;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.sw-holders-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
}

.sw-holders-table tr:last-child td {
  border-bottom: none;
}

.sw-holders-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.sw-holder-name {
  font-weight: 700;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-holder-type {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
}

/* Light theme support */
body.theme-light .scripless-warkat-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  border-left-color: #0284c7 !important;
}

body.theme-light .sw-metric-box {
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
}

body.theme-light .sw-metric-num {
  color: #0f172a !important;
}

body.theme-light .sw-metric-box.scripless .sw-metric-num {
  color: #0284c7 !important;
}

body.theme-light .sw-metric-box.warkat.warning .sw-metric-num {
  color: #d97706 !important;
}

body.theme-light .sw-alert-box.warning {
  background: #fffbeb !important;
  border-color: #fde68a !important;
  color: #92400e !important;
}

body.theme-light .sw-alert-box.warning .sw-alert-title {
  color: #b45309 !important;
}

body.theme-light .sw-alert-box.success {
  background: #ecfdf5 !important;
  border-color: #a7f3d0 !important;
  color: #065f46 !important;
}

body.theme-light .sw-alert-box.success .sw-alert-title {
  color: #047857 !important;
}

body.theme-light .sw-holders-table-wrap {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

body.theme-light .sw-holders-table-wrap {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

body.theme-light .sw-holders-title {
  background: #f8fafc !important;
  color: #0f172a !important;
  font-weight: 800;
  border-color: #e2e8f0 !important;
}

body.theme-light .sw-holders-table th {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  font-weight: 900;
  border-color: #e2e8f0 !important;
}

body.theme-light .sw-holders-table td {
  color: #0f172a !important;
  font-weight: 700;
  border-color: #f1f5f9 !important;
}

body.theme-light .sw-holders-table tr:hover td {
  background: #f8fafc !important;
}

/* Activity section light theme */
body.theme-light .activity-title {
  color: #0f172a !important;
  font-weight: 900;
}

body.theme-light .activity-subtitle {
  color: #0f172a !important;
  font-weight: 600;
}

body.theme-light .activity-table-wrap {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

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

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

body.theme-light .activity-table tr:hover td {
  background: #f8fafc !important;
}

body.theme-light .activity-seg-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.theme-light .activity-seg-btn.active {
  background: #0284c7;
  color: #ffffff;
}

body.theme-light .activity-dropdown,
body.theme-light .activity-select {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════
   DRAWER QUEUE DETAIL SIDE PANEL (Muncul di sebelah kiri Stock Activity Drawer)
   Untuk Bid maupun Offer muncul di samping kiri drawer
   ═══════════════════════════════════════════════════════════════════ */
.drawer-queue-sidepanel {
  position: fixed;
  top: 0;
  right: calc(44px + 880px);
  width: 410px;
  max-width: calc(100vw - 930px);
  height: 100vh;
  background: #0f172a;
  border-left: 1px solid rgba(56, 189, 248, 0.25);
  border-right: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px 0 0 12px;
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.85), 0 0 20px rgba(15, 23, 42, 0.8);
  color: #f8fafc;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  z-index: 10000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: slideDrawerSidepanel 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body.sidebar-hidden .drawer-queue-sidepanel {
  right: 880px;
  max-width: calc(100vw - 885px);
}

.drawer-queue-sidepanel.open {
  display: flex;
}

@keyframes slideDrawerSidepanel {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 980px) {
  .drawer-queue-sidepanel {
    right: 0 !important;
    width: 100%;
    max-width: 480px;
    border-radius: 0;
    z-index: 10002;
  }
}






/* =======================================================
   DONE DETAIL (EOD TICK LOG FROM STOCKARJUM)
   ======================================================= */
.dd-card {
  background: #0d131f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.dd-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #131b2e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 10px;
}

.dd-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dd-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dd-tag-eod {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.dd-total-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-family: var(--font-mono, monospace);
}

.dd-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: nowrap !important;
  overflow-x: auto;
  scrollbar-width: thin;
}

.dd-filter-select, .dd-filter-input {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 5px 8px;
  outline: none;
  transition: border-color 0.15s;
}

.dd-filter-select:focus, .dd-filter-input:focus {
  border-color: #3b82f6;
}

.dd-stats-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(2, 6, 23, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  flex-wrap: wrap;
  gap: 8px;
}

.dd-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #94a3b8;
}

.dd-stat-pill b {
  color: #f8fafc;
}

.dd-table-wrap {
  width: 100%;
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
}

.dd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  font-family: var(--font-mono, monospace);
}

.dd-table thead th {
  position: sticky;
  top: 0;
  background: #172033;
  color: #94a3b8;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
  white-space: nowrap;
}

.dd-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.12s ease;
}

.dd-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.dd-table td {
  padding: 6px 10px;
  white-space: nowrap;
}

.dd-act-badge {
  display: inline;
  padding: 0;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.dd-act-buy {
  color: #34d399 !important;
  background: transparent !important;
  border: none !important;
}

.dd-act-sell {
  color: #f87171 !important;
  background: transparent !important;
  border: none !important;
}

.dd-party {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dd-broker-code {
  font-weight: 700;
  color: #f8fafc;
}

.dd-type-pill {
  display: inline;
  padding: 0;
  font-size: 10px;
  font-weight: 700;
  margin-left: 3px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.dd-type-f {
  color: #c084fc !important;
  background: transparent !important;
  border: none !important;
  font-weight: 800;
}

.dd-type-d {
  color: #64748b !important;
  background: transparent !important;
  border: none !important;
  font-weight: 600;
}

.dd-board-pill {
  display: inline;
  padding: 0;
  font-size: 10.5px;
  font-weight: 700;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.dd-board-rg {
  color: #94a3b8 !important;
  background: transparent !important;
}

.dd-board-ng {
  color: #f59e0b !important;
  background: transparent !important;
}

.dd-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #131b2e;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  flex-wrap: wrap;
  gap: 10px;
}

.dd-page-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dd-page-btn {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.dd-page-btn:hover:not(:disabled) {
  background: #334155;
  border-color: #60a5fa;
}

.dd-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dd-jump-input {
  width: 46px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 11px;
  text-align: center;
  padding: 3px 4px;
  border-radius: 4px;
}

.dd-th-sortable {
  cursor: pointer !important;
  user-select: none !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}
.dd-th-sortable:hover {
  background: #1e293b !important;
  color: #38bdf8 !important;
}
