* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0a0a14; color: #e0e0e0; }
nav { background: #12122a; border-bottom: 1px solid #1e1e3a; padding: 0 24px; display: flex; align-items: center; gap: 8px; height: 56px; }
nav a { color: #a0a0b0; text-decoration: none; padding: 8px 16px; border-radius: 6px; font-size: 14px; }
nav a:hover, nav a.active { background: #1e1e3a; color: #a78bfa; }
nav .brand { font-weight: 700; font-size: 16px; color: #7c3aed; margin-right: 16px; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-user-info { font-size: 12px; color: #6b7280; display: flex; align-items: center; gap: 6px; }
.nav-user-info .username { color: #a0a0b0; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn { font-size: 12px; color: #6b7280; background: none; border: 1px solid #2a2a4a; padding: 4px 10px; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.logout-btn:hover { color: #ef4444; border-color: #7f1d1d; background: #1e0e0e; }
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.card { background: #12122a; border: 1px solid #1e1e3a; border-radius: 10px; padding: 24px; margin-bottom: 20px; }
.card h2 { font-size: 15px; color: #a78bfa; margin-bottom: 16px; border-bottom: 1px solid #1e1e3a; padding-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.row3 { grid-template-columns: 1fr 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 12px; color: #9ca3af; }
input, select { padding: 8px 12px; background: #0a0a14; border: 1px solid #2a2a4a; border-radius: 6px; color: #e0e0e0; font-size: 14px; outline: none; font-family: inherit; width: 100%; }
input:focus, select:focus { border-color: #7c3aed; }
input.mono { font-family: 'Courier New', monospace; letter-spacing: 0.05em; }
.actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
button { padding: 10px 24px; background: #7c3aed; color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; transition: background 0.2s; }
button:hover { background: #6d28d9; }
button.secondary { background: #1e1e3a; border: 1px solid #2a2a4a; color: #a0a0b0; }
button.secondary:hover { background: #2a2a4a; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.danger { background: #450a0a; border: 1px solid #7f1d1d; }
button.danger:hover { background: #7f1d1d; }
button.success { background: #064e3b; border: 1px solid #065f46; }
button.success:hover { background: #065f46; }
.msg { margin-top: 12px; font-size: 13px; padding: 10px 14px; border-radius: 6px; display: none; }
.msg.ok { background: #064e3b; color: #34d399; display: block; }
.msg.err { background: #450a0a; color: #f87171; display: block; }
.msg.warn { background: #1c2a1a; color: #fb923c; display: block; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-live { background: #450a0a; color: #f87171; }
.badge-paper { background: #1e3a5f; color: #60a5fa; }
.badge-success { background: #064e3b; color: #34d399; }
.badge-pending { background: #3b2a06; color: #fb923c; }
.badge-failed { background: #450a0a; color: #f87171; }
.badge-filled { background: #064e3b; color: #34d399; }
.badge-skipped { background: #1e1e3a; color: #6b7280; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: #6b7280; font-weight: 500; padding: 8px 12px; border-bottom: 1px solid #1e1e3a; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid #1a1a2e; color: #d1d5db; vertical-align: middle; }
tr:hover td { background: #0f0f1e; }
.mono { font-family: 'Courier New', monospace; font-size: 12px; color: #a78bfa; }
.loading { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #6b7280; }
.spinner { width: 16px; height: 16px; border: 2px solid #2a2a4a; border-top-color: #7c3aed; border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #2a2a4a; border-radius: 24px; transition: 0.3s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #6b7280; border-radius: 50%; transition: 0.3s; }
.toggle-switch input:checked + .toggle-slider { background: #7c3aed; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: white; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #12122a; border: 1px solid #1e1e3a; border-radius: 10px; padding: 18px 20px; }
.stat-label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 24px; font-weight: 700; }
.stat-value.green { color: #10b981; }
.stat-value.red { color: #ef4444; }
.stat-value.purple { color: #a78bfa; }
.stat-value.orange { color: #fb923c; }
.stat-sub { font-size: 12px; color: #6b7280; margin-top: 4px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: pulse 2s infinite; margin-right: 4px; }
.live-dot.offline { background: #6b7280; animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-header h1 { font-size: 20px; font-weight: 700; }
.toast { position: fixed; bottom: 24px; right: 24px; z-index: 1000; max-width: 360px; padding: 14px 18px; border-radius: 8px; font-size: 13px; display: none; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.toast.show { display: flex; align-items: flex-start; gap: 10px; }
.toast-title { font-weight: 600; margin-bottom: 2px; }
.pagination { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.pagination button { padding: 6px 14px; font-size: 13px; }
.empty-row td { text-align: center; color: #6b7280; padding: 32px; }
.tag { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.tag-buy { background: #064e3b; color: #34d399; }
.tag-sell { background: #450a0a; color: #f87171; }
