/* Inventory tools share the workspace palette in both themes. */
#view-needs { min-width: 0; }
#view-needs .needs-controls { padding: 20px; margin-bottom: 25px; }
.needs-controls h2 { font-size: 18px; line-height: 1.4; }
.needs-parameter-fields { display: grid; grid-template-columns: minmax(230px, 1.6fr) repeat(2, minmax(110px, 1fr)) auto; gap: 10px; align-items: end; margin-top: 20px; }
.needs-parameter-fields .field { min-width: 0; }
.needs-parameter-fields label { display: block; margin-bottom: 9px; color: var(--ink); font-size: 13px; font-weight: 400; }
.needs-parameter-fields :is(input, select) { width: 100%; min-width: 0; }
#needs-stock-mode-hint, #needs-source-note, #needs-history-note, #needs-status, #needs-summary-note { font-size: 13px; line-height: 1.6; color: var(--muted); }
#needs-stock-mode-hint { margin-top: 15px; }
#needs-source-note { margin-top: 15px; }
#needs-history-note { margin-top: 6px; }
#needs-status, #needs-summary-note { margin-bottom: 25px; }
#needs-loading { padding: 25px 0; }
.needs-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 25px; margin-bottom: 25px; }
.needs-metric { padding: 20px; }
.needs-metric h3 { margin: 0 0 10px; color: var(--ink); font-size: 16px; line-height: 1.4; }
.needs-metric strong { display: block; font-size: 24px; line-height: 1.25; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.needs-metric:first-child strong, .needs-metric:nth-child(2) strong { color: var(--accent); }
.needs-metric p { margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
/* Table colours, type, borders and controls come from products.css. */
.needs-report .count-pill { justify-self: end; }
.needs-report .needs-export-error { margin: 20px; }
#needs-export-xlsx { white-space: nowrap; }
.needs-scroll { max-height: 650px; overflow: auto; }
.needs-scroll table { width: 100%; min-width: 1050px; border-collapse: collapse; }
.needs-scroll .resizable-table { min-width: 100%; }
.needs-scroll .resizable-table th { position: relative; }
.needs-scroll .resizable-table :is(th, td) { overflow: hidden; text-overflow: ellipsis; }
.needs-scroll .resizable-table :is(.needs-product, .needs-reason) { min-width: 0; max-width: none; }
.needs-scroll .column-resize-handle::after { top: 0; bottom: 0; right: 0; opacity: 0; }
.needs-scroll .column-resize-handle:is(:hover, :focus-visible)::after { opacity: 1; }
.needs-scroll th { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.needs-scroll .numeric { white-space: nowrap; font-variant-numeric: tabular-nums; }
.needs-scroll .needs-product { min-width: 200px; max-width: 320px; }
.needs-scroll .needs-product-name { display: block; max-width: 100%; overflow-wrap: anywhere; }
.needs-scroll .product-meta { display: block; overflow-wrap: anywhere; }
.needs-scroll .needs-unknown { color: var(--muted); }
.needs-scroll .needs-reason { min-width: 220px; max-width: 320px; white-space: normal; }
.needs-sort-button { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.needs-sort-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.needs-sort-indicator { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.needs-scroll th:is([aria-sort="ascending"], [aria-sort="descending"]) .needs-sort-indicator { color: var(--accent); font-weight: 700; }
.needs-warnings { margin: 0 0 25px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.needs-warnings p + p { margin-top: 10px; }
@media (max-width: 1100px) {
  .needs-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .needs-parameter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }
  .needs-stock-mode-field { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  /* Three navigation sections fit on a narrow screen without clipped labels. */
  body.workspace-view .navigation > .nav-section { flex: 1 1 0; }
  body.workspace-view .navigation > .nav-button { flex: 1 1 0; min-width: 0; white-space: normal; text-align: center; }
  body.workspace-view .nav-group-toggle { height: 100%; gap: 4px; }
  body.workspace-view .navigation > .nav-section .nav-design-icon,
  body.workspace-view .navigation > .nav-button .nav-design-icon { display: none; }
  .inventory-nav-group .nav-submenu { left: 50%; transform: translateX(-50%); }
  .needs-parameter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #needs-calculate { grid-column: 1 / -1; }
  .needs-metrics { gap: 15px; }
  .needs-metric { padding: 20px; }
  .needs-metric h3 { font-size: 13px; }
  .needs-metric strong { font-size: 24px; }
  .needs-report .count-pill { justify-self: start; }
}
