.workforce {
  color: var(--ink, #18263b);
}
.wf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.wf-header h2 {
  margin: 0 0 0.4rem;
  font-size: 22px;
}
.wf-header p {
  margin: 0;
}
.wf-toolbar {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(6rem, 7rem) minmax(12rem, 1fr) auto;
  align-items: end;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #d8e0ea;
  border-radius: 12px;
}
.wf-toolbar .field {
  margin: 0;
}
.wf-toolbar button {
  justify-self: start;
}
.wf-tabs,
.wf-actions,
.wf-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.wf-tabs {
  margin: 1.25rem 0;
  border-bottom: 1px solid #d8e0ea;
  padding-bottom: 0.75rem;
}
.wf-tabs .selected,
.wf-actions .selected {
  background: #0047bb;
  border-color: #0047bb;
  color: #fff;
}
.wf-actions {
  margin: 1rem 0;
  align-items: end;
  gap: 12px;
}
.wf-range-buttons {
  display: flex;
  gap: 8px;
}
.wf-actions > .button,
.wf-range-buttons .button,
.wf-actions input,
.wf-toolbar > .button {
  min-height: 44px;
}
.wf-actions .field {
  margin: 0;
}
.wf-table-wrap {
  overflow: auto;
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  background: #fff;
}
.wf-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.wf-table th,
.wf-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e5eaf1;
  vertical-align: middle;
  min-width: 7rem;
}
.wf-table th {
  color: #52647c;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f5f7fb;
}
.wf-table tr:last-child td {
  border-bottom: 0;
}
.wf-table tbody tr:hover {
  background: #f8faff;
}
.wf-table td:first-child {
  font-weight: 600;
  width: auto;
}
.wf-row-actions {
  min-width: 12rem;
}
.wf-row-actions .button {
  min-height: 40px;
  padding: 0.5rem 0.75rem;
}
.wf-empty {
  padding: 2rem;
  border: 1px dashed #b7c5d9;
  border-radius: 12px;
  background: #fff;
  color: #52647c;
  text-align: center;
}
.wf-note,
.wf-alert,
.wf-notice {
  padding: 1rem 1.2rem;
  border-radius: 10px;
  line-height: 1.6;
}
.wf-note {
  background: #edf3ff;
  color: #264676;
  border: 1px solid #cdddf5;
}
.wf-alert {
  background: #fff1e7;
  color: #753700;
  border: 1px solid #edc5a3;
}
.wf-alert p {
  margin: 0.3rem 0;
}
.wf-notice {
  background: #eaf6ef;
  color: #1c5a37;
}
.wf-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #d8e0ea;
  background: white;
  border-radius: 12px;
  margin: 1rem 0;
}
.wf-summary > div {
  padding: 1rem 1.2rem;
}
.wf-summary span,
.wf-summary strong {
  display: block;
}
.wf-summary strong {
  font-size: 18px;
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.wf-editor {
  padding: 1.4rem;
  background: #fff;
  border: 1px solid #d8e0ea;
  border-radius: 12px;
  max-width: 64rem;
}
.wf-editor h2 {
  margin-top: 0;
}
.workforce input,
.workforce select,
.workforce textarea {
  min-height: 44px;
  width: 100%;
  background: #fff;
  border: 1px solid #b6c4d7;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  box-sizing: border-box;
}
.workforce .check input {
  width: 1.2rem;
  min-height: 1.2rem;
}
.workforce :focus-visible {
  outline: 3px solid #0047bb;
  outline-offset: 3px;
}
.workforce button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.wf-history {
  min-width: 14rem;
  padding: 0.5rem 0;
}
.wf-history p {
  margin: 0.3rem 0;
  overflow-wrap: anywhere;
}
.workforce summary {
  cursor: pointer;
  color: #0047bb;
  padding: 0.5rem 0;
}
@media (max-width: 700px) {
  .wf-toolbar {
    grid-template-columns: minmax(0, 1fr) minmax(6rem, 7rem);
  }
  .wf-toolbar > :nth-child(n + 3) {
    grid-column: 1 / -1;
  }
  .wf-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wf-tabs .button {
    flex: 1 1 auto;
  }
  .wf-editor {
    padding: 1rem;
  }
  .wf-editor .form-grid {
    grid-template-columns: 1fr;
  }
  .wf-header h2 {
    font-size: 18px;
  }
  .wf-summary strong {
    font-size: 16px;
  }
}

.wf-legacy-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0;
  align-items: end;
}

.workforce .wf-delete {
  color: #a12424;
  border-color: #d9b8b8;
}
.workforce .wf-delete-confirm {
  color: #fff;
  background: #a12424;
  border-color: #a12424;
}
.workforce .wf-delete-confirm:hover {
  background: #821d1d;
}

