* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0f1117;
    --bg2: #1a1d27;
    --bg3: #242836;
    --text: #e1e4ea;
    --text2: #8b8fa3;
    --accent: #4f8fff;
    --accent2: #6c5ce7;
    --green: #00d68f;
    --red: #ff6b6b;
    --orange: #ffa94d;
    --border: #2d3148;
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Navbar */
.navbar {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1200px; margin: 0 auto; }
.nav-brand { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 16px; align-items: center; }
.nav-links a { color: var(--text2); font-size: 0.9rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* Buttons */
.btn-primary {
    background: var(--accent);
    color: #fff;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-block;
}
.btn-primary:hover { background: #3d7ae6; text-decoration: none; color: #fff; }
.btn-outline {
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9rem;
    background: transparent;
    display: inline-block;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-danger { background: var(--red); color: #fff; padding: 6px 14px; border-radius: 6px; border: none; cursor: pointer; font-size: 0.85rem; }
.btn-danger:hover { background: #e05050; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-green { background: var(--green); color: #000; }
.btn-green:hover { background: #00c080; }

/* Flash messages */
.flash-container { max-width: 1200px; margin: 16px auto; padding: 0 24px; }
.flash { padding: 12px 20px; border-radius: 8px; margin-bottom: 8px; font-size: 0.9rem; }
.flash-error { background: rgba(255,107,107,0.15); color: var(--red); border: 1px solid rgba(255,107,107,0.3); }
.flash-success { background: rgba(0,214,143,0.15); color: var(--green); border: 1px solid rgba(0,214,143,0.3); }

/* Main content */
.main-content { flex: 1; max-width: 1200px; margin: 0 auto; padding: 32px 24px; width: 100%; }

/* Cards */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}
.card-header { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* Stat cards */
.stat-card {
    background: var(--bg3);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--green); margin: 8px 0; }
.stat-label { font-size: 0.85rem; color: var(--text2); }

/* Exchange cards */
.exchange-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.2s;
}
.exchange-card:hover { border-color: var(--accent); }
.exchange-card h3 { margin-bottom: 12px; }
.exchange-card .status { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }
.status-connected { background: rgba(0,214,143,0.15); color: var(--green); }
.status-pending { background: rgba(255,169,77,0.15); color: var(--orange); }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 0.9rem; color: var(--text2); font-weight: 500; }
.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
}
.form-group input:focus { border-color: var(--accent); }
.form-group .hint { font-size: 0.8rem; color: var(--text2); margin-top: 4px; }
.form-inline { display: flex; gap: 12px; align-items: flex-end; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }

/* Auth forms */
.auth-container { max-width: 440px; margin: 60px auto; }
.auth-container .card { padding: 32px; }
.auth-container h2 { text-align: center; margin-bottom: 24px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; padding: 10px 12px; color: var(--text2); font-weight: 600; border-bottom: 1px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
tr:hover td { background: var(--bg3); }

/* Toggle switch */
.toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { display: none; }
.toggle .slider {
    width: 44px; height: 24px; background: var(--bg3); border-radius: 12px;
    position: relative; transition: background 0.2s;
}
.toggle .slider::after {
    content: ''; position: absolute; left: 3px; top: 3px;
    width: 18px; height: 18px; background: var(--text2); border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}
.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider::after { transform: translateX(20px); background: #fff; }

/* Chart container */
.chart-container { position: relative; height: 300px; margin: 20px 0; }

/* Info box */
.info-box {
    background: rgba(79,143,255,0.1);
    border: 1px solid rgba(79,143,255,0.3);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    font-size: 0.9rem;
    color: var(--text);
}
.info-box code { background: var(--bg3); padding: 2px 8px; border-radius: 4px; font-family: monospace; color: var(--accent); }

/* Tabs */
.tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tab-btn {
    padding: 10px 20px; cursor: pointer; border: none; background: none;
    color: var(--text2); font-size: 0.9rem; font-weight: 500;
    border-bottom: 2px solid transparent; transition: all 0.2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Spinner */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Landing page */
.hero {
    text-align: center;
    padding: 80px 24px;
    max-width: 800px;
    margin: 0 auto;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 16px; line-height: 1.2; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.15rem; color: var(--text2); margin-bottom: 32px; line-height: 1.6; }
.hero-actions { display: flex; gap: 16px; justify-content: center; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 48px 0; max-width: 1000px; margin-left: auto; margin-right: auto; padding: 0 24px; }
.feature-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; text-align: center; }
.feature-card h3 { margin: 12px 0 8px; }
.feature-card p { font-size: 0.9rem; color: var(--text2); line-height: 1.5; }
.feature-icon { font-size: 2rem; }

.exchanges-section { text-align: center; padding: 48px 24px; }
.exchanges-section h2 { margin-bottom: 32px; }
.exchange-logos { display: flex; gap: 40px; justify-content: center; align-items: center; flex-wrap: wrap; }
.exchange-logo { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 40px; font-size: 1.2rem; font-weight: 700; }

/* Footer */
.footer { text-align: center; padding: 24px; color: var(--text2); font-size: 0.85rem; border-top: 1px solid var(--border); margin-top: auto; }

/* Responsive */
@media (max-width: 768px) {
    .card-grid, .features { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.8rem; }
    .hero-actions { flex-direction: column; align-items: center; }
    .exchange-logos { flex-direction: column; }
    .nav-links { gap: 10px; }
}

/* Key type section */
.key-section {
    background: var(--bg3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
}
.key-section h4 { margin-bottom: 12px; color: var(--accent); }
.key-section .note { font-size: 0.85rem; color: var(--orange); margin-bottom: 12px; }

/* Report header */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.report-header h2 { font-size: 1.5rem; }
