:root {
  --bg: #0a0e1a;
  --bg2: #111827;
  --bg3: #1a2235;
  --border: #1e2d42;
  --accent: #00d4aa;
  --accent2: #00b894;
  --danger: #ff4757;
  --warn: #ffa502;
  --text: #e2e8f0;
  --muted: #8892a4;
  --green: #00d4aa;
  --red: #ff4757;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
a { text-decoration: none; color: inherit; }
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(10,14,26,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 0 1.5rem; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-size: 1.3rem; font-weight: 800; color: var(--accent); letter-spacing: -0.5px; }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav-links a { color: var(--muted); font-size: .9rem; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .6rem 1.4rem; border-radius: 8px; font-size: .9rem; font-weight: 600; border: none; cursor: pointer; transition: all .2s; }
.btn-primary { background: var(--accent); color: #0a0e1a; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: #0a0e1a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: .4rem .9rem; font-size: .82rem; }
.btn-lg { padding: .8rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 1.5rem; }
.form-group { margin-bottom: 1.2rem; }
.form-label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .4rem; font-weight: 500; }
.form-input { width: 100%; padding: .7rem 1rem; background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: .95rem; outline: none; transition: border-color .2s; }
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-green { background: #00d4aa1a; color: var(--green); border: 1px solid #00d4aa33; }
.badge-red { background: #ff47571a; color: var(--red); border: 1px solid #ff475733; }
.badge-warn { background: #ffa5021a; color: var(--warn); border: 1px solid #ffa50233; }
.badge-muted { background: var(--bg3); color: var(--muted); border: 1px solid var(--border); }
.toggle { position: relative; width: 52px; height: 28px; }
.toggle input { display: none; }
.toggle-slider { position: absolute; inset: 0; background: var(--bg3); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; transition: .3s; }
.toggle-slider::before { content: ''; position: absolute; width: 20px; height: 20px; background: var(--muted); border-radius: 50%; top: 3px; left: 3px; transition: .3s; }
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { background: #0a0e1a; transform: translateX(24px); }
.app-layout { display: flex; min-height: 100vh; padding-top: 60px; }
.sidebar { width: 220px; background: var(--bg2); border-right: 1px solid var(--border); padding: 1.5rem 1rem; position: fixed; top: 60px; bottom: 0; overflow-y: auto; }
.sidebar-link { display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem; border-radius: 10px; color: var(--muted); font-size: .9rem; font-weight: 500; transition: all .2s; margin-bottom: .2rem; }
.sidebar-link:hover,.sidebar-link.active { background: var(--bg3); color: var(--text); }
.sidebar-link.active { color: var(--accent); }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.main-content { margin-left: 220px; flex: 1; padding: 1.5rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 1.1rem 1.25rem; }
.stat-label { font-size: .78rem; color: var(--muted); margin-bottom: .3rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-value.green { color: var(--green); }
.stat-value.red { color: var(--red); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; padding: .75rem 1rem; color: var(--muted); font-weight: 600; font-size: .8rem; border-bottom: 1px solid var(--border); }
td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }
.section-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.alert { padding: .75rem 1rem; border-radius: 10px; font-size: .88rem; margin-bottom: 1rem; }
.alert-error { background: #ff47571a; border: 1px solid #ff475733; color: #ff6b7a; }
.alert-success { background: #00d4aa1a; border: 1px solid #00d4aa33; color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-red { background: var(--red); }
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-box { width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo h1 { font-size: 2rem; font-weight: 800; color: var(--accent); }
.auth-logo p { color: var(--muted); font-size: .9rem; margin-top: .25rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: .88rem; color: var(--muted); }
.auth-footer a { color: var(--accent); }
.spinner { width: 18px; height: 18px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.pos-side.long { color: var(--green); font-weight: 700; }
.pos-side.short { color: var(--red); font-weight: 700; }
.pnl-pos { color: var(--green); font-weight: 600; }
.pnl-neg { color: var(--red); font-weight: 600; }
.mobile-menu-btn { background: none; border: none; color: var(--text); cursor: pointer; padding: .25rem; display: none; }
.mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 49; display: none; }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s; z-index: 50; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 1rem; }
  .mobile-menu-btn { display: flex; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .hide-mobile { display: none; }
}
