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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #f5f7fa;
    color: #2c3e50;
}

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

/* Header */
header {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* Nav bar */
.nav-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 20px;
    gap: 10px 20px;
}

.nav-container .controls {
    flex: 1;
    min-width: 0;
    order: 2;
}

.nav-logo {
    flex-shrink: 0;
    font-size: 1.1em;
    font-weight: 700;
    color: #1a1a1a;
    text-decoration: none;
    white-space: nowrap;
    order: 1;
}

.nav-hamburger {
    display: none;
    order: 3;
    margin-left: auto;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 1.1em;
    cursor: pointer;
    color: #475569;
}

.nav-links {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
    order: 4;
    align-items: center;
}

@media (max-width: 768px) {
    .nav-hamburger {
        display: block;
    }

    .nav-container .controls {
        order: 4;
        flex: none;
        width: 100%;
    }

    .nav-links {
        display: none;
        order: 5;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 8px 0;
        border-top: 1px solid #f1f5f9;
        margin-left: 0;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        width: 100%;
        padding: 8px 12px;
    }

    .nav-links #userBar {
        padding: 6px 12px;
        width: 100%;
    }
}

.nav-links a {
    color: #6b7280;
    text-decoration: none;
    font-size: 0.88em;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background 0.15s, color 0.15s;
}

.nav-links a:hover {
    color: #2563eb;
    background: #eff6ff;
}

.nav-links a.active {
    color: #1d4ed8;
    background: #dbeafe;
    font-weight: 600;
}

h1 {
    font-size: 28px;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

select, input[type="text"] {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

select {
    min-width: 150px;
}

input[type="text"] {
    flex: 1;
    max-width: 400px;
}

/* Metrics Cards */
.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.metric-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
}

.metric-change {
    font-size: 14px;
    margin-top: 5px;
}

.metric-change.up {
    color: #22c55e;
}

.metric-change.down {
    color: #ef4444;
}

/* Tabs */
.tabs {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background: #f3f4f6;
}

.tab-button.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: white;
}

.tab-content {
    padding: 25px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Chart */
.chart-container {
    margin-bottom: 25px;
    min-height: 400px;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
}

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

th {
    background: #f9fafb;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
    border-bottom: 2px solid #e5e7eb;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

tr:hover {
    background: #f9fafb;
}

.text-right {
    text-align: right;
}

.fund-link {
    color: #2563eb;
    text-decoration: none;
    cursor: pointer;
}

.fund-link:hover {
    text-decoration: underline;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px;
    color: #6b7280;
    font-size: 16px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}
