#page-stock {
  min-width: 0;
}
.stock-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.stock-toolbar label,
.stock-modal label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stock-toolbar input,
.stock-toolbar select,
.stock-modal input,
.stock-modal select,
.stock-modal textarea {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  padding: 9px 10px;
  color: var(--t1, inherit);
  background: var(--bg, transparent);
  border: 1px solid var(--bd, #aaa);
  border-radius: 8px;
  font: inherit;
}
.stock-toolbar .stock-check,
.stock-modal .stock-check {
  flex-direction: row;
  align-items: center;
}
.stock-toolbar h2 {
  flex: 1;
  margin: 0;
}
.stock-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}
.stock-table th,
.stock-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--bd, #aaa);
  overflow-wrap: anywhere;
}
.stock-link {
  background: none;
  border: 0;
  color: inherit;
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.stock-badge {
  display: inline-block;
  padding: 2px 6px;
  margin-left: 5px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 11px;
}
.stock-neg {
  color: #b63e36;
  font-weight: 700;
  background: rgba(200, 60, 40, 0.09);
}
.stock-crit {
  color: #956400;
  background: rgba(180, 130, 0, 0.09);
}
.stock-modal {
  box-sizing: border-box;
  width: min(840px, 94vw);
  max-height: 90dvh;
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--bd, #aaa);
  border-radius: 16px;
  background: var(--card, #fff);
  color: var(--t1, #222);
}
.stock-modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.stock-modal label {
  margin: 12px 0;
}
.stock-form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
#stockGoodError {
  color: #b63e36;
}
@media (max-width: 700px) {
  .stock-toolbar > label {
    flex: 1 1 140px;
  }
  .stock-table thead {
    display: none;
  }
  .stock-table tr {
    display: block;
    border: 1px solid var(--bd, #aaa);
    border-radius: 10px;
    margin: 10px 0;
    padding: 6px;
  }
  .stock-table td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    padding: 8px;
  }
  .stock-table td::before {
    content: attr(data-label);
    font-weight: 600;
    flex-shrink: 0;
  }
  .stock-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .stock-modal {
    padding: 16px;
  }
}

[data-theme='dark'] .stock-neg {
  color: #ff9890;
}
[data-theme='dark'] .stock-crit {
  color: #f1c86b;
}
#page-stock button:not(.stock-link),
.stock-modal button {
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--card);
  color: var(--t1);
  font: inherit;
  cursor: pointer;
}
#page-stock .tab.active {
  border-color: var(--a);
  background: var(--as);
  color: var(--t1);
}
#page-stock button:disabled,
.stock-modal button:disabled {
  opacity: 0.5;
  cursor: default;
}
.stock-line {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr) auto;
  gap: 8px;
  align-items: end;
  border-bottom: 1px solid var(--bd);
  padding: 10px 0;
}
.stock-modal p[role='alert'] {
  color: var(--danger);
  white-space: pre-line;
}
.stock-modal textarea {
  width: 100%;
  min-height: 65px;
}
@media (max-width: 700px) {
  .stock-line {
    grid-template-columns: 1fr 1fr;
  }
  .stock-line > label:first-child {
    grid-column: 1/-1;
  }
}

.stock-modal {
  margin: auto;
}
.stock-check input[type='checkbox'] {
  width: auto;
}

/* Catalog layout. These classes are shared with stockGoodsHtml(). */
#page-stock [hidden] {
  display: none !important;
}
#page-stock .stock-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
#page-stock .stock-breadcrumb {
  margin-bottom: 5px;
  color: var(--t3);
  font-size: 12px;
}
#page-stock .stock-page-head h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}
#page-stock #stockCounters {
  margin-top: 6px;
  color: var(--t3);
  font-size: 12px;
}
#page-stock .stock-page-actions,
#page-stock .stock-filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
#page-stock .stock-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  margin: 0 -2px 18px;
  padding: 0 2px;
  border-bottom: 1px solid var(--bd);
}
#page-stock .stock-tabs .tab {
  flex: 0 0 auto;
  padding: 10px 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--t2);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
