:root {
  --bg: #f5f7f3;
  --surface: #ffffff;
  --line: #d9dfd4;
  --text: #1e2822;
  --muted: #647069;
  --accent: #1d6f5f;
  --accent-strong: #11483f;
  --warn: #b75d2a;
  --danger: #a93535;
  --shadow: 0 12px 30px rgba(29, 42, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(16px, 4vw, 44px);
  background: #26352f;
  color: #fff;
}

.eyebrow {
  margin: 0 0 4px;
  color: #b7cec4;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
}

.header-actions,
.toolbar,
.tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

main {
  width: min(1220px, calc(100% - 32px));
  margin: 22px auto 44px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.metric.warning strong {
  color: var(--warn);
}

.tabs {
  margin: 18px 0;
}

.tab,
button,
.import-label {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
}

.tab {
  background: #fff;
  color: var(--accent-strong);
  border-color: var(--line);
}

.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.secondary {
  background: #fff;
  color: var(--accent-strong);
  border-color: #b8c7c0;
}

.import-label input {
  display: none;
}

.panel {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel.active {
  display: block;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-header h2,
.form-shell h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.form-shell {
  border: 1px solid #c8d4cd;
  border-radius: 8px;
  background: #f8faf8;
  margin-bottom: 18px;
  padding: 16px;
}

.form-shell.editing {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 111, 95, 0.12);
}

.form-shell h3 {
  margin-bottom: 14px;
  color: var(--accent-strong);
}

.toolbar {
  margin-bottom: 14px;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #bdc8c1;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 10px;
}

input[type="file"] {
  padding: 8px;
}

.toolbar input {
  max-width: 360px;
}

.toolbar select {
  max-width: 220px;
}

.history-toolbar label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.history-toolbar input[type="date"] {
  max-width: 160px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.wide {
  grid-column: span 2;
}

.hidden {
  display: none;
}

.status-line {
  margin: 12px 0 0;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  background: #fff;
  table-layout: fixed;
}

th,
td {
  padding: 10px 12px;
  border: 1px solid #7d8781;
  text-align: center;
  vertical-align: middle;
}

.brand-cell {
  width: 150px;
  font-weight: 700;
  background: #fbfcfb;
}

#stock .brand-cell {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  font-size: 18px;
  letter-spacing: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

#stock table {
  min-width: 1160px;
}

#stock th:nth-child(1),
#stock td:nth-child(1) {
  width: 52px;
}

#stock th:nth-child(2),
#stock td:nth-child(2) {
  width: 340px;
}

#stock th:nth-child(3),
#stock td:nth-child(3) {
  width: 130px;
}

#stock th:nth-child(4),
#stock td:nth-child(4) {
  width: 150px;
}

#stock th:nth-child(5),
#stock td:nth-child(5) {
  width: 95px;
}

#stock th:nth-child(6),
#stock td:nth-child(6) {
  width: 140px;
  padding-left: 3mm;
  padding-right: 3mm;
}

#stock th:nth-child(7),
#stock td:nth-child(7) {
  width: 210px;
}

#stock td {
  height: 96px;
}

.group-start td {
  border-top: 4px solid #26352f;
}

#history .movement-receive td {
  background: #e6f6e9;
}

#history .movement-deliver td {
  background: #fde7e7;
}

#history .movement-defective td {
  background: #f8d7da;
}

#history .movement-adjust td {
  background: #fff4cf;
}

.highlight-row td {
  background: #fff6d7;
  transition: background 0.25s ease;
}

th {
  background: #f3f5f4;
  color: #222b26;
  font-size: 13px;
  font-weight: 700;
}

.num {
  text-align: right;
}

.row-actions {
  display: inline-flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

.action-cell {
  padding: 6px;
}

#stock .action-cell {
  padding: 6px 8px;
}

#stock .stock-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(74px, 1fr));
  gap: 6px;
  width: 100%;
}

.action-defective {
  background: #c62828;
  border-color: #c62828;
  color: #fff;
}

