/* ===== MAIN CSS ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fb;
    --bg-sidebar: #fafbfc;
    --text-primary: #1a1d23;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --accent-primary: #3b82f6;
    --accent-secondary: #10b981;
    --accent-danger: #ef4444;
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    font-weight: 400;
    overflow-x: hidden;
}

.app-container {
    display: grid;
    grid-template-columns: 420px 1fr;
    grid-template-rows: auto 1fr;
    min-height: calc(100vh - 40px); /* Adjust for footer */
    max-width: 2200px;
    margin: 0 auto;
    background: var(--bg-primary);
    box-shadow: var(--shadow-xl);
}

/* Helper Classes */
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Responsive Design */
@media (max-width: 1400px) {
    .app-container {
        grid-template-columns: 380px 1fr;
    }
}

@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 360px 1fr;
    }
}

@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        min-height: calc(100vh - 40px);
    }
    .sidebar {
        order: 2;
        height: auto;
        border-right: none;
    }
    .preview-panel {
        order: 1;
        min-height: 60vh;
    }
}

@media (max-width: 768px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    .invoice-body {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}
