:root {
    --primary-color: #6366F1;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    padding: 1.5rem;
    min-height: 100vh;
}

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    background: transparent;
}

.main-header {
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    margin: -1.5rem -1.5rem 2rem -1.5rem;
    padding: 2rem 1.5rem;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.main-header .container {
    max-width: 1400px;
    margin: 0 auto;
}

.site-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.site-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 400;
}

/* Section Header Enhancements */
.section-header {
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    display: inline-block;
    position: relative;
}

.section-header h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -0.5rem;
    width: 3rem;
    height: 0.25rem;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    border-radius: 1rem;
}

/* Financial Cards Grid */
.financial-cards, .graphs-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
    justify-content: start;
    grid-auto-flow: row;
    grid-auto-rows: auto;
}

.fin-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(234, 234, 234, 0.8);
}

.fin-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
}

.fin-card h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.fin-card .amount {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.fin-card .description {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Progress Section */
.progress-container {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2.5rem;
    position: relative;
}

.progress-section {
    margin-bottom: 1.5rem;
}

.progress-section:last-child {
    margin-bottom: 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.progress-label span {
    font-size: 0.875rem;
    color: #333;
}

.value-label {
    color: #00b894;
    font-weight: 600;
}

.progress-bar-wrapper {
    height: 24px;
    background-color: #F1F1F1;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
}

.progress-bar.days-left {
    background-color: #26BA8F;
    width: 19.4%;
}

.progress-bar.reserves {
    background-color: #6366F1;
    width: 19%;
}

.threshold-marker {
    position: absolute;
    left: 70%;
    top: 0;
    height: 100%;
    width: 1px;
    background-color: #999;
    border-left: 1px dashed #999;
}

.required-marker {
    position: absolute;
    left: 70%;
    top: -20px;
    font-size: 0.75rem;
    color: #666;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Add vertical line styles */
.progress-container::after {
    content: '';
    position: absolute;
    height: calc(100% + 1.5rem);
    width: 2px;
    left: 20%;
    top: 0;
    z-index: 9999;
    background: none;
    border-left: 2px dotted #26BA8F;
}

.calculated-required {
    position: absolute;
    left: 20%;
    bottom: -25px;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #26BA8F;
    white-space: nowrap;
}

/* Info Panel */
.info-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-item span:first-child {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.info-item span:last-child {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Charts Section */
.graphs-section {
    margin-top: 2.5rem;
    margin-bottom: 3rem;
}

.graphs-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding-bottom: 1.5rem;
}

.chart-container {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem 1.5rem 2rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    height: 350px;
    transition: all 0.3s ease;
    width: 100%;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .financial-cards, .graphs-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .main-header {
        margin: -1rem -1rem 1.5rem -1rem;
        padding: 1.5rem 1rem;
    }

    .financial-cards, .graphs-container {
        grid-template-columns: 1fr;
    }

    .graphs-section {
        margin-bottom: 2rem;
    }

    .graphs-container {
        gap: 1.25rem;
        padding: 0 0.5rem;
    }

    .chart-container {
        height: 300px;
        padding: 1rem;
        margin-bottom: 0.5rem;
        min-width: unset;
        width: 100%;
    }

    .chart-container h3 {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    canvas {
        width: 100% !important;
        height: 100% !important;
    }

    .info-panel {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .chart-container {
        height: 250px;
        padding: 0.75rem;
    }

    .graphs-container {
        gap: 1rem;
        padding: 0 0.25rem;
    }
}

/* Card Variations */
.fin-card.debt { border-left: 4px solid var(--danger-color); }
.fin-card.income { border-left: 4px solid var(--success-color); }
.fin-card.deficit { border-left: 4px solid var(--warning-color); }
.fin-card.trade { border-left: 4px solid var(--primary-color); }
.fin-card.required { border-left: 4px solid #8b5cf6; }
.fin-card.total-debt { border-left: 4px solid #ec4899; }