:root {
  --bg: #efe7d8;
  --bg-2: #e7dcc8;
  --ink: #1f1a14;
  --ink-soft: #6b5e4e;
  --line: #d3c4aa;
  --card: #fbf7ef;
  --card-2: #fffdf8;
  --accent: #b4451a;
  --accent-2: #8d3413;
  --good: #2f6a48;
  --warn: #a15c12;
  --bad: #9b2c2c;
  --chip: #efe2cc;
  --shadow: 0 10px 30px rgba(50, 32, 12, 0.08);
  --radius: 18px;
  --sans: "IBM Plex Sans", "Noto Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  background:
    radial-gradient(900px 400px at 0% 0%, #f4e4c8 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  letter-spacing: -0.01em;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}
.menu-btn { min-width: 48px; min-height: 48px; font-size: 22px; }
.menu-bg {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(31,26,20,.4);
}
.menu-sheet {
  position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw);
  z-index: 41; height: 100vh;
}
.tapnum {
  text-align: right;
  font-family: var(--mono);
  min-height: 48px;
  font-size: 20px;
}
.pad-modal { max-width: 360px; }
.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.padk { min-height: 56px; font-size: 22px; }
.pad-val {
  font-family: var(--mono);
  font-size: 36px;
  text-align: right;
  padding: 8px 4px 16px;
}
.btn { min-height: 44px; }

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: #f6edd9;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  padding: 4px 8px 10px;
}
.brand small {
  display: block;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.brand strong {
  display: block;
  font-size: 22px;
  line-height: 1.15;
  margin-top: 4px;
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--ink-soft);
}
.nav button.active, .nav button:hover {
  background: #fff8ec;
  color: var(--ink);
}
.nav button.active { box-shadow: inset 3px 0 0 var(--accent); }

.side-foot {
  margin-top: auto;
  padding: 12px;
  border-radius: 14px;
  background: #efe0c4;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.main { padding: 10px 16px 16px; min-width: 0; width: 100%; flex: 1; overflow: auto; }

.kassa-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}
.kassa-pane {
  min-width: 180px;
  flex: 0 0 auto;
  box-sizing: border-box;
  overflow: auto;
  max-height: calc(100vh - 118px);
}
.kassa-pane > b { display: block; margin-bottom: 10px; }
.kassa-pay {
  flex: 1 1 auto;
  width: auto !important;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  overflow: auto;
  gap: 4px;
}
.kassa-pay > b { margin-bottom: 4px; }
.kassa-pay .field { margin: 0 0 6px; }
.kassa-pay-foot { margin-top: auto; padding-top: 4px; }
.pay-go { width: 100%; margin: 0; min-height: 40px; font-size: 15px; }
.pay-go-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 8px; }
.kassa-split {
  flex: 0 0 10px;
  cursor: col-resize;
  background: linear-gradient(#d3c4aa, #d3c4aa) center / 2px 46% no-repeat;
  touch-action: none;
}
.kassa-split:hover { background-color: #ead9b8; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 0;
  flex-shrink: 0;
}
.top h1 { margin: 0; font-size: 20px; font-weight: 600; white-space: nowrap; }
.top p { margin: 2px 0 0; color: var(--ink-soft); font-size: 14px; }
.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 1;
  justify-content: flex-end;
  overflow-x: auto;
}
.top-actions .btn { white-space: nowrap; flex-shrink: 0; padding: 8px 10px; }

