.budget-planner-page {
    max-width: var(--medium-width);
    margin: 0 auto;
    padding: 20px;
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-card.income .stat-icon {
    background: #ecfdf5;
}

.stat-card.expense .stat-icon {
    background: #fef2f2;
}

.stat-card.balance .stat-icon {
    background: #f0f9ff;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
}

.stat-card.income .stat-value {
    color: #10b981;
}

.stat-card.expense .stat-value {
    color: #ef4444;
}

.stat-card.balance .stat-value {
    color: #3b82f6;
}

.stat-card.balance .stat-value.negative {
    color: #ef4444;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: 20px;
}

.input-section {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.group-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.form-item {
    display: flex;
    flex-direction: column;
}

.form-item label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-item input {
    padding: 12px 14px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    font-size: 14px;
    text-align: right;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-item input:focus {
    outline: none;
    border-color: #10b981;
}

.result-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.expense-chart-card, .health-analysis-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.expense-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    width: 40px;
    font-size: 12px;
    color: #64748b;
}

.bar-track {
    flex: 1;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.bar-value {
    width: 110px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-align: right;
}

.expense-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-name {
    flex: 1;
    color: #64748b;
}

.legend-value {
    font-weight: 600;
    color: #374151;
}

.health-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.health-icon {
    font-size: 24px;
}

.health-message {
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 20px;
}

.health-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.detail-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.detail-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.detail-value {
    font-size: 18px;
    font-weight: 700;
    color: #374151;
}

.health-tips {
    background: #f0fdf4;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #dcfce7;
}

.health-tips h4 {
    font-size: 14px;
    font-weight: 600;
    color: #166534;
    margin-bottom: 12px;
}

.health-tips ul {
    margin: 0;
    padding-left: 20px;
}

.health-tips li {
    font-size: 13px;
    color: #15803d;
    margin-bottom: 8px;
    line-height: 1.6;
}

.health-tips li:last-child {
    margin-bottom: 0;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .expense-legend {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-section {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 24px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .expense-legend {
        grid-template-columns: repeat(2, 1fr);
    }

    .health-details {
        grid-template-columns: 1fr;
    }

    .bar-value {
        width: 90px;
    }
}