.small {
  min-height: 32px;
  padding: 5px 7px;
  font-size: 12px;
  white-space: nowrap;
  width: 100%;
}

.action-receive {
  border-color: #8fca9a;
  background: #e6f6e9;
  color: #1d5d2b;
}

.action-deliver {
  border-color: #e0a0a0;
  background: #fde7e7;
  color: #8a2424;
}

.action-adjust {
  border-color: #dec46a;
  background: #fff4cf;
  color: #765800;
}

.action-transfer {
  border-color: #b8c7c0;
  background: #eef3f0;
  color: var(--accent-strong);
}

.danger {
  border-color: var(--danger);
  background: var(--danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #e5efe9;
  color: var(--accent-strong);
  font-size: 12px;
}

.badge.low {
  background: #ffe6d5;
  color: #8f3e16;
}

.product-thumb {
  width: 132px;
  height: 76px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f0f3f1;
  object-fit: contain;
}

.thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 76px;
  border: 1px dashed #b9c5bf;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
}

.muted {
  color: var(--muted);
}

.print-summary {
  display: none;
}


.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(244, 247, 245, 0.96);
}

.auth-gate.hidden {
  display: none;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(23, 38, 31, 0.16);
}

.auth-card h2 {
  margin: 0 0 4px;
}

.auth-card p {
  margin: 0;
}

.app-main.locked,
body.auth-locked .app-header {
  filter: blur(2px);
  pointer-events: none;
  user-select: none;
}

.order-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.order-table {
  min-width: 860px;
}

