/* Scheme 01 / 10-04. Original suppliers and production resources, CSS only.
 * Keep source visibility, seven columns, price access and all business actions. */
@layer plan01 {
  body.erp-plan01 #baseInfoView[data-active-base-section="processingPoints"] {
    min-width: 0;
    padding: 24px 28px 32px !important;
    color: #172438;
    background: #fff;
    font-variant-numeric: tabular-nums;

    & > .section-bar {
      gap: 16px;
      margin: 0 0 20px !important;
      padding: 0 !important;
      border: 0 !important;
      background: transparent !important;
    }
    & > .section-bar h2 { font-size: 16px !important; }
    & > .section-bar p { color: #5b6b80 !important; line-height: 1.6; }
    & #newBaseInfoBtn { flex: 0 0 auto; min-height: 44px !important; }
    & > .base-layout { min-width: 0; grid-template-columns: minmax(0, 1fr) !important; gap: 24px; }
    & #baseInfoNav {
      min-width: 0;
      max-width: 100%;
      grid-template-columns: none !important;
      grid-auto-flow: column;
      grid-auto-columns: max-content;
      flex-direction: row !important;
      flex-wrap: nowrap !important;
      position: static !important;
      max-height: none !important;
      gap: 8px !important;
      padding: 8px !important;
      overflow-x: auto !important;
      overflow-y: hidden !important;
      border: 1px solid #e0e9f0 !important;
      background: #edf4f7 !important;
      scrollbar-width: thin;
      scrollbar-color: #8b9fb5 #edf4f7;
    }
    & #baseInfoNav > button { flex: 0 0 auto !important; min-height: 44px !important; width: auto !important; padding: 8px 16px !important; white-space: nowrap !important; }
    & #baseInfoNav > button.active { background: #008575 !important; color: #fff !important; border-color: #008575 !important; }
    & .base-main-panel { min-width: 0; padding: 0 !important; border: 0 !important; box-shadow: none !important; }
    & .base-main-panel > .panel-header { padding: 0 0 20px !important; margin: 0 !important; border: 0 !important; }
    & #baseInfoTitle { font-size: 26px !important; line-height: 1.4; color: #172438 !important; }
    & #baseInfoSubtitle { color: #5b6b80 !important; font-size: 13px; line-height: 1.6; }
    & .supplier-production-resources { margin: 0 0 16px; }
    & .supplier-resource-header { align-items: flex-start; gap: 16px; padding: 0 0 16px; }
    & :is(.supplier-resource-header, .supplier-master-heading) h3 { font-size: 17px !important; line-height: 1.5; }
    & :is(.supplier-resource-header, .supplier-master-heading) p { max-width: 74ch; color: #5b6b80; line-height: 1.6; }
    & .supplier-resource-create-actions { flex: 0 0 auto; }
    & :is(.supplier-resource-create-actions > summary, .table-actions-inline button) { min-height: 38px !important; }
    & .table-wrap {
      max-width: 100%;
      min-width: 0;
      overflow-x: auto !important;
      border: 1px solid #e0e9f0 !important;
      border-radius: 4px !important;
      scrollbar-color: #8b9fb5 #edf4f7;
      scrollbar-width: thin;
      overscroll-behavior-x: contain;
    }
    & .table-wrap > table { width: 100% !important; border-collapse: collapse; table-layout: auto !important; }
    & .base-main-panel > .table-wrap > table { min-width: 1080px !important; }
    & .base-main-panel > .table-wrap :is(th, td):last-child { min-width: 160px !important; width: 160px; }
    & .table-wrap :is(th, td) { padding: 12px 16px !important; height: auto !important; vertical-align: middle; border-color: #e0e9f0 !important; font-size: 13px !important; line-height: 1.6 !important; }
    & .table-wrap th { color: #52677e !important; background: #eff5f8 !important; font-weight: 600; white-space: nowrap; }
    & .table-wrap td { color: #25364a !important; }
    & .table-wrap td small { color: #5b6b80 !important; }
    & .table-wrap tr:hover > td { background-color: #f3faf8 !important; }
    & .table-actions-inline { gap: 8px !important; flex-wrap: nowrap !important; }
    & .table-actions-inline button { min-width: 64px !important; padding-inline: 12px !important; white-space: nowrap !important; word-break: normal !important; }
    & .supplier-resource-tags { gap: 8px; }
    & .supplier-resource-tags button { border-radius: 4px; padding: 6px 10px; min-height: 34px; font-weight: 550; }
    & .supplier-resource-catalog-grid { gap: 24px; margin-top: 24px; }
    & .supplier-resource-catalog { border-color: #e0e9f0; }
    & .supplier-resource-catalog-row { gap: 12px; padding: 12px 0; align-items: flex-start; }
    & .supplier-resource-catalog-row > div:first-child { flex: 1 1 auto; }
    & .supplier-resource-catalog-row strong { white-space: normal; overflow-wrap: anywhere; }
    & .supplier-resource-catalog-row small { color: #5b6b80; line-height: 1.6; }
    & .supplier-resource-catalog-row > .table-actions-inline { flex: 0 0 auto; }
    & .supplier-master-heading { margin: 24px 0 0; padding: 20px 0 0; border-color: #e0e9f0; }
    & .supplier-product-tags { gap: 8px; }
    & .supplier-product-price-tag { max-width: 360px; border-radius: 4px !important; white-space: normal !important; }
    & .supplier-product-price-tag :is(strong, small) { max-width: 360px !important; overflow: visible !important; overflow-wrap: anywhere; white-space: normal !important; }
    & :is(.empty-state, .central-master-state) { padding: 24px !important; line-height: 1.6; }
    & :is(button, summary):focus-visible { outline: 2px solid #008575 !important; outline-offset: 3px; }
    & ::selection { background: #d0f6eb; color: #172438; }

    @media (max-width: 700px) {
      padding: 18px 16px 24px !important;
      & > .section-bar { flex-wrap: wrap; align-items: flex-start; }
      & > .section-bar > div { min-width: 0; flex-basis: 100%; }
      & #newBaseInfoBtn { margin: 0 !important; }
      & #baseInfoTitle { font-size: 24px !important; }
      & .supplier-resource-header { flex-direction: column; }
      & .supplier-resource-catalog-grid { grid-template-columns: minmax(0, 1fr); }
      & .supplier-resource-catalog-row { flex-wrap: wrap; }
      & .supplier-resource-catalog-row > div:first-child { flex-basis: 100%; }
      & :is(button, summary) { min-height: 44px !important; min-width: 44px !important; }
      & :is(.supplier-resource-create-actions > summary, .table-actions-inline button) { min-height: 44px !important; }
      & .table-wrap :is(th, td) { padding: 12px !important; }
    }
  }

  body.erp-plan01 dialog#baseInfoDialog.wide-master-dialog[data-base-section="processingPoints"] {
    width: min(1180px, calc(100vw - 48px)) !important;
    max-width: calc(100vw - 48px) !important;
    max-height: calc(100dvh - 48px) !important;
    padding: 0 !important;
    border-radius: 4px !important;
    color: #172438;
    & #baseInfoForm { width: 100% !important; max-width: none !important; padding: 24px !important; max-height: calc(100dvh - 48px) !important; }
    & #baseInfoForm > .dialog-header { padding: 0 0 16px !important; gap: 16px; align-items: center; }
    & #baseInfoDialogTitle { font-size: 24px !important; line-height: 1.4; }
    & #closeBaseInfoDialogBtn { width: 44px !important; height: 44px !important; min-width: 44px !important; padding: 0 !important; }
    & #baseInfoFormFields { margin: 20px 0 !important; padding: 0 !important; gap: 16px 24px !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    & #baseInfoFormFields label { min-width: 0; }
    & :is(input, select):not([type="hidden"]):not([type="checkbox"]) { min-width: 0; min-height: 44px !important; }
    & :is(input, select):focus-visible { outline: 2px solid #008575 !important; outline-offset: 2px; }
    & input::placeholder { color: #5b6b80 !important; opacity: 1; }
    & input { caret-color: #008575; }
    & .supplier-products-fieldset { grid-column: 1 / -1; min-width: 0; margin: 4px 0; padding: 20px; border: 1px solid #e0e9f0 !important; border-radius: 4px !important; background: #fff !important; }
    & .supplier-product-catalog-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    & .supplier-product-catalog-option { min-width: 0; border-radius: 4px; }
    & .supplier-product-catalog-choice { min-height: 44px; min-width: 0; }
    & .supplier-product-catalog-choice > span { overflow-wrap: anywhere; }
    & .supplier-product-catalog-choice input { width: 18px; height: 18px; accent-color: #008575; }
    & .supplier-product-price-row { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, .6fr) minmax(0, .6fr) minmax(0, 1fr) auto !important; gap: 12px; padding: 16px 0 !important; border: 0 !important; border-bottom: 1px solid #e0e9f0 !important; border-radius: 0 !important; }
    & :is(.supplier-product-manager-head, .supplier-product-selected-head) { gap: 8px; margin-block: 16px 12px; }
    & .supplier-product-manager-head { margin-top: 0; }
    & :is(small, .supplier-product-price-empty, .supplier-product-catalog-empty, .central-master-permission-note) { color: #5b6b80; line-height: 1.6; }
    & #baseInfoForm > .dialog-actions { padding: 16px 0 max(0px, env(safe-area-inset-bottom)) !important; }
    & button { min-height: 44px !important; }
    & ::selection { background: #d0f6eb; color: #172438; }

    @media (max-width: 980px) {
      & #baseInfoFormFields { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
      & .supplier-product-price-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
      & .supplier-product-price-copy { grid-column: 1 / -1; }
    }
    @media (max-width: 700px) {
      width: 100vw !important;
      max-width: 100vw !important;
      max-height: 100dvh !important;
      & #baseInfoForm { padding: 16px !important; max-height: none !important; }
      & #baseInfoDialogTitle { font-size: 22px !important; }
      & #baseInfoFormFields { grid-template-columns: minmax(0, 1fr) !important; }
      & .supplier-products-fieldset { padding: 12px; }
      & .supplier-product-catalog-list { grid-template-columns: minmax(0, 1fr); }
      & .supplier-product-price-row { grid-template-columns: minmax(0, 1fr) !important; }
      & :is(input, select):not([type="hidden"]):not([type="checkbox"]) { font-size: 16px !important; }
    }
  }
}