.wf-month-grid {
  max-height: 65vh;
  scroll-padding-inline-start: 200px;
}
.wf-month-grid .wf-table th,
.wf-month-grid .wf-table td {
  min-width: 52px;
  padding: 6px;
  text-align: center;
}
.wf-month-grid .wf-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.wf-month-grid .wf-table th:first-child,
.wf-month-grid .wf-table td:first-child {
  position: sticky;
  left: 0;
  min-width: 180px;
  max-width: 220px;
  text-align: left;
  background: #fff;
  z-index: 1;
}
.wf-month-grid .wf-table th:first-child {
  z-index: 3;
  background: #f5f7fb;
}
.wf-person strong,
.wf-person small {
  display: block;
  overflow-wrap: anywhere;
}
.wf-person small {
  font-weight: 400;
  margin-top: 4px;
}
.wf-day-cell {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #0047bb;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  padding: 4px;
}
.wf-day-cell:hover {
  background: #edf3ff;
  border-color: #b6c4d7;
}
.wf-day-cell.wf-draft {
  background: #fff1e7;
  color: #753700;
}
.wf-cell-note {
  display: block;
  font-size: 12px;
}
.wf-pay-items {
  grid-column: 1 / -1;
}
.wf-pay-item {
  display: grid;
  grid-template-columns: minmax(10rem, 2fr) minmax(8rem, 1fr) minmax(7rem, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-block: 12px;
}
.wf-pay-item .field {
  margin: 0;
}
.wf-difference {
  display: block;
  color: #753700;
}
@media (max-width: 700px) {
  .wf-pay-item {
    grid-template-columns: 1fr;
    border-bottom: 1px solid #d8e0ea;
    padding-bottom: 16px;
  }
  .wf-month-grid .wf-table th:first-child,
  .wf-month-grid .wf-table td:first-child {
    min-width: 140px;
    max-width: 140px;
  }
  .wf-month-grid {
    scroll-padding-inline-start: 160px;
  }
}

.wf-payroll-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.wf-payroll-table {
  max-height: 65vh;
  scroll-padding-inline-start: 180px;
}
.wf-payroll-table th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.wf-payroll-table td:first-child,
.wf-payroll-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 160px;
  max-width: 180px;
  background: #fff;
}
.wf-payroll-table th:first-child {
  z-index: 3;
  background: #f5f7fb;
}
.wf-calculation {
  margin-top: 24px;
}
.wf-calculation > summary {
  font-weight: 600;
  min-height: 44px;
}
@media (max-width: 700px) {
  .wf-payroll-summary {
    grid-template-columns: 1fr;
  }
}

/* Lane bo-ui step 6: «Смена менеджера» (capabilities.manager_shifts) and positions. */
.manager-shift .ms-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 16px 14px;
  background: var(--card);
}
.manager-shift > h3,
.manager-shift > .ms-history-bar,
.manager-shift > .notice,
.manager-shift > .op-note {
  margin-left: 16px;
  margin-right: 16px;
}
.manager-shift > .inventory-table {
  margin: 0 16px 16px;
}
.ms-history-bar .field {
  max-width: 260px;
}
.manager-shift .ms-card.ms-open {
  border-left: 4px solid var(--green);
}
.ms-title {
  font-weight: 700;
  margin: 0 0 6px;
}
.ms-check {
  margin: 4px 0;
  padding-left: 10px;
  border-left: 3px solid var(--border);
  overflow-wrap: anywhere;
}
.ms-check-ok {
  border-left-color: var(--green);
}
.ms-check-problem {
  border-left-color: var(--red);
}
.ms-check-no_data {
  border-left-color: var(--accent);
}
.ms-dialog {
  width: min(760px, calc(100vw - 32px));
}
.ms-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 10px 0;
  padding: 8px 12px;
}
.ms-item legend {
  font-weight: 600;
  padding: 0 4px;
}
.ms-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}
.ms-options .button.selected {
  background: var(--text);
  color: var(--card);
  border-color: var(--text);
}
.ms-handover {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ms-template-row,
.wf-position-row {
  align-items: end;
  flex-wrap: wrap;
}
.wf-extra {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.wf-extra legend {
  padding: 0 4px;
}
@media (max-width: 650px) {
  .ms-options .button {
    flex: 1 1 100%;
  }
  .ms-dialog {
    width: calc(100vw - 16px);
  }
}

/* Lane bo-ui step 7: «Скидки» (capabilities.discounts). */
.discounts > .notice,
.discounts > .op-note,
.discounts > .dc-bar {
  margin-left: 16px;
  margin-right: 16px;
}
.discounts > .inventory-table {
  margin: 0 16px 16px;
}
.dc-banner {
  border-left: 4px solid var(--accent);
}
.dc-bar .field {
  max-width: 280px;
}
.dc-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.dc-state-active {
  font-weight: 600;
}
/* «Скидки на кассе» (04.12): the «На кассе» line; the words carry the state, the mark helps. */
.dc-till {
  font-size: 0.875rem;
}
.dc-till::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #8a94a6;
  vertical-align: middle;
}
.dc-till-good::before {
  background: #2f9e5b;
}
.dc-till-wait::before {
  background: #d9a400;
}
.dc-till-bad {
  color: #b42318;
}
.dc-till-bad::before {
  background: #c92a2a;
}
.dc-actions {
  flex-wrap: wrap;
  gap: 6px;
}
.dc-dialog {
  width: min(820px, calc(100vw - 32px));
}
.dc-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 12px 0;
  padding: 6px 12px 10px;
}
.dc-group legend {
  font-weight: 600;
  padding: 0 4px;
}
.dc-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 18px;
}
.dc-checks .check {
  min-height: 40px;
  padding: 6px 0;
}
.dc-sub,
.dc-cat-name {
  font-weight: 600;
  margin: 6px 0 0;
}
.dc-hours {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}
.dc-hour {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
}
.dc-hour .field {
  max-width: 160px;
}
.dc-dialog .op-form-error p {
  margin: 0;
}
@media (max-width: 650px) {
  .dc-dialog {
    width: calc(100vw - 16px);
  }
  .dc-hour .field {
    max-width: none;
    flex: 1 1 120px;
  }
}
/* Words stay whole in the discount columns (no «Синтетичес кая»). */
.discounts .inventory-table td,
.dc-dialog .inventory-table td {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}
.dc-cell {
  display: grid;
  gap: 4px;
}
.dc-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.discounts .inventory-table td:nth-child(3) {
  min-width: 170px;
}

