/* ==========================================================================
   AURUM SIGNAL AI - LUXURY LIGHT MODE STYLING
   Reka bentuk UI/UX Eksklusif, Kemas, Terang & Berprestij Tinggi (Tanpa Dark Mode)
   ========================================================================== */

:root {
  /* Canvas & Surfaces (Pristine Light Theme) */
  --bg-canvas: #f8fafc;
  --bg-canvas-subtle: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-alt: #f8fafc;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #94a3b8;

  /* Typography */
  --text-main: #0f172a;        /* Deep Slate 900 */
  --text-secondary: #334155;   /* Slate 700 */
  --text-muted: #64748b;       /* Slate 500 */
  --text-light: #94a3b8;       /* Slate 400 */

  /* Gold Brand Accents (XAUUSD) */
  --gold-50: #fffbeb;
  --gold-100: #fef3c7;
  --gold-200: #fde68a;
  --gold-500: #f59e0b;
  --gold-600: #d97706;
  --gold-700: #b45309;
  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  --gold-glow: rgba(217, 119, 6, 0.16);

  /* Emerald Green (BUY / Profit / Wins) */
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-glow: rgba(16, 185, 129, 0.15);

  /* Rose / Ruby (SELL / Stop Loss / Negative) */
  --rose-50: #fff1f2;
  --rose-100: #ffe4e6;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;
  --rose-700: #be123c;
  --rose-glow: rgba(225, 29, 72, 0.15);

  /* Sapphire Blue (Tech / Multi-timeframe) */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;

  /* Shadows & Elevations */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
  --shadow-lg: 0 10px 25px -4px rgba(15, 23, 42, 0.06), 0 4px 10px -2px rgba(15, 23, 42, 0.03);
  --shadow-gold: 0 4px 16px rgba(217, 119, 6, 0.18);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 9999px;

  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Transitions */
  --trans-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --trans-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.light-theme {
  background-color: var(--bg-canvas);
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(245, 158, 11, 0.05), transparent 60%),
    radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.02), transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-canvas-subtle);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   NAVBAR & TOP MARKET BAR
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Brand Section */
.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: var(--gold-50);
  border: 1px solid var(--gold-200);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--trans-fast);
}

.brand-logo:hover {
  transform: rotate(6deg) scale(1.04);
}

.gold-icon {
  width: 26px;
  height: 26px;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  background: var(--gold-100);
  color: var(--gold-700);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-200);
  letter-spacing: 0.5px;
}

.brand-desc {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Market Status Center */
.market-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--text-secondary);
  transition: all var(--trans-fast);
}

.status-pill:hover {
  border-color: var(--border-strong);
  background: #ffffff;
}

/* Pulsing Dots */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.pulse-dot.green {
  background: var(--emerald-500);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.price-pill {
  background: #ffffff;
  border-color: var(--gold-200);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.08);
}

.pill-symbol {
  font-weight: 700;
  color: var(--gold-700);
}

.pill-price {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
  font-size: 13px;
}

.pill-spread {
  background: var(--gold-100);
  color: var(--gold-700);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.session-pill {
  background: #ffffff;
}

.volatility-tag {
  background: var(--emerald-100);
  color: var(--emerald-700);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.clock-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auto-scan-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: #059669;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.05);
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--trans-fast);
  white-space: nowrap;
}

.btn-icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--gold-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-gold);
  border-color: #d97706;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.28);
}

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

.btn-outline {
  background: #ffffff;
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-alt);
  color: var(--text-main);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px;
  border-radius: var(--radius-md);
}

.btn-ghost:hover {
  background: var(--bg-canvas-subtle);
  color: var(--text-main);
}

/* Scanner Toggle Switch */
.scanner-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: var(--emerald-500);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

.toggle-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   APP BODY & LAYOUT
   ========================================================================== */
.app-body {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Generic Card */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--trans-fast), border-color var(--trans-fast);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card-header-styled {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: #ffffff;
}

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

.header-icon {
  font-size: 16px;
}

.card-header-styled h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

/* Status Chips */
.status-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.status-chip.active {
  background: var(--emerald-50);
  color: var(--emerald-700);
  border: 1px solid var(--emerald-100);
}

