/* Inventory and purchase history share one workspace and keep distinct records. */
body:has(#masterItems.active) #pageTitle { font-family: Inter, ui-sans-serif, system-ui, sans-serif !important; font-weight: 800 !important; font-size: clamp(26px, 3vw, 38px); line-height: 1.15; letter-spacing: -.04em; }
.inventory-workspace { min-width: 0; }
.inventory-intro { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.inventory-tabs { display: flex; gap: 5px; padding: 5px; width: fit-content; max-width: 100%; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 12px; background: #eaf2fa; }
.inventory-tabs button { background: transparent; color: #526a87; border: 1px solid transparent; border-radius: 8px; padding: 12px 20px; min-height: 46px; font-size: 13px; font-weight: 750; white-space: nowrap; box-shadow: none; }
.inventory-tabs button[aria-selected=true] { background: #fff; color: #006eae; border-color: #d4e2ef; box-shadow: 0 2px 6px #0827490a; }
.inventory-tabs button:focus-visible { outline: 3px solid #53b2e6; outline-offset: 2px; }
.inventory-workspace [role=tabpanel][hidden] { display: none !important; }
.inventory-workspace .toolbar { gap: 14px; margin-bottom: 18px; }
.inventory-workspace .toolbar .search { min-height: 50px; font-size: 14px; }
.inventory-workspace .toolbar button, .inventory-workspace .form-actions button { min-height: 50px; border-radius: 10px; font-size: 14px; }
.inventory-workspace .card, .inventory-workspace .form-card { padding: 24px; min-width: 0; }
.inventory-workspace h3 { font-family: Inter, ui-sans-serif, system-ui, sans-serif !important; font-size: 21px; font-weight: 800 !important; letter-spacing: -.03em; margin: 0 0 20px; }
.inventory-workspace .form-grid { gap: 18px; }
.inventory-workspace form label { display: grid; gap: 8px; min-width: 0; font-size: 13px; font-weight: 700; }
.inventory-workspace form input, .inventory-workspace form select { width: 100%; box-sizing: border-box; height: 50px; min-width: 0; border-radius: 10px; font-size: 14px; }
.inventory-workspace .form-actions { padding-top: 20px; border-top: 1px solid var(--line); }
.inventory-workspace .table-card { max-height: none !important; overflow: visible !important; }
.inventory-workspace .table-card::after { display: none !important; }
.inventory-workspace table { width: 100%; min-width: 0 !important; table-layout: fixed; }
.inventory-workspace th, .inventory-workspace td { min-width: 0 !important; padding: 15px 12px; white-space: normal; overflow-wrap: anywhere; vertical-align: top; font-size: 13px; }
.inventory-workspace th { font-size: 10px; letter-spacing: .05em; }
.inventory-workspace th:first-child, .inventory-workspace td:first-child { position: static !important; }
.inventory-workspace td.money { font-size: 12px; font-variant-numeric: tabular-nums; }
.inventory-workspace td small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.inventory-workspace td:last-child button { padding: 7px 9px; font-size: 11px; margin-bottom: 5px; white-space: nowrap; }
#tradeItemsTable th:first-child { width: 22%; }
#tradeItemsTable th:nth-child(2) { width: 12%; }
#tradeItemsTable th:nth-child(3), #tradeItemsTable th:nth-child(4) { width: 10%; }
#tradeItemsTable th:nth-child(5) { width: 8%; }
#tradeItemsTable th:nth-child(6) { width: 13%; }
#tradeItemsTable th:last-child { width: 25%; }
#tradePurchasesTable th:first-child { width: 12%; }
#tradePurchasesTable th:nth-child(2) { width: 22%; }
#tradePurchasesTable th:nth-child(3) { width: 7%; }
#tradePurchasesTable th:nth-child(4), #tradePurchasesTable th:nth-child(5) { width: 13%; }
#tradePurchasesTable th:nth-child(6) { width: 21%; }
#tradePurchasesTable th:last-child { width: 12%; }
@media (max-width: 1100px) {
  .inventory-workspace table, .inventory-workspace tbody { display: block; }
  .inventory-workspace thead { display: none; }
  .inventory-workspace tbody { display: grid; gap: 12px; }
  .inventory-workspace tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .inventory-workspace td { display: grid; align-content: start; gap: 5px; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
  .inventory-workspace td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
  .inventory-workspace td:first-child, .inventory-workspace td:last-child, .inventory-workspace td[colspan] { grid-column: 1/-1; }
  .inventory-workspace td:last-child { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
  .inventory-workspace td:last-child::before { flex-basis: 100%; }
  .inventory-workspace td:last-child button { margin-bottom: 0; }
}
@media (max-width: 720px) {
  .inventory-tabs { width: 100%; box-sizing: border-box; }
  .inventory-tabs button { flex: 1; min-width: 0; padding: 10px 8px; font-size: 12px; white-space: normal; }
  .inventory-workspace .card, .inventory-workspace .form-card { padding: 16px; }
  .inventory-workspace .form-grid { grid-template-columns: minmax(0, 1fr); }
  .inventory-workspace .form-actions button { flex: 1; }
}
