.inventory {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.inventory-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.inventory-toolbar > div {
  font-size: 22px;
  font-weight: 700;
  margin-right: auto;
}
.inventory-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid #d5deea;
}
.inventory-tabs .selected,
.inventory-tabs .button.selected:hover:not(:disabled) {
  background: #0047bb;
  color: white;
  border-color: #0047bb;
}
.inventory-filters {
  display: grid;
  grid-template-columns: minmax(180px, 2fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 12px;
}
.inventory input,
.inventory select,
.inventory-editor input,
.inventory-editor select {
  min-height: 44px;
  width: 100%;
  box-sizing: border-box;
}
.inventory-table {
  max-width: 100%;
  overflow: auto;
  border: 1px solid #d5deea;
  border-radius: 12px;
  background: white;
}
.inventory-table table {
  width: 100%;
  border-collapse: collapse;
}
.inventory-table th,
.inventory-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #e7ecf2;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.inventory-table th {
  background: #f5f7fb;
  white-space: nowrap;
}
.inventory-table tr:last-child td {
  border-bottom: 0;
}
.inventory-table summary {
  color: #0047bb;
  cursor: pointer;
  min-height: 44px;
}
.inventory-table details[open] {
  min-width: min(600px, 70vw);
}
.inventory-lines {
  display: grid;
  gap: 14px;
}
.inventory-line {
  display: grid;
  grid-template-columns: minmax(170px, 2fr) minmax(90px, 1fr) 90px;
  gap: 12px;
  padding: 16px;
  background: #f5f7fb;
  border: 1px solid #d5deea;
  border-radius: 12px;
  align-items: start;
}
.inventory-line > .field:nth-child(4) {
  grid-column: 1 / 3;
}
.inventory-editor {
  width: min(980px, calc(100vw - 32px));
}
.inventory-editor .check {
  margin: 16px 0;
}
.inventory-editor .check input {
  width: 20px;
  min-height: 20px;
}
.inventory-preview {
  min-width: 0;
}
@media (max-width: 650px) {
  .inventory-filters,
  .inventory-line {
    grid-template-columns: 1fr;
  }
  .inventory-line > .field:nth-child(4) {
    grid-column: auto;
  }
  .inventory-tabs .button {
    flex: 1 1 40%;
  }
  .inventory-toolbar > div {
    flex-basis: 100%;
  }
}
.inventory > *,
.inventory-editor > * {
  min-width: 0;
}
.inventory-line > .button {
  justify-self: start;
  align-self: end;
}

/* Lane bo-ui stock P1 (capabilities.stock_p1 only): words stay whole in the narrow report and
   document columns, and the quick waste tiles sit in a row that wraps. */