/* ==========================================================================
   KPI BANNER CARDS
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform var(--trans-fast), box-shadow var(--trans-fast);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.kpi-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kpi-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.emerald-badge { background: var(--emerald-100); color: var(--emerald-700); }
.gold-badge { background: var(--gold-100); color: var(--gold-700); }
.blue-badge { background: var(--blue-100); color: var(--blue-600); }

.kpi-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-number {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -1px;
  line-height: 1;
}

.emerald-text { color: var(--emerald-600) !important; }
.rose-text { color: var(--rose-600) !important; }
.gold-text { color: var(--gold-600) !important; }

.kpi-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-box svg {
  width: 22px;
  height: 22px;
}

.gold-box { background: var(--gold-50); color: var(--gold-600); border: 1px solid var(--gold-200); }
.blue-box { background: var(--blue-50); color: var(--blue-600); border: 1px solid var(--blue-100); }
.amber-box { background: var(--gold-100); color: var(--gold-700); }

/* Progress Ring */
.kpi-ring-wrap {
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}

.ring-fill {
  transition: stroke-dashoffset 0.8s ease;
}

.kpi-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.kpi-trend.positive {
  color: var(--emerald-700);
  font-weight: 600;
}

.kpi-tag {
  background: var(--gold-50);
  color: var(--gold-700);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-100);
}

