/* ============================================
   MAVA — Market Activity Volume Analysis
   Premium Dark Mode Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* === CSS Custom Properties === */
:root {
  /* Primary Palette */
  --bg-primary: #060a1a;
  --bg-secondary: #0c1229;
  --bg-tertiary: #111836;
  --bg-card: rgba(16, 22, 52, 0.85);
  --bg-card-hover: rgba(22, 30, 65, 0.95);

  /* Surface colors */
  --surface-glass: rgba(15, 20, 48, 0.6);
  --surface-glass-border: rgba(100, 120, 200, 0.12);
  --surface-elevated: rgba(20, 28, 58, 0.9);

  /* Accent Colors */
  --accent-gold: #f0b90b;
  --accent-gold-dim: rgba(240, 185, 11, 0.15);
  --accent-gold-glow: rgba(240, 185, 11, 0.4);
  --accent-cyan: #00d4aa;
  --accent-cyan-dim: rgba(0, 212, 170, 0.12);
  --accent-cyan-glow: rgba(0, 212, 170, 0.35);
  --accent-blue: #4a7cff;
  --accent-blue-dim: rgba(74, 124, 255, 0.12);
  --accent-purple: #a855f7;
  --accent-purple-dim: rgba(168, 85, 247, 0.12);

  /* Semantic Colors */
  --bullish: #00e676;
  --bullish-dim: rgba(0, 230, 118, 0.12);
  --bearish: #ff5252;
  --bearish-dim: rgba(255, 82, 82, 0.12);
  --warning: #ffab40;
  --warning-dim: rgba(255, 171, 64, 0.12);

  /* Text */
  --text-primary: #e8ecf4;
  --text-secondary: #8b95b0;
  --text-tertiary: #5a6480;
  --text-accent: #f0b90b;

  /* Volume Colors */
  --vol-normal: #3a4468;
  --vol-above: #4a7cff;
  --vol-bigmoney: #f0b90b;

  /* Borders & Shadows */
  --border-subtle: rgba(100, 120, 200, 0.08);
  --border-medium: rgba(100, 120, 200, 0.15);
  --border-accent: rgba(240, 185, 11, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow-gold: 0 0 30px rgba(240, 185, 11, 0.15);
  --shadow-glow-cyan: 0 0 30px rgba(0, 212, 170, 0.12);

  /* Layout */
  --sidebar-width: 300px;
  --header-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(74, 124, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(240, 185, 11, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 212, 170, 0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Custom Scrollbar — besar & jelas (emas di atas gelap) */
html {
  scrollbar-width: auto;
  scrollbar-color: rgba(240, 185, 11, 0.55) rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: rgba(240, 185, 11, 0.55);
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(240, 185, 11, 0.85);
  border: 3px solid transparent;
  background-clip: content-box;
}

/* === Glass panel (used on sidebar, top-nav, chart panel, cards) === */
.glass-panel {
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid var(--surface-glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* === Layout === */
#app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* === Header === */
#app-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--surface-glass-border);
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-gold), #ff9500);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #0a0e27;
  box-shadow: 0 0 20px rgba(240, 185, 11, 0.3);
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--accent-gold), #ffd54f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-subtitle {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-left: 4px;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 4px;
  background: rgba(10, 14, 39, 0.5);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-primary);
  background: rgba(100, 120, 200, 0.08);
}

.nav-tab.active {
  color: var(--accent-gold);
  background: rgba(240, 185, 11, 0.1);
  box-shadow: 0 0 15px rgba(240, 185, 11, 0.08);
}

.nav-tab .tab-icon {
  font-size: 1rem;
}

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

/* === Sidebar === */
.sidebar {
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-right: 1px solid var(--surface-glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-section {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* File Upload */
/* Stock List */
.stock-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: 2px;
}

.stock-item:hover {
  background: rgba(100, 120, 200, 0.08);
}

.stock-item.active {
  background: var(--accent-gold-dim);
  border: 1px solid rgba(240, 185, 11, 0.2);
}

.stock-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stock-ticker-badge {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  min-width: 50px;
}

.stock-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.stock-item-right {
  text-align: right;
}

.stock-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 500;
}

.stock-change {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
}

.stock-change.positive { color: var(--bullish); }
.stock-change.negative { color: var(--bearish); }

.bigmoney-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* === Main Content Area === */
.main-content {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Tab Content */
.tab-content {
  display: none;
  flex: 1;
  overflow: hidden;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* Halaman chart butuh scroll vertikal (chart + indikator + data detail). */
.tab-content.allow-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  flex: none;
  padding-bottom: 24px;
}

/* === Live intraday strip (chart.php) === */
.live-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-height: 18px;
}

.live-strip:empty {
  display: none;
}

.live-strip .bullish { color: var(--bullish); }
.live-strip .bearish { color: var(--bearish); }

.live-badge {
  color: var(--accent-gold);
  font-weight: 600;
}

/* === Home Menu === */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 4px;
}

.menu-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.menu-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-2px);
}

