/* WMS (wms.retsklad.online): экран для ТСД и ПК в духе приложения Kaspi (iOS): белый фон, крупные скруглённые карточки, красный акцент.
   Размеры в rem: wms.js подстраивает корневой размер шрифта под ТСД (у Chrome на ТСД страница рисуется как на широком экране и выходит мелкой). */
:root {
    --red: #f14635;
    --red-press: #d93c2b;
    --red-soft: #fdeceb;
    --red-line: #f6c9c4;
    --green: #3d8b1f;
    --green-soft: #e6f4dd;
    --ink: #111114;
    --ink-2: #6d6d72;
    --ink-3: #a1a1a8;
    --line: #e5e5ea;
    --fill: #f1f1f4;
    --bg: #fff;
}
* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
    background: var(--bg); color: var(--ink);
    font: 1.0625rem/1.4 -apple-system, "SF Pro Text", "Helvetica Neue", Roboto, "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* ---------- вход ---------- */
.wms-login-body { display: flex; min-height: 100vh; min-height: 100dvh; align-items: center; justify-content: center; padding: 1.25rem; }
.wms-login { width: 100%; max-width: 26rem; }
.wms-login h1 { margin: 0; font-size: 2.25rem; font-weight: 800; letter-spacing: -.02em; color: var(--red); }
.wms-login-sub { margin: .125rem 0 1.75rem; color: var(--ink-2); font-size: 1.0625rem; }
.wms-login-form label { display: block; margin: 1rem 0 .375rem; font-size: .9375rem; font-weight: 600; color: var(--ink-2); }
.wms-login-form input { width: 100%; height: 3.5rem; padding: 0 1rem; border: 0; border-radius: .875rem; background: var(--fill); font: inherit; font-size: 1.125rem; color: var(--ink); }
.wms-login-form input:focus { outline: .125rem solid var(--red); outline-offset: 0; background: #fff; }
.wms-login-form button { width: 100%; height: 3.5rem; margin-top: 1.75rem; border: 0; border-radius: .875rem; background: var(--red); color: #fff; font-size: 1.1875rem; font-weight: 700; }
.wms-login-form button:active { background: var(--red-press); }
.wms-login-err { margin: 0 0 .25rem; padding: .75rem 1rem; border-radius: .875rem; background: var(--red-soft); color: var(--red-press); font-size: 1rem; font-weight: 600; }

/* ---------- шапка ---------- */
.wms-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 3.5rem; padding: .375rem 1rem; background: rgba(255,255,255,.94); -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.wms-brand { font-weight: 800; font-size: 1.375rem; letter-spacing: -.01em; color: var(--red); }
.wms-top-right { display: flex; align-items: center; gap: .375rem; min-width: 0; }
.wms-top-right form { margin: 0; }
.wms-user { color: var(--ink-2); font-size: .9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 6.5rem; }
.wms-link { border: 0; background: none; padding: .625rem .5rem; color: var(--red); font-size: 1rem; font-weight: 600; }
.wms-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: .875rem; background: var(--fill); color: var(--ink); }
.wms-icon svg { width: 1.375rem; height: 1.375rem; }
.wms-icon[aria-pressed="false"] { color: var(--ink-3); }
#wmsSound[aria-pressed="false"] .wms-wave { display: none; }
.wms-icon:active { background: #e4e4e9; }

/* ---------- основное ---------- */
.wms-main { width: 100%; max-width: 80rem; margin: 0 auto; padding: 1rem 1rem 2.5rem; }
.wms-title { margin: .25rem .125rem .75rem; font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.wms-scan-row { position: relative; display: flex; align-items: center; gap: .5rem; padding: 0 .375rem 0 1rem; height: 3.75rem; border-radius: 1rem; background: var(--fill); }
.wms-scan-row:focus-within { box-shadow: 0 0 0 .1875rem rgba(241,70,53,.28); background: #fff; outline: .09375rem solid var(--red); }
.wms-scan-ico { flex: none; width: 1.5rem; height: 1.5rem; color: var(--ink-2); }
.wms-scan-input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; font: inherit; font-size: 1.5rem; font-weight: 700; letter-spacing: .02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.wms-scan-input::placeholder { color: var(--ink-3); font-weight: 500; letter-spacing: 0; }
.wms-scan-input:focus { outline: 0; }
.wms-kbd { flex: none; background: transparent; }
.wms-scan-cap { margin: .5rem .25rem 0; font-size: .9375rem; color: var(--ink-2); }

.wms-result { margin-top: 1rem; }
.wms-hint { display: flex; flex-direction: column; align-items: center; gap: .75rem; padding: 3rem 1rem; text-align: center; color: var(--ink-3); font-size: 1.0625rem; }
.wms-hint svg { width: 4rem; height: 4rem; color: #cfcfd6; }
.wms-loading { padding: 2rem 1rem; text-align: center; color: var(--ink-3); font-size: 1.0625rem; }
.wms-error { display: flex; gap: .875rem; align-items: flex-start; padding: 1.125rem 1.25rem; border: 1px solid var(--red-line); border-radius: 1.125rem; background: var(--red-soft); color: var(--red-press); font-size: 1.25rem; font-weight: 700; }
.wms-error svg { flex: none; width: 1.75rem; height: 1.75rem; margin-top: .0625rem; }
.wms-error small { display: block; margin-top: .25rem; font-weight: 500; font-size: 1rem; color: #9a4339; font-variant-numeric: tabular-nums; }

.wms-order { border: 1px solid var(--line); border-radius: 1.25rem; padding: 1.125rem 1.25rem; }
.wms-order-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.wms-order-no { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.wms-status { display: inline-block; padding: .25rem .75rem; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .9375rem; font-weight: 700; }
.wms-status.is-bad { background: var(--red-soft); color: var(--red-press); }
.wms-kv { margin: .875rem 0 0; padding: 0; list-style: none; }
.wms-kv li { display: flex; justify-content: space-between; gap: 1rem; padding: .625rem 0; border-top: 1px solid var(--line); font-size: 1.0625rem; }
.wms-kv span { color: var(--ink-2); flex: none; }
.wms-kv b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.wms-sum { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: .25rem; padding-top: .875rem; border-top: 1px solid var(--line); }
.wms-sum b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.wms-sum span { color: var(--ink-2); font-size: 1.0625rem; text-align: right; }

.wms-h2 { margin: 1.5rem .25rem .625rem; font-size: 1.375rem; font-weight: 800; letter-spacing: -.01em; }
.wms-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); gap: .75rem; margin: 0; padding: 0; list-style: none; }
.wms-item { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .75rem; border: 1px solid var(--line); border-radius: 1.25rem; background: #fff; }
.wms-photo { width: 4.5rem; height: 4.5rem; border-radius: 1rem; background: var(--fill); overflow: hidden; display: flex; align-items: center; justify-content: center; color: #c4c4cb; }
.wms-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wms-photo svg { width: 2rem; height: 2rem; }
.wms-item-body { min-width: 0; }
.wms-item-name { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wms-item-art { margin: .25rem 0 0; font-size: 1rem; color: var(--ink-2); overflow-wrap: anywhere; }
.wms-item-art.is-warn { color: #b26a00; }
.wms-item-sum { margin: .25rem 0 0; font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.wms-qty { min-width: 3.5rem; padding: .5rem .625rem; border-radius: 1rem; background: var(--fill); color: var(--ink); text-align: center; font-size: 1.5rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.wms-qty small { display: block; margin-top: .125rem; font-size: .8125rem; font-weight: 600; color: var(--ink-2); }
.wms-qty.is-many { background: var(--red); color: #fff; }
.wms-qty.is-many small { color: rgba(255,255,255,.85); }

@media (min-width: 62em) {
    .wms-main { padding: 1.5rem 1.5rem 3rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
