@import url('./fonts.css');
.finance-workspace {
  container: finance / inline-size;
  display: grid;
  gap: 20px;
  min-width: 0;
}
.finance-toolbar,
.finance-tabs,
.finance-heading,
.finance-actions,
.finance-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.finance-toolbar {
  align-items: end;
}
.finance-toolbar .field {
  min-width: 155px;
}
.finance-tabs {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.finance-tabs .button.selected,
.finance-tabs .button.selected:hover:not(:disabled) {
  background: var(--text);
  color: var(--card);
  border-color: var(--text);
}
.finance-workspace > *,
.finance-report-group,
.finance-workspace .table-scroll {
  min-width: 0;
}
.finance-totals table,
.finance-report-group table,
.finance-editor table {
  min-width: 0;
}
.finance-totals td:last-child,
.finance-report-group td:last-child {
  text-align: right;
  white-space: nowrap;
}
.finance-heading {
  justify-content: space-between;
}
.finance-source {
  color: var(--muted);
  max-width: 95ch;
  font-size: 13px;
}
.finance-editor {
  padding: 24px;
  display: grid;
  gap: 20px;
}
.finance-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.finance-form-grid textarea {
  min-height: 90px;
}
.finance-report-group {
  background: transparent;
}
.finance-report-group .finance-heading {
  margin-bottom: 12px;
}
.finance-number,
.finance-workspace td {
  font-variant-numeric: tabular-nums;
}
.finance-workspace td strong {
  white-space: nowrap;
}
.finance-workspace td small {
  display: block;
}
.finance-workspace summary {
  cursor: pointer;
  padding: 10px 0;
}
.finance-link {
  border: 0;
  background: transparent;
  color: #0047bb;
  text-align: left;
  padding: 8px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.finance-workspace .button {
  min-height: 44px;
}
.finance-totals {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.finance-totals tr:last-child {
  font-weight: 700;
  background: var(--hi);
}
.finance-correction {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.finance-correction .field {
  margin: 12px 0;
}
.finance-workspace ::selection {
  background: #ffdbc9;
  color: #172438;
}
.finance-workspace input,
.finance-workspace textarea {
  caret-color: #0047bb;
}
@media (max-width: 700px) {
  .finance-form-grid {
    grid-template-columns: 1fr;
  }
  .finance-toolbar .field {
    flex: 1 1 145px;
  }
  .finance-editor,
  .finance-report-group {
    padding: 16px;
  }
  .finance-tabs {
    gap: 8px;
  }
  .finance-tabs .button {
    flex: 1 1 auto;
  }
}
:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --side: #091020;
  --card: #ffffff;
  --hi: #eef2f6;
  --border: #d9e0e9;
  --text: #172438;
  --muted: #56657a;
  --accent: #ff671f;
  --green: #147556;
  --red: #b63243;
  font:
    14px/1.5 Inter,
    Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
input,
select,
textarea {
  outline-offset: 4px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #0047bb;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.6px;
}
h2 {
  font-size: 18px;
}
h3 {
  font-size: 16px;
}
h4 {
  font-size: 14px;
}
small {
  font-size: 12px;
}
strong {
  font-weight: 600;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.4px;
}
.button {
  min-height: 48px;
  border: 1px solid #bbc6d5;
  border-radius: 9px;
  padding: 10px 16px;
  background: var(--hi);
  color: var(--text);
  font-weight: 600;
  white-space: normal;
  line-height: 1.3;
}
.button:hover:not(:disabled) {
  background: #e3e9f1;
}
.button.primary {
  background: var(--accent);
  color: #171017;
  border-color: var(--accent);
}
.button.primary:hover:not(:disabled) {
  background: #ff843f;
}
.button.subtle {
  background: transparent;
}
.button.danger {
  color: #a32539;
  border-color: #d7a4ad;
}
.button.small {
  padding: 8px 12px;
  font-size: 13px;
  margin: 3px;
}
.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  background: var(--side);
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
}
.brand {
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 10px;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 32px;
}
.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  grid-row: span 2;
}
.brand small {
  font-weight: 400;
  color: var(--muted);
}
.nav-caption {
  font-size: 12px;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin: 0 14px 9px;
}
.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 500;
  padding: 14px 16px;
  min-height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-item:before {
  content: '';
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
}
.nav-item.active {
  background: #ff671f19;
  color: #ff985c;
}
.nav-item:disabled {
  opacity: 0.65;
}
.sidebar-note {
  font-size: 12px;
  color: var(--muted);
  margin: 22px 12px;
  line-height: 1.65;
}
.user {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.user button {
  margin-top: 8px;
}
.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
.topbar {
  padding: 20px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.topbar h1 {
  margin-bottom: 5px;
}
.topbar > .field {
  min-width: 230px;
  max-width: 360px;
}
.content {
  padding: 24px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.stat strong {
  font-size: 28px;
  line-height: 1.1;
}
.stat span {
  font-size: 12px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.panel-toolbar {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 280px);
  gap: 14px;
  padding: 0 20px 20px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid #bbc6d5;
  border-radius: 8px;
  font-size: 16px;
}
input::placeholder {
  color: #637086;
}
input[readonly] {
  background: #edf1f5;
  color: var(--muted);
}
textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}
input[type='checkbox'] {
  width: 22px;
  min-height: 22px;
  height: 22px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  padding: 10px 0;
  cursor: pointer;
}
.check input {
  margin: 0;
}
.notice {
  background: #edf4fb;
  border: 1px solid #bacde3;
  border-radius: 10px;
  padding: 14px 16px;
  color: #264669;
  line-height: 1.6;
}
.notice.compact {
  font-size: 12px;
  padding: 11px 14px;
}
.notice.error {
  background: #fff0f1;
  border-color: #e9adb5;
  color: #92263a;
  white-space: pre-line;
}
.notice button {
  margin-top: 12px;
  display: block;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 870px;
  font-size: 13px;
}
th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  font-weight: 600;
  background: #f4f6f9;
  padding: 14px 16px;
}
td {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
td:first-child {
  width: 34%;
}
td:last-child {
  width: 215px;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.row-actions .button {
  margin: 0;
  white-space: nowrap;
}
td small {
  display: block;
  margin-top: 4px;
}
td.price {
  white-space: nowrap;
  font-weight: 600;
}
td.price .aggregator-prices {
  font-weight: 400;
}
.product-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 240px;
}
.product-identity > img,
.product-identity > .image-placeholder {
  height: 64px;
  width: 74px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 auto;
}
.product-identity strong {
  display: block;
  overflow-wrap: anywhere;
}
.product-identity .image-placeholder {
  font-size: 12px;
  padding: 5px;
}
.image-placeholder {
  background: #edf1f5;
  color: #56657a;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 10px;
  padding: 20px;
}
.badge {
  font-size: 12px;
  border-radius: 5px;
  background: #e8edf4;
  padding: 5px 8px;
  display: inline-block;
}
.badge.good {
  color: #126747;
  background: #e4f3ec;
}
.table-count {
  padding: 14px 20px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.empty {
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
td.empty {
  display: table-cell;
}
.modifier-summary {
  padding: 20px;
}
.modifier-summary > p {
  margin-top: 8px;
}
.group-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.group-card {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-wrap: anywhere;
}
.group-card h3 {
  font-size: 14px;
}
.group-card small {
  display: block;
  margin-top: 4px;
}
.group-card p {
  font-size: 12px;
  margin-top: 12px;
  color: var(--muted);
}
.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  border-top: 1px solid #bbc6d5;
  background: #fffffff5;
  backdrop-filter: blur(14px);
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  box-shadow: 0 -8px 28px #0003;
}
.save-bar small {
  display: block;
  margin-top: 4px;
}
.save-actions {
  display: flex;
  gap: 10px;
}
.review-note {
  font-size: 12px;
  margin-top: -18px;
  max-width: 800px;
}
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  max-width: 520px;
  width: 100%;
  padding: 40px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.login-card > img {
  width: 68px;
  height: 68px;
}
.login-card h1 {
  font-size: 28px;
}
.login-card > p:last-child {
  font-size: 12px;
}
.editor-dialog {
  width: min(960px, calc(100vw - 32px));
  max-width: 960px;
  height: min(920px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  border: 1px solid #465779;
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 20px 100px #0008;
}
.editor-dialog::backdrop,
.confirm-dialog::backdrop {
  background: #040a17c9;
  backdrop-filter: blur(4px);
}
.editor-form {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.editor-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 18px;
  font-weight: 600;
}
.editor-tabs {
  display: flex;
  overflow: auto;
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  flex-shrink: 0;
}
.tab {
  font: inherit;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 16px 12px;
  min-height: 52px;
  white-space: nowrap;
}
.tab.active {
  color: #af410a;
  border-bottom-color: var(--accent);
}
.editor-body {
  overflow: auto;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.editor-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.editor-section + section {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.asset-preview {
  width: 200px;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
}
.asset-preview > img,
.asset-preview > .image-placeholder {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.option-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.editor-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  background: #f4f6f9;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 20px;
  align-items: center;
  flex-shrink: 0;
}
.editor-footer p {
  font-size: 12px;
}
.form-error {
  color: #9e2c3d;
  font-size: 13px;
  white-space: pre-line;
  grid-column: 1/-1;
  max-height: 100px;
  overflow: auto;
}
.form-error:empty {
  display: none;
}
.preview-card {
  max-width: 460px;
  padding: 24px;
  background: var(--bg);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.preview-card > img,
.preview-card > .image-placeholder {
  width: 100%;
  height: 250px;
  object-fit: contain;
}
.preview-price {
  font-size: 28px;
  color: #af410a;
}
.confirm-dialog {
  color: var(--text);
  background: var(--card);
  border: 1px solid #465779;
  border-radius: 16px;
  width: min(540px, calc(100vw - 32px));
  padding: 28px;
}
.confirm-dialog p,
.confirm-dialog .notice {
  margin-top: 18px;
}
.confirm-dialog button {
  margin-top: 24px;
  margin-right: 10px;
}
@media (max-width: 1200px) {
  .shell {
    grid-template-columns: 195px minmax(0, 1fr);
  }
  .sidebar {
    padding: 20px 12px;
  }
  .topbar,
  .content {
    padding-left: 20px;
    padding-right: 20px;
  }
  .save-bar {
    padding: 14px 20px;
    flex-wrap: wrap;
  }
  .save-actions {
    margin-left: auto;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 16px;
  }
  .group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    padding: 12px 18px;
    display: flex;
    flex-direction: row;
    align-items: center;
  }
  .brand {
    margin: 0;
    flex: 1;
  }
  .nav-item,
  .nav-caption,
  .sidebar-note {
    display: none;
  }
  .user {
    margin: 0;
    padding: 0;
    border: 0;
    display: block;
    font-size: 12px;
  }
  .user > span {
    display: none;
  }
  .user button {
    margin-left: 12px;
  }
  .topbar {
    flex-wrap: wrap;
  }
  .topbar > .field {
    max-width: none;
    flex: 1;
  }
  .content {
    padding: 16px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters {
    grid-template-columns: 1fr;
  }
  .save-bar {
    padding: 12px 16px;
  }
  .save-actions {
    width: 100%;
    margin: 0;
  }
  .save-actions button {
    flex: 1;
    padding: 10px;
    font-size: 12px;
  }
  .editor-body {
    padding: 18px;
  }
  .editor-footer {
    padding: 14px 18px;
    grid-template-columns: 1fr;
  }
  .editor-footer p {
    display: none;
  }
  .editor-header {
    padding: 14px 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .group-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
/* Preserve readable nutrition and prices when the operator scrolls the tablet table. */
td:nth-child(2) {
  min-width: 105px;
}
td:nth-child(3) {
  min-width: 110px;
}
td:nth-child(4) {
  min-width: 150px;
}
td:nth-child(5) {
  min-width: 130px;
}
@media (max-width: 1200px) {
  .table-count:after {
    content: ' · Таблица прокручивается по горизонтали';
  }
}
/* Full backoffice follows the supplied 250 px rail and dense dark workspace. */
.nav-item {
  min-height: 40px;
  padding: 10px 12px;
  flex-shrink: 0;
  font-size: 13px;
}
.nav-item.active {
  background: #17223a;
  color: var(--text);
}
.nav-item.active:before {
  background: var(--accent);
}
.sidebar {
  padding: 20px 12px;
  gap: 2px;
}
.sidebar .brand {
  margin: 0 8px 26px;
  font-size: 16px;
}
.sidebar .user {
  margin-top: 24px;
  padding: 16px 8px;
}
.topbar {
  min-height: 80px;
  padding: 16px 28px;
  gap: 20px;
  flex-wrap: wrap;
}
.topbar > div:first-child {
  flex: 1;
  min-width: 240px;
}
.topbar h1 {
  font-size: 22px;
}
.topbar > .field {
  min-width: 170px;
  max-width: 230px;
}
.topbar > .field .field-label {
  font-size: 12px;
}
.op-periods {
  display: flex;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 4px;
  background: var(--card);
}
.op-periods button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
}
.op-periods .selected {
  background: var(--accent);
  color: #0c1222;
}
.op-freshness {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}
.op-freshness .button {
  min-height: 32px;
  padding: 4px 12px;
}
.op-panel {
  padding: 20px;
  min-width: 0;
}
.op-panel .panel-head {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.op-panel .panel-head > div:first-child {
  flex: 1;
  min-width: 180px;
}
.op-panel h2 {
  font-size: 16px;
}
.op-panel .muted {
  font-size: 12px;
  margin-top: 5px;
}
.op-panel .notice.station-plan {
  margin: 14px 0;
}
.op-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.op-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.op-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  max-width: 350px;
  overflow-wrap: anywhere;
}
.op-table tr:last-child td {
  border-bottom: 0;
}
.op-table td:first-child {
  font-weight: 600;
}
.op-table .button {
  font-size: 12px;
  min-height: 36px;
  padding: 5px 10px;
  white-space: nowrap;
}
.op-empty {
  padding: 36px !important;
  text-align: center;
  font-weight: 400 !important;
  color: var(--muted);
}
.op-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 7px;
  background: #e8eef6;
  color: #354e70;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.op-badge.good {
  background: #e2f2e9;
  color: #126747;
}
.op-badge.bad {
  background: #fce8eb;
  color: #97243a;
}
.op-note {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  padding: 10px 0;
}
.op-grid {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 16px;
}
.op-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.op-bars {
  display: grid;
  gap: 14px;
  max-height: 330px;
  overflow: auto;
}
.op-bar {
  display: grid;
  grid-template-columns: 90px 1fr 130px;
  align-items: center;
  gap: 14px;
  font-size: 12px;
}
.op-bar progress {
  width: 100%;
  height: 12px;
  accent-color: var(--accent);
}
.op-bar strong {
  text-align: right;
}
.op-dialog {
  width: min(840px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  border: 1px solid #3a4b69;
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  padding: 24px;
  overflow: auto;
}
.op-dialog::backdrop {
  background: #030811c9;
  backdrop-filter: blur(3px);
}
.op-dialog > .panel-head {
  position: sticky;
  top: -24px;
  background: var(--card);
  padding: 14px 0;
  z-index: 1;
}
.op-dialog > .form-grid,
.op-dialog > .field,
.op-dialog > h3 {
  margin: 18px 0;
}
.op-dialog > .button.primary:last-child {
  position: sticky;
  bottom: -24px;
  display: block;
  margin: 20px 0 0 auto;
}
.op-form-error:empty {
  display: none;
}
.op-line {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 12px 0;
}
.op-line > .field {
  flex: 1;
  min-width: 0;
}
.op-checks {
  /* Review 15.11: every dish of a station is visible; the dialog itself scrolls. */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 16px;
  padding: 14px 0;
}
@media (max-width: 1100px) {
  .op-grid {
    grid-template-columns: 1fr;
  }
  .topbar {
    gap: 12px;
  }
  .op-line {
    flex-wrap: wrap;
  }
  .op-table {
    min-width: 620px;
  }
}
@media (max-width: 800px) {
  .sidebar {
    flex-wrap: wrap;
    position: relative;
  }
  .sidebar .nav-item {
    display: flex;
    min-height: 38px;
    white-space: nowrap;
  }
  .sidebar .brand {
    width: 100%;
    flex: none;
    margin-bottom: 10px;
  }
  .sidebar .user {
    margin-top: 10px;
  }
  .sidebar .nav-caption {
    display: none;
  }
  .sidebar {
    max-height: 230px;
    overflow: auto;
  }
  .op-dialog .form-grid {
    grid-template-columns: 1fr;
  }
  .op-line > .field {
    min-width: 45%;
  }
  .op-bar {
    grid-template-columns: 75px 1fr 110px;
  }
  .op-panel {
    padding: 14px;
  }
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topbar > .field .field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.topbar > .field select {
  min-height: 40px;
}
.topbar h1 {
  margin-bottom: 3px;
}
.topbar > div:first-child > small {
  font-size: 12px;
}
.sidebar .brand {
  margin-bottom: 28px;
}

/* Director workspace: quiet surfaces, familiar controls and a compact brand rail. */
.sidebar {
  color: #e8edf5;
  border-color: #26344f;
}
.sidebar .muted,
.sidebar .brand small {
  color: #b4c1d5;
}
.sidebar .button {
  color: #e8edf5;
  border-color: #43526a;
}
.sidebar .button:hover:not(:disabled) {
  background: #202d44;
}
.sidebar .user {
  border-color: #26344f;
  margin-top: auto;
}
.navigation,
.nav-primary {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-item {
  color: #b4c1d5;
  width: 100%;
  min-height: 44px;
}
.nav-item:hover:not(:disabled) {
  color: #fff;
  background: #17223a;
}
.nav-item.active {
  color: #fff;
  background: #26344a;
}
.topbar {
  align-items: flex-start;
}
.topbar > div:first-child {
  min-width: 180px;
}
.topbar > .field .field-label {
  position: static;
  width: auto;
  height: auto;
  clip-path: none;
}
.topbar > .field select {
  min-height: 44px;
}
.stat,
.panel {
  border-radius: 12px;
}
.stat strong,
td.price,
.op-table td,
.op-bar strong {
  font-variant-numeric: tabular-nums;
}
.stat strong {
  font-size: 28px;
}
th {
  font-size: 12px;
  letter-spacing: 0.3px;
}
.op-periods button {
  min-height: 44px;
}
.op-periods .selected {
  background: #172438;
  color: #fff;
}
.op-periods button:hover:not(:disabled) {
  background: #e8edf4;
  color: #172438;
}
.button,
.nav-item,
.op-periods button {
  transition:
    background-color 150ms ease-out,
    color 150ms ease-out;
}
.save-bar {
  background: #fff;
  box-shadow: 0 -4px 14px #1724380c;
  backdrop-filter: none;
}
::selection {
  background: #ffd8c3;
  color: #172438;
}
input,
textarea {
  caret-color: #b6450c;
}
@media (max-width: 800px) {
  .sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    max-height: none;
    overflow: visible;
    gap: 12px;
  }
  .sidebar .brand {
    width: auto;
    margin: 0;
  }
  .sidebar .user {
    margin: 0;
    padding: 0;
    border: 0;
  }
  .sidebar .user strong {
    display: none;
  }
  .sidebar .user button {
    margin: 0;
  }
  .navigation {
    grid-column: 1 / -1;
    min-width: 0;
  }
  .nav-primary {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .sidebar .nav-item {
    min-height: 44px;
    width: auto;
    flex-shrink: 0;
  }
  .nav-item:before {
    display: none;
  }
  .topbar {
    padding: 20px 16px;
  }
  .topbar > div:first-child {
    flex-basis: 100%;
  }
  .topbar > .field {
    min-width: 0;
  }
  .op-periods {
    max-width: 100%;
    overflow: auto;
  }
  .op-periods button {
    flex-shrink: 0;
  }
  .op-bar {
    grid-template-columns: 70px minmax(0, 1fr) 95px;
    gap: 8px;
  }
  .panel-head,
  .panel-toolbar {
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .button,
  .nav-item,
  .op-periods button {
    transition: none;
  }
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 100%;
}
.date-range {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-basis: 100%;
  justify-content: flex-end;
}
.date-range .field {
  width: 160px;
}
@media (max-width: 800px) {
  .header-tools {
    width: 100%;
    justify-content: flex-start;
  }
  .date-range {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .date-range .field {
    flex: 1;
    width: auto;
    min-width: 120px;
  }
}

.finance-overview,
.finance-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.finance-overview-block,
.finance-chart,
.finance-sheet {
  min-width: 0;
  background: var(--card);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.finance-key-values {
  margin: 20px 0 8px;
}
.finance-key-values > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.finance-key-values > div:last-child {
  font-weight: 700;
  border: 0;
}
.finance-key-values dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.finance-negative {
  color: #a32720;
}
.finance-ranking {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}
.finance-rank-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.finance-rank-label strong {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.finance-ranking .finance-link {
  min-height: 44px;
  padding: 4px 0;
}
.finance-track {
  height: 7px;
  margin: 4px 0;
  background: var(--hi);
  border-radius: 3px;
  overflow: hidden;
}
.finance-track span {
  display: block;
  height: 100%;
  background: #b6450c;
}
.finance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
}
.finance-in:before,
.finance-out:before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  background: #0047bb;
}
.finance-out:before {
  background: #b6450c;
}
.finance-chart > svg {
  width: 100%;
  display: block;
  height: auto;
}
.finance-chart-scale {
  font-size: 12px;
  margin-bottom: 0;
}
.finance-chart-data {
  font-size: 13px;
}
.finance-chart-data table {
  min-width: 420px;
}
.finance-chart-data td:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}
.finance-sheet > .table-scroll > table {
  min-width: 0;
}
.finance-sheet td {
  vertical-align: top;
}
.finance-sheet td:not(:first-child),
.finance-sheet th:not(:first-child) {
  text-align: right;
  white-space: nowrap;
}
.finance-sheet td:first-child {
  width: 65%;
}
.finance-sheet > .table-scroll > table > tbody > tr:last-child {
  background: var(--hi);
}
.finance-sheet .finance-report-group {
  padding: 0;
  border: 0;
  border-radius: 0;
}
.finance-report-group > summary {
  font-weight: 600;
  padding-top: 0;
}
.finance-report-group table {
  font-size: 13px;
  min-width: 390px;
}
.finance-sheet .finance-report-group td:first-child {
  width: auto;
}
.finance-extra {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.finance-extra .finance-form-grid {
  margin-top: 16px;
}
.finance-effect {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
.finance-workspace select {
  appearance: none;
  min-height: 48px;
  padding: 11px 40px 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  width: 100%;
}
.finance-workspace .field:has(> select) {
  position: relative;
}
.finance-workspace .field:has(> select)::after {
  content: '';
  position: absolute;
  pointer-events: none;
  right: 18px;
  bottom: 21px;
  width: 7px;
  height: 7px;
  border-bottom: 1.5px solid var(--muted);
  border-right: 1.5px solid var(--muted);
  transform: rotate(45deg);
}
.finance-journal-table table {
  min-width: 920px;
}
.finance-journal-table td,
.finance-journal-table th {
  padding: 12px;
}
.finance-journal-table td:first-child,
.finance-journal-table td:last-child {
  width: auto;
  white-space: nowrap;
}
.finance-journal-table td:nth-child(2) {
  width: 26%;
  min-width: 210px;
}
.finance-journal-table td:nth-child(4) {
  width: 20%;
}
.finance-journal-table td:nth-child(6),
.finance-journal-table th:nth-child(6) {
  text-align: right;
  white-space: nowrap;
}
.finance-account-settings {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.finance-account-settings > summary {
  font-weight: 600;
}
@media (max-width: 1100px) {
  .finance-charts {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .finance-overview {
    grid-template-columns: 1fr;
  }
  .finance-chart,
  .finance-sheet,
  .finance-overview-block {
    padding: 16px;
  }
  .finance-key-values {
    font-size: 14px;
  }
  .finance-rank-label {
    align-items: start;
    flex-direction: column;
    gap: 0;
  }
  .finance-sheet > .table-scroll > table {
    font-size: 12px;
  }
  .finance-sheet td,
  .finance-sheet th {
    padding: 10px 6px;
  }
  .finance-sheet td:first-child {
    width: auto;
  }
}
.finance-charts {
  align-items: start;
}
.finance-sheet td:first-child strong {
  white-space: normal;
}
.finance-totals th:last-child {
  text-align: right;
}
.finance-quick-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.finance-period-shortcut {
  min-height: 44px;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
}
.finance-period-shortcut:hover:not(:disabled) {
  background: var(--hi);
  color: var(--text);
}
.finance-period-shortcut[aria-pressed='true'] {
  color: #0047bb;
  background: #edf4ff;
  border-color: #c5d7f4;
}
.finance-filters {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.finance-period-filter,
.finance-journal-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
  align-items: end;
}
.finance-period-filter .field,
.finance-journal-filter .field {
  min-width: 0;
}
.finance-workspace .field-label {
  line-height: 20px;
}
.finance-workspace input:not([type='checkbox']),
.finance-workspace select {
  min-width: 0;
  min-height: 48px;
  height: 48px;
  font-size: 16px;
  line-height: 24px;
}
.finance-period-filter > .button,
.finance-journal-filter > .button {
  min-height: 48px;
  padding: 11px 20px;
}
.finance-filter-hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.finance-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-bottom: 16px;
}
.finance-tabs .button {
  min-height: 52px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 18px;
  border-color: transparent;
  background: transparent;
  white-space: normal;
}
.finance-tabs .button:hover:not(:disabled) {
  background: var(--hi);
}
.finance-tabs .button.selected,
.finance-tabs .button.selected:hover:not(:disabled) {
  background: var(--text);
  color: var(--card);
}
@container finance (min-width: 760px) {
  .finance-period-filter {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr) auto;
  }
  .finance-journal-filter {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(0, 1fr) auto;
  }
  .finance-tabs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
@container finance (max-width: 479px) {
  .finance-period-filter > :nth-child(n + 3) {
    grid-column: 1 / -1;
  }
  .finance-journal-filter {
    grid-template-columns: minmax(0, 1fr);
  }
  .finance-filters {
    padding: 12px;
  }
  .finance-quick-periods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .finance-period-shortcut:last-child {
    grid-column: 1 / -1;
  }
}
@media (forced-colors: active) {
  .finance-workspace select {
    appearance: auto;
    background-image: none;
  }
  .finance-workspace .field:has(> select)::after {
    display: none;
  }
}

/* Finance correction and audit: actions first, a readable immutable trail below. */
.finance-detail .finance-heading {
  margin-bottom: 8px;
}
.finance-entry-status {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.finance-workspace .button.finance-danger {
  color: #a42620;
  border-color: #d7a7a2;
  background: #fff;
}
.finance-workspace .button.finance-danger:hover:not(:disabled) {
  background: #fff0ed;
  border-color: #a42620;
}
.finance-delete-confirm {
  padding: 20px;
  margin: 20px 0;
  border: 1px solid #d7a7a2;
  border-radius: 12px;
  background: #fff8f6;
}
.finance-delete-confirm h3 {
  margin-top: 0;
}
.finance-delete-confirm > p {
  max-width: 70ch;
}
.finance-delete-confirm .field {
  max-width: 680px;
}
.finance-detail-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 32px;
  padding: 24px 0;
  margin: 0;
}
.finance-detail-values dt {
  font-size: 14px;
  margin-bottom: 4px;
}
.finance-detail-values dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-weight: 600;
}
.finance-history {
  border-top: 1px solid var(--border);
  margin-top: 12px;
  padding-top: 24px;
}
.finance-history h3 {
  margin: 0 0 8px;
}
.finance-history-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}
.finance-history-list > li {
  padding: 20px 0;
  border-top: 1px solid var(--border);
}
.finance-history-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 24px;
}
.finance-history-heading h4 {
  margin: 0;
  font-size: 18px;
}
.finance-history-heading time {
  font-size: 14px;
}
.finance-history-author {
  font-weight: 600;
  margin: 8px 0 4px;
}
.finance-history-list p {
  overflow-wrap: anywhere;
}
.finance-history-amount {
  font-variant-numeric: tabular-nums;
}
.finance-history td {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 110px;
}
.finance-history details > summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  text-decoration: underline;
  text-underline-offset: 4px;
}
@container finance (max-width: 480px) {
  .finance-detail-values {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .finance-delete-confirm {
    padding: 16px;
  }
  .finance-detail > .finance-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.login-form {
  display: grid;
  gap: 18px;
}
.login-form .field {
  min-width: 0;
  margin: 0;
}
.login-form input:not([type='checkbox']) {
  width: 100%;
  min-height: 48px;
}
.login-reveal {
  justify-self: start;
  padding: 4px 0;
  min-height: 32px;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.login-remember {
  min-height: 32px;
  padding: 0;
  align-items: center;
  font-size: 14px;
}
.login-form [hidden] {
  display: none;
}
@media (max-width: 540px) {
  .login-page {
    padding: 16px;
  }
  .login-card {
    padding: 24px;
    border-radius: 16px;
  }
  .login-card h1 {
    font-size: 28px;
  }
}
/* Unified menu: connected channels, cashier delivery, uploaded photos and remote stops. */
.channel-status {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.channel-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.channel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
}
.channel-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a6b1c0;
}
.channel-badge.on {
  color: #126747;
  border-color: #b9dcc9;
  background: #f1f9f5;
}
.channel-badge.on::before {
  background: var(--green);
}
.delivery {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
}
.delivery-good {
  border-color: #b9dcc9;
  background: #f1f9f5;
  color: #126747;
}
.delivery-bad {
  border-color: #e9adb5;
  background: #fff0f1;
  color: #92263a;
}
.delivery-wait {
  border-color: #f2c99a;
  background: #fff7ee;
  color: #8a4b0f;
}
.channel-help,
.table-help {
  font-size: 12px;
  line-height: 1.6;
}
.table-help {
  padding: 0 20px 16px;
}
.uploaded-photo {
  object-fit: cover;
}
.asset-preview > .uploaded-photo {
  object-fit: contain;
  background: var(--hi);
}
.fallback-preview {
  width: 96px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
}
.fallback-preview > img,
.fallback-preview > .image-placeholder {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.photo-progress {
  width: 100%;
  max-width: 320px;
  height: 8px;
  accent-color: var(--accent);
}
.photo-progress[hidden] {
  display: none;
}
.photo-picker input[type='file'] {
  min-height: 0;
  padding: 8px 0;
  border: 0;
  background: none;
}
.tile-color {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tile-color input[type='color'] {
  width: 48px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}
.stop-freshness {
  font-weight: 600;
  margin-bottom: 14px;
}
.stop-freshness.bad {
  background: #fff0f1;
  border-color: #e9adb5;
  color: #92263a;
}
.stop-blocker {
  margin: 0 20px 14px;
}
.stop-filters {
  padding: 0 20px 14px;
  margin-top: 16px;
}
.stop-table td small {
  display: block;
  margin-top: 4px;
}
.stop-table .stop-option td:first-child {
  padding-left: 32px;
}
.stop-table .stop-option strong {
  font-weight: 500;
}
.stop-state {
  font-size: 13px;
  font-weight: 600;
}
.stop-state.good {
  color: #126747;
}
.stop-state.bad {
  color: #97243a;
}
.stop-state.wait {
  color: #8a4b0f;
}
.stop-durations {
  border: 0;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}
.stop-durations legend {
  margin-bottom: 4px;
}
.stop-dialog-name {
  font-weight: 600;
  margin: 4px 0 12px;
}
@media (max-width: 800px) {
  /* Phones: each stop row becomes a card so the action stays on screen. */
  .op-table.stop-table,
  .stop-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .stop-table thead {
    display: none;
  }
  .stop-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'name action'
      'status action'
      'state state';
    gap: 8px 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }
  .stop-table tbody tr:last-child {
    border-bottom: 0;
  }
  .stop-table td {
    display: block;
    padding: 0;
    border: 0;
    width: auto;
    min-width: 0;
    max-width: none;
  }
  .stop-table td:nth-child(1) {
    grid-area: name;
  }
  .stop-table td:nth-child(2) {
    grid-area: status;
  }
  .stop-table td:nth-child(3) {
    grid-area: state;
  }
  .stop-table td:nth-child(4) {
    grid-area: action;
    align-self: center;
  }
  .stop-table td.op-empty {
    grid-column: 1 / -1;
  }
  .stop-table .stop-none {
    display: none;
  }
  .stop-blocker,
  .stop-filters {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .stop-table .stop-option td:first-child {
    padding-left: 14px;
  }
}
.photo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 20px;
}
.photo-actions .photo-picker {
  flex: 1 1 320px;
}
.photo-actions > .button {
  flex: 0 0 auto;
  margin-bottom: 26px;
}
/* Cutover CC-7: sales report on the reports page. */
.sales-report {
  min-width: 0;
}
.sales-report-filters {
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto;
  margin: 12px 0;
}
.sales-report-filters input {
  min-height: 44px;
  width: 100%;
}
.sales-report h3 {
  margin: 22px 0 8px;
  font-size: 16px;
}
.sales-table {
  max-width: 100%;
  overflow-x: auto;
}
.sales-table td {
  white-space: nowrap;
}
.sales-table td:nth-child(n + 6) {
  white-space: normal;
}
.sales-report-rules ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
@media (max-width: 650px) {
  .sales-report-filters {
    grid-template-columns: 1fr;
  }
  .sales-report .panel-head {
    flex-wrap: wrap;
  }
}
/* Lane bo-ui «Касса» (BACKOFFICE_POS_DAY_ENABLED): only new classes, nothing else changes. */
.pos-day,
.pos-day-body,
.pos-shifts {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.pos-day > *,
.pos-day-body > *,
.pos-shifts > *,
.pos-home > *,
.pos-dialog > * {
  min-width: 0;
}
.pos-day-controls > .button {
  justify-self: start;
}
.pos-home .stats,
.pos-amount {
  white-space: nowrap;
}
.pos-day .pos-stats {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.pos-dialog .pos-stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.pos-dialog .stat strong {
  font-size: 22px;
}
/* The receipt card: columns share the dialog width and their text wraps inside them. */
.pos-dialog .op-table {
  table-layout: fixed;
}
.pos-dialog .op-table th {
  white-space: normal;
}
.pos-day-controls {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(150px, 260px) auto;
  align-items: end;
  gap: 12px;
}
.pos-day-controls input,
.pos-day-controls select,
.pos-receipt-filters input,
.pos-receipt-filters select {
  min-height: 44px;
  width: 100%;
}
.pos-day-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.pos-day-tabs .button.selected,
.pos-day-tabs .button.selected:hover:not(:disabled),
.pos-day-tabs .button.selected:focus-visible {
  background: var(--text);
  color: var(--card);
  border-color: var(--text);
}
.pos-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.pos-day-head h2 {
  font-size: 18px;
  margin: 0;
}
.pos-day h3,
.pos-dialog h3,
.pos-home h3 {
  margin: 18px 0 8px;
  font-size: 16px;
}
.pos-shift h4 {
  margin: 14px 0 6px;
  font-size: 14px;
}
.pos-shift-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.pos-receipt-filters {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(140px, 1fr));
  align-items: end;
  gap: 12px;
}
.pos-receipt-name {
  display: flex;
  flex-direction: column;
}
.pos-receipt-name small,
.pos-table td small {
  display: block;
}
.pos-table {
  max-width: 100%;
  overflow-x: auto;
}
/* The global table minimum (870 px) and the global first/last cell widths (34 %, 215 px) would
   push «Касса» tables past their panel and dialog and squeeze the phone cards. */
.pos-table table {
  min-width: 0;
}
.pos-table td:first-child,
.pos-table td:last-child {
  width: auto;
}
.pos-table td {
  /* Words wrap at spaces only (audit F19: no «Наличн-ые»). */
  overflow-wrap: break-word;
  padding: 12px 8px;
}
.pos-table th {
  padding: 12px 8px;
}
.pos-nowrap,
.op-nowrap {
  white-space: nowrap;
}
.pos-notice {
  margin: 0;
}
.pos-warn {
  border-left: 4px solid var(--red);
  font-weight: 600;
}
.pos-day-rules ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.pos-day-rules summary {
  cursor: pointer;
  min-height: 44px;
  font-weight: 600;
}
.pos-home {
  display: grid;
  gap: 14px;
}
.pos-home-period {
  font-size: 16px;
  margin: 18px 0 0;
}
.pos-order-totals {
  font-weight: 600;
  color: var(--text);
}
.pos-shift-key {
  font-weight: 600;
  margin: 8px 0;
}
.pos-method-lines {
  display: none;
  margin: 8px 0;
  padding-left: 18px;
}
.pos-method-lines li {
  margin: 4px 0;
}
/* Review BOUI-R6: a phone shows the methods of a shift as one line each, not a card per row,
   and the cash and Kaspi tables of a shift as «Показатель ... сумма» lines. */
@media (max-width: 480px) {
  .pos-shift [data-testid='pos-shift-methods'] {
    display: none;
  }
  .pos-method-lines {
    display: block;
  }
  .pos-shift .pos-shift-grid .pos-table tr {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
  }
  .pos-shift .pos-shift-grid .pos-table td {
    display: block;
    padding: 0;
  }
  .pos-shift .pos-shift-grid .pos-table td::before {
    content: none;
  }
  .pos-shift .pos-shift-grid .pos-table td:last-child {
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
  }
}
@media (max-width: 650px) {
  .pos-day-controls,
  .pos-receipt-filters,
  .pos-shift-grid {
    grid-template-columns: 1fr;
  }
  .pos-day-tabs .button {
    flex: 1 1 30%;
  }
  /* Phone: every row becomes a labelled card; no amount or button is off the screen. */
  .pos-table .op-table,
  .pos-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .pos-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .pos-table tr {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
  }
  .pos-table td {
    display: grid;
    grid-template-columns: minmax(96px, 40%) minmax(0, 1fr);
    gap: 8px;
    padding: 4px 0;
    border: 0;
    white-space: normal;
    max-width: none;
  }
  .pos-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
  }
  .pos-table td[data-label='']::before {
    content: none;
  }
  .pos-table .pos-empty-row td {
    display: block;
  }
}
/* «Кассовые смены» of «Касса» (stage 4, owner 04.12.2026, as iiko «Активные смены»). */
.cash-shifts,
.cs-card-facts {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.cash-shifts > *,
.cs-card > * {
  min-width: 0;
}
.cs-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 180px)) minmax(150px, 240px) auto auto;
  align-items: end;
  gap: 12px;
}
.cs-controls input[type='date'],
.cs-controls select {
  min-height: 44px;
  width: 100%;
}
.cs-controls .check {
  min-height: 44px;
  align-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cs-controls > .button {
  justify-self: start;
}
.cs-desk {
  display: grid;
  gap: 10px;
}
.cs-desk h3 {
  margin: 0;
  font-size: 16px;
}
/* Tables scroll inside their own box: the page never scrolls sideways. */
.cs-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.cs-table-wrap table {
  min-width: 720px;
}
.cs-card-table table {
  min-width: 420px;
}
.cs-table td,
.cs-table th {
  width: auto;
  min-width: 0;
  max-width: none;
  overflow-wrap: normal;
}
.cs-card-table .op-table th,
.cs-card-table .op-table td {
  padding: 10px 8px;
}
.cs-accept .op-form-error {
  margin: 0;
  color: var(--red);
  font-weight: 600;
}
.cs-row {
  cursor: pointer;
}
.cs-row:hover td {
  background: var(--soft, rgba(127, 127, 127, 0.08));
}
.cs-open {
  font-weight: 600;
}
.cs-status small,
.cs-issue {
  display: block;
  margin-top: 4px;
  color: var(--red);
  font-size: 12px;
}
.cs-desk-totals {
  margin: 0;
  font-weight: 600;
}
/* The shift card is a side panel on the right, full screen on a phone. */
.op-dialog.cs-card {
  width: min(560px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  border-radius: 0;
  border-width: 0 0 0 1px;
  padding: 0 24px 24px;
  box-sizing: border-box;
}
.op-dialog.cs-card > .panel-head {
  top: 0;
}
.op-dialog.cs-card > .panel-head h2 {
  margin: 0 0 4px;
}
.cs-card-facts {
  gap: 2px;
}
.cs-card-facts p {
  margin: 0;
}
.cs-card h3 {
  margin: 20px 0 8px;
  font-size: 16px;
}
.cs-card h4 {
  margin: 14px 0 6px;
  font-size: 14px;
}
.cs-lines {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}
.cs-lines th {
  width: 60%;
  background: transparent;
}
.cs-lines td {
  width: auto;
  min-width: 0;
}
.cs-lines td.cs-line-text {
  text-align: left;
  overflow-wrap: anywhere;
}
.cs-lines th,
.cs-lines td {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
}
.cs-lines td {
  text-align: right;
  padding-left: 12px;
}
.cs-line-strong th,
.cs-line-strong td {
  font-weight: 700;
}
.cs-attention {
  color: var(--red);
  font-weight: 600;
}
.cs-accept {
  display: grid;
  gap: 10px;
}
.cs-accept textarea {
  width: 100%;
  min-height: 88px;
  box-sizing: border-box;
}
.cs-accept .field {
  display: grid;
  gap: 6px;
}
.cs-accept > .button.primary {
  justify-self: start;
  min-height: 44px;
}
@media (max-width: 650px) {
  .cs-controls {
    grid-template-columns: 1fr 1fr;
  }
  .cs-controls > label:nth-child(3),
  .cs-controls .check {
    grid-column: 1 / -1;
  }
  .op-dialog.cs-card {
    width: 100vw;
    padding: 0 16px 16px;
    border-width: 0;
  }
}
/* Cutover Аг4: «Внешнее меню» (aggregator prices) in «Меню и цены». */
.catalog-tabs {
  padding: 0;
  margin-bottom: 4px;
}
.external-intro {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 20px 20px;
}
.external-intro > p {
  margin: 0;
}
.external-menu .filters .external-copy {
  grid-column: 1 / -1;
  justify-self: start;
}
.external-menu td input {
  width: 100%;
  min-width: 110px;
  max-width: 180px;
}
.external-menu td input[aria-invalid='true'] {
  border-color: var(--danger, #c92a2a);
}
