:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --border-color: #30363d;
    --success-color: #238636;
    --danger-color: #da3633;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    margin: 0;
    padding: 20px;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    margin-bottom: 30px;
}

h1 {
    font-size: 2rem;
    margin: 0;
    background: linear-gradient(90deg, #58a6ff, #a371f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Grid Layouts */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.kpi-card h3 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Tables */
.section {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

h2 {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.table-container {
    overflow-x: auto;
}

.scrollable-table {
    max-height: 500px;
    /* Adjust based on row height, ~20 rows */
    overflow-y: auto;
    display: block;
    /* Needed for max-height to work on wrapper */
}

/* Fix header for scrollable tables */
.scrollable-table table {
    width: 100%;
    /* border-collapse separate needed for sticky headers in some browsers, but collapse is standard */
}

.scrollable-table thead th {
    position: sticky;
    top: 0;
    background-color: var(--card-bg);
    z-index: 10;
    /* Ensure border below header is visible */
    box-shadow: 0 1px 0 var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th {
    text-align: left;
    color: var(--text-secondary);
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 10px;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
}

tr:last-child td {
    border-bottom: none;
}

/* Utilities */
.text-right {
    text-align: right;
}

.text-green {
    color: var(--success-color);
}

.text-red {
    color: var(--danger-color);
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-buy {
    background-color: rgba(35, 134, 54, 0.2);
    color: #3fb950;
}

.badge-sell {
    background-color: rgba(218, 54, 51, 0.2);
    color: #f85149;
}