* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    min-height: 100vh;
}

.wrap { max-width: 480px; margin: 0 auto; padding: 20px 16px 60px; }

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

header { text-align: center; margin-bottom: 20px; position: relative; }
header h1 { font-size: 20px; color: #fff; margin-bottom: 4px; }
.subtitle { font-size: 13px; color: #888; }

.btn-back {
    display: inline-block; margin-bottom: 10px;
    background: none; border: none; color: #888;
    font-size: 13px; cursor: pointer; padding: 4px 0;
}
.btn-back:active { color: #fff; }

.field select {
    width: 100%; padding: 12px 14px;
    background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 8px;
    color: #fff; font-size: 14px; outline: none;
}

.search-box { position: relative; margin-bottom: 16px; }
.search-box input {
    width: 100%; padding: 12px 40px 12px 14px;
    background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 8px;
    color: #fff; font-size: 14px; outline: none;
}
.search-box input:focus { border-color: #00c853; }
.search-clear {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: #666; cursor: pointer; display: none; font-size: 14px;
}
.search-clear.show { display: block; }

.search-empty, .search-loading {
    text-align: center; padding: 40px 0; color: #555; font-size: 13px;
}
.search-empty-icon { font-size: 36px; margin-bottom: 10px; }

.result-card {
    background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 10px;
    padding: 14px; margin-bottom: 10px;
}
.result-main { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.result-img, .result-img-placeholder {
    width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
    background: #111; flex-shrink: 0;
}
.result-img-placeholder { display: flex; align-items: center; justify-content: center; font-size: 20px; }
.result-info { flex: 1; min-width: 0; }
.result-name { font-size: 14px; color: #fff; margin-bottom: 2px; }
.result-sku { font-size: 12px; color: #888; }

.btn-report {
    width: 100%; padding: 10px; border: none; border-radius: 8px;
    background: #3a1a00; color: #ffb74d; font-size: 13px; font-weight: 700; cursor: pointer;
}
.btn-report:active { background: #4a2200; }

.field { margin-bottom: 16px; }
.field label {
    display: block; font-size: 12px; font-weight: 600;
    color: #888; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}
.field input, .field textarea {
    width: 100%; padding: 12px 14px;
    background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 8px;
    color: #fff; font-size: 14px; outline: none;
}
.field input:focus, .field textarea:focus { border-color: #00c853; }
.field input[readonly] { color: #888; background: #141414; }

.field-row { display: flex; gap: 10px; margin-bottom: 16px; }
.field-row .field { flex: 1; margin-bottom: 0; }

.scan-box {
    position: relative; width: 100%; aspect-ratio: 4/3;
    background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 8px;
}
.scan-box video, .scan-box #ean-reader { width: 100%; height: 100%; object-fit: cover; }
.scan-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.55); color: #fff; font-size: 13px; text-align: center; padding: 16px;
}

.scan-actions { display: flex; gap: 8px; margin-bottom: 8px; }

.btn-secondary {
    flex: 1; padding: 10px; border-radius: 8px; border: 1px solid #2a2a2a;
    background: #1a1a1a; color: #aaa; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-secondary:active { background: #222; }

.confirm-box {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: #112; border: 1px solid #1e3a5f; border-radius: 8px;
    padding: 10px 12px; font-size: 13px; margin-top: 8px;
}
.btn-mini { padding: 6px 10px; border: none; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; }
.btn-ok    { background: #14532d; color: #86efac; }
.btn-retry { background: #7f1d1d; color: #fca5a5; }

#expiryManual { margin-top: 8px; }

.photo-row { display: flex; gap: 10px; }
.photo-slot {
    flex: 1; position: relative; aspect-ratio: 1;
    background: #1a1a1a; border: 2px dashed #2a2a2a; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    text-align: center; font-size: 12px; color: #666; overflow: hidden;
}
.photo-slot input {
    position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.photo-slot:has(input:focus) { border-color: #00c853; }

.btn-submit {
    width: 100%; padding: 16px; margin-top: 10px;
    background: #00c853; color: #000; border: none; border-radius: 10px;
    font-size: 16px; font-weight: 800; cursor: pointer;
}
.btn-submit:active { background: #00e676; }
.btn-submit:disabled { opacity: 0.5; }

.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #1a1a1a; border: 1px solid #2a2a2a; color: #fff;
    padding: 12px 20px; border-radius: 10px; font-size: 13px;
    opacity: 0; transition: all 0.25s; pointer-events: none; z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok  { border-color: #14532d; }
.toast.err { border-color: #7f1d1d; }