.menu-card-icon {
  font-size: 1.8rem;
}

.menu-card-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.menu-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* === Chart Panel === */
.chart-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  min-height: 0;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.chart-toolbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chart-panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.chart-tab-switch {
  display: flex;
  gap: 4px;
}

.chart-tab-btn {
  padding: 5px 12px;
  border: 1px solid var(--border-medium);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.chart-tab-btn:hover {
  color: var(--text-primary);
}

.chart-tab-btn.active {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  background: var(--accent-gold-dim);
}

.chart-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chart-select-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* .input-modern was used all over (chart/screener/settings) but never
   actually had a style rule — rendered as raw unstyled browser white input.
   Barely visible on desktop (narrow), glaring on mobile (full-width). */
.input-modern {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.85rem;
}
.input-modern::placeholder { color: var(--text-tertiary); }
.input-modern:focus { outline: none; border-color: var(--border-accent); }

.chart-select {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  font-family: inherit;
  font-size: 0.75rem;
}

.chart-checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.chart-legend i.dash {
  width: 14px;
  height: 0;
  border-top: 2px dashed rgba(255, 213, 79, 0.6);
}

.legend-glyph {
  font-weight: 600;
  font-size: 0.72rem;
}

.chart-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-height: 18px;
}

.chart-readout .readout-date {
  color: var(--text-primary);
  font-weight: 600;
}

.chart-readout .bullish { color: var(--bullish); }
.chart-readout .bearish { color: var(--bearish); }

.chart-canvas-wrap {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: clamp(420px, 62vh, 640px);
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-glass-border);
  overflow: hidden;
}

.chart-canvas-wrap canvas {
  display: block;
}

.tradingview-panel {
  flex: 1;
  min-height: 420px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-glass-border);
  overflow: hidden;
}

.chart-views-row {
  display: flex;
  gap: 10px;
}

/* Indicator Sidebar */
.indicator-panel {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.indicator-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-glass-border);
  padding: 16px;
  transition: var(--transition-smooth);
}

.indicator-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.indicator-card-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.indicator-card-title .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bullish);
  box-shadow: 0 0 8px var(--bullish);
}

.indicator-card-title .status-dot.warning { 
  background: var(--warning); 
  box-shadow: 0 0 8px var(--warning);
}

.indicator-card-title .status-dot.danger { 
  background: var(--bearish); 
  box-shadow: 0 0 8px var(--bearish);
}

