/* Only the three original inventory tools and their existing forms. Never
 * overrides a board's display/availability or the permission layer. */
@layer plan01 {
  /* These adapted subpages supply their own title. Keep the original heading
   * everywhere else, including the central opening workflow and no-adapter fallback. */
  body.erp-plan01 #inventoryView[data-active-board="transfer"]:has(> [data-inventory-board="transfer"][data-plan01-inventory-tool="transfer"]) > .section-bar,
  body.erp-plan01 #inventoryView[data-active-board="stocktake"]:has(> [data-inventory-board="stocktake"][data-plan01-inventory-tool="stocktake"]) > .section-bar,
  body.erp-plan01 #inventoryView[data-active-board="warehouses"]:has(> [data-inventory-board="warehouses"][data-plan01-inventory-tool="warehouses"]) > .section-bar { display: none !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] { min-width: 0 !important; margin: 20px 0 0 !important; padding: 20px 0 0 !important; border: 0 !important; border-top: 1px solid #e0e9f0 !important; border-radius: 0 !important; box-shadow: none !important; background: #fff !important; color: #172438 !important; font-variant-numeric: tabular-nums; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] > .panel-header { align-items: center !important; flex-wrap: wrap !important; gap: 16px !important; padding: 0 !important; margin: 0 0 20px !important; background: none !important; border: 0 !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] > .panel-header > div { min-width: 0; flex: 1 1 260px; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] > .panel-header h2 { margin: 0 0 5px !important; color: #172438 !important; font-size: 29px !important; font-weight: 740 !important; line-height: 1.28 !important; letter-spacing: -.5px; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] > .panel-header span { color: #66768c !important; font-size: 14px !important; line-height: 1.6 !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] :is(button,input,select) { min-height: 39px !important; height: auto !important; border-radius: 5px !important; box-shadow: none !important; font-size: 13px !important; line-height: 1.5 !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] button { padding: 8px 14px !important; color: #172438 !important; border: 1px solid #ccdae6 !important; background: #fff !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] button.primary-button { background: #008575 !important; border-color: #008575 !important; color: #fff !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .danger-text-button { color: #c83b36 !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-controls { min-width: 0; margin: 0 0 16px; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-tabs { display: flex; gap: 8px; max-width: 100%; overflow-x: auto; margin-bottom: 14px; padding: 0 0 2px; scrollbar-width: thin; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-tabs button { flex: 0 0 auto; min-width: 96px; background: #f4f8fa !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-tabs button[aria-pressed="true"] { color: #fff !important; border-color: #008575 !important; background: #008575 !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-filters input { min-width: 0 !important; margin: 0 !important; padding: 8px 12px !important; border: 1px solid #cad8e5 !important; background: #fff !important; color: #40536a !important; box-sizing: border-box !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-search { flex: 2 1 300px; width: auto !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-date { display: grid; gap: 5px; flex: 1 1 160px; min-width: 0; margin: 0; padding: 0; color: #66768c; font-size: 12px; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-date input { width: 100% !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-filters > button { color: #1879d2 !important; border-color: transparent !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-scope { margin: 10px 0 0; color: #66768c; font-size: 12px; line-height: 1.6; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-scroll { width: 100% !important; min-width: 0 !important; max-width: 100% !important; margin: 0 !important; padding: 0 !important; overflow-x: auto !important; border: 1px solid #e0e9f0 !important; border-radius: 5px !important; scrollbar-color: #99afca #f4f8fa; scrollbar-width: thin; overscroll-behavior-x: contain; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] table { width: 100% !important; min-width: 1100px !important; table-layout: fixed !important; border-collapse: collapse !important; color: #172438 !important; font-size: 13px !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] thead { display: table-header-group !important; position: static !important; clip-path: none !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] tbody { display: table-row-group !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] tr:not([hidden]):not([aria-hidden="true"]):not([style*="display" i]) { display: table-row !important; padding: 0 !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] :is(th,td):not([hidden]):not([aria-hidden="true"]):not([style*="display" i]) { display: table-cell !important; position: static !important; padding: 10px 12px !important; border: 1px solid #e0e9f0 !important; line-height: 1.45 !important; white-space: normal !important; overflow-wrap: anywhere; vertical-align: middle !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] th { height: 43px !important; color: #485b73 !important; background: #f0f6f9 !important; font-size: 12px !important; font-weight: 650 !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] td { height: 54px !important; color: #172438 !important; background: #fff !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] td::before { display: none !important; content: none !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] :is(th,td):first-child { width: 15% !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] :is(th,td):last-child { width: 17% !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .table-actions { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] td[colspan] { width: auto !important; padding: 28px 16px !important; text-align: center !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-empty { margin: 0; padding: 24px 16px; color: #66768c; text-align: center; border-bottom: 1px solid #e0e9f0; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 16px; color: #66768c; font-size: 12px; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-count { margin-right: auto; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-pagination :is(input,select,button) { width: auto !important; min-width: 0 !important; min-height: 32px !important; height: 32px !important; margin: 0 !important; padding: 0 10px !important; font-size: 12px !important; color: #172438 !important; border: 1px solid #ccdae6 !important; background: #fff !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-current { border: 1px solid #008575; border-radius: 5px; min-height: 32px; padding: 6px 10px; color: #008575; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-jump { display: flex !important; align-items: center; flex-wrap: nowrap !important; gap: 8px !important; width: auto !important; margin: 0 !important; padding: 0 !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-jump input { max-width: 64px !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] :is(button,input,select,[tabindex]):focus-visible { outline: 2px solid #008575 !important; outline-offset: 3px; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] button:disabled { opacity: .5; cursor: not-allowed; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] button:not(:disabled):hover { border-color: #008575 !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] ::selection { color: #172438; background: #d0f6eb; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] input::placeholder { color: #66768c; opacity: 1; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] #warehouseGrid:not([hidden]):not([aria-hidden="true"]):not([style*="display" i]) { display: block !important; min-width: 1220px !important; width: 100% !important; margin: 0 !important; padding: 0 !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] :is(.warehouse-card:not([hidden]):not([aria-hidden="true"]):not([style*="display" i]),.plan01-inventory-tools-warehouse-head) { display: grid !important; grid-template-columns: 1.5fr 1.3fr 1fr .85fr .95fr .8fr 1fr .7fr 1.2fr !important; gap: 0 !important; min-width: 1220px !important; border: 0 !important; border-bottom: 1px solid #e0e9f0 !important; border-radius: 0 !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; background: #fff !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-warehouse-head { color: #485b73; background: #f0f6f9 !important; font-size: 12px; font-weight: 650; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-warehouse-head > span { padding: 13px 12px; border-right: 1px solid #e0e9f0; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card > .warehouse-card-heading { display: contents !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card :is(.warehouse-card-heading > h3,.warehouse-card-heading > .status),
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card > :is(.status,.stock-line,.card-actions) { grid-row: 1; min-width: 0; align-self: center; margin: 0 !important; padding: 12px !important; border: 0 !important; font-size: 13px !important; line-height: 1.5 !important; overflow-wrap: anywhere; box-shadow: none !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card .warehouse-card-heading > h3 { grid-column: 1; color: #172438 !important; font-weight: 650 !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card .warehouse-card-heading > .status { grid-column: 8; margin: 10px 8px !important; padding: 3px 8px !important; justify-self: start; border-radius: 4px !important; font-size: 11px !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card > .status { grid-column: 2; background: none !important; color: #40536a !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card > .stock-line:not([hidden]):not([aria-hidden="true"]):not([style*="display" i]) { display: block !important; color: #172438 !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card > .stock-line:nth-of-type(2) { grid-column: 3; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card > .stock-line:nth-of-type(3) { grid-column: 4; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card > .stock-line:nth-of-type(4) { grid-column: 5; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card > .stock-line:nth-of-type(5) { grid-column: 6; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card > .stock-line:nth-of-type(6) { grid-column: 7; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card > .stock-line > span { display: block; color: #66768c !important; font-size: 11px !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card > .stock-line > strong { color: #172438 !important; font-size: 13px !important; font-weight: 400 !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .warehouse-card > .card-actions { grid-column: 9; display: flex !important; flex-wrap: wrap; gap: 6px; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] #warehouseGrid > .empty { padding: 28px 16px !important; color: #66768c !important; }
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] :is(#warehouseTransfersTable,#inventoryStocktakesTable,#warehouseGrid) > .plan01-inventory-tools-row-hidden { display: none !important; }
  /* Source rows marked inaccessible must remain visually excluded too. The
   * decorative warehouse header has aria-hidden and is deliberately not here. */
  body.erp-plan01 #inventoryView [data-plan01-inventory-tool] :is(#warehouseTransfersTable,#inventoryStocktakesTable,#warehouseGrid) > [aria-hidden="true"] { display: none !important; }

  body.erp-plan01 :is(#warehouseTransferDialog,#inventoryStocktakeDialog,#warehouseDialog)[data-plan01-inventory-tool-form] { inset: 134px 0 0 232px !important; width: calc(100vw - 232px) !important; max-width: none !important; height: calc(100dvh - 134px) !important; max-height: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: #fff !important; box-shadow: none !important; overflow: hidden !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form]::backdrop { background: transparent !important; backdrop-filter: none !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] > .dialog-card { display: block !important; box-sizing: border-box !important; width: 100% !important; height: 100% !important; max-width: none !important; max-height: 100% !important; margin: 0 !important; padding: 22px 28px !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; overflow: auto !important; background: #fff !important; color: #172438 !important; font: 14px/1.5 'PingFang SC','Microsoft YaHei',Arial,sans-serif !important; scrollbar-color: #99afca #f4f8fa; scrollbar-width: thin; }
  body.erp-plan01 [data-plan01-inventory-tool-form] .dialog-header { display: flex !important; flex-wrap: nowrap !important; align-items: flex-start !important; justify-content: space-between !important; gap: 16px !important; margin: 0 0 24px !important; padding: 0 !important; border: 0 !important; background: none !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] .dialog-header > div { flex: 1 1 0; min-width: 0; }
  body.erp-plan01 [data-plan01-inventory-tool-form] h2 { margin: 0 !important; color: #172438 !important; font-size: 29px !important; font-weight: 740 !important; line-height: 1.28 !important; letter-spacing: -.5px; overflow-wrap: anywhere; }
  body.erp-plan01 [data-plan01-inventory-tool-form] :is(.dialog-subtitle,.dialog-header small) { display: block; margin: 6px 0 0 !important; color: #66768c !important; font-size: 13px !important; line-height: 1.6 !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] .simple-flow-banner { display: flex !important; flex-wrap: wrap; gap: 10px !important; padding: 14px 16px !important; margin: 0 0 20px !important; color: #485b73 !important; background: #f4f8fa !important; border: 1px solid #e0e9f0 !important; border-radius: 5px !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] .form-grid { display: grid !important; grid-template-columns: repeat(3,minmax(0,1fr)) !important; gap: 15px 24px !important; margin: 0 !important; padding: 0 !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] label { display: grid !important; gap: 7px !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important; color: #40536a !important; font-size: 13px !important; line-height: 1.5 !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] > form > label { margin-top: 20px !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] .form-span-2 { grid-column: span 2 !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] .plan01-inventory-tools-wide { grid-column: 1 / -1 !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] :is(input:not([type="hidden"]),select,textarea) { box-sizing: border-box !important; width: 100% !important; min-width: 0 !important; min-height: 39px !important; height: auto !important; margin: 0 !important; padding: 9px 12px !important; color: #40536a !important; border: 1px solid #cad8e5 !important; border-radius: 4px !important; background: #fff !important; box-shadow: none !important; font: 13px/1.5 'PingFang SC','Microsoft YaHei',Arial,sans-serif !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] :is(input[readonly],input:disabled,select:disabled) { color: #66768c !important; background: #f6f9fb !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] textarea { min-height: 88px !important; resize: vertical; }
  body.erp-plan01 [data-plan01-inventory-tool-form] :is(input,textarea)::placeholder { color: #66768c; opacity: 1; }
  body.erp-plan01 [data-plan01-inventory-tool-form] button { min-height: 39px !important; height: auto !important; padding: 8px 16px !important; border: 1px solid #ccdae6 !important; border-radius: 5px !important; background: #fff !important; color: #172438 !important; box-shadow: none !important; font-size: 13px !important; line-height: 1.5 !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] button.primary-button { color: #fff !important; background: #008575 !important; border-color: #008575 !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] .icon-button { flex: 0 0 auto; width: 39px !important; min-width: 39px !important; padding: 6px !important; font-size: 20px !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] .dialog-actions { display: flex !important; flex-wrap: wrap !important; gap: 10px !important; justify-content: flex-end !important; margin: 24px 0 0 !important; padding: 16px 0 0 !important; border: 0 !important; border-top: 1px solid #e0e9f0 !important; background: #fff !important; box-shadow: none !important; }
  body.erp-plan01 [data-plan01-inventory-tool-form] :is(button,input,select,textarea):focus-visible { outline: 2px solid #008575 !important; outline-offset: 3px; }
  body.erp-plan01 [data-plan01-inventory-tool-form] button:disabled { opacity: .5; cursor: not-allowed; }
  body.erp-plan01 [data-plan01-inventory-tool-form] ::selection { color: #172438; background: #d0f6eb; }
  @media (max-width: 980px) {
    body.erp-plan01 :is(#warehouseTransferDialog,#inventoryStocktakeDialog,#warehouseDialog)[data-plan01-inventory-tool-form] { inset: 0 !important; width: 100vw !important; height: 100dvh !important; }
  }
  @media (max-width: 600px) {
    body.erp-plan01 #inventoryView [data-plan01-inventory-tool] > .panel-header { align-items: flex-start !important; }
    body.erp-plan01 #inventoryView [data-plan01-inventory-tool] > .panel-header > div { flex: 0 1 auto; }
    body.erp-plan01 #inventoryView [data-plan01-inventory-tool] > .panel-header h2,
    body.erp-plan01 [data-plan01-inventory-tool-form] h2 { font-size: 25px !important; }
    body.erp-plan01 #inventoryView [data-plan01-inventory-tool] :is(button,input,select),
    body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-pagination :is(button,input,select),
    body.erp-plan01 :is(#warehouseTransferDialog,#inventoryStocktakeDialog,#warehouseDialog)[data-plan01-inventory-tool-form] :is(button,input:not([type="hidden"]),select,textarea) { min-height: 44px !important; height: auto !important; }
    body.erp-plan01 #inventoryView [data-plan01-inventory-tool] :is(input,select),
    body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-pagination :is(input,select),
    body.erp-plan01 :is(#warehouseTransferDialog,#inventoryStocktakeDialog,#warehouseDialog)[data-plan01-inventory-tool-form] :is(input:not([type="hidden"]),select,textarea) { font-size: 16px !important; }
    body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-search { flex-basis: 100%; }
    body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-date { flex-basis: calc(50% - 5px); }
    body.erp-plan01 #inventoryView [data-plan01-inventory-tool] .plan01-inventory-tools-count { flex-basis: 100%; }
    body.erp-plan01 [data-plan01-inventory-tool-form] > .dialog-card { padding: 16px !important; }
    body.erp-plan01 [data-plan01-inventory-tool-form] .form-grid { grid-template-columns: minmax(0,1fr) !important; gap: 16px !important; }
    body.erp-plan01 [data-plan01-inventory-tool-form] .form-span-2 { grid-column: 1 !important; }
    body.erp-plan01 [data-plan01-inventory-tool-form] .icon-button { min-width: 44px !important; width: 44px !important; }
    body.erp-plan01 [data-plan01-inventory-tool-form] .dialog-actions > button { flex: 1; }
  }
}