.btn {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 9px 13px;
  border-radius: 14px;
}
.btn:hover { filter: brightness(1.05); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-2); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { background: #f3d4d0; border-color: #e3b4ae; color: var(--bad); }

.top-actions .btn:nth-child(6n+1) { background: #f4d7b8; border-color: #e4c19a; }
.top-actions .btn:nth-child(6n+2) { background: #d7ead8; border-color: #b7d4ba; }
.top-actions .btn:nth-child(6n+3) { background: #d7e3f4; border-color: #b7c8e4; }
.top-actions .btn:nth-child(6n+4) { background: #ead7f0; border-color: #d4b8de; }
.top-actions .btn:nth-child(6n+5) { background: #f4e2b8; border-color: #e4ce96; }
.top-actions .btn:nth-child(6n+6) { background: #f3d4d0; border-color: #e3b4ae; }
.top-actions .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.top-actions .btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.top-actions .btn.danger { background: #c45b4a; border-color: #c45b4a; color: #fff; }

.pay-methods .btn:nth-child(1) { background: #ffe08a; border-color: #e0c05a; }
.pay-methods .btn:nth-child(2) { background: #b8e0c8; border-color: #8fc8a6; }
.pay-methods .btn:nth-child(3) { background: #c5d4f4; border-color: #9db0e0; }
.pay-methods .btn.primary { color: #1f1a14; }

.period-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.period-btn { border-radius: 14px; background: #efe2cc; }
.period-btn:nth-child(1) { background: #f4d7b8; border-color: #e4c19a; }
.period-btn:nth-child(2) { background: #d7ead8; border-color: #b7d4ba; }
.period-btn:nth-child(3) { background: #d7e3f4; border-color: #b7c8e4; }
.period-btn:nth-child(4) { background: #ead7f0; border-color: #d4b8de; }
.period-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.period-date {
  border-radius: 14px !important;
  background: #fffdf8 !important;
  border: 1px solid var(--line) !important;
  min-height: 44px;
  padding: 8px 12px;
}

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1.4fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.stat .label { color: var(--ink-soft); font-size: 14px; }
.stat .value {
  font-family: var(--mono);
  font-size: 24px;
  margin-top: 6px;
}
.stat .sub { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }
.stat.good .value { color: var(--good); }
.stat.warn .value { color: var(--warn); }
.stat.bad .value { color: var(--bad); }

.search-2 { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 8px; margin-bottom: 4px; }
.metrics-box { max-width: 480px; }
.search {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card-2);
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--chip);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 15px;
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-c0 { background: #f4d7b8; border-color: #e4c19a; }
.chip-c1 { background: #d7ead8; border-color: #b7d4ba; }
.chip-c2 { background: #d7e3f4; border-color: #b7c8e4; }
.chip-c3 { background: #ead7f0; border-color: #d4b8de; }
.chip-c4 { background: #f4e2b8; border-color: #e4ce96; }
.chip-c5 { background: #f3d4d0; border-color: #e3b4ae; }
.chip-c6 { background: #cfe8e2; border-color: #a9d0c6; }
.chip-c7 { background: #e4dcc8; border-color: #cfc3a6; }
.chip-c8 { background: #dde8c8; border-color: #c0d09a; }
.chip-c9 { background: #f0d5e4; border-color: #dcb0c8; }
.pie-wrap { display: flex; gap: 14px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.pie { width: 140px; height: 140px; flex: 0 0 140px; }
.pie-leg { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.leg { display: flex; align-items: center; gap: 8px; }
.leg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.bar i.b0 { background: #b4451a; }
.bar i.b1 { background: #2f6a48; }
.bar i.b2 { background: #3d6ea8; }
.bar i.b3 { background: #a15c12; }
.bar i.b4 { background: #7a4ea3; }
.bar i.b5 { background: #c45b4a; }
.bar i.b6 { background: #2a9d8f; }
.bar i.b7 { background: #c9a227; }
.bar-lab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.list { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow: auto; }
.row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card-2);
  border: 1px solid transparent;
}
.row:hover { border-color: var(--line); }
.row .meta { color: var(--ink-soft); font-size: 15px; }
.row .money { font-family: var(--mono); }
.tag {
  display: inline-block;
  font-size: 13px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ead9b8;
}
.tag.low { background: #f3d7a4; }
.tag.zero { background: #f0c7c7; }

table { width: 100%; border-collapse: collapse; font-size: 17px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--ink-soft); font-weight: 500; font-size: 14px; }
td.num, th.num { text-align: right; font-family: var(--mono); }
td.bad { color: var(--bad); font-weight: 600; }
td.warn { color: var(--warn); }
.in-table select, .numin {
  width: 88px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.in-table select { width: 78px; }
tr.onrow td { background: #f3e2c4; }
.row.onrow { background: #fff3e4; outline: 2px solid var(--accent); }
.doc-list { max-height: 48vh; gap: 10px; }
.doc-card {
  grid-template-columns: minmax(0, 1.4fr) minmax(140px, 0.8fr) auto;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.doc-card .money { text-align: right; font-size: 18px; font-weight: 700; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.field span { font-size: 15px; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.cart-lines { display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.cart-line {
  display: grid;
  grid-template-columns: 1fr 90px 90px 28px;
  gap: 8px;
  align-items: center;
}
.cart-line input { width: 100%; padding: 8px; border-radius: 10px; border: 1px solid var(--line); }
.cart-head { margin: 8px 0 0; font-size: 14px; }
.cart-head > div:nth-child(2), .cart-head > div:nth-child(3) { text-align: center; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-methods {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin: 6px 0 8px;
}
.pay-methods .btn { width: 100%; min-width: 0; padding: 8px 6px; font-size: 14px; }
#cust { min-width: 0; width: 100%; }
.total-box {
  background: #1f1a14;
  color: #f6edd9;
  border-radius: 12px;
  padding: 10px 12px;
}
.total-box .big { font-family: var(--mono); font-size: 20px; }
.tapcard { cursor: pointer; }
.tapcard:hover { outline: 2px solid var(--accent); }
.kpi-line { font-size: 15px; margin-top: 6px; color: var(--ink-soft); overflow: hidden; }
.kpi-line b { color: var(--ink); float: right; font-family: var(--mono); }

.modal-bg {
  position: fixed; inset: 0;
  background: rgba(31, 26, 20, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 20;
}
.modal {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--card);
  border-radius: 20px;
  padding: 18px;
}

.receipt {
  width: 280px;
  margin: 0 auto;
  background: #fff;
  color: #111;
  padding: 16px;
  font-family: var(--mono);
  font-size: 12px;
}
.receipt h3 { text-align: center; margin: 0 0 8px; font-family: var(--sans); }
.muted { color: var(--ink-soft); }
.right { text-align: right; }
.flex { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
.hide { display: none !important; }

.formula {
  font-size: 15px;
  color: var(--ink-soft);
  padding: 10px 12px;
  background: #efe0c4;
  border-radius: 12px;
}

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 80px; gap: 8px; align-items: center; font-size: 15px; }
.bar {
  height: 10px;
  background: #eadcc3;
  border-radius: 99px;
  overflow: hidden;
}
.bar > i { display: block; height: 100%; background: var(--accent); }

.toast {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%);
  background: #1f1a14; color: #fff; padding: 10px 18px; border-radius: 12px;
  z-index: 200; font-size: 15px; max-width: min(720px, 90vw);
  line-height: 1.35; text-align: center; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast.hide { display: none; }

.modal-cats {
  max-width: 720px;
  width: min(720px, 96vw);
  max-height: none;
  overflow: visible;
}
.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
.cat-grid .btn { min-height: 40px; padding: 6px 8px; text-align: center; font-size: 15px; }

@media (max-width: 980px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .main { padding: 12px; }
  .top { flex-direction: column; align-items: stretch; }
}

/* --- версия 2: индикатор связи с сервером --- */
.sync-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 2px 8px; border-radius: 999px; margin-left: 8px; white-space: nowrap; }
.sync-badge.ok { color: #1d6b34; }
.sync-badge.busy { color: #8a6a00; }
.sync-badge.off { color: #fff; background: #b3261e; font-weight: 600; }

/* --- Приход: аккуратная раскладка --- */
.btn.sm { padding: 6px 10px; font-size: 14px; min-height: 0; border-radius: 10px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--card-2); border-color: var(--line); }
.danger-txt { color: var(--bad); }
.linkbtn { border: 0; background: none; padding: 0 0 0 6px; color: var(--accent); cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; }
.warn { color: var(--warn); }
.good { color: var(--good); }

.inc-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.inc-tabs { display: inline-flex; background: var(--bg-2); border-radius: 12px; padding: 3px; gap: 2px; }
.inc-tab { border: 0; background: transparent; padding: 8px 16px; border-radius: 10px; font: inherit; font-size: 15px; color: var(--ink-soft); cursor: pointer; }
.inc-tab.on { background: var(--card-2); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(50,32,12,.12); }
.inc-count { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--chip); font-size: 13px; font-weight: 500; text-align: center; }
.inc-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.inc-tools .btn { background: var(--card); }

.inc-head { padding: 12px 14px 8px; margin-bottom: 10px; }
.inc-head.editing { outline: 2px solid var(--warn); }
.inc-head-grid { display: grid; grid-template-columns: 1.3fr 1.3fr 1fr; gap: 12px; }
.inc-head .field { margin-bottom: 6px; }
.inc-head .field span { font-size: 13px; }
.inc-head .field input { padding: 8px 10px; }
.inc-head .field input:disabled { background: var(--bg-2); color: var(--ink-soft); }
.inc-check { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-soft); cursor: pointer; }

.inc-work { height: calc(100vh - 290px); min-height: 360px; }
.inc-work .kassa-pane { max-height: none; height: 100%; display: flex; flex-direction: column; padding: 12px; }
.inc-hint { font-size: 13px; margin: 8px 0 6px; }
.inc-picklist { max-height: none; flex: 1; gap: 4px; }
.inc-picklist .row { padding: 7px 10px; border-radius: 10px; }
.inc-picklist .row b { font-weight: 500; font-size: 15px; }
.inc-picklist .row .meta { font-size: 12px; }
.inc-picklist .row .btn { padding: 4px 10px; min-height: 0; }
.inc-lines-scroll { flex: 1; overflow: auto; min-height: 0; }
.inc-lines .in-table { font-size: 15px; }
.inc-lines .in-table th { position: sticky; top: 0; background: var(--card); z-index: 1; font-size: 13px; }
.inc-lines .in-table td { padding: 6px 6px; }
.inc-lines .in-table td .meta { font-size: 12px; color: var(--ink-soft); }
.inc-lines .numin { width: 76px; padding: 5px 7px; text-align: right; font-family: var(--mono); }
.inc-lines .in-table select { width: 70px; padding: 5px 4px; }
.inc-empty { padding: 28px 10px !important; text-align: center; }
.inc-sum { display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 1px; margin-top: 10px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.inc-sum > div { background: var(--card-2); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inc-sum span { font-size: 12px; line-height: 1.2; color: var(--ink-soft); }
.inc-sum > div { justify-content: space-between; }
.inc-pick .search { min-width: 0; }
.inc-sum b { font-family: var(--mono); font-size: 15px; white-space: nowrap; }
.inc-sum .inc-sum-main { background: #1f1a14; }
.inc-sum .inc-sum-main span { color: #cfc2aa; }
.inc-sum .inc-sum-main b { color: #f6edd9; font-size: 19px; }
.inc-sum .warn b { color: var(--warn); }
.inc-sum .good b { color: var(--good); }
.inc-sum .bad b { color: var(--bad); }

.inc-docs { padding: 12px 14px; }
.inc-filter { display: flex; gap: 8px; margin-bottom: 8px; }
.inc-select { min-width: 220px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; }
.inc-supinfo { font-size: 14px; color: var(--ink-soft); margin: 4px 2px 8px; }
.inc-doclist { max-height: calc(100vh - 250px); overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.inc-docrow { display: grid; grid-template-columns: 100px minmax(0, 1fr) 140px 150px 290px; gap: 12px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--card-2); cursor: pointer; }
.inc-docrow:last-child { border-bottom: 0; }
.inc-docrow:hover { background: #fff; }
.inc-docrow.onrow { background: #fff3e4; outline: none; box-shadow: inset 3px 0 0 var(--accent); }
.inc-docrow .num { text-align: right; font-family: var(--mono); font-size: 15px; }
.inc-docrow .meta { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inc-docrow .num .meta { font-family: var(--sans); }
.inc-dochead .num { font-family: var(--sans); font-size: 13px; }
.inc-dochead { position: sticky; top: 0; z-index: 1; background: var(--card); cursor: default; font-size: 13px; color: var(--ink-soft); padding-top: 7px; padding-bottom: 7px; }
.inc-dochead:hover { background: var(--card); }
.inc-date { display: flex; flex-direction: column; font-size: 14px; }
.inc-date span { font-size: 12px; color: var(--ink-soft); }
.inc-who b { font-weight: 600; }
.inc-acts { display: flex; gap: 2px; justify-content: flex-end; }

.sup-modal { width: min(620px, 100%); }
.sup-add { display: flex; gap: 8px; margin-bottom: 10px; }
.sup-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--card-2); }
.sup-row:last-child { border-bottom: 0; }
.sup-row input { border: 1px solid transparent; background: transparent; padding: 6px 8px; border-radius: 8px; font: inherit; min-width: 0; }
.sup-row input:hover, .sup-row input:focus { border-color: var(--line); background: #fff; }
.sup-row .muted { font-size: 13px; white-space: nowrap; }

@media (max-width: 980px) {
  .inc-head-grid { grid-template-columns: 1fr; }
  .inc-work { height: auto; flex-direction: column; overflow: visible; }
  .inc-work .kassa-pane { width: 100% !important; height: auto; }
  .inc-work .kassa-split { display: none; }
  .inc-picklist { max-height: 40vh; }
  .inc-lines-scroll { overflow-x: auto; }
  .inc-filter { flex-wrap: wrap; }
  .inc-filter .search, .inc-select { width: 100%; min-width: 0; }
  .inc-docrow > div:nth-child(4) { grid-column: 1 / -1; text-align: left; }
  .inc-sum { grid-template-columns: 1fr 1fr; }
  .inc-docrow { grid-template-columns: 1fr auto; }
  .inc-docrow .inc-date, .inc-dochead { display: none; }
  .inc-acts { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ===== Мобильная версия ===== */
/* Кнопки в шапке: прокрутка начинается слева (раньше первые кнопки обрезались). */
.top-actions > :first-child { margin-left: auto; }
.top-actions { justify-content: flex-start; scrollbar-width: none; }
.top-actions::-webkit-scrollbar { display: none; }
/* Строки списков: все кнопки в одну строку, сколько бы их ни было */
.row { grid-template-columns: minmax(0, 1fr); grid-auto-flow: column; grid-auto-columns: auto; }
.m-tabs { display: none; }

@media (max-width: 900px) {
  /* Касса на телефоне: вкладки Поиск / Чек / Оплата вместо трёх колонок */
  .m-tabs { display: flex; gap: 4px; background: var(--bg-2); border-radius: 12px; padding: 3px; margin-bottom: 8px; position: sticky; top: 0; z-index: 5; }
  .m-tab { flex: 1; border: 0; background: transparent; padding: 10px 6px; border-radius: 10px; font: inherit; font-size: 15px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-tab.on { background: var(--card-2); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(50,32,12,.12); }
  .m-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 13px; }
  .kassa-main { height: auto; overflow: visible; }
  .kassa-main .kassa-split { display: none; }
  .kassa-main .kassa-pane { display: none; width: 100% !important; max-height: none; min-width: 0; }
  .kassa-main.m-find .kp-find, .kassa-main.m-cart .kp-cart, .kassa-main.m-pay .kp-pay { display: flex; flex-direction: column; }
  .kassa-main .kp-find .list { max-height: none; }
  .kassa-main .cart-line { grid-template-columns: minmax(0, 1fr) 70px 80px 32px; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .main { padding: 8px 10px 16px; }
  .top { padding: 6px 10px 0; gap: 6px; }
  .top > .flex { width: 100%; }
  .top h1 { font-size: 18px; }
  .top p { font-size: 13px; }
  .top-actions { flex: 0 0 auto; width: 100%; padding-bottom: 2px; }
  .top-actions .btn { padding: 7px 10px; font-size: 14px; min-height: 38px; }
  .menu-btn { min-width: 44px; min-height: 44px; }
  .card { padding: 12px; border-radius: 14px; }
  /* Таблицы: листаются вбок внутри карточки, а не обрезаются */
  .main .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 15px; }
  th, td { padding: 7px 6px; }
  .stat .value { font-size: 22px; }
  .chip, .period-btn { font-size: 14px; }
  .modal-bg { padding: 8px; align-items: flex-end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 18px 18px 12px 12px; padding: 14px; }
  .row { padding: 9px 10px; gap: 8px; }
  .row .meta { font-size: 13px; }
  /* iPhone не увеличивает страницу при вводе, если шрифт поля не меньше 16px */
  input, select, textarea { font-size: 16px; }
  .search-2 { grid-template-columns: 1fr 90px; }
  .pay-methods .btn { font-size: 13px; }
  .inc-tools .btn { font-size: 13px; }
}

@media (max-width: 980px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  .grid-4, .grid-5 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .grid-4 .stat .value, .grid-5 .stat .value { font-size: 18px; letter-spacing: -0.5px; overflow-wrap: anywhere; }
  .stat { padding: 10px 12px; }
}

/* ---------- Сканер штрихкодов камерой ---------- */
.cam-wrap { position: relative; display: block; min-width: 0; }
.cam-wrap.grow { flex: 1 1 auto; }
.cam-wrap > input { width: 100%; padding-right: 50px; }
.cam-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 36px; border: 0; border-radius: 9px;
  background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.cam-btn:active { transform: translateY(-50%) scale(.94); }
html.cam-open, html.cam-open body { overflow: hidden; }
.cam-bg {
  position: fixed; inset: 0; z-index: 10000; background: #000; color: #fff;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.cam-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.cam-title { font-weight: 600; font-size: 17px; }
.cam-x { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 50%; width: 40px; height: 40px; font-size: 18px; }
.cam-view { position: relative; flex: 1 1 auto; overflow: hidden; }
.cam-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame {
  position: absolute; left: 7%; right: 7%; top: 50%; height: 36%; transform: translateY(-50%);
  border: 3px solid rgba(255,255,255,.9); border-radius: 16px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.38);
}
.cam-frame i { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #ff4d3d; box-shadow: 0 0 8px #ff4d3d; }
.cam-frame.hit { animation: camHit .45s; }
.cam-frame.miss { animation: camMiss .6s; }
@keyframes camHit { 0% { border-color: #3ddc84; box-shadow: 0 0 0 100vmax rgba(0,80,30,.45); } 100% { } }
@keyframes camMiss { 0% { border-color: #ff4d3d; box-shadow: 0 0 0 100vmax rgba(90,0,0,.45); } 100% { } }
.cam-msg {
  position: absolute; left: 16px; right: 16px; bottom: 16px; text-align: center;
  background: rgba(0,0,0,.6); padding: 10px 12px; border-radius: 12px; font-size: 15px;
}
.cam-msg[hidden], .cam-last[hidden], .cam-tool[hidden] { display: none; }
.cam-last { margin: 8px 14px 0; padding: 10px 12px; border-radius: 12px; font-size: 16px; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.cam-last.ok { background: #1f6f43; }
.cam-last.bad { background: #8e2b22; }
.cam-bottom { display: flex; gap: 10px; align-items: center; padding: 12px 14px 16px; }
.cam-tool { width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 22px; display: grid; place-items: center; flex: 0 0 auto; }
.cam-tool.on { background: #ffd54a; color: #222; }
.cam-done { flex: 1 1 auto; min-height: 52px; font-size: 17px; }

/* Окно продаж на компьютере: колонки тянутся до низа экрана, без пустой полосы снизу */
@media (min-width: 901px) {
  .main:has(> .kassa-main) { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 10px; }
  .main > .kassa-main { flex: 1 1 auto; height: auto; min-height: 0; }
  .kassa-main .kassa-pane { max-height: none; }
}
@media (min-width: 901px) {
  .pay-go-2 { grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
  .pay-go { padding-left: 6px; padding-right: 6px; }
}
/* невысокий экран ноутбука: окно продаж компактнее, чтобы всё влезало без прокрутки */
@media (min-width: 901px) and (max-height: 820px) {
  .kassa-main .kassa-pane { padding: 10px 12px; }
  .kassa-main .kassa-pane > b { margin-bottom: 6px; }
  .kp-pay .field { margin-bottom: 6px; gap: 3px; }
  .kp-pay .field span { font-size: 13px; }
  .kp-pay .field input, .kp-pay .field select { padding-top: 6px; padding-bottom: 6px; }
  .kp-pay .btn { min-height: 36px; padding-top: 5px; padding-bottom: 5px; }
  .kp-pay .pay-methods { margin: 4px 0 6px; }
  .kp-pay .total-box { padding: 7px 10px; }
  .kp-pay .total-box .big { font-size: 18px; }
  .kp-pay .pay-go-2 { margin-top: 6px; gap: 6px; }
  .kp-find .search-2 .search, .kp-cart .cart-line input { padding-top: 6px; padding-bottom: 6px; }
}

/* Цифровая клавиатура в окне оплаты (для сенсорного экрана кассы) */
.numpad {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(34px, 1fr); gap: 6px;
  flex: 1 1 auto; min-height: 124px; max-height: 300px; margin: 2px 0 6px;
}
.np-key {
  min-height: 0; padding: 0; font-family: var(--mono); font-size: 22px; font-weight: 600;
  background: var(--card-2); touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.np-key:active { background: var(--bg-2); transform: scale(.96); }
.np-back { color: var(--bad); }
@media (max-width: 900px) { .numpad { display: none; } }
/* совсем невысокий экран: две строки 1-5 ⌫ / 6-0 . */
@media (min-width: 901px) and (max-height: 700px) {
  .numpad { grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(32px, 1fr); min-height: 70px; max-height: 110px; gap: 5px; }
  .np-key { font-size: 19px; }
  .np-key[data-np="1"] { order: 1; } .np-key[data-np="2"] { order: 2; } .np-key[data-np="3"] { order: 3; }
  .np-key[data-np="4"] { order: 4; } .np-key[data-np="5"] { order: 5; } .np-key[data-np="⌫"] { order: 6; }
  .np-key[data-np="6"] { order: 7; } .np-key[data-np="7"] { order: 8; } .np-key[data-np="8"] { order: 9; }
  .np-key[data-np="9"] { order: 10; } .np-key[data-np="0"] { order: 11; } .np-key[data-np="."] { order: 12; }
}
@media (min-width: 901px) and (max-height: 700px) {
  .kp-pay .pay-go-2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kp-pay .pay-go { font-size: 13px; padding-left: 2px; padding-right: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.np-key { display: grid; place-items: center; cursor: pointer; }
.np-key.down { background: var(--bg-2); transform: scale(.96); }
@media (min-width: 901px) { .kassa-main input.np-target { outline: 2px solid var(--accent); outline-offset: 1px; } }
/* на компьютере цифры набираются встроенной клавиатурой — кнопки ⌨ у полей оплаты не нужны, поля шире */
@media (min-width: 901px) { .kp-pay [data-pad] { display: none; } }
/* меню на невысоком экране прокручивается, нижние кнопки не уходят за край */
.menu-sheet { overflow-y: auto; height: 100%; max-height: 100dvh; }

/* Финансы: «Основные показатели» на всю ширину, по группам */
.metrics-box { max-width: none; }
.mb-head { margin-bottom: 10px; }
.mb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.mb-group, .mb-hero { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card-2); min-width: 0; }
.mb-title { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 6px; }
.mb-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 0; font-size: 15px; color: var(--ink-soft); }
.mb-row + .mb-row { border-top: 1px dashed var(--line); }
.mb-row b { font-family: var(--mono); color: var(--ink); white-space: nowrap; }
.mb-hero { background: #1f1a14; border-color: #1f1a14; color: #f6edd9; display: flex; flex-direction: column; gap: 6px; }
.mb-hero.alt { background: var(--good); border-color: var(--good); color: #fff; }
.mb-label { font-size: 14px; opacity: .8; }
.mb-big { font-family: var(--mono); font-size: 24px; font-weight: 600; white-space: nowrap; }
.mb-hero .btn { align-self: flex-start; margin-top: auto; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: inherit; font-size: 13px; }
.mb-hint { margin: 10px 0 0; }
@media (max-width: 760px) { .mb-big { font-size: 20px; } }
.mb-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1500px) { .mb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) { .mb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .mb-grid { grid-template-columns: minmax(0, 1fr); } }
/* «Долги» убраны из показателей (есть отдельными карточками ниже): 5 блоков */
.mb-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1500px) { .mb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mb-hero.alt { grid-column: span 2; } }
@media (max-width: 980px) { .mb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mb-hero.alt { grid-column: span 2; } }
@media (max-width: 560px) { .mb-grid { grid-template-columns: minmax(0, 1fr); } .mb-hero.alt { grid-column: auto; } }
/* 4 блока: кошелёк, склад, касса и доли, чистые активы */
.mb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mb-hero.alt { grid-column: auto; }
@media (max-width: 1100px) { .mb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mb-hero.alt { grid-column: auto; } }
@media (max-width: 560px) { .mb-grid { grid-template-columns: minmax(0, 1fr); } }
.silent-print { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.silent-print .btn { display: inline-block; text-decoration: none; color: inherit; margin-top: 4px; }
/* Кнопка «Назад» слева в шапке, рядом с меню */
.back-btn { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.back-btn:hover { background: var(--accent-2); }
@media (max-width: 760px) {
  .period-bar { display: flex; flex-wrap: wrap; gap: 6px; }
  .period-bar .period-date { flex: 1 1 140px; min-width: 0; width: auto; }
}

/* Средняя часть шапки (Приход: вкладки и инструменты между заголовком и «Провести приход») */
.top-mid { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.top-mid .inc-bar { margin: 0; flex: 1 1 auto; justify-content: space-between; gap: 10px; }
.top.has-mid .top-actions { flex: 0 0 auto; }
.top.has-mid { gap: 14px; }
@media (max-width: 980px) {
  .top-mid { width: 100%; order: 3; }
  .top.has-mid .top-actions { order: 2; }
}

/* Галочки крупнее — удобнее попадать пальцем и мышью */
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-width: 22px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
@media (pointer: coarse) { input[type="checkbox"], input[type="radio"] { width: 26px; height: 26px; min-width: 26px; } }
label:has(> input[type="checkbox"]) { cursor: pointer; }

/* ---------- Компактнее: списки карточек и плитки показателей ---------- */
/* списки (клиенты, смены): на широком экране — в несколько колонок, строки ниже */
.row-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 6px; padding: 10px; }
.row-grid > .row { padding: 6px 10px; border: 1px solid var(--line); }
.row-grid > .row .meta { font-size: 13px; }
.row-grid > .row .btn { min-height: 34px; padding: 4px 10px; }
.row-grid > .row b { font-weight: 600; }
/* плитки показателей не растягиваются на весь широкий экран */
@media (min-width: 981px) {
  .grid-2:has(> .stat), .grid-3:has(> .stat), .grid-4:has(> .stat) { grid-template-columns: repeat(auto-fill, minmax(230px, 320px)); }
  .grid-5:has(> .stat) { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}
.stat { padding: 12px 14px; }
.stat .value { font-size: 22px; margin-top: 4px; }

/* ===== Аналитика ===== */
.an-tabs { margin-bottom: 10px; }
.an-tabs .chip { font-size: 15px; padding: 7px 12px; }
.an { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.an-kpis { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.an-kpi .value { font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-kpi .sub { font-size: 13px; }
.an-d { font-weight: 600; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.an-d.up { color: var(--good); }
.an-d.down { color: var(--bad); }
.an-note { margin: 0; font-size: 13px; }
.an-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.an-card { padding: 12px 14px; min-width: 0; }
.an-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.an-h .muted { font-size: 13px; }
.an-tw { overflow: auto; max-height: 560px; }
.an-table { width: 100%; font-size: 14px; }
.an-table th { position: sticky; top: 0; background: var(--card); font-size: 13px; color: var(--ink-soft); font-weight: 600; z-index: 1; }
.an-table td, .an-table th { padding: 6px 8px; }
.an-table th.num, .an-table td.num { text-align: right; white-space: nowrap; }
.an-table .meta { color: var(--ink-soft); font-size: 12px; }
.an-table tr.an-strong td { font-weight: 700; border-top: 2px solid var(--line); }
.an-table tr.tapcard { cursor: pointer; }
.an-bar-cell { width: 22%; min-width: 80px; }
.an-meter { height: 10px; border-radius: 6px; background: var(--chip); overflow: hidden; }
.an-meter i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.an-meter.good i { background: var(--good); }
.an-meter.bad i { background: var(--bad); }
.an-abc { display: inline-block; min-width: 20px; text-align: center; font-size: 12px; font-weight: 700; border-radius: 5px; padding: 1px 4px; margin-right: 3px; }
.an-abc.A { background: #d7ead8; color: var(--good); }
.an-abc.B { background: #f4e2b8; color: var(--warn); }
.an-abc.C { background: #f0d5d0; color: var(--bad); }
.an-sortbar { margin-bottom: 8px; }
.an-cols { display: flex; align-items: stretch; gap: 3px; height: 190px; padding-top: 6px; }
.an-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; cursor: default; }
.an-colbar { flex: 1; width: 100%; position: relative; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); }
.an-colbar i { position: absolute; bottom: 0; left: 8%; right: 8%; background: #e0b89f; border-radius: 4px 4px 0 0; }
.an-colbar b { position: absolute; bottom: 0; left: 28%; right: 28%; background: var(--good); border-radius: 3px 3px 0 0; }
.an-col:hover .an-colbar i { background: var(--accent); }
.an-col span { font-size: 11px; color: var(--ink-soft); height: 16px; line-height: 16px; white-space: nowrap; }
.an-legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.an-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.an-legend i.c1 { background: #e0b89f; }
.an-legend i.c2 { background: var(--good); }
.an-sig { display: flex; flex-direction: column; gap: 6px; }
.an-sig-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line); font-size: 15px; }
.an-sig-row i { flex: 0 0 10px; height: 10px; border-radius: 50%; background: var(--ink-soft); }
.an-sig-row.bad i { background: var(--bad); }
.an-sig-row.warn i { background: var(--warn); }
.an-sig-row.good i { background: var(--good); }
.an-sig-row.bad { background: #fbeeec; }
.an-sig-row.warn { background: #fdf4e6; }
.an-sig-row span { flex: 1; }
.an-sig-row em { font-style: normal; color: var(--ink-soft); font-size: 20px; }
.an-fc { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.an-fc > div { display: flex; flex-direction: column; gap: 2px; }
.an-fc b { font-family: var(--mono); font-size: 21px; }
.an-fc small { color: var(--ink-soft); }
.an-card > .an-note { margin-top: 8px; }
.an-heat { display: grid; gap: 3px; align-items: center; overflow-x: auto; }
.an-heat i { display: block; height: 24px; border-radius: 4px; background: var(--accent); }
.an-heat .hh { font-size: 11px; text-align: center; color: var(--ink-soft); }
.an-heat .hd { font-size: 12px; color: var(--ink-soft); }
@media (max-width: 900px) {
  .an-g2 { grid-template-columns: minmax(0, 1fr); }
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .an-kpi .value { font-size: 17px; }
  .an-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .an-tabs .chip { flex: 0 0 auto; }
  .an-cols { height: 150px; gap: 2px; }
  .an-table { font-size: 13px; }
  .an-bar-cell { display: none; }
  .an-heat i { height: 18px; }
}
.an .bar-row { grid-template-columns: minmax(70px, 150px) minmax(60px, 1fr) auto; font-size: 14px; }
.an .bar-row .right { white-space: nowrap; text-align: right; font-size: 13px; }
@media (max-width: 600px) {
  .an .bar-row { grid-template-columns: 1fr auto; row-gap: 2px; }
  .an .bar-row .bar { grid-column: 1 / -1; grid-row: 2; }
}

/* ===== Компактные списки и таблицы (везде) ===== */
table { font-size: 15px; }
th, td { padding: 6px 8px; }
th { font-size: 13px; }
td .btn { min-height: 32px; padding: 3px 10px; font-size: 14px; border-radius: 9px; line-height: 1.2; }
td .btn + .btn { margin-left: 4px; }
td:has(> .btn) { white-space: nowrap; width: 1%; text-align: right; }
td .meta, td > div.meta { font-size: 12px; color: var(--ink-soft); line-height: 1.25; }
.card > table, .card > .an-tw { margin: -4px 0; }
.list { gap: 5px; }
.row { padding: 7px 10px; gap: 8px; border-radius: 11px; }
.row .meta { font-size: 13px; }
.row .btn { min-height: 34px; padding: 4px 10px; }
.row-grid > .row { padding: 5px 10px; }
/* нажимаемые строки: видно, что это можно открыть */
tr.tapcard { cursor: pointer; }
tr.tapcard:hover { outline: none; }
tr.tapcard:hover > td { background: #f6e8d2; }
tr.tapcard > td:last-child::after { content: "›"; display: inline-block; margin-left: 10px; color: var(--accent); font-size: 20px; font-weight: 700; line-height: 1; vertical-align: -1px; }
tr.tapcard > td:last-child { white-space: nowrap; text-align: right; }
.row.tapcard, .row[data-openshift] { position: relative; padding-right: 26px; }
.row.tapcard::after { content: "›"; position: absolute; right: 9px; top: 50%; transform: translateY(-52%); color: var(--accent); font-size: 20px; font-weight: 700; }
@media (pointer: coarse) {
  td .btn { min-height: 36px; }
}

/* ===== Списки по ширине содержимого и по центру (без пустых полос) ===== */
.main > .card:has(> table),
.main > .card:has(> .an-tw),
.an > .an-card:has(> .an-tw) {
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  overflow-x: auto;
  box-sizing: border-box;
}
.main > .card > table,
.main > .card > .an-tw > table,
.an > .an-card > .an-tw > table { width: auto; }
.main > .card > table td, .main > .card > table th { padding: 6px 12px; }
.main > .card > table td:first-child, .main > .card > table th:first-child { padding-left: 4px; }
.main > .card > table td:last-child, .main > .card > table th:last-child { padding-right: 4px; }
.main > .card > table td b { white-space: nowrap; }
.main > .card > table td.num { white-space: nowrap; }
.main > .card > table td:first-child { white-space: nowrap; }
@media (max-width: 700px) {
  .main > .card > table td:first-child { white-space: normal; }
  .main > .card > table td, .main > .card > table th { padding: 6px 6px; }
}
@media (max-width: 700px) {
  .main > .card > table td { white-space: nowrap; }
  .main > .card > table td:first-child { white-space: normal; min-width: 110px; }
}
/* сотрудники */
span.good { color: var(--good); font-weight: 600; }
span.bad { color: var(--bad); font-weight: 600; }
.emp-months { justify-content: center; margin-bottom: 10px; }
tr.emp-total td { border-top: 2px solid var(--line); font-weight: 700; }
.emp-stats { margin-bottom: 4px; }

/* ===== Центровка во всей программе (кроме окна продаж) ===== */
.main.centered > * { max-width: 1500px; margin-left: auto; margin-right: auto; }
.main.centered > .kassa-wrap, .main.centered > .inc-work { max-width: none; }
.main.centered > .period-bar, .main.centered .period-bar { justify-content: center; }
.main.centered .chips { justify-content: center; }
.main.centered > .flex { justify-content: center; }
.main.centered .grid:has(> .stat) { justify-content: center; }
.main.centered > .search, .main.centered > input.search { display: block; max-width: 900px; }
.main.centered > p.muted, .main.centered > .muted { text-align: center; }
.main.centered .an-kpis { justify-content: center; }
.main.centered .an-h { justify-content: space-between; }

/* ===== Финансы: одна сетка, одна ширина ===== */
.main.centered > .fin { max-width: 1240px; }
.fin { display: flex; flex-direction: column; gap: 10px; margin: 0 auto; }
.fin > .period-bar { margin: 0; }
.fin-h { font-weight: 700; font-size: 15px; margin: 8px 2px 0; }
.fin-h .muted { font-weight: 400; }
.fin-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.fin-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fin-tile, .fin-nav-t { padding: 12px 14px; min-width: 0; margin: 0; }
.fin-l { font-size: 14px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-v { font-family: var(--mono); font-size: 22px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-s { font-size: 13px; color: var(--ink-soft); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-tile.good .fin-v { color: var(--good); }
.fin-tile.warn .fin-v { color: var(--warn); }
.fin-tile.bad .fin-v { color: var(--bad); }
.fin-tile.tapcard:hover, .fin-nav-t:hover { outline: 2px solid var(--accent); }
.fin-pay { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 0; margin: 0; overflow: hidden; }
.fin-pay-t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 14px; min-width: 0; }
.fin-pay-t + .fin-pay-t { border-left: 1px solid var(--line); }
.fin-pay-t span { color: var(--ink-soft); font-size: 14px; white-space: nowrap; }
.fin-pay-t b { font-family: var(--mono); font-weight: 500; font-size: 16px; white-space: nowrap; }
.fin-note { margin: 0; text-align: center; }
.fin-metrics { margin: 0; }
.fin-metrics .mb-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fin-metrics .mb-hero .mb-big { font-size: 22px; }
.fin-nav-t { display: flex; align-items: center; gap: 10px; }
.fin-nav-t > div { flex: 1; min-width: 0; }
.fin-nav-t > i { font-style: normal; color: var(--accent); font-size: 24px; font-weight: 700; }
.fin-nav-t.good .fin-v { color: var(--good); }
@media (max-width: 1150px) {
  .fin-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fin-pay { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fin-pay-t:nth-child(4) { border-left: none; }
  .fin-pay-t:nth-child(n+4) { border-top: 1px solid var(--line); }
  .fin-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-metrics .mb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .fin-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-row > .fin-tile:last-child { grid-column: 1 / -1; }
  .fin-pay { grid-template-columns: minmax(0, 1fr); }
  .fin-pay-t + .fin-pay-t { border-left: none; border-top: 1px solid var(--line); }
  .fin-nav { grid-template-columns: minmax(0, 1fr); }
  .fin-metrics .mb-grid { grid-template-columns: minmax(0, 1fr); }
  .fin-v { font-size: 18px; }
}
.fin-metrics .mb-hint { font-size: 13px; text-align: center; }
.fin-metrics .mb-row span { font-size: 14px; }
.fin-metrics .mb-hero .btn { font-size: 12px; padding: 4px 10px; min-height: 0; }
@media (max-width: 640px) { .fin-s { white-space: normal; } }

/* ===== Кнопка «Назад» ===== */
.nav-back {
  display: inline-flex; align-items: center; gap: 4px;
  height: 44px; padding: 0 16px 0 10px;
  border-radius: 999px; border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf8, #f3e9d8);
  color: var(--ink); font-weight: 600; font-size: 15px;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 2px 6px rgba(60,40,20,.10);
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: box-shadow .15s, transform .15s, background .15s;
}
.nav-back svg { color: var(--accent); transition: transform .15s; }
.nav-back:hover { background: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 4px 12px rgba(60,40,20,.16); }
.nav-back:hover svg { transform: translateX(-3px); }
.nav-back:active { transform: scale(.97); }
.top .nav-back { height: 48px; margin-left: 2px; }
@media (max-width: 700px) {
  .top .nav-back { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .top .nav-back span { display: none; }
}

/* ===== Окно «Расходы» в окне продаж ===== */
.sm-modal { width: min(640px, 100%); padding: 16px 18px 18px; }
.sm-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sm-top h3 { margin: 0; flex: 1; font-size: 20px; }
.sm-top .nav-back { height: 38px; font-size: 14px; }
.sm-x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card-2); font-size: 22px; line-height: 1; color: var(--ink-soft); cursor: pointer; }
.sm-x:hover { background: #fff; color: var(--ink); }
.sm-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.sm-cat {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card-2); font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left;
  transition: border-color .12s, box-shadow .12s, background .12s;
}
.sm-cat i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: 0 0 10px; }
.sm-cat:hover { border-color: var(--c); }
.sm-cat.on { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.14); }
.sm-cat.on i { background: #fff; }
.sm-list-h { display: flex; justify-content: space-between; align-items: baseline; margin: 2px 2px 6px; }
.sm-list-h span { font-family: var(--mono); }
.sm-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card-2); }
.sm-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 10px; }
.sm-row + .sm-row { border-top: 1px solid var(--line); }
.sm-time { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.sm-what { display: flex; flex-direction: column; min-width: 0; }
.sm-what small, .sm-sum small { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-sum { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--mono); white-space: nowrap; }
.sm-sum small { font-family: inherit; font-family: var(--sans, inherit); }
.sm-acts { display: flex; gap: 4px; }
.sm-acts .btn { min-height: 32px; padding: 3px 9px; border-radius: 9px; font-size: 14px; }
.sm-empty { padding: 18px; text-align: center; color: var(--ink-soft); }
.sm-form { display: flex; flex-direction: column; gap: 6px; border-top: 3px solid var(--c); padding-top: 12px; }
.sm-label { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.sm-who { display: flex; flex-wrap: wrap; gap: 6px; }
.sm-pill { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card-2); font-size: 15px; cursor: pointer; }
.sm-pill:hover { border-color: var(--c); }
.sm-pill.on { background: var(--c); border-color: var(--c); color: #fff; }
.sm-newwho { flex: 1 1 160px; min-width: 140px; padding: 8px 14px; border-radius: 999px; border: 1px dashed var(--line); background: transparent; font-size: 15px; }
.sm-amt { display: flex; align-items: center; gap: 8px; padding: 4px 16px; border-radius: 16px; border: 2px solid var(--line); background: #fff; transition: border-color .12s; }
.sm-amt:focus-within { border-color: var(--c); }
.sm-amt input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-family: var(--mono); font-size: 30px; padding: 6px 0; }
.sm-amt span { font-size: 18px; color: var(--ink-soft); }
.sm-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--chip); }
.sm-seg button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 6px; border-radius: 10px; border: 0; background: transparent; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; }
.sm-seg button small { font-size: 12px; font-weight: 400; color: var(--ink-soft); font-family: var(--mono); white-space: nowrap; }
.sm-seg button.on { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.sm-split { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sm-split[hidden] { display: none; }
.sm-split label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--ink-soft); }
.sm-split input, .sm-note { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 16px; }
.sm-split input { font-family: var(--mono); }
.sm-split input:focus, .sm-note:focus { outline: 2px solid var(--c); outline-offset: -1px; }
.btn.primary.sm-save { margin-top: 12px; min-height: 52px; font-size: 17px; font-weight: 700; border-radius: 14px; background: var(--c); border-color: var(--c); }
.btn.primary.sm-save:hover { filter: brightness(1.06); background: var(--c); }
@media (max-width: 560px) {
  .sm-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .sm-time { display: none; }
  .sm-amt input { font-size: 26px; }
}
@media (max-width: 560px) {
  .sm-cats { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; margin-bottom: 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .sm-cats::-webkit-scrollbar { display: none; }
  .sm-cat { flex: 0 0 auto; padding: 9px 12px; font-size: 14px; }
}

/* ===== Аналитика: одна колонка, одна сетка (как Финансы) ===== */
.main.centered > .an { max-width: 1240px; }
.an { margin: 0 auto; gap: 10px; }
.an > .an-tabs { margin: 0; justify-content: center; }
.an > .period-bar { margin: 0; }
.an > .an-note, .an > p.an-note { text-align: center; }
/* плитки: равные колонки в одну линию; 7–8 плиток — две строки по 4 */
.main.centered .an-kpis, .an-kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; gap: 10px; justify-content: stretch; }
.main.centered .an-kpis:has(> :nth-child(7)), .an-kpis:has(> :nth-child(7)) { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.an-kpi { margin: 0; padding: 12px 14px; min-width: 0; }
.an-kpi .label { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-kpi .value { font-size: 22px; margin-top: 4px; }
.an-kpi .sub { font-size: 13px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-kpi .sub:empty::before { content: "\00a0"; }
/* карточки и таблицы — во всю ширину колонки */
.an > .an-card:has(> .an-tw), .an > .an-card { width: auto; max-width: none; margin: 0; }
.an > .an-card > .an-tw > table, .an-card .an-table { width: 100%; }
.an-g2 { margin: 0; align-items: stretch; }
.an-g2 > .an-card { margin: 0; }
/* полоса прогноза */
.an-fcs { padding: 12px 14px; margin: 0; }
.an-fcs-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 10px; }
.an-fcs-cells > div { display: flex; flex-direction: column; gap: 2px; padding: 0 14px; min-width: 0; }
.an-fcs-cells > div:first-child { padding-left: 0; }
.an-fcs-cells > div + div { border-left: 1px solid var(--line); }
.an-fcs-cells span { font-size: 14px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-fcs-cells b { font-family: var(--mono); font-size: 22px; font-weight: 500; white-space: nowrap; }
.an-fcs-cells small { font-size: 13px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-fcs .an-note { margin-top: 6px; }
.an-sig { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 1100px) {
  .main.centered .an-kpis, .an-kpis { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .main.centered .an-kpis:has(> :nth-child(7)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .an-sig { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .main.centered .an-kpis, .an-kpis, .main.centered .an-kpis:has(> :nth-child(7)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-kpi .value { font-size: 18px; }
  .an-fcs-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .an-fcs-cells > div:nth-child(3) { border-left: none; padding-left: 0; }
  .an-fcs-cells b { font-size: 18px; }
  .an > .an-tabs { justify-content: flex-start; }
}
@media (max-width: 760px) { .main.centered .an > .an-tabs { justify-content: flex-start; } }

/* ===== Графики аналитики: оси, подписи, подсказки ===== */
.an-chart, .an-pareto { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 8px; padding-top: 18px; }
.an-yax { position: relative; height: 210px; }
.an-yax span { position: absolute; right: 0; transform: translateY(50%); font-size: 11px; color: var(--ink-soft); font-family: var(--mono); white-space: nowrap; }
.an-plot { position: relative; height: 210px; }
.an-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid #e8dcc6; pointer-events: none; }
.an-grid.mark { border-top-color: #cdb999; }
.an-avg { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px solid #8a6d4a; pointer-events: none; z-index: 2; opacity: .75; }
.an-avg span { position: absolute; right: 0; bottom: 2px; font-size: 11px; color: #6b5e4e; background: var(--card); padding: 0 4px; border-radius: 4px; }
.an-chart .an-cols { position: absolute; inset: 0; height: auto; padding: 0; display: flex; align-items: stretch; gap: 2px; }
.an-chart .an-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; outline: none; }
.an-chart .an-colbar { flex: 1; position: relative; border-bottom: 1px solid #cdb999; }
.an-chart .an-colbar i { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: min(78%, 28px); background: #e2bfa6; border-radius: 4px 4px 0 0; }
.an-chart .an-colbar b { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: min(40%, 14px); background: var(--good); border-radius: 3px 3px 0 0; }
.an-chart .an-col:hover .an-colbar i, .an-chart .an-col:focus .an-colbar i { background: #d09a78; }
.an-chart .an-col > span { height: 18px; line-height: 18px; font-size: 11px; color: var(--ink-soft); text-align: center; white-space: nowrap; overflow: visible; }
.an-val { position: absolute; left: 50%; transform: translate(-50%, -3px); font-style: normal; font-size: 10.5px; line-height: 1; color: var(--ink); font-family: var(--mono); white-space: nowrap; pointer-events: none; z-index: 3; }
.an-val.max { font-weight: 700; }
.an-cols:not(.dense) .an-val { writing-mode: horizontal-tb; }
/* столбиков много или экран узкий — подписываем только максимум, минимум и последний */
.an-cols.dense .an-val:not(.key) { display: none; }
.an-segs { position: absolute; left: 50%; bottom: 0; top: 0; transform: translateX(-50%); width: min(78%, 28px); display: flex; flex-direction: column-reverse; }
.an-segs u { display: block; width: 100%; text-decoration: none; border-top: 2px solid var(--card); }
.an-segs u:last-child { border-radius: 4px 4px 0 0; }
.an-segs u:first-child { border-top: 0; }
/* подсказка при наведении */
.an-tip { display: none; position: absolute; left: 50%; transform: translateX(-50%); min-width: 170px; background: #1f1a14; color: #f6edd9; border-radius: 10px; padding: 8px 10px; font-size: 12px; z-index: 20; box-shadow: 0 6px 18px rgba(0,0,0,.25); pointer-events: none; }
.an-tip strong { display: block; margin-bottom: 4px; font-size: 12.5px; }
.an-tip div { display: flex; align-items: center; gap: 6px; justify-content: space-between; white-space: nowrap; }
.an-tip div span { color: #cfc2aa; flex: 1; }
.an-tip div em { font-style: normal; font-family: var(--mono); }
.an-tip div i { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px; }
.an-col:hover .an-tip, .an-col:focus .an-tip { display: block; }
.an-col:first-child .an-tip, .an-col:nth-child(2) .an-tip { left: 0; transform: none; }
.an-col:last-child .an-tip, .an-col:nth-last-child(2) .an-tip { left: auto; right: 0; transform: none; }
.an-legend i.c3 { width: 14px; height: 0; border-top: 2px solid #8a6d4a; border-radius: 0; vertical-align: 3px; }
.an-legend b { font-weight: 600; font-family: var(--mono); margin-left: 2px; }
.an-empty { padding: 20px; text-align: center; }
/* Парето */
.an-pareto { grid-template-rows: auto auto; }
.an-pareto .an-plot { border-bottom: 1px solid #cdb999; }
.an-pareto svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.an-pareto .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.an-pareto .area { fill: var(--accent); opacity: .1; }
.an-zone { position: absolute; top: 0; bottom: 0; }
.an-zone span { position: absolute; bottom: 6px; left: 6px; font-size: 11px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.an-zone.a { left: 0; background: rgba(47,106,72,.07); }
.an-zone.b { background: rgba(161,92,18,.06); }
.an-zone.c { background: rgba(155,44,44,.05); }
.an-zone.c span { left: auto; right: 6px; }
.an-pdot { position: absolute; width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--card); z-index: 3; }
.an-pdot em { position: absolute; left: 14px; top: -22px; font-style: normal; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--card); padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); }
.an-xax { grid-column: 2; display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-soft); margin-top: 4px; }
/* одноцветные полосы в аналитике: цвет не должен означать разное для одного ряда */
.an .bars.nice .bar i { background: #c8744a; }
@media (max-width: 760px) {
  .an-chart, .an-pareto { grid-template-columns: 40px minmax(0, 1fr); column-gap: 4px; }
  .an-yax, .an-plot { height: 170px; }
  .an-chart .an-cols .an-val:not(.key) { display: none; }
  .an-tip { min-width: 150px; }
}
.an-chart { padding-bottom: 22px; }
.an-chart .an-col { position: relative; }
.an-chart .an-col > span { position: absolute; left: -10px; right: -10px; top: 100%; margin-top: 4px; }

.an-chart .an-col:hover .an-val, .an-chart .an-col:focus .an-val { visibility: hidden; }
.an-pdot.flip em { left: auto; right: 14px; }
@media (max-width: 760px) {
  .an-avg span { display: none; }
  .an-pdot em { white-space: normal; width: 150px; top: 8px; }
  .an-pdot:not(.flip) em { left: 10px; }
}
/* рейтинг поставщиков */
.an-scoretab td.an-good { color: var(--good); font-weight: 600; }
.an-scoretab td.an-bad { color: var(--bad); }
.an-scoretab td.an-score { min-width: 130px; }
.an-scoretab td.an-score .an-meter { display: inline-block; width: 80px; vertical-align: middle; height: 8px; }
.an-scoretab td.an-score b { font-family: var(--mono); margin-left: 8px; vertical-align: middle; }
.an-scoretab tr:first-child + tr td { background: rgba(47,106,72,.06); }
.an-sig-head { display: flex; align-items: center; gap: 10px; }
.an-sig-head .an-sig-row { flex: 1; font-weight: 600; }
.an-sig-row.info i { background: var(--ink-soft); }
.an-sigview .an-tw { max-height: none; }
.an-sigview { display: flex; flex-direction: column; gap: 10px; }

/* ===== Окно «Чеки» в окне продаж ===== */
.ck-modal { width: min(760px, 100%); padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.ck-top { position: sticky; top: 0; z-index: 2; background: var(--card); padding: 14px 16px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.ck-top .sm-top { margin: 0; }
.ck-top h3 { font-size: 19px; }
.ck-sum { font-size: 14px; font-weight: 400; margin-left: 6px; font-family: var(--mono); }
.ck-scope { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ck-scope button { padding: 7px 6px; }
.ck-top .search { padding: 9px 12px; }
.ck-chips { justify-content: flex-start !important; }
.ck-chips .chip { font-size: 14px; padding: 5px 10px; }
.ck-list { overflow: auto; flex: 1; min-height: 0; padding: 6px 12px 12px; }
.ck-row { display: grid; grid-template-columns: 70px 80px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--line); border-radius: 0; }
.ck-row:hover { background: #f6e8d2; outline: none; }
.ck-time { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.ck-no { font-size: 14px; }
.ck-kind { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-width: 0; }
.ck-kind small { color: var(--ink-soft); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-sum2 { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.ck-sum2.bad { color: var(--bad); }
.ck-more { width: 100%; margin-top: 8px; }
@media (max-width: 760px) {
  .ck-modal { max-height: 92vh; }
  .ck-row { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 2px; }
  .ck-no { display: none; }
  .ck-top { padding: 12px 12px 8px; }
  .ck-chips { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; }
  .ck-chips .chip { flex: 0 0 auto; }
}
.modal-x { position: sticky; top: 0; float: right; z-index: 5; width: 38px; height: 38px; margin: -4px -4px 0 8px; border-radius: 50%; border: 1px solid var(--line); background: var(--card-2); font-size: 22px; line-height: 1; color: var(--ink-soft); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.modal-x:hover { background: #fff; color: var(--ink); }
.mb-row small { display: block; font-size: 12px; color: var(--ink-soft); opacity: .85; margin-top: 1px; }
.mb-row span { min-width: 0; }
.mb-sub { font-size: 13px; opacity: .85; }
.mb-sub b { font-family: var(--mono); }
.mb-sub b { white-space: nowrap; }

/* ===== Список закупок ===== */
.main.centered > .buy { max-width: 1240px; }
.buy { display: flex; flex-direction: column; gap: 10px; margin: 0 auto; }
.buy-ctl { padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.buy-ctl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.buy-seg { grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 240px; }
.buy-seg button { padding: 7px 10px; }
.buy-q { flex: 1 1 260px; max-width: 420px; padding: 9px 12px; }
.buy-ctl .chip b { font-family: var(--mono); margin-left: 3px; }
.buy-group { margin: 0; padding: 12px 14px; }
.buy-gh { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.buy-gh b { font-size: 16px; }
.buy-gh .bad { color: var(--bad); font-weight: 600; }
.buy-gb { display: flex; gap: 6px; }
.buy-table td small { color: var(--ink-soft); font-size: 12px; }
.tag.buy-out, .tag.buy-urgent { background: #f3d4d0; color: var(--bad); }
.tag.buy-soon { background: #f4e2b8; color: #7a4a0c; }
.tag.buy-min { background: #e4dcc8; }
.buy .an-tw { max-height: none; }
@media (max-width: 760px) {
  .buy-ctl-row { justify-content: stretch; }
  .buy-seg { min-width: 0; flex: 1 1 100%; }
  .buy-q { max-width: none; }
  .buy-gb { width: 100%; }
  .buy-gb .btn { flex: 1; }
}
.buy-table { table-layout: fixed; }
.buy-table th:nth-child(1) { width: 32%; }
.buy-table th:nth-child(2) { width: 13%; }
.buy-table th:nth-child(3) { width: 8%; }
.buy-table th:nth-child(4) { width: 10%; }
.buy-table th:nth-child(5) { width: 10%; }
.buy-table th:nth-child(6) { width: 10%; }
.buy-table th:nth-child(7) { width: 8%; }
.buy-table th:nth-child(8) { width: 9%; }
.buy-table td:first-child { overflow: hidden; text-overflow: ellipsis; }
.buy-table td:first-child .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .buy-table { table-layout: auto; min-width: 640px; }
}

/* ===== Закупка по списку: отметки «куплено» ===== */
.buy-trip { margin: 0; padding: 12px 14px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 2px solid #b7d4ba; }
.buy-trip-f { display: flex; gap: 10px; flex-wrap: wrap; flex: 1 1 420px; }
.buy-trip-f label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--ink-soft); flex: 1 1 180px; }
.buy-trip-f select, .buy-trip-f input { padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 15px; }
.buy-trip-s { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.buy-trip-s > div { display: flex; flex-direction: column; gap: 3px; min-width: 170px; }
.buy-trip-s b { font-family: var(--mono); font-size: 17px; }
.buy-trip-s .an-meter { height: 6px; }
.buy-trip-s small { font-size: 12px; }
.buy-ckc { width: 44px; padding-left: 2px !important; padding-right: 2px !important; }
.buy-table th.buy-ckc { width: 44px !important; }
.buy-check { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #b9a88c; background: #fff; color: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: background .12s, border-color .12s, transform .1s; }
.buy-check:hover { border-color: var(--good); color: #b7d4ba; }
.buy-check:active { transform: scale(.92); }
.buy-check.on { background: var(--good); border-color: var(--good); color: #fff; }
tr.buy-on > td { background: #eef6ef; }
tr.buy-on:hover > td { background: #e2efe4; }
.buy-bcell { text-align: right; }
.buy-done { color: var(--good); font-weight: 600; white-space: nowrap; }
.buy-bcell small { display: block; font-size: 12px; color: var(--ink-soft); }
.buy-gh .good { color: var(--good); font-weight: 600; }
.buy-extra { border: 2px solid #b7d4ba; }
.buy-table th:nth-child(1) { width: 44px; }
.buy-table th:nth-child(2) { width: 30%; }
.buy-table th:nth-child(3) { width: 12%; }
.buy-table th:nth-child(4) { width: 8%; }
.buy-table th:nth-child(5) { width: 8%; }
.buy-table th:nth-child(6) { width: 9%; }
.buy-table th:nth-child(7) { width: 11%; }
.buy-table th:nth-child(8) { width: 8%; }
.buy-table th:nth-child(9) { width: 9%; }
.buy-table td:first-child { overflow: visible; }
.buy-table td:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
/* окно покупки */
.bf-modal { width: min(560px, 100%); }
.bf-info { font-size: 14px; margin: -4px 0 10px; }
.bf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bf-f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.bf-f input { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 18px; font-family: var(--mono); color: var(--ink); }
.bf-f:nth-child(4) input { font-family: inherit; font-size: 16px; }
.bf-sum { margin: 12px 0; font-size: 15px; }
.bf-sum b { font-family: var(--mono); }
.bf-sum .bad { color: var(--bad); }
.bf-btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.bf-save { min-width: 160px; min-height: 48px; font-size: 16px; font-weight: 700; }
/* в приходе */
.inc-buys { margin: 0 0 10px; padding: 12px 14px; border: 2px solid #b7d4ba; background: #f3f9f3; }
.inc-buys-h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 8px; }
.inc-buys-h .muted { font-size: 13px; }
.inc-buys-list { display: flex; flex-direction: column; gap: 6px; }
.inc-buys-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.inc-buys.on { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
@media (max-width: 760px) {
  .buy-table { min-width: 680px; }
  .bf-grid { grid-template-columns: 1fr; }
  .bf-btns .btn { flex: 1; }
  .buy-trip-s { width: 100%; justify-content: space-between; }
}
.buy-mstock { display: none; }
@media (max-width: 760px) {
  .buy .an-tw { overflow: visible; }
  .buy-table { min-width: 0 !important; table-layout: auto; }
  .buy-table, .buy-table tbody { display: block; }
  .buy-table tr:first-child { display: none; }
  .buy-table tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 6px; align-items: center; border-bottom: 1px solid var(--line); padding: 4px 0; }
  .buy-table td { border: 0 !important; padding: 2px 2px !important; }
  .buy-table td:nth-child(1) { grid-row: 1 / span 2; }
  .buy-table td:nth-child(2) { grid-column: 2; grid-row: 1; white-space: normal; }
  .buy-table td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .buy-table td:nth-child(4), .buy-table td:nth-child(5), .buy-table td:nth-child(6), .buy-table td:nth-child(8) { display: none; }
  .buy-table td:nth-child(7) { grid-column: 3; grid-row: 1; text-align: right; }
  .buy-table td:nth-child(9) { grid-column: 3; grid-row: 2; text-align: right; color: var(--ink-soft); font-size: 13px; }
  .buy-table td.buy-bcell { grid-row: 1 / span 2; }
  .buy-mstock { display: inline; }
  .buy-check { width: 38px; height: 38px; }
}
@media (max-width: 760px) {
  .buy-table tr { grid-template-columns: 44px minmax(0, 1fr) minmax(0, max-content); }
  .buy-table tr.buy-on { background: #eef6ef; border-radius: 10px; }
  .buy-table tr.buy-on > td { background: transparent; }
  .buy-table td.buy-bcell { max-width: 150px; }
  .buy-done { white-space: normal; display: block; line-height: 1.25; }
}
@media (max-width: 760px) { .buy-table tr.tapcard:hover > td { background: transparent; } }
.numin.need { border-color: var(--warn); background: #fff4e0; }
/* Список закупок на телефоне: с ним ходят за товаром */
.buy-bottom { display: none; }
@media (max-width: 760px) {
  .buy { padding-bottom: 76px; gap: 8px; }
  .buy .an-kpis { display: none; }
  .buy-trip { padding: 10px; border-width: 1.5px; gap: 8px; }
  .buy-trip-f { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1 1 100%; }
  .buy-trip-f label { font-size: 12px; }
  .buy-trip-f select, .buy-trip-f input { padding: 10px; font-size: 15px; min-width: 0; }
  .buy-trip-s { display: none; }
  .buy-ctl { padding: 10px; gap: 8px; position: sticky; top: 0; z-index: 4; box-shadow: 0 4px 10px rgba(0,0,0,.06); }
  .buy-ctl-row { gap: 6px; }
  .buy-ctl-row > .muted { display: none; }
  .buy-seg { order: 2; }
  .buy-q { order: 1; padding: 10px 12px; font-size: 16px; }
  .buy-ctl .chips { flex-wrap: nowrap !important; overflow-x: auto; justify-content: flex-start !important; scrollbar-width: none; padding-bottom: 2px; }
  .buy-ctl .chips::-webkit-scrollbar { display: none; }
  .buy-ctl .chip { flex: 0 0 auto; padding: 7px 12px; }
  .buy-group { padding: 8px 10px; }
  .buy-gh { flex-wrap: nowrap; margin-bottom: 2px; }
  .buy-gh > div:first-child { min-width: 0; font-size: 14px; }
  .buy-gh b { font-size: 16px; }
  .buy-gb { width: auto; }
  .buy-gb .btn { flex: 0 0 auto; padding: 6px 10px; }
  .buy-table td:nth-child(2) { font-size: 15.5px; font-weight: 500; line-height: 1.25; }
  .buy-table td:nth-child(2) .meta { font-weight: 400; }
  .buy-table td:nth-child(7) b { font-size: 17px; }
  .buy-check { width: 40px; height: 40px; }
  .buy-bottom { display: flex; position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 15; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #1f1a14; color: #f6edd9; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
  .buy-bottom > div { display: flex; flex-direction: column; min-width: 0; }
  .buy-bottom small { font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .buy-bottom .btn { min-height: 44px; font-weight: 700; white-space: nowrap; }
}
@media (max-width: 760px) {
  .buy-ctl { top: -12px; border-radius: 0 0 16px 16px; margin: 0 -12px; padding: 10px 12px; }
  .buy-seg button { padding: 5px 6px; font-size: 14px; }
  .buy-copyt { display: none; }
  .buy-gh .btn { min-height: 34px; width: 38px; padding: 0; }
}
/* список закупок: упрощённые строки (название · остаток · сколько купить) */
.buy-table th:nth-child(n) { width: auto; }
.buy-table th:nth-child(1) { width: 48px; }
.buy-table th:nth-child(3) { width: 16%; }
.buy-table th:nth-child(4) { width: 12%; }
.buy-table th:nth-child(5) { width: 12%; }
.buy-name { display: block; font-size: 15.5px; }
.buy-stock { display: block; font-size: 12px; color: var(--ink-soft); }
.buy-stock.bad { color: var(--bad); }
@media (max-width: 760px) {
  .buy-table tr { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .buy-table td:nth-child(1) { grid-row: auto; }
  .buy-table td:nth-child(2) { grid-column: 2; grid-row: 1; }
  .buy-table td:nth-child(3) { grid-column: 3; grid-row: 1; text-align: right; display: block; }
  .buy-table td:nth-child(4), .buy-table td:nth-child(5) { display: none !important; }
  .buy-table td:nth-child(n+6) { display: none; }
  .buy-table td.buy-bcell { grid-row: 1; display: block !important; }
  .buy-table td:nth-child(3) b { font-size: 18px; }
  .buy-name { font-size: 16px; font-weight: 500; }
}
/* список закупок: новые товары и «добавлено вручную» */
.bf-wide { grid-column: 1 / -1; }
.bf-f select { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 16px; color: var(--ink); }
.bf-grid .bf-f input#bnname, .bf-grid .bf-f input#bnsup, .bf-grid .bf-f input#bnbar { font-family: inherit; font-size: 16px; }
.bf-grid .bf-f input::placeholder { font-family: inherit; font-size: 13px; }
.buy-newbtn { white-space: nowrap; font-weight: 600; border-color: var(--good); color: var(--good); }
.buy-none { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 16px; }
.buy-none-b { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.buy-wants { border-color: #d9b56a; }
.buy-wdel { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.buy-wdel:hover { color: var(--bad); border-color: var(--bad); }
.buy-wnew .buy-check { border-style: dashed; }
.k-want { padding: 6px 8px; min-width: 36px; opacity: .45; filter: grayscale(1); }
.k-want:hover { opacity: .8; }
.k-want.on { opacity: 1; filter: none; background: #f4e2b8; border-color: #d9b56a; }
.k-wanttext { margin-top: 8px; width: 100%; }
@media (max-width: 760px) {
  .buy-q { flex: 1 1 0; min-width: 0; }
  .buy-newbtn { order: 1; flex: 0 0 auto; padding: 8px 10px; }
  .buy-seg { order: 3; }
  .buy-wants .buy-table tr { grid-template-columns: 48px minmax(0, 1fr) auto 36px; }
  .buy-wants .buy-table td:nth-child(5) { display: block !important; grid-column: 4; grid-row: 1; }
  .buy-none-b .btn { flex: 1 1 100%; }
}
.bf-grid.bf-new .bf-f input { font-family: inherit; font-size: 16px; }
.bf-grid.bf-new .bf-f input::placeholder { font-size: 13px; letter-spacing: 0; }
@media (max-width: 760px) {
  .bf-grid.bf-new { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .bf-grid.bf-new .bf-f input, .bf-grid.bf-new .bf-f select { padding: 10px 12px; }
  .buy-wants tr.tapcard > td:last-child::after { display: none; }
}
.bf-grid.bf-new .bf-f { min-width: 0; }
.bf-grid.bf-new .bf-f input, .bf-grid.bf-new .bf-f select { width: 100%; min-width: 0; box-sizing: border-box; }
.mb-warn { font-size: 12px; color: var(--warn, #a15c12); margin-top: 4px; }
.exp-split { margin: 8px 0 12px; }
.exp-split summary { cursor: pointer; color: var(--accent); font-weight: 600; }
/* журнал кошелька */
.mb-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.wl { max-width: 820px; margin: 0 auto; }
.wl-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px; }
.wl-sum > div { display: flex; flex-direction: column; gap: 2px; text-align: center; }
.wl-sum span { font-size: 12px; color: var(--ink-soft); }
.wl-sum b { font-family: var(--mono); font-size: 16px; }
.wl-sum .good b { color: var(--good); } .wl-sum .bad b { color: var(--bad); }
.wl-chips { justify-content: center; margin: 10px 0; }
.wl-list { padding: 4px 12px; }
.wl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.wl-row:last-child { border-bottom: 0; }
.wl-main { display: flex; flex-direction: column; min-width: 0; }
.wl-main span { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.wl-main small { font-size: 12px; color: var(--ink-soft); }
.wl-amt { font-family: var(--mono); font-weight: 700; white-space: nowrap; text-align: right; }
.wl-amt.good { color: var(--good); } .wl-amt.bad { color: var(--bad); }
.wl-bal { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); white-space: nowrap; min-width: 110px; text-align: right; }
@media (max-width: 760px) {
  .wl-sum { grid-template-columns: 1fr 1fr; }
  .wl-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .wl-main { grid-row: span 2; }
  .wl-bal { min-width: 0; font-size: 12px; }
  .wl-chips { flex-wrap: nowrap !important; overflow-x: auto; justify-content: flex-start !important; }
  .wl-chips .chip { flex: 0 0 auto; }
}
/* монеты */
.coin-modal { max-width: 520px; }
.coin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 12px; }
.coin-c { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.coin-c span { font-size: 13px; color: var(--ink-soft); }
.coin-c b { font-family: var(--mono); font-size: 15px; }
.coin-c small { font-size: 12px; color: var(--ink-soft); }
.coin-c.tot { background: #f4e2b8; border-color: #d9b56a; }
.coin-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coin-acts .btn { min-height: 46px; }
.coin-in { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.coin-in label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft); }
.coin-in input { padding: 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 18px; font-family: var(--mono); min-width: 0; width: 100%; box-sizing: border-box; }
.coin-hint { font-size: 13px; margin: 8px 0; }
.coin-log { margin-top: 8px; border-top: 1px solid var(--line); }
.coin-log > div { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.coin-log small { grid-column: 1 / -1; color: var(--ink-soft); }
.coin-log b { font-family: var(--mono); }
.mb-coins { display: inline-block; margin-top: 4px; background: #f4e2b8; border: 1px solid #d9b56a; border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; color: var(--ink); }
@media (max-width: 760px) { .coin-grid { grid-template-columns: 1fr 1fr; } }
/* окно оплаты по Enter */
.pd-modal { max-width: 460px; }
.pd-total { font-family: var(--mono); }
.pd-f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-soft); margin: 6px 0 10px; }
.pd-f input { padding: 14px 16px; font-size: 30px; font-family: var(--mono); border-radius: 14px; border: 2px solid var(--accent); text-align: right; width: 100%; box-sizing: border-box; }
.pd-m { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pd-m .btn.on { background: #1f1a14; color: #f6edd9; border-color: #1f1a14; }
.pd-info { min-height: 64px; margin: 12px 0; text-align: center; }
.pd-big { font-size: 24px; font-weight: 700; font-family: var(--mono); }
.pd-big.good { color: var(--good); } .pd-big.bad { color: var(--bad); }
.pd-coins { margin-top: 4px; font-size: 16px; }
.pd-go { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pd-go .btn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 58px; }
.pd-go .btn b { font-family: var(--mono); font-size: 18px; }
.pd-go .btn { font-weight: 600; font-size: 15px; }
.pd-go .btn small { font-family: var(--mono); font-size: 12px; opacity: .7; font-weight: 400; }
.amort-box { max-width: 560px; margin: 10px auto 0; padding: 10px 16px; }
.amort-box > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.amort-box > div:last-child { border-bottom: 0; }
.amort-box b { font-family: var(--mono); }
.amort-box .tot b { font-size: 17px; }
/* амортизация */
.am { max-width: 820px; margin: 0 auto; }
.am-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; text-align: center; }
.am-sum > div { display: flex; flex-direction: column; gap: 2px; }
.am-sum span { font-size: 12px; color: var(--ink-soft); }
.am-sum b { font-family: var(--mono); font-size: 17px; }
.am-table td:first-child { white-space: nowrap; }
@media (max-width: 760px) { .am-sum { grid-template-columns: 1fr; } }
.share-months { justify-content: center; margin-bottom: 10px; }
.share-tbl { max-width: 900px; margin: 12px auto 0; }
@media (max-width: 760px) { .share-months { flex-wrap: nowrap !important; overflow-x: auto; justify-content: flex-start !important; } .share-months .chip { flex: 0 0 auto; } }
.am-hist { max-width: 420px; margin: 12px auto 0; padding: 10px 16px; }
.am-hist > div { display: flex; justify-content: space-between; padding: 5px 0; border-top: 1px solid var(--line); }
.am-hist > b { display: block; margin-bottom: 4px; }
.am-hist { width: 100%; box-sizing: border-box; }
.am-hist > div { gap: 16px; }
/* демо */
.demo-login { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: #f4e2b8; border: 1px solid #d9b56a; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.demo-login code { font-family: var(--mono); font-size: 16px; font-weight: 700; }
.demo-login small { color: var(--ink-soft); }
.demo-tag { display: inline-block; vertical-align: middle; margin-left: 6px; font-size: 11px; font-weight: 700; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px; background: #f4e2b8; color: #7a4a0c; border: 1px solid #d9b56a; }
/* список купленного */
.bl-modal { max-width: 560px; }
.bl-group { border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; margin-top: 10px; background: #fff; }
.bl-gh { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.bl-gh > div { display: flex; flex-direction: column; min-width: 0; }
.bl-gh small { color: var(--ink-soft); font-size: 12px; }
.bl-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.bl-row:last-child { border-bottom: 0; }
.bl-name { display: flex; flex-direction: column; min-width: 0; font-size: 15px; }
.bl-name small { color: var(--ink-soft); font-size: 12px; }
.bl-row.tapcard::after { display: none; }
.bb-open { font-size: 12px; font-weight: 500; opacity: .8; margin-left: 6px; text-decoration: underline; }
.buy-bottom-l { cursor: pointer; }
.buy-trip-open { cursor: pointer; }
.bl-row:focus, .bl-row:hover { outline: none; background: #faf6ee; }
/* быстрый выбор поставщика */
.sup-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; margin-top: -2px; }
.sup-chips .chip { padding: 6px 12px; font-size: 14px; }
.sup-chips .chip.on { background: #1f1a14; color: #f6edd9; border-color: #1f1a14; }
/* наши долги поставщику */
.sp { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.sp-head { text-align: center; padding: 16px; }
.sp-name { font-size: 18px; font-weight: 700; }
.sp-debt { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--bad); margin: 4px 0; }
.sp-pay { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.sp-l { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.sp-amt { display: flex; align-items: center; gap: 8px; }
.sp-amt input { flex: 1; min-width: 0; padding: 12px 14px; font-size: 26px; font-family: var(--mono); border: 2px solid var(--accent); border-radius: 14px; text-align: right; }
.sp-amt span { font-size: 18px; color: var(--ink-soft); }
.sp-quick { justify-content: flex-start; }
.sp-src { width: 100%; }
.sp-src button { flex: 1; }
.sp-src button:disabled { opacity: .4; }
.sp-hint { font-size: 13px; margin: 0; }
.sp-go { min-height: 52px; font-size: 17px; }
.sp-go b { font-family: var(--mono); margin-left: 6px; }
.sp-ok { text-align: center; color: var(--good); font-weight: 600; padding: 14px; }
.sp-docs { padding: 12px 16px; }
.sp-doc { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.sp-doc > div { display: flex; flex-direction: column; min-width: 0; }
.sp-doc small { color: var(--ink-soft); font-size: 12px; }
.sp-doc > b { font-family: var(--mono); white-space: nowrap; }
.sp-wipe { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 4px; }
.danger-text { color: var(--bad); border-color: transparent; background: transparent; }
.sp-list { max-width: 640px; margin: 0 auto; padding: 4px 14px; }
.sp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.sp-row:last-child { border-bottom: 0; }
.sp-row > div { display: flex; flex-direction: column; min-width: 0; }
.sp-row small { color: var(--ink-soft); font-size: 12px; }
.sp-row > b { font-family: var(--mono); }
.sp-row > i { color: var(--accent); font-style: normal; font-size: 20px; font-weight: 700; }
.sp-row.tapcard::after { display: none; }
.main.centered .sp, .main.centered .sp-list { max-width: 600px !important; width: 100%; margin-left: auto !important; margin-right: auto !important; }
.sp-row:focus, .sp-row:hover { outline: none; background: #faf6ee; }
.rc-seg{grid-template-columns:1fr 1fr!important;margin:4px 0 12px}
.rt-settle{margin-top:10px;padding:12px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:6px}
.rt-total{display:flex;justify-content:space-between;align-items:baseline;font-size:18px}
.rt-total b{font-family:var(--mono);font-size:22px}
.rt-res{margin:4px 0 0;font-weight:600;color:var(--good,#2d6a4f)}
.rt-hist{margin-top:12px}
.rt-hist .sp-doc{gap:10px}
.rt-hist .sp-doc small{display:block}
.rt-hist .sp-doc>div{flex:1;min-width:0}
.rt-manual{padding:8px 12px 0}
