:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --success-color: #4ade80;
    --danger-color: #f87171;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --font-family: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    background-image:
        radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(168, 85, 247, 0.1) 0px, transparent 50%);
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: var(--glass-border);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Stats As Of Date */
.stats-as-of {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    opacity: 0.9;
}

.stats-as-of span::before {
    content: "Stats as of ";
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.highlight {
    color: var(--accent-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: var(--glass-border);
}

.dot {
    width: 8px;
    height: 8px;
    background-color: var(--success-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-card .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-card .stat-row:last-child {
    border-bottom: none;
}

.stat-value {
    font-weight: 600;
    font-family: monospace;
    font-size: 1.1rem;
}

.stat-value.negative {
    color: var(--danger-color);
}

/* Exposure Card */
.exposure-card {
    min-height: 200px;
}

.exposure-summary {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.placeholder-text {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Strategy List */
.strategies-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.strategy-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.strategy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.strategy-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.strategy-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.strategy-stat-value {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 0.25rem;
}

/* Strategy Breakdown */
.strategy-breakdown {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.breakdown-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.breakdown-value {
    font-size: 0.95rem;
    font-weight: 600;
    font-family: monospace;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    margin-top: 0.5rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background-color 0.3s ease;
}

.progress-green {
    background-color: var(--success-color);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
}

.progress-yellow {
    background-color: #facc15;
    /* Yellow-400 */
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

.progress-red {
    background-color: var(--danger-color);
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.5rem;
    }

    .strategy-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .strategy-stats {
        width: 100%;
        justify-content: space-between;
    }
}

/* Account Selector */
.account-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: var(--glass-border);
}

.account-selector label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.account-selector select {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-selector select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-color);
}

.account-selector select:focus {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Strategy List */
.strategies-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.strategy-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.strategy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.strategy-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.strategy-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.strategy-stat-value {
    color: var(--text-primary);
    font-weight: 600;
    margin-left: 0.25rem;
}

/* Strategy Breakdown */
.strategy-breakdown {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.375rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.breakdown-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.breakdown-value {
    font-size: 0.95rem;
    font-weight: 600;
    font-family: monospace;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    margin-top: 0.5rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background-color 0.3s ease;
}

.progress-green {
    background-color: var(--success-color);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
}

.progress-yellow {
    background-color: #facc15;
    /* Yellow-400 */
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

.progress-red {
    background-color: var(--danger-color);
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 1rem;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.5rem;
    }

    .strategy-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .strategy-stats {
        width: 100%;
        justify-content: space-between;
    }
}

/* Account Selector */
.account-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: var(--glass-border);
}

.account-selector label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.account-selector select {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-selector select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-color);
}

.account-selector select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.account-selector select option {
    background: var(--bg-color);
    color: var(--text-primary);
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    background: var(--card-bg);
    border: var(--glass-border);
    padding: 2.5rem;
    border-radius: 1rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-card h2 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.login-card input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    margin-bottom: 1rem;
    outline: none;
    transition: all 0.2s ease;
}

.login-card input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.login-card button {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent-color);
    color: #0f172a;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-card button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.error-msg {
    color: var(--danger-color) !important;
    font-size: 0.875rem;
    margin-top: 1rem;
    margin-bottom: 0 !important;
    min-height: 1.25rem;
}

@media (max-width: 800px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        text-align: center;
    }

    .account-selector {
        width: 100%;
        justify-content: center;
    }
}