:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #657181;
  --line: #dce2ea;
  --primary: #1f6feb;
  --primary-dark: #1557bd;
  --brand-burgundy: #6b0008;
  --brand-burgundy-hover: #4a0005;
  --brand-burgundy-active: #330003;
  --danger: #c93535;
  --danger-bg: #fff0f0;
  --ok: #157347;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  padding: 10px 14px;
}

button:hover {
  border-color: #b8c2d0;
}

button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.danger {
  border-color: #f0b5b5;
  background: var(--danger-bg);
  color: var(--danger);
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 22px;
}

.brand {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
  text-align: center;
}

.brand img {
  justify-self: center;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-subtitle,
.muted {
  color: var(--muted);
  font-size: 14px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a {
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  text-decoration: none;
}

.nav a.active {
  background: #eef4ff;
  color: var(--primary);
  font-weight: 650;
}

.sidebar-action {
  margin-top: 10px;
  width: 100%;
}

.admin-user {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
}

.admin-user button {
  width: 100%;
}

.login-screen {
  align-items: center;
  background: var(--bg);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 30;
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  max-width: 380px;
  padding: 24px;
  width: 100%;
}

.login-panel img {
  justify-self: center;
  width: 100%;
}

.login-panel h1 {
  font-size: 22px;
  text-align: center;
}

#loginStatus {
  color: var(--danger);
  min-height: 20px;
}

#loginStatus.login-status-progress {
  color: var(--muted);
}

.login-panel[aria-busy="true"] {
  cursor: wait;
}

.login-panel .login-loading {
  align-items: center;
  display: inline-flex;
  gap: 9px;
  justify-content: center;
}

.login-panel .login-loading::before {
  animation: login-spinner 0.8s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  border-top-color: #fff;
  content: "";
  height: 15px;
  width: 15px;
}

@keyframes login-spinner {
  to {
    transform: rotate(360deg);
  }
}

.login-panel .primary {
  background: var(--brand-burgundy);
  border-color: var(--brand-burgundy);
  color: #fff;
}

.login-panel .primary:hover {
  background: var(--brand-burgundy-hover);
  border-color: var(--brand-burgundy-hover);
}

.login-panel .primary:active {
  background: var(--brand-burgundy-active);
  border-color: var(--brand-burgundy-active);
}

.login-panel .primary:focus {
  box-shadow: 0 0 0 3px rgba(107, 0, 8, 0.15);
  outline: none;
}

.login-panel input {
  background: #f6f7f9;
  border: 1px solid #d8dee6;
  color: var(--text);
}

.login-panel input:focus {
  border-color: var(--brand-burgundy);
  background: #f6f7f9;
  box-shadow: 0 0 0 3px rgba(107, 0, 8, 0.10);
  outline: none;
}

.login-panel input.input-error {
  border-color: #c62828;
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.12);
}

.login-panel input:-webkit-autofill,
.login-panel input:-webkit-autofill:hover,
.login-panel input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #f6f7f9 inset;
  -webkit-text-fill-color: #111827;
}

.content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  padding: 14px 22px;
}

.admin-view {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.rating-view {
  padding: 0;
}

.rating-view iframe {
  border: 0;
  flex: 1;
  min-height: calc(100vh - 28px);
  width: 100%;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 18px;
}

.toolbar,
.catalog-panel,
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  margin-bottom: 8px;
}

.header-search {
  border: 0;
  background: transparent;
  margin-bottom: 0;
  padding: 0;
}

.header-search button,
.page-header .distribution-release-toolbar button {
  min-height: 34px;
  padding: 5px 10px;
}

.catalog-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-bottom: 16px;
  min-height: 0;
}

.catalog-head {
  align-items: center;
  background: #f4f6fa;
  color: #7b88a6;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
}

.catalog-actions {
  display: flex;
  gap: 6px;
}

.catalog-actions button,
.showcase-button {
  min-width: 78px;
  padding-bottom: 6px;
  padding-top: 6px;
}