.pf-bar-wrap {
  flex: 1;
  max-width: 100px;
  height: 6px;
  background: #e2e8f0;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.pf-bar-fill {
  height: 100%;
  background: var(--blue-600);
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   SESSION HEATMAP CARD
   ========================================================================== */
.session-tracker-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

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

.session-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--gold-100);
  color: var(--gold-700);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.session-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.session-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
}

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

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.legend-dot.green { background: var(--emerald-500); }
.legend-dot.amber { background: var(--gold-500); }
.legend-dot.gray { background: #cbd5e1; }

.session-timeline {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr 1.5fr 1.2fr;
  gap: 8px;
}

.session-block {
  background: var(--bg-canvas-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all var(--trans-fast);
}

.session-block .sess-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.session-block .sess-hours {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.session-block.active {
  background: #ffffff;
  border-color: var(--gold-500);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.12);
}

.session-block.active .sess-name {
  color: var(--gold-700);
}

.session-block.overlap {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #f59e0b;
}

.session-block.overlap .sess-name {
  color: #b45309;
}

/* ==========================================================================
   WORKSPACE GRID (LEFT & RIGHT)
   ========================================================================== */
.workspace-grid {
  display: grid;
  grid-template-columns: 66% 34%;
  gap: 24px;
  align-items: start;
}

.left-workspace, .right-workspace {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==========================================================================
   CHART CARD
   ========================================================================== */
.chart-card {
  display: flex;
  flex-direction: column;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.chart-title-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.symbol-tag {
  display: flex;
  align-items: center;
  gap: 6px;
}

.symbol-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.timeframe-tag {
  background: var(--gold-50);
  color: var(--gold-700);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-200);
}

.candle-timer-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(37, 99, 235, 0.2);
  white-space: nowrap;
}

.live-quote-box {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.quote-label {
  font-size: 11px;
  color: var(--text-muted);
}

.quote-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.quote-spread {
  font-size: 11px;
  color: var(--emerald-600);
  background: var(--emerald-50);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Timeframe Selector */
.tf-selector {
  display: flex;
  background: var(--bg-canvas-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
}

.tf-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.tf-btn:hover {
  color: var(--text-main);
}

.tf-btn.active {
  background: #ffffff;
  color: var(--gold-700);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Indicator Toggles */
.indicator-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  cursor: pointer;
  user-select: none;
  transition: all var(--trans-fast);
  color: var(--text-secondary);
}

.chip-toggle.active {
  background: var(--bg-canvas-subtle);
  border-color: var(--border-strong);
}

.color-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.color-dot.blue { background: #3b82f6; }
.color-dot.amber { background: #f59e0b; }
.color-dot.purple { background: #8b5cf6; }
.color-dot.green { background: #10b981; }

/* Chart Viewport Canvas */
.chart-viewport {
  position: relative;
  width: 100%;
  height: 400px;
  background: #ffffff;
  cursor: crosshair;
}

#customCandleCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-crosshair-tooltip {
  position: absolute;
  display: none;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  line-height: 1.4;
}

.chart-levels-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}

.chart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-surface-alt);
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
}

.chart-metrics {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-pill strong {
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* ==========================================================================
   HERO ACTIVE SIGNAL SPOTLIGHT CARD
   ========================================================================== */
.signal-hero-card {
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.hero-status-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-dir-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.hero-dir-badge.buy {
  background: var(--emerald-500);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.hero-dir-badge.sell {
  background: var(--rose-600);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
}

.dir-icon {
  width: 20px;
  height: 20px;
}

.hero-setup-title h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.hero-time-tag {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Confluence Score Box */
.confluence-score-box {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--gold-50);
  border: 1px solid var(--gold-200);
  padding: 10px 18px;
  border-radius: var(--radius-lg);
}

.score-circle-wrap {
  display: flex;
  align-items: baseline;
}

.score-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--gold-700);
  font-family: var(--font-mono);
  line-height: 1;
}

.score-denom {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-600);
}

.score-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.grade-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  display: inline-block;
}

.grade-badge.a-plus {
  background: #b45309;
  color: #ffffff;
}

.score-desc {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Price Targets Grid */
.price-targets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.target-card {
  background: var(--bg-canvas-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform var(--trans-fast);
}

.target-card:hover {
  transform: translateY(-2px);
  background: #ffffff;
}

.target-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.target-price {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
}

.target-sub {
  font-size: 11px;
  color: var(--text-muted);
}

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

.scale-badge {
  font-size: 9px;
  font-weight: 700;
  background: var(--emerald-100);
  color: var(--emerald-700);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}

.runner-badge {
  font-size: 9px;
  font-weight: 700;
  background: var(--gold-100);
  color: var(--gold-700);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}

/* Live Progress Section */
.live-progress-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-surface-alt);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.progress-track {
  position: relative;
  height: 10px;
  background: #e2e8f0;
  border-radius: var(--radius-pill);
}

.progress-bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  border-radius: var(--radius-pill);
  transition: width 0.4s ease;
}

.progress-curr-pointer {
  position: absolute;
  top: -7px;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: #ffffff;
  border: 3px solid #059669;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 0.4s ease;
}

.pointer-bubble {
  position: absolute;
  top: -26px;
  background: var(--text-main);
  color: #ffffff;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.floating-pips-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  font-size: 13px;
}

.flt-label {
  color: var(--text-muted);
  font-weight: 600;
}

.flt-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
}

.flt-status-pill.be-safe {
  background: var(--emerald-50);
  color: var(--emerald-700);
  border: 1px solid var(--emerald-200);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

/* Confluence Reasons Checklist */
.confluence-reasons-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reasons-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.reasons-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reason-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
}

.reason-pill.success {
  background: var(--emerald-50);
  color: var(--emerald-700);
  border: 1px solid var(--emerald-100);
}

/* ==========================================================================
   RIGHT COLUMN: RADAR, CALCULATOR, LOG FEED
   ========================================================================== */
/* Radar List */
.radar-list {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radar-item {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--trans-fast);
}

.radar-item:hover {
  background: #ffffff;
  border-color: var(--border-strong);
}

.radar-item.radar-active-pulse {
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.8) 0%, #ffffff 100%);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12);
}

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

.radar-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-main);
}

.radar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.radar-dot.green { background: var(--emerald-500); }
.radar-dot.gray { background: #94a3b8; }

.radar-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.radar-badge.active {
  background: var(--emerald-100);
  color: var(--emerald-700);
}

.radar-badge.standby {
  background: #e2e8f0;
  color: var(--text-muted);
}

.radar-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.radar-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 6px;
}

/* Calculator Card */
.lot-rule-tag {
  font-size: 10px;
  background: var(--gold-100);
  color: var(--gold-700);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.calc-form {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calc-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.input-prefix-wrap, .input-suffix-wrap {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 10px;
  transition: border-color var(--trans-fast);
}

.input-prefix-wrap:focus-within, .input-suffix-wrap:focus-within {
  border-color: var(--gold-600);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

.input-prefix-wrap input, .input-suffix-wrap input, .form-group input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
}

.prefix, .suffix {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.input-hint {
  font-size: 10px;
  color: var(--text-muted);
}

.calc-result-box {
  background: var(--bg-canvas-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.res-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.res-lot {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--gold-700);
}

.result-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 11px;
}

.res-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.m-label {
  color: var(--text-muted);
}

/* Scanner Feed Terminal */
.btn-text-small {
  background: transparent;
  border: none;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-text-small:hover {
  color: var(--text-main);
  text-decoration: underline;
}

.terminal-feed {
  padding: 14px 18px;
  height: 180px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fbfcfd;
}

.terminal-line {
  line-height: 1.4;
  color: var(--text-secondary);
}

.terminal-line .t-time {
  color: var(--text-muted);
  margin-right: 6px;
}

.terminal-line.info { color: #334155; }
.terminal-line.success { color: #047857; font-weight: 600; }
.terminal-line.warn { color: #b45309; }
.terminal-line.error { color: #b91c1c; }

/* ==========================================================================
   SIGNALS TABLE & AUDIT TRAIL
   ========================================================================== */
.table-card {
  padding: 0;
}

.table-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 14px;
}

.table-title-group h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.table-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.table-filters {
  display: flex;
  background: var(--bg-canvas-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.filter-tab {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.filter-tab:hover {
  color: var(--text-main);
}

.filter-tab.active {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.signals-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.signals-table th {
  background: var(--bg-surface-alt);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.3px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.signals-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  vertical-align: middle;
}

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

.signals-table tbody tr:hover {
  background: #f8fafc;
}

/* Table Pill Badges */
.badge-dir {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.badge-dir.buy {
  background: var(--emerald-100);
  color: var(--emerald-700);
}

.badge-dir.sell {
  background: var(--rose-100);
  color: var(--rose-700);
}

.badge-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.badge-status.tp2 { background: var(--emerald-100); color: var(--emerald-700); }
.badge-status.tp1 { background: var(--emerald-50); color: var(--emerald-600); }
.badge-status.be { background: var(--blue-100); color: var(--blue-600); }
.badge-status.sl { background: var(--rose-100); color: var(--rose-700); }
.badge-status.running { background: var(--gold-100); color: var(--gold-700); }

.table-score {
  display: flex;
  align-items: center;
  gap: 6px;
}

.score-dot-bar {
  width: 50px;
  height: 5px;
  background: #e2e8f0;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.score-dot-fill {
  height: 100%;
  background: var(--gold-500);
}

.pips-chip {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
}

.reasons-snippet {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
}

/* ==========================================================================
   ANALYTICS & RULES ROW
   ========================================================================== */
.analytics-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 24px;
}

/* ==========================================================================
   EQUITY CURVE CARD
   ========================================================================== */
.equity-card .card-header-styled {
  align-items: flex-start;
}

.equity-meta-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.equity-chart-wrap {
  position: relative;
  padding: 0 20px 20px;
  height: 220px;
}

.equity-chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.equity-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

.setup-stats-list {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setup-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.setup-name-block {
  display: flex;
  flex-direction: column;
}

.setup-name-block strong {
  font-size: 13px;
  color: var(--text-main);
}

.setup-name-block span {
  font-size: 11px;
  color: var(--text-muted);
}

.setup-metrics-block {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: right;
}

.setup-metric-item {
  display: flex;
  flex-direction: column;
}

.setup-metric-item .val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}

.setup-metric-item .lbl {
  font-size: 10px;
  color: var(--text-muted);
}

/* Rules List */
.rules-list {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.rule-num {
  width: 26px;
  height: 26px;
  background: var(--gold-100);
  color: var(--gold-700);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.rule-content strong {
  font-size: 13px;
  color: var(--text-main);
  display: block;
  margin-bottom: 2px;
}

.rule-content p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   MODALS (CONFIG & SMC GUIDE)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 580px;
  width: 100%;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.2);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.guide-dialog {
  max-width: 680px;
}

@keyframes slideUp {
  from { transform: translateY(16px) scale(0.98); }
  to { transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title-group h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.config-grid .form-group input {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.guide-section {
  margin-bottom: 18px;
}

.guide-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold-700);
  margin-bottom: 6px;
}

.guide-section p, .guide-section ul {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guide-section ul {
  margin-left: 20px;
  margin-top: 6px;
}

.guide-section li {
  margin-bottom: 4px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--gold-500);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -4px rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  animation: slideInToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 280px;
}

.toast.success { border-left-color: var(--emerald-500); }
.toast.warn { border-left-color: var(--gold-500); }
.toast.error { border-left-color: var(--rose-600); }

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1200px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .session-timeline {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 1100px) {
  .analytics-row {
    grid-template-columns: 1fr 1fr;
  }
  .equity-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .price-targets-grid {
    grid-template-columns: 1fr 1fr;
  }
  .analytics-row {
    grid-template-columns: 1fr;
  }
  .equity-card {
    grid-column: auto;
  }
  .nav-container {
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .app-body {
    padding: 16px;
  }
  .market-status-bar {
    display: none;
  }
}
