/* Production BOM workspace; shared customer and supplier pages keep their own layout. */
@media screen {
  main:has(> #page-boms:not(.hidden)) { display:flex; flex-direction:column; padding:24px 24px 18px; }
  main:has(> #page-boms:not(.hidden)) > .topbar { flex-shrink:0; }
  #page-boms:not(.hidden) { display:flex; flex:1; flex-direction:column; min-height:0; padding-bottom:0; }
  #page-boms .bom-workspace-panel {
    display:flex; flex:1; flex-direction:column; min-height:535px; margin:0; padding:0;
    overflow:hidden; border:1px solid #dfe5ef; border-radius:16px; background:#fff; box-shadow:0 6px 24px #25395904;
  }
  #page-boms .bom-workspace-head {
    display:flex; flex-shrink:0; align-items:center; gap:24px; padding:12px 20px;
    border-bottom:1px solid #e8ecf4; background:linear-gradient(110deg,#fff 66%,#faf9ff);
  }
  #page-boms .bom-workspace-label { display:none; }
  #page-boms .bom-workspace-metrics { display:grid; flex:1; grid-template-columns:repeat(4,minmax(0,1fr)); max-width:800px; min-width:0; margin:0; }
  #page-boms .bom-workspace-metrics > div { min-width:0; padding:0 22px; border-right:1px solid #e9edf4; }
  #page-boms .bom-workspace-metrics > div:first-child { padding-left:0; }
  #page-boms .bom-workspace-metrics > div:last-child { border-right:0; }
  #page-boms .bom-workspace-metrics dt { color:#77859a; font-size:11px; line-height:1.5; white-space:nowrap; }
  #page-boms .bom-workspace-metrics dd { margin:4px 0 0; color:#354b69; font-size:22px; font-weight:650; line-height:1.15; font-variant-numeric:tabular-nums; letter-spacing:-.5px; }
  #page-boms .bom-metric-active dd { color:#17876f; }
  #page-boms .bom-metric-draft dd { color:#b7802c; }
  #page-boms .bom-metric-total dd { color:#6a56c9; }
  #page-boms .bom-workspace-create { flex-shrink:0; min-height:37px; margin-left:auto; padding:8px 13px; border-radius:9px; font-size:12px; white-space:nowrap; box-shadow:0 4px 12px #6654d318; }
  #page-boms .bom-workspace-create > span { margin-right:3px; font-size:14px; }
  #page-boms .bom-workspace-toolbar { display:flex; flex-shrink:0; align-items:center; flex-wrap:wrap; gap:10px; padding:12px 18px; border-bottom:1px solid #e8edf4; background:#fbfcff; }
  #page-boms .bom-workspace-search { display:flex; flex:1 1 260px; align-items:center; gap:8px; max-width:430px; min-width:210px; height:38px; margin:0; padding:3px 3px 3px 11px; border:1px solid #dce3ee; border-radius:9px; background:#fff; }
  #page-boms .bom-workspace-search:focus-within { border-color:#a297dc; box-shadow:0 0 0 3px #8b77d811; }
  #page-boms .bom-workspace-search > span { flex-shrink:0; color:#95a0b3; font-size:17px; }
  #page-boms .bom-workspace-search input { flex:1; width:100%; min-width:0; height:30px; min-height:0; margin:0; padding:5px 0; border:0!important; outline:0!important; border-radius:0; background:transparent!important; box-shadow:none!important; color:#415572; font-size:12px; }
  #page-boms .bom-workspace-search button { flex-shrink:0; min-height:30px; margin:0; padding:5px 13px; border-radius:6px; font-size:11px; box-shadow:none; }
  #page-boms #bomStatus { width:126px; min-height:38px; margin:0; padding:7px 10px; border:1px solid #dce3ee; border-radius:8px; background:#fff; color:#566781; font-size:12px; }
  #page-boms .bom-clear-filters { min-height:36px; margin:0; padding:7px 11px; border-radius:8px; font-size:11px; box-shadow:none; }
  #page-boms .bom-filter-count { margin-left:auto; color:#8b97ab; font-size:11px; white-space:nowrap; }
  #page-boms .bom-filter-count strong { color:#6d5ab5; font-weight:600; }

  #page-boms #bomList { display:flex; flex:1; flex-direction:column; min-height:0; }
  #page-boms .bom-workspace-table-shell { flex:1; min-height:0; max-height:none!important; margin:0; overflow:auto; border:0; border-radius:0; }
  #page-boms .bom-table { width:100%; min-width:970px; table-layout:fixed; }
  #page-boms .bom-table:has(tbody > tr:nth-child(5)) { height:100%; }
  #page-boms .bom-table th { position:sticky; top:0; z-index:2; height:44px; padding:12px 14px; color:#7a879d; background:#f8fafd; font-size:11px; font-weight:550; white-space:nowrap; }
  #page-boms .bom-table td { height:64px; padding:12px 14px; color:#526681; font-size:12px; line-height:1.5; vertical-align:middle; }
  #page-boms .bom-table tbody tr:hover { background:#fbfaff; }
  #page-boms .bom-product-link { display:flex; flex-direction:row; align-items:center; gap:11px; min-width:0; }
  #page-boms .bom-product-symbol { display:grid; flex:0 0 34px; width:34px; height:34px; place-items:center; border:1px solid #e8e4f7; border-radius:9px; background:#f4f1fc; color:#8c7ad3; font-style:normal; }
  #page-boms .bom-product-symbol svg { width:18px; height:18px; }
  #page-boms .bom-product-copy { display:flex; flex-direction:column; gap:5px; min-width:0; }
  #page-boms .bom-product-copy strong { display:-webkit-box; overflow:hidden; -webkit-line-clamp:2; -webkit-box-orient:vertical; color:#344969; font-size:13px; font-weight:600; line-height:1.5; overflow-wrap:anywhere; }
  #page-boms .bom-product-copy small { display:block; overflow:hidden; color:#91a0b6; font:11px/1.4 Consolas,"Microsoft YaHei",monospace; text-overflow:ellipsis; white-space:nowrap; }
  #page-boms .bom-product-link:hover strong { color:#6652bf; }
  #page-boms .bom-version-cell { display:flex; flex-direction:column; align-items:flex-start; gap:5px; min-width:0; }
  #page-boms .version-pill { max-width:100%; margin:0; padding:3px 8px; overflow:hidden; border-radius:6px; background:#f0edfc; color:#7761bf; font-size:12px; font-weight:650; text-overflow:ellipsis; white-space:nowrap; }
  #page-boms .bom-version-cell > small { color:#99a3b4; font-size:10px; }
  #page-boms .bom-workspace-status { display:inline-flex; align-items:center; gap:5px; padding:5px 9px; font-size:11px; line-height:1.5; white-space:nowrap; }
  #page-boms .bom-workspace-status::before { width:5px; height:5px; border-radius:50%; background:currentColor; content:""; }
  #page-boms .bom-workspace-status.ACTIVE { background:#edf8f3; color:#238b72; }
  #page-boms .bom-workspace-status.DRAFT { background:#fff7e9; color:#b47d2c; }
  #page-boms .bom-workspace-status.INACTIVE { background:#f0f2f6; color:#8a96a8; }
  #page-boms .date-range { gap:7px; color:#7889a1; font-size:11px; font-variant-numeric:tabular-nums; }
  #page-boms .date-range i { color:#b5bfce; }
  #page-boms .bom-material-count { color:#8b98ad; font-size:11px; white-space:nowrap; }
  #page-boms .bom-material-count strong { margin-right:3px; color:#506581; font-size:14px; font-weight:600; }
  #page-boms .bom-row-actions { display:flex; align-items:center; gap:7px; min-width:0; white-space:nowrap; }
  #page-boms .bom-row-actions button { min-height:32px; margin:0; padding:6px 10px; border-radius:8px; font-size:11px; font-weight:500; box-shadow:none; }
  #page-boms .bom-row-actions .document-more { background:#fafbfe; color:#76859b; }
  #page-boms .bom-row-actions .document-more span { margin-left:2px; color:#9aabc0; }
  #page-boms .data-pager { flex-shrink:0; min-height:56px; padding:10px 16px; border-top:1px solid #e6ebf3; background:#fafbfe; font-size:12px; }
  #page-boms .data-pager :is(select,input,button) { min-height:34px; font-size:12px; }
  #page-boms .bom-workspace-empty { display:flex; flex:1; flex-direction:column; align-items:center; justify-content:center; gap:12px; min-height:220px; padding:32px 20px; }
  #page-boms .bom-workspace-empty > span { display:grid; width:48px; height:48px; place-items:center; border-radius:14px; background:#f4f1fc; color:#9a88cf; font-size:26px; }
  #page-boms .bom-workspace-empty > strong { color:#738197; font-size:14px; font-weight:550; }
  #page-boms .bom-workspace-empty > button { min-height:32px; padding:6px 11px; font-size:11px; }

  #dialog:has(.bom-form,.bom-detail-table) { width:min(1120px,calc(100vw - 32px)); }
  #dialog:has(.bom-detail-table) .bom-breadcrumb-root { display:none; }
  #dialog:has(.bom-detail-table) .bom-detail-head { gap:16px; padding:16px 18px; border-color:#e4dff3; border-radius:12px; background:linear-gradient(115deg,#f8f6fe,#fff); }
  #dialog:has(.bom-detail-table) .bom-detail-head h3 { margin:9px 0 5px; color:#354766; font-size:18px; overflow-wrap:anywhere; }
  #dialog:has(.bom-detail-table) .bom-detail-head p { color:#8d98a9; font-size:11px; }
  #dialog:has(.bom-detail-table) .bom-detail-head button { min-height:35px; font-size:12px; white-space:nowrap; }
  #dialog:has(.bom-detail-table) .bom-meta { gap:10px; margin:12px 0 16px; }
  #dialog:has(.bom-detail-table) .bom-meta > div { padding:11px 13px; border:1px solid #edf0f6; border-radius:9px; background:#fafbfe; }
  #dialog:has(.bom-detail-table) .bom-meta strong { color:#5a6b83; font-size:12px; }
  #dialog:has(.bom-detail-table) .bom-detail-table { min-width:650px; }
  #dialog:has(.bom-detail-table) .bom-detail-table th { color:#8190a6; background:#f7f9fd; font-size:11px; white-space:nowrap; }
  #dialog:has(.bom-detail-table) .bom-detail-table td { padding-block:12px; font-size:12px; }
  #dialog:has(.bom-detail-table) .bom-child-row { background:#f8f6fe; }
  #dialog:has(.bom-detail-table) .bom-crumb.current { color:#7961bb; }
  #dialog:has(.bom-detail-table) .bom-material-link strong { color:#6f5bb8; }
  #dialog:has(.bom-detail-table) .bom-material-link small { color:#9a8cba; }
  #dialog:has(.bom-form) .edit-notice { gap:5px; margin-bottom:16px; padding:11px 14px; border-color:#e4dff3; border-radius:10px; background:#f8f6fe; }
  #dialog:has(.bom-form) .edit-notice strong { color:#7b61b2; font-size:12px; }
  #dialog:has(.bom-form) .edit-notice span { color:#8b90a2; font-size:11px; }
  #dialog:has(.bom-form) .bom-lines-head { margin-top:18px; }
  #dialog:has(.bom-form) .bom-lines-head > button { min-height:35px; font-size:12px; }
  #dialog:has(.bom-form) .bom-edit-table { min-width:740px; }
  #dialog:has(.bom-form) .bom-edit-table input { min-width:0; }
  #dialog:has(.bom-form) .bom-edit-table th { color:#8190a6; background:#f7f9fd; font-size:11px; }
}

