  /* ── Bootstrap dark-theme 변수 오버라이드 ── */
  [data-bs-theme="dark"] {
    --bs-body-bg:              #0d1117;
    --bs-body-color:           #e6edf3;
    --bs-border-color:         #21262d;
    --bs-secondary-bg:         #161b22;
    --bs-tertiary-bg:          #161b22;
    --bs-table-color:          #e6edf3;
    --bs-table-bg:             transparent;
    --bs-table-border-color:   #21262d;
    --bs-table-hover-bg:       rgba(88,166,255,.07);
    --bs-table-hover-color:    #e6edf3;
    --bs-form-control-bg:      #21262d;
    --bs-form-control-color:   #e6edf3;
    --bs-input-bg:             #21262d;
    --bs-input-color:          #e6edf3;
    --bs-link-color:           #58a6ff;
  }
  :root {
    --bg: #0d1117; --surface: #161b22; --border: #21262d;
    --text: #e6edf3; --muted: #8b949e; --accent: #58a6ff;
    --green: #3fb950; --red: #f85149; --yellow: #d29922; --purple: #bc8cff;
  }
  * { box-sizing: border-box; }
  body { background: var(--bg) !important; color: var(--text) !important;
         font-family: 'Segoe UI', sans-serif; font-size: 14px; }

  /* 네비 / 탭 */
  .navbar-brand { font-weight: 700; letter-spacing: 1px; color: var(--accent) !important; }
  .nav-tabs .nav-link { color: var(--muted); border: none; padding: 10px 20px; }
  .nav-tabs .nav-link.active { color: var(--accent); border-bottom: 2px solid var(--accent); background: transparent; }
  .nav-tabs { border-bottom: 1px solid var(--border); }

  /* 카드 */
  .card { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: 10px; }
  .card-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; }
  .stat-val { font-size: 26px; font-weight: 700; color: var(--text); }
  .stat-val.green { color: var(--green) !important; }
  .stat-val.red   { color: var(--red)   !important; }

  /* 폼 컨트롤 */
  .form-control, .form-select, input[type=number], input[type=date] {
    background: #21262d !important; border: 1px solid #30363d !important;
    color: var(--text) !important; border-radius: 6px;
  }
  .form-control:focus, .form-select:focus, input:focus {
    background: #21262d !important; color: var(--text) !important;
    border-color: var(--accent) !important; box-shadow: none !important;
  }
  .btn-primary { background: var(--accent) !important; border: none !important; font-weight: 600; color: #0d1117 !important; }
  .btn-primary:hover { background: #79b8ff !important; }
  label, .form-label { color: var(--muted) !important; font-size: 12px; }

  /* 테이블 — Bootstrap dark theme가 대부분 처리, 남은 것만 보정 */
  .table { font-size: 12px; }
  .table td, .table th { color: var(--text) !important; border-color: var(--border) !important; padding: 6px 10px; }
  .table thead th { color: var(--muted) !important; }
  .table-responsive { max-height: 420px; overflow-y: auto; }
  .table-responsive::-webkit-scrollbar { width: 5px; }
  .table-responsive::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

  /* 배지 */
  .badge-win  { background: rgba(63,185,80,.2);   color: var(--green)  !important; padding: 2px 8px; border-radius: 20px; }
  .badge-loss { background: rgba(248,81,73,.2);   color: var(--red)    !important; padding: 2px 8px; border-radius: 20px; }
  .badge-flat { background: rgba(210,153,34,.15); color: var(--yellow) !important; padding: 2px 8px; border-radius: 20px; }
  .badge-reason { background: rgba(88,166,255,.12); color: #8b949e !important; padding: 2px 8px; border-radius: 20px; font-size: 11px; white-space: nowrap; }
  .trade-sort-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
  .trade-sort-bar .trade-sort-label { color: var(--muted); margin-right: 4px; font-weight: 600; }
  .trade-sort-btn { font-size: 11px !important; padding: 2px 8px !important; }
  .trade-sort-btn.active { background: rgba(88,166,255,.22) !important; border-color: var(--accent) !important; color: var(--accent) !important; }

  /* 스피너 */
  .spin-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55);
                  z-index: 9999; align-items: center; justify-content: center; }
  .spin-overlay.show { display: flex; }
  .spinner { width: 48px; height: 48px; border: 4px solid var(--border);
             border-top-color: var(--accent); border-radius: 50%; animation: spin .9s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* 기타 */
  canvas { background: transparent !important; }
  .section-title { font-size: 13px; font-weight: 600; color: var(--muted);
                   text-transform: uppercase; letter-spacing: 1px; margin: 24px 0 12px; }
  input[type=radio] { accent-color: var(--accent); }
  .ratio-bar { height: 8px; border-radius: 4px; background: var(--border); margin-top: 4px; overflow: hidden; }
  .ratio-fill-g { height: 100%; border-radius: 4px 0 0 4px; background: var(--green); display: inline-block; }
  .ratio-fill-r { height: 100%; border-radius: 0 4px 4px 0; background: var(--red);   display: inline-block; float: right; }
  .text-pnl-pos { color: var(--green) !important; }
  .text-pnl-neg { color: var(--red)   !important; }
  /* 파라미터 설명 툴팁 */
  .param-help { font-size: 10px; color: var(--muted); margin-top: 2px; }
  /* 운영 설정 탭 */
  .lc-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 16px;
  }
  .lc-field-label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 2px; }
  .lc-field-hint { font-size: 10px; color: var(--muted); margin-top: 2px; }
  .lc-field-tbl { font-size: 10px; color: #58a6ff; margin-left: 4px; }
  .lc-field-key { font-size: 10px; color: #8b949e; margin-left: 4px; font-weight: normal; }
