:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface2: #242836;
    --border: #2e3347;
    --text: #e4e6f0;
    --text-muted: #8b8fa3;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --green: #00b894;
    --red: #e17055;
    --yellow: #fdcb6e;
    --blue: #0984e3;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

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

header {
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-light);
}

header h1 span {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.9rem;
    margin-left: 12px;
}

/* Cards grid */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: border-color 0.2s;
}

.card:hover { border-color: var(--accent); }

.card-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
}

.card-value.green { color: var(--green); }
.card-value.blue { color: var(--blue); }
.card-value.yellow { color: var(--yellow); }

.card-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Sections */
.section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--accent-light);
}

/* Chart */
.chart-container {
    position: relative;
    width: 100%;
    height: 350px;
}

/* Simulator */
.sim-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.sim-form label {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.sim-form input {
    width: 100%;
    padding: 10px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.sim-form input:focus { border-color: var(--accent); }

.btn {
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s;
    align-self: end;
}

.btn:hover { background: var(--accent-light); color: var(--bg); }

.sim-results {
    display: none;
}

.sim-results.active {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.sim-card {
    background: var(--surface2);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.sim-card .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sim-card .value {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 4px;
}

.sim-chart-container {
    position: relative;
    width: 100%;
    height: 280px;
    display: none;
}

.sim-chart-container.active { display: block; }

/* Table */
.table-wrap {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

th {
    color: var(--text-muted);
    font-weight: 500;
    position: sticky;
    top: 0;
    background: var(--surface);
}

td { color: var(--text); }

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

@media (max-width: 600px) {
    .card-value { font-size: 1.5rem; }
    .chart-container { height: 250px; }
}
