:root {
    --primary: #4f46e5; /* Indigo */
    --primary-hover: #4338ca;
    --bg-body: #f3f4f6; /* Light Gray */
    --bg-card: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #10b981; /* Green */
    --danger: #ef4444; /* Red */
    --radius: 8px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 50px;
}

/* --- LAYOUT & UTILS --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-4 { gap: 1rem; }
.w-full { width: 100%; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.font-bold { font-weight: 700; }

/* --- HEADER --- */
header { background: var(--bg-card); border-bottom: 1px solid var(--border); padding: 1rem 0; box-shadow: var(--shadow); }
.brand { font-size: 1.25rem; font-weight: 800; color: var(--text-main); text-decoration: none; }
.brand span { color: var(--primary); }
.nav-link { margin-left: 20px; color: var(--text-muted); text-decoration: none; font-weight: 500; }
.nav-link:hover { color: var(--primary); }

/* --- ADVERTISING SLOTS --- */
.ad-container {
    background-color: #e5e7eb;
    border: 1px dashed #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 0.8rem;
    margin: 20px auto;
    overflow: hidden;
}
.ad-leaderboard { width: 100%; max-width: 728px; height: 90px; }
.ad-sidebar { width: 100%; height: 250px; }

/* --- CARDS & STATS --- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 20px; }
.card { background: var(--bg-card); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text-main); }
.stat-label { font-size: 0.875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* --- FORM --- */
label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); margin-bottom: 0.25rem; }
input, select { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; font-size: 1rem; outline: none; transition: border 0.2s; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1); }

/* --- BUTTONS --- */
.btn { display: inline-block; padding: 0.6rem 1.2rem; border-radius: var(--radius); font-weight: 600; cursor: pointer; border: none; text-align: center; transition: 0.2s; width: 100%; }
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-muted); width: auto; font-size: 0.875rem; padding: 0.4rem 0.8rem; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger-sm { background: #fee2e2; color: #b91c1c; padding: 0.2rem 0.5rem; font-size: 0.8rem; border-radius: 4px; }
.btn-danger-sm:hover { background: #fecaca; }

/* --- TABLE --- */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { text-align: left; padding: 0.75rem; background: #f9fafb; color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
td { padding: 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 99px; font-size: 0.75rem; font-weight: 700; }
.badge-buy { background: #dbeafe; color: #1e40af; }
.badge-sell { background: #fce7f3; color: #9d174d; }
.text-win { color: var(--success); font-weight: bold; }
.text-loss { color: var(--danger); font-weight: bold; }

/* --- RESPONSIVE --- */
.main-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; }
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .main-grid { grid-template-columns: 1fr; }
    .ad-leaderboard { height: 100px; } /* Mobile banner size */
}