.inventory-p1 .inventory-table td {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}
.op-quick-waste {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.op-quick-waste .op-quick-tile {
  min-height: 44px;
}

/* Lane bo-ui step 5 «Списание по продажам» (capabilities.stock_p1 only): the mode, queue and
   links blocks keep their distance, the row actions wrap and stay tappable on the phone. */
.autoconsume > section {
  margin-top: 20px;
}
.autoconsume > section > h3 {
  margin: 0 0 8px;
}
.autoconsume-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.autoconsume-actions .button {
  min-height: 40px;
}
.autoconsume-link-line {
  align-items: end;
}
/* Lane bo-ui2 step 4 stock reports (capabilities.stock_reports only): the actions of «Остатки»
   and «К заказу» in one row, a tappable checkbox per row and «Откуда» under the name. */
.inventory .op-actions {
  margin: 8px 0;
}
/* Step 6 pass: the buttons wrap on a phone; the checkbox keeps its own size (the generic
   `.inventory input` rule made it a 44 px square stretched over its column). */
.inventory .stock-reorder-tools {
  flex-wrap: wrap;
}
.inventory .stock-reorder-pick {
  width: 26px;
  min-height: 26px;
  height: 26px;
  margin: 0;
}
.stock-reorder-from {
  display: block;
  margin-top: 2px;
}
/* An amount of the stock reports never breaks across lines. */
.stock-money {
  white-space: nowrap;
}
/* The checkbox column is as wide as its header, not the generic first column (34 %). */
.stock-reorder-pickable .inventory-table td:first-child {
  width: 1%;
  min-width: 0;
}

/* Бухгалтер-калькулятор (28.11): «Калькуляция», the lines of every recipe under the table. */
.costing-composition {
  margin-top: 20px;
}
.costing-composition h3 {
  margin: 0 0 8px;
  font-size: 16px;
}
.costing-lines {
  border-top: 1px solid var(--border);
  padding: 10px 0;
}
.costing-lines summary {
  cursor: pointer;
  font-weight: 600;
}
.costing-lines[open] summary {
  margin-bottom: 8px;
}
/* «Номенклатура и техкарты» (owner 01.12.2026, nomenclature.ts). */
.nomenclature .link-button {
  background: none;
  border: 0;
  padding: 0;
  min-height: 0;
  color: #0047bb;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.nomenclature .link-button:focus-visible {
  outline: 2px solid #0047bb;
  outline-offset: 2px;
}
.nomenclature .op-badge {
  margin-left: 6px;
}
.nomenclature-title {
  margin: 0;
  font-size: 22px;
}
.nomenclature-facts {
  display: grid;
  grid-template-columns: minmax(160px, max-content) 1fr;
  gap: 6px 16px;
  margin: 0;
}
.nomenclature-facts dt {
  color: #5b6b80;
}
.nomenclature-facts dd {
  margin: 0;
  font-weight: 600;
}
.nomenclature-text {
  white-space: pre-wrap;
  margin: 0;
}
.nomenclature-modifiers,
.nomenclature-used {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}
@media (max-width: 640px) {
  .nomenclature-facts {
    grid-template-columns: 1fr;
  }
  .nomenclature-facts dd {
    margin-bottom: 6px;
  }
}
.nomenclature .check input {
  width: auto;
  min-height: 0;
}
.nomenclature .inventory-filters {
  grid-template-columns: minmax(180px, 2fr) minmax(180px, 1fr) auto;
}
.nomenclature .inventory-filters .check {
  align-self: center;
  display: flex;
  gap: 8px;
  align-items: center;
}
.nomenclature .inventory-report-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 640px) {
  .nomenclature .inventory-filters {
    grid-template-columns: 1fr;
  }
}
/* Editing «Номенклатура и техкарты» (owner 02.12.2026, nomenclature-editor.ts). */
.op-dialog.nm-dialog-wide {
  width: min(1180px, calc(100vw - 40px));
}
.nm-lines th {
  white-space: normal;
  vertical-align: bottom;
}
.nm-lines td {
  white-space: nowrap;
}
.nm-lines input {
  width: 76px;
  min-height: 36px;
  padding: 4px 8px;
  font: inherit;
}
.nm-lines td:first-child input {
  width: 100%;
  min-width: 190px;
}
.nm-lines td {
  vertical-align: middle;
}
.nm-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 12px;
}
.nm-totals {
  margin-top: 12px;
}
.nm-container {
  align-items: end;
}
.nm-container .check {
  display: flex;
  gap: 8px;
  align-items: center;
}
.nm-container .check input {
  width: auto;
  min-height: 0;
}
@media (max-width: 640px) {
  .op-dialog.nm-dialog-wide {
    width: calc(100vw - 16px);
    padding: 16px;
  }
}
.op-dialog.nm-dialog-wide fieldset {
  min-width: 0;
}
.nm-lines-wrap {
  overflow-x: auto;
}
/* «Акт реализации» (stage 3, 02.12.2026, realization.ts). */
.realization h3 {
  margin: 20px 0 8px;
}
.realization td:first-child {
  min-width: 150px;
}
/* «Меню и блюда» (owner 02.12.2026, menu-dishes.ts): the menu next to the dishes of iiko. */
.nm-modes {
  margin-bottom: 12px;
}
.md-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: baseline;
  margin: 8px 0 12px;
}
.md-summary-item {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}
.md-warn {
  color: var(--red);
}
.md-badge {
  display: inline-block;
  color: var(--muted);
  font-style: italic;
}
.md-confirm {
  margin: 0 0 12px;
}
.md-table td {
  vertical-align: top;
  min-width: 150px;
}
.md-table td:first-child {
  min-width: 200px;
}
.md-cell {
  display: grid;
  gap: 4px;
  justify-items: start;
}
.md-cell.md-off {
  opacity: 0.7;
}
.md-dish {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.md-option .md-name {
  padding-left: 16px;
}
.md-option td:first-child small {
  padding-left: 16px;
}
/* «Склад» как в iiko (stage 3, 03.12.2026, store-documents.ts): journal, balances, document. */
.store-docs,
.store-docs-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.store-docs h3 {
  margin: 8px 0 0;
}
.store-docs .inventory-tabs {
  margin-bottom: 12px;
}
.nomenclature .store-docs-filters {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
/* The line over the tabs: main store, rules of writeoff, last automatic act (04.12.2026). */
.store-docs-status {
  margin: 0 0 -4px;
}
.sd-kind {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.nomenclature .sd-kind .op-badge {
  margin-left: 0;
}

[data-testid='sd-rules'] .field {
  margin: 0;
  min-width: 220px;
  max-width: 420px;
}
[data-testid='sd-rules'] select {
  width: 100%;
  min-width: 0;
}
.nomenclature .sd-kind .op-badge,
.op-table td .sd-kind .op-badge {
  min-width: 0;
}
.store-sales-group h3 {
  margin: 8px 0 4px;
  font-size: 15px;
}
.store-sales-group ul {
  margin: 0;
  padding-left: 20px;
}
.store-doc-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 12px;
}
.store-docs .dc-group {
  min-width: 0;
}
.sd-lines td:first-child {
  width: 1%;
}
.sd-lines td:nth-child(2) input {
  width: 100%;
  min-width: 260px;
}
.sd-lines input[data-testid='sd-line-amount'],
.sd-lines input[data-testid='sd-line-sum'] {
  width: 120px;
}
[data-testid='sd-documents'] td:nth-child(2),
[data-testid='sd-documents'] td:nth-child(6),
[data-testid='sd-balances'] td:nth-child(5),
[data-testid='sd-balances'] td:nth-child(6) {
  white-space: nowrap;
}
.sd-lines select {
  min-height: 36px;
  font: inherit;
}
.store-doc-actions {
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .nomenclature .store-docs-filters {
    grid-template-columns: 1fr;
  }
  [data-testid='sd-rules'] .field {
    min-width: 0;
    max-width: none;
  }
  /* The store under its label: the whole card width for «Основной склад (…)». */
  .bo-cards[data-testid='sd-rules'] td {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .store-doc-actions {
    justify-content: stretch;
  }
  .store-doc-actions .button {
    flex: 1 1 auto;
  }
}
/* «Справочники кассы» (stage 4, 04.12.2026, register-settings.ts). */
.register-settings {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.rs-head {
  display: flex;
  justify-content: flex-end;
}
/* The arrows take only their width; the names get the room. */
.register-settings td:first-child {
  width: 1%;
  white-space: nowrap;
}
.rs-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.rs-status {
  display: grid;
  gap: 4px;
  margin: 0;
}
.rs-status.rs-good {
  border-color: #8fd1a8;
  background: #eefaf2;
}
.rs-status.rs-bad {
  border-color: #f0a3a3;
  background: #fff1f1;
}
.rs-status.rs-off {
  background: #f4f6fa;
}
.rs-hint {
  margin: 0;
}
.rs-order {
  display: inline-flex;
  gap: 4px;
}
.rs-order .rs-arrow {
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
}
.rs-name {
  display: grid;
  gap: 2px;
  min-width: 240px;
}
.register-settings td input[type='text'] {
  width: 100%;
  min-width: 160px;
  min-height: 40px;
  font: inherit;
}
.register-settings td .field {
  margin: 0;
  min-width: 140px;
}
.register-settings td select {
  width: 100%;
  min-height: 40px;
  font: inherit;
}
.rs-switch {
  white-space: nowrap;
}
.rs-problems {
  margin: 0;
  padding-left: 28px;
}
.rs-problems[hidden] {
  display: none;
}
.rs-actions,
.rs-add {
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .register-settings td:first-child {
    width: auto;
  }
  .rs-name,
  .register-settings td input[type='text'],
  .register-settings td .field {
    min-width: 0;
  }
  .bo-cards[data-testid='rs-payments'] td,
  .bo-cards[data-testid='rs-reasons'] td,
  .bo-cards[data-testid='rs-cash'] td {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .rs-actions .button {
    flex: 1 1 auto;
  }
}
[data-testid='rs-payments'] td {
  vertical-align: middle;
}
/* «Администрирование» (cloud 100, admin-users.ts): people, roles and the access journal. */
.au-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.au-head .inventory-tabs {
  flex: 1;
  border-bottom: 0;
  padding-bottom: 0;
}
.au-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 16px 0;
}
.au-bar .op-note {
  flex: 1 1 320px;
  margin: 0;
}
.au-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.au-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8efff;
  color: #0047bb;
  font-size: 12px;
  white-space: nowrap;
}
.au-badge.muted {
  background: #eef1f5;
  color: #4c5a70;
}
.au-state-disabled,
.au-state-invite_expired {
  color: #a3271b;
}
.au-state-invited {
  color: #8a5a00;
}
.au-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-users td {
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.au-journal-title {
  margin: 24px 0 8px;
}
.au-dialog {
  width: min(560px, calc(100vw - 32px));
}
.op-dialog.au-dialog-wide {
  width: min(960px, calc(100vw - 32px));
}
.au-dialog-body {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}
.au-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}
.au-link {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
}
.au-rights {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-items: start;
  gap: 12px;
}
.au-group {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid #d5deea;
  border-radius: 12px;
  padding: 10px 12px;
}
.au-group legend {
  font-weight: 600;
  padding: 0 4px;
}
.au-group .check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.au-group .check input {
  width: auto;
  min-height: 0;
  margin-top: 3px;
}
@media (max-width: 640px) {
  .op-dialog.au-dialog,
  .op-dialog.au-dialog-wide {
    width: calc(100vw - 16px);
    padding: 16px;
  }
  .au-rights {
    grid-template-columns: 1fr;
  }
}
/* «Журнал событий» (cloud 101, event-journal.ts): filters, the list newest first, CSV. */
.ej-filter-wrap {
  margin: 16px 0 8px;
}
.ej-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  align-items: end;
  gap: 12px;
}
.ej-filters .check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.ej-filters .check input {
  width: auto;
  min-height: 0;
}
.ej-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ej-hint {
  margin: 8px 0 0;
}
.ej-summary {
  margin: 12px 0 8px;
}
.ej-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
}
.ej-time,
.ej-amount {
  white-space: nowrap;
}
.ej-source-pos {
  color: #0047bb;
}
.ej-source-office {
  color: #4c5a70;
}
@media (max-width: 640px) {
  .ej-filters {
    grid-template-columns: 1fr 1fr;
  }
  .ej-actions .button {
    flex: 1 1 auto;
  }
  /* The cards of a phone: no label without a value. */
  .ej-table td:has(> span:empty) {
    display: none;
  }
}
/* «Настройки точки» (cloud 102, branch-settings.ts): the point, hours, receipt texts, history. */
.bs {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.bs-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}
.bs-title {
  margin: 0 0 12px;
}
.bs-subtitle {
  margin: 16px 0 8px;
}
.bs-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0 0 8px;
}
.bs-facts dt {
  color: var(--muted);
}
.bs-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.bs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.bs-grid textarea {
  min-height: 64px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
.bs-hours-table .check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bs-hours-table .check input {
  width: auto;
  min-height: 0;
}
.bs-time {
  width: 6.5em;
}
.bs-card > .field {
  max-width: 280px;
}
.bs-preview {
  max-width: 48ch;
  padding: 12px;
  border: 1px dashed var(--border);
  background: #fff;
  color: #111;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 13px;
  text-align: center;
  overflow-wrap: anywhere;
}
.bs-lead {
  font-size: 16px;
  font-weight: 700;
}
.bs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.bs-delivery {
  margin: 12px 0 0;
}
@media (max-width: 640px) {
  .bs-card {
    padding: 12px;
  }
  .bs-facts {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .bs-facts dd {
    margin-bottom: 6px;
  }
  .bs-grid {
    grid-template-columns: 1fr;
  }
  .bs-actions .button {
    flex: 1 1 auto;
  }
  .bs-time {
    width: 100%;
  }
}