.indicator-value-large {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.indicator-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Gauge Component */
.gauge-container {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(100, 120, 200, 0.1);
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.gauge-fill.bullish {
  background: linear-gradient(90deg, var(--bullish), #69f0ae);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.3);
}

.gauge-fill.warning {
  background: linear-gradient(90deg, var(--warning), #ffd54f);
  box-shadow: 0 0 12px rgba(255, 171, 64, 0.3);
}

.gauge-fill.bearish {
  background: linear-gradient(90deg, var(--bearish), #ff8a80);
  box-shadow: 0 0 12px rgba(255, 82, 82, 0.3);
}

.gauge-fill.gold {
  background: linear-gradient(90deg, var(--accent-gold), #ffd54f);
  box-shadow: 0 0 12px rgba(240, 185, 11, 0.3);
}

.gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

.gauge-labels span {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
}

/* Big Money Alert Card */
.bigmoney-alert {
  background: linear-gradient(135deg, rgba(240, 185, 11, 0.08), rgba(255, 149, 0, 0.05));
  border: 1px solid rgba(240, 185, 11, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.bigmoney-alert::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.bigmoney-alert-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.katalis-badge { font-size: 10px; padding: 2px 8px; border-radius: 10px; margin-left: 8px; }
.katalis-badge.katalis-high { background: rgba(0,230,118,.15); color: var(--bullish); }
.katalis-badge.katalis-medium { background: rgba(240,185,11,.15); color: var(--accent-gold); }
.katalis-badge.katalis-low { background: rgba(255,255,255,.08); color: var(--text-tertiary); }
.katalis-checklist { font-size: 12px; line-height: 1.5; color: var(--text-primary); margin: 8px 0; }
.katalis-check-row { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.katalis-check-row:last-child { border-bottom: none; }
.katalis-check-icon { flex: none; }
.katalis-check-body { color: var(--text-secondary); }
.katalis-check-body b { color: var(--text-primary); }
.katalis-ada { color: var(--bullish); font-weight: 600; }
.katalis-tidak-ada { color: var(--text-tertiary); }
.katalis-sources { font-size: 11px; color: var(--text-tertiary); margin-top: 8px; }
.katalis-source-row { padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.katalis-source-row a { color: inherit; text-decoration: none; }
.katalis-source-row a:hover { text-decoration: underline; }

.bigmoney-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 0.78rem;
}

.bigmoney-detail-label {
  color: var(--text-secondary);
}

.bigmoney-detail-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--accent-gold);
}

/* === Screener Tab === */
#screener-tab {
  padding: 16px;
  gap: 16px;
}

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

.screener-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.screener-title span {
  background: linear-gradient(135deg, var(--accent-gold), #ffd54f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.screener-stats {
  display: flex;
  gap: 20px;
}

.screener-stat {
  text-align: center;
}

.screener-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.screener-stat-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Screener Filters */
.screener-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-glass-border);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.filter-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-input {
  background: rgba(10, 14, 39, 0.6);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  transition: var(--transition-fast);
  outline: none;
}

.filter-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.1);
}

.filter-input::placeholder {
  color: var(--text-tertiary);
}

select.filter-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b95b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

select.filter-input option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-primary {
  padding: 8px 24px;
  background: linear-gradient(135deg, var(--accent-gold), #ff9500);
  color: #0a0e27;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(240, 185, 11, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  padding: 8px 18px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* Screener Table */
.screener-table-container {
  flex: 1;
  overflow: auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-glass-border);
}

.screener-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.screener-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.screener-table th {
  background: var(--bg-tertiary);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-medium);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}

.screener-table th:hover {
  color: var(--text-primary);
  background: rgba(100, 120, 200, 0.08);
}

.screener-table th .sort-icon {
  margin-left: 4px;
  opacity: 0.4;
}

.screener-table th.sorted .sort-icon {
  opacity: 1;
  color: var(--accent-gold);
}

.screener-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-fast);
}

.screener-table tbody tr {
  cursor: pointer;
  transition: var(--transition-fast);
}

.screener-table tbody tr:hover {
  background: rgba(100, 120, 200, 0.05);
}

.screener-table tbody tr:hover td {
  border-bottom-color: var(--border-medium);
}

.screener-table .cell-ticker {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-primary);
}

.screener-table .cell-price {
  font-family: 'JetBrains Mono', monospace;
}

.screener-table .cell-gap {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.screener-table .cell-gap.positive { color: var(--bullish); }
.screener-table .cell-gap.negative { color: var(--bearish); }

.cell-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.cell-status.intact {
  background: var(--bullish-dim);
  color: var(--bullish);
}

.cell-status.broken {
  background: var(--bearish-dim);
  color: var(--bearish);
}

/* Sparkline in table */
.sparkline-container {
  width: 80px;
  height: 28px;
}

.sparkline-container canvas {
  width: 100%;
  height: 100%;
}

/* === Settings Tab === */
#settings-tab {
  padding: 24px;
  overflow-y: auto;
  gap: 20px;
}

.settings-group {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--surface-glass-border);
  padding: 24px;
}