#page-stock .stock-tabs .tab.active {
  border-bottom-color: #d99b00;
  background: transparent;
  color: var(--t1);
  font-weight: 700;
}
#page-stock .stock-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--card);
}
#page-stock .stock-filters label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: var(--t2);
  font-size: 12px;
  font-weight: 600;
}
#page-stock .stock-filters input,
#page-stock .stock-filters select {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  padding: 9px 10px;
  color: var(--t1);
  background: var(--card);
  border: 1px solid var(--bd);
  border-radius: 7px;
  font: inherit;
  font-weight: 400;
}
#page-stock .stock-search-field input {
  width: 100%;
}
#page-stock .stock-filter-actions {
  justify-content: space-between;
  align-items: flex-end;
}
#page-stock .stock-filter-actions label {
  width: 112px;
}
#page-stock .stock-extra-filters {
  border-top: 1px solid var(--bd);
  padding-top: 12px;
}
#page-stock .stock-extra-filters summary {
  width: fit-content;
  color: var(--t2);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
#page-stock .stock-extra-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
#page-stock .stock-catalog-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
#page-stock .stock-catalog-sidebar,
#page-stock .stock-catalog-results {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--card);
}
#page-stock .stock-catalog-sidebar {
  position: sticky;
  top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}
#page-stock .stock-catalog-sidebar section {
  padding: 16px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--card);
}
#page-stock .stock-catalog-sidebar section + section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--bd);
}
#page-stock .stock-catalog-sidebar h3 {
  margin: 0 0 12px;
  font-size: 15px;
}
#page-stock .stock-catalog-sidebar section:first-child button {
  display: block;
  width: 100%;
  margin-top: 8px;
}
#page-stock .stock-catalog-sidebar section:first-child button[data-stock-quick-manage] {
  border-color: #d99b00;
  background: #eab308;
  color: #241a00;
  font-weight: 700;
}
#page-stock .stock-category-tree,
#page-stock .stock-category-tree ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}
#page-stock .stock-category-tree ul {
  padding-left: 16px;
}
#page-stock .stock-category-tree li {
  position: relative;
  padding: 3px 0 3px 16px;
}
#page-stock .stock-category-tree li::before {
  content: '›';
  position: absolute;
  left: 2px;
  color: var(--t3);
}
#page-stock .stock-category-tree .stock-link {
  width: 100%;
  padding: 3px 5px;
  border-radius: 5px;
  text-decoration: none;
}
#page-stock .stock-category-tree .stock-link:hover,
#page-stock .stock-category-tree .stock-link[aria-current='true'] {
  background: var(--bg);
  color: var(--t1);
  font-weight: 600;
}
#page-stock .stock-catalog-results {
  overflow: hidden;
}
#page-stock .stock-catalog-table {
  margin-top: 0;
}
#page-stock .stock-catalog-count {
  margin-bottom: 12px;
  color: var(--t3);
  text-align: center;
}
#page-stock .stock-catalog-table small {
  display: block;
  margin-top: 3px;
  color: var(--t3);
  font-size: 11px;
}
#page-stock .stock-catalog-table td:first-child,
#page-stock .stock-catalog-table th:first-child {
  width: 38px;
}
#page-stock button.btn-pri {
  border-color: #d99b00;
  background: #eab308;
  color: #241a00;
  font-weight: 700;
}
#page-stock button.btn-pri:hover {
  background: #d99b00;
}
[data-theme='dark'] #page-stock button.btn-pri,
[data-theme='dark'] #page-stock .stock-catalog-sidebar section:first-child button[data-stock-quick-manage] {
  background: #facc15;
  color: #211a00;
}

