.container { max-width: 600px; margin: 0 auto; padding: 20px; }

.screen { display: none; }
.screen.active { display: block; }

.card { padding: 24px; }

h1 {
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    margin: 28px 0 20px;
    color: var(--color-primary);
    letter-spacing: -0.03em;
}

/* ── Forms ──────────────────────────────────────────────── */

.form-group { margin-bottom: 18px; }

label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    font-size: 12px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

input, select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #f8faff;
    color: var(--color-text);
    transition: border-color 0.2s, background 0.2s;
    -webkit-appearance: none;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    background: white;
}

/* ── Buttons ────────────────────────────────────────────── */

button {
    width: 100%;
    min-height: 52px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}

button:active { transform: scale(0.98); }

button.primary {
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
    color: white;
    box-shadow: 0 4px 16px rgba(11,87,208,0.35);
}

button.success {
    background: linear-gradient(135deg, #1a7336, #28a745);
    color: white;
    box-shadow: 0 4px 12px rgba(26,115,54,0.30);
}

button.danger {
    background: linear-gradient(135deg, var(--color-danger), #e53935);
    color: white;
    box-shadow: 0 4px 12px rgba(179,38,30,0.30);
}

button.secondary {
    background: #e8eef7;
    color: var(--color-text);
    box-shadow: none;
}

button:disabled {
    background: #e0e0e0;
    color: #aaa;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ── Scanner header ─────────────────────────────────────── */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.user-info { font-size: 14px; color: var(--color-muted); }
.user-info strong { color: var(--color-text); font-weight: 700; }

/* ── Camera ─────────────────────────────────────────────── */

#reader {
    width: 100%;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

/* ── Scan result ────────────────────────────────────────── */

#result { display: none; }
#result.show { display: block; }

.result-header {
    font-size: 20px;
    font-weight: 800;
    text-align: center;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.result-header.success {
    background: linear-gradient(135deg, #1a7336, #28a745);
    color: white;
    box-shadow: 0 4px 16px rgba(26,115,54,0.35);
}

.result-header.warning {
    background: linear-gradient(135deg, #7c4a00, #f0a500);
    color: white;
    box-shadow: 0 4px 16px rgba(240,165,0,0.30);
}

.result-header.danger {
    background: linear-gradient(135deg, var(--color-danger), #e53935);
    color: white;
    box-shadow: 0 4px 16px rgba(179,38,30,0.35);
}

.result-info { margin-bottom: 16px; }

.result-label {
    font-size: 11px;
    color: var(--color-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.result-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

/* ── Quantity ───────────────────────────────────────────── */

.quantity-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.quantity-box {
    padding: 14px 12px;
    background: #f6f9ff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.quantity-box .label {
    font-size: 11px;
    color: var(--color-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.quantity-box .value {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.quantity-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

/* ── Scan history ───────────────────────────────────────── */

.scan-history {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--color-border);
}

.scan-history h3 {
    font-size: 12px;
    margin-bottom: 12px;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.scan-entry {
    padding: 10px 14px;
    background: #f6f9ff;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 14px;
    border: 1px solid var(--color-border);
}

.scan-entry strong { color: var(--color-primary); }

/* ── All products list ──────────────────────────────────── */

.line-items { margin-top: 20px; }

.line-item {
    padding: 12px 14px;
    background: #f6f9ff;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--color-border);
}

.line-item-name { font-weight: 700; color: var(--color-text); }

.line-item-qty {
    background: var(--color-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

/* ── Manual search divider ──────────────────────────────── */

.divider { text-align: center; margin: 20px 0; position: relative; }

.divider::before {
    content: '';
    position: absolute;
    left: 0; right: 0; top: 50%;
    border-top: 2px solid var(--color-border);
    z-index: 0;
}

.divider span {
    background: var(--color-bg);
    padding: 0 14px;
    position: relative;
    z-index: 1;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

#manualSearch h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 14px 0;
    color: var(--color-text);
}

.loading { font-size: 18px; }

@media (max-width: 480px) {
    .container { padding: 12px; }
    h1 { font-size: 22px; }
    .quantity-buttons { grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); }
}
