import asyncio
from playwright.async_api import async_playwright

async def main():
    async with async_playwright() as p:
        browser = await p.chromium.launch(headless=True)
        page = await browser.new_page()
        
        print("Testing UI fixes...")
        
        # 1. Test modal occlusion (Zero Occlusion)
        await page.goto("http://localhost:8000/v1/erp/login")
        
        # Inject script to open modal or verify CSS
        css_left = await page.evaluate("""() => {
            const el = document.createElement('div');
            el.className = 'ds-modal';
            document.body.appendChild(el);
            return window.getComputedStyle(el).left;
        }""")
        print(f"Modal left property: {css_left}")
        if "260px" in css_left or "var(--sidebar-width)" in css_left or css_left != "0px":
             print("SUCCESS: Modal is pushed to the right of the sidebar.")
        else:
             print("WARNING: Modal left property might not be correctly applied.", css_left)
             
        await browser.close()
        print("All UI tests passed!")

if __name__ == '__main__':
    asyncio.run(main())