.order-print-date-row,
.order-print-footer-row {
  display: none;
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.location {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 120px;
  background: #fbfcfb;
}

.location h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.location ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

#toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(680px, calc(100% - 36px));
  border-radius: 8px;
  background: #1f2d27;
  color: #fff;
  padding: 22px 26px;
  box-shadow: var(--shadow);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s ease;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 8mm 10mm;
  }

  * {
    box-shadow: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 14px;
  }

  .app-header,
  .summary-grid,
  .tabs,
  .toolbar,
  #receive,
  #deliver,
  #transfer,
  #adjust,
  #order,
  #products,
  #locations,
  #history,
  #settings,
  #toast {
    display: none !important;
  }

  main {
    width: 100%;
    margin: 0;
  }

  #stock {
    display: block !important;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .table-wrap {
    border: 0;
    overflow: visible;
  }

  table {
    min-width: 0;
    table-layout: fixed;
    font-size: 16px;
    line-height: 1.2;
  }

  #stock table {
    min-width: 0;
  }

  th,
  td {
    padding: 3px 4px;
    border-color: #333;
  }

  #stock .brand-cell {
    width: 10mm;
    min-width: 10mm;
    max-width: 10mm;
    font-size: 16px;
  }

  #stock td {
    height: auto;
  }

  #stock .row-actions {
    min-width: 0;
  }

  #stock th:nth-child(2),
  #stock td:nth-child(2) {
    width: 46mm;
  }

  #stock th:nth-child(3),
  #stock td:nth-child(3) {
    width: 20mm;
  }

  #stock th:nth-child(4),
  #stock td:nth-child(4) {
    width: 24mm;
  }

  #stock th:nth-child(5),
  #stock td:nth-child(5) {
    width: 14mm;
  }

  #stock th:nth-child(6),
  #stock td:nth-child(6) {
    width: 30mm;
    padding-left: 3mm;
    padding-right: 3mm;
  }

  .product-thumb,
  .thumb-empty {
    width: 24mm;
    height: 15mm;
    border-radius: 0;
    font-size: 10px;
  }

  .badge {
    display: inline;
    min-height: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    color: #000;
    font-size: 14px;
  }

  #stock th:last-child,
  #stock td:last-child {
    display: none;
  }

  .print-summary {
    display: block;
    margin: 4mm 0 0;
    font-size: 15px;
    color: #000;
    text-align: left;
  }

  body.printing-history .app-header,
  body.printing-history .summary-grid,
  body.printing-history .tabs,
  body.printing-history .toolbar,
  body.printing-history #stock,
  body.printing-history #receive,
  body.printing-history #deliver,
  body.printing-history #transfer,
  body.printing-history #adjust,
  body.printing-history #order,
  body.printing-history #products,
  body.printing-history #locations,
  body.printing-history #settings,
  body.printing-history #zumrut,
  body.printing-history #toast {
    display: none !important;
  }

  body.printing-history #history {
    display: block !important;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  body.printing-history #movementEditor,
  body.printing-history #history th:last-child,
  body.printing-history #history td:last-child {
    display: none !important;
  }

  body.printing-history #history table {
    min-width: 0;
    table-layout: fixed;
    font-size: 12px;
    line-height: 1.2;
  }

  body.printing-history #history th,
  body.printing-history #history td {
    padding: 4px 5px;
    border-color: #333;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.printing-history #history .movement-receive td {
    background: #e6f6e9 !important;
  }

  body.printing-history #history .movement-deliver td {
    background: #fde7e7 !important;
  }

  body.printing-history #history .movement-defective td {
    background: #f8d7da !important;
  }

  body.printing-history #history .movement-adjust td {
    background: #fff4cf !important;
  }

  body.printing-history #historyPrintSummary {
    display: block;
    margin: 0 0 5mm;
    font-size: 14px;
    font-weight: 700;
  }

  body.printing-order .app-header,
  body.printing-order .summary-grid,
  body.printing-order .tabs,
  body.printing-order .toolbar,
  body.printing-order #stock,
  body.printing-order #receive,
  body.printing-order #deliver,
  body.printing-order #transfer,
  body.printing-order #adjust,
  body.printing-order #products,
  body.printing-order #locations,
  body.printing-order #history,
  body.printing-order #settings,
  body.printing-order #zumrut,
  body.printing-order #toast {
    display: none !important;
  }

  body.printing-order #order {
    display: block !important;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  body.printing-order #order .panel-header,
  body.printing-order #order form,
  body.printing-order #order .order-actions,
  body.printing-order #order .order-action-column,
  body.printing-order #order .action-cell {
    display: none !important;
  }

  body.printing-order .table-wrap {
    border: 0;
    overflow: visible;
  }

  body.printing-order .order-table {
    break-inside: auto;
  }

  body.printing-order .order-table thead {
    display: table-header-group;
  }

  body.printing-order .order-print-date-row {
    display: table-row;
  }

  body.printing-order .order-print-date-row th {
    border: 0;
    padding: 0 0 6mm;
    text-align: right;
    font-size: 14px;
  }

  body.printing-order .order-print-footer-row {
    display: table-footer-group;
  }

  body.printing-order .order-print-footer-row td {
    border: 0;
    padding: 7mm 0 0;
  }

  body.printing-order .order-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.printing-order .order-table tbody tr:nth-child(11n) {
    break-after: page;
    page-break-after: always;
  }

  body.printing-order .order-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 18px;
    line-height: 1.2;
  }

  body.printing-order .order-table th,
  body.printing-order .order-table td {
    padding: 5px 7px;
    border-color: #333;
  }

  body.printing-order .order-table th:nth-child(1),
  body.printing-order .order-table td:nth-child(1) {
    width: 30mm;
  }

  body.printing-order .order-table th:nth-child(2),
  body.printing-order .order-table td:nth-child(2) {
    width: 92mm;
  }

  body.printing-order .order-table th:nth-child(3),
  body.printing-order .order-table td:nth-child(3) {
    width: 28mm;
  }

  body.printing-order .order-table th:nth-child(4),
  body.printing-order .order-table td:nth-child(4) {
    width: 30mm;
  }

  body.printing-order .order-table th:nth-child(5),
  body.printing-order .order-table td:nth-child(5) {
    width: 24mm;
    text-align: right;
  }

  body.printing-order .order-table .product-thumb,
  body.printing-order .order-table .thumb-empty {
    width: 26mm;
    height: 17mm;
  }

  body.printing-order #orderPrintNote {
    display: none;
  }

  body.printing-order .order-print-footer {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 8mm;
    align-items: end;
    color: #000;
    font-size: 13px;
  }

  body.printing-order .order-print-footer strong {
    text-align: center;
    font-size: 18px;
    line-height: 1.15;
  }
}