@media (max-width: 760px) {
  #page-stock .stock-page-head {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  #page-stock .stock-page-actions {
    align-items: stretch;
  }
  #page-stock .stock-page-actions button {
    flex: 1;
  }
  #page-stock .stock-catalog-layout {
    grid-template-columns: 1fr;
  }
  #page-stock .stock-catalog-sidebar {
    position: static;
  }
  #page-stock .stock-extra-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 390px) {
  #page-stock .stock-page-actions,
  #page-stock .stock-filter-actions {
    flex-direction: column;
    align-items: stretch;
  }
  #page-stock .stock-page-actions button {
    width: 100%;
  }
  #page-stock .stock-extra-grid {
    grid-template-columns: 1fr;
  }
  #page-stock .stock-tabs {
    margin-right: -16px;
    padding-right: 16px;
  }
}

/* Operations journal.  The operation-specific wrapper keeps this dense layout
   isolated from the catalog, balances and document forms above. */
#page-stock .stock-operations {
  min-width: 0;
  color: var(--t1);
}
#page-stock.stock-operations-active > .stock-page-head,
#page-stock.stock-operations-active .stock-page-head.stock-common-head {
  display: none;
}
#page-stock .stock-operations-head,
#page-stock .stock-operations-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 18px;
}
#page-stock .stock-operations-caption,
#page-stock .stock-operations .stock-breadcrumb {
  margin: 0 0 12px;
  color: var(--t2);
  font-size: 13px;
}
#page-stock .stock-operations h1,
#page-stock .stock-operations-title {
  margin: 0;
  color: var(--t1);
  font-size: 30px;
  line-height: 1.12;
}
#page-stock .stock-operations-actions,
#page-stock .stock-operations-head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
#page-stock .stock-operations-actions > button,
#page-stock .stock-operations-head-actions > button {
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--bd);
  border-radius: 7px;
  background: var(--card);
  color: var(--t1);
  font: inherit;
  cursor: pointer;
}
#page-stock .stock-operations-actions .stock-operations-export,
#page-stock .stock-operations-head-actions .stock-operations-export {
  background: var(--card);
}
#page-stock .stock-operations-actions .stock-operations-menu,
#page-stock .stock-operations-head-actions .stock-operations-menu,
#page-stock .stock-operations-actions [data-stock-operation-menu],
#page-stock .stock-operations-head-actions [data-stock-operation-menu] {
  border-color: #eab308;
  background: #facc15;
  color: #241a00;
}
#page-stock .stock-operations-actions .stock-operations-menu > summary,
#page-stock .stock-operations-head-actions .stock-operations-menu > summary {
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid #eab308;
  border-radius: 7px;
  background: #facc15;
  color: #241a00;
  font: inherit;
  cursor: pointer;
}
#page-stock .stock-operations-menu-wrap {
  position: relative;
}
#page-stock .stock-operations-dropdown {
  position: relative;
}
#page-stock .stock-operations-filter-extra {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 1px solid var(--bd);
}
#page-stock .stock-operations-extra {
  grid-column: 1 / -1;
  border-top: 1px solid var(--bd);
  padding-top: 10px;
}
#page-stock .stock-operations-extra summary {
  width: fit-content;
  color: var(--t2);
  font-size: 13px;
  cursor: pointer;
}
#page-stock .stock-operations-extra-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 30px;
  margin-top: 10px;
}
#page-stock .stock-operations-filter-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
}
#page-stock .stock-operations-filter-footer label {
  flex: 0 1 auto;
  width: auto;
  display: flex;
  align-items: center;
  gap: 7px;
}
#page-stock .stock-operations-filter-footer > button {
  flex: 0 0 24%;
  min-width: 180px;
  justify-content: center;
  background: #fbad55;
  color: #241a00;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
}
#page-stock #stockOperationsError {
  margin: 12px 0;
  color: var(--danger, #b63e36);
  white-space: pre-line;
}
#page-stock .stock-operations-menu-list {
  position: absolute;
  z-index: 5;
  top: calc(100% + 3px);
  right: 0;
  min-width: 190px;
  padding: 6px 0;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .14);
}
#page-stock .stock-operations-menu-list button,
#page-stock .stock-operations-menu-list a {
  display: block;
  width: 100%;
  padding: 10px 13px;
  border: 0;
  background: transparent;
  color: var(--t1);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