@media screen and (max-width:900px) {
  main:has(> #page-boms:not(.hidden)) { height:calc(100dvh - 62px); min-height:0; padding:16px 12px 18px; }
  #page-boms .bom-workspace-panel { min-height:600px; }
  #page-boms .bom-workspace-head { gap:16px; padding:14px 16px; }
  #page-boms .bom-workspace-metrics > div { padding-inline:14px; }
  #dialog:has(.bom-detail-table) .bom-detail-head { align-items:flex-start; }
  #dialog:has(.bom-detail-table) .bom-meta { grid-template-columns:repeat(3,minmax(0,1fr)); }
}

@media screen and (max-width:600px) {
  #page-boms .bom-workspace-head { flex-wrap:wrap; gap:13px; padding:13px 14px; }
  #page-boms .bom-workspace-label { display:block; margin:0; color:#52617a; font-size:13px; font-weight:600; }
  #page-boms .bom-workspace-create { min-height:33px; padding:7px 10px; font-size:11px; }
  #page-boms .bom-workspace-metrics { order:3; flex-basis:100%; }
  #page-boms .bom-workspace-metrics > div { padding-inline:10px; }
  #page-boms .bom-workspace-metrics dt { font-size:10px; }
  #page-boms .bom-workspace-metrics dd { font-size:21px; }
  #page-boms .bom-workspace-toolbar { gap:8px; padding:12px; }
  #page-boms .bom-workspace-search { flex-basis:100%; min-width:0; max-width:none; }
  #page-boms #bomStatus { flex:0 0 120px; }
  #page-boms .bom-filter-count { font-size:10px; }
  #page-boms .data-pager { padding-inline:12px; }
  #dialog:has(.bom-detail-table) .bom-detail-head { padding:14px; }
  #dialog:has(.bom-detail-table) .bom-detail-head h3 { font-size:15px; }
  #dialog:has(.bom-detail-table) .bom-meta { gap:7px; }
  #dialog:has(.bom-detail-table) .bom-meta > div { padding:9px; }
  #dialog:has(.bom-form) .bom-lines-head { align-items:flex-start; }
}