/* Lane bo-ui2 step 2: «Закупки» (capabilities.supply). */
.supply > .notice,
.supply > .op-note,
.supply > .sp-bar,
.supply > .sp-list-actions,
.supply > .sp-tabs {
  margin-left: 16px;
  margin-right: 16px;
}
.supply > .inventory-table {
  margin: 0 16px 16px;
}
.sp-banner {
  border-left: 4px solid var(--accent);
}
.sp-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
}
.sp-bar .field {
  flex: 1 1 150px;
  max-width: 220px;
}
.sp-list-actions {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.sp-rights {
  margin: 0;
}
.sp-state {
  font-weight: 600;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.sp-state-draft {
  background: #f3f5f8;
}
.sp-state-submitted {
  background: #e8f0ff;
  border-color: #9db8f0;
}
.sp-state-received {
  background: #e7f6ec;
  border-color: #8fcfa5;
}
.sp-state-cancelled {
  background: #fbeceb;
  border-color: #e3a9a4;
}
.sp-dialog {
  width: min(900px, calc(100vw - 32px));
}
.sp-dialog .op-form-error p {
  margin: 0;
}
.sp-info {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 8px 0 12px;
}
.sp-info dt {
  color: var(--muted, #5b6573);
}
.sp-info dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.sp-total {
  font-weight: 600;
  margin: 8px 0 12px;
}
.sp-dialog h3 {
  margin: 16px 0 8px;
}
.sp-dialog .sp-difference {
  margin-top: 8px;
}
.sp-line {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 6px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.sp-line .field:first-child {
  flex: 2 1 220px;
}
.sp-line .field {
  flex: 1 1 120px;
}
/* The cost of a receipt line: its label and hint stay on two lines at most. */
.sp-line .field:nth-child(4) {
  flex: 1 1 190px;
}
.sp-line > .op-note {
  flex: 1 1 100%;
  margin: 0;
}
.sp-text {
  width: 100%;
  font: inherit;
  white-space: pre-wrap;
}
.sp-share {
  flex-wrap: wrap;
  gap: 8px;
}
.sp-request-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.sp-price-form {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 8px;
}
/* Lane bo-ui2 step 3: the report of the last price import under the suppliers. */
.sp-imports {
  border-top: 1px solid var(--border);
  margin: 16px 16px 0;
  padding: 8px 0 16px;
}
.sp-imports h3 {
  margin: 16px 0 8px;
}
.sp-imports .inventory-table {
  margin: 8px 0;
}
.sp-imports .field {
  max-width: 420px;
}
.sp-imports p.sp-state {
  margin: 8px 0;
}
.sp-import-counts .sp-count {
  display: contents;
}
@media (max-width: 650px) {
  /* A count stays next to its label on a phone. */
  .sp-info.sp-import-counts {
    grid-template-columns: 1fr max-content;
  }
}
.supply .inventory-table td,
.sp-dialog .inventory-table td {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}
/* Step 6 pass: the request number column is narrow (the generic first column takes 34 % and
   squeezed «Позиции» into five lines). */
.supply [data-testid='sp-requests'] td:first-child {
  width: auto;
  min-width: 0;
  white-space: nowrap;
}
/* The same for the import report (its first column is a line number). */
.sp-imports .inventory-table td:first-child {
  width: auto;
}
/* Step 6 pass: in a phone card (a grid cell) a state badge keeps its own width instead of
   stretching over the whole value column. */
.supply .bo-cards td > .sp-state,
.sp-dialog .bo-cards td > .sp-state,
[data-testid='stock-reorder'] .bo-cards td > .op-badge,
[data-testid='stock-balances'] .bo-cards td > .op-badge {
  justify-self: start;
}
.sp-print-root {
  display: none;
}
@media (max-width: 650px) {
  .sp-dialog {
    width: calc(100vw - 16px);
  }
  .sp-bar .field {
    max-width: none;
  }
  .sp-info {
    grid-template-columns: 1fr;
  }
}
@media print {
  html.sp-printing body > :not(.sp-print-root) {
    display: none !important;
  }
  html.sp-printing .sp-print-root {
    display: block;
    color: #000;
    font:
      12pt/1.4 Arial,
      sans-serif;
  }
  .sp-print-root table {
    width: 100%;
    border-collapse: collapse;
    margin: 12pt 0;
  }
  .sp-print-root th,
  .sp-print-root td {
    border: 1px solid #000;
    padding: 4pt 6pt;
    text-align: left;
  }
  /* Бухгалтер-калькулятор (28.11): the sheets size their columns by the header, not by the
     generic td:first-child (34 %) and td:last-child (215 px) of the screen tables. */
  .sp-print-root .count-sheet td,
  .sp-print-root .costing-sheet td {
    width: auto;
  }
}
/* Lane bo-ui2 step 4: a field with a note under it (no supplier of the kind yet) no longer
   stretches the field beside it in the request editor. */
.sp-dialog .form-grid {
  align-items: start;
}

/* Lane bo-ui2 step 5: «Расстановка» (capabilities.staff_assignment). */
.assignment > .notice,
.assignment > .op-note,
.assignment > .as-bar,
.assignment > .as-heading,
.assignment > .as-grid,
.assignment > .as-free {
  margin-left: 16px;
  margin-right: 16px;
}
.assignment > .inventory-table {
  margin: 0 16px 16px;
}
.as-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 12px;
}
.as-bar .field {
  flex: 0 1 200px;
}
.as-note,
.as-rights {
  margin-top: 4px;
  margin-bottom: 4px;
}
.as-heading {
  margin-top: 16px;
  margin-bottom: 8px;
}
.as-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.as-station {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
/* Who stands there is said in words («На станции: 2»); the border only repeats it. */
.as-station-busy {
  border-left: 4px solid var(--accent);
}
.as-station-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.as-station-head h4 {
  margin: 0;
  font-size: 14px;
}
.as-count {
  font-weight: 600;
  white-space: nowrap;
}
.as-people,
.as-free {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.as-person {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.as-who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.as-override {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.as-person-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.as-past {
  margin: 8px 0 0;
}
.as-earlier .as-earlier-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin: 6px 0 0;
}
.as-dialog {
  width: min(560px, calc(100vw - 32px));
}
.as-form {
  display: grid;
  gap: 10px;
  margin: 8px 0 12px;
}
.as-name {
  font-weight: 600;
  margin: 0;
}
.as-current {
  margin: 0;
}
/* The stations of a day in the month grid of «Табель»: a dot after the hours. */
.wf-day-cell.wf-placed::after {
  content: '•';
  margin-left: 2px;
}
@media (max-width: 650px) {
  .as-grid {
    grid-template-columns: 1fr;
  }
  .as-bar .field {
    flex: 1 1 100%;
  }
  .as-person-actions .button {
    flex: 1 1 auto;
  }
  .as-dialog {
    width: calc(100vw - 16px);
  }
}
/* «Явки с кассы» (cloud 098): the marks to check above the time sheet. */
.wf-marks {
  margin: 0.5rem 0 1.5rem;
}
.wf-marks h3 {
  margin: 1.25rem 0 0.25rem;
}
.wf-marks > .muted {
  margin: 0.25rem 0 0.75rem;
}
/* «Персонал», срез 3 (cloud 099): statement, payments, staff meals and pay schemes. */
.wf-pay-section {
  margin: 0.5rem 0 1.5rem;
}
.wf-pay-section h3 {
  margin: 1.25rem 0 0.25rem;
}
.wf-pay-section > .muted {
  margin: 0.25rem 0 0.75rem;
}
.wf-review-label {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff4e0;
  color: #753700;
  font-size: 0.8125rem;
  font-weight: 600;
  vertical-align: middle;
}
.wf-overpaid {
  color: #a12424;
  font-weight: 600;
}
.wf-voided {
  color: #6b6b6b;
  text-decoration: line-through;
}
.wf-meal-match {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}
.wf-meal-match .field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
