/* ============ Строгое стекло · чёрный · тонкое золото ============ */
:root {
  --bg: #000;
  --ink: #F5F5F7;
  --ink-2: rgba(245,245,247,.6);
  --ink-3: rgba(245,245,247,.38);
  --ink-4: rgba(245,245,247,.22);
  --hair: rgba(255,255,255,.09);
  --glass: rgba(255,255,255,.05);
  --glass-2: rgba(255,255,255,.09);
  --edge: rgba(255,255,255,.14);
  --gold: #D4AF5A;
  --gold-soft: rgba(212,175,90,.14);
  --gold-edge: rgba(212,175,90,.45);
  --red: #E5655B;
  --green: #5FB97A;
  --blue: #6E9BD6;
  --r: 18px; --r-sm: 12px;
  --pad: 18px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar: 78px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color: var(--ink); min-height: 100%; }
body { margin: 0; background: transparent; min-height: 100%;
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overscroll-behavior: none; letter-spacing: -.01em; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
input, select { outline: none; }
::selection { background: rgba(212,175,90,.3); }

/* ---- ambient: едва заметный тёплый свет сверху ---- */
.ambient { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: #000; overflow: hidden; }
.ambient i { position: absolute; border-radius: 50%; filter: blur(90px); }
.ambient .a1 { width: 90vw; height: 60vw; left: -10vw; top: -30vw; background: rgba(212,175,90,.22); }
.ambient .a2 { width: 80vw; height: 60vw; right: -30vw; bottom: -30vw; background: rgba(110,155,214,.10); }
.ambient .a3 { display: none; }

/* ---- стекло ---- */
.g { position: relative; background: var(--glass); border: 1px solid var(--edge); border-radius: var(--r);
  backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset; }
.g > * { position: relative; }

/* ---- экраны ---- */
#app { min-height: 100vh; }
.screen { padding: calc(var(--safe-t) + 14px) var(--pad) calc(var(--safe-b) + 28px); min-height: 100vh; }
.screen.anim { animation: in .2s ease-out; }
.screen.with-tabs { padding-bottom: calc(var(--safe-b) + var(--tabbar) + 24px); }
.screen.center { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px; text-align: center; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- навигация, заголовки ---- */
.nav { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 8px; }
.nav .ib { width: 44px; height: 44px; margin-left: -10px; display: flex; align-items: center; justify-content: center; color: var(--ink-2); flex: 0 0 auto; border-radius: 12px; }
.nav .ib:active { background: var(--glass-2); }
.nav .grow { flex: 1; min-width: 0; }
.nav .right { flex: 0 0 auto; }
.title { font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin: 0; }
.title.sm { font-size: 22px; }
.subtitle { color: var(--ink-2); font-size: 14px; margin-top: 3px; }
.nav.brand { justify-content: center; min-height: 72px; margin: 4px 0 10px; }
.nav.brand .logo { height: 72px; width: auto; display: block; object-fit: contain; }
.sect { color: var(--ink-3); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin: 24px 4px 8px; }
.sect.first { margin-top: 12px; }

/* иконки: тонкие линии, без подложек */
.ic { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.ic.lg { width: 26px; height: 26px; }
.sym { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--ink-2); }
.sym.sm { width: 22px; height: 22px; }
.sym.gold { color: var(--gold); }
.sym .ic { width: 22px; height: 22px; }

/* ---- профиль ---- */
.profile { padding: 16px 18px; margin-top: 6px; display: flex; gap: 14px; align-items: center; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; flex: 0 0 auto;
  color: var(--gold); border: 1px solid var(--gold-edge); background: var(--gold-soft); letter-spacing: 0; }
.profile .nm { font-size: 18px; font-weight: 600; }
.profile .ps { color: var(--ink-2); font-size: 14px; margin-top: 1px; }
.profile .wh { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.status { display: inline-flex; align-items: center; gap: 8px; margin: 12px 4px 0; font-size: 13.5px; color: var(--ink-2); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.status.on::before { background: var(--green); } .status.off::before { background: var(--red); }

/* ---- сегмент ---- */
.seg { display: flex; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid var(--hair); }
.seg button { flex: 1; padding: 9px 8px; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: 14.5px; transition: all .15s; text-align: center; }
.seg button.on { background: rgba(255,255,255,.14); color: var(--ink); font-weight: 600; }

/* ---- основные действия ---- */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.act { padding: 18px 16px 16px; min-height: 128px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; transition: background .12s; }
.act:active { background: var(--glass-2); }
.act .sym { width: 28px; height: 28px; color: var(--ink); }
.act .sym .ic { width: 26px; height: 26px; }
.act .t { font-size: 17px; font-weight: 600; }
.act .s { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.act.gold { border-color: var(--gold-edge); }
.act.gold .sym { color: var(--gold); }
.act:disabled { opacity: .4; }

/* ---- сгруппированный список ---- */
.group { overflow: hidden; margin-top: 10px; }
.group .cell { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; width: 100%; min-height: 56px; }
.group .cell + .cell { border-top: 1px solid var(--hair); }
.group .cell:active { background: var(--glass-2); }
.cell .body { flex: 1; min-width: 0; }
.cell .l1 { font-size: 16px; font-weight: 500; }
.cell .l2 { color: var(--ink-3); font-size: 13px; margin-top: 1px; }
.cell .chev { color: var(--ink-4); display: flex; }
.cell .chev svg { width: 18px; height: 18px; }
.cell .tag { color: var(--ink-3); font-size: 12.5px; font-weight: 500; flex: 0 0 auto; }
.thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; background: rgba(255,255,255,.06); border: 1px solid var(--hair); }

/* ---- группы товаров ---- */
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat { padding: 16px 16px 14px; min-height: 96px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; transition: background .12s; }
.cat:active { background: var(--glass-2); }
.cat .t { font-size: 15.5px; font-weight: 600; line-height: 1.25; }
.cat .s { color: var(--ink-3); font-size: 12.5px; }
.cat .idx { color: var(--gold); font-size: 12px; font-weight: 600; letter-spacing: .06em; }

/* ---- поиск ---- */
.search { position: sticky; top: calc(var(--safe-t) + 6px); z-index: 5; margin: 6px 0 12px; }
.search .in { width: 100%; padding: 12px 14px 12px 42px; border-radius: 14px; color: var(--ink); font-size: 16px;
  background: rgba(18,18,18,.82); border: 1px solid var(--edge); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.search .in:focus { border-color: rgba(255,255,255,.3); }
.search .in::placeholder { color: var(--ink-3); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--ink-3); pointer-events: none; z-index: 1; }

/* ---- поля ---- */
.field { margin-top: 16px; }
.label { color: var(--ink-3); font-size: 12.5px; font-weight: 600; margin: 0 4px 7px; text-transform: uppercase; letter-spacing: .04em; }
.in { width: 100%; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--edge); color: var(--ink); font-size: 17px; }
.in:focus { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.07); }
.in.err, .shot.err, .chips.err { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(229,101,91,.18); }
.chips.err { border-radius: var(--r); padding: 6px; margin: -6px; border: 1px solid var(--red); }
.in::placeholder { color: var(--ink-4); }
.in.num { font-size: 34px; font-weight: 600; letter-spacing: -.02em; padding: 12px 70px 12px 18px; font-variant-numeric: tabular-nums; }
.wrap { position: relative; }
.wrap .suf { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 500; font-size: 17px; pointer-events: none; }
select.in { appearance: none; -webkit-appearance: none; padding-right: 44px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(245,245,247,.4)' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 20px; }
select.in option { background: #121212; color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 10px 14px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); background: rgba(255,255,255,.04); border: 1px solid var(--edge); transition: all .15s; }
.chip.on { background: var(--ink); color: #000; border-color: var(--ink); font-weight: 600; }
.switch { display: flex; align-items: center; gap: 12px; padding: 13px 16px; width: 100%; }
.switch .body { flex: 1; } .switch .l1 { font-weight: 500; } .switch .l2 { color: var(--ink-3); font-size: 13px; margin-top: 1px; }
.sw { width: 46px; height: 28px; border-radius: 999px; background: rgba(255,255,255,.14); position: relative; transition: background .18s; flex: 0 0 auto; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .18s; }
.switch.on .sw { background: var(--gold); } .switch.on .sw::after { transform: translateX(18px); }

/* ---- кнопки ---- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 18px; border-radius: 14px; font-weight: 600; font-size: 16px; transition: opacity .12s, background .12s; }
.btn:active { opacity: .8; }
.btn:disabled { opacity: .45; }
.btn.gold { background: var(--gold); color: #1a1405; }
.btn.white { background: var(--ink); color: #000; }
.btn.glass { background: rgba(255,255,255,.06); border: 1px solid var(--edge); color: var(--ink); }
.btn.red { background: transparent; border: 1px solid rgba(229,101,91,.45); color: var(--red); }
.btn.sm { padding: 10px 13px; min-height: 42px; font-size: 14px; width: auto; border-radius: 11px; font-weight: 500; }
.btn .ic { width: 18px; height: 18px; }
.row2 { display: flex; gap: 10px; } .row2 > * { flex: 1; min-width: 0; }
.row2 .btn { white-space: nowrap; }
.row2.wrap { flex-wrap: wrap; gap: 8px; } .row2.wrap > * { flex: 1 1 auto; }
.row2.wrap .btn.sm { padding: 10px 12px; gap: 6px; }
.cta { position: sticky; bottom: calc(var(--safe-b) + 10px); margin-top: 20px; padding-top: 10px; background: linear-gradient(to top, rgba(0,0,0,.92) 60%, rgba(0,0,0,0)); }

/* ---- фото ---- */
.shot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 150px; padding: 20px;
  border-radius: var(--r); border: 1px dashed var(--gold-edge); background: rgba(212,175,90,.04); color: var(--ink); font-weight: 500; font-size: 15.5px; }
.shot .sym { width: 36px; height: 36px; color: var(--gold); margin-bottom: 4px; }
.shot .sym .ic { width: 30px; height: 30px; }
.shot .h { color: var(--ink-3); font-weight: 400; font-size: 13px; }
.prev { position: relative; border-radius: var(--r); overflow: hidden; border: 1px solid var(--edge); }
.prev img { display: block; width: 100%; max-height: 340px; object-fit: cover; }
.prev .re { position: absolute; right: 12px; bottom: 12px; padding: 8px 12px; border-radius: 10px; color: #fff; font-size: 13.5px; font-weight: 500;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.ok-line { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: 13.5px; margin: 8px 4px 0; }
.ok-line .ic { width: 16px; height: 16px; }
.hero { width: 100%; max-height: 230px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--edge); margin-top: 10px; }

/* ---- карточка товара в форме ---- */
.pcard { padding: 14px 16px; margin-top: 10px; display: flex; gap: 14px; align-items: center; }
.pcard .nm { font-size: 18px; font-weight: 600; }
.pcard .mt { color: var(--ink-3); font-size: 13px; margin-top: 2px; }

/* ---- записи ---- */
.op { display: flex; gap: 14px; align-items: stretch; padding: 12px; margin-top: 10px; }
.op .ph { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; border: 1px solid var(--hair); background: rgba(255,255,255,.05); }
.op .body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.op .top { display: flex; align-items: center; gap: 10px; }
.op .tm { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.op .nm { font-weight: 500; font-size: 15.5px; margin-top: 2px; }
.op .qt { font-size: 21px; font-weight: 600; letter-spacing: -.02em; margin-top: 1px; }
.op .qt.out { color: var(--blue); } .op .qt.in { color: var(--green); } .op .qt.wo { color: var(--ink); }
.op .mt { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.op .del { color: var(--red); font-size: 13px; font-weight: 500; margin-top: 8px; display: inline-flex; align-items: center; gap: 5px; }
.op .del .ic { width: 15px; height: 15px; }
.badge { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.badge.out { color: var(--blue); } .badge.in { color: var(--green); } .badge.wo { color: var(--gold); }

/* ---- панель вкладок ---- */
.tabbar { position: fixed; left: 14px; right: 14px; bottom: calc(var(--safe-b) + 12px); z-index: 40; display: flex; padding: 6px; border-radius: 22px;
  background: rgba(14,14,14,.78); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px 6px; border-radius: 16px; color: var(--ink-3); font-size: 10.5px; font-weight: 500; transition: color .15s; }
.tabbar button .ic { width: 23px; height: 23px; }
.tabbar button.on { color: var(--ink); }

/* ---- прочее ---- */
.empty { text-align: center; color: var(--ink-3); padding: 44px 16px; }
.empty .sym { margin: 0 auto 14px; width: 44px; height: 44px; color: var(--ink-4); }
.empty .sym .ic { width: 40px; height: 40px; stroke-width: 1.2; }
.empty h2 { margin: 4px 0 4px; font-size: 18px; font-weight: 600; color: var(--ink); }
.empty p { margin: 0; font-size: 14px; }
.done { text-align: center; padding: 28px 8px 10px; }
.done .ring { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--green); color: var(--green); }
.done .ring .ic { width: 34px; height: 34px; stroke-width: 2; }
.done h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.done p { color: var(--ink-2); margin: 6px 0 16px; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.1); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 18px; right: 18px; bottom: calc(var(--safe-b) + var(--tabbar) + 8px); z-index: 60; padding: 13px 16px; border-radius: 14px; text-align: center; font-weight: 500; font-size: 14.5px;
  background: rgba(24,24,24,.92); border: 1px solid var(--edge); color: #fff; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transform: translateY(12px); opacity: 0; pointer-events: none; transition: all .2s ease-out; }
.toast.show { transform: none; opacity: 1; }
.toast.bad { color: #f3b4ae; border-color: rgba(229,101,91,.5); } .toast.good { color: #bfe6c9; border-color: rgba(95,185,122,.5); }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.96); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.overlay[hidden] { display: none; }
.overlay { flex-direction: column; gap: 12px; }
.overlay img { max-width: 100%; max-height: 85vh; border-radius: 12px; }
.overlay-cap { color: var(--ink-2); font-size: 13.5px; text-align: center; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gcell { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.05); border: 1px solid var(--hair); display: flex; flex-direction: column; justify-content: flex-end; }
.gcell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gcell .gcap, .gcell .gname { position: relative; padding: 4px 7px; font-size: 11px; background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,0)); color: #fff; display: flex; justify-content: space-between; gap: 6px; }
.gcell .gname { padding-top: 0; color: var(--ink-2); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.gcell.missing::after { content: "в архиве"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 12px; }
.note { color: var(--ink-4); font-size: 12.5px; text-align: center; margin: 20px 10px 0; line-height: 1.45; }
.muted { color: var(--ink-2); } .small { font-size: 13px; } .mt { margin-top: 12px; }
.kv { display: flex; gap: 10px; align-items: center; }
.inline-edit { display: flex; gap: 8px; align-items: center; width: 100%; padding: 10px 12px; }
.inline-edit .in { padding: 10px 12px; font-size: 15px; }

/* ---- живая камера ---- */
.cam { position: fixed; inset: 0; z-index: 90; background: #000; display: flex; flex-direction: column; }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-top { position: relative; display: flex; align-items: center; gap: 12px; padding: calc(var(--safe-t) + 10px) 14px 10px; }
.cam-top .ib { width: 44px; height: 44px; border-radius: 14px; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; color: #fff; }
.cam-hint { color: #fff; font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.45); }
.cam-bottom { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 28px); display: flex; justify-content: center; }
.shutter { width: 76px; height: 76px; border-radius: 50%; background: #fff; border: 5px solid rgba(255,255,255,.35); box-shadow: 0 0 0 3px rgba(0,0,0,.4); }
.shutter:active { transform: scale(.92); }

/* ---- статус проверки фото ---- */
.chk { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; margin-left: auto; white-space: nowrap; }
.chk.ok { color: var(--green); background: rgba(95,185,122,.12); }
.chk.warn { color: var(--gold, #D4AF5A); background: rgba(212,175,90,.14); }
.photo-err { color: var(--red); font-size: 13.5px; margin: 0 4px 8px; line-height: 1.35; }