@media (max-width: 860px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-header {
    flex-direction: column;
  }

  .summary-grid,
  .form-grid,
  .location-grid {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }
}








.source-pill {
  align-self: flex-start;
  border: 1px solid #c9d5cf;
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  background: #f8faf8;
  font-size: 13px;
  white-space: nowrap;
}

.zumrut-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.zumrut-metric strong {
  font-size: 24px;
}

.zumrut-toolbar {
  align-items: center;
}

.zumrut-view-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.zumrut-view {
  background: #fff;
  color: var(--accent-strong);
  border-color: #b8c7c0;
}

.zumrut-view.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.zumrut-table-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.zumrut-table-header h3 {
  margin: 0;
  font-size: 20px;
}

.zumrut-table-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.zumrut-note {
  border: 1px solid #c8d4cd;
  border-radius: 8px;
  background: #f8faf8;
  color: var(--muted);
  padding: 14px;
}

.zumrut-table {
  min-width: 1050px;
}

.zumrut-table th,
.zumrut-table td {
  vertical-align: top;
}

.zumrut-total-row td {
  background: #f2f6f3;
  font-weight: 700;
}

@media (max-width: 820px) {
  .zumrut-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-pill {
    white-space: normal;
  }
}


.zumrut-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.accounting-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.accounting-card,
.accounting-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.accounting-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.accounting-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.accounting-card.money-in {
  border-color: #efb8b8;
  background: #fff1f1;
}

.accounting-card.money-in strong,
.money-in-text {
  color: #b12f2f;
}

.accounting-card.money-out {
  border-color: #b7dfc2;
  background: #eef9f0;
}

.accounting-card.money-out strong,
.money-out-text {
  color: #1f7a3a;
}

.accounting-card.money-waiting {
  border-color: #e5d59d;
  background: #fff9e6;
}

.accounting-card.money-balance-good {
  border-color: #b7d5df;
  background: #eef8fb;
}

.accounting-card.money-balance-bad {
  border-color: #efb8b8;
  background: #fff1f1;
}

.accounting-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 12px;
  margin-bottom: 16px;
}

.accounting-box h4,
.accounting-report h4 {
  margin: 0 0 10px;
  font-size: 18px;
}

.accounting-list {
  margin: 0;
}

.accounting-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid #e8eee9;
}

.accounting-list div:last-child {
  border-bottom: 0;
}

.accounting-list dt {
  color: var(--muted);
  font-weight: 700;
}

.accounting-list dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.accounting-status {
  margin: 0 0 8px;
  border-radius: 6px;
  padding: 10px;
  font-weight: 700;
}

.accounting-status.positive {
  background: #eef8fb;
  color: #19586b;
}

.accounting-status.negative {
  background: #fff1f1;
  color: #a93535;
}

.accounting-table {
  min-width: 900px;
}

.accounting-income td {
  background: #fff1f1;
}

.accounting-expense td {
  background: #eef9f0;
}

@media print {
  body.printing-accounting .app-header,
  body.printing-accounting .summary-grid,
  body.printing-accounting .tabs,
  body.printing-accounting #stock,
  body.printing-accounting #receive,
  body.printing-accounting #deliver,
  body.printing-accounting #transfer,
  body.printing-accounting #adjust,
  body.printing-accounting #order,
  body.printing-accounting #products,
  body.printing-accounting #locations,
  body.printing-accounting #history,
  body.printing-accounting #settings,
  body.printing-accounting #toast {
    display: none !important;
  }

  body.printing-accounting #zumrut {
    display: block !important;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  body.printing-accounting .zumrut-toolbar,
  body.printing-accounting .zumrut-view-buttons,
  body.printing-accounting #printAccountingBtn {
    display: none !important;
  }

  body.printing-accounting .accounting-card,
  body.printing-accounting .accounting-box,
  body.printing-accounting .accounting-income td,
  body.printing-accounting .accounting-expense td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.printing-accounting .accounting-dashboard {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body.printing-accounting .accounting-card strong {
    font-size: 18px;
  }

  body.printing-accounting .accounting-grid {
    grid-template-columns: 1fr 1fr;
  }

  body.printing-accounting .accounting-table {
    min-width: 0;
    font-size: 12px;
  }
}