.showcase-count-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--primary);
  padding: 3px 6px;
  white-space: nowrap;
}

.showcase-count-button:hover {
  background: #eef4ff;
  color: var(--primary-dark);
}

.catalog-table-wrap {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
}

.catalog-table {
  min-width: 860px;
  table-layout: fixed;
}

.catalog-price-col {
  width: 74px;
}

.catalog-code-col {
  width: 92px;
}

.catalog-article-col {
  width: 126px;
}

.catalog-quantum-col {
  width: 70px;
}

.catalog-unit-col {
  width: 52px;
}

.catalog-showcase-col {
  width: 96px;
}

.distribution-table {
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}

.distribution-table th:nth-child(1),
.distribution-table td:nth-child(1) {
  width: auto;
}

.distribution-table th:nth-child(2),
.distribution-table td:nth-child(2) {
  width: 118px;
}

.distribution-table th:nth-child(3),
.distribution-table td:nth-child(3),
.distribution-table th:nth-child(4),
.distribution-table td:nth-child(4),
.distribution-table th:nth-child(5),
.distribution-table td:nth-child(5) {
  text-align: center;
  width: 100px;
}

.distribution-table th:nth-child(6),
.distribution-table td:nth-child(6) {
  text-align: center;
  width: 58px;
}

.distribution-table th:nth-child(7),
.distribution-table td:nth-child(7) {
  width: 44px;
}

.distribution-config-row {
  cursor: default;
}

.distribution-config-name-cell {
  width: 100%;
}

.distribution-config-name-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  display: block;
  max-width: 100%;
  overflow: hidden;
  padding: 3px 6px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.distribution-config-name-button:hover {
  background: #eef4ff;
  color: var(--primary);
}

.distribution-name-field .distribution-config-name-button {
  background: #eef4ff;
  color: var(--primary);
  font-size: 17px;
  font-weight: 750;
}

.distribution-name-field .distribution-config-name-button:hover {
  background: #dceaff;
  color: var(--primary-dark);
}

.distribution-table th:not(:first-child),
.distribution-table td:not(:first-child) {
  white-space: nowrap;
}

.distribution-config-toolbar,
.distribution-create-toolbar,
.distribution-release-toolbar,
.distribution-template-toolbar {
  align-items: center;
}

.distribution-config-toolbar {
  display: flex;
}

.distribution-release-toolbar,
.distribution-template-toolbar {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.distribution-release-toolbar {
  flex: 0 0 auto;
}

.distribution-template-toolbar select {
  max-width: 260px;
}

.distribution-add-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.distribution-name-field {
  flex: 1;
  min-width: 240px;
}

.distribution-name-editor {
  align-items: center;
  display: flex;
  gap: 6px;
}

.distribution-name-input {
  background: #eef4ff;
  font-size: 17px;
  font-weight: 750;
  flex: 1;
  min-width: 0;
}

.distribution-name-input-invalid {
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 700;
}

.distribution-name-input-invalid::placeholder {
  color: var(--danger);
  opacity: 1;
}

.distribution-product-search {
  flex: 1;
  min-width: 320px;
  position: relative;
}

.distribution-product-search .field,
.distribution-name-field {
  width: 100%;
}

.distribution-product-results {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(23, 32, 42, 0.16);
  display: grid;
  left: 0;
  max-height: 320px;
  overflow-y: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 6;
}

.distribution-product-result {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 34px;
  padding: 6px 10px;
  text-align: left;
}

.distribution-folder-result {
  padding: 0;
}

.distribution-folder-result > button:first-child {
  background: transparent;
  border: 0;
  flex: 1;
  min-height: 34px;
  padding: 6px 10px;
  text-align: left;
}

.distribution-product-result:hover {
  background: #f2f5f9;
}

.distribution-empty-result {
  color: var(--muted);
  justify-content: flex-start;
  pointer-events: none;
}

.distribution-status-label {
  border: 0;
  border-radius: 999px;
  display: inline-block;
  font-weight: 700;
  min-height: 26px;
  padding: 3px 10px;
}

.distribution-status-active {
  background: #e8f7ef;
  color: var(--ok);
}

.distribution-status-applied {
  background: #eef1f5;
  color: var(--muted);
}

.distribution-value-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  display: inline-flex;
  font-variant-numeric: tabular-nums;
  justify-content: center;
  min-height: 28px;
  padding: 3px 6px;
  text-align: center;
  width: 8ch;
}