#page-stock .stock-operations-menu-list button:hover,
#page-stock .stock-operations-menu-list a:hover {
  background: var(--bg);
}
#page-stock .stock-operations-filters,
#page-stock .stock-operation-filters,
#page-stock .stock-operations-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 30px;
  margin: 0 0 15px;
  padding: 18px 0 14px;
  border-top: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
}
#page-stock .stock-operations-filters,
#page-stock .stock-operation-filters {
  display: block;
  border-top: 1px solid var(--bd);
  border-bottom: 1px solid var(--bd);
}
#page-stock .stock-operations-filters > .stock-operations-filter-grid,
#page-stock .stock-operation-filters > .stock-operations-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 30px;
  padding: 18px 0 14px;
}
#page-stock .stock-operations-filters label,
#page-stock .stock-operation-filters label,
#page-stock .stock-operations-filter-grid label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--t2);
  font-size: 13px;
  font-weight: 400;
}
#page-stock .stock-operations-filters input,
#page-stock .stock-operations-filters select,
#page-stock .stock-operation-filters input,
#page-stock .stock-operation-filters select,
#page-stock .stock-operations-filter-grid input,
#page-stock .stock-operations-filter-grid select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 35px;
  padding: 7px 10px;
  border: 1px solid var(--bd);
  border-radius: 0;
  background: var(--card);
  color: var(--t1);
  font: inherit;
}
#page-stock .stock-operations-filters .stock-search,
#page-stock .stock-operation-filters .stock-search,
#page-stock .stock-operations-filters .stock-filter-wide,
#page-stock .stock-operation-filters .stock-filter-wide,
#page-stock .stock-operations-filter-grid .stock-search,
#page-stock .stock-operations-filter-grid .stock-filter-wide {
  grid-column: span 2;
}
#page-stock .stock-operations-filter-actions,
#page-stock .stock-operation-filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 20px;
}
#page-stock .stock-operations-filter-actions button,
#page-stock .stock-operation-filter-actions button,
#page-stock .stock-operations-show {
  min-height: 31px;
  min-width: 180px;
  padding: 6px 18px;
  border: 0;
  border-radius: 4px;
  background: #f6ad55;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
#page-stock .stock-operations-filter-actions button:hover,
#page-stock .stock-operation-filter-actions button:hover,
#page-stock .stock-operations-show:hover {
  background: #ed9835;
}
#page-stock .stock-operations-page-size {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--t2);
  font-size: 13px;
}
#page-stock .stock-operations-page-size select {
  min-height: 31px;
  padding: 4px 6px;
  border: 1px solid var(--bd);
  background: var(--card);
  color: var(--t1);
}
#page-stock .stock-operations-count,
#page-stock .stock-operation-count,
#page-stock #stockOperationsCount,
#page-stock .stock-operations-meta {
  margin: 0 auto 9px;
  color: var(--t2);
  text-align: center;
  font-size: 13px;
}
#page-stock .stock-operations-count strong,
#page-stock .stock-operation-count strong {
  display: inline-block;
  margin-left: 8px;
  padding: 7px 10px;
  border: 1px solid var(--bd);
  background: var(--card);
  color: #f27f32;
}
#page-stock .stock-operations-table-wrap,
#page-stock .stock-operation-table-wrap,
#page-stock #stockOperationsList {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--bd);
  background: var(--card);
}
#page-stock .stock-operations-table,
#page-stock .stock-operation-table,
#page-stock #stockOperationsList > table {
  width: 100%;
  min-width: 1450px;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}
#page-stock .stock-operations-table th,
#page-stock .stock-operations-table td,
#page-stock .stock-operation-table th,
#page-stock .stock-operation-table td,
#page-stock #stockOperationsList > table th,
#page-stock #stockOperationsList > table td {
  padding: 10px 8px;
  border: 1px solid var(--bd);
  vertical-align: top;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