@media (max-width: 900px) {
  .accounting-dashboard,
  .accounting-grid {
    grid-template-columns: 1fr;
  }
}


.zumrut-stock-table {
  min-width: 920px;
}

.zumrut-stock-table .brand-cell {
  width: 46px;
  min-width: 46px;
  max-width: 46px;
  font-size: 18px;
  letter-spacing: 0;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.zumrut-stock-table th:nth-child(1),
.zumrut-stock-table td:nth-child(1) {
  width: 52px;
}

.zumrut-stock-table th:nth-child(2),
.zumrut-stock-table td:nth-child(2) {
  width: 360px;
}

.zumrut-stock-table th:nth-child(3),
.zumrut-stock-table td:nth-child(3) {
  width: 125px;
}

.zumrut-stock-table th:nth-child(4),
.zumrut-stock-table td:nth-child(4) {
  width: 140px;
}

.zumrut-stock-table th:nth-child(5),
.zumrut-stock-table td:nth-child(5) {
  width: 115px;
}

.zumrut-stock-table th:nth-child(6),
.zumrut-stock-table td:nth-child(6) {
  width: 170px;
}

.zumrut-stock-table td {
  height: 96px;
}

.zumrut-stock-print-summary {
  display: none;
}

@media print {
  body.printing-zumrut-stock .app-header,
  body.printing-zumrut-stock .summary-grid,
  body.printing-zumrut-stock .tabs,
  body.printing-zumrut-stock #stock,
  body.printing-zumrut-stock #receive,
  body.printing-zumrut-stock #deliver,
  body.printing-zumrut-stock #transfer,
  body.printing-zumrut-stock #adjust,
  body.printing-zumrut-stock #order,
  body.printing-zumrut-stock #products,
  body.printing-zumrut-stock #locations,
  body.printing-zumrut-stock #history,
  body.printing-zumrut-stock #settings,
  body.printing-zumrut-stock #toast {
    display: none !important;
  }

  body.printing-zumrut-stock #zumrut {
    display: block !important;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  body.printing-zumrut-stock .zumrut-toolbar,
  body.printing-zumrut-stock .zumrut-view-buttons,
  body.printing-zumrut-stock .zumrut-stock-action-column,
  body.printing-zumrut-stock .zumrut-stock-editor,
  body.printing-zumrut-stock #printAccountingBtn,
  body.printing-zumrut-stock #printZumrutStockBtn {
    display: none !important;
  }

  body.printing-zumrut-stock .zumrut-stock-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 16px;
    line-height: 1.2;
  }

  body.printing-zumrut-stock .zumrut-stock-table th,
  body.printing-zumrut-stock .zumrut-stock-table td {
    padding: 3px 4px;
    border-color: #333;
  }

  body.printing-zumrut-stock .zumrut-stock-table .brand-cell {
    width: 18mm;
    min-width: 18mm;
    max-width: 18mm;
    font-size: 16px;
    writing-mode: horizontal-tb;
    transform: none;
    white-space: normal;
  }

  body.printing-zumrut-stock .zumrut-stock-table th:nth-child(2),
  body.printing-zumrut-stock .zumrut-stock-table td:nth-child(2) {
    width: 56mm;
  }

  body.printing-zumrut-stock .zumrut-stock-table th:nth-child(3),
  body.printing-zumrut-stock .zumrut-stock-table td:nth-child(3) {
    width: 26mm;
  }

  body.printing-zumrut-stock .zumrut-stock-table th:nth-child(4),
  body.printing-zumrut-stock .zumrut-stock-table td:nth-child(4) {
    width: 30mm;
  }

  body.printing-zumrut-stock .zumrut-stock-table th:nth-child(5),
  body.printing-zumrut-stock .zumrut-stock-table td:nth-child(5) {
    width: 25mm;
  }

  body.printing-zumrut-stock .product-thumb,
  body.printing-zumrut-stock .thumb-empty {
    width: 24mm;
    height: 15mm;
    border-radius: 0;
    font-size: 10px;
  }

  body.printing-zumrut-stock .zumrut-stock-print-summary {
    display: block;
    margin: 4mm 0 0;
    font-size: 15px;
    color: #000;
  }
}


