/* Ввод количества (заготовка) */
.numpad { max-width: 420px; margin: 0 auto; text-align: center; }
.numpad-hint { margin: 0 0 8px; }
.numpad-display { font-size: 3rem; font-weight: 700; margin: 8px 0 20px; min-height: 64px; }
.numpad-display .muted { font-size: 1.6rem; font-weight: 600; }
.numpad .pin-keys > span { display: block; }
.numpad-ok { margin-top: 18px; min-height: 84px; font-size: 1.4rem; }
.numpad-ok:disabled { opacity: .4; }
.chip { min-height: 52px; padding: 0 18px; border: 0; border-radius: 14px; background: var(--field); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.chip:active { background: var(--surface-pressed); }

/* Готово + превью этикетки */
.done { max-width: 520px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.done h1 { margin: 0; }
.done-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.day-nav { align-items: center; gap: 8px; }
.day-nav strong { font-size: 1.15rem; }

/* Этикетка (размер — в kitchen/templates/kitchen/printing/label.html): на экране превью, при печати — только она */
.label-paper {
  padding: 2mm 2.5mm; box-sizing: border-box;
  background: #fff; color: #000; text-align: left; border-radius: 6px; outline: 1px dashed #c8cbd0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; overflow: hidden;
  display: flex; flex-direction: column; gap: .6mm;
}
.lb-name { font-size: 4.8mm; font-weight: 800; line-height: 1.05; max-height: 10.2mm; overflow: hidden; margin-bottom: .8mm; }
.lb-row { display: flex; justify-content: space-between; gap: 2mm; font-size: 3.1mm; line-height: 1.25; }
.lb-row b { white-space: nowrap; }
.lb-until { font-size: 3.3mm; }
.lb-row span { white-space: nowrap; }
.lb-until b { font-weight: 800; }
.lb-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 3mm; font-weight: 600; border-top: .2mm solid #000; padding-top: .6mm; }
.label-extra-copy { display: none; }
.label-copies-dialog { width: min(340px, calc(100vw - 32px)); padding: 24px; border: 0;
  border-radius: 24px; background: var(--surface); color: var(--text); text-align: center; }
.label-copies-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.label-copies-dialog h2 { margin: 0; font-size: 1.2rem; text-transform: none; color: var(--text); }
.label-copies-stepper { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px;
  align-items: center; gap: 12px; margin: 24px 0; }
.label-copies-stepper .btn { min-height: 56px; padding: 0; font-size: 1.6rem; }
.label-copies-stepper input { width: 100%; min-width: 0; height: 56px; padding: 0;
  border: 0; border-radius: 14px; background: var(--field); color: var(--text);
  text-align: center; font: inherit; font-size: 1.5rem; appearance: textfield; -moz-appearance: textfield; }
.label-copies-stepper input::-webkit-inner-spin-button,
.label-copies-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.label-copies-dialog > .btn { margin-top: 10px; min-height: 52px; }

@media print {
  /* На бумагу идёт только этикетка: всё, что её не содержит, убираем совсем. */
  body *:not(:has(#label-print)):not(#label-print):not(#label-print *) { display: none !important; }
  html, body, main.page, .done { background: #fff !important; margin: 0 !important; padding: 0 !important; gap: 0 !important; display: block !important; }
  #label-print .label-paper { display: flex; border-radius: 0; outline: none;
    break-inside: avoid; break-after: page; page-break-after: always; }
  #label-print .label-paper:last-child { break-after: auto; page-break-after: auto; }
}
.big-icon.problem { color: var(--problem); }

/* Списание: причина */
.reason { max-width: 720px; margin: 0 auto; text-align: center; }
.reason h1 { margin: 8px 0 20px; }
.reason-summary { font-size: 1.2rem; margin: 0; }
.reason-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.reason-btn {
  min-height: 104px; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--text);
  font: inherit; font-size: 1.35rem; font-weight: 700; cursor: pointer; touch-action: manipulation;
}
.reason-btn:active { background: var(--surface-pressed); }
.reason-btn[data-other] { grid-column: 1 / -1; }
.reason-other { display: none; text-align: left; margin-top: 18px; }
.reason-other.open { display: block; }
.reason-other input { width: 100%; min-height: 60px; padding: 0 18px; font: inherit; font-size: 1.1rem; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); margin-bottom: 12px; }
.reason-photo { margin-top: 20px; }
.report-total { display: flex; justify-content: space-between; align-items: baseline; }
.report-total b { font-size: 1.8rem; }
.wo-photo { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; display: block; }
@media (max-width: 700px) { .reason-grid { grid-template-columns: 1fr; } }

/* Продажи за день */
.sale-rows { display: flex; flex-direction: column; gap: 6px; }
.sale-row { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--field); cursor: text; }
.sale-row[hidden] { display: none; }
.sale-name { flex: 1; min-width: 0; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sale-name .tag-check { margin-top: 0; }
.sale-price { white-space: nowrap; }
.sale-row input { width: 110px; min-height: 52px; padding: 0 14px; font: inherit; font-size: 1.15rem; text-align: right; border: 0; border-radius: 12px; background: var(--surface); color: var(--text); }
.sale-entry { display: grid; grid-template-columns: minmax(0, 1fr) 88px; gap: 16px; padding: 14px 12px 14px 16px; }
.sale-dish { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.sale-entry .sale-name { display: block; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.sale-entry .sale-price { font-size: .875rem; line-height: 1.4; white-space: normal; }
.sale-quantity { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.sale-entry .sale-quantity input { width: 100%; min-width: 0; font-size: 1rem; }
.sale-quantity > .muted { font-size: .8rem; line-height: 1.3; }
.sales-detail-price { display: none; }
@media (max-width: 600px) {
  .sales-detail-table, .sales-detail-table tbody, .sales-detail-table tfoot { display: block; }
  .sales-detail-table thead { display: none; }
  .sales-detail-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(80px, .7fr); gap: 14px 16px; padding: 18px 0; border-bottom: 1px solid var(--sep); }
  .sales-detail-table tr:last-child { border-bottom: 0; }
  .table.sales-detail-table td { display: block; padding: 0; border: 0; min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: left; font-size: .9rem; }
  .sales-detail-table td:nth-child(2), .sales-detail-table td:nth-child(4) { text-align: right; }
  .sales-detail-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .75rem; margin-bottom: 4px; }
  .sales-detail-name { line-height: 1.4; font-weight: 500; }
  .sales-detail-price { display: block; margin-top: 6px; font-size: .8rem; line-height: 1.4; }
}
.sale-form input[type=date], .sale-form #id_comment { width: 100%; min-height: 60px; padding: 0 18px; font: inherit; font-size: 1.1rem; color: var(--text); border: 0; border-radius: 14px; background: var(--field); }
.log-row .muted { display: block; }

/* Остатки */
.stock-table tbody tr { cursor: pointer; }
.stock-table a { color: inherit; text-decoration: none; font-weight: 600; }
.stock-problem td:nth-child(2) b { color: var(--problem); }
.tag-problem { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--problem-bg); font-size: .85rem; font-weight: 600; }
.tag-problem .icon { color: var(--problem); width: 1em; height: 1em; }
.stock-table .tag-check { margin: 0 0 0 8px; padding: 2px 10px; font-size: .85rem; }
.minus { color: var(--problem); }
.plus { color: var(--ok); }

/* Пересчёт */
.count-head { display: flex; justify-content: space-between; padding: 0 16px 6px; font-size: .9rem; }
.count-row { flex-wrap: wrap; }
.opening-form .count-row:has(.opening-value):not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) 130px 130px; padding: 14px 16px; gap: 12px; }
.opening-form .opening-value { display: grid; gap: 6px; min-width: 0; font-weight: 400; font-size: .85rem; }
.opening-form .opening-value input { width: 100%; min-width: 0; min-height: 44px; font-size: 1rem; }
@media (max-width: 600px) {
  .opening-form .count-row:has(.opening-value):not([hidden]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opening-form .count-row:has(.opening-value) .sale-name { grid-column: 1 / -1; min-width: 0; }
}
.count-expected { min-width: 110px; text-align: right; white-space: nowrap; }
.count-price { flex-basis: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.count-price .tag-check { margin-top: 0; }
.count-section { font-size: 1.15rem; margin: 24px 0 10px; }
/* Инвентаризация из Excel: кнопка загрузки, незнакомые названия, вид пересчёта. */
.count-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 16px; }
.count-file-note { margin-bottom: 16px; }
.count-unknown { flex-wrap: wrap; }
.count-unknown select { min-height: 52px; max-width: 100%; border: 0; border-radius: 12px; padding: 0 12px; font: inherit; background: var(--surface); color: var(--text); }
.count-remember { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-weight: 600; }
.count-remember input { width: 24px; height: 24px; }
.count-kind { margin-top: 8px; }
.count-apply { margin-bottom: 20px; }
.count-row .sale-name { flex-direction: column; align-items: flex-start; gap: 2px; }
.count-row .sale-name small { font-weight: 400; }
.count-asked { box-shadow: inset 0 0 0 2px var(--check); }
.filter-row[hidden] { display: none; }

/* ---------- Планшет не подключён к кухне ---------- */
.device-gate { max-width: 760px; margin: 0 auto; display: grid; gap: 32px; }
.device-gate h1 { margin: 0 0 12px; }
.device-gate p { margin: 0; font-size: 1.1rem; line-height: 1.5; }
.device-gate .home-main { min-height: 280px; grid-row: auto; }
.device-connect { max-width: 760px; }
.device-hint { margin-top: 24px; }
.network-card { margin-top: 32px; }
.network-card h2 { margin: 0 0 12px; font-size: 1.2rem; }
.network-card > p { line-height: 1.5; }
.network-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--field); }
.network-row strong { display: block; overflow-wrap: anywhere; }
.network-row small { display: block; margin-top: 4px; }
.network-here { margin: 20px 0 16px; overflow-wrap: anywhere; }
.tag-ok { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; background: var(--ok-bg); font-size: .9rem; font-weight: 600; }
.tag-ok .icon { color: var(--ok); width: 1em; height: 1em; }

/* ---------- Стартовая инвентаризация ---------- */
.start-intro { margin-bottom: 24px; }
.start-intro p { margin: 0; line-height: 1.5; }
.start-intro .start-intro-title { margin-bottom: 8px; font-size: 1.15rem; font-weight: 600; }
@media (min-width: 700px) {
  .count-start .count-row { flex-wrap: nowrap; }
  .count-start .count-row .count-price { flex-basis: 210px; flex-shrink: 0; }
  .count-start .count-head-shelf { margin-left: auto; margin-right: 160px; }
  .count-start .count-head-price { flex-basis: 110px; text-align: right; }
}
.start-note { margin: 16px 0 0; }
/* Расхождения: сводка за период (блок 5). */
.discrepancy-period { margin: 0 0 12px; }
.discrepancy-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.discrepancy-tile { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.discrepancy-tile strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
