*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #0f1117; color: #e2e8f0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: #1a1d2e; border: 1px solid #2d3148; border-radius: 12px; padding: 40px; width: 340px; text-align: center; }
.login-box h2 { font-size: 1.6rem; margin-bottom: 6px; }
.login-sub { color: #94a3b8; margin-bottom: 24px; }
.login-error { background: #3b1212; color: #f87171; border-radius: 6px; padding: 8px 12px; margin-bottom: 16px; font-size: 0.85rem; }
.login-box input { width: 100%; padding: 10px 14px; margin-bottom: 12px; background: #0f1117; border: 1px solid #2d3148; border-radius: 8px; color: #e2e8f0; font-size: 0.95rem; }
.login-box button { width: 100%; padding: 10px; background: #4a9eff; border: none; border-radius: 8px; color: #fff; font-size: 1rem; font-weight: 600; cursor: pointer; }
.login-box button:hover { background: #3a8eef; }

/* Sidebar */
.sidebar { position: fixed; left: 0; top: 0; width: 180px; height: 100vh; background: #1a1d2e; border-right: 1px solid #2d3148; display: flex; flex-direction: column; z-index: 100; overflow-y: auto; }
.sidebar-brand { font-size: 1rem; font-weight: 700; color: #e2e8f0; padding: 20px 16px 16px; border-bottom: 1px solid #2d3148; white-space: nowrap; }
.sidebar-links { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; flex: 1; }
.nav-link { color: #94a3b8; text-decoration: none; padding: 9px 12px; border-radius: 6px; font-size: 0.88rem; display: block; white-space: nowrap; }
.nav-link:hover, .nav-link.active { background: #2d3148; color: #e2e8f0; }
.sidebar-footer { padding: 12px 8px; border-top: 1px solid #2d3148; display: flex; flex-direction: column; gap: 2px; }
.nav-logout { color: #64748b; text-decoration: none; font-size: 0.82rem; padding: 7px 12px; border-radius: 6px; display: block; }
.nav-logout:hover { color: #94a3b8; background: #1e2235; }

/* Container */
.container { margin-left: 180px; padding: 24px 32px; }

/* Page header */
.page-header { margin-bottom: 20px; }
.page-header h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: #64748b; font-size: 0.82rem; }

/* Search */
.search-row { display: flex; gap: 10px; margin-bottom: 20px; }
.search-row input { flex: 1; padding: 10px 16px; background: #1a1d2e; border: 1px solid #2d3148; border-radius: 8px; color: #e2e8f0; font-size: 0.95rem; }
.search-row input:focus { outline: none; border-color: #4a9eff; }
.search-row button { padding: 10px 20px; background: #4a9eff; border: none; border-radius: 8px; color: #fff; font-weight: 600; cursor: pointer; }
.search-row button:hover { background: #3a8eef; }

/* Tabs */
.tab-bar { display: flex; gap: 4px; flex-wrap: wrap; }
.tab-btn { background: #1a1d2e; border: 1px solid #2d3148; color: #94a3b8; padding: 6px 14px; cursor: pointer; font-size: 0.85rem; border-radius: 20px; }
.tab-btn:hover { color: #e2e8f0; }
.tab-btn.active { background: #4a9eff; border-color: #4a9eff; color: #fff; font-weight: 600; }

/* Summary cards */
.cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.card { background: #1a1d2e; border: 1px solid #2d3148; border-radius: 10px; padding: 14px; text-align: center; }
.card-label { font-size: 0.72rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }
.card-value { font-size: 1.2rem; font-weight: 700; }

/* Leaderboard table */
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th { text-align: left; padding: 8px 12px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; border-bottom: 1px solid #2d3148; }
.lb-table td { padding: 12px 12px; border-bottom: 1px solid #1e2235; vertical-align: middle; }
.lb-row { cursor: pointer; transition: background 0.1s; }
.lb-row:hover td { background: #1e2235; }
.lb-rank { color: #64748b; font-weight: 700; width: 32px; }
.lb-name { font-weight: 600; font-size: 0.9rem; }
.lb-addr { color: #64748b; font-family: monospace; font-size: 0.75rem; margin-top: 2px; }
.verified-badge { color: #3b82f6; font-size: 0.75rem; margin-left: 4px; }
.x-handle { color: #64748b; font-size: 0.75rem; text-decoration: none; }
.x-handle:hover { color: #94a3b8; }
.star-btn { background: none; border: none; cursor: pointer; color: #475569; font-size: 0.85rem; padding: 0 2px; line-height: 1; transition: color 0.15s; }
.star-btn:hover { color: #f59e0b; }
.star-btn.starred { color: #f59e0b; }
.wl-toggle-btn { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: #f59e0b; padding: 5px 14px; border-radius: 4px; font-size: 0.8rem; cursor: pointer; transition: all 0.15s; }
.wl-toggle-btn:hover { background: rgba(245,158,11,0.2); }
.wl-toggle-btn.starred { background: rgba(245,158,11,0.2); border-color: #f59e0b; }
.lb-pnl { font-weight: 700; font-size: 1rem; }
.lb-meta { color: #94a3b8; font-size: 0.85rem; }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 8px 10px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; border-bottom: 1px solid #2d3148; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid #1e2235; vertical-align: top; line-height: 1.3; }
.data-table tr:hover td { background: #1e2235; }

/* Colours */
.positive { color: #4ade80; }
.negative { color: #f87171; }
.neutral  { color: #94a3b8; }

/* Misc */
.loading { color: #64748b; padding: 40px; text-align: center; line-height: 2; }
.empty { color: #64748b; padding: 24px; text-align: center; font-style: italic; }
.results-label { font-size: 0.8rem; color: #64748b; }
.hidden { display: none; }

/* Sortable column headers */
.lb-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.lb-table th.sortable:hover { color: #e2e8f0; }
.sort-arrow { font-size: 0.65rem; color: #4a6080; margin-left: 3px; }
.sort-arrow.active { color: #4a9eff; }