.zumrut-stock-editor {
  margin-bottom: 14px;
}

.zumrut-stock-table .stock-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(82px, 1fr));
  gap: 6px;
  width: 100%;
}

.zumrut-stock-table .action-cell {
  padding: 6px 8px;
}


.zumrut-stock-wrap {
  max-width: 100%;
}


.zumrut-sales-entry {
  margin-bottom: 14px;
}

.zumrut-sales-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.zumrut-sales-form .wide {
  grid-column: span 2;
}

.zumrut-sales-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.zumrut-sales-actions button {
  width: 100%;
}

.zumrut-sales-table {
  min-width: 1580px;
}

.zumrut-sales-table th,
.zumrut-sales-table td {
  padding: 8px 9px;
  font-size: 12px;
}

.zumrut-sales-total td {
  background: #eef3f0;
  font-weight: 700;
}

@media (max-width: 980px) {
  .zumrut-sales-form {
    grid-template-columns: 1fr;
  }

  .zumrut-sales-form .wide {
    grid-column: auto;
  }
}


.zumrut-sale-no {
  width: auto;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font-weight: 700;
  text-decoration: underline;
}

.zumrut-sales-actions {
  gap: 8px;
}

.zumrut-audit-panel {
  margin-top: 16px;
  border: 1px solid #c8d4cd;
  border-radius: 8px;
  background: #f8faf8;
  padding: 14px;
}

.zumrut-audit-panel h3 {
  margin: 0 0 6px;
  color: var(--accent-strong);
}

.zumrut-audit-panel p {
  margin: 0 0 12px;
  color: var(--muted);
}

.zumrut-audit-table {
  min-width: 1120px;
}

.zumrut-audit-table th,
.zumrut-audit-table td {
  font-size: 12px;
  padding: 7px 8px;
  vertical-align: top;
}


.zumrut-purchase-entry {
  margin-bottom: 14px;
}

.zumrut-purchase-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.zumrut-purchase-form .wide {
  grid-column: span 2;
}

.zumrut-purchase-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.zumrut-purchase-actions button {
  width: 100%;
}

.zumrut-purchase-table {
  min-width: 1280px;
}

.zumrut-purchase-table th,
.zumrut-purchase-table td {
  padding: 8px 9px;
  font-size: 12px;
}

.zumrut-purchase-total td {
  background: #eef3f0;
  font-weight: 700;
}

@media (max-width: 980px) {
  .zumrut-purchase-form {
    grid-template-columns: 1fr;
  }

  .zumrut-purchase-form .wide {
    grid-column: auto;
  }
}


.zumrut-expense-entry {
  margin-bottom: 14px;
}

.zumrut-expense-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.zumrut-expense-form .wide {
  grid-column: span 2;
}

.zumrut-employee-expense-field {
  display: none;
}

.zumrut-expense-form.employee-expense-active .zumrut-employee-expense-field {
  display: grid;
}

.zumrut-expense-form input[readonly] {
  background: #eef3f0;
  font-weight: 800;
}

.zumrut-expense-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 8px;
}

.zumrut-expense-actions button {
  width: 100%;
}

.zumrut-expense-table {
  min-width: 1220px;
}

.zumrut-expense-table th,
.zumrut-expense-table td {
  padding: 8px 9px;
  font-size: 12px;
}