.settings-group-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-group-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setting-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.setting-input {
  background: rgba(10, 14, 39, 0.6);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  transition: var(--transition-fast);
  outline: none;
  width: 100%;
}

.setting-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(240, 185, 11, 0.1);
}

.setting-hint {
  font-size: 0.68rem;
  color: var(--text-tertiary);
}

/* === Toast Notification === */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  font-size: 0.82rem;
  animation: toast-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 400px;
}

.toast.success {
  border-color: rgba(0, 230, 118, 0.3);
}

.toast.error {
  border-color: rgba(255, 82, 82, 0.3);
}

.toast.info {
  border-color: rgba(74, 124, 255, 0.3);
}

.toast.warning {
  border-color: rgba(255, 171, 64, 0.3);
}

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.toast-removing {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(60px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(60px) scale(0.9);
  }
}

/* === Loading States === */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, rgba(100, 120, 200, 0.08) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Empty State === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-tertiary);
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 0.82rem;
  max-width: 360px;
  line-height: 1.6;
}

/* === Crosshair === */
.crosshair-x, .crosshair-y {
  position: absolute;
  pointer-events: none;
  z-index: 20;
}

.crosshair-x {
  width: 100%;
  height: 1px;
  background: rgba(100, 120, 200, 0.2);
  border-top: 1px dashed rgba(100, 120, 200, 0.3);
}

.crosshair-y {
  width: 1px;
  height: 100%;
  background: rgba(100, 120, 200, 0.2);
  border-left: 1px dashed rgba(100, 120, 200, 0.3);
}

.price-label {
  position: absolute;
  right: 0;
  background: var(--accent-gold);
  color: #0a0e27;
  padding: 2px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 3px;
  transform: translateY(-50%);
  z-index: 25;
  white-space: nowrap;
}

/* === No Data State === */
.no-stock-selected {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-tertiary);
}

.no-stock-selected .icon {
  font-size: 4rem;
  opacity: 0.15;
}

/* === Responsive === */
@media (max-width: 1200px) {
  .indicator-panel {
    width: 240px;
  }
}

@media (max-width: 992px) {
  /* HP: menu numpuk di atas, halaman bisa scroll — konten tidak ketutup lagi. */
  body {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  #app-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    width: 100%;
    max-width: 100%;
  }

  .main-content {
    /* overflow-y visible = biar tinggi ikut konten pas body jadi auto-height;
       overflow-x TETAP hidden — kalau dibiarin shorthand "overflow: visible"
       ini juga buka x-axis, tabel lebar (screener dsb) nyembur keluar layar
       gitu aja instead of di-scroll di dalam wrapper .glass-panel sendiri. */
    overflow-y: visible;
    overflow-x: hidden;
  }

  .tab-content.allow-scroll {
    overflow-y: visible;
    overflow-x: hidden;
  }

  .top-nav { padding-left: 12px; }

  .nav-tabs {
    overflow-x: auto;
    max-width: 100%;
  }

  .indicator-panel {
    display: none;
  }
}

/* === Animations === */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fade-in 0.3s ease;
}

