/* Оформление нового экрана: системный шрифт (Windows — Segoe UI), вся ширина, спокойная палитра.
   Структура и надписи — как в GAS. */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --text: #16181d; --muted: #5f6672; --line: #dde1e7;
  --ok: #157f3b; --ok-bg: #e3f5e9; --err: #b42318; --err-bg: #fde8e6; --warn: #8a5a00; --warn-bg: #fff4d6;
  --accent: #3a66e8; --orange: #c26a00; --purple: #6a1b9a; --gray: #4b5563;
  /* Айдентика ATARTS (atarts.ru): тёмный #0F172A, синий #4D7CFF (на кнопках чуть темнее — белый текст читается на ярком свету),
     градиент логотипа. Зелёный/красный/жёлтый — только сигналы результата скана. */
  --brand-dark: #0f172a;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 18px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button { font: inherit; cursor: pointer; }
h2 { font-size: 26px; margin: 6px 0 14px; }

/* Шапка */
.top { display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--brand-dark); color: #fff; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .3px; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, #00b2ff, #4d7cff, #8b5cf6); box-shadow: 0 0 0 4px rgba(77, 124, 255, .25); }
.brand-sub { font-weight: 500; opacity: .75; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, .25); }
.env { padding: 2px 8px; border-radius: 6px; background: #8a5a00; font-size: 14px; }
.env:empty { display: none; }
.net { padding: 2px 10px; border-radius: 6px; background: var(--err); font-size: 15px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.op-bar { margin-right: 6px; }
.top-btn { padding: 6px 12px; border: 1px solid #334155; border-radius: 8px; background: #1e293b; color: #fff; font-size: 15px; }

main { padding: 18px 20px 48px; }
.screen[hidden] { display: none; }
.screen.narrow { max-width: 560px; margin: 0 auto; }
.screen.mid { max-width: 860px; margin: 0 auto; }

/* Карточки и строки «подпись — значение», как в GAS */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; }
.label { color: var(--muted); font-size: 15px; margin-bottom: 6px; }
.row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; align-items: baseline; }
.row .k { color: var(--muted); font-size: 15px; min-width: 130px; }
.row .v { text-align: right; font-weight: 600; }
.separator { border-top: 1px solid var(--line); margin: 10px 0; }
.qty-big { font-size: 26px; font-weight: 900; color: var(--err); }
.badge-loc { display: inline-block; padding: 2px 10px; border-radius: 8px; background: var(--brand-dark); color: #fff; font-weight: 700; letter-spacing: .5px; }
.art { color: var(--accent); font-weight: 700; }
.addr-big { text-align: center; padding: 10px 0; }
.addr-big .lbl { font-size: 14px; color: var(--muted); }
.addr-big .addr { font-size: 40px; font-weight: 900; letter-spacing: 1px; }
.addr-big .sub { font-size: 15px; color: var(--muted); margin-top: 4px; }
.warn-box { padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-weight: 600; margin-top: 8px; }
.note { margin-top: 10px; padding: 10px 12px; border-radius: 8px; border-left: 5px solid #9aa0a6; background: #f1f3f4; color: #444; font-size: 15px; }
.note.warn { border-left-color: #e65100; background: #fff3e0; color: #a13d00; font-weight: 700; font-size: 17px; }
.photo-btn { margin-left: 8px; font-size: 14px; }

/* Кнопки — во всю ширину, как в GAS */
.btn { display: block; width: 100%; padding: 14px 18px; margin: 8px 0 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font-size: 18px; text-align: center; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-success { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 600; }
.btn-secondary { background: var(--gray); border-color: var(--gray); color: #fff; }
.btn-warn { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-danger-text { color: var(--err); }
.btn:focus-visible, .top-btn:focus-visible, .task-row:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn[hidden] { display: none; }

/* Поля ввода и сообщения */
.big-input { width: 100%; font-size: 24px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 10px; margin: 4px 0 8px; background: #fff; }
.big-input:focus { border-color: var(--accent); outline: none; }
.big-input.scan { margin-top: 10px; }
.error-box { padding: 14px 16px; border: 2px solid var(--err); border-radius: 10px; background: var(--err-bg); color: var(--err); font-size: 21px; font-weight: 700; margin: 6px 0; }
.error-box[hidden] { display: none; }
.msg { padding: 12px 16px; border-radius: 10px; font-size: 19px; font-weight: 600; margin: 4px 0 0; }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.warning, .msg.manual, .msg.queued { background: var(--warn-bg); color: var(--warn); }
.msg[hidden] { display: none; }
.step-tag { display: inline-block; padding: 4px 12px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 15px; margin: 10px 2px; }

/* Смена: две колонки на широком экране (склад, 16.09.2026) */
.shift-layout { display: grid; grid-template-columns: 380px 1fr; gap: 24px; max-width: 1280px; margin: 0 auto; align-items: start; }
.shift-left { position: sticky; top: 72px; }
.not-done-block { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-radius: 12px; background: #c5221f; color: #fff; margin-bottom: 12px; }
.not-done-block.zero { background: var(--ok); }
.not-done-lbl { font-size: 14px; font-weight: 700; letter-spacing: 1px; opacity: .9; }
.not-done-num { font-size: 48px; font-weight: 800; line-height: 1.1; }
.not-done-of { font-size: 14px; opacity: .85; text-align: right; }
.shift-summary .row { padding: 4px 0; }
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: left; }
.task-row .partner { font-weight: 700; font-size: 19px; }
.task-row .num { color: var(--muted); font-size: 15px; }
.task-row .items { grid-column: 1 / -1; }
.badge { justify-self: end; align-self: start; padding: 2px 10px; border-radius: 999px; background: var(--bg); font-size: 15px; white-space: nowrap; }
.badge.s-PICKING, .badge.s-PICKED { background: #e6eefc; color: var(--accent); }
.badge.s-PACKED { background: var(--warn-bg); color: var(--warn); }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--panel); border-radius: 12px; border: 1px solid var(--line); }

/* Таблица всего заказа — дополнение к шагам GAS */
.order-table-wrap { margin-top: 22px; }
.lines { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.lines caption { text-align: left; color: var(--muted); font-size: 15px; padding: 0 2px 6px; }
.lines th, .lines td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 16px; }
.lines th { font-size: 14px; color: var(--muted); font-weight: 600; }
.lines tr.done td { color: var(--ok); }
.lines tr.current td { background: #eef3fd; font-weight: 600; }
.lines .small { font-size: 13px; color: var(--muted); font-weight: 400; }

/* Готово */
.done-icon { font-size: 64px; text-align: center; margin-top: 20px; }
.done-title { font-size: 40px; font-weight: 900; text-align: center; color: var(--ok); }
.done-sub { text-align: center; color: var(--muted); margin: 8px 0 16px; font-size: 18px; }

/* Настройки */
.switch { display: flex; gap: 10px; align-items: center; padding: 10px 0; font-size: 19px; }
.switch input { width: 22px; height: 22px; }

/* Тестовый стенд */
.demo { margin-top: 18px; padding: 12px 16px; background: #fffbea; border: 1px dashed #c9a227; border-radius: 12px; }
.demo summary { cursor: pointer; color: var(--warn); }
.demo-codes { font-size: 15px; margin-top: 8px; }
.demo-pad { margin-top: 14px; padding: 10px 12px; border: 1px dashed #c9a227; border-radius: 12px; background: #fffbea; }
.demo-pad .t { font-size: 14px; color: var(--warn); margin-bottom: 6px; }
.demo-pad .b { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-pad button { padding: 6px 10px; border: 1px solid #e3c766; border-radius: 8px; background: #fff; font-size: 14px; }

@media (max-width: 900px) {
  .shift-layout { grid-template-columns: 1fr; }
  .shift-left { position: static; }
}

/* Партнёры (администратор) */
.screen.wide { max-width: 1280px; margin: 0 auto; }
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.btn-inline { width: auto; display: inline-block; margin: 0; }
.partners-list { display: flex; flex-direction: column; gap: 10px; }
.p-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-align: left; width: 100%; }
.p-row.off { opacity: .6; }
.p-row .p-name { font-weight: 700; font-size: 19px; }
.p-row .p-sub { color: var(--muted); font-size: 14px; }
.mp { font-size: 15px; }
.mp .t { font-weight: 700; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: #9aa0a6; }
.dot.ok { background: var(--ok); } .dot.err { background: var(--err); } .dot.warn { background: #e6a700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 6px 0 8px; }
.form-grid label { display: flex; flex-direction: column; font-size: 14px; color: var(--muted); gap: 4px; }
.form-grid label.wide { grid-column: 1 / -1; }
.form-grid label.chk { flex-direction: row; align-items: center; gap: 8px; font-size: 17px; color: var(--text); }
.inp { font: inherit; font-size: 17px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.inp:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.wh-list { font-size: 15px; margin-top: 8px; }
@media (max-width: 900px) { .p-row { grid-template-columns: 1fr; } .form-grid { grid-template-columns: 1fr; } }

/* Фильтр по партнёрам над списком (как в GAS) */
.pt-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; }
.pt-filter button { padding: 6px 14px; border: 1px solid var(--brand-dark); border-radius: 18px; background: #fff; color: var(--brand-dark); font-size: 15px; font-weight: 600; }
.pt-filter button.on { background: var(--brand-dark); color: #fff; }
.prod-name { font-size: 20px; font-weight: 800; }
.done-msg { font-size: 15px; }