.distribution-value-button:hover {
  background: #f2f5f9;
}

.distribution-value-invalid {
  color: var(--danger);
  font-weight: 700;
}

.distribution-rule-editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(23, 32, 42, 0.16);
  padding: 8px;
  position: fixed;
  left: 0;
  right: auto;
  top: 0;
  width: max-content;
  max-width: calc(100vw - 64px);
  z-index: 5;
}

.distribution-rule-editor-row {
  align-items: center;
  display: flex;
  gap: 6px;
}

.distribution-rule-input {
  max-width: 9ch;
  min-height: 32px;
  min-width: 9ch;
  text-align: right;
}

.distribution-form-hint {
  color: var(--danger);
  font-weight: 700;
  margin: -2px 0 8px;
}

#distributionProductSearchButton,
#distributionTemplateActionButton,
#distributionBackButton {
  height: 34px;
  min-height: 34px;
  padding: 5px 12px;
}

.distribution-create-toolbar input {
  min-height: 34px;
}

.distribution-create-toolbar input[type="number"] {
  max-width: 130px;
}

.catalog-nav-row td {
  background: #f4f6fa;
  color: #7b88a6;
  font-weight: 650;
  padding-bottom: 5px;
  padding-top: 5px;
}

.catalog-row {
  cursor: default;
}

.catalog-path-row td {
  background: #f4f6fa;
  color: #7b88a6;
  font-weight: 650;
  padding-bottom: 5px;
  padding-top: 9px;
}

