:root {
    --bg: #0f1117;
    --card: #1a1d27;
    --border: #2a2d3a;
    --text: #e4e4e7;
    --muted: #9ca3af;
    --accent: #6366f1;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;
}

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

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

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

/* Layout */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 1.5rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar h2 {
    padding: 0 1.5rem;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.sidebar nav a {
    display: block;
    padding: 0.6rem 1.5rem;
    color: var(--muted);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text);
    text-decoration: none;
    border-left: 3px solid var(--accent);
}

.main {
    margin-left: 220px;
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
}

.main h1 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem;
}

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

.card .value {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 0.3rem;
}

.card .value.positive { color: var(--green); }
.card .value.negative { color: var(--red); }

/* Tables */
.table-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 2rem;
}

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

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

th {
    background: rgba(255,255,255,0.03);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.text-right { text-align: right; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-muted { color: var(--muted); }

/* Chart container */
.chart-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 2rem;
}

.chart-container h3 {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 360px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.login-box input {
    width: 100%;
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
}

.login-box button {
    width: 100%;
    padding: 0.7rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 600;
}

.login-box button:hover { opacity: 0.9; }

.login-box .error {
    color: var(--red);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Progress bar */
.progress-bar {
    background: var(--border);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: var(--green);
    border-radius: 4px;
    transition: width 0.3s;
}

/* Filter bar */
.filter-bar {
    margin-bottom: 1.5rem;
}

.filter-bar select {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Section title */
.section-title {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 1rem;
    margin-top: 1rem;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-info { background: rgba(99,102,241,0.2); color: var(--accent); }
.badge-warning { background: rgba(234,179,8,0.2); color: var(--yellow); }
.badge-error { background: rgba(239,68,68,0.2); color: var(--red); }
.badge-success { background: rgba(34,197,94,0.2); color: var(--green); }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; padding: 1rem; }
    .cards { grid-template-columns: repeat(2, 1fr); }
}