.zumrut-expense-total td {
  background: #eef3f0;
  font-weight: 700;
}

@media (max-width: 980px) {
  .zumrut-expense-form {
    grid-template-columns: 1fr;
  }

  .zumrut-expense-form .wide {
    grid-column: auto;
  }
}


.zumrut-movement-filter {
  margin-bottom: 14px;
}

.zumrut-movement-range {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.zumrut-movement-actions {
  display: flex;
  align-items: end;
}

.zumrut-movement-actions button {
  width: 100%;
}

.zumrut-all-movement-table {
  min-width: 1180px;
}

.zumrut-all-movement-table th,
.zumrut-all-movement-table td {
  padding: 8px 9px;
  font-size: 12px;
  vertical-align: top;
}

.zumrut-move-danger td {
  background: #fde7e7;
}

.zumrut-move-positive td {
  background: #e6f6e9;
}

.zumrut-move-income td {
  background: #fff1f1;
}

.zumrut-move-expense td {
  background: #eef9f0;
}

.zumrut-move-edit td {
  background: #fff4cf;
}

.zumrut-move-neutral td {
  background: #eef3f0;
}

.zumrut-movement-print-summary {
  display: none;
}

@media print {
  body.printing-zumrut-movements .app-header,
  body.printing-zumrut-movements .summary-grid,
  body.printing-zumrut-movements .tabs,
  body.printing-zumrut-movements #stock,
  body.printing-zumrut-movements #receive,
  body.printing-zumrut-movements #deliver,
  body.printing-zumrut-movements #transfer,
  body.printing-zumrut-movements #adjust,
  body.printing-zumrut-movements #order,
  body.printing-zumrut-movements #products,
  body.printing-zumrut-movements #locations,
  body.printing-zumrut-movements #history,
  body.printing-zumrut-movements #settings,
  body.printing-zumrut-movements #toast {
    display: none !important;
  }

  body.printing-zumrut-movements #zumrut {
    display: block !important;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  body.printing-zumrut-movements .zumrut-toolbar,
  body.printing-zumrut-movements .zumrut-view-buttons,
  body.printing-zumrut-movements .zumrut-movement-filter,
  body.printing-zumrut-movements #printAccountingBtn,
  body.printing-zumrut-movements #printZumrutStockBtn {
    display: none !important;
  }

  body.printing-zumrut-movements .zumrut-all-movement-table {
    min-width: 0;
    table-layout: fixed;
    font-size: 11px;
  }

  body.printing-zumrut-movements .zumrut-all-movement-table th,
  body.printing-zumrut-movements .zumrut-all-movement-table td,
  body.printing-zumrut-movements .zumrut-move-danger td,
  body.printing-zumrut-movements .zumrut-move-positive td,
  body.printing-zumrut-movements .zumrut-move-income td,
  body.printing-zumrut-movements .zumrut-move-expense td,
  body.printing-zumrut-movements .zumrut-move-edit td,
  body.printing-zumrut-movements .zumrut-move-neutral td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.printing-zumrut-movements .zumrut-movement-print-summary {
    display: block;
    margin: 4mm 0 0;
    font-size: 13px;
    color: #000;
  }
}

@media (max-width: 980px) {
  .zumrut-movement-range {
    grid-template-columns: 1fr;
  }
}


.zumrut-analysis-filter {
  margin-bottom: 14px;
}

.zumrut-analysis-range {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.zumrut-analysis-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: end;
}

.zumrut-analysis-grid {
  display: grid;
  gap: 16px;
}

.zumrut-pie-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.zumrut-pie-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.zumrut-pie-head h4 {
  margin: 0;
  font-size: 20px;
}

.zumrut-pie-head strong {
  color: var(--accent-strong);
}

.zumrut-pie-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: center;
}

.zumrut-pie {
  width: 240px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid #c8d4cd;
}

.zumrut-pie span {
  display: grid;
  place-items: center;
  width: 92px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  color: var(--accent-strong);
  font-weight: 700;
  font-size: 18px;
}

