.bom-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 30px 32px;
  color: #fff;
  border-radius: 20px;
  background: linear-gradient(125deg, #102b4d 0%, #165fba 58%, #278de3 100%);
  box-shadow: 0 22px 45px rgba(18, 70, 130, .2);
}

.bom-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -90px;
  top: -130px;
  border: 52px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
}

.bom-hero > * { position: relative; z-index: 1; }
.bom-hero .eyebrow { color: #a9d5ff; }
.bom-hero h3 { margin: 7px 0 10px; font-size: 28px; }
.bom-hero p { max-width: 760px; margin: 0; color: #d8eaff; line-height: 1.75; font-size: 13px; }
.bom-create { min-width: 138px; background: #fff; color: #1359a5; box-shadow: 0 12px 24px rgba(3, 31, 65, .2); }
.bom-create:hover { background: #edf6ff; color: #0d4b90; }

.bom-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.bom-summary > div {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(34, 61, 91, .05);
}

.bom-summary span { color: var(--muted); font-size: 12px; }
.bom-summary strong { display: block; margin-top: 7px; color: #163a64; font-size: 26px; }
.bom-panel { padding: 0; overflow: hidden; }

.bom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.bom-toolbar h3 { margin: 0 0 5px; }
.bom-toolbar > div > span { color: var(--muted); font-size: 12px; }
.bom-filters { display: flex; gap: 9px; }
.bom-filters input, .bom-filters select {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f9fbfd;
  color: var(--ink);
  outline: none;
}
.bom-filters input { width: 245px; }
.bom-filters input:focus, .bom-filters select:focus { border-color: #78adee; box-shadow: 0 0 0 3px rgba(23, 105, 224, .1); }
.table-wrap { width: 100%; overflow-x: auto; }
.bom-table th, .bom-table td { padding: 14px 16px; vertical-align: middle; }
.bom-table tbody tr:hover { background: #f8fbff; }
.bom-product-link, .bom-material-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.bom-product-link strong, .bom-material-link strong { color: #155eb7; font-size: 13px; }
.bom-product-link span, .bom-material-link span, .bom-material-leaf span { color: var(--ink); }
.bom-material-link small { margin-top: 4px; color: #4b81bf; }
.bom-product-link:hover strong, .bom-material-link:hover strong { text-decoration: underline; }
.version-pill { display: inline-block; margin-right: 6px; padding: 5px 8px; border-radius: 7px; background: #eaf3ff; color: #155eb7; font-weight: 700; }
.date-range { display: flex; align-items: center; gap: 8px; white-space: nowrap; color: #56677b; }
.date-range i { color: #9ca9b8; font-style: normal; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 215px; }
.status.DRAFT { background: #fff5de; color: #a76500; }
.status.ACTIVE { background: #e8f8f0; color: #16815a; }
.status.INACTIVE { background: #eef1f5; color: #6c7888; }
.bom-empty { display: flex; flex-direction: column; gap: 7px; }
.bom-empty strong { color: var(--ink); font-size: 15px; }

.bom-breadcrumb { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.bom-breadcrumb > div { display: flex; align-items: center; gap: 8px; color: #8b99aa; font-size: 12px; }
.bom-crumb.current { color: #175fae; font-weight: 700; }
.bom-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border: 1px solid #dbe9f8;
  border-radius: 15px;
  background: linear-gradient(135deg, #f2f8ff, #fff);
}
.bom-detail-head h3 { margin: 10px 0 5px; font-size: 21px; }
.bom-detail-head p { margin: 0; color: var(--muted); font-size: 12px; }
.readonly-note { color: var(--muted); font-size: 12px; white-space: nowrap; }
.bom-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 16px; }
.bom-meta > div { padding: 12px 14px; border-radius: 10px; background: #f6f8fb; }
.bom-meta span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.bom-meta strong { font-size: 13px; }
.bom-detail-table th, .bom-detail-table td { padding: 13px 11px; vertical-align: middle; }
.bom-child-row { background: #f7fbff; }
.bom-child-row:hover { background: #eef7ff; }
.line-index { width: 44px; color: #9aa7b7; font-variant-numeric: tabular-nums; }
.bom-material-leaf { display: flex; flex-direction: column; gap: 3px; }
.bom-material-leaf small { color: var(--muted); }
.leaf-tag { color: #95a1af; font-size: 11px; }

.edit-notice { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; padding: 13px 15px; border: 1px solid #cfe2f8; border-radius: 11px; background: #f2f8ff; }
.edit-notice strong { color: #155eb7; font-size: 13px; }
.edit-notice span { color: #617389; font-size: 12px; }
.bom-lines-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 10px; }
.bom-lines-head strong, .bom-lines-head span { display: block; }
.bom-lines-head span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.bom-edit-table th, .bom-edit-table td { vertical-align: middle; }
.bom-edit-table select, .bom-edit-table input { width: 100%; min-width: 130px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.bom-edit-table select { min-width: 280px; }
.bom-edit-table { min-width: 780px; }
.bom-edit-table th:first-child { width: 48%; }
.bom-edit-table th:nth-child(2), .bom-edit-table th:nth-child(3) { width: 18%; }
#dialog:has(.bom-form) { width: min(1260px, calc(100vw - 36px)); }
.bom-root-field { display: flex; min-width: 0; flex-direction: column; gap: 6px; color: #58677b; font-size: 12px; font-weight: 600; }
.bom-root-field > button { display: flex; min-height: 54px; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 13px; border: 1px solid #d9e0eb; border-radius: 10px; background: #fbfcfe; color: #26364e; text-align: left; cursor: pointer; }
.bom-root-field > button:hover:not(:disabled) { border-color: #837bea; background: #f8f7ff; box-shadow: 0 0 0 3px rgba(81,71,229,.08); }
.bom-root-field > button:disabled { cursor: default; opacity: .78; }
.bom-root-field > button span, .bom-selected-material { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.bom-root-field > button strong, .bom-selected-material strong { color: #253650; font-size: 13px; }
.bom-root-field > button small, .bom-selected-material small { overflow: hidden; color: #8a96a8; font-size: 10px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.bom-root-field > button i { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: #eeedff; color: #554bd7; font-size: 9px; font-style: normal; }
.bom-selected-material span { color: #57667b; font-size: 11px; }
.bom-form .material-lines-empty { margin-bottom: 12px; }
.bom-form .material-count { margin-left: 6px; }

@media (max-width: 900px) {
  .bom-hero, .bom-toolbar, .bom-detail-head { align-items: flex-start; flex-direction: column; }
  .bom-summary { grid-template-columns: repeat(2, 1fr); }
  .bom-filters { width: 100%; flex-direction: column; }
  .bom-filters input, .bom-filters select { width: 100%; }
  .bom-meta { grid-template-columns: 1fr; }
  .bom-create { width: 100%; }
}

/* Keep BOM header consistent with the compact business pages. */
.bom-hero {
  min-height: 0;
  gap: 16px;
  padding: 17px 20px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.bom-hero::after { display: none; }
.bom-hero .eyebrow { display: none; }

.bom-hero h3 {
  margin: 0 0 3px;
  color: var(--ink);
  font-size: 17px;
}

.bom-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.bom-create,
.bom-create:hover {
  min-width: 0;
  color: #fff;
  background: linear-gradient(135deg,#5b53eb,#4338ca);
  box-shadow: 0 5px 13px rgba(79,70,229,.15);
}

@media (max-width: 900px) {
  .bom-hero { padding: 15px 16px; }
}