#page-stock .stock-operations-table th,
#page-stock .stock-operation-table th,
#page-stock #stockOperationsList > table th {
  background: var(--card);
  color: var(--t2);
  font-weight: 700;
  text-align: left;
  word-break: normal;
  overflow-wrap: normal;
  text-transform: none;
  letter-spacing: normal;
  font-size: 12px;
}
#page-stock .stock-operations-table th:nth-child(1), #page-stock .stock-operations-table td:nth-child(1), #page-stock .stock-operation-table th:nth-child(1), #page-stock .stock-operation-table td:nth-child(1) { width: 2%; }
#page-stock .stock-operations-table th:nth-child(2), #page-stock .stock-operations-table td:nth-child(2), #page-stock .stock-operation-table th:nth-child(2), #page-stock .stock-operation-table td:nth-child(2) { width: 8%; }
#page-stock .stock-operations-table th:nth-child(3), #page-stock .stock-operations-table td:nth-child(3), #page-stock .stock-operation-table th:nth-child(3), #page-stock .stock-operation-table td:nth-child(3) { width: 6%; }
#page-stock .stock-operations-table th:nth-child(4), #page-stock .stock-operations-table td:nth-child(4), #page-stock .stock-operation-table th:nth-child(4), #page-stock .stock-operation-table td:nth-child(4) { width: 10%; }
#page-stock .stock-operations-table th:nth-child(5), #page-stock .stock-operations-table td:nth-child(5), #page-stock .stock-operation-table th:nth-child(5), #page-stock .stock-operation-table td:nth-child(5) { width: 8%; }
#page-stock .stock-operations-table th:nth-child(6), #page-stock .stock-operations-table td:nth-child(6), #page-stock .stock-operation-table th:nth-child(6), #page-stock .stock-operation-table td:nth-child(6) { width: 7%; }
#page-stock .stock-operations-table th:nth-child(7), #page-stock .stock-operations-table td:nth-child(7), #page-stock .stock-operation-table th:nth-child(7), #page-stock .stock-operation-table td:nth-child(7) { width: 7%; }
#page-stock .stock-operations-table th:nth-child(8), #page-stock .stock-operations-table td:nth-child(8), #page-stock .stock-operation-table th:nth-child(8), #page-stock .stock-operation-table td:nth-child(8) { width: 14%; }
#page-stock .stock-operations-table th:nth-child(9), #page-stock .stock-operations-table td:nth-child(9), #page-stock .stock-operation-table th:nth-child(9), #page-stock .stock-operation-table td:nth-child(9) { width: 8%; }
#page-stock .stock-operations-table th:nth-child(10), #page-stock .stock-operations-table td:nth-child(10), #page-stock .stock-operation-table th:nth-child(10), #page-stock .stock-operation-table td:nth-child(10) { width: 7%; }
#page-stock .stock-operations-table th:nth-child(11), #page-stock .stock-operations-table td:nth-child(11), #page-stock .stock-operation-table th:nth-child(11), #page-stock .stock-operation-table td:nth-child(11) { width: 6%; }
#page-stock .stock-operations-table th:nth-child(12), #page-stock .stock-operations-table td:nth-child(12), #page-stock .stock-operation-table th:nth-child(12), #page-stock .stock-operation-table td:nth-child(12) { width: 8%; }
#page-stock .stock-operations-table th:nth-child(13), #page-stock .stock-operations-table td:nth-child(13), #page-stock .stock-operation-table th:nth-child(13), #page-stock .stock-operation-table td:nth-child(13) { width: 9%; }
#page-stock .stock-operations-table tbody tr:hover,
#page-stock .stock-operation-table tbody tr:hover,
#page-stock #stockOperationsList > table tbody tr:hover {
  background: color-mix(in srgb, var(--a) 5%, var(--card));
}
#page-stock .stock-operations-table a,
#page-stock .stock-operation-table a,
#page-stock #stockOperationsList > table a {
  color: var(--a);
}
#page-stock .stock-operations-table .stock-link,
#page-stock .stock-operation-table .stock-link {
  color: #1769aa;
  text-decoration: none;
}
#page-stock .stock-operations-table th,
#page-stock .stock-operation-table th,
#page-stock .stock-operations-table td,
#page-stock .stock-operation-table td {
  border-right: 0;
  border-left: 0;
}
#page-stock .stock-operations-pagination,
#page-stock .stock-operation-pagination,
#page-stock #stockOperationsList .stock-operations-pagination {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 14px 0;
}

