/* Final98 Scheme 01 main-list layout. No permission or controller visibility grants. */
@layer plan01 {
  body.erp-plan01 [data-plan01-operations] { color: #172438; }
  body.erp-plan01 [data-plan01-operations] :is(.blacklake-page-title,.purchase-section-bar) { justify-content: space-between !important; align-items: center !important; gap: 20px !important; margin-bottom: 14px !important; }
  body.erp-plan01 [data-plan01-operations] :is(.blacklake-page-title,.purchase-section-bar) > div:first-child { min-width: 0; }
  body.erp-plan01 [data-plan01-operations] :is(.blacklake-page-title,.purchase-section-bar) p { color: #66768c !important; font-size: 14px !important; line-height: 1.5 !important; margin: 4px 0 0 !important; }
  body.erp-plan01 [data-plan01-operations] :is(.blacklake-tabbar,.purchase-status-navigation) { display: flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: 6px !important; min-height: 36px !important; margin: 0 0 14px !important; padding: 0 0 2px !important; max-width: 100%; overflow-x: auto !important; border: 0 !important; background: transparent !important; }
  body.erp-plan01 [data-plan01-operations] :is(.blacklake-tabbar,.purchase-status-navigation) > button { flex: none !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 6px !important; min-width: 97px !important; height: 36px !important; min-height: 36px !important; padding: 0 17px !important; border: 1px solid #e0e9f0 !important; border-radius: 5px !important; color: #172438 !important; background: #f8fbfd !important; font-size: 13px !important; font-weight: 600 !important; }
  body.erp-plan01 [data-plan01-operations] :is(.blacklake-tabbar,.purchase-status-navigation) > button.active { background: #008575 !important; color: #fff !important; border-color: #008575 !important; }
  body.erp-plan01 [data-plan01-operations] :is(.blacklake-tabbar,.purchase-status-navigation) :is(span,small) { color: inherit !important; background: transparent !important; margin: 0 !important; padding: 0 !important; font-size: inherit !important; min-width: 0 !important; }
  body.erp-plan01 [data-plan01-operations] :is(.blacklake-tabbar,.purchase-status-navigation) button::after { content: none !important; }
  body.erp-plan01 #workOrdersView[data-plan01-operations] > .blacklake-filterbar,
  body.erp-plan01 [data-plan01-operations] .plan01-operation-filters { display: flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: 10px !important; padding: 0 !important; margin: 0 0 15px !important; min-height: 40px !important; width: 100% !important; background: #fff !important; border: 0 !important; }
  body.erp-plan01 #workOrdersView[data-plan01-operations] > .blacklake-filterbar > label { flex: 0 1 160px !important; margin: 0 !important; min-width: 0 !important; }
  body.erp-plan01 #workOrdersView[data-plan01-operations] > .blacklake-filterbar > .plan01-operation-search { flex: 1 1 300px !important; max-width: 470px !important; }
  body.erp-plan01 #workOrdersView[data-plan01-operations] > .blacklake-filterbar > label > span { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%); white-space: nowrap; }
  body.erp-plan01 [data-plan01-operations] .blacklake-filter-actions { display: flex !important; flex: none !important; gap: 8px !important; margin: 0 !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-dates { position: relative; flex: none; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-dates > summary { height: 39px; padding: 9px 12px; border: 1px solid #cad8e5; border-radius: 5px; font-size: 13px; color: #40536a; cursor: pointer; white-space: nowrap; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-date-fields { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; width: 360px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; border: 1px solid #ccdae6; border-radius: 5px; background: #fff; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-date-fields label { min-width: 0 !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-date-fields label > span { display: block; margin-bottom: 7px; font-size: 12px; color: #66768c; }
  body.erp-plan01 #purchaseView[data-plan01-operations] .purchase-filter-search { flex: 1; min-width: 0; max-width: 470px; margin: 0; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-reset { height: 39px; border: 0; padding: 0 9px; background: transparent; color: #1879d2; font-size: 13px; }
  body.erp-plan01 #purchaseView[data-plan01-operations] #purchaseResultBar:empty { display: none !important; }
  body.erp-plan01 #purchaseView[data-plan01-operations] #purchaseResultBar:not(:empty) { display: flex !important; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; padding: 10px 12px; font-size: 12px; border: 1px solid #e0e9f0; border-radius: 5px; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-toolbar { display: flex !important; align-items: center !important; justify-content: space-between !important; flex-wrap: wrap; gap: 10px; min-height: 35px !important; padding: 0 !important; margin: 0 0 9px !important; color: #66768c !important; font-size: 12px !important; background: transparent !important; border: 0 !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-toolbar > div { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
  body.erp-plan01 [data-plan01-operations] .blacklake-toolbar-actions { gap: 8px !important; }
  body.erp-plan01 [data-plan01-operations] .blacklake-toolbar-actions button { min-height: 31px !important; padding: 5px 10px !important; border: 1px solid #ccdae6 !important; border-radius: 4px !important; font-size: 12px !important; background: #fff !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table-wrap { width: 100% !important; max-width: 100%; padding: 0 !important; margin: 0 !important; border: 1px solid #e0e9f0 !important; border-radius: 5px !important; overflow: auto !important; scrollbar-color: #9aabb9 #f4f8fa; scrollbar-width: thin; overscroll-behavior-x: contain; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table { display: table !important; min-width: 1100px !important; width: 100% !important; table-layout: fixed !important; font-size: 13px !important; line-height: 1.45 !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table :is(th,td) { position: static !important; left: auto !important; right: auto !important; padding: 10px 12px !important; line-height: 1.45 !important; border: 1px solid #e0e9f0 !important; box-shadow: none !important; white-space: normal !important; overflow-wrap: anywhere; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table th { height: 43px !important; background: #f0f6f9 !important; color: #485b73 !important; font-size: 12px !important; font-weight: 650 !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table td { height: 54px !important; color: #172438 !important; vertical-align: middle !important; background: #fff !important; }
  /* Keep empty states visible despite legacy first-column hiding. */
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table tbody td[colspan] { display: table-cell !important; width: auto !important; text-align: center !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table tbody tr:first-child td { background: #f6fcfa !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table small { color: #66768c !important; font-size: 11px !important; line-height: 1.6 !important; white-space: normal !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table .simple-row-actions { display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 6px !important; min-width: 0 !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table .simple-row-actions > :is(button,details) { flex: none; }
  /* Restore the existing read-only detail control; never override explicit
     permission hiding, inline display decisions or the original disabled state. */
  body.erp-plan01 #workOrdersView[data-plan01-operations] .blacklake-operation-cell button[data-action="openWorkOrderDetail"]:not([hidden]):not([aria-hidden="true"]):not([style*="display" i]) { display: inline-flex !important; align-items: center; justify-content: center; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table .row-more-actions > div { position: static !important; min-width: 0 !important; border: 0 !important; box-shadow: none !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table .row-more-actions[open] { flex-basis: 100%; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table .row-more-actions summary { padding: 5px; font-size: 12px; color: #1879d2; cursor: pointer; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table :is(.blacklake-link,[data-action="openPurchaseDetail"]):not(.primary-row-action) { display: inline; min-height: 0 !important; padding: 0 !important; background: transparent !important; color: #1879d2 !important; border: 0 !important; text-align: left; white-space: normal; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table :is(.status,.blacklake-table-status) { display: inline-block !important; padding: 3px 8px !important; border-radius: 4px !important; font-size: 11px !important; line-height: 1.5 !important; white-space: nowrap !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table :is(.status.work,.is-running) { background: #e8f2ff !important; color: #276aac !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table :is(.status.warn,.is-wait,.is-quality) { background: #fff2dc !important; color: #a9600b !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-table :is(.status.done,.is-done) { background: #e0faf1 !important; color: #087f62 !important; }
  body.erp-plan01 #purchaseView[data-plan01-operations] #purchaseCards { display: block !important; width: 100%; margin: 0 !important; }
  body.erp-plan01 #purchaseView[data-plan01-operations] [data-plan01-column="status"] { width: 11% !important; }
  body.erp-plan01 #purchaseView[data-plan01-operations] [data-plan01-column="document"] { width: 16% !important; }
  body.erp-plan01 #purchaseView[data-plan01-operations] [data-plan01-column="supplier"] { width: 15% !important; }
  body.erp-plan01 #purchaseView[data-plan01-operations] [data-plan01-column="quantity"] { width: 23% !important; }
  body.erp-plan01 #purchaseView[data-plan01-operations] [data-plan01-column="arrival"] { width: 12% !important; }
  body.erp-plan01 #purchaseView[data-plan01-operations] [data-plan01-column="receipt"] { width: 10% !important; }
  body.erp-plan01 #purchaseView[data-plan01-operations] [data-plan01-column="actions"] { width: 13% !important; }
  body.erp-plan01 #workOrdersView[data-plan01-operations].blacklake-comfortable-rows .plan01-operation-table td { height: 72px !important; padding-block: 16px !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-pagination { display: flex !important; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 17px; padding: 0 !important; border: 0 !important; background: transparent !important; color: #66768c; font-size: 12px; }
  body.erp-plan01 [data-plan01-operations] .workorder-page-actions { margin-left: auto; }
  body.erp-plan01 [data-plan01-operations] .blacklake-status-strip { padding: 12px 0 !important; margin-top: 20px !important; border-top: 1px solid #e0e9f0 !important; background: transparent !important; }
  body.erp-plan01 [data-plan01-operations] .plan01-operation-scroll-note { display: none; margin: 0 0 9px; font-size: 12px; color: #66768c; }
  @media (max-width: 1100px) {
    body.erp-plan01 #workOrdersView[data-plan01-operations] > .blacklake-filterbar { flex-wrap: wrap !important; }
    body.erp-plan01 [data-plan01-operations] .plan01-operation-scroll-note { display: block; }
    /* Both lists use one horizontally scrollable table, not the legacy card grid. */
    body.erp-plan01 [data-plan01-operations] .plan01-operation-table thead { display: table-header-group !important; position: static !important; width: auto !important; height: auto !important; clip-path: none !important; overflow: visible !important; }
    body.erp-plan01 [data-plan01-operations] .plan01-operation-table tbody { display: table-row-group !important; width: auto !important; }
    body.erp-plan01 [data-plan01-operations] .plan01-operation-table tr { display: table-row !important; padding: 0 !important; }
    body.erp-plan01 [data-plan01-operations] .plan01-operation-table :is(th,td) { display: table-cell !important; }
    body.erp-plan01 [data-plan01-operations] .plan01-operation-table td::before { display: none !important; content: none !important; }
    body.erp-plan01 #workOrdersView[data-plan01-operations] .plan01-operation-table :is(th,td):is(:nth-child(1),:nth-child(7)):not([colspan]) { display: none !important; }
  }
  @media (max-width: 600px) {
    body.erp-plan01 [data-plan01-operations] :is(.blacklake-page-title,.purchase-section-bar) { flex-direction: column !important; align-items: stretch !important; }
    body.erp-plan01 [data-plan01-operations] :is(.plan01-heading-actions,.section-create-button) { margin-left: 0 !important; align-self: flex-start; flex-wrap: wrap; }
    body.erp-plan01 #workOrdersView[data-plan01-operations] > .blacklake-filterbar > .plan01-operation-search { flex-basis: 100% !important; max-width: none !important; }
    body.erp-plan01 #workOrdersView[data-plan01-operations] > .blacklake-filterbar > .plan01-operation-select { flex: 1 1 40% !important; }
    body.erp-plan01 [data-plan01-operations] .plan01-operation-date-fields { position: fixed; top: 140px; left: 16px; right: 16px; width: auto; }
    body.erp-plan01 [data-plan01-operations] .workorder-page-actions { margin-left: 0; flex-wrap: wrap; }
    body.erp-plan01 [data-plan01-operations] .plan01-operation-permission-note { display: none; }
    body.erp-plan01 [data-plan01-operations] :is(button,input,select,summary) { min-height: 44px !important; }
    body.erp-plan01 [data-plan01-operations] :is(.blacklake-tabbar,.purchase-status-navigation) > button { height: 44px !important; }
    body.erp-plan01 [data-plan01-operations] .plan01-operation-table button:not(.blacklake-link),
    body.erp-plan01 [data-plan01-operations] .plan01-operation-table .row-more-actions summary { min-width: 44px !important; }
    body.erp-plan01 [data-plan01-operations] .blacklake-page-title > div:first-child { max-width: none !important; width: 100% !important; }
  }
}

/* 019: only these renderer-marked main tables. No dialog/subpage overrides. */
@layer plan01 {
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] {
    min-width: 1180px !important;
    font-variant-numeric: tabular-nums;
  }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] :is(th,td)[data-plan01-column]:not([hidden]):not([aria-hidden="true"]):not([style*="display" i]) {
    display: table-cell !important;
    width: var(--plan01-operation-column-width, auto) !important;
    text-align: left !important;
    padding: var(--plan01-operation-cell-block, 8px) 10px !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] td {
    height: 54px !important;
    vertical-align: top !important;
  }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] :is(strong,small,span,button) {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] td :is(strong,small) {
    display: block;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] [data-plan01-column="status"] { --plan01-operation-column-width: 8%; }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] [data-plan01-column="document"] { --plan01-operation-column-width: 17%; }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] [data-plan01-column="product"] { --plan01-operation-column-width: 16%; }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] [data-plan01-column="actions"] { --plan01-operation-column-width: 12%; }
  body.erp-plan01 #workOrdersView table[data-plan01-grid="production-019"] [data-plan01-column="customer"] { --plan01-operation-column-width: 10%; }
  body.erp-plan01 #workOrdersView table[data-plan01-grid="production-019"] [data-plan01-column="quantity"] { --plan01-operation-column-width: 12%; }
  body.erp-plan01 #workOrdersView table[data-plan01-grid="production-019"] [data-plan01-column="process"] { --plan01-operation-column-width: 11%; }
  body.erp-plan01 #workOrdersView table[data-plan01-grid="production-019"] [data-plan01-column="arrival"] { --plan01-operation-column-width: 14%; }
  body.erp-plan01 #purchaseView table[data-plan01-grid="purchase-019"] [data-plan01-column="supplier"] { --plan01-operation-column-width: 12%; }
  body.erp-plan01 #purchaseView table[data-plan01-grid="purchase-019"] [data-plan01-column="amount"] { --plan01-operation-column-width: 9%; }
  body.erp-plan01 #purchaseView table[data-plan01-grid="purchase-019"] [data-plan01-column="arrival"] { --plan01-operation-column-width: 13%; }
  body.erp-plan01 #purchaseView table[data-plan01-grid="purchase-019"] [data-plan01-column="payment"] { --plan01-operation-column-width: 13%; }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] .plan01-row-secondary {
    margin-top: 2px;
    font-size: 11px;
    color: #66768c;
  }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] .plan01-row-secondary > summary {
    min-height: 22px;
    padding: 2px 0;
    color: #40536a;
    cursor: pointer;
    width: fit-content;
    max-width: 100%;
  }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] .plan01-row-secondary[open] {
    padding-bottom: 4px;
  }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] .plan01-row-secondary > :not(summary) {
    overflow-wrap: anywhere;
    white-space: normal;
  }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] .plan01-field-unavailable {
    color: #66768c;
    font-size: 12px;
  }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] .plan01-quantity-progress {
    display: block;
    appearance: none;
    width: 100%;
    height: 5px;
    margin: 6px 0 4px;
    border: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #e0e9f0;
    accent-color: #008575;
  }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] .plan01-quantity-progress::-webkit-progress-bar { background: #e0e9f0; border-radius: 4px; }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] .plan01-quantity-progress::-webkit-progress-value { background: #008575; border-radius: 4px; }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] .plan01-quantity-progress::-moz-progress-bar { background: #008575; border-radius: 4px; }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] .plan01-date-compact { white-space: nowrap; }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] .plan01-date-original { word-break: break-all; }
  body.erp-plan01 #workOrdersView[data-plan01-structure019] .plan01-operation-summary { position: relative; }
  body.erp-plan01 #workOrdersView[data-plan01-structure019] .plan01-operation-summary > summary { cursor: pointer; min-height: 28px; padding: 4px 0; color: #40536a; }
  body.erp-plan01 #workOrdersView[data-plan01-structure019] .plan01-operation-summary .blacklake-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 0 !important;
    padding: 8px 0 !important;
    border: 0 !important;
  }
  body.erp-plan01 #workOrdersView[data-plan01-structure019] .plan01-operation-footer,
  body.erp-plan01 #purchaseView[data-plan01-operations] > .plan01-purchase-footer {
    margin-top: 16px;
    padding: 0 !important;
    color: #66768c;
    font-size: 12px;
    line-height: 1.5;
  }
  body.erp-plan01 #workOrdersView[data-plan01-structure019] .workorder-page-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] :is(summary,button):focus-visible,
  body.erp-plan01 #workOrdersView[data-plan01-structure019] .plan01-operation-summary > summary:focus-visible {
    outline: 2px solid #008575;
    outline-offset: 3px;
  }
  body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] ::selection { background: #d0f6eb; color: #172438; }
  body.erp-plan01 #workOrdersView[data-plan01-operations].blacklake-comfortable-rows table[data-plan01-grid="production-019"] { --plan01-operation-cell-block: 16px; }
  @media (max-width: 600px) {
    body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] .plan01-row-secondary > summary { min-height: 44px !important; display: flex; align-items: center; }
    body.erp-plan01 #workOrdersView[data-plan01-structure019] .workorder-page-actions { width: 100%; margin-left: 0; }
    body.erp-plan01 #workOrdersView[data-plan01-structure019] .plan01-operation-page-size { flex-basis: 100%; }
  }
}

/* 286: keep existing permitted row actions reachable on compact desktops.
   No display/visibility/disabled/permission rules are overridden. */
@layer plan01 {
  @media (min-width: 900px) {
    body.erp-plan01 :is(#workOrdersView,#purchaseView)[data-plan01-operations] table[data-plan01-grid] :is(th,td)[data-plan01-column="actions"] {
      position: sticky !important; right: 0 !important; left: auto !important;
      z-index: 2; border-left: 1px solid #ccdae6 !important;
    }
  }
}