.animate-slide-up {
  animation: slide-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Utility */
.mono { font-family: 'JetBrains Mono', monospace; }
.text-gold { color: var(--accent-gold); }
.text-cyan { color: var(--accent-cyan); }
.text-bullish { color: var(--bullish); }
.text-bearish { color: var(--bearish); }
.text-muted { color: var(--text-secondary); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }

/* === Summary panels (Pivot / SSV / Support / TSP) === */
.sum-panel {
  padding: 12px 14px;
  min-width: 0;
}

.sum-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sum-legend {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  display: flex;
  gap: 6px;
  align-items: center;
}

.sum-legend i { font-style: normal; }

.sum-grid {
  display: grid;
  gap: 8px;
}

.sum-grid-5 { grid-template-columns: repeat(5, 1fr); }

.sum-cell {
  background: rgba(10, 14, 39, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  min-width: 0;
}

.sum-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sum-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sum-sub {
  font-size: 0.62rem;
  color: var(--text-tertiary);
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}

.tsp-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
}

.tsp-box {
  background: rgba(10, 14, 39, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  min-width: 0;
}

.tsp-box.hit {
  border-color: rgba(0, 230, 118, 0.5);
  background: rgba(0, 230, 118, 0.08);
}

.tsp-box.target {
  border-color: rgba(240, 185, 11, 0.55);
  background: rgba(240, 185, 11, 0.08);
}

.tsp-name {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

.tsp-box.hit .tsp-name { color: var(--bullish); }
.tsp-box.target .tsp-name { color: var(--accent-gold); }

.tsp-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
}

.tsp-box.hit .tsp-price { color: var(--bullish); }
.tsp-box.target .tsp-price { color: var(--accent-gold); }

.tsp-stl {
  font-size: 0.6rem;
  color: var(--text-tertiary);
  font-family: 'JetBrains Mono', monospace;
}

@media (max-width: 900px) {
  .sum-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .tsp-grid { grid-template-columns: repeat(5, 1fr); }
}

/* === BV (POC) Screener === */
.bvscan-title-row {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.bvscan-mode-select {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 16px;
}

.bvscan-panel {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bvscan-row {
  display: flex;
  gap: 10px;
}

.bvscan-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.bvscan-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-tertiary);
  min-width: 0;
}

.bvscan-grid .filter-input { width: 100%; }

.check-row {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(10, 14, 39, 0.6);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent-gold);
  cursor: pointer;
}

.bvscan-status {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 8px 0;
  font-family: 'JetBrains Mono', monospace;
}

@media (max-width: 1100px) {
  .bvscan-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .bvscan-grid { grid-template-columns: repeat(2, 1fr); }
  .bvscan-row { flex-direction: column; }
}

/* === Info tooltip (glosarium indikator) === */
.info-tip {
  position: relative;
  display: inline-block;
  cursor: help;
  color: var(--text-tertiary);
  font-size: 0.8rem;
  margin-left: 6px;
}

.info-tip:hover,
.info-tip:focus { color: var(--accent-gold); }

.info-tip-box {
  display: none;
  position: absolute;
  z-index: 60;
  top: 130%;
  left: -10px;
  width: 260px;
  background: rgba(12, 18, 41, 0.98);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 10px 12px;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
}

.info-tip:hover .info-tip-box,
.info-tip:focus .info-tip-box { display: block; }

.info-tip-box b { color: var(--text-primary); }

/* === Data Detail (tabel historis harian) === */
.data-detail-panel {
  margin-top: 12px;
  padding: 14px;
}

.data-detail-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dd-period-switch {
  display: inline-flex;
  gap: 4px;
}

.dd-period-switch .chart-tab-btn {
  padding: 3px 10px;
  font-size: 0.68rem;
}

.data-detail-title span {
  color: var(--text-tertiary);
  font-weight: 400;
  letter-spacing: normal;
  margin-left: 8px;
}

.data-detail-scroll {
  max-height: 320px;
  overflow-y: auto;
  border-radius: 8px;
}

.data-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
}

.data-detail-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

.data-detail-table th {
  background: var(--bg-tertiary);
  padding: 8px 10px;
  text-align: right;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-medium);
  white-space: nowrap;
}

.data-detail-table th:nth-child(1),
.data-detail-table th:nth-child(2),
.data-detail-table th:last-child { text-align: left; }