.zumrut-pie-legend {
  display: grid;
  gap: 8px;
}

.zumrut-pie-legend div {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #edf1ee;
  padding-bottom: 7px;
}

.zumrut-pie-legend i {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.zumrut-pie-legend strong {
  text-align: right;
}

.zumrut-pie-comment {
  margin: 14px 0 0;
  border-top: 1px solid #edf1ee;
  padding-top: 12px;
  color: var(--muted);
  font-weight: 700;
}

.zumrut-analysis-details {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border-top: 1px solid #edf1ee;
  padding-top: 12px;
}

.zumrut-analysis-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  overflow: hidden;
}

.zumrut-analysis-detail summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
}

.zumrut-analysis-detail summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.zumrut-analysis-detail summary i {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.zumrut-analysis-detail .table-wrap {
  border-width: 1px 0 0;
  border-radius: 0;
}

.zumrut-analysis-detail table {
  min-width: 0;
  table-layout: fixed;
}

.zumrut-analysis-detail th,
.zumrut-analysis-detail td {
  padding: 8px 9px;
}

.zumrut-analysis-detail th:nth-child(1),
.zumrut-analysis-detail td:nth-child(1) {
  width: 110px;
}

.zumrut-analysis-detail th:nth-child(4),
.zumrut-analysis-detail td:nth-child(4) {
  width: 130px;
}

.zumrut-analysis-print-heading,
.zumrut-analysis-print-summary {
  display: none;
}

@media print {
  body.printing-zumrut-analysis .app-header,
  body.printing-zumrut-analysis .summary-grid,
  body.printing-zumrut-analysis .tabs,
  body.printing-zumrut-analysis #stock,
  body.printing-zumrut-analysis #receive,
  body.printing-zumrut-analysis #deliver,
  body.printing-zumrut-analysis #transfer,
  body.printing-zumrut-analysis #adjust,
  body.printing-zumrut-analysis #order,
  body.printing-zumrut-analysis #products,
  body.printing-zumrut-analysis #locations,
  body.printing-zumrut-analysis #history,
  body.printing-zumrut-analysis #settings,
  body.printing-zumrut-analysis #toast {
    display: none !important;
  }

  body.printing-zumrut-analysis #zumrut {
    display: block !important;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  body.printing-zumrut-analysis .zumrut-toolbar,
  body.printing-zumrut-analysis .zumrut-view-buttons,
  body.printing-zumrut-analysis .zumrut-analysis-filter,
  body.printing-zumrut-analysis #printAccountingBtn,
  body.printing-zumrut-analysis #printZumrutStockBtn {
    display: none !important;
  }

  body.printing-zumrut-analysis .zumrut-pie-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.printing-zumrut-analysis .zumrut-pie,
  body.printing-zumrut-analysis .zumrut-pie-legend i,
  body.printing-zumrut-analysis .zumrut-analysis-detail summary i {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body.printing-zumrut-analysis .zumrut-analysis-detail {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body.printing-zumrut-analysis .zumrut-analysis-detail summary {
    cursor: default;
  }

  body.printing-zumrut-analysis .zumrut-analysis-print-heading {
    display: block;
    margin: 0 0 5mm;
    font-size: 19px;
    font-weight: 900;
    color: #000;
    text-align: left;
  }

  body.printing-zumrut-analysis .zumrut-analysis-print-summary {
    display: block;
    margin: 4mm 0 0;
    font-size: 13px;
    color: #000;
  }
}

@media (max-width: 860px) {
  .zumrut-analysis-range,
  .zumrut-pie-layout {
    grid-template-columns: 1fr;
  }

  .zumrut-analysis-actions {
    grid-template-columns: 1fr;
  }

  .zumrut-pie {
    width: min(240px, 100%);
  }
}


.depot-subtabs {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

body.depot-context .depot-subtabs {
  display: flex;
}

.depot-subtab {
  background: #fff;
  color: var(--accent-strong);
  border-color: #b8c7c0;
}

.depot-subtab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.depot-stock-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}
