/* Старкинд · цены. Мотив — полочный ценник: жёлтая плашка цены, графитовая шапка, знак 1С. */
:root {
  --bg: #eef1f4; --card: #ffffff; --ink: #1c2329; --muted: #6b7680; --line: #dfe4e9; --soft: #f6f8fa;
  --head: #1f272e; --head-ink: #f2f5f7; --head-muted: #9aa7b2;
  --tag: #ffd200; --tag-ink: #1c1c1c; --red: #d6262b;
  --act: #1f272e; --act-ink: #ffffff;
  --up: #e6f5ec; --up-ink: #17703f; --down: #fdeaea; --down-ink: #b3261e; --new: #fff6cc;
  --warn: #b45309; --shadow: 0 1px 2px rgba(20, 30, 40, .06), 0 4px 14px rgba(20, 30, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12171b; --card: #1a2126; --ink: #e7ecef; --muted: #91a0ab; --line: #2a333a; --soft: #20282e;
    --head: #0c1013; --act: #ffd200; --act-ink: #1c1c1c;
    --up: #163323; --up-ink: #6fd69a; --down: #3a1d1d; --down-ink: #ff8a80; --new: #3a3410; --warn: #f5a524;
    --shadow: none; color-scheme: dark; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
a { color: inherit; }
small, .small { font-size: 12.5px; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.r { text-align: right; }
.c { text-align: center; }
[hidden] { display: none !important; }

button, .btn { font: inherit; font-weight: 600; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .btn:hover { border-color: var(--muted); }
button.primary, .btn.primary { background: var(--act); color: var(--act-ink); border-color: var(--act); }
button.tagbtn { background: var(--tag); color: var(--tag-ink); border-color: var(--tag); }
button.ghost { background: transparent; }
button.danger { color: var(--down-ink); }
input, select { font: inherit; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--tag); outline-offset: 0; border-color: var(--tag); }

/* шапка */
.top { background: var(--head); color: var(--head-ink); }
.top .in { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: .2px; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--tag); color: var(--red); display: grid; place-items: center;
  font: 800 17px/1 Arial, Helvetica, sans-serif; letter-spacing: -.5px; flex: none; }
.brand small { display: block; font-weight: 500; color: var(--head-muted); font-size: 12px; }
nav { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; }
nav a { text-decoration: none; color: var(--head-muted); padding: 8px 12px; border-radius: 9px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
nav a:hover { color: var(--head-ink); background: rgba(255, 255, 255, .06); }
nav a.on { color: var(--tag-ink); background: var(--tag); }
.badge { background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; line-height: 18px; }
nav a.on .badge { background: var(--tag-ink); color: var(--tag); }
.who { display: flex; gap: 10px; align-items: center; margin: 0; color: var(--head-muted); font-size: 13px; }
.who button { background: transparent; color: var(--head-ink); border-color: rgba(255, 255, 255, .18); padding: 6px 12px; }
.sync { max-width: 1120px; margin: 0 auto; padding: 6px 16px 0; font-size: 12px; color: var(--muted); }
.sync.bad { color: var(--down-ink); font-weight: 600; }
main { padding: 8px 16px 110px; max-width: 1120px; margin: 0 auto; }
h2 { font-size: 21px; margin: 14px 0 10px; text-wrap: balance; letter-spacing: -.2px; }
h3 { font-size: 16px; margin: 22px 0 8px; }

/* поиск */
.search { position: sticky; top: env(safe-area-inset-top, 0px); padding: 10px 0; background: var(--bg); z-index: 4; }
.search .box { display: flex; align-items: center; gap: 10px; background: var(--card); border: 2px solid var(--ink); border-radius: 14px;
  padding: 4px 6px 4px 14px; box-shadow: var(--shadow); }
.search .box:focus-within { border-color: var(--tag); box-shadow: 0 0 0 4px rgba(255, 210, 0, .25); }
.search input { flex: 1; border: 0; font-size: 19px; padding: 10px 0; background: transparent; min-width: 0; }
.search input:focus { outline: none; }
.search svg { flex: none; color: var(--muted); }
.hint { color: var(--muted); padding: 18px 4px; }

/* карточки товаров */
.items { display: grid; gap: 8px; }
.item { background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); display: grid;
  grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; border: 1px solid transparent; }
.item.incart { border-color: var(--tag); }
.item .nm { font-weight: 650; font-size: 15.5px; }
.item .meta { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.price { justify-self: end; text-align: right; }
.pricetag { background: var(--tag); color: var(--tag-ink); border: 0; border-radius: 8px 8px 8px 2px; padding: 6px 12px;
  font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.3px; cursor: pointer; }
.pricetag small { font-size: 12px; font-weight: 600; }
.pricetag.none { background: var(--soft); color: var(--muted); }
.pend { color: var(--warn); font-size: 12px; font-weight: 700; margin-top: 4px; }
.sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.stepper button { border: 0; border-radius: 0; padding: 7px 12px; font-size: 17px; line-height: 1; }
.stepper input { border: 0; border-radius: 0; width: 46px; text-align: center; padding: 7px 0; font-variant-numeric: tabular-nums; }
.editprice { display: flex; gap: 6px; justify-content: flex-end; }
.editprice input { width: 100px; font-size: 18px; text-align: right; }

/* таблицы */
.panel { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
.list td, .list th { padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.list tr:last-child td { border-bottom: 0; }
.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; background: var(--soft); white-space: nowrap; }
.list th.r { text-align: right; }
.list input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--act); }
tr.link { cursor: pointer; }
tr.link:hover td { background: var(--soft); }
tr.up td { background: var(--up); }
tr.down td { background: var(--down); }
tr.new td { background: var(--new); }
.mv { font-weight: 700; font-size: 12px; white-space: nowrap; }
.mv.up { color: var(--up-ink); }
.mv.down { color: var(--down-ink); }
.newprice { width: 84px; text-align: right; font-weight: 700; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; background: var(--soft); font-size: 12px; font-weight: 600; }
.tag.okt { background: var(--up); color: var(--up-ink); }
.tag.warn { background: var(--down); color: var(--down-ink); }
.note { padding: 10px 14px; border-radius: 12px; margin: 8px 0; background: var(--up); color: var(--up-ink); font-weight: 600; }
.err { color: var(--down-ink); }
form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); margin: 6px 0 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }

.printbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 18px rgba(20, 30, 40, .08); padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
.printbar .in { max-width: 1120px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.printbar .grow { flex: 1; }
.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.chk input { width: 18px; height: 18px; accent-color: var(--act); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }

/* вход */
body.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: var(--head); }
.login .card { background: var(--card); padding: 28px 24px; border-radius: 18px; width: 100%; max-width: 360px; display: grid; gap: 14px; }
.login .brand { color: var(--ink); font-size: 20px; margin-bottom: 6px; }
.login .brand small { color: var(--muted); }
.login label { display: grid; gap: 5px; color: var(--muted); font-size: 13px; }
.login input { font-size: 17px; }
.login button { justify-content: center; padding: 12px; }

@media (max-width: 640px) {
  .who span { display: none; }
  .top .in { gap: 8px 10px; }
  nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  nav a { white-space: nowrap; }
  .pricetag { font-size: 19px; }
  h2 { font-size: 18px; }
}

/* группы как в 1С */
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0 8px; font-size: 14px; }
.crumbs a { text-decoration: none; padding: 4px 8px; border-radius: 8px; color: var(--muted); font-weight: 600; cursor: pointer; }
.crumbs a:hover { background: var(--card); color: var(--ink); }
.crumbs a.cur { color: var(--ink); }
.crumbs .sep { color: var(--muted); }
.crumbs .scope { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-bottom: 10px; }
.group { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 12px; padding: 11px 12px; box-shadow: var(--shadow);
  cursor: pointer; border: 1px solid transparent; text-align: left; font-weight: 600; color: var(--ink); }
.group:hover { border-color: var(--tag); }
.group .fold { width: 30px; height: 24px; flex: none; border-radius: 4px 7px 7px 7px; background: var(--tag); position: relative; }
.group .fold::before { content: ""; position: absolute; left: 0; top: -4px; width: 13px; height: 6px; border-radius: 3px 3px 0 0; background: var(--tag); }
.group .gn { flex: 1; min-width: 0; overflow-wrap: break-word; hyphens: auto; line-height: 1.25; }
.group .gc { color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

@media (min-width: 760px) {
  .item { grid-template-columns: 1fr auto auto; padding: 10px 14px; }
  .acts { grid-column: auto; flex-wrap: nowrap; }
  .price { min-width: 120px; }
}
