/* Лёгкое оформление: системные шрифты, без анимаций, теней и картинок — для слабых компьютеров. */
* { box-sizing: border-box; }
html { font: 16px/1.35 "Segoe UI", Tahoma, Arial, sans-serif; color: #1b1b1b; background: #f2f4f6; }
body { margin: 0; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 0 0 10px; }
p { margin: 0 0 10px; }
[hidden] { display: none !important; }
.pad { padding: 20px; }
.muted { color: #667; }
.small { font-size: 13px; }
.warn { color: #b3261e; }
.b { font-weight: 600; }
.right { text-align: right; }
.grow { flex: 1 1 auto; }

/* шапка */
.top { display: flex; flex-wrap: wrap; align-items: center; background: #1f4e79; color: #fff; }
.top nav { display: flex; flex-wrap: wrap; flex: 1 1 auto; }
.top nav a { color: #fff; text-decoration: none; padding: 14px 13px; font-size: 16px; }
.top nav a.active { background: #fff; color: #1f4e79; font-weight: 600; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 6px 14px; font-size: 14px; }
.status .muted { color: #cfdbe7; }
.dot::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot.on::before { background: #5fd38d; }
.dot.off::before { background: #ffb347; }
.badge { background: #ffb347; color: #222; padding: 2px 8px; border-radius: 10px; text-decoration: none; }
.badge.err { background: #ff6b5e; color: #fff; }
main { padding: 14px; max-width: 1400px; margin: 0 auto; }

/* кнопки и поля — крупные, под палец */
.btn { font: inherit; min-height: 44px; padding: 8px 16px; border: 1px solid #b8c0c8; border-radius: 4px; background: #fff; color: #1b1b1b; cursor: pointer; }
.btn:active { background: #e3e8ed; }
.btn:disabled { opacity: .5; }
.btn.primary { background: #1f4e79; border-color: #1f4e79; color: #fff; }
.btn.primary:active { background: #173a5a; }
.btn.danger { color: #b3261e; border-color: #dba7a3; }
.btn.big { min-height: 52px; font-size: 18px; padding: 10px 24px; }
.btn.sq { min-width: 44px; padding: 0; font-size: 22px; line-height: 1; }
.link { font: inherit; background: none; border: 0; border-bottom: 1px dashed #889; padding: 4px 0; cursor: pointer; color: inherit; }
input[type=text], input[type=password], input[type=number], input[type=date], select {
  font: inherit; min-height: 44px; padding: 6px 10px; border: 1px solid #b8c0c8; border-radius: 4px; background: #fff; width: 100%; }
input:focus, select:focus { outline: 2px solid #5b9bd5; outline-offset: -1px; }
.scan { font-size: 20px; min-height: 52px; }
input.cellin, input[type=text].cellin, input[type=number].cellin { width: 96px; flex: none; text-align: right; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.row.end { justify-content: flex-end; margin-top: 12px; }
.field { display: block; margin-bottom: 10px; }
.field > span { display: block; font-size: 14px; color: #556; margin-bottom: 3px; }
.field.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.field.inline > span { margin: 0; white-space: nowrap; }
.field.inline select, .field.inline input { width: auto; }
.field.inline.grow input { width: 100%; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; }

/* таблицы */
.tbl { width: 100%; border-collapse: collapse; background: #fff; }
.tbl th { text-align: left; font-size: 13px; font-weight: 600; color: #556; padding: 8px 10px; border-bottom: 2px solid #d5dbe1; white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid #e3e7eb; vertical-align: middle; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl td.grow { width: 99%; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:active { background: #e9eff5; }
.tbl .empty { text-align: center; color: #778; padding: 28px 10px; }
.tbl .qty { white-space: nowrap; }
.qv { min-width: 64px; font-weight: 600; margin: 0 4px; }
.scroll-x { overflow-x: auto; }

/* поиск товара */
.picker { margin-bottom: 12px; }
.results, .list { background: #fff; margin-bottom: 10px; }
/* Список найденных товаров прокручивается сам и не растягивает страницу. */
.results { max-height: 40vh; overflow-y: auto; border: 1px solid #d5dbe1; }
.results:empty { display: none; }
.result { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 12px; font: inherit; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #e3e7eb; cursor: pointer; color: inherit; }
.result:active { background: #e9eff5; }

/* касса */
.sale { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.sale-main { flex: 1 1 520px; min-width: 0; }
.sale-side { flex: 0 0 260px; display: flex; flex-direction: column; gap: 10px; background: #fff; padding: 14px; border: 1px solid #d5dbe1; }
.total { font-size: 40px; font-weight: 700; line-height: 1.1; }
.pay { min-height: 68px; font-size: 22px; }
.sale-info { border-top: 1px solid #e3e7eb; padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.sale-info:empty { display: none; }
.row2 { display: flex; gap: 8px; }
.row2 .btn { flex: 1 1 0; padding: 8px 6px; }
.kit-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.form2 { display: flex; flex-wrap: wrap; gap: 0 12px; }
.form2 .field { flex: 1 1 200px; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs .btn.on { background: #1f4e79; border-color: #1f4e79; color: #fff; }
.change { font-size: 24px; font-weight: 700; color: #1a7f45; }
@media (max-width: 820px) { .sale-side { flex: 1 1 100%; } }

/* карточки настроек */
.cards { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.card { flex: 1 1 320px; background: #fff; border: 1px solid #d5dbe1; padding: 14px; min-width: 0; }
.summary { display: flex; flex-wrap: wrap; gap: 8px 28px; background: #fff; border: 1px solid #d5dbe1; padding: 10px 14px; margin-bottom: 12px; }
.summary:empty { display: none; }
.notice { background: #fff4e5; border: 1px solid #f0c080; padding: 10px 12px; margin-bottom: 12px; }
.notice p { margin: 6px 0 0; }
.notice code { background: #fff; padding: 1px 4px; border: 1px solid #e0d0b0; word-break: break-all; }

/* окна */
.modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 10px; overflow-y: auto; z-index: 10; }
.box { background: #fff; width: 100%; max-width: 520px; padding: 16px; border-radius: 4px; }
.box .btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.box.np { max-width: 360px; }
.box.wide { max-width: 900px; }
.box .body { max-height: 70vh; overflow-y: auto; }
.np-disp { font-size: 36px; font-weight: 700; text-align: right; padding: 6px 10px; border: 1px solid #b8c0c8; border-radius: 4px; min-height: 60px; }
.np-hint { min-height: 24px; text-align: right; color: #1a7f45; font-weight: 600; margin: 4px 0; }
.np-keys { display: flex; flex-wrap: wrap; margin: -4px; }
.np-keys .btn { flex: 0 0 calc(33.333% - 8px); margin: 4px; min-height: 60px; font-size: 24px; }

.login { max-width: 380px; margin: 8vh auto; background: #fff; padding: 22px; border: 1px solid #d5dbe1; }
.login .btn { width: 100%; }
.err-text { color: #b3261e; min-height: 20px; }

#toasts { position: fixed; left: 0; right: 0; bottom: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 20; pointer-events: none; }
.toast { background: #2c3e50; color: #fff; padding: 10px 18px; border-radius: 4px; max-width: 92vw; }
.toast.err { background: #b3261e; }

/* печать: на бумагу попадает только блок #print */
#print { display: none; }
@media print {
  html, body { background: #fff; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; color: #000; }
  .receipt { font: 11px/1.3 "Courier New", monospace; padding: 2mm 1mm 6mm; }
  .receipt hr { border: 0; border-top: 1px dashed #000; margin: 1.5mm 0; }
  .r-shop { text-align: center; font-weight: bold; font-size: 13px; }
  .r-c { text-align: center; }
  .r-line { display: flex; justify-content: space-between; }
  .r-total { font-weight: bold; font-size: 14px; }
  .r-bye { margin-top: 3mm; }
  .label { overflow: hidden; padding: 1.5mm 2mm; display: flex; flex-direction: column; font-family: Arial, sans-serif; color: #000; }
  .l-name { font-size: 9pt; line-height: 1.1; max-height: 2.2em; overflow: hidden; }
  .l-price { font-size: 17pt; font-weight: bold; line-height: 1.15; }
  .l-price small { font-size: 8pt; font-weight: normal; }
  .l-bar { flex: 1 1 0; min-height: 0; }
  .l-bar svg { width: 100%; height: 100%; display: block; }
  .l-code { font-size: 8pt; }
  .p-labels.thermo .label { page-break-after: always; break-after: page; }
  .p-labels.a4 { display: flex; flex-wrap: wrap; }
  .p-labels.a4 .label { border: 0.2mm solid #999; page-break-inside: avoid; break-inside: avoid; }
}