.catalog-search-path {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

mark {
  background: #fff8b8;
  color: inherit;
  padding: 0;
}

.catalog-name {
  align-items: center;
  display: flex;
  gap: 8px;
}

.catalog-toggle {
  color: #27396f;
  font-size: 18px;
  width: 18px;
}

.catalog-folder {
  font-weight: 650;
}

.catalog-product {
  padding-left: 26px;
}

.catalog-product-name-invalid {
  color: var(--danger);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.name-inline-editor {
  align-items: center;
  display: flex;
  gap: 6px;
  width: 100%;
}

.name-inline-input {
  min-width: 260px;
  width: min(520px, 100%);
}

.catalog-price {
  color: var(--muted);
  font-size: inherit;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.catalog-code,
.article-value {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-quantum {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.field {
  display: grid;
  gap: 4px;
  min-width: 260px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 34px;
  padding: 5px 9px;
}

input:focus,
select:focus {
  border-color: var(--primary);
  outline: 2px solid #dceaff;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 5px 9px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.stock-inline-editor {
  align-items: center;
  display: flex;
  gap: 8px;
}

.stock-inline-input {
  min-width: 8ch;
  max-width: 8ch;
  min-height: 32px;
  text-align: right;
}

.stock-value-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  min-height: 28px;
  padding: 3px 6px;
  text-align: right;
  width: 8ch;
}

.stock-value-button:hover {
  background: #f2f5f9;
}

.product-summary-row {
  align-items: center;
  display: flex;
  gap: 18px;
  min-height: 32px;
  justify-content: space-between;
  max-width: min(540px, calc(100vw - 128px));
  width: 100%;
}

.product-summary-name {
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.product-quantum-control {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: inherit;
  font-weight: 700;
  gap: 6px;
  justify-content: flex-end;
  min-height: 32px;
  width: 17ch;
}

.product-quantum-button {
  background: #eef1f5;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  font-size: inherit;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  height: 32px;
  padding: 4px 6px;
  text-align: right;
  width: 8ch;
}

.product-quantum-button:hover {
  background: #e2e8f0;
}

.product-quantum-input {
  font-size: inherit;
  font-weight: 700;
  height: 32px;
  max-width: 8ch;
  min-width: 8ch;
  text-align: right;
}

.product-quantum-invalid {
  color: var(--danger);
  font-weight: 700;
}

.stock-add-row td {
  color: var(--muted);
  padding-top: 8px;
}

.stock-add-button {
  background: transparent;
  border: 0;
  color: var(--primary);
  padding: 4px 0;
}

.stock-add-button:hover {
  color: var(--primary-dark);
}

.stock-shop-select {
  min-height: 32px;
  max-width: 100%;
}

.stock-value-cell {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  width: 17ch;
  margin-left: auto;
  position: relative;
}

.stock-override-hourglass-button,
.stock-override-value-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
  min-height: 28px;
  padding: 3px 5px;
  width: 8ch;
}

.stock-override-hourglass-button {
  color: var(--muted);
  text-align: right;
}

.stock-override-value-button {
  color: #4b5563;
  font-weight: 700;
  text-align: right;
}

.stock-override-hourglass-button:hover,
.stock-override-value-button:hover {
  background: #f2f5f9;
}

.stock-override-editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(23, 32, 42, 0.16);
  display: grid;
  gap: 6px;
  padding: 8px;
  position: fixed;
  right: 0;
  top: 0;
  width: max-content;
  max-width: calc(100vw - 64px);
  z-index: 5;
}

.stock-override-editor-row {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.stock-override-editor-main-row {
  justify-self: stretch;
  width: 100%;
}

.stock-override-editor-actions-row {
  justify-self: end;
}

.stock-override-input {
  max-width: 8ch;
  min-height: 32px;
  min-width: 8ch;
  text-align: right;
}

.stock-override-all {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  gap: 4px;
  min-height: 28px;
  white-space: nowrap;
}

.stock-override-all input {
  min-height: 0;
  padding: 0;
}

.stock-override-delete-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--danger);
  flex: 0 0 28px;
  min-height: 28px;
  min-width: 0;
  padding: 4px 6px;
}

.stock-override-delete-button:hover {
  background: var(--danger-bg);
}

.stock-override-date-input {
  flex: 0 0 132px;
  min-height: 32px;
  min-width: 0;
}

.stock-override-comment-input {
  flex: 1;
  max-width: none;
  min-height: 32px;
  min-width: 0;
  width: 0;
}

.panel-dialog-overlay {
  align-items: center;
  background: rgba(23, 32, 42, 0.24);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 24px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 20;
}

.panel-dialog {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 42px rgba(23, 32, 42, 0.22);
  display: grid;
  gap: 12px;
  max-width: 420px;
  padding: 16px;
  width: 100%;
}

.panel-dialog-title {
  font-size: 16px;
  font-weight: 750;
}

.panel-dialog-message {
  color: var(--text);
  line-height: 1.45;
  white-space: pre-line;
}

.panel-dialog-link {
  color: var(--primary);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.panel-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.panel-dialog-actions button {
  min-height: 34px;
}

.catalog-actions-cell {
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}

.article-cell {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  min-width: 0;
}

.article-value {
  flex: 1;
  min-width: 0;
}

.catalog-icon-button {
  align-items: center;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  display: inline-flex;
  height: 28px;
  justify-content: center;
  line-height: 1;
  min-width: 0;
  padding: 0;
  vertical-align: middle;
  width: 28px;
}

.catalog-icon-button:hover {
  background: #eef4ff;
  color: var(--primary);
}

.article-value {
  text-align: right;
}

.article-inline-editor {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  position: relative;
}

.article-inline-input {
  min-height: 32px;
  max-width: 150px;
  text-align: right;
}

.article-confirm,
.article-cancel {
  border: 0;
  border-radius: 6px;
  min-width: 28px;
  padding: 4px 7px;
}

.article-confirm {
  background: #e7f6ed;
  color: var(--ok);
}

.article-cancel {
  background: var(--danger-bg);
  color: var(--danger);
}

.article-note {
  border-bottom: 1px dotted var(--muted);
  color: var(--muted);
  cursor: help;
  font-size: 12px;
}

.article-inline-options {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(31, 42, 55, 0.16);
  display: grid;
  grid-template-columns: max-content max-content;
  column-gap: 8px;
  row-gap: 2px;
  max-height: 220px;
  max-width: min(520px, 80vw);
  min-width: max-content;
  overflow: auto;
  padding: 4px;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 25;
}

.article-option-row {
  align-items: center;
  display: contents;
}

.article-option-value,
.article-option-note {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}

.article-option-value {
  justify-self: start;
}

.article-option-note,
.article-option-note-editor {
  justify-self: end;
}

.article-option-value:hover,
.article-option-note:hover {
  background: #f2f5f9;
}

.article-option-note {
  color: var(--muted);
  font-size: 12px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-option-note-editor {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-height: 30px;
  min-width: 120px;
  padding: 5px 7px;
  width: 100%;
}

.article-option-note-editor:focus {
  border-color: var(--brand-burgundy);
  box-shadow: 0 0 0 3px rgba(107, 0, 8, 0.10);
  outline: none;
}

.status-ok {
  color: var(--ok);
}

.modal {
  align-items: center;
  background: rgba(23, 32, 42, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 20;
}

.modal-panel {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
  max-height: calc(100vh - 48px);
  max-width: min(960px, calc(100vw - 48px));
  overflow: auto;
  width: fit-content;
}

.modal-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
}

#stocksModal .modal-header > div:first-child {
  min-width: 0;
  width: 100%;
}

.modal-close-button {
  align-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  font-size: 24px;
  height: 32px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 32px;
}

.modal-close-button:hover {
  background: #f2f5f9;
  color: var(--text);
}

.modal .table-wrap {
  border: 0;
  border-radius: 0;
  overflow-x: visible;
}

.modal table {
  table-layout: auto;
  min-width: 0;
  width: auto;
}

.modal th,
.modal td {
  padding: 6px 14px;
}

.modal th:first-child,
.modal td:first-child {
  padding-left: 14px;
}

.modal th:last-child,
.modal td:last-child {
  padding-right: 14px;
}

.modal td:nth-child(2) {
  text-align: right;
}

.modal th:nth-child(2) {
  text-align: center;
}

.release-acts-list,
.release-act-editor {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 0;
  overflow: auto;
}

.release-acts-list {
  overflow-x: hidden;
}

.release-acts-body {
  min-width: 0;
}

.release-acts-empty {
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.release-act-row {
  align-items: start;
  background: var(--panel);
  border: 0;
  border-bottom: 1px solid #edf0f4;
  border-radius: 0;
  color: var(--text);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 70px 44px minmax(0, 1fr) minmax(140px, 220px) 108px 24px;
  padding: 14px 12px;
  text-align: left;
  width: 100%;
}

.release-act-main,
.release-act-responsible,
.release-act-amount-actions {
  min-width: 0;
}

.release-act-responsible {
  overflow-wrap: anywhere;
}

.release-act-amount-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.release-act-vsd-button {
  margin: 0;
  min-width: 58px;
  padding: 8px 10px;
}

.release-act-row:hover {
  background: #f7f9fc;
  border-color: #edf0f4;
}

.release-act-draft,
.release-act-draft:hover {
  background: #f0f2f5;
  color: #8a929d;
}

.release-act-date {
  color: var(--text);
  font-size: 16px;
  white-space: nowrap;
}

.release-act-draft .release-act-date {
  color: #8a929d;
}

.release-act-number,
.release-act-responsible {
  color: #8b95a8;
}

.release-act-warehouse {
  color: #263f7f;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 5px;
}

.release-act-draft .release-act-warehouse {
  color: #697384;
}

.release-act-product {
  color: #8b8b8b;
  line-height: 1.45;
}

.release-act-product span {
  color: #a2a2a2;
}

.release-act-amount {
  color: #263f7f;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.release-act-draft .release-act-amount {
  color: #8b95a8;
  font-weight: 500;
}

.release-act-state {
  color: #1d9a45;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  justify-self: end;
  text-align: center;
  width: 24px;
}

.release-act-editor {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.release-act-editor-toolbar {
  border-bottom: 1px solid var(--line);
  flex-wrap: nowrap;
  padding: 12px;
}

.release-act-editor-title {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.release-act-items-table {
  min-width: 720px;
  width: 100%;
}

.release-act-items-table th:nth-child(2),
.release-act-items-table td:nth-child(2) {
  width: 130px;
}

.release-act-items-table th:nth-child(3),
.release-act-items-table td:nth-child(3) {
  text-align: right;
  width: 160px;
}

.release-act-items-table th:nth-child(4),
.release-act-items-table td:nth-child(4) {
  text-align: center;
  width: 70px;
}

.release-act-item-name {
  font-weight: 600;
}

.release-act-quantity-input {
  max-width: 130px;
  text-align: right;
  width: 100%;
}

.stock-check-filters {
  align-items: end;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stock-check-filters .field {
  min-width: 0;
}

.stock-check-filters input,
.stock-check-filters select {
  min-width: 0;
  width: 100%;
}

.stock-check-reset-button {
  align-self: flex-end;
  min-height: 34px;
  padding: 5px 10px;
}

.stock-check-list {
  min-height: 0;
}

.stock-check-table {
  min-width: 0;
  table-layout: fixed;
}

.stock-check-table th:nth-child(1) {
  width: 13%;
}

.stock-check-table th:nth-child(2) {
  width: 22%;
}

.stock-check-table th:nth-child(3) {
  width: 19%;
}

.stock-check-table th:nth-child(4) {
  width: 24%;
}

.stock-check-table th:nth-child(5) {
  width: 12%;
}

.stock-check-table th:nth-child(6) {
  width: 52px;
}

.stock-check-row {
  cursor: pointer;
}

.stock-check-row:hover td,
.stock-check-row:focus td,
.stock-check-row-expanded td {
  background: #f6f9fe;
}

.stock-check-row:focus {
  outline: 2px solid #b9d1f8;
  outline-offset: -2px;
}

.stock-check-version,
.stock-check-absent {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.stock-check-count {
  font-size: 17px;
  font-weight: 700;
}

.stock-check-absent.has-absent {
  color: var(--danger);
  font-weight: 650;
}

.stock-check-status {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  padding: 5px 9px;
}

.stock-check-status-shop_pending {
  background: #fff4d6;
  color: #805900;
}

.stock-check-status-supervisor_pending {
  background: #e8f1ff;
  color: #205bb5;
}

.stock-check-status-approving {
  background: #e8f1ff;
  color: #205bb5;
}

.stock-check-status-approved {
  background: #e4f6eb;
  color: var(--ok);
}

.stock-check-status-cancelled {
  background: #f0f2f5;
  color: #626d7d;
}

.stock-check-error-mark {
  align-items: center;
  background: var(--danger);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  height: 17px;
  justify-content: center;
  width: 17px;
}

.stock-check-expand-button {
  border: 0;
  color: var(--primary);
  min-height: 30px;
  padding: 4px 8px;
  width: 100%;
}

.stock-check-detail-row > td {
  background: #f8fafc;
  padding: 12px 18px 16px;
}

.stock-check-detail-content {
  min-width: 0;
  width: 100%;
}

.stock-check-detail-times {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  gap: 5px 14px;
  margin-bottom: 10px;
}

.stock-check-detail-times span {
  white-space: nowrap;
}

.stock-check-detail-loading,
.stock-check-detail-error,
.stock-check-empty {
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.stock-check-detail-error,
.stock-check-saby-error {
  color: var(--danger);
}

.stock-check-document-meta {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.stock-check-document-meta a {
  color: var(--primary);
  font-weight: 650;
}

.stock-check-saby-error {
  background: var(--danger-bg);
  border-radius: 6px;
  padding: 7px 9px;
}

.stock-check-items-wrap {
  max-width: 100%;
  overflow: hidden;
}

.stock-check-items-table {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}

.stock-check-items-table th,
.stock-check-items-table td {
  overflow-wrap: anywhere;
}

.stock-check-items-table th:nth-child(1) {
  width: 40%;
}

.stock-check-items-table th:nth-child(2) {
  width: 20%;
}

.stock-check-items-table th:nth-child(3) {
  width: 22%;
}

.stock-check-items-table th:nth-child(4) {
  width: 18%;
}

.stock-check-list-footer {
  background: #f8fafc;
  border-top: 1px solid var(--line);
  font-size: 14px;
  padding: 10px 14px;
  text-align: right;
}

.stock-check-answer {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.stock-check-answer-yes {
  background: #e4f6eb;
  color: var(--ok);
}

.stock-check-answer-no {
  background: var(--danger-bg);
  color: var(--danger);
}

.stock-check-answer-empty {
  background: #f0f2f5;
  color: var(--muted);
}

.users-create-toolbar {
  align-items: end;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 180px minmax(240px, 1fr) auto;
}

.users-create-toolbar .field {
  min-width: 0;
}

.users-create-button {
  min-height: 34px;
}

.users-table {
  min-width: 880px;
}

.users-table th:nth-child(1) {
  width: 22%;
}

.users-table th:nth-child(2) {
  width: 190px;
}

.users-table th:nth-child(3) {
  width: 130px;
}

.users-table th:nth-child(4),
.users-table th:nth-child(5) {
  width: 145px;
}

.users-table th:last-child {
  width: 110px;
}

.users-role-select {
  width: 100%;
}

.users-access-label {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  white-space: nowrap;
}

.users-access-label input {
  min-height: 0;
}

.users-current-label {
  color: var(--muted);
  font-size: 12px;
}

.users-save-button {
  min-height: 32px;
  padding: 5px 10px;
  width: 100%;
}

.hidden {
  display: none !important;
}

@media (max-width: 820px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content {
    padding: 18px;
  }

  .page-header,
  .toolbar,
  .catalog-head,
  .modal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-actions {
    flex-wrap: wrap;
  }

  .field {
    min-width: 0;
  }

  .stock-value-cell {
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .release-acts-header-actions,
  .release-act-editor-toolbar {
    align-items: stretch;
  }

  .users-create-toolbar {
    grid-template-columns: 1fr;
  }

  .stock-check-filters {
    grid-template-columns: 1fr;
  }

  .stock-check-list .catalog-table-wrap {
    overflow: visible;
  }

  .stock-check-table,
  .stock-check-table > tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .stock-check-table > thead {
    display: none;
  }

  .stock-check-row {
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 8px 44px 8px 8px;
    position: relative;
  }

  .stock-check-row td {
    border: 0;
    min-width: 0;
    padding: 7px 8px;
  }

  .stock-check-row td::before,
  .stock-check-items-table td::before {
    color: var(--muted);
    content: attr(data-label);
    display: block;
    font-size: 11px;
    font-weight: 650;
    margin-bottom: 3px;
  }

  .stock-check-expand-cell {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
  }

  .stock-check-detail-row,
  .stock-check-detail-row > td {
    display: block;
    width: 100%;
  }

  .stock-check-detail-row > td {
    padding: 12px;
  }

  .stock-check-detail-times {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .stock-check-items-table,
  .stock-check-items-table tbody {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .stock-check-items-table thead {
    display: none;
  }

  .stock-check-items-table tr {
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(100px, auto);
    padding: 7px;
  }

  .stock-check-items-table tr:last-child {
    border-bottom: 0;
  }

  .stock-check-items-table td {
    border: 0;
    min-width: 0;
    padding: 6px;
  }

  .stock-check-items-table td:first-child {
    grid-column: 1 / -1;
  }
}
