/* SPDX-License-Identifier: MIT
 * Everyday inventory controls shared by tinyInvendo and Invendo.Cloud. */
.iv-quantity-controls {
  display: grid; grid-template-columns: 2.75rem minmax(4.5rem, 1fr) 2.75rem;
  align-items: center; gap: .5rem; min-width: 13.5rem; width: 100%; max-width: 18rem;
}
.iv-quantity-controls > form { margin: 0; }
.iv-quantity-controls .iv-quantity-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; min-width: 2.75rem; padding: 0;
  border: 1px solid var(--border, var(--bs-border-color)); border-radius: 50%;
  background: var(--bg-elev, var(--bs-tertiary-bg)); color: var(--text, var(--bs-body-color));
  font-size: 1.2rem; line-height: 1;
}
.iv-quantity-controls .iv-quantity-step--add {
  background: var(--iv-brand-strong); border-color: var(--iv-brand-strong); color: #fff;
}
.iv-quantity-controls .iv-quantity-value {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 2.75rem; padding: .4rem .55rem; border-radius: var(--iv-radius-control);
  border: 1px solid var(--border, var(--bs-border-color));
  background: var(--bg-elev, var(--bs-tertiary-bg)); color: var(--text, var(--bs-body-color));
  flex-wrap: wrap; min-width: 0; font: inherit; font-weight: 650; font-variant-numeric: tabular-nums; cursor: pointer;
}
.iv-quantity-value small { font-weight: 400; font-size: .8em; max-width: 100%; overflow-wrap: anywhere; }
.iv-quantity-value .bi { font-size: .75em; opacity: .65; }
.iv-quantity-controls button:focus-visible, .iv-quantity-more > summary:focus-visible,
.iv-task-options button:focus-visible { outline: 3px solid var(--iv-brand-tint); outline-offset: 3px; }
.iv-quantity-controls button:disabled { opacity: .4; cursor: not-allowed; }
.iv-quantity-more { margin-top: .5rem; font-size: .85rem; }
.iv-quantity-more > summary { min-height: 2.75rem; padding: .55rem .3rem; cursor: pointer; }
.iv-quantity-more > div { display: flex; flex-wrap: wrap; gap: .5rem; padding: .5rem 0; }
.iv-quantity-more form { margin: 0; }
.iv-quantity-difference { display: flex; align-items: center; gap: .5rem; flex-basis: 100%; }
.iv-quantity-difference input { width: 7rem; min-height: 2.75rem; }
.iv-quantity-difference button { min-height: 2.75rem; }
.iv-task-options { display: flex; gap: .25rem; flex-wrap: wrap; padding: .25rem;
  background: var(--bg-elev, var(--bs-tertiary-bg)); border: 1px solid var(--border, var(--bs-border-color));
  border-radius: var(--iv-radius-control); margin: .75rem 0; width: fit-content; }
.iv-task-options button { min-height: 2.75rem; border: 0; border-radius: .35rem; padding: .4rem .85rem;
  color: var(--text, var(--bs-body-color)); background: transparent; }
.iv-task-options button[aria-pressed="true"] { color: white; background: var(--iv-brand-strong); }
.iv-stock-direction { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
.iv-stock-direction button { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
@media (prefers-contrast: more) { .iv-quantity-controls button { border-width: 2px; } }

.iv-context-menu { position: relative; }
.iv-context-menu > summary { display: flex; align-items: center; justify-content: center;
  width: 2.75rem; min-height: 2.75rem; list-style: none; cursor: pointer; }
.iv-context-menu > summary::-webkit-details-marker { display: none; }
.iv-context-menu > div { position: absolute; z-index: 30; right: 0; top: calc(100% + .4rem);
  display: flex; flex-wrap: wrap; gap: .5rem; width: min(20rem, calc(100vw - 3rem));
  padding: .75rem; border: 1px solid var(--border, var(--bs-border-color));
  border-radius: var(--iv-radius); background: var(--bg-elev, var(--bs-body-bg)); box-shadow: var(--iv-shadow-raised); }
.iv-context-menu .place-context-id { flex-basis: 100%; overflow-wrap: anywhere; }

[data-iv-context] { display: grid; grid-template-columns: minmax(0, 1fr) 2.75rem; gap: .75rem; align-items: start; }
[data-iv-context] > .place-context-main { width: auto; min-width: 0; }
[data-iv-context] > .place-context-editor { grid-column: 1 / -1; }
.place-items-table [data-inventory-detail] { display: none !important; }
