body { font-family: system-ui, sans-serif; margin: 0; background: #f5f6f8; color: #1a1a1a; }
.wrap { max-width: 560px; margin: 40px auto; background: #fff; padding: 28px 32px;
  border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
h1 { font-size: 20px; margin: 0 0 20px; }
label { display: block; margin: 12px 0; font-size: 14px; }
select, input[type=number], input[type=date] { display: block; margin-top: 4px;
  padding: 8px; font-size: 15px; min-width: 220px; border: 1px solid #ccc; border-radius: 6px; }
fieldset { margin: 14px 0; border: 1px solid #ddd; border-radius: 6px; }
button, .btn { background: #2d6cdf; color: #fff; border: 0; padding: 10px 18px;
  font-size: 15px; border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block; }
.secondary { margin-top: 14px; } .secondary button { background: #777; }
.hidden { display: none; } .note { background: #fff7e6; padding: 14px; border-radius: 6px; }
.form-error { color: #b00020; background: #fdecea; border: 1px solid #f5c6cb;
  padding: 10px 14px; border-radius: 6px; }
#az-banner { position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 1000; background: #b00020; color: #fff; padding: 10px 18px;
  border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.25); display: none; }
#az-banner.show { display: block; }
.ok { color: #1a7f37; } .err { color: #c00; } progress { width: 100%; height: 16px; }
.wide { max-width: 1180px; }
table.hist { width: 100%; border-collapse: collapse; font-size: 14px; }
table.hist th, table.hist td { text-align: left; padding: 9px 14px; border-bottom: 1px solid #eee;
  vertical-align: top; }
table.hist th { color: #555; font-weight: 600; }
/* строки данных в одну строку; переносится только длинный столбец «Группа/поставщик» (4-й) */
table.hist td { white-space: nowrap; }
table.hist td:nth-child(4) { white-space: normal; min-width: 220px; }
.muted { color: #999; }
label.inline { display: inline-block; margin: 4px 10px 4px 0; }
/* Прокручивающееся окно для длинных списков (объединения сигарет) */
.scrollbox { max-height: 55vh; overflow-y: auto; overflow-x: hidden; border: 1px solid #e3e3e3;
  border-radius: 8px; padding: 6px 12px; background: #fafafa; }
.scrollbox .note { background: #fff; }
/* Объединения: длинные списки ШК + поставщик переносятся (общий table.hist здесь nowrap —
   снимаем), кнопка действия — в узкой колонке справа. Таблицы помещаются в окно без
   горизонтального скролла; штрихкоды видны переносом. */
#merge-app table.hist td { white-space: normal; overflow-wrap: anywhere; }
#merge-app table.hist td:last-child { white-space: nowrap; width: 1px;
  text-align: right; vertical-align: top; }
#merge-app .auto-cb, #merge-app .sel-cb { vertical-align: text-top; }

/* === Каркас (UX-переработка) === */
.layout { display:flex; min-height:100vh; }
.sidebar { width:200px; flex:0 0 200px; background:#1f2a44; color:#cdd5e3;
  display:flex; flex-direction:column; transition:flex-basis .15s, width .15s; }
.sidebar .brand { display:flex; align-items:center; gap:8px; padding:12px 14px; font-weight:700; color:#fff; }
.sidebar a { display:flex; align-items:center; gap:10px; padding:10px 14px; color:#cdd5e3;
  text-decoration:none; white-space:nowrap; }
.sidebar a:hover { background:#27324d; color:#fff; }
.sidebar a.active { background:#2d6cdf; color:#fff; }
.sidebar .ic { width:20px; text-align:center; font-size:15px; }
body.sidebar-collapsed .sidebar { width:52px; flex-basis:52px; }
body.sidebar-collapsed .sidebar .lbl,
body.sidebar-collapsed .sidebar .brand-name { display:none; }
.main { flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar { display:flex; align-items:center; gap:14px; padding:10px 20px;
  background:#fff; border-bottom:1px solid #e3e6ea; }
.topbar .crumb { font-weight:600; }
.topbar .queue { margin-left:auto; font-size:13px; }
.queue.idle { color:#1a7f37; } .queue.busy { color:#b25e00; }
.burger { background:transparent; color:inherit; border:0; font-size:18px; cursor:pointer; padding:2px 6px; }
.topbar .burger.sm { display:none; }
#content { padding:22px 26px; }
#content h1 { font-size:20px; margin:0 0 18px; }
.panel { background:#fff; border:1px solid #e3e6ea; border-radius:8px; padding:18px 20px; }
.muted-panel { background:#fafbfc; }
.grid2 { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:16px; align-items:start; }
.row { display:flex; gap:14px; flex-wrap:wrap; }
.row > label { flex:1; min-width:160px; }
.label { font-weight:700; font-size:11px; color:#555; text-transform:uppercase; margin-bottom:6px; }
table.hist { background:#fff; }
@media (max-width:760px){
  .grid2 { grid-template-columns:1fr; }
  .sidebar { width:52px; flex-basis:52px; }
  .sidebar .lbl, .sidebar .brand-name { display:none; }
}

/* === Прогресс задачи === */
.phases { list-style:none; padding:0; margin:0; }
.phases li { display:flex; align-items:center; gap:8px; padding:5px 0; }
.phases li.done { color:#1a7f37; } .phases li.cur { color:#2d6cdf; font-weight:600; }
.phases li.todo { color:#b3b8be; }
.phases .ic { width:16px; text-align:center; }
.phases .barwrap { flex:1; max-width:220px; background:#eef0f3; border-radius:6px; height:9px; overflow:hidden; }
.phases .bar { background:#2d6cdf; height:100%; }
.eta { color:#555; margin-top:10px; }
