/* ══════════════════════════════════════════════════════════════
   Copy Trading module — reuses the base design tokens defined in
   css/base-tokens-layout.css (--bg*, --glass-*, --border*, --text*,
   --green/red/blue/gold, --r-*, --shadow-*). No new tokens introduced.
   ══════════════════════════════════════════════════════════════ */

.ct-wrap { display: flex; flex-direction: column; gap: 20px; }

/* Sub-nav tabs: Overview / Masters / Slaves / Active Copies / Trade Activity / Risk Controls / Logs / Settings */
.ct-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 4px;
}
.ct-tab {
  padding: 9px 16px; border-radius: var(--r-md); font-size: 13px; font-weight: 600;
  color: var(--text2); cursor: pointer; transition: all .15s ease; white-space: nowrap;
}
.ct-tab:hover { color: var(--text); background: var(--glass-1); }
.ct-tab.active { color: var(--text); background: var(--glass-3); box-shadow: var(--shadow-xs); }

/* Widget grid (Overview) */
.ct-widget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.ct-widget {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px;
}
.ct-widget-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text3); margin-bottom: 8px; }
.ct-widget-value { font-size: 26px; font-weight: 700; color: var(--text); }
.ct-widget-value.pos { color: var(--green); }
.ct-widget-value.neg { color: var(--red); }
.ct-widget-value.warn { color: var(--gold); }

/* Account cards (Masters / Slaves) */
.ct-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ct-card {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; display: flex; flex-direction: column; gap: 10px; position: relative;
}
.ct-card-head { display: flex; align-items: center; justify-content: space-between; }
.ct-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.ct-card-sub { font-size: 12px; color: var(--text3); }

.ct-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.ct-status-dot.connected, .ct-status-dot.live { background: var(--green); box-shadow: 0 0 8px var(--green-glow); }
.ct-status-dot.disconnected, .ct-status-dot.paused { background: var(--text3); }
.ct-status-dot.degraded, .ct-status-dot.reconnecting { background: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.ct-status-dot.error { background: var(--red); box-shadow: 0 0 8px var(--red-glow); }

.ct-status-badge { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.ct-status-badge.connected, .ct-status-badge.live { color: var(--green); }
.ct-status-badge.disconnected, .ct-status-badge.paused { color: var(--text3); }
.ct-status-badge.degraded, .ct-status-badge.reconnecting { color: var(--gold); }
.ct-status-badge.error { color: var(--red); }

.ct-card-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 12.5px; }
.ct-card-stats div span { display: block; color: var(--text3); font-size: 10.5px; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 2px; }
.ct-card-stats div b { color: var(--text); font-weight: 600; }

.ct-card-actions { display: flex; gap: 8px; margin-top: 4px; }

/* Buttons (reuse existing button look via glass background) */
.ct-btn {
  padding: 8px 14px; border-radius: var(--r-md); font-size: 12.5px; font-weight: 600;
  background: var(--glass-2); border: 1px solid var(--border); color: var(--text);
  cursor: pointer; transition: all .15s ease;
}
.ct-btn:hover { background: var(--glass-3); }
.ct-btn.primary { background: var(--blue); border-color: var(--blue); color: #08121f; }
.ct-btn.primary:hover { filter: brightness(1.08); }
.ct-btn.danger { background: var(--red-dim); border-color: rgba(248,113,113,0.35); color: var(--red); }
.ct-btn.danger:hover { background: rgba(248,113,113,0.22); }
.ct-btn:disabled { opacity: .45; cursor: not-allowed; }

/* Emergency stop banner */
.ct-emergency-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--red-dim); border: 1px solid rgba(248,113,113,0.3); border-radius: var(--r-lg);
  padding: 12px 18px;
}
.ct-emergency-bar b { color: var(--red); }

/* Activity feed */
.ct-feed { display: flex; flex-direction: column; gap: 10px; }
.ct-feed-item {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px 16px; font-size: 13px;
}
.ct-feed-time { color: var(--text3); font-size: 11px; margin-bottom: 4px; }
.ct-feed-master { font-weight: 700; color: var(--text); }
.ct-feed-slaves { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.ct-feed-slave-row { display: flex; align-items: center; gap: 6px; color: var(--text2); }
.ct-feed-slave-row.ok::before { content: '✓'; color: var(--green); }
.ct-feed-slave-row.fail::before { content: '⚠'; color: var(--red); }

/* Empty state */
.ct-empty {
  text-align: center; padding: 48px 20px; color: var(--text3); font-size: 13.5px;
  background: var(--bg3); border: 1px dashed var(--border); border-radius: var(--r-lg);
}
.ct-empty .ct-btn { margin-top: 14px; }

/* Wizard */
.ct-wizard-steps { display: flex; gap: 6px; margin-bottom: 18px; }
.ct-wizard-step { flex: 1; height: 4px; border-radius: 2px; background: var(--glass-2); }
.ct-wizard-step.done { background: var(--green); }
.ct-wizard-step.active { background: var(--blue); }

.ct-form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ct-form-row label { font-size: 12px; font-weight: 600; color: var(--text2); }
.ct-form-row input, .ct-form-row select {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 9px 12px; color: var(--text); font-size: 13.5px;
}
.ct-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.ct-live-confirm {
  background: var(--gold-glow); border: 1px solid rgba(251,191,36,0.35); border-radius: var(--r-lg);
  padding: 16px 18px;
}
.ct-live-confirm b { color: var(--gold); }

.ct-sim-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--r-full); background: var(--blue-dim); color: var(--blue);
  text-transform: uppercase; letter-spacing: .03em;
}
.ct-live-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--r-full); background: var(--red-dim); color: var(--red);
  text-transform: uppercase; letter-spacing: .03em;
}