@media (max-width: 980px) {
  #page-stock .stock-operations-filters,
  #page-stock .stock-operation-filters,
  #page-stock .stock-operations-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #page-stock .stock-operations-filters > .stock-operations-filter-grid,
  #page-stock .stock-operation-filters > .stock-operations-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  #page-stock .stock-operations-head,
  #page-stock .stock-operations-header {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  #page-stock .stock-operations-title,
  #page-stock .stock-operations h1 {
    font-size: 25px;
  }
  #page-stock .stock-operations-filters,
  #page-stock .stock-operation-filters,
  #page-stock .stock-operations-filter-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #page-stock .stock-operations-filters > .stock-operations-filter-grid,
  #page-stock .stock-operation-filters > .stock-operations-filter-grid {
    grid-template-columns: 1fr;
  }
  #page-stock .stock-operations-filters .stock-search,
  #page-stock .stock-operation-filters .stock-search,
  #page-stock .stock-operations-filters .stock-filter-wide,
  #page-stock .stock-operation-filters .stock-filter-wide,
  #page-stock .stock-operations-filter-grid .stock-search,
  #page-stock .stock-operations-filter-grid .stock-filter-wide {
    grid-column: auto;
  }
  #page-stock .stock-operations-extra-grid {
    grid-template-columns: 1fr;
  }
  #page-stock .stock-operations-filter-actions,
  #page-stock .stock-operation-filter-actions {
    align-items: stretch;
    flex-direction: column;
  }
  #page-stock .stock-operations-show,
  #page-stock .stock-operations-filter-actions button,
  #page-stock .stock-operation-filter-actions button {
    width: 100%;
  }
  #page-stock .stock-operations-filter-footer { flex-wrap: wrap; }
  #page-stock .stock-operations-filter-footer > button {
    flex-basis: 100%;
    width: 100%;
  }
  /* Keep the journal as a real wide table: only its wrapper scrolls on phones. */
  #page-stock .stock-operations-table thead,
  #page-stock .stock-operation-table thead,
  #page-stock #stockOperationsList > .stock-operations-table-wrap table thead {
    display: table-header-group;
  }
  #page-stock .stock-operations-table tr,
  #page-stock .stock-operation-table tr,
  #page-stock #stockOperationsList > .stock-operations-table-wrap table tr {
    display: table-row;
    border: 0;
    margin: 0;
    padding: 0;
  }
  #page-stock .stock-operations-table td,
  #page-stock .stock-operation-table td,
  #page-stock #stockOperationsList > .stock-operations-table-wrap table td {
    display: table-cell;
    padding: 10px 8px;
    border: 1px solid var(--bd);
  }
  #page-stock .stock-operations-table td::before,
  #page-stock .stock-operation-table td::before,
  #page-stock #stockOperationsList > .stock-operations-table-wrap table td::before {
    content: none;
  }
}
[data-theme='dark'] #page-stock .stock-operations-actions .stock-operations-menu,
[data-theme='dark'] #page-stock .stock-operations-head-actions .stock-operations-menu,
[data-theme='dark'] #page-stock .stock-operations-actions [data-stock-operation-menu],
[data-theme='dark'] #page-stock .stock-operations-head-actions [data-stock-operation-menu] {
  background: #facc15;
  color: #211a00;
}

/* Maintain contrast in both application themes. */
[data-theme='dark'] #page-stock .stock-operations-table .stock-link { color: #77b8ee; }
#page-stock .stock-operations-head,
#page-stock .stock-operations-filters { background: var(--card); }
