/* ==========================================================================
   Material Issue Center V1 — configurable deduction-mode + configurable-
   approval master-detail workspace (Render/CSS/Component only; see
   MaterialIssueCenterPage.js / MaterialIssueWorkspace.js / components/
   MaterialIssue*.js / ApprovalRuleCard.js / DailyConsumptionDialog.js). No
   backend, no API — pure UI Prototype, mirrors the Receipt Center /
   Purchase Return Center V1 architecture so the module reuses one Shell/
   Design System.
   ==========================================================================
   Reuses shared Foundation classes untouched (.card, .inventory-page-shell,
   .inventory-page-header, .prototype-banner, .item-page-actions,
   .inventory-btn-*, .icon-btn, .status-badge, .inventory-badge-*,
   .status-badge-info, .drawer-tabs/.drawer-tab, .drawer-footer-meta/
   -actions, .field-grid, .inventory-section-card, .item-movement-timeline
   family, .item-tab-note, .profile-summary-row, .dialog-overlay/-panel,
   .po-permission-panel / .po-quick-filters family, .inventory-empty-state,
   .query-field, .supplier-search-card). Every new Material-Issue-Center-
   specific class below uses a self-contained "mi-" prefix, matching the
   module-independence convention used throughout this session's Prototype
   phases. Does not touch purchase-order.css / PurchaseOrder* files.
   ========================================================================== */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-page-shell {
  gap: 0;
}/* ---- Header (V1.6 section 五): scoped override of the shared
   .inventory-page-header/.prototype-banner spacing — only applies when
   nested under .mi-page-shell, so other pages reusing those shared classes
   are unaffected. Frees ~20px so Header 以下只剩 Summary Strip／查詢／
   工作區三個固定區塊. ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-page-shell .inventory-page-header {
  margin-bottom: 8px;
  min-height: 34px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-page-shell .inventory-page-title {
  line-height: 1.2;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-page-shell .inventory-page-subtitle {
  margin-top: 2px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-page-shell .prototype-banner {
  margin-top: 4px;
  padding: 3px 10px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-fixed-block {
  flex-shrink: 0;
  margin-bottom: 8px;
}/* ---- Header actions (V1.1 section 三 → V1.6 section 五: 全部改為純 Icon
   Button，統一用 title 屬性提供瀏覽器原生 Tooltip，不再需要依斷點切換文字
   顯示，移除舊的 .mi-btn-compressible/.mi-btn-label 邏輯). 每日耗材盤點仍
   保留青綠描邊以維持視覺優先權。最右側以分隔線區隔出 Developer 按鈕. ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-btn-emphasis {
  border-color: var(--color-teal);
  color: var(--color-teal);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-header-actions {
  align-items: center;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-header-divider {
  width: 1px;
  height: 20px;
  background: var(--ids-border-soft);
  margin: 0 2px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-header-dev-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  font-size: var(--ids-font-xs);
  flex-shrink: 0;
}/* ---- Summary Strip (V1.4/V1.5 section 一 → V1.6 section 三: 不再是
   Dashboard 卡片陣列，改為單行 Icon＋數字＋名稱文字列，固定 50px、無卡片
   外框背景). ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-summary-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  height: 50px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-strip-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-strip-item .inv-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-strip-item-danger .inv-icon {
  color: #b3382c;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-strip-value {
  font-size: 19px;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-strip-item-danger .mi-strip-value {
  color: #b3382c;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-strip-label {
  font-size: var(--ids-font-sm);
  white-space: nowrap;
}/* ---- Status badge tones not covered by the shared inventory-badge-*
   family (section 十八) ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-badge-purple { background: #f1eafb; color: #6b3fa0; }:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-badge-cyan { background: #e2f6f6; color: #0f7a7a; }/* ---- Clinic-level 簽核模式 switcher (section 十五／V1.1 section 六／V1.4
   section 三: 高度由 ~72px 收緊為 ~52px). V1.6: 現在只在 Developer Drawer
   內出現，不再是主畫面固定區塊，樣式維持不變、重複使用。 ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-approval-switcher {
  padding: 5px 16px;
  background: var(--color-white);
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-lg);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-approval-switcher-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-approval-switcher-hint {
  margin-top: 2px;
  font-size: 11px;
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-approval-switcher-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ids-font-sm);
  font-weight: 600;
  color: var(--color-navy);
  flex-shrink: 0;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-approval-switcher-options {
  display: flex;
  gap: var(--ids-space-2);
  flex-wrap: wrap;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-approval-mode-btn {
  padding: 4px 12px;
  border: 1px solid var(--ids-border-soft);
  border-radius: 999px;
  background: var(--color-white);
  color: var(--color-text-muted);
  font-size: var(--ids-font-xs);
  cursor: pointer;
  transition: all 150ms ease;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-approval-mode-btn:hover {
  border-color: var(--color-teal);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-approval-mode-btn.active {
  background: var(--color-teal);
  border-color: var(--color-teal);
  color: var(--color-white);
  font-weight: 600;
}/* ---- Developer Drawer (V1.6 section 一／八): 簽核模式設定＋權限模擬移到
   Header「⚙ Developer」按鈕開啟的 Overlay，沿用共用的 .dialog-overlay/
   -panel 樣式（與 DailyConsumptionDialog 同一種 Drawer），收合時完全不佔
   版面高度，正式使用者預設不會看到。 ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-developer-drawer {
  width: min(560px, 92vw);
  max-height: 86vh;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-developer-drawer-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-devmode-section {
  display: flex;
  flex-direction: column;
}/* ---- Search / filter row (section 六／V1.4 section 五 → V1.5 section 三
   → V1.6 section 二: 移除「更多篩選」按鈕，搜尋框於第一排彈性填滿剩餘寬
   度；快速篩選 Ribbon 併入第二排右側，不再獨立佔一列). ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-filter-card {
  padding: 6px 12px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-filter-row {
  display: flex;
  align-items: center;
  gap: var(--ids-space-3);
  flex-wrap: wrap;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-filter-row-1 {
  align-items: flex-end;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-filter-row-1 .item-search-input-wrap {
  flex: 1 1 260px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-filter-row-2 {
  align-items: flex-end;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-filter-row .query-field {
  gap: 2px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-filter-row .query-field select, :is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-filter-row .query-field input, :is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-filter-row .supplier-search-input-wrap input {
  height: 30px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-filter-divider {
  width: 1px;
  align-self: stretch;
  min-height: 20px;
  background: var(--ids-border-soft);
}/* ---- 待辦 Filter Ribbon (V1.5 section 四): 取代個別 Chip 樣式，改用分隔線
   連接的單行文字列，高度由 48px 收緊為 36px；使用 mi- 前綴，不影響其他頁面
   共用的 .po-quick-filters／.po-quick-chip。 ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-quick-ribbon {
  display: flex;
  align-items: center;
  height: 36px;
  flex-wrap: wrap;
  font-size: var(--ids-font-sm);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-quick-ribbon-item {
  border: none;
  background: none;
  padding: 4px 2px;
  color: var(--color-text-muted);
  font-size: var(--ids-font-sm);
  cursor: pointer;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-quick-ribbon-item:hover {
  color: var(--color-teal);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-quick-ribbon-item.active {
  color: var(--color-teal);
  font-weight: 700;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-quick-ribbon-sep {
  color: var(--color-text-muted);
  opacity: 0.5;
  margin: 0 6px;
}/* ---- Two-pane workspace (section 八): ~58/42, both panes scroll
   independently. Below 1440px the right panel becomes a CSS-only overlay
   Drawer covering the list (V1.1 section 十二: raised from 1366px so the
   Workspace never renders cramped between 1366-1440px). ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-workspace {
  display: flex;
  gap: var(--ids-space-4);
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-list-panel {
  flex: 0 0 58%;
  max-width: 58%;
  height: 100%;
  overflow-y: auto;
  padding-right: 2px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-panel {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: var(--color-white);
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-lg);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-panel-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-workspace-backdrop {
  display: none;
}

@media (max-width: 1440px) {:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-list-panel {
    flex: 1 1 100%;
    max-width: 100%;
  }:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 92%;
    max-width: 560px;
    height: 100%;
    border-radius: 0;
    box-shadow: -8px 0 24px rgba(18, 43, 68, 0.16);
    z-index: 60;
  }:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-panel.has-selection {
    display: flex;
  }:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-workspace-backdrop.visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(18, 43, 68, 0.35);
    z-index: 55;
  }
}/* ---- Left: Issue Card List (V1.1 section 四: 精簡五列版型 — card height
   reduced ≥15% vs V1 via tighter padding/gap/font-size, while keeping each
   row scannable rather than collapsing into a dense table). ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-card-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--color-white);
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-lg);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-card:hover {
  border-color: var(--color-teal);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-card.active {
  border-color: var(--color-teal);
  box-shadow: 0 0 0 2px rgba(18, 137, 122, 0.15);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-card-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-card-no {
  font-size: var(--ids-font-md);
  font-weight: 700;
  color: var(--color-navy);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-card-row2 {
  font-size: var(--ids-font-xs);
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-card-row3 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-card-reason-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ids-surface-muted);
  color: var(--color-text-muted);
  font-size: 11px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-card-row4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: var(--ids-font-xs);
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-card-amount {
  font-size: var(--ids-font-sm);
  font-weight: 700;
  color: var(--color-navy);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-card-row5 {
  font-size: 11px;
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
  padding-top: 4px;
  border-top: 1px solid var(--ids-border-soft);
}/* ---- Right: Workspace header / tabs (section 八) ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-header {
  padding: var(--ids-space-4) var(--ids-space-5) var(--ids-space-3);
  flex-shrink: 0;
  border-bottom: 1px solid var(--ids-border-soft);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ids-space-3);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-header-identity {
  display: flex;
  align-items: flex-start;
  gap: var(--ids-space-2);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-title {
  font-size: var(--ids-font-lg);
  font-weight: 700;
  color: var(--color-navy);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-status-row {
  margin-top: 4px;
  font-size: var(--ids-font-sm);
  color: var(--color-text);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-header-actions {
  display: flex;
  align-items: center;
  gap: var(--ids-space-2);
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-header-meta {
  display: flex;
  flex-wrap: wrap;
  row-gap: 6px;
  column-gap: var(--ids-space-4);
  margin-top: var(--ids-space-3);
  font-size: var(--ids-font-xs);
  color: var(--color-text);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-header-meta span {
  flex: 0 1 auto;
  min-width: 110px;
  white-space: nowrap;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-meta-label {
  color: var(--color-text-muted);
  margin-right: 4px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-header-actions button, :is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-footer button {
  white-space: nowrap;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-tabs {
  flex-shrink: 0;
  padding: 0 var(--ids-space-4);
  overflow-x: auto;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: var(--ids-space-4) var(--ids-space-5);
  display: flex;
  flex-direction: column;
  gap: var(--ids-space-4);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-ws-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ids-space-3);
  padding: var(--ids-space-3) var(--ids-space-5);
  border-top: 1px solid var(--ids-border-soft);
  box-shadow: 0 -4px 12px rgba(18, 43, 68, 0.04);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-treatment-fields {
  margin-top: var(--ids-space-3);
  padding-top: var(--ids-space-3);
  border-top: 1px dashed var(--ids-border-soft);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-urgent-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ids-font-sm);
  height: 34px;
}/* ---- 領料摘要 (section 九) ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-summary-blocks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ids-space-5);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-summary-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-summary-label {
  font-size: 11px;
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-summary-value {
  font-size: var(--ids-font-lg);
  font-weight: 700;
  color: var(--color-navy);
}/* ---- 領料品項 Card + 三種扣庫模式 (section 十) ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-card-list {
  display: flex;
  flex-direction: column;
  gap: var(--ids-space-4);
  margin-top: var(--ids-space-3);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-card {
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-md);
  padding: var(--ids-space-4);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ids-space-3);
  margin-bottom: var(--ids-space-3);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-card-name-row {
  display: flex;
  align-items: center;
  gap: var(--ids-space-2);
  flex-wrap: wrap;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-card-name {
  font-size: var(--ids-font-sm);
  font-weight: 700;
  color: var(--color-text);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-card-code {
  font-size: var(--ids-font-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-card-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ids-space-5);
  margin-bottom: var(--ids-space-3);
  padding-bottom: var(--ids-space-3);
  border-bottom: 1px dashed var(--ids-border-soft);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-stat-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-stat-value {
  font-size: var(--ids-font-lg);
  font-weight: 700;
  color: var(--color-text);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-stat-value input {
  width: 90px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-sm);
  font-size: var(--ids-font-sm);
  box-sizing: border-box;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
}/* ---- ACTUAL_QTY 批號明細 ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-batch-section-title {
  font-size: var(--ids-font-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--ids-space-2);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-batch-entries {
  display: flex;
  flex-direction: column;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-batch-entry {
  padding: var(--ids-space-2) 0;
  border-bottom: 1px solid var(--ids-border-soft);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-batch-entry:last-child {
  border-bottom: none;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-batch-row1 {
  display: flex;
  align-items: center;
  gap: var(--ids-space-3);
  margin-bottom: 6px;
  flex-wrap: wrap;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-batch-lot {
  font-size: var(--ids-font-sm);
  font-weight: 600;
  color: var(--color-text);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-batch-exp, :is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-batch-available {
  font-size: var(--ids-font-xs);
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-batch-row2 {
  display: flex;
  align-items: flex-end;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-batch-mini-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-batch-mini-field label {
  font-size: 11px;
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-batch-field {
  width: 110px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-sm);
  font-size: var(--ids-font-sm);
  box-sizing: border-box;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-plain-qty-row {
  display: flex;
  align-items: center;
  gap: var(--ids-space-2);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-plain-qty-row label {
  font-size: var(--ids-font-xs);
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-plain-qty-field {
  width: 100px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-sm);
  font-size: var(--ids-font-sm);
  box-sizing: border-box;
}/* ---- OPEN_PACKAGE ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-open-package-banner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--ids-space-2) var(--ids-space-3);
  margin-bottom: var(--ids-space-3);
  background: #f1eafb;
  color: #6b3fa0;
  border-radius: var(--ids-radius-sm);
  font-size: var(--ids-font-xs);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-open-batch-row {
  display: flex;
  align-items: center;
  gap: var(--ids-space-2);
  margin-top: var(--ids-space-2);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-open-batch-row label {
  font-size: var(--ids-font-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-open-batch-field {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-sm);
  font-size: var(--ids-font-sm);
}/* ---- DAILY_SUMMARY (read-only within an issue) ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-note {
  font-size: var(--ids-font-xs);
  color: var(--color-text-muted);
}/* ---- 扣庫明細 Tab (section 十三) ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-deduction-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ids-space-4);
  padding: var(--ids-space-2) 0;
  border-bottom: 1px solid var(--ids-border-soft);
  font-size: var(--ids-font-sm);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-deduction-row:last-child {
  border-bottom: none;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-deduction-row span:first-child {
  font-weight: 600;
  color: var(--color-text);
  flex: 1 1 140px;
}/* ---- 附件 Tab (section 二十一) ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-attachment-list {
  display: flex;
  flex-direction: column;
  gap: var(--ids-space-2);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-attachment-row {
  display: flex;
  align-items: center;
  gap: var(--ids-space-2);
  padding: var(--ids-space-2) var(--ids-space-3);
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-sm);
  font-size: var(--ids-font-sm);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-attachment-name {
  font-weight: 600;
  color: var(--color-text);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-attachment-type {
  color: var(--color-text-muted);
  font-size: var(--ids-font-xs);
}/* ---- Text tone helpers ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-text-success { color: #0e6d61; }:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-text-warning { color: #8a5a00; }:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-text-danger { color: #b3382c; }:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-text-info { color: #1c5d8c; }/* ---- 新增領料品項 Modal (section 十一) ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog {
  width: min(980px, 94vw);
  max-height: 82vh;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog-body-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--ids-space-3);
  overflow: hidden;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog-search {
  position: relative;
  flex-shrink: 0;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog-search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-sm);
  font-size: var(--ids-font-sm);
  box-sizing: border-box;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog-search .supplier-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog-table {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-md);
  overflow: hidden;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog-row {
  display: grid;
  grid-template-columns: 28px 70px 1.3fr 90px 90px 70px 80px 90px 56px;
  gap: var(--ids-space-2);
  align-items: center;
  padding: var(--ids-space-2) var(--ids-space-3);
  font-size: var(--ids-font-xs);
  border-bottom: 1px solid var(--ids-border-soft);
  overflow: hidden;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog-row:last-child {
  border-bottom: none;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog-header-row {
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--ids-surface-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog-header-row .mi-item-dialog-cell {
  white-space: normal;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog-cell-name {
  font-weight: 600;
  color: var(--color-text);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog-row.is-added {
  background: var(--ids-surface-muted);
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-added-tag {
  font-size: 11px;
  color: #0e6d61;
  font-weight: 600;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-item-dialog-body {
  overflow-y: auto;
  max-height: 48vh;
}/* ---- 每日耗材盤點 Dialog (section 十二) ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-dialog {
  width: min(1080px, 96vw);
  max-height: 88vh;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-dialog-body {
  display: flex;
  flex-direction: column;
  gap: var(--ids-space-3);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-date-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ids-font-sm);
  color: var(--color-text);
  flex-shrink: 0;
}/* ---- V1.1 section 八: 只顯示每日耗材／顯示全部品項 view toggle ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-view-toggle {
  display: flex;
  gap: var(--ids-space-2);
  flex-shrink: 0;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-view-btn {
  padding: 6px 14px;
  border: 1px solid var(--ids-border-soft);
  border-radius: 999px;
  background: var(--color-white);
  color: var(--color-text-muted);
  font-size: var(--ids-font-xs);
  cursor: pointer;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-view-btn.active {
  background: var(--color-teal);
  border-color: var(--color-teal);
  color: var(--color-white);
  font-weight: 600;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-md);
  overflow: hidden;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-row {
  display: grid;
  grid-template-columns: 32px 1.3fr 100px 110px 80px 100px 90px;
  gap: var(--ids-space-2);
  align-items: center;
  padding: var(--ids-space-2) var(--ids-space-3);
  font-size: var(--ids-font-xs);
  border-bottom: 1px solid var(--ids-border-soft);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-row:last-child {
  border-bottom: none;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-header-row {
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--ids-surface-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-cell-name {
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-info-icon {
  display: inline-flex;
  margin-left: 4px;
  color: var(--color-text-muted);
  cursor: help;
  vertical-align: middle;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-info-icon .inv-icon {
  width: 13px;
  height: 13px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-unit {
  font-weight: 400;
  font-size: 11px;
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-closing-field {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-sm);
  font-size: var(--ids-font-sm);
  box-sizing: border-box;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-usage {
  font-weight: 700;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-row.is-error {
  background: #fdf1f0;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-row.is-warn {
  background: #fff8ec;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-error-tag {
  font-size: 11px;
  font-weight: 600;
  color: #b3382c;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-warn-tag {
  font-size: 11px;
  font-weight: 600;
  color: #8a5a00;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-row-reference {
  color: var(--color-text-muted);
  background: var(--ids-surface-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-reference-tag {
  font-size: 11px;
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-body {
  overflow-y: auto;
  max-height: 42vh;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-summary {
  display: flex;
  align-items: center;
  gap: 6px 10px;
  flex-wrap: wrap;
  padding: var(--ids-space-3);
  background: var(--ids-surface-muted);
  border-radius: var(--ids-radius-md);
  font-size: var(--ids-font-sm);
  color: var(--color-text-muted);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-daily-summary strong {
  color: var(--color-navy);
  font-size: var(--ids-font-md);
  margin-right: 4px;
}/* ---- 完成領料確認 Dialog (section 十九／V1.1 section 十一: 本次將建立
   異動預覽區，每項前方使用勾選 Icon；0 筆項目降低視覺權重而非隱藏). ---- */:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-complete-confirm-dialog {
  width: min(560px, 92vw);
  max-height: 86vh;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-will-create-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--ids-border-soft);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-will-create-row:last-child {
  border-bottom: none;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-will-create-check {
  display: flex;
  color: #0e6d61;
  flex-shrink: 0;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-will-create-check .inv-icon {
  width: 16px;
  height: 16px;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-will-create-label {
  flex: 1;
  font-size: var(--ids-font-sm);
  color: var(--color-text);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-will-create-value {
  font-size: var(--ids-font-sm);
  font-weight: 700;
  color: var(--color-navy);
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-will-create-row.is-zero {
  opacity: 0.55;
}:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-will-create-row.is-zero .mi-will-create-check {
  color: var(--color-text-muted);
}

/* ---- INVENTORY-PHASE3-UAT-FIX-PACK-002 §5: 新增領料單 Dialog 的商品搜尋 ----
   商品搜尋 → 加入明細 → 形成領料明細。Reuses the Purchase Return dialog's
   large-work-dialog shell (prt-source-dialog) rather than defining a second
   modal system. ---- */
:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-search-block {
  display: flex;
  flex-direction: column;
  gap: var(--ids-space-2);
}
:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-search-results {
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-md);
}
:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-search-result {
  display: flex;
  align-items: center;
  gap: var(--ids-space-3);
  padding: var(--ids-space-2) var(--ids-space-3);
  background: var(--color-white);
  border: none;
  border-bottom: 1px solid var(--ids-border-soft);
  cursor: pointer;
  text-align: left;
  font-size: var(--ids-font-sm);
}
:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-search-result:last-child { border-bottom: none; }
:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-search-result:hover { background: var(--ids-surface-muted); }
:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-search-result-name { font-weight: 600; color: var(--color-text); }
:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-search-result-code { color: var(--color-text-muted); }
:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-search-result-add {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-teal);
  font-weight: 600;
}
:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-lines-table { min-width: 780px; }
:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-lines-table input[type="number"],
:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-lines-table input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 34px;
  box-sizing: border-box;
  padding: 0 8px;
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-sm);
  font-size: var(--ids-font-sm);
}
:is(#inventoryHostRoot, #inventoryOverlayRoot) .mi-lines-table .prt-qty-stepper input[data-line-qty] {
  border: none;
  border-left: 1px solid var(--ids-border-soft);
  border-right: 1px solid var(--ids-border-soft);
  border-radius: 0;
  height: 32px;
}

/* §4 調撥／借出：調撥原因選項列與借出資訊區塊 */
:is(#inventoryHostRoot, #inventoryOverlayRoot) .inventory-transfer-reason-row {
  display: flex;
  align-items: center;
  gap: var(--ids-space-4);
  margin-bottom: var(--ids-space-3);
  flex-wrap: wrap;
}
:is(#inventoryHostRoot, #inventoryOverlayRoot) .inventory-transfer-reason-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--ids-font-sm);
  cursor: pointer;
}
:is(#inventoryHostRoot, #inventoryOverlayRoot) .inventory-transfer-borrow-block {
  margin-top: var(--ids-space-3);
  padding: var(--ids-space-3);
  background: var(--ids-surface-muted);
  border: 1px solid var(--ids-border-soft);
  border-radius: var(--ids-radius-md);
}

/* INVENTORY-ISSUE-ORDER-PICKER-FIX —— 目前可領庫存清單。沿用既有 inventory table 密度，
   不新增色彩或元件；清單本身可捲動，Modal Footer 仍固定。 */
.mi-stock-title{margin:12px 0 6px;font-size:13px;font-weight:700;color:#101828}
.mi-search-block .mi-search-results{max-height:280px;overflow-y:auto}
.mi-stock-table{width:100%}
.mi-stock-table th,.mi-stock-table td{padding:6px 8px;font-size:12.5px}
.mi-stock-table th.right,.mi-stock-table td.right{text-align:right}
.mi-stock-table .mi-stock-add{min-height:28px;padding:0 12px;font-size:12.5px}
.mi-stock-table .mi-stock-add:disabled{opacity:.5;cursor:not-allowed}

/* ISSUE-ORDER-PICKER-REFINEMENT-002 —— 目前庫存 toolbar：標題／0 庫存開關／搜尋同一列，
   表格緊接在下，搜尋不再獨佔上方大塊空間。0 庫存列以較低視覺權重呈現，不新增色彩系統。 */
.mi-stock-toolbar{display:flex;align-items:center;gap:12px;margin:14px 0 8px}
.mi-stock-toolbar .mi-stock-title{margin:0;flex:0 0 auto}
.mi-stock-zero-toggle{display:inline-flex;flex-direction:row;align-items:center;gap:6px;margin:0;font-size:12.5px;font-weight:600;color:#475467;white-space:nowrap}
.mi-stock-zero-toggle input{margin:0}
.mi-stock-search{flex:1 1 auto;min-width:0;margin:0}
.mi-stock-row-zero td{color:#98a2b3}
.mi-lines-table td.mi-line-stock{font-variant-numeric:tabular-nums;color:#475467}

/* INVENTORY-ISSUE-ALL-STOCK-UI-003 —— 領料明細上方的低權重說明（出庫倉庫由系統判定）。
   沿用既有 muted 文字樣式，不是 Card、不是提示框，不新增元件或色彩。 */
.mi-lines-hint{margin:14px 0 6px;font-size:12px;color:#98a2b3}