.data-detail-table td {
  padding: 7px 10px;
  text-align: right;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-detail-table td:nth-child(1),
.data-detail-table td:nth-child(2),
.data-detail-table td:last-child { text-align: left; }

.data-detail-table tbody tr:hover { background: rgba(100, 120, 200, 0.05); }

.data-detail-table tr.row-bm { background: rgba(0, 230, 118, 0.07); }

.data-detail-table .dd-up { color: var(--bullish); }
.data-detail-table .dd-down { color: var(--bearish); }
.data-detail-table .dd-flat { color: var(--accent-gold); }

.dd-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
}

/* === POC / Volume-Profile popup (chart canvas overlay) === */
.poc-popup {
  position: absolute;
  z-index: 30;
  min-width: 220px;
  max-width: 280px;
  background: rgba(12, 18, 41, 0.97);
  border: 1px solid rgba(255, 213, 79, 0.35);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  padding: 10px 12px 10px;
  font-size: 0.75rem;
  pointer-events: auto;
}

.poc-popup-close {
  position: absolute;
  top: 2px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

.poc-popup-close:hover { color: var(--text-primary); }

.poc-popup-title {
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 6px;
  padding-right: 16px;
}

.poc-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  color: var(--text-secondary);
}

.poc-row b {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}

.poc-hint {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-size: 0.68rem;
  line-height: 1.4;
}

/* === Biografi Volume (BV) modal === */
.bv-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(3, 6, 18, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.bv-dialog {
  width: min(1500px, 100%);
  height: 94vh;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  overflow: hidden;
}

.bv-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 8px;
}

.bv-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bv-ticker-badge {
  background: rgba(100, 120, 200, 0.15);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  padding: 2px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.bv-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bv-btn {
  padding: 5px 14px;
  font-size: 0.75rem;
}

.bv-info {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.bv-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.bv-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: -1px;
}

.bv-legend i.line {
  width: 18px;
  height: 0;
  border-top: 2px solid #ff4d4d;
  vertical-align: middle;
}

.bv-hint {
  margin-left: auto;
  color: var(--text-tertiary);
  font-style: italic;
}

.bv-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 480px;
  overflow-y: auto;
  background: #0a0f24;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.bv-canvas-wrap canvas { display: block; }

.bv-tooltip { min-width: 200px; }

@media (max-width: 768px) {
  .bv-dialog { padding: 10px; }
  .bv-hint { display: none; }
}

/* ============================================================
   SIDE FEATURE MENU (launcher) + MARKET CLOCK
   ============================================================ */
/* Hamburger (garis tiga) — always visible, opens the sidebar drawer */
.menu-toggle {
  display: inline-flex;
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1003;
  width: 40px;
  height: 36px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--bg-secondary, #161b26);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  padding: 0;
}
.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #e8ecf4;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.side-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.55);
}

/* Menu is drawer-only at EVERY screen size: hidden by default, slides in via
   the hamburger. Content takes the full width — no reserved sidebar column. */
#app-container { grid-template-columns: 1fr; }
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  max-width: 86vw;
  z-index: 1002;
  transform: translateX(-105%);
  transition: transform 0.25s ease;
  border-radius: 0;
  overflow-y: auto;
  padding: 14px 12px;
}
#sidebar.open {
  transform: translateX(0);
  box-shadow: 0 0 44px rgba(0, 0, 0, 0.65);
}
.side-menu-backdrop.show { display: block; }
#sidebar .sidebar-header { padding-left: 46px; }
.top-nav { padding-left: 58px; }

