:root {
    --primary-color: #00b900;
    --secondary-color: #666;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333;
    --border-radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 16px;
    line-height: 1.6;
}

#app {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

h1 {
    font-size: 20px;
    text-align: center;
    margin-bottom: 24px;
    color: var(--primary-color);
}

.field {
    margin-bottom: 16px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 14px;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    box-sizing: border-box;
    font-size: 16px; /* Prevents iOS zoom on focus */
}

.item-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.item-name { flex: 2; }
.item-amount { flex: 1; }

button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

button:active { opacity: 0.8; }

.primary {
    background-color: var(--primary-color);
    color: white;
}

.secondary {
    background-color: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    margin-top: 8px;
}

#previewBtn {
    background-color: #333;
    color: white;
    margin-top: 24px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    border-radius: var(--border-radius);
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* Overlay / Loading */
.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.8);
    z-index: 2000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
