/* Stock operation geometry only. Colors, fonts, controls and menus use voucher rules. */
html body #app .spu-page{position:relative;display:grid;grid-template-columns:var(--spu-list-width,320px) minmax(0,1fr)!important;height:calc(var(--erp-screen-height,100vh) - 130px);min-height:600px}
html body #app .spu-page.spu-collapsed{grid-template-columns:28px minmax(0,1fr)!important}.spu-collapsed>.so-history{visibility:hidden}
.spu-page [hidden]{display:none!important}
.spu-page .spu-collapse{position:absolute;top:5px;left:calc(var(--spu-list-width) - 28px);z-index:4;width:25px;padding:0;min-height:28px}.spu-collapsed .spu-collapse{left:1px}
.spu-page .spu-splitter{position:absolute;left:calc(var(--spu-list-width) - 3px);top:40px;bottom:0;width:6px;padding:0;border:0;border-radius:0;cursor:col-resize;background:transparent;z-index:3}.spu-collapsed .spu-splitter{display:none}
html body #app .spu-page .so-history>header{display:flex;justify-content:space-between;align-items:center;gap:10px}
html body #app .spu-page .spu-list-scroll{min-height:0;flex:1;overflow:auto}
html body #app .spu-page .so-history-rows{overflow:visible;height:auto!important}
html body #app .spu-page :is(.so-history-columns,.spu-filters,.so-history-rows>button){display:grid!important;grid-template-columns:var(--spu-history-columns)!important;width:var(--spu-history-width)!important;box-sizing:border-box;gap:6px!important;padding:4px 10px}
html body #app .spu-page .spu-filters{position:sticky;top:28px;z-index:2;background:var(--bg-soft)}
html body #app .spu-page .so-history-columns{position:sticky;top:0;z-index:2;height:28px;background:var(--bg-soft)}
.spu-page .so-history-columns>span{position:relative;padding-right:10px}.spu-page .so-history-rows>button>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;grid-row:auto!important}
.spu-page .spu-column-grip{position:absolute;right:0;top:0;height:100%;width:7px;min-height:0;padding:0;border:0;border-radius:0;background:transparent;cursor:col-resize;touch-action:none}
html body #app .spu-page .so-form{padding:0;gap:0;overflow:hidden}
html body #app .spu-page .so-title{flex-wrap:wrap;flex-shrink:0;align-items:end;padding:14px 16px;gap:22px}
html body #app .spu-page .so-title>div:first-child{min-width:145px;max-width:180px}.spu-page .so-title p{display:none}
html body #app .spu-page .so-header-fields{display:flex;flex:1 1 580px;flex-wrap:wrap;min-width:0;gap:8px}
html body #app .spu-page .so-detail-tabs{padding:6px 12px;margin:0;border-radius:0}
.spu-page .so-details-title{padding:4px 12px}.spu-page .so-details-title h2{display:none}.spu-page .so-details-title p{font-size:11px;margin:0}
html body #app .spu-page .so-detail-scroll{min-height:150px!important;max-height:none;flex:1;border-radius:0;overflow:auto!important;padding-bottom:270px;box-sizing:border-box}
html body #app .spu-page .so-detail-scroll table{table-layout:fixed!important;min-width:0!important;border-collapse:collapse}
.spu-page .so-detail-scroll thead{display:table-header-group}.spu-page .so-detail-scroll tbody{display:table-row-group}.spu-page .so-detail-scroll tr{display:table-row;padding:0}
html body #app .spu-page .so-detail-scroll :is(th,td){display:table-cell;box-sizing:border-box}.spu-page .so-detail-scroll td:before{display:none}
html body #app .spu-page .so-detail-scroll td:has(.searchable-combo){position:relative;overflow:visible}
html body #app .spu-page .so-detail-scroll td:has(.searchable-combo.open){z-index:20}
html body #app .spu-page .so-detail-scroll .searchable-combo{min-width:0!important;width:100%}
html body #app .spu-page .so-detail-scroll .searchable-combo-native{min-width:0!important;width:1px!important;height:1px!important}
html body #app .spu-page .searchable-combo-options{position:absolute;top:calc(100% + 5px);left:0;right:0;max-width:calc(100vw - 40px);box-sizing:border-box}
html body #app .spu-page .so-title .searchable-combo.open{z-index:30}
html body #app .spu-page .so-freight-total{padding:8px 12px}.spu-page .so-detail-scroll small{font-size:11px}
html body #app .spu-page .so-actions{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:8px;padding:10px}
html body #app .spu-page .so-actions button{min-width:0}
@media(max-width:780px){html body #app .spu-page,html body #app .spu-page.spu-collapsed{display:block;height:auto;min-height:0}.spu-page .spu-collapse,.spu-page .spu-splitter{display:none}.spu-page.spu-collapsed>.so-history{visibility:visible}.spu-page .so-history{height:220px;max-height:220px}html body #app .spu-page .so-form{overflow:visible}html body #app .spu-page .so-title{display:block}html body #app .spu-page .so-detail-scroll{height:400px;max-height:450px;flex:none}html body #app .spu-page .so-actions{grid-template-columns:repeat(4,minmax(0,1fr))}}
/* Prevent the older stock control rules from overriding the shared voucher controls. */
html body #app .spu-page .spu-voucher-entry-grid input:not(.searchable-combo-input){background:transparent!important}
html body #app .spu-page .spu-voucher-entry-grid input:not(.searchable-combo-input):focus{background:var(--bg)!important}
html body #app .spu-page .searchable-combo-option{border:0!important;border-radius:7px!important;min-height:34px!important;height:auto!important;padding:7px 9px!important}
html body #app .spu-page .so-actions .spu-voucher-action-button{padding:1px 6px;border-color:var(--line)}
html body #app .spu-page .so-actions .spu-voucher-action-button:not(:hover):not(:focus-visible){background:var(--panel)}
html body #app .spu-page .searchable-combo-option:not(.active):not(:hover){background:transparent!important}
html:root[data-theme="dark"] body #app .spu-page .searchable-combo-option:not(.active):not(:hover){color:#dce9f6!important;-webkit-text-fill-color:#dce9f6!important}

html body #app .spu-page .spu-master-field {
  display: flex !important;
  align-items: center;
  gap: 4px;
  min-width: 0;
  width: 100%;
}
.spu-master-field > .spu-combo {
  flex: 1 1 0;
  min-width: 0 !important;
}
.spu-page .spu-master-add {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}
.spu-page .spu-master-add:is(:hover, :focus-visible) {
  border-color: var(--cyan);
  outline: 1px solid var(--cyan);
  outline-offset: 1px;
}
html body #app .spu-page .so-title {
  gap: 10px;
  padding: 8px 12px;
}
html body #app .spu-page .so-title > div:first-child {
  min-width: 0;
  max-width: 160px;
}
html body #app .spu-page .so-header-fields {
  align-items: end;
}
html body #app .spu-page .so-header-fields > label {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1 1 120px;
  gap: 4px;
  min-width: 0;
  max-width: none;
}
.spu-page .spu-field-caption {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html body #app .spu-page .so-header-fields > .spu-document-number {
  flex: 0 0 76px;
}
html body #app .spu-page .so-header-fields > :is(.spu-document-date, label:has(input[type="date"])) {
  flex: 0 0 122px;
}
html body #app .spu-page .so-header-fields > .spu-document-currency {
  flex: 0 0 102px;
}
html body #app .spu-page .so-header-fields > .spu-document-reference {
  flex: 1 1 104px;
  max-width: 150px;
}
html body #app .spu-page .so-header-fields > .spu-document-party {
  flex: 2 1 180px;
  max-width: 300px;
}
html body #app .spu-page .so-header-fields :is(.spu-combo, .spu-master-field) {
  margin: 0 !important;
  min-height: 38px !important;
  height: 38px !important;
}
html body #app .spu-page .so-header-fields .spu-combo {
  display: flex !important;
  align-items: center;
  min-width: 0 !important;
}
html body #app .spu-page .so-header-fields :is(.spu-combo-input, .searchable-combo-option) {
  font-weight: 400 !important;
}
html body #app .spu-page .so-header-fields > .sc-conditions {
  flex-basis: 145px;
}
html body #app .spu-page .so-header-fields > label > :is(input, textarea),
html body #app .spu-page .so-header-fields .searchable-combo-input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  height: 38px;
}
html:root[data-theme] body #app .spu-page #stock-operation-form .so-header-fields > label > input[type="date"] {
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent) !important;
  border-radius: 8px !important;
  padding-inline: 8px !important;
}
html:root[data-theme] body #app .spu-page #stock-operation-form .so-header-fields > label > input[type="date"]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}
.spu-page .spu-document-number input[readonly] {
  opacity: .9;
  cursor: default;
}
@media (min-width: 1100px) {
  html body #app .spu-page .so-header-fields {
    flex-wrap: nowrap;
  }
}
@media (max-width: 780px) {
  html body #app .spu-page .so-header-fields {
    margin-top: 8px;
  }
}