.side-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}
.side-menu-btn {
    display: block;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: center;
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.side-menu-btn:hover {
    transform: translateX(3px);
    filter: brightness(1.15);
}
.side-menu-btn.active {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 1px;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
}
/* Vibrant gradients per item */
.sm-green   { background: linear-gradient(135deg, #0b6e4f, #17c07a); }
.sm-orange  { background: linear-gradient(135deg, #e06000, #ff9b3d); }
.sm-blue    { background: linear-gradient(135deg, #1667c7, #3f9bff); }
.sm-teal    { background: linear-gradient(135deg, #0c6363, #14b8b8); }
.sm-olive   { background: linear-gradient(135deg, #5f7a10, #a5c616); }
.sm-cyan    { background: linear-gradient(135deg, #0e7f96, #22d3ee); }
.sm-pink    { background: linear-gradient(135deg, #c02a6c, #ff5fa2); }
.sm-purple  { background: linear-gradient(135deg, #6d28d9, #a06bff); }
.sm-indigo  { background: linear-gradient(135deg, #3730a3, #6366f1); }
.sm-magenta { background: linear-gradient(135deg, #a3118a, #e839c8); }
.sm-lime    { background: linear-gradient(135deg, #3f8f14, #84cc16); }
.sm-emerald { background: linear-gradient(135deg, #047857, #34d399); }
.sm-gold    { background: linear-gradient(135deg, #b98a00, #ffd54f); color: #241c00; }
.sm-sky     { background: linear-gradient(135deg, #0c4a6e, #38bdf8); }
.sm-red     { background: linear-gradient(135deg, #8f1d1d, #ff5a5a); }

.market-clock {
    margin-top: 16px;
    padding: 9px 10px;
    border-radius: 9px;
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 7px;
    justify-content: center;
}
.market-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b7280;
}
.market-dot.open { background: #00e676; box-shadow: 0 0 8px #00e676; }
.market-dot.closed { background: #ff5252; }
.market-state { color: var(--text-tertiary, #9aa3b2); }

/* Panel Indikator Teknikal (TradingView embed) */
#ta-widget { min-height: 450px; }
#ta-widget iframe { max-width: 100%; }
@media (max-width: 768px) {
  #ta-widget { min-height: 480px; }
}

/* Page: flow table rows */
.flow-row-bull { border-left: 3px solid var(--bullish, #00c853); }
.flow-row-bear { border-left: 3px solid var(--bearish, #ff5252); }
.flow-value { font-family: 'JetBrains Mono', monospace; }

/* Calc result cards */
.calc-result {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(0, 200, 150, 0.08);
    border: 1px solid rgba(0, 200, 150, 0.3);
}
.calc-result .indicator-title { margin-bottom: 8px; }

/* ============================================================
   DESAIN HP (≤768px) — bottom nav, tabel geser + kolom nempel,
   chart & tombol ramah jempol. Desktop tidak tersentuh.
   ============================================================ */
.mobile-bottom-nav { display: none; }

@media (max-width: 768px) {
  /* Ruang buat bottom nav + jaga biar gak ada elemen yang narik scroll
     horizontal (eksplisit, jangan andelin overflow-x kebawa dari body{overflow:hidden}
     shorthand desktop yang cuma sebagian di-override overflow-y di breakpoint 992px). */
  html, body { overflow-x: hidden; max-width: 100vw; padding-bottom: 74px; }

  /* Tab-bar atas (.nav-tabs) redundan di HP — isinya udah ke-cover hamburger
     drawer + bottom nav. Row horizontal-scroll ini yang bikin "geser ke kiri"
     pas kesentuh jari, jadi dimatiin total di lebar ini (bukan didesktop). */
  .top-nav { display: none; }

  /* Bottom nav ala aplikasi: 5 menu utama, kaca blur */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 900;
    background: rgba(8, 12, 30, 0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 7px 2px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-decoration: none;
    border-radius: 10px;
    min-height: 48px;
    justify-content: center;
  }
  .mobile-bottom-nav a .mnav-ico { font-size: 19px; line-height: 1; }
  .mobile-bottom-nav a.active {
    color: var(--accent-gold);
    background: rgba(240, 185, 11, 0.1);
  }

  /* Header chart: susun vertikal, harga besar tetap */
  .header-info { gap: 8px; }
  .header-info h1 { font-size: 1.35rem; }
  .header-info > div { flex-wrap: wrap; }
  #chart-price { font-size: 22px !important; }
  #bsjp-badge { font-size: 11px; }

  /* Form cari saham full-width */
  .header-info form { width: 100%; margin-left: 0 !important; }
  .header-info form input { flex: 1; }

  /* Cegah auto-zoom iOS + target jempol 44px */
  input, select, button, .btn, .btn-primary, .btn-secondary, .chart-select {
    font-size: 16px;
    min-height: 44px;
  }
  .chart-select-label { font-size: 12px; }
  .chart-select { min-height: 40px; }

  /* Toolbar chart bungkus */
  .chart-toolbar, .chart-toolbar-left, .chart-toolbar-right {
    flex-wrap: wrap;
    gap: 8px;
  }
  .chart-panel-title { width: 100%; margin-bottom: 2px; }
  .chart-tab-btn { padding: 8px 14px; }

  /* Kanvas lebih pendek biar panel kebaca tanpa scroll jauh */
  .chart-canvas-wrap { height: 320px; }
  .tradingview-panel { min-height: 320px; }

  /* Readout OHLC geser samping */
  .chart-readout {
    overflow-x: auto;
    white-space: nowrap;
    font-size: 11px;
  }
  .chart-legend { font-size: 10px; gap: 6px; }

  /* Live strip bungkus */
  .live-strip { flex-wrap: wrap; font-size: 11px; gap: 6px; }

  /* Kartu ringkasan jadi 1 kolom */
  .header-info + div[style*="display: flex"],
  div[style*="display: flex"][style*="gap: 20px"] { flex-wrap: wrap; }
  .indicator-card { flex: 1 1 100% !important; padding: 12px; }
  .indicator-value { font-size: 1.3rem; }

  /* Grid ringkasan: 2 kolom di HP */
  .sum-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .sum-panel { margin-bottom: 10px; }
  .tsp-box { min-width: 30%; }

  /* Tabel: font kecil + kolom ticker nempel kiri */
  .screener-table { font-size: 11px; }
  .screener-table th, .screener-table td { padding: 8px 7px; }
  .screener-table tbody tr { min-height: 44px; }
  .screener-table thead th:first-child,
  .screener-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #0c1230;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.5);
  }
  .screener-table thead th:first-child { z-index: 3; }

  /* Modal jadi hampir fullscreen */
  .bv-dialog {
    width: 94vw !important;
    max-width: 94vw !important;
    max-height: 88vh;
    overflow-y: auto;
    margin: 6vh auto !important;
  }
  .poc-popup {
    max-width: 86vw;
    font-size: 12px;
  }

  /* Panel indikator (kanan chart) turun ke bawah */
  .indicator-panel { width: 100%; }
  .bigmoney-detail-row {
    font-size: 12px;
    flex-wrap: wrap;
  }
  .bigmoney-detail-label, .bigmoney-detail-value { min-width: 0; }

  /* Guard page-wide: cegah 1 elemen kelebaran narik seluruh halaman scroll
     horizontal (ini yang bikin value di kartu Volume Spike ke-clip/ilang). */
  .main-content, .tab-content, .header-info, .glass-panel,
  .indicators-grid, .indicator-card, .alert-card {
    max-width: 100%;
  }
  .indicators-grid { display: flex; flex-direction: column; gap: 12px; }

  /* BV modal: kontrol susun */
  .bv-controls { flex-wrap: wrap; }
  .bv-controls label { flex: 1 1 45%; }

  /* Sparkline tabel jangan terlalu lebar */
  .sparkline-container { min-width: 90px; }

  /* Toast di atas bottom nav */
  .toast-container { bottom: 84px !important; }
}

/* HP kecil (≤380px): grid 1 kolom penuh */
@media (max-width: 380px) {
  .sum-grid-5 { grid-template-columns: 1fr 1fr; }
  .header-info h1 { font-size: 1.15rem; }
  .chart-canvas-wrap { height: 280px; }
}
