:root {
    --primary-color: #08a40d;
    --primary-dark: #067a0a;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-sub: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --radius: 12px;
    --header-height: 60px;
    --footer-height: 70px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg-color); color: var(--text-main); }

/* --- HEADER --- */
.app-header {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: var(--card-bg);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1rem;
    box-shadow: var(--shadow);
    z-index: 100;
}
.app-title { font-size: 1.1rem; font-weight: 700; color: var(--primary-color); display: flex; align-items: center; gap: 8px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.logout-btn { background: none; border: none; color: var(--text-sub); font-size: 1.2rem; padding: 8px; }

/* --- MODE TOGGLE (Pill Shape) --- */
.mode-pill {
    background: #e2e8f0; border-radius: 20px; padding: 4px;
    display: flex; position: relative;
}
.toggle-option {
    padding: 4px 12px; font-size: 0.75rem; font-weight: 600;
    border-radius: 16px; cursor: pointer; color: var(--text-sub);
    transition: all 0.2s ease;
}
.toggle-option.active { background: var(--card-bg); color: var(--primary-color); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

/* --- MAIN LAYOUT --- */
.main-content {
    margin-top: var(--header-height);
    padding: 1rem;
    padding-bottom: calc(var(--footer-height) + 20px); /* Space for footer */
    max-width: 600px; margin-left: auto; margin-right: auto;
}

/* --- WIZARD STEPS --- */
.step-view { display: none; animation: fadeIn 0.3s ease; }
.step-view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* Progress Indicator */
.stepper { display: flex; justify-content: center; gap: 8px; margin-bottom: 1.5rem; }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; }
.step-dot.active { background: var(--primary-color); transform: scale(1.2); }

/* --- CARDS & INPUTS --- */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; }
.search-box { width: 100%; padding: 12px 16px; border: 1px solid var(--border-color); border-radius: var(--radius); font-size: 1rem; outline: none; background: #f9fafb; }
.search-box:focus { border-color: var(--primary-color); background: #fff; }

/* --- LIST ITEMS (User & Stock) --- */
.list-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px; border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}
.list-item:last-child { border-bottom: none; }

/* User Selection */
.user-item { cursor: pointer; }
.user-item:active { background: #f0fdf4; }
.user-item.selected { background: #dcfce7; border-radius: 8px; border-bottom: none; }
.user-avatar { width: 40px; height: 40px; background: #e2e8f0; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #64748b; font-weight: bold; margin-right: 12px; }
.user-info h4 { margin: 0; font-size: 0.95rem; }
.user-info p { margin: 0; font-size: 0.8rem; color: var(--text-sub); }

/* Item Selection */
.item-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px; background: #fff; border-radius: 12px; margin-bottom: 8px; border: 1px solid var(--border-color);
}
.item-meta h4 { margin: 0 0 4px 0; font-size: 0.9rem; }
.stock-badge { font-size: 0.75rem; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; color: #64748b; }
.item-controls { display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-color); background: #fff; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; color: var(--primary-color); }
.qty-display { width: 24px; text-align: center; font-weight: 600; font-size: 0.9rem; }

/* Summary Table */
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border-color); font-size: 0.9rem; }
.total-row { display: flex; justify-content: space-between; padding-top: 12px; font-weight: bold; font-size: 1rem; }

/* --- FIXED FOOTER --- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--footer-height); background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    display: flex; align-items: center; padding: 0 1rem;
    z-index: 90;
}
.nav-content { width: 100%; max-width: 600px; margin: 0 auto; display: flex; gap: 12px; }

.btn {
    border: none; padding: 0 24px; height: 44px; border-radius: 22px;
    font-weight: 600; font-size: 0.95rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    flex: 1; transition: transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-secondary { background: #f1f5f9; color: var(--text-main); flex: 0 0 auto; }
.btn-primary { background: var(--primary-color); color: white; box-shadow: 0 4px 6px -1px rgba(8, 164, 13, 0.3); }
.btn-primary:disabled { background: #cbd5e1; box-shadow: none; }

/* --- TOAST --- */
.toast-container { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 200; width: 90%; max-width: 400px; }
.toast { padding: 12px 16px; border-radius: 8px; color: white; margin-bottom: 8px; font-size: 0.9rem; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.toast-success { background: var(--primary-color); }
.toast-warning { background: #f59e0b; }
.toast-error { background: #ef4444; }

/* --- LOGIN PAGE STYLES --- */
.login-body {
    background-color: #f4f7f6;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 360px;
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    text-align: center;
}

.brand-logo {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
}

.login-subtitle {
    color: var(--text-sub);
    font-size: 0.9rem;
    margin-bottom: 30px;
}

.login-form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-left: 4px;
}

.login-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
    background: #f8fafc;
}

.login-input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(8, 164, 13, 0.1);
}

.login-btn {
    width: 100%;
    padding: 16px;
    margin-top: 10px;
    font-size: 1rem;
    border-radius: 12px;
}

/* Mobile tweaks */
@media (min-width: 768px) {
    .main-content { padding-top: 2rem; }
    .stepper { display: none; } /* Less needed on desktop */
}
