* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0a0e17; color: #e0e6ed; min-height: 100vh; }
.container { max-width: 1300px; margin: 0 auto; padding: 24px 16px; }

header { margin-bottom: 20px; }
.header-row { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
header h1 { font-size: 1.8rem; background: linear-gradient(135deg, #22d3ee, #7b61ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.subtitle { color: #6b7a8d; margin-top: 4px; font-size: 14px; }
.header-links { display: flex; align-items: center; gap: 12px; }
.nav-link { color: #00d4ff; text-decoration: none; font-size: 14px; padding: 6px 14px; border: 1px solid #1e293b; border-radius: 8px; }
.nav-link:hover { background: #111827; }
.poll-status { font-size: 12px; color: #6b7a8d; padding: 4px 10px; background: #111827; border-radius: 12px; }
.poll-status.active { color: #34d399; }

/* Stats */
.stats-panel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: #111827; border: 1px solid #1e293b; border-radius: 12px; padding: 16px 20px; text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: #e0e6ed; }
.stat-green { color: #34d399; }
.stat-yellow { color: #fbbf24; }
.stat-red { color: #f87171; }
.stat-blue { color: #60a5fa; }
.stat-label { font-size: 12px; color: #6b7a8d; margin-top: 4px; }

/* Filters */
.filters-panel { background: #0d1420; border: 1px solid #1e293b; border-radius: 10px; padding: 12px 18px; margin-bottom: 16px; }
.filters-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.filters-row label { font-size: 13px; color: #8b9ab0; display: flex; align-items: center; gap: 6px; }
.filters-row select { background: #1a2332; border: 1px solid #2d3a4a; color: #e0e6ed; padding: 5px 8px; border-radius: 6px; font-size: 13px; cursor: pointer; }

/* Positions */
.positions-panel { background: #111827; border: 1px solid #1e293b; border-radius: 12px; padding: 20px; }
.positions-panel h2 { font-size: 1rem; margin-bottom: 14px; }
.count-badge { background: linear-gradient(135deg, #00d4ff15, #7b61ff15); color: #00d4ff; padding: 2px 10px; border-radius: 12px; font-weight: 700; font-size: 13px; margin-left: 6px; }

.positions-list { display: flex; flex-direction: column; gap: 10px; max-height: 75vh; overflow-y: auto; }
.positions-list::-webkit-scrollbar { width: 6px; }
.positions-list::-webkit-scrollbar-thumb { background: #2d3a4a; border-radius: 3px; }

/* Position card */
.pos-card { background: #0d1420; border: 1px solid #1e293b; border-radius: 10px; padding: 14px 18px; display: grid; grid-template-columns: 1fr auto; gap: 12px; animation: fadeIn 0.3s ease; }
.pos-card.closed { opacity: 0.5; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.pos-main { display: flex; flex-direction: column; gap: 6px; }
.pos-header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pos-pair { font-size: 16px; font-weight: 700; color: #22d3ee; }
.pos-status { font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.pos-status.active { background: #064e3b; color: #34d399; }
.pos-status.closed { background: #450a0a; color: #f87171; }
.pos-status.closing { background: #422006; color: #fbbf24; }
.pos-fee-tier { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: #1e3a5f; color: #60a5fa; font-weight: 700; }

.pos-wallet { font-size: 12px; color: #8b9ab0; }
.pos-wallet a { color: #8b9ab0; text-decoration: none; }
.pos-wallet a:hover { color: #22d3ee; }
.pos-router { margin-top: 2px; }
.router-badge { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: #1a2332; border: 1px solid #2d3a4a; color: #6b7a8d; display: inline-block; }
.router-badge.aggregator { color: #f59e0b; border-color: #f59e0b44; background: #1a1f0a; }

.pos-tokens { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.pos-token-tag { font-size: 11px; background: #1a2332; border: 1px solid #2d3a4a; padding: 2px 6px; border-radius: 6px; color: #8b9ab0; display: inline-flex; align-items: center; gap: 3px; }
.copy-btn { background: none; border: none; cursor: pointer; font-size: 11px; padding: 0 2px; opacity: 0.6; }
.copy-btn:hover { opacity: 1; }

/* Fees section */
.pos-fees { display: flex; flex-direction: column; gap: 6px; text-align: right; min-width: 200px; }
.pos-fee-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.pos-fee-label { color: #6b7a8d; }
.pos-fee-value { font-weight: 600; }
.pos-fee-value.green { color: #34d399; }
.pos-fee-value.yellow { color: #fbbf24; }
.pos-fee-value.blue { color: #60a5fa; }
.pos-fee-value.total { color: #22d3ee; font-size: 14px; }

.pos-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.pos-chain { font-size: 11px; padding: 2px 8px; border-radius: 8px; font-weight: 600; }
.pos-time { font-size: 11px; color: #4a5568; }

/* Chain badges */
.chain-ethereum { background: #1e293b; color: #94a3b8; }
.chain-bsc { background: #422006; color: #fbbf24; }
.chain-base { background: #172554; color: #60a5fa; }
.chain-arbitrum { background: #1e1b4b; color: #818cf8; }
.chain-polygon { background: #3b0764; color: #c084fc; }
.chain-optimism { background: #450a0a; color: #f87171; }

.empty-state { text-align: center; padding: 24px; color: #4a5568; font-size: 14px; }

/* Notification toast */
.toast { position: fixed; top: 20px; right: 20px; background: #064e3b; border: 1px solid #34d399; color: #34d399; padding: 12px 20px; border-radius: 10px; font-size: 14px; z-index: 999; animation: slideIn 0.3s ease; }
.toast.closed { background: #450a0a; border-color: #f87171; color: #f87171; }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 768px) {
  .stats-panel { grid-template-columns: repeat(2, 1fr); }
  .filters-row { flex-direction: column; align-items: flex-start; }
  .pos-card { grid-template-columns: 1fr; }
  .pos-fees { text-align: left; min-width: 0; }
}
