/* ==============================
     MODERN CSS VARIABLES & RESET
     ============================== */
  *, *::before, *::after { box-sizing: border-box; }

  :root {
    --bg-primary: #0b0f1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-indigo: #6366f1;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --glass-bg: rgba(15, 23, 42, 0.75);
    --glass-border: rgba(255,255,255,0.08);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.45);
    --card-gradient-start: rgba(99, 102, 241, 0.08);
    --card-gradient-end: rgba(139, 92, 246, 0.08);
    --table-row: rgba(15, 23, 42, 0.5);
    --table-row-even: rgba(30, 41, 59, 0.35);
    --border-subtle: rgba(255,255,255,0.06);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.light-mode {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(139, 92, 246, 0.15);
    --glass-shadow: 0 4px 20px rgba(0,0,0,0.06);
    --card-gradient-start: rgba(99, 102, 241, 0.04);
    --card-gradient-end: rgba(139, 92, 246, 0.04);
    --table-row: rgba(255, 255, 255, 0.9);
    --table-row-even: rgba(248, 250, 252, 0.9);
    --border-subtle: rgba(0,0,0,0.06);
  }

  body {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background var(--transition-normal), color var(--transition-normal);
  }

  /* ==============================
     CUSTOM SCROLLBAR
     ============================== */
  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
    transition: background var(--transition-fast);
  }
  ::-webkit-scrollbar-thumb:hover { background: rgba(139, 92, 246, 0.5); }

  /* ==============================
     ANIMATIONS
     ============================== */
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
  @keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
  @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
  @keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
  @keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ==============================
     GLOBAL LOADING OVERLAY
     ============================== */
  .global-loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(11, 15, 26, 0.65);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.2s ease;
  }
  .global-loading-overlay.show { display: flex; }
  .global-loading-box {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    padding: 28px 44px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  }
  .global-loading-spinner {
    width: 40px; height: 40px; border-radius: 50%;
    border: 4px solid rgba(139, 92, 246, 0.15);
    border-top-color: var(--accent-purple);
    animation: spin 0.8s linear infinite;
  }
  .global-loading-text {
    color: var(--text-primary);
    font-size: 14px; font-weight: 600; letter-spacing: 0.3px;
  }
  /* Inline spinner kecil untuk elemen spesifik (dropdown, tombol) */
  .inline-spinner {
    display: inline-block; width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--accent-purple);
    animation: spin 0.7s linear infinite;
    vertical-align: -2px; margin-right: 6px;
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }

  /* ==============================
     LOGIN SCREEN MODERN
     ============================== */
  #login-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    overflow: hidden;
  }

  #login-screen::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 50% 0%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
    animation: gradientShift 15s ease infinite;
    background-size: 200% 200%;
  }

  .login-box {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--glass-shadow), 0 0 0 1px rgba(255,255,255,0.03) inset;
    max-width: 400px;
    width: 90%;
    animation: scaleIn 0.4s ease;
    position: relative;
  }

  .login-box::after {
    content: '';
    position: absolute;
    top: -1px; left: 20%; right: 20%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-indigo), var(--accent-purple), transparent);
    border-radius: 2px;
  }

  .login-box h2 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 36px;
    text-align: center;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
  }

  .login-box input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0,0,0,0.3);
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    margin-bottom: 20px;
    outline: none;
    transition: all var(--transition-normal);
  }

  .login-box input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
    background: rgba(0,0,0,0.4);
  }

  .login-box button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
  }

  .login-box button::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.6s ease;
  }

  .login-box button:hover::before { left: 100%; }
  .login-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.35);
  }
  .login-box button:active { transform: translateY(0); }

  .error-message {
    color: var(--accent-rose);
    font-size: 13px;
    margin-top: -12px;
    margin-bottom: 16px;
    text-align: center;
    display: none;
    background: rgba(244, 63, 94, 0.1);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(244, 63, 94, 0.2);
  }

  #main-content { display: none; }

  /* ==============================
     GLASS & CARD STYLES
     ============================== */
  .glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-normal);
  }

  .glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-normal);
  }

  .glass-card:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.25);
    box-shadow: var(--glass-shadow), 0 0 20px rgba(99, 102, 241, 0.08);
  }

  /* ==============================
     HEADER
     ============================== */
  .header-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow), 0 0 0 1px rgba(255,255,255,0.03) inset;
    transition: all var(--transition-normal);
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
  }

  .header-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-indigo), var(--accent-purple), transparent);
    opacity: 0.5;
  }

  body.light-mode .header-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(248,250,252,0.95));
    border-color: rgba(139, 92, 246, 0.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
  }

  .gradient-text {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  /* ==============================
     BUTTON STYLES
     ============================== */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
  }

  .btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s ease;
  }

  .btn:hover::before { left: 100%; }

  .btn-primary { background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)); color: white; }
  .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3); }

  .btn-success { background: linear-gradient(135deg, #10b981, #059669); color: white; }
  .btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3); }

  .btn-danger { background: linear-gradient(135deg, var(--accent-rose), #e11d48); color: white; }
  .btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(244, 63, 94, 0.3); }

  .btn-warning { background: linear-gradient(135deg, var(--accent-amber), #d97706); color: white; }
  .btn-warning:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3); }

  .btn-ghost {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(139, 92, 246, 0.2);
  }
  .btn-ghost:hover { background: rgba(99, 102, 241, 0.2); transform: translateY(-1px); }

  .btn-sm { padding: 6px 14px; font-size: 12px; border-radius: var(--radius-sm); }
  .btn-lg { padding: 14px 28px; font-size: 15px; border-radius: var(--radius-lg); }

  .btn-icon {
    width: 36px; height: 36px; padding: 0;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
  }

  /* ==============================
     TABULATOR TABLE MODERNIZATION
     ============================== */
  .tabulator {
    border-radius: var(--radius-lg) !important;
    overflow: hidden;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow);
    will-change: scroll-position;
    -webkit-overflow-scrolling: touch;
    contain: layout style paint;
  }

  body.light-mode .tabulator {
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(139, 92, 246, 0.12) !important;
  }

  .tabulator .tabulator-tableHolder {
    overflow-y: auto; overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tabulator-tableHolder.tabulator-scrolling .tabulator-row:hover {
    background: var(--table-row) !important;
    border-left: none !important;
  }

  .tabulator-header {
    background: var(--bg-tertiary) !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2) !important;
    font-weight: 600 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
  }

  body.light-mode .tabulator-header {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15) !important;
  }

  .tabulator-header .tabulator-col {
    background: transparent !important;
    border-right: 1px solid var(--border-subtle) !important;
    padding: 10px 8px !important;
  }

  .tabulator-header .tabulator-col-title {
    color: var(--accent-purple) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
  }

  body.light-mode .tabulator-header .tabulator-col-title {
    color: var(--accent-indigo) !important;
  }

  .tabulator-col-sorter { color: var(--accent-purple) !important; }

  .tabulator-row {
    background: var(--table-row) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    cursor: pointer;
    transition: background var(--transition-fast);
  }

  body.light-mode .tabulator-row {
    background: var(--table-row) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
  }

  .tabulator-row:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08)) !important;
    border-left: 3px solid var(--accent-purple);
  }

  body.light-mode .tabulator-row:hover {
    background: rgba(241, 245, 249, 0.9) !important;
    border-left: 3px solid var(--accent-purple);
  }

  .tabulator-row.tabulator-row-even {
    background: var(--table-row-even) !important;
  }

  body.light-mode .tabulator-row.tabulator-row-even {
    background: var(--table-row-even) !important;
  }

  .tabulator-row.tabulator-row-even:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08)) !important;
  }

  body.light-mode .tabulator-row.tabulator-row-even:hover {
    background: rgba(241, 245, 249, 0.9) !important;
  }

  /* Frozen columns - SOLID backgrounds (no transparency) */
  .tabulator-frozen,
  .tabulator-frozen-left,
  .tabulator-frozen-right,
  .tabulator-frozen-rows-holder { background: var(--bg-primary) !important; }
  body.light-mode .tabulator-frozen,
  body.light-mode .tabulator-frozen-left,
  body.light-mode .tabulator-frozen-right,
  body.light-mode .tabulator-frozen-rows-holder { background: var(--bg-secondary) !important; }
  .tabulator-header .tabulator-col.tabulator-frozen { background: var(--bg-tertiary) !important; }
  body.light-mode .tabulator-header .tabulator-col.tabulator-frozen { background: var(--bg-secondary) !important; }
  .tabulator-row .tabulator-frozen { background: var(--bg-primary) !important; }
  body.light-mode .tabulator-row .tabulator-frozen { background: var(--bg-secondary) !important; }
  .tabulator-row:hover .tabulator-frozen { background: var(--bg-tertiary) !important; }
  body.light-mode .tabulator-row:hover .tabulator-frozen { background: #f1f5f9 !important; }
  .tabulator-row.tabulator-row-even .tabulator-frozen { background: var(--bg-secondary) !important; }
  body.light-mode .tabulator-row.tabulator-row-even .tabulator-frozen { background: var(--bg-secondary) !important; }
  .tabulator-row.tabulator-row-even:hover .tabulator-frozen { background: var(--bg-tertiary) !important; }
  body.light-mode .tabulator-row.tabulator-row-even:hover .tabulator-frozen { background: #f1f5f9 !important; }

 /* Shadow on frozen columns for visual indicator */
 .tabulator-frozen-left {
   box-shadow: 4px 0 12px rgba(0,0,0,0.3) !important;
   clip-path: inset(0px -12px 0px 0px) !important;
 }
 body.light-mode .tabulator-frozen-left {
   box-shadow: 4px 0 12px rgba(0,0,0,0.08) !important;
 }

 .tabulator-cell {
    border-right: 1px solid var(--border-subtle) !important;
    padding: 10px 8px !important;
    color: var(--text-primary) !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  body.light-mode .tabulator-cell {
    color: var(--text-primary) !important;
    border-right: 1px solid var(--border-subtle) !important;
  }

  /* Number cells */
  .tabulator-cell[tabulator-field*="Price"],
  .tabulator-cell[tabulator-field*="Volume"],
  .tabulator-cell[tabulator-field*="Market"],
  .tabulator-cell[tabulator-field*="Cap"] {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace !important;
    font-weight: 600 !important;
    color: var(--accent-cyan) !important;
  }

  body.light-mode .tabulator-cell[tabulator-field*="Price"],
  body.light-mode .tabulator-cell[tabulator-field*="Volume"],
  body.light-mode .tabulator-cell[tabulator-field*="Market"],
  body.light-mode .tabulator-cell[tabulator-field*="Cap"] {
    color: #0369a1 !important;
  }

  /* Link cells */
  .tabulator-cell a {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)) !important;
    color: white !important;
    padding: 6px 14px !important;
    border-radius: var(--radius-sm) !important;
    text-decoration: none !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    transition: all var(--transition-fast) !important;
    display: inline-block !important;
  }

  .tabulator-cell a:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
    background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
  }

  /* Header filter inputs */
  .tabulator-header-filter input,
  .tabulator-header-filter select {
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-primary);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-sm);
    font-size: 11px;
    padding: 6px 10px;
    transition: all var(--transition-fast);
    font-weight: 500;
    width: 100%;
  }

  .tabulator-header-filter input::placeholder {
    color: var(--text-muted);
    font-style: italic;
  }

  .tabulator-header-filter input:hover,
  .tabulator-header-filter select:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(0, 0, 0, 0.35);
  }

  .tabulator-header-filter input:focus,
  .tabulator-header-filter select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
    background: rgba(0, 0, 0, 0.35);
  }

  body.light-mode .tabulator-header-filter input,
  body.light-mode .tabulator-header-filter select {
    background: rgba(255,255,255,0.8) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(139, 92, 246, 0.2) !important;
  }

  body.light-mode .tabulator-header-filter input:focus,
  body.light-mode .tabulator-header-filter select:focus {
    background: rgba(255,255,255,0.95) !important;
    border-color: var(--accent-purple) !important;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1) !important;
  }

  /* Footer / Pagination */
  .tabulator-footer {
    background: var(--bg-tertiary) !important;
    border-top: 1px solid rgba(139, 92, 246, 0.15) !important;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 12px 16px !important;
  }

  body.light-mode .tabulator-footer {
    background: var(--bg-secondary) !important;
    border-top: 1px solid rgba(139, 92, 246, 0.1) !important;
  }

  .tabulator-paginator { color: var(--accent-purple) !important; font-weight: 600 !important; }

  .tabulator-page {
    background: rgba(99, 102, 241, 0.08) !important;
    border: 1px solid rgba(99, 102, 241, 0.2) !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    margin: 0 3px;
    padding: 8px 14px !important;
    font-weight: 600 !important;
    transition: all var(--transition-fast);
    min-width: 36px;
  }

  .tabulator-page:hover {
    background: rgba(139, 92, 246, 0.2) !important;
    transform: translateY(-1px);
    border-color: rgba(139, 92, 246, 0.35) !important;
  }

  .tabulator-page.active {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)) !important;
    border-color: var(--accent-purple) !important;
    color: white !important;
    transform: scale(1.05);
  }

  body.light-mode .tabulator-page {
    background: rgba(99, 102, 241, 0.06) !important;
    border: 1px solid rgba(99, 102, 241, 0.15) !important;
    color: var(--text-primary) !important;
  }

  body.light-mode .tabulator-page:hover {
    background: rgba(139, 92, 246, 0.12) !important;
  }

  body.light-mode .tabulator-page.active {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)) !important;
    color: white !important;
    border-color: var(--accent-purple) !important;
  }

  /* ==============================
     STAT BADGE
     ============================== */
  .stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-purple);
  }

  body.light-mode .stat-badge {
    color: var(--accent-indigo);
  }

  /* ==============================
     CHANGE COLORS
     ============================== */
  .change-positive { color: var(--accent-emerald) !important; font-weight: 700 !important; }
  .change-negative { color: var(--accent-rose) !important; font-weight: 700 !important; }
  .change-neutral { color: var(--accent-amber) !important; font-weight: 700 !important; }

  .check-pass { color: var(--accent-emerald) !important; font-weight: 700 !important; font-size: 15px !important; }
  .check-fail { color: var(--accent-rose) !important; font-weight: 700 !important; font-size: 15px !important; }
  .badge-2at { display:inline-block; background: rgba(52,211,153,0.15); color: var(--accent-emerald); border: 1px solid rgba(52,211,153,0.4); font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
  .badge-2at-hijau { display:inline-block; background: rgba(52,211,153,0.15); color: var(--accent-emerald); border: 1px solid rgba(52,211,153,0.4); font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
  .badge-2at-merah { display:inline-block; background: rgba(251,191,36,0.15); color: #fbbf24; border: 1px solid rgba(251,191,36,0.4); font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }

  /* ==============================
     FILTER ICONS & SORT ICONS
     ============================== */
  .filter-icon {
    cursor: pointer;
    margin-left: 4px;
    font-size: 12px;
    opacity: 0.4;
    transition: all var(--transition-fast);
    display: inline-block;
    padding: 2px 4px;
  }

  .filter-icon:hover { opacity: 1; transform: scale(1.15); color: var(--accent-purple); }
  .filter-icon.active { opacity: 1; color: var(--accent-emerald); }

  .sort-icon {
    cursor: pointer;
    margin-left: 2px;
    font-size: 11px;
    opacity: 0.3;
    transition: all var(--transition-fast);
    display: inline-block;
    padding: 2px 3px;
  }

  .sort-icon:hover { opacity: 1; transform: scale(1.15); color: var(--accent-purple); }

  /* ==============================
     FILTER MODAL
     ============================== */
  .filter-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.03) inset;
    z-index: 10000;
    min-width: 340px;
    max-width: 430px;
    max-height: 85vh;
    overflow-y: auto;
    animation: scaleIn 0.2s ease;
  }

  body.light-mode .filter-modal {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  }

  .filter-modal h4 {
    margin: 0 0 16px 0;
    color: var(--accent-purple);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  }

  body.light-mode .filter-modal h4 { color: var(--accent-indigo); }

  .filter-modal input,
  .filter-modal select {
    width: 100%;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13px;
    transition: all var(--transition-fast);
  }

  body.light-mode .filter-modal input,
  body.light-mode .filter-modal select {
    background: rgba(255,255,255,0.8);
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.2);
  }

  .filter-modal input:focus,
  .filter-modal select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  }

  /* Checkbox container */
  #checkbox-container {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(139, 92, 246, 0.15);
  }

  body.light-mode #checkbox-container {
    background: rgba(248, 250, 252, 0.5);
    border-color: rgba(139, 92, 246, 0.12);
  }

  #checkbox-container label {
    display: flex !important;
    align-items: center;
    padding: 8px 10px !important;
    cursor: pointer;
    border-radius: var(--radius-sm) !important;
    transition: all var(--transition-fast) !important;
    margin-bottom: 3px;
    font-size: 13px;
    color: var(--text-primary);
    border: 1px solid transparent;
  }

  #checkbox-container label:hover {
    background: rgba(139, 92, 246, 0.12) !important;
    border-color: rgba(139, 92, 246, 0.2);
  }

  #checkbox-container label input[type="checkbox"] {
    margin-right: 10px !important;
    width: 16px; height: 16px;
    cursor: pointer;
    accent-color: var(--accent-purple);
  }

  .filter-modal-buttons {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid rgba(139, 92, 246, 0.15);
  }

  .filter-modal-buttons button {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .filter-apply { background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple)); color: white; }
  .filter-apply:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }

  .filter-clear { background: rgba(244, 63, 94, 0.8); color: white; }
  .filter-clear:hover { background: rgba(244, 63, 94, 1); transform: translateY(-1px); }

  .modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    animation: fadeIn 0.2s ease;
  }

  /* ==============================
     QUICK FILTER BUTTONS
     ============================== */
  .quick-filter-buttons {
    display: flex;
    gap: 2px;
    margin-top: 4px;
    justify-content: center;
  }

  .quick-filter-btn {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-secondary);
    line-height: 1.2;
  }

  .quick-filter-btn:hover { transform: translateY(-1px); }

  .quick-filter-btn.active {
    border-color: var(--accent-purple);
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    color: white;
  }

  .quick-filter-btn.check { color: var(--accent-emerald); }
  .quick-filter-btn.check.active { background: var(--accent-emerald); color: white; border-color: var(--accent-emerald); }

  .quick-filter-btn.cross { color: var(--accent-rose); }
  .quick-filter-btn.cross.active { background: var(--accent-rose); color: white; border-color: var(--accent-rose); }

  body.light-mode .quick-filter-btn { background: rgba(99, 102, 241, 0.06); }
  body.light-mode .quick-filter-btn.check { color: #059669; }
  body.light-mode .quick-filter-btn.check.active { background: #059669; color: white; }
  body.light-mode .quick-filter-btn.cross { color: #dc2626; }
  body.light-mode .quick-filter-btn.cross.active { background: #dc2626; color: white; }

  /* ==============================
     PRESET PANEL
     ============================== */
  .preset-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-normal);
  }

  .preset-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    flex-wrap: wrap;
    gap: 12px;
  }

  .preset-header h3 {
    color: var(--accent-purple);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  body.light-mode .preset-header h3 { color: var(--accent-indigo); }

  .preset-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }

  .preset-input {
    flex: 1;
    min-width: 180px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
  }

  .preset-input:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  }

  .preset-input::placeholder { color: var(--text-muted); }

  body.light-mode .preset-input {
    background: rgba(255,255,255,0.8);
    color: var(--text-primary);
    border-color: rgba(139, 92, 246, 0.2);
  }

  .preset-btn {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
  }

  .preset-btn-save { background: linear-gradient(135deg, #10b981, #059669); color: white; }
  .preset-btn-save:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }

  .preset-btn-clear { background: rgba(244, 63, 94, 0.8); color: white; }
  .preset-btn-clear:hover { background: rgba(244, 63, 94, 1); transform: translateY(-1px); }

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

  .preset-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-sm);
    color: var(--accent-purple);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
  }

  .preset-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-color: rgba(139, 92, 246, 0.35);
    transform: translateY(-1px);
  }

  .preset-item.active {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    color: white;
    border-color: var(--accent-purple);
  }

  .preset-delete {
    background: rgba(244, 63, 94, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px; height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
    transition: all var(--transition-fast);
  }

  .preset-delete:hover { background: rgba(244, 63, 94, 1); transform: scale(1.15); }

  body.light-mode .preset-item {
    background: rgba(99, 102, 241, 0.06);
    color: var(--accent-indigo);
    border-color: rgba(139, 92, 246, 0.2);
  }

  body.light-mode .preset-item.active {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    color: white;
  }

  .preset-empty {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    padding: 12px;
    text-align: center;
    width: 100%;
  }

  /* ==============================
     COLUMN TOGGLE PANEL
     ============================== */
  .column-toggle-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--glass-shadow);
  }

  .column-toggle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    flex-wrap: wrap;
    gap: 10px;
  }

  .column-toggle-header h3 {
    color: var(--accent-purple);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
  }

  body.light-mode .column-toggle-header h3 { color: var(--accent-indigo); }

  .column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(139, 92, 246, 0.1);
  }

  body.light-mode .column-grid {
    background: rgba(241, 245, 249, 0.4);
  }

  .column-checkbox-label {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 12px;
    color: var(--text-primary);
    border: 1px solid transparent;
    background: rgba(139, 92, 246, 0.03);
  }

  .column-checkbox-label:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.2);
  }

  .column-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 15px; height: 15px;
    cursor: pointer;
    accent-color: var(--accent-purple);
  }

  body.light-mode .column-checkbox-label { color: var(--text-primary); }

  .toggle-all-btn {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-purple);
  }

  .toggle-all-btn:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(139, 92, 246, 0.35);
    transform: translateY(-1px);
  }

  body.light-mode .toggle-all-btn { color: var(--accent-indigo); }

  .lite-mode-btn {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent-emerald);
  }

  .lite-mode-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.45);
  }

  .lite-mode-btn.active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border-color: #10b981;
  }

  body.light-mode .lite-mode-btn { color: #059669; }

  .fit-screen-btn {
    border-color: rgba(6, 182, 212, 0.3);
    background: rgba(6, 182, 212, 0.08);
    color: #22d3ee;
  }

  .fit-screen-btn:hover {
    background: rgba(6, 182, 212, 0.16);
    border-color: rgba(6, 182, 212, 0.5);
  }

  .fit-screen-btn.active {
    background: linear-gradient(135deg, #06b6d4, #0e7490);
    color: #ffffff;
    border-color: #06b6d4;
  }

  body.light-mode .fit-screen-btn { color: #0e7490; }
  body.light-mode .fit-screen-btn.active { color: #ffffff; }

  /* Saat fit-screen aktif: sembunyikan scrollbar horizontal tabel & beri ruang hasil zoom */
  body.fit-screen-active #screening-table .tabulator-tableholder .tabulator-table,
  body.fit-screen-active #screening-table .tabulator-tableholder .tabulator-table {
    transform-origin: top left;
    will-change: transform;
  }
  body.fit-screen-active #screening-table .tabulator-tableholder {
    overflow-x: hidden !important;
  }

  /* ==============================
     STATS DASHBOARD
     ============================== */
  .stats-dashboard {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--glass-shadow);
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
  }

  .stat-card {
    background: linear-gradient(135deg, var(--card-gradient-start), var(--card-gradient-end));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
  }

  .stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--accent-indigo), var(--accent-purple));
    opacity: 0.5;
  }

  .stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.35);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
  }

  body.light-mode .stat-card { background: linear-gradient(135deg, rgba(99, 102, 241, 0.04), rgba(139, 92, 246, 0.04)); }

  .stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--accent-purple);
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    line-height: 1.2;
  }

  body.light-mode .stat-value { color: var(--accent-indigo); }

  .stat-subtext {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
  }

  .lite-stats-placeholder {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.06);
    color: var(--accent-emerald);
    font-size: 12px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  body.light-mode .lite-stats-placeholder { background: rgba(16, 185, 129, 0.05); }

  .lite-stats-btn {
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.1);
    color: inherit;
    border-radius: var(--radius-sm);
    font-size: 11px;
    padding: 6px 10px;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
  }

  /* ==============================
     WATCHLIST TOGGLE
     ============================== */
  .watchlist-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid rgba(251, 191, 36, 0.25);
    background: rgba(251, 191, 36, 0.08);
    color: var(--accent-amber);
  }

  .watchlist-toggle:hover {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.4);
    transform: translateY(-1px);
  }

  .watchlist-toggle.active {
    background: linear-gradient(135deg, var(--accent-amber), #d97706);
    color: white;
    border-color: var(--accent-amber);
  }

  .favorite-star {
    cursor: pointer;
    font-size: 15px;
    transition: all var(--transition-fast);
    display: inline-block;
  }

  .favorite-star:hover { transform: scale(1.3); }
  .favorite-star.active { color: var(--accent-amber); text-shadow: 0 0 8px rgba(251, 191, 36, 0.5); }

  /* ==============================
     STOCK LOGO (foto saham di kolom Saham)
     ============================== */
  .stock-logo-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
  }

  .stock-logo-img {
    width: 24px;
    height: 24px;
    min-width: 24px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 2px;
    transition: transform 0.15s ease;
    vertical-align: middle;
  }

  .stock-logo-ticker {
    font-weight: 700;
    color: var(--body);
    text-decoration: none;
    letter-spacing: 0.02em;
  }

  .stock-logo-ticker:hover {
    color: var(--accent-cyan);
    text-decoration: underline;
  }

  /* ==============================
     RETEST / BACKTESTING
     ============================== */
  .retest-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 10px;
    background: linear-gradient(135deg, var(--accent-amber), #d97706);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    line-height: 1.2;
    text-align: center;
    min-width: 75px;
  }

  .tabulator-row.retest-highlight {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.12)) !important;
    border-left: 4px solid var(--accent-amber) !important;
  }

  body.light-mode .tabulator-row.retest-highlight {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), rgba(217, 119, 6, 0.08)) !important;
  }

  .tabulator-row.retest-highlight:hover {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.15)) !important;
  }

  /* ==============================
     CHART PANEL
     ============================== */
  .chart-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--glass-shadow);
  }

  .chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    flex-wrap: wrap;
    gap: 10px;
  }

  .chart-header h3 {
    color: var(--accent-purple);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  body.light-mode .chart-header h3 { color: var(--accent-indigo); }

  .chart-container {
    position: relative;
    height: 420px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    padding: 16px;
  }

  body.light-mode .chart-container { background: rgba(241, 245, 249, 0.4); }

  .chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .chart-grid .chart-container { height: 340px; }

  @media (max-width: 1024px) {
    .chart-grid { grid-template-columns: 1fr; }
  }

  .chart-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(139, 92, 246, 0.15);
  }

  .chart-info-item {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
  }

  body.light-mode .chart-info-item { background: rgba(99, 102, 241, 0.04); }

  .chart-info-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  .chart-info-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-purple);
  }

  body.light-mode .chart-info-value { color: var(--accent-indigo); }

  /* ==============================
     SECTOR MODAL
     ============================== */
  .sector-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9998;
    display: none;
    animation: fadeIn 0.2s ease;
  }

  .sector-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    display: none;
    animation: scaleIn 0.2s ease;
  }

  .sector-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  }

  .sector-modal-header h2 {
    color: var(--accent-purple);
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  body.light-mode .sector-modal-header h2 { color: var(--accent-indigo); }

  .sector-modal-close {
    background: rgba(244, 63, 94, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 34px; height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all var(--transition-fast);
  }

  .sector-modal-close:hover { background: rgba(244, 63, 94, 1); transform: scale(1.1); }

  /* ==============================
     TRADINGVIEW CHART MODAL
     ============================== */
  .tv-chart-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9998;
    display: none;
    animation: fadeIn 0.2s ease;
  }

  .tv-chart-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 95vw;
    max-width: 1400px;
    height: 90vh;
    max-height: 90vh;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
    display: none;
    animation: scaleIn 0.2s ease;
    flex-direction: column;
  }

  .tv-chart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    flex-shrink: 0;
  }

  .tv-chart-modal-header h2 {
    color: var(--accent-purple);
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  body.light-mode .tv-chart-modal-header h2 { color: var(--accent-indigo); }

  .tv-chart-modal-body {
    flex: 1;
    min-height: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #0f172a;
  }

  .sector-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
  }

  .sector-stat-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.06));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
  }

  .sector-stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  .sector-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-purple);
  }

  body.light-mode .sector-stat-value { color: var(--accent-indigo); }

  .stock-list { display: grid; gap: 10px; }

  .stock-item {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition-fast);
    cursor: pointer;
  }

  body.light-mode .stock-item { background: rgba(248, 250, 252, 0.85); }

  .stock-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateX(4px);
  }

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

  .stock-ticker {
    font-size: 17px;
    font-weight: 700;
    color: var(--accent-purple);
  }

  body.light-mode .stock-ticker { color: var(--accent-indigo); }

  .stock-change {
    font-size: 14px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
  }

  .stock-change.positive { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
  .stock-change.negative { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }

  .stock-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
  }

  /* ==============================
     DOCUMENTATION MODAL
     ============================== */
  .doc-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 850px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    animation: scaleIn 0.25s ease;
  }

  body.light-mode .doc-modal {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  }

  .doc-modal h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .doc-modal h3 {
    color: var(--accent-purple);
    font-size: 16px;
    font-weight: 600;
    margin-top: 18px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  body.light-mode .doc-modal h3 { color: var(--accent-indigo); }

  .doc-modal p, .doc-modal li {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 6px;
  }

  .doc-modal ul { margin-left: 18px; margin-bottom: 14px; }

  .doc-modal .doc-section {
    background: rgba(139, 92, 246, 0.04);
    border-left: 3px solid var(--accent-purple);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
  }

  body.light-mode .doc-modal .doc-section { background: rgba(139, 92, 246, 0.05); }

  .doc-modal .close-btn {
    background: linear-gradient(135deg, var(--accent-rose), #e11d48);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 20px;
    width: 100%;
  }

  .doc-modal .close-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3); }

  /* ==============================
     DEFAULT CHART SETTINGS MODAL
     ============================== */
  .default-chart-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-xl);
    padding: 28px;
    min-width: 320px;
    max-width: 400px;
    z-index: 10002;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.2s ease;
  }

  body.light-mode .default-chart-modal {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  }

  .default-chart-modal h3 {
    color: var(--accent-purple);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  }

  body.light-mode .default-chart-modal h3 { color: var(--accent-indigo); }

  .default-chart-option {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.15);
  }

  .default-chart-option:hover {
    background: rgba(99, 102, 241, 0.1);
  }

  .default-chart-option.active {
    border-color: var(--accent-purple);
    background: rgba(99, 102, 241, 0.15);
  }

  .default-chart-option input[type="radio"] {
    margin-right: 12px;
    width: 18px; height: 18px;
    accent-color: var(--accent-purple);
  }

  .default-chart-option label {
    cursor: pointer;
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
  }

  .default-chart-option .option-desc {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    display: block;
    margin-top: 2px;
  }

  /* ==============================
     FEATURE PANEL
     ============================== */
  .feature-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--glass-shadow);
    display: none;
    animation: slideUp 0.3s ease;
  }

  .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    flex-wrap: wrap;
    gap: 8px;
  }

  .panel-header h3 {
    color: var(--accent-purple);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  body.light-mode .panel-header h3 { color: var(--accent-indigo); }

  /* ==============================
     TRADING DIARY
     ============================== */
  .diary-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(99, 102, 241, 0.06));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    padding: 18px;
    transition: all var(--transition-fast);
  }

  .diary-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
  }

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

  .diary-ticker { font-size: 18px; font-weight: 700; color: var(--accent-indigo); }

  .diary-type {
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
  }

  .diary-type.buy { background: rgba(34, 197, 94, 0.15); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.3); }
  .diary-type.sell { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }
  .diary-type.note { background: rgba(168, 85, 247, 0.15); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); }

  .diary-card-note {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.05), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(168, 85, 247, 0.2);
  }

  .diary-card-journal {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05), rgba(8, 145, 178, 0.05));
    border: 1px solid rgba(6, 182, 212, 0.2);
  }

  .diary-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 10px;
  }

  .diary-field-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
  }

  .diary-field-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
  }

  .diary-notes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(139, 92, 246, 0.15);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
  }

  .diary-actions { margin-top: 14px; display: flex; gap: 8px; }

  .diary-btn {
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
  }

  .diary-btn-edit { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }
  .diary-btn-edit:hover { background: rgba(59, 130, 246, 0.25); }

  .diary-btn-delete { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }
  .diary-btn-delete:hover { background: rgba(244, 63, 94, 0.25); }

  /* ==============================
     TOP MOVERS
     ============================== */
  .movers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
  }

  .mover-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(139, 92, 246, 0.06));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
  }

  .mover-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-purple);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mover-list { display: flex; flex-direction: column; gap: 6px; }

  .mover-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(30, 41, 59, 0.4);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
  }

  body.light-mode .mover-item { background: rgba(248, 250, 252, 0.85); }

  .mover-item:hover {
    background: rgba(99, 102, 241, 0.12);
    transform: translateX(4px);
  }

  .mover-rank {
    width: 22px; height: 22px;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
  }

  .mover-info { flex: 1; margin-left: 10px; min-width: 0; }
  .mover-ticker { font-size: 13px; font-weight: 700; color: var(--accent-purple); }
  body.light-mode .mover-ticker { color: var(--accent-indigo); }
  .mover-sector { font-size: 10px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mover-value { font-size: 14px; font-weight: 700; text-align: right; flex-shrink: 0; }

  /* ==============================
     CALCULATOR
     ============================== */
  .calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  @media (max-width: 768px) {
    .calculator-grid { grid-template-columns: 1fr; }
  }

  .calculator-input-group { margin-bottom: 14px; }

  .calculator-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  .calculator-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    transition: all var(--transition-fast);
  }

  body.light-mode .calculator-input {
    background: rgba(255,255,255,0.8);
    color: var(--text-primary);
  }

  .calculator-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  }

  .calculator-result {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.12));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    padding: 18px;
    text-align: center;
  }

  .calculator-result-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.3px;
  }

  .calculator-result-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-purple);
    margin-bottom: 6px;
  }

  body.light-mode .calculator-result-value { color: var(--accent-indigo); }

  .calculator-verdict {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-block;
  }

  .verdict-good { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
  .verdict-medium { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
  .verdict-poor { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }

  /* ==============================
     SECTOR ROTATION
     ============================== */
  .rotation-chart { position: relative; height: 380px; }

  .sector-performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 18px;
  }

  .sector-perf-card {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-sm);
    padding: 12px;
    transition: all var(--transition-fast);
  }

  body.light-mode .sector-perf-card { background: rgba(248, 250, 252, 0.7); }

  .sector-perf-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
  }

  .sector-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-purple);
    margin-bottom: 6px;
  }

  body.light-mode .sector-name { color: var(--accent-indigo); }

  .sector-change-bar {
    height: 6px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
  }

  .sector-change-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
  }

  .sector-stats {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
  }

  .sector-count { color: var(--text-muted); }
  .sector-avg { font-weight: 700; }

  /* ==============================
     EXPORT MODAL
     ============================== */
  .export-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 18px;
  }

  .export-option {
    padding: 16px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
  }

  body.light-mode .export-option { background: rgba(248, 250, 252, 0.7); }

  .export-option:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(139, 92, 246, 0.35);
    transform: translateY(-2px);
  }

  .export-icon { font-size: 28px; margin-bottom: 6px; }

  .export-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-purple);
  }

  body.light-mode .export-title { color: var(--accent-indigo); }

  /* ==============================
     RESPONSIVE — MOBILE FIRST
     ============================== */

  /* Touch-friendly minimums */
  .btn, .preset-btn, .toggle-all-btn, .watchlist-toggle,
  .watchlist-settings-btn, .watchlist-mode-btn, .diary-btn {
    min-height: 36px;
  }
  .btn-sm { min-height: 30px; }

  /* Table horizontal scroll container */
  #screening-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tabulator {
    min-width: 600px;
  }
  .tabulator .tabulator-tableHolder {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .tabulator-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Responsive font sizing for stat values */
  .stat-value {
    font-size: clamp(18px, 4vw, 26px);
  }
  .calculator-result-value {
    font-size: clamp(22px, 5vw, 28px);
  }

  @media (max-width: 900px) {
    body { padding: 12px !important; }

    .header-card { padding: 16px; }
    .header-card h1 { font-size: 20px !important; }
    .header-card .flex { flex-direction: column; align-items: flex-start !important; }
    .header-card .text-right { width: 100%; }
    .header-card .text-right > div { justify-content: flex-start !important; flex-wrap: wrap; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }

    .chart-grid { grid-template-columns: 1fr; }
    .chart-container { height: 260px; }
    .chart-grid .chart-container { height: 260px; }
    .rotation-chart { height: 280px; }

    .movers-grid { grid-template-columns: 1fr; }
    .export-options { grid-template-columns: 1fr; }

    .preset-panel, .column-toggle-panel, .stats-dashboard { padding: 16px; }
    .preset-controls { flex-direction: column; }
    .preset-input { min-width: auto; }
    .preset-header { flex-direction: column; align-items: flex-start; }

    .filter-modal { min-width: auto; width: 92%; max-width: 400px; padding: 16px; }
    .filter-modal-buttons { flex-direction: column; }
    .filter-modal-buttons button { width: 100%; }

    .sector-modal { padding: 16px; max-height: 90vh; width: 95%; }
    .sector-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .sector-stat-card { padding: 10px; }

    .diary-info { grid-template-columns: 1fr; }

    .login-box { padding: 32px 20px; max-width: 360px; }
    .login-box h2 { font-size: 22px; }

    .doc-modal { padding: 20px; max-width: 95vw; max-height: 85vh; }

    #checkbox-container { max-height: 200px; }

    .tv-chart-modal { padding: 16px; }
    .tv-chart-modal-header h2 { font-size: 16px; }
    .tv-chart-modal-body { min-height: 300px; }

    .watchlist-modal { padding: 16px; }
    .watchlist-modal-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .watchlist-modal-header > div { width: 100%; justify-content: flex-start; }
    .watchlist-condition-grid { grid-template-columns: 1fr; }
    .watchlist-columns-grid { grid-template-columns: repeat(2, 1fr); }

    .calculator-grid { grid-template-columns: 1fr; }
    .sector-performance-grid { grid-template-columns: repeat(2, 1fr); }

    .header-card .flex.items-center.justify-between > div:first-child { width: 100%; }
    .header-card .mt-4 .flex.items-center.gap-4 { flex-direction: column; align-items: stretch; gap: 8px; }
    .header-card .mt-4 .flex.items-center.gap-4 > * { width: 100%; }
    .header-card .mt-4 .flex.items-center.gap-4 select { width: 100%; }
    .header-card .mt-4 .flex.items-center.gap-4 input[type="number"] { width: 100% !important; }
    .header-card .mt-4 .pt-3.flex.items-center.gap-4 { flex-direction: column; align-items: stretch; gap: 8px; }
    .header-card .mt-4 .pt-3.flex.items-center.gap-4 > * { width: 100%; }
    .header-card .mt-4 .pt-3.flex.items-center.gap-4 input[type="number"] { width: 100% !important; }

    .default-chart-modal { min-width: auto; width: 90%; }

    .quick-filter-buttons { flex-wrap: wrap; }
  }

  @media (max-width: 600px) {
    body { padding: 8px !important; }

    .header-card { padding: 12px; border-radius: var(--radius-lg); }
    .header-card h1 { font-size: 17px !important; }
    .header-card .flex.items-center.justify-between > div:first-child > p.text-sm { font-size: 11px; }

    .btn { font-size: 11px; padding: 8px 12px; min-height: 34px; }
    .btn-sm { font-size: 10px; padding: 6px 10px; min-height: 28px; }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-label { font-size: 9px; }
    .stat-value { font-size: clamp(16px, 3.5vw, 22px); }
    .stat-subtext { font-size: 9px; }

    .chart-panel { padding: 14px; }
    .chart-container { height: 220px; padding: 10px; }
    .chart-grid .chart-container { height: 220px; }
    .chart-header h3 { font-size: 14px; }
    .chart-info { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .chart-info-item { padding: 8px; }
    .chart-info-value { font-size: 13px; }

    .preset-panel, .column-toggle-panel, .stats-dashboard { padding: 12px; }
    .preset-header h3 { font-size: 14px; }

    .filter-modal { width: 95%; padding: 14px; max-height: 90vh; top: 50%; left: 50%; transform: translate(-50%, -50%); }
    .filter-modal h4 { font-size: 11px; }

    .sector-modal { padding: 14px; width: 96%; max-height: 92vh; }
    .sector-modal-header h2 { font-size: 17px; }
    .sector-stats { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .sector-stat-value { font-size: 14px; }
    .stock-ticker { font-size: 15px; }

    .tv-chart-modal { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; border-radius: 0; padding: 12px; top: 0; left: 0; transform: none; }
    .tv-chart-modal-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .tv-chart-modal-header h2 { font-size: 14px; }
    .tv-chart-modal-header > div { flex-wrap: wrap; justify-content: flex-start; width: 100%; }
    .tv-chart-modal-body { flex: 1; min-height: 250px; }

    .watchlist-modal { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; border-radius: 0; padding: 12px; top: 0; left: 0; transform: none; }
    .watchlist-modal-header h2 { font-size: 16px; }
    .watchlist-modal-header > div { flex-wrap: wrap; gap: 6px; }
    .watchlist-item-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .watchlist-ticker { font-size: 15px; }
    .watchlist-condition-grid { grid-template-columns: 1fr; }
    .watchlist-columns-grid { grid-template-columns: 1fr 1fr; }

    .watchlist-sort-menu { right: auto; left: 0; min-width: 120px; }
    .watchlist-mode-toggle { width: 100%; }
    .watchlist-mode-btn { flex: 1; text-align: center; font-size: 9px; padding: 4px 6px; }

    .login-box { padding: 28px 16px; max-width: 320px; }
    .login-box h2 { font-size: 20px; margin-bottom: 24px; }
    .login-box input { padding: 12px; font-size: 14px; }
    .login-box button { padding: 12px; font-size: 14px; }

    .retest-badge { font-size: 9px; padding: 4px 8px; min-width: 60px; }
    .retest-badge br { display: none; }

    .preset-list { gap: 6px; }
    .preset-item { font-size: 11px; padding: 6px 10px; }

    .sector-performance-grid { grid-template-columns: 1fr; }

    .watchlist-compact-item { padding: 8px 12px; gap: 8px; }
    .watchlist-compact-ticker { font-size: 12px; min-width: 55px; }

    .column-toggle-header { flex-direction: column; align-items: flex-start; }
    .column-toggle-header h3 { font-size: 14px; }

    .mover-item { padding: 6px 8px; }
    .mover-ticker { font-size: 12px; }
    .mover-value { font-size: 12px; }

    .diary-card { padding: 14px; }
    .diary-header { flex-direction: column; align-items: flex-start; }
    .diary-ticker { font-size: 15px; }
    .diary-actions { flex-direction: column; }
    .diary-actions button { width: 100%; }

    .doc-modal { padding: 16px; max-height: 90vh; }
    .doc-modal h2 { font-size: 18px; }

    .calculator-grid { gap: 12px; }
    .calculator-result { padding: 14px; }
    .calculator-result-value { font-size: clamp(18px, 4.5vw, 22px); }

    .watchlist-modal-close, .sector-modal-close { width: 28px; height: 28px; font-size: 14px; }
    .sector-modal-close { width: 28px; height: 28px; font-size: 14px; }

    .feature-panel { padding: 14px; }
    .panel-header h3 { font-size: 14px; }

    .stock-details { grid-template-columns: 1fr 1fr; gap: 4px; }
    .stock-item { padding: 12px; }

    #checkbox-container { max-height: 180px; }
    .checkbox-container label { padding: 6px 8px !important; font-size: 12px; }

    .watchlist-copy-date-btn { font-size: 10px; padding: 5px 10px; }
    .watchlist-sort-btn { font-size: 10px; padding: 5px 10px; }

    .quick-filter-btn { font-size: 9px; padding: 2px 6px; }

    .glass.rounded-2xl { padding: 12px !important; }
    #screening-table { margin: 0 -4px; }
  }

  @media (max-width: 400px) {
    .stats-grid { grid-template-columns: 1fr; }
    .sector-stats { grid-template-columns: 1fr 1fr; }

    .header-card h1 { font-size: 15px !important; }

    .tv-chart-modal-header h2 { font-size: 12px; }
    .tv-chart-modal-header > div button { font-size: 9px; padding: 4px 8px; }

    .watchlist-columns-grid { grid-template-columns: 1fr; }
    .export-options { gap: 8px; }

    .chart-info { grid-template-columns: 1fr 1fr; }
    .chart-info-item { padding: 6px; }
    .chart-info-value { font-size: 12px; }
  }

  /* Landscape phone optimization */
  @media (max-height: 500px) and (orientation: landscape) {
    .login-box { padding: 20px 16px; max-width: 300px; }
    .login-box h2 { font-size: 18px; margin-bottom: 16px; }
    .login-box input { padding: 8px; margin-bottom: 12px; font-size: 13px; }
    .login-box button { padding: 8px; font-size: 13px; }

    .tv-chart-modal { padding: 8px; }
    .tv-chart-modal-header { margin-bottom: 8px; padding-bottom: 8px; }
    .tv-chart-modal-body { min-height: 180px; }

    .watchlist-modal { padding: 8px; }
    .watchlist-modal-header { margin-bottom: 10px; padding-bottom: 10px; }

    .sector-modal { max-height: 90vh; padding: 12px; }

    .chart-container { height: 180px; }
    .chart-grid .chart-container { height: 180px; }
    .rotation-chart { height: 200px; }
  }

  /* Prevent overflow on very small screens */
  .tabulator-header-filter input { max-width: 100%; box-sizing: border-box; }
  .tabulator-header-filter select { max-width: 100%; box-sizing: border-box; }

  /* Better touch scrolling for modals */
  .sector-modal, .watchlist-modal, .filter-modal,
  .doc-modal, .default-chart-modal, .tv-chart-modal {
    -webkit-overflow-scrolling: touch;
  }

  /* ==============================
     ACTIVE PRESET INDICATOR
     ============================== */
  #active-preset-badge span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
  }

  #active-preset-badge .pulse-dot {
    display: inline-block;
    width: 7px; height: 7px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s infinite;
  }

  /* ==============================
     UTILITY OVERRIDES
     ============================== */

  /* Ensure the #screening-table container has a proper background */
  .glass.rounded-2xl { border-radius: var(--radius-xl) !important; }

  .tabulator-col-title-holder { cursor: default !important; }

  /* ==============================
     WATCHLIST MODAL STYLES
     ============================== */
  .watchlist-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9998;
    display: none;
    animation: fadeIn 0.2s ease;
  }

  .watchlist-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 95vw;
    max-width: 900px;
    max-height: 85vh;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.2s ease;
    display: none;
    flex-direction: column;
  }

  body.light-mode .watchlist-modal {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    border: 1px solid rgba(139, 92, 246, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  }

  .watchlist-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    flex-shrink: 0;
  }

  .watchlist-modal-header h2 {
    color: var(--accent-purple);
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  body.light-mode .watchlist-modal-header h2 { color: var(--accent-indigo); }

  .watchlist-modal-close {
    background: rgba(244, 63, 94, 0.8);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .watchlist-modal-close:hover { background: rgba(244, 63, 94, 1); transform: scale(1.1); }

  .watchlist-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
  }

  .watchlist-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
  }

  .watchlist-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
  }

  .watchlist-empty-text {
    font-size: 16px;
    margin-bottom: 8px;
  }

  .watchlist-empty-hint {
    font-size: 13px;
    color: var(--text-muted);
  }

  .watchlist-simple-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    transition: all var(--transition-fast);
  }

  .watchlist-simple-ticker {
    font-weight: 700;
    color: var(--text-primary);
  }

  .watchlist-simple-added {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(139, 92, 246, 0.1);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }

  body.light-mode .watchlist-simple-item {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(139, 92, 246, 0.15);
  }

  .watchlist-simple-item:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateX(4px);
  }

  .watchlist-compact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.12);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
  }

  body.light-mode .watchlist-compact-item {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(139, 92, 246, 0.15);
  }

  .watchlist-compact-item:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateX(4px);
  }

  .watchlist-compact-ticker {
    font-weight: 700;
    color: var(--accent-purple);
    min-width: 70px;
  }

  .watchlist-compact-added {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(139, 92, 246, 0.1);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
  }

  /* Logo saham di watchlist */
  .watchlist-logo-img {
    width: 22px;
    height: 22px;
    min-width: 22px;
    object-fit: contain;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 2px;
    transition: transform 0.15s ease;
    vertical-align: middle;
  }

  .watchlist-logo-lg {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .watchlist-compact-item:hover .watchlist-logo-img,
  .watchlist-simple-item:hover .watchlist-logo-img,
  .watchlist-item:hover .watchlist-logo-img {
    transform: scale(1.2);
  }

  body.light-mode .watchlist-compact-ticker {
    color: var(--accent-indigo);
  }

  .watchlist-compact-close {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    font-weight: 600;
  }

  .watchlist-item {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
  }

  body.light-mode .watchlist-item {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(139, 92, 246, 0.2);
  }

  .watchlist-item:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateX(4px);
  }

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

  .watchlist-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .watchlist-ticker {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-purple);
  }

  body.light-mode .watchlist-ticker { color: var(--accent-indigo); }

  .watchlist-added-date {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(139, 92, 246, 0.1);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
  }

  .watchlist-remove-btn {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    transition: all var(--transition-fast);
  }

  .watchlist-remove-btn:hover {
    background: rgba(244, 63, 94, 0.3);
  }

  .watchlist-condition-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .watchlist-condition-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px;
  }

  body.light-mode .watchlist-condition-box {
    background: rgba(0, 0, 0, 0.05);
  }

  .watchlist-condition-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
  }

  .watchlist-condition-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
  }

  .watchlist-condition-label {
    color: var(--text-secondary);
  }

  .watchlist-condition-value {
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
  }

  .watchlist-condition-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
  }

  .watchlist-condition-change.positive {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
  }

  .watchlist-condition-change.negative {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
  }

  .watchlist-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
  }

  .watchlist-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), transparent);
  }

  .watchlist-divider-icon {
    padding: 0 12px;
    font-size: 14px;
  }

  .watchlist-chart-hint {
    text-align: center;
    padding: 12px;
    color: var(--text-muted);
    font-size: 12px;
  }

  /* Scrollbar styling for watchlist */
  .watchlist-content::-webkit-scrollbar {
    width: 6px;
  }

  .watchlist-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
  }

  .watchlist-content::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
  }

  .watchlist-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
  }

  /* ==============================
     WATCHLIST COLUMN CUSTOMIZATION
     ============================== */
  .watchlist-settings-btn {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .watchlist-settings-btn:hover {
    background: rgba(99, 102, 241, 0.25);
  }

  .watchlist-mode-toggle {
    display: flex;
    gap: 2px;
    background: rgba(0, 0, 0, 0.2);
    padding: 3px;
    border-radius: var(--radius-sm);
  }

  body.light-mode .watchlist-mode-toggle {
    background: rgba(0, 0, 0, 0.08);
  }

  .watchlist-mode-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
  }

  .watchlist-mode-btn:hover {
    color: var(--text-primary);
  }

  .watchlist-mode-btn.active {
    background: var(--accent-purple);
    color: white;
  }

  body.light-mode .watchlist-mode-btn.active {
    background: var(--accent-indigo);
  }

  .watchlist-settings-panel {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
  }

  body.light-mode .watchlist-settings-panel {
    background: rgba(255, 255, 255, 0.9);
  }

  .watchlist-settings-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-purple);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

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

  .watchlist-column-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    cursor: grab;
    transition: all var(--transition-fast);
    font-size: 12px;
    color: var(--text-primary);
  }

  body.light-mode .watchlist-column-item {
    background: rgba(0, 0, 0, 0.05);
  }

  .watchlist-column-item:hover {
    background: rgba(139, 92, 246, 0.15);
  }

  .watchlist-column-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
  }

  .watchlist-column-item.drag-over {
    border: 2px dashed var(--accent-purple);
    background: rgba(139, 92, 246, 0.1);
  }

  .watchlist-column-item .drag-handle {
    color: var(--text-muted);
    font-size: 14px;
  }

  .watchlist-column-item input[type="checkbox"] {
    accent-color: var(--accent-purple);
    width: 14px;
    height: 14px;
  }

  .watchlist-column-item label {
    cursor: pointer;
    flex: 1;
    font-size: 11px;
  }

  .watchlist-reset-btn {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: 12px;
  }

  .watchlist-reset-btn:hover {
    background: rgba(244, 63, 94, 0.25);
  }

  /* ==============================
     WATCHLIST SORT DROPDOWN
     ============================== */
  .watchlist-sort-dropdown {
    position: relative;
    display: inline-block;
  }

  .watchlist-sort-btn {
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-amber);
    border: 1px solid rgba(251, 191, 36, 0.25);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .watchlist-sort-btn:hover {
    background: rgba(251, 191, 36, 0.25);
    border-color: rgba(251, 191, 36, 0.4);
  }

  .watchlist-sort-btn.active {
    background: linear-gradient(135deg, var(--accent-amber), #d97706);
    color: white;
    border-color: var(--accent-amber);
  }

  .watchlist-sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: rgba(30, 41, 59, 0.98);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-sm);
    padding: 6px 0;
    min-width: 140px;
    z-index: 100;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }

  body.light-mode .watchlist-sort-menu {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(139, 92, 246, 0.2);
  }

  .watchlist-sort-menu.show {
    display: block;
  }

  .watchlist-sort-option {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .watchlist-sort-option:hover {
    background: rgba(139, 92, 246, 0.15);
  }

  .watchlist-sort-option.active {
    color: var(--accent-purple);
    font-weight: 600;
  }

  body.light-mode .watchlist-sort-option.active {
    color: var(--accent-indigo);
  }

  /* ==============================
     WATCHLIST COPY BY DATE BUTTONS
     ============================== */
  .watchlist-copy-date-btn {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
  }

  .watchlist-copy-date-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
  }

  body.light-mode .watchlist-copy-date-btn {
    color: #2563eb;
  }

  /* ==============================
     BID OFFER PANEL (Stockbit Orderbook)
     Ditampilkan di sisi kanan chart (tv-chart-modal)
     ============================== */

  /* Layout modal: chart kiri, bid-offer kanan */
  .tv-chart-modal-body {
    display: flex;
    gap: 12px;
    padding: 0;
    background: transparent;
  }

  .tv-chart-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #0f172a;
  }

  body.light-mode .tv-chart-main {
    background: #ffffff;
    border: 1px solid rgba(139, 92, 246, 0.15);
  }

  /* Panel kanan (Bid Offer | Funda Chart) */
  .side-panel {
    width: 380px;
    flex-shrink: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    overflow: hidden;
  }

  body.light-mode .side-panel {
    background: #ffffff;
    border-color: rgba(139, 92, 246, 0.2);
  }

  /* Tab bar */
  .side-panel-tabs {
    display: flex;
    flex-shrink: 0;
    padding: 6px;
    gap: 4px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  }

  body.light-mode .side-panel-tabs { background: #f1f5f9; }

  .side-panel-tab {
    flex: 1;
    padding: 7px 8px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
  }

  .side-panel-tab:hover {
    color: var(--text-secondary);
    background: rgba(139, 92, 246, 0.1);
  }

  .side-panel-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.35);
  }

  body.light-mode .side-panel-tab.active { color: #fff; }

  .bid-offer-panel,
  .funda-chart-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
  }

  .bid-offer-panel::-webkit-scrollbar,
  .funda-chart-panel::-webkit-scrollbar { width: 6px; }
  .bid-offer-panel::-webkit-scrollbar-track,
  .funda-chart-panel::-webkit-scrollbar-track { background: transparent; }
  .bid-offer-panel::-webkit-scrollbar-thumb,
  .funda-chart-panel::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.4); border-radius: 3px; }

  /* Loading / Error state */
  .bid-offer-loading,
  .bid-offer-error {
    height: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 13px;
  }

  .bid-offer-error p { color: #f87171; text-align: center; padding: 0 16px; }

  .bid-offer-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: bo-spin 0.8s linear infinite;
  }

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

  /* Card utama */
  .bid-offer-card {
    display: flex;
    flex-direction: column;
    font-size: 12px;
  }

  /* Header */
  .bo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    background: rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 2;
  }

  body.light-mode .bo-header { background: #f8fafc; }

  .bo-header-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
  }

  body.light-mode .bo-header-title { color: var(--accent-indigo); }

  .bo-header-fd {
    display: flex;
    gap: 10px;
    font-size: 10px;
    white-space: nowrap;
  }

  .bo-foreign { color: #22c55e; }
  .bo-domestic { color: #3b82f6; }

  /* Stats Row */
  .bo-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.12);
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
  }

  body.light-mode .bo-stats { background: #f8fafc; }

  .bo-stat { text-align: center; min-width: 0; }
  .bo-stat-label {
    font-size: 9px;
    color: var(--text-primary);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  .bo-stat-value {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
  }
  body.light-mode .bo-stat-value { color: #0f172a; }

  .bo-pressure {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
  }
  .bo-pressure-diff {
    font-size: 9px;
    color: var(--text-primary);
    margin-top: 1px;
  }

  /* Depth grid — 6 kolom konsisten */
  .bo-depth-header,
  .bo-row,
  .bo-summary {
    display: grid;
    grid-template-columns: 44px 52px 1fr 1fr 52px 44px;
    gap: 4px;
    align-items: center;
  }

  .bo-depth-header {
    padding: 6px 10px;
    font-size: 9px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }

  .bo-row {
    padding: 2px 10px;
    transition: background var(--transition-fast);
  }
  .bo-row:hover { background: rgba(139, 92, 246, 0.08); }

  .bo-freq { text-align: center; font-size: 10px; color: var(--text-primary); }
  .bo-lot { text-align: center; font-size: 10px; color: var(--text-primary); white-space: nowrap; }

  /* Bid cell: bar hijau kiri + harga */
  .bo-bid {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
  }
  .bo-bar {
    height: 18px;
    border-radius: 2px;
    flex-shrink: 0;
    transition: width 0.3s ease;
  }
  .bo-bar-bid {
    background: linear-gradient(to right, rgba(34, 197, 94, 0.35), rgba(34, 197, 94, 0.08));
    margin-right: 4px;
  }
  .bo-price {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
  }
  .bo-price-bid { color: #22c55e; }

  /* Offer cell: harga merah + bar kanan */
  .bo-offer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
  }
  .bo-bar-offer {
    background: linear-gradient(to left, rgba(239, 68, 68, 0.35), rgba(239, 68, 68, 0.08));
    margin-left: 4px;
  }
  .bo-price-offer { color: #ef4444; }

  /* Summary row */
  .bo-summary {
    padding: 6px 10px 8px;
    border-top: 1px solid rgba(139, 92, 246, 0.15);
    font-size: 10px;
    font-weight: 700;
  }

  /* Responsive: tumpuk di layar kecil */
  @media (max-width: 1024px) {
    .side-panel { width: 320px; }
  }

  @media (max-width: 768px) {
    .tv-chart-modal-body {
      flex-direction: column;
    }
    .tv-chart-main {
      min-height: 40vh;
    }
    .side-panel {
      width: 100%;
      max-height: 45vh;
    }
  }

  /* ==============================
     FUNDA CHART (Shareholders vs Price)
     Ditampilkan di tab "Funda Chart" pada side panel
     ============================== */

  .funda-card {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    padding: 12px;
    gap: 10px;
    min-height: 100%;
  }

  /* Header */
  .funda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .funda-header-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
  }

  body.light-mode .funda-header-title { color: var(--accent-indigo); }

  .funda-timeframe {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
  }

  /* Stat cards — 2 kolom */
  .funda-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .funda-stat-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.12);
    min-width: 0;
  }

  body.light-mode .funda-stat-card { background: #f8fafc; }

  .funda-stat-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }

  .funda-stat-value {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
  }

  body.light-mode .funda-stat-value { color: #0f172a; }

  .funda-stat-value.funda-sh { color: #06b6d4; }
  .funda-stat-value.funda-price { color: #f59e0b; }

  .funda-stat-change {
    font-size: 10px;
    font-weight: 700;
  }

  .funda-up { color: #22c55e; }
  .funda-down { color: #ef4444; }

  /* Legend toggles */
  .funda-toggles {
    display: flex;
    gap: 14px;
    align-items: center;
  }

  .funda-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
  }

  .funda-toggle input[type="checkbox"] {
    width: 13px;
    height: 13px;
    accent-color: var(--accent-purple);
    cursor: pointer;
  }

  .funda-toggle-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
  }

  .funda-toggle-sh-dot { background: #06b6d4; }
  .funda-toggle-price-dot { background: #f59e0b; }

  /* Chart box */
  .funda-chart-box {
    width: 100%;
    height: 280px;
    min-height: 280px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(139, 92, 246, 0.15);
    background: rgba(15, 23, 42, 0.6);
    overflow: hidden;
  }

  body.light-mode .funda-chart-box { background: #f8fafc; }

  .funda-info {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
  }

  /* Retry button */
  .funda-retry-btn {
    padding: 7px 18px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-indigo));
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--transition-fast);
  }

  .funda-retry-btn:hover { opacity: 0.85; }
