@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Outfit:wght@600;700&display=swap');

:root { 
    --primary: #4318ff; 
    --secondary: #EC4899; 
    --success: #10B981; 
    --error: #EF4444; 
    --bg: #F4F7FE; 
    --text: #1B2559; 
    --border: #E2E8F0; 
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    background-color: #f1f1f1; 
    margin: 0; 
    display: flex; 
    justify-content: center; 
    min-height: 100vh; 
    color: var(--text); 
}

.app-container { 
    width: 100%; 
    max-width: 480px; 
    background: var(--bg); 
    min-height: 100vh; 
    box-shadow: 0 0 50px rgba(0,0,0,0.1); 
    position: relative; 
    display: flex; 
    flex-direction: column; 
}

.page { 
    padding: 24px; 
    display: none; 
    flex: 1; 
    overflow-y: auto; 
    flex-direction: column; 
}

.page.active { display: flex; }

/* Typography */
h1, h2, h3 { font-family: 'Outfit', sans-serif; margin: 0; }
.section-title { 
    font-size: 13px; 
    font-weight: 800; 
    color: var(--primary); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-bottom: 16px; 
    margin-top: 24px; 
}

/* Buttons */
.btn { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 18px; 
    border-radius: 16px; 
    font-weight: 700; 
    width: 100%; 
    cursor: pointer; 
    font-size: 16px; 
    transition: 0.2s; 
    box-shadow: 0 10px 20px rgba(67, 24, 255, 0.15); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 8px; 
}
.btn:active { transform: scale(0.98); }
.btn-outline { background: white; color: var(--primary); border: 2px solid var(--primary); box-shadow: none; }
.btn-ghost { background: transparent; color: #707EAE; border: none; box-shadow: none; font-weight: 700; }

/* Forms */
.input-group { margin-bottom: 24px; }
.input-label { font-size: 13px; font-weight: 700; color: #707EAE; margin-bottom: 10px; display: block; padding-left: 4px; }
input, select, textarea { 
    width: 100%; 
    padding: 16px; 
    border-radius: 14px; 
    border: 1px solid var(--border); 
    font-size: 15px; 
    outline: none; 
    background: #f8faff; 
    font-weight: 600; 
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: white; }

/* Cards */
.welcome-card { 
    background: var(--primary); 
    color: white; 
    padding: 32px; 
    border-radius: 28px; 
    margin-bottom: 24px; 
    box-shadow: 0 15px 30px rgba(67, 24, 255, 0.2); 
}
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 32px; }
.stat-card { 
    background: white; 
    padding: 20px; 
    border-radius: 22px; 
    border: 1px solid var(--border); 
    text-align: center; 
}
.action-card { 
    background: white; 
    border: 1px solid var(--border); 
    border-radius: 24px; 
    padding: 20px; 
    margin-bottom: 16px; 
    display: flex; 
    align-items: center; 
    cursor: pointer; 
}
.card-icon { 
    width: 48px; 
    height: 48px; 
    border-radius: 16px; 
    margin-right: 16px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 20px; 
}

/* Modals & Overlays */
.modal-overlay { 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.5); 
    backdrop-filter: blur(4px); 
    display: none; 
    justify-content: center; 
    align-items: flex-end; 
    z-index: 1000; 
}
.modal-overlay.active { display: flex; }
.modal-content { 
    background: white; 
    width: 100%; 
    max-width: 480px; 
    border-radius: 32px 32px 0 0; 
    padding: 32px; 
    transform: translateY(100%); 
    transition: 0.3s; 
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.success-overlay { 
    position: fixed; 
    inset: 0; 
    background: rgba(255,255,255,0.95); 
    backdrop-filter: blur(10px); 
    z-index: 3000; 
    display: none; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    padding: 40px; 
    text-align: center; 
}
.success-overlay.active { display: flex; }

/* History */
.history-item { 
    background: white; 
    padding: 16px; 
    border-radius: 20px; 
    margin-bottom: 12px; 
    border: 1px solid var(--border); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

/* Images */
.image-picker { 
    border: 2px dashed var(--border); 
    border-radius: 20px; 
    padding: 32px; 
    text-align: center; 
    cursor: pointer; 
    margin-bottom: 24px; 
}
.image-preview { 
    width: 100%; 
    height: 200px; 
    border-radius: 16px; 
    object-fit: cover; 
    display: none; 
    margin-top: 16px; 
}
.product-image-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.mini-picker { 
    border: 2px dashed var(--border); 
    border-radius: 16px; 
    padding: 16px; 
    text-align: center; 
    cursor: pointer; 
    height: 110px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
    overflow: hidden; 
}
.mini-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }

.error-popup { 
    position: fixed; 
    top: 20px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: var(--error); 
    color: white; 
    padding: 16px 24px; 
    border-radius: 14px; 
    z-index: 4000; 
    display: none; 
    font-weight: 700; 
    width: 90%; 
    max-width: 400px; 
    text-align: center; 
}
