/* Product registry: Branch-style blue navigation and compact controls. */
.ap-product-page {
  --registry-blue: #0869a8;
  --registry-blue-dark: #075486;
  --registry-line: #cddce7;
  color: #243d50;
  background: #f3f6f8;
}
.ap-product-page > .ap-heading {
  min-height: 46px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom-color: var(--registry-line);
}
.ap-product-page > .ap-heading h1 { margin: 0; font-size: 20px; color: #143a57; }
.ap-product-page > .ap-heading > .ap-toolbar { gap: 6px; margin: 0; }
.ap-product-page .ap-button,
.registry-product-dialog .ap-button,
.registry-duplicate-dialog .ap-button {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid #a7c3d7;
  border-radius: 3px;
  background: #fff;
  color: #075b94;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}
.ap-product-page .ap-button:hover,
.registry-product-dialog .ap-button:hover,
.registry-duplicate-dialog .ap-button:hover { background: #e6f1f8; border-color: #6d9ebe; }
.ap-product-page [data-action="new-product"],
.registry-product-dialog .primary-btn,
.registry-duplicate-dialog .primary-btn {
  background: #0869a8;
  border: 1px solid #0869a8;
  color: #fff;
}
.ap-product-page [data-action="new-product"]:hover,
.registry-product-dialog .primary-btn:hover,
.registry-duplicate-dialog .primary-btn:hover { background: #075486; border-color: #075486; }
.ap-product-page [data-action="price-fast-stop"] { color: #994035; border-color: #d9b8b2; background: #fff; }
.ap-product-page button:disabled { cursor: not-allowed; opacity: .48; }
.ap-product-page #ap-message:not(:empty) { margin-bottom: 10px; }
.ap-product-page #ap-message .notice { padding: 9px 12px; font-size: 13px; }
.ap-product-page .ap-product-sync-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  grid-template-areas: "summary progress" "detail detail" "error error";
  gap: 3px 14px;
  padding: 8px 11px;
  margin-bottom: 12px;
  border: 1px solid #c6dce9;
  border-radius: 3px;
  background: #eef6fb;
  box-shadow: none;
}
.ap-product-page #price-agent-status { display: none; }
.ap-product-page .ap-product-sync-row { grid-area: summary; gap: 8px; flex-wrap: nowrap; min-width: 0; }
.ap-product-page #price-sync-pct {
  flex-shrink: 0;
  min-height: 23px;
  padding: 2px 6px;
  border: 1px solid #aacfe7;
  border-radius: 3px;
  background: #fff;
  font-size: 12px;
  line-height: 17px;
}
.ap-product-page #price-sync-text { font-size: 13px; line-height: 1.5; font-weight: 700; }
.ap-product-page .ap-product-sync-status .ap-price-progress {
  grid-area: progress;
  align-self: center;
  height: 5px;
  margin: 0;
  background: #d3e3ed;
  border-radius: 2px;
}
.ap-product-page .ap-product-sync-status #price-sync-bar { background: #0a79b9; }
.ap-product-page #price-sync-detail { grid-area: detail; margin: 0; font-size: 12px; line-height: 1.5; color: #597184; }
.ap-product-page #price-sync-error { grid-area: error; margin: 0; font-size: 12px; line-height: 1.5; }
.ap-product-page #price-sync-detail:empty,
.ap-product-page #price-sync-error:empty { display: none; }
.ap-product-page .ap-catalog { grid-template-columns: 232px minmax(0, 1fr); gap: 12px; }
.ap-product-page .ap-categories {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 222px);
  border: 1px solid var(--registry-line);
  background: #eaf2f7;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: #a1b9c9 #eaf2f7;
}
.ap-product-page .ap-categories h2 { padding: 10px 12px; background: #0869a8; font-size: 14px !important; }
.ap-product-page .ap-categories button {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
  line-height: 1.5;
  color: #245b7e;
  border-left: 3px solid transparent;
}
.ap-product-page .registry-category-group { border-top: 1px solid #d2e0e9; }
.ap-product-page .registry-category-group summary {
  padding: 8px 10px;
  background: #dcebf4;
  color: #194c70;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.ap-product-page .registry-category-group summary:hover { background: #cfe3f0; }
.ap-product-page .registry-category-group summary:focus-visible { outline: 2px solid #0878b7; outline-offset: -2px; }
.ap-product-page .registry-category-group summary::marker { color: #467996; font-size: 10px; }
.ap-product-page .registry-category-group button { padding-left: 23px; }
.ap-product-page .ap-categories button.active,
.ap-product-page .ap-categories button[aria-pressed="true"] {
  border-left-color: #0878b7;
  background: #fff;
  color: #075486;
  font-weight: 700;
}
.ap-product-page .ap-categories button:hover { background: #d6e9f4; }
.ap-product-page .ap-catalog section > .ap-toolbar { margin: 0 0 10px; align-items: end; gap: 8px 12px; }
.ap-product-page .ap-catalog section > .ap-toolbar label { flex: 0 1 380px; gap: 4px; font-weight: 600; }
.ap-product-page #registry-total { margin: 0 0 8px; color: #597184; font-size: 12px; font-variant-numeric: tabular-nums; }
.ap-product-page #ap-content .ap-catalog input { min-height: 35px; border: 1px solid #abc4d7; border-radius: 3px; background: #fff; }
.ap-product-page .ap-table-scroll { border-color: var(--registry-line); border-radius: 0; }
.ap-product-page #catalog-table { width: 100%; min-width: 0; }
.ap-product-page #catalog-table .ap-table { width: 100%; min-width: 660px; table-layout: auto; border-collapse: collapse; }
.ap-product-page #catalog-table th { padding: 8px 10px; background: #0869a8; font-size: 12px; }
.ap-product-page #catalog-table td { padding: 7px 10px; font-size: 12px; line-height: 1.55; border-bottom: 1px solid #e4edf3; }
.ap-product-page #catalog-table td:first-child { width: 22%; white-space: normal; }
.ap-product-page #catalog-table td:nth-child(2) { min-width: 108px; width: 15%; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ap-product-page #catalog-table td:nth-child(3) { width: auto; }
.ap-product-page #catalog-table th:last-child,
.ap-product-page #catalog-table td:last-child { padding-right: 16px; }
.ap-product-page #catalog-table tr:nth-child(even) { background: #f5f8fa; }
.ap-product-page #catalog-table tr:hover { background: #eaf4fb; }
.ap-product-page #catalog-table .ap-link { color: #0870ac; font-size: 12px; }
.ap-product-page #catalog-table .empty { padding: 38px 12px; color: #6a8294; text-align: center; }
.ap-product-page .registry-pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-top: 9px; color: #567082; font-size: 12px; font-variant-numeric: tabular-nums; }
.ap-product-page #catalog-count { margin: 0; padding: 0 5px; }
.ap-product-page .registry-pagination > :first-child:not(button) { margin-right: auto; }
.ap-product-page .registry-pagination button { min-height: 31px; padding: 4px 10px; border: 1px solid #b5cbdc; border-radius: 3px; color: #075486; background: #fff; font-size: 12px; }
.ap-product-page .registry-pagination button:hover:not(:disabled) { background: #e1eef7; }
.registry-product-dialog,
.registry-duplicate-dialog { width: min(720px, calc(100% - 24px)); padding: 18px 20px; border-radius: 4px; border-color: #acc6d8; color: #243d50; }
.registry-product-dialog .ap-heading,
.registry-duplicate-dialog .ap-heading { margin-bottom: 14px; padding-bottom: 12px; border-color: #d3e0ea; }
.registry-product-dialog .ap-heading h2,
.registry-duplicate-dialog .ap-heading h2 { color: #144e77; font-size: 17px; }
.registry-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.registry-form-grid label { min-width: 0; margin: 6px 0; gap: 5px; color: #3b556a; font-size: 13px; }
.registry-form-grid .registry-wide { grid-column: 1 / -1; }
.registry-product-dialog .registry-form-grid input,
.registry-product-dialog .registry-form-grid select,
.registry-product-dialog .registry-form-grid textarea { width: 100%; min-height: 37px; padding: 7px 9px; border: 1px solid #b2c8d8; border-radius: 3px; background: #fff; color: #243d50; font-size: 14px; }
.registry-product-dialog .registry-form-grid input[readonly] { background: #eef4f8; color: #416780; font-variant-numeric: tabular-nums; }
.registry-product-dialog .registry-form-grid input::placeholder { color: #8598a7; font-size: 13px; }
.registry-product-dialog .registry-form-grid select:disabled { opacity: 1; background: #f2f5f7; color: #738695; }
.registry-code-note { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; color: #687f90; }
.registry-duplicate-hint { margin: 0; padding: 7px 9px; border-left: 3px solid #d7a232; background: #fff7df; color: #7f590c; font-size: 12px; line-height: 1.5; }
.registry-duplicate-hint:empty { display: none; }
.registry-form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding-top: 13px; border-top: 1px solid #d3e0ea; }
.registry-product-dialog .registry-form-actions button,
.registry-duplicate-dialog .registry-form-actions button { width: auto; min-height: 36px; padding: 7px 15px; border-radius: 3px; font-size: 13px; font-weight: 700; box-shadow: none; }
.registry-duplicate-dialog { width: min(560px, calc(100% - 24px)); }
.registry-duplicate-dialog > p { font-size: 14px; line-height: 1.65; }
.registry-duplicate-list { max-height: 230px; margin: 12px 0 0; padding: 0; overflow: auto; border: 1px solid #d4e1e9; background: #f5f9fc; list-style: none; }
.registry-duplicate-list .ap-table-scroll { border: 0; }
.registry-duplicate-list .ap-table { min-width: 0; width: 100%; table-layout: fixed; }
.registry-duplicate-list th,
.registry-duplicate-list td { padding: 9px 12px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.registry-duplicate-list th:first-child,
.registry-duplicate-list td:first-child { width: 112px; white-space: normal; }
.registry-duplicate-list td:nth-child(2) { min-width: 0; }
.registry-duplicate-list strong { color: #075b94; font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) {
  .ap-product-page .ap-catalog { grid-template-columns: 200px minmax(0, 1fr); gap: 10px; }
  .ap-product-page > .ap-heading h1 { font-size: 18px; }
}
@media (max-width: 700px) {
  .ap-product-page > .ap-heading { align-items: flex-start; gap: 8px; }
  .ap-product-page > .ap-heading > .ap-toolbar { width: 100%; }
  .ap-product-page .ap-product-sync-status { grid-template-columns: minmax(0, 1fr); grid-template-areas: "summary" "progress" "detail" "error"; gap: 5px; }
  .ap-product-page .ap-product-sync-status .ap-price-progress { height: 4px; }
  .ap-product-page .ap-catalog { grid-template-columns: minmax(0, 1fr); }
  .ap-product-page .ap-categories { position: static; max-height: 220px; }
  .ap-product-page .ap-catalog section > .ap-toolbar label { flex: 1 1 240px; }
  .ap-product-page .ap-table-scroll { max-height: 60vh; }
  .ap-product-page #catalog-table th { position: sticky; top: 0; z-index: 1; }
  .registry-form-grid { grid-template-columns: minmax(0, 1fr); }
  .registry-form-grid .registry-wide { grid-column: auto; }
  .registry-product-dialog,
  .registry-duplicate-dialog { padding: 14px; }
}
@media (max-width: 420px) {
  .ap-product-page .ap-button { padding: 6px 8px; font-size: 12px; }
  .ap-product-page #price-sync-text { font-size: 12px; }
  .ap-product-page .registry-pagination { gap: 5px; }
  .ap-product-page .registry-pagination > :first-child:not(button) { width: 100%; margin-bottom: 2px; }
  .registry-form-actions > button { flex: 1 1 auto; }
}
@media print {
  .ap-product-page .ap-product-sync-status,
  .ap-product-page .registry-pagination { display: none !important; }
}

.ap-product-page .registry-category-group{margin:0}

.branch-new-preview-table{max-height:330px;overflow:auto;margin-top:12px}.branch-new-preview .ap-table{min-width:620px}.branch-new-preview .ap-toolbar{justify-content:flex-end}.ap-product-page [data-action=price-fast-new]{background:#e6f3ed;color:#166443;border-color:#92c2ab}

