/* Scheme 01 · 10-01 / 10-22 candidate. CSS only, not registered.
 * Original product cards, five-column route/BOM tables, section visibility,
 * eight visible and four hidden product fields remain the only authority.
 * The source is a product archive, not a combined product/material master.
 */
@layer plan01 {
  body.erp-plan01 #productsView {
    min-width: 0 !important;
    color: #172438 !important;
    background: #fff !important;
    font-variant-numeric: tabular-nums;
    & *, & *::before, & *::after { box-sizing: border-box; }
    & > .section-bar {
      display: flex !important;
      flex-direction: row !important;
      justify-content: space-between !important;
      text-align: left !important;
      gap: 12px 24px !important;
      align-items: center !important;
      flex-wrap: wrap;
      margin: 0 0 20px !important;
      padding: 0 !important;
      background: #fff !important;
    }
    & > .section-bar h2 { margin: 0 0 6px !important; font-size: 29px !important; line-height: 1.28 !important; }
    & > .section-bar p { margin: 0 !important; color: #5b6b80 !important; font-size: 14px !important; line-height: 1.5 !important; }
    & > .module-mini-nav {
      gap: 8px !important;
      margin: 0 0 16px !important;
      padding: 8px !important;
      border: 0 !important;
      border-radius: 5px !important;
      background: #edf4f7 !important;
      overflow-x: auto !important;
    }
    & > .module-mini-nav button {
      min-height: 39px !important;
      padding: 8px 20px !important;
      border: 1px solid transparent !important;
      border-radius: 5px !important;
      color: #172438 !important;
      background: transparent !important;
      font-size: 14px !important;
      font-weight: 600 !important;
      white-space: nowrap;
    }
    & > .module-mini-nav button.active { color: #fff !important; background: #008575 !important; border-color: #008575 !important; }
    & > .module-section {
      min-width: 0 !important;
      margin: 0 !important;
      padding: 0 !important;
      border: 1px solid #e0e9f0 !important;
      border-radius: 5px !important;
      background: #fff !important;
      box-shadow: none !important;
    }
    & > .module-section > .panel-header {
      min-height: 52px !important;
      margin: 0 !important;
      padding: 12px 16px !important;
      gap: 6px 16px !important;
      flex-wrap: wrap;
      border-bottom: 1px solid #e0e9f0 !important;
      background: #fff !important;
    }
    & > .module-section > .panel-header h2 { margin: 0 !important; font-size: 18px !important; line-height: 1.5 !important; }
    & > .module-section > .panel-header span { color: #5b6b80 !important; font-size: 12px !important; white-space: normal; }
    & #productCards { min-width: 0 !important; margin: 0 !important; padding: 0 !important; gap: 0 !important; }
    & #productCards > .module-card {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, .85fr) auto !important;
      grid-template-rows: auto auto;
      align-items: center;
      gap: 6px 20px !important;
      min-width: 0 !important;
      min-height: 0 !important;
      margin: 0 !important;
      padding: 16px !important;
      border: 0 !important;
      border-bottom: 1px solid #e0e9f0 !important;
      border-radius: 0 !important;
      background: #fff !important;
      box-shadow: none !important;
    }
    & #productCards > .module-card:last-child { border-bottom: 0 !important; }
    & #productCards > .module-card > * { min-width: 0; margin: 0 !important; overflow-wrap: anywhere; }
    & #productCards > .module-card > span { grid-column: 1 !important; grid-row: 1 !important; color: #5b6b80 !important; font-size: 12px !important; line-height: 1.5 !important; }
    & #productCards > .module-card > strong { grid-column: 1 !important; grid-row: 2 !important; color: #172438 !important; font-size: 16px !important; line-height: 1.5 !important; }
    & #productCards > .module-card > p { display: block !important; overflow: visible !important; -webkit-line-clamp: unset !important; color: #40536a !important; font-size: 13px !important; line-height: 1.5 !important; }
    & #productCards > .module-card > p:nth-of-type(1) { grid-column: 2 !important; grid-row: 1 !important; }
    & #productCards > .module-card > p:nth-of-type(2) { grid-column: 2 !important; grid-row: 2 !important; }
    & #productCards > .module-card > p:nth-of-type(3) { grid-column: 3 !important; grid-row: 1 !important; }
    & #productCards > .module-card > p:nth-of-type(4) { grid-column: 3 !important; grid-row: 2 !important; font-variant-numeric: tabular-nums; }
    & #productCards > .module-card > .card-actions { grid-column: 4 !important; grid-row: 1 / span 2 !important; display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 8px !important; }
    & #productCards .status { max-width: 100%; height: auto !important; white-space: normal !important; overflow-wrap: anywhere; border-radius: 4px !important; }
    & #productCards .small-button { min-height: 32px !important; padding: 5px 12px !important; border: 1px solid #ccdae6 !important; border-radius: 4px !important; background: #fff !important; color: #1879d2 !important; font-size: 12px !important; white-space: normal; }
    & #productCards .danger-text-button { color: #b93430 !important; }
    & .table-wrap { min-width: 0 !important; max-width: 100% !important; padding: 0 !important; overflow: auto !important; border: 0 !important; border-radius: 0 !important; }
    & .module-section table { min-width: 760px !important; width: 100% !important; table-layout: auto !important; border-collapse: collapse !important; }
    & .module-section :is(th, td) { padding: 12px 16px !important; border: 0 !important; border-bottom: 1px solid #e0e9f0 !important; border-right: 1px solid #edf2f6 !important; text-align: left !important; vertical-align: middle !important; white-space: normal !important; overflow-wrap: anywhere; }
    & .module-section th { height: 43px !important; background: #f0f6f9 !important; color: #485b73 !important; font-size: 12px !important; font-weight: 600 !important; }
    & .module-section td { height: 54px !important; color: #172438 !important; font-size: 13px !important; line-height: 1.5 !important; }
    & .module-section td small { color: #5b6b80 !important; }
    & .module-section tr:last-child td { border-bottom: 0 !important; }
    & .module-section td.empty { height: 120px !important; text-align: center !important; color: #5b6b80 !important; }
    & :is(button, .table-wrap):focus-visible { outline: 2px solid #008575 !important; outline-offset: 3px; }
    & ::selection { background: #d0f6eb; color: #172438; }
  }
  body.erp-plan01 #productDialog {
    box-sizing: border-box;
    width: calc(100vw - 32px) !important;
    max-width: 1180px !important;
    max-height: calc(100dvh - 32px) !important;
    padding: 0 !important;
    border: 1px solid #e0e9f0 !important;
    border-radius: 5px !important;
    background: #fff !important;
    color: #172438 !important;
    overflow: auto !important;
    & *, & *::before, & *::after { box-sizing: border-box; }
    & #productForm { width: 100% !important; max-width: none !important; height: auto !important; min-height: 0 !important; max-height: none !important; margin: 0 !important; padding: 24px 28px !important; border: 0 !important; border-radius: 0 !important; background: #fff !important; overflow: visible !important; box-shadow: none !important; }
    & .dialog-header { align-items: flex-start; gap: 16px !important; margin: 0 0 20px !important; padding: 0 0 16px !important; border-bottom: 1px solid #e0e9f0 !important; background: #fff !important; }
    & .dialog-header h2 { min-width: 0; margin: 0 !important; font-size: 29px !important; line-height: 1.28 !important; color: #172438 !important; overflow-wrap: anywhere; }
    & .icon-button { flex: 0 0 auto; min-width: 39px; min-height: 39px; border: 1px solid #ccdae6; border-radius: 5px; }
    & .form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 20px 24px !important; margin: 0 !important; padding: 20px !important; border: 1px solid #e0e9f0; border-radius: 5px; }
    & .form-grid > label { display: flex !important; flex-direction: column !important; align-items: stretch !important; justify-content: flex-start !important; justify-self: stretch !important; min-width: 0 !important; width: 100% !important; gap: 7px !important; margin: 0 !important; color: #172438 !important; font-size: 13px !important; font-weight: 550 !important; line-height: 1.5 !important; }
    & .product-route-field { grid-column: span 2; }
    & :is(input:not([type="hidden"]), select) { min-width: 0 !important; width: 100% !important; max-width: none !important; height: 39px !important; min-height: 39px !important; flex: 0 0 auto !important; align-self: stretch !important; padding: 8px 12px !important; border: 1px solid #cad8e5 !important; border-radius: 4px !important; font: inherit; font-weight: 400; color: #40536a !important; background: #fff !important; caret-color: #008575; }
    & :is(input, select):disabled { background: #f6f9fb !important; color: #5b6b80 !important; }
    & #productRouteHint { margin: 0 !important; max-width: none !important; font-size: 12px !important; line-height: 1.6 !important; white-space: normal !important; overflow-wrap: anywhere; }
    & #productRouteHint.is-warning { color: #a9600b !important; }
    & #productRouteHint.is-error { color: #c83b36 !important; }
    & #productRouteHint.is-ready { color: #087f62 !important; }
    & .dialog-actions { gap: 10px !important; margin: 20px 0 0 !important; padding: 16px 0 0 !important; border-top: 1px solid #e0e9f0 !important; background: #fff !important; flex-wrap: wrap; }
    & :is(button, input, select):focus-visible { outline: 2px solid #008575 !important; outline-offset: 3px; }
    & ::selection { background: #d0f6eb; color: #172438; }
  }
  @media (min-width: 981px) {
    body.erp-plan01 #productDialog.plan01-form-page { inset: 134px 0 0 232px !important; margin: 0 !important; width: calc(100vw - 232px) !important; max-width: none !important; height: calc(100dvh - 134px) !important; max-height: none !important; border: 0 !important; border-radius: 0 !important; }
  }
  @media (max-width: 1100px) {
    body.erp-plan01 #productsView #productCards > .module-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) !important; }
    body.erp-plan01 #productsView #productCards > .module-card > :is(span, strong, p:nth-of-type(n), .card-actions) { grid-column: auto !important; grid-row: auto !important; }
    body.erp-plan01 #productsView #productCards > .module-card > .card-actions { grid-column: 1 / -1 !important; flex-direction: row !important; justify-content: flex-end !important; }
    body.erp-plan01 #productDialog .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    body.erp-plan01 #productDialog .product-route-field { grid-column: auto; }
  }
  @media (max-width: 600px) {
    body.erp-plan01 #productsView > .section-bar h2 { font-size: 24px !important; }
    body.erp-plan01 #productsView #productCards > .module-card { grid-template-columns: minmax(0, 1fr) !important; gap: 8px !important; padding: 16px 12px !important; }
    body.erp-plan01 #productsView #productCards .small-button { min-height: 39px !important; }
    body.erp-plan01 #productsView > .module-section > .panel-header { padding: 12px !important; }
    body.erp-plan01 #productDialog #productForm { padding: 20px 16px !important; }
    body.erp-plan01 #productDialog .dialog-header h2 { font-size: 24px !important; }
    body.erp-plan01 #productDialog .form-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 20px !important; padding: 16px !important; }
    body.erp-plan01 #productDialog .dialog-actions { justify-content: stretch; }
    body.erp-plan01 #productDialog .dialog-actions button { flex: 1; min-width: 0; }
  }
  /* Never override source-controlled hiding with presentation layout. */
  body.erp-plan01 :is(#productsView, #productDialog) :is([hidden], [aria-hidden="true"], [style*="display: none"], [style*="display:none"]) { display: none !important; }
  body.erp-plan01 #productsView:is([hidden], [aria-hidden="true"], [style*="display: none"], [style*="display:none"]),
  body.erp-plan01 #productDialog:not([open]) { display: none !important; }
}
