/* Inventory add-on: products list, product page (gallery), stock forms, task products. */
.product-thumb { display:inline-flex; align-items:center; justify-content:center; flex:none; vertical-align:middle; border-radius:6px;
  object-fit:cover; background:#f1f5f9; border:1px solid var(--line); overflow:hidden; }
.product-thumb-40 { width:40px; height:40px; font-size:.8rem; }
.product-thumb-32 { width:32px; height:32px; font-size:.7rem; }
.product-thumb-48 { width:48px; height:48px; font-size:.9rem; }
.product-thumb-empty { color:#94a3b8; background:#f1f5f9; border-color:#e2e8f0; }
.product-thumb-icon { width:55%; height:55%; display:block; }

.stock-badge { display:inline-block; min-width:2rem; text-align:center; padding:0 .45rem; border-radius:10px; background:#e2e8f0; color:#0f172a;
  font-weight:600; font-size:.85rem; font-variant-numeric:tabular-nums; }
.stock-badge.low { background:#fee2e2; color:#b91c1c; border:1px solid #fca5a5; }
.low-note { color:#b91c1c; font-weight:600; font-size:.85rem; }

.head-actions { display:flex; gap:.4rem; flex-wrap:wrap; }
.product-filter-bar .filter-toolbar { flex-wrap:wrap; align-items:center; }
.product-filter-bar .filter-toolbar input.product-search { flex:2 1 24rem; max-width:none; min-width:12rem; font-size:1.05rem; padding:.55rem .7rem; }
@media (max-width:600px) { .product-filter-bar .filter-toolbar input.product-search { flex:1 1 100%; min-width:0; } }
.toolbar-field { display:inline-flex; align-items:center; gap:.35rem; white-space:nowrap; font-size:.9rem; }
.toolbar-check { border:1px solid var(--line); border-radius:4px; padding:.3rem .55rem; background:#fff; }
.list-count { margin:.3rem 0; }
.product-count { font-weight:700; font-size:1.05rem; margin:.2rem 0 .6rem; }

table.products { width:100%; max-width:100%; border-collapse:collapse; background:#fff; table-layout:fixed; }
table.products th, table.products td { padding:.3rem .4rem; border-bottom:1px solid var(--line); vertical-align:middle; }
.print-view table.products { table-layout: auto; }
.print-view table.products td.col-photo, .print-view table.products th.col-photo { width: 0.95in; }
.print-view table.products tr { break-inside: avoid; page-break-inside: avoid; }
.print-view img.print-photo { display: block; width: auto; max-width: 0.75in; height: auto; max-height: 0.6in; object-fit: contain; }
table.products td.col-name, table.products th.col-name,
table.products td.col-location, table.products th.col-location,
table.products th.col-purchase_date { white-space:normal; overflow:hidden; text-overflow:clip; }
table.products th.col-photo { white-space:nowrap; overflow:visible; }
table.products td.col-name { font-weight: 600; }
table.products td.col-name a.record-link { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.products-scroll { max-width: 100%; }
table.products .col-view { width: 2.2rem; }
table.products .col-thumb, table.products .col-photo { width: 4.8rem; }
table.products th.col-photo a { white-space: nowrap; }
table.products .col-stk { width: 5.2rem; }
table.products .col-active { width: 4.6rem; }
table.products .col-purchase_date { width: 7.4rem; }
@media (max-width: 1023px) {
  .products-scroll { overflow-x: auto; }
  table.products { width: max-content; min-width: 64rem; table-layout: auto; }
}
@media (min-width: 1024px) {
  .products-scroll { overflow-x: hidden; }
  table.products col { width: auto !important; }
  table.products th.col-actions, table.products td.col-actions { width: 7.5rem; overflow: hidden; }
  table.products .row-actions { display: flex; flex-wrap: wrap; gap: .15rem; }
  table.products .row-actions a, table.products .row-actions .btn, table.products .row-actions button { font-size: .75rem; padding: .05rem .3rem; }
}
table.products td.col-name .mobile-meta { display:none; font-weight:400; font-size:.8rem; }
table.products .col-thumb { width:4.8rem; }
table.products th { position:relative; }
.col-resize { position:absolute; top:0; right:0; width:8px; height:100%; cursor:col-resize; z-index:2; touch-action:none; }
.col-resize:hover { background:rgba(15,23,42,.18); }
table.products.sized { table-layout:fixed; }
table.products.sized th, table.products.sized td { overflow:hidden; text-overflow:ellipsis; }
table.products.sized td.col-name, table.products.sized th.col-name,
table.products.sized td.col-location, table.products.sized th.col-location,
table.products.sized th.col-purchase_date, table.products.sized th.col-photo { text-overflow:clip; white-space:normal; }
table.products.sized th.col-actions, table.products.sized td.col-actions { overflow:hidden; text-overflow:clip; }
.column-chooser-reset { display:flex; justify-content:flex-end; margin:.4rem 0 0; }
table.products th.col-actions { width:7.5rem; text-align:right; }
.column-gear { border:0; background:transparent; color:#475569; padding:.2rem; line-height:0; border-radius:4px; cursor:pointer; }
.column-gear:hover, .column-gear:focus-visible { background:#e2e8f0; color:#0f172a; }
dialog#column-chooser { width:min(32rem, 94vw); max-height:min(40rem, 90vh); overflow:auto; }
dialog#column-chooser::backdrop { background:rgba(15,23,42,.45); }
dialog#column-chooser h2 { margin:0 0 .3rem; }
.column-chooser-list { list-style:none; margin:.6rem 0; padding:0; }
.column-chooser-list li { display:flex; align-items:center; gap:.35rem; padding:.28rem .15rem; border-bottom:1px solid var(--line); background:#fff; cursor:grab; }
.column-chooser-list li label { flex:1; cursor:pointer; }
.column-chooser-actions { display:flex; gap:.5rem; justify-content:flex-end; margin-top:.6rem; }
table.products .col-qty, table.products .col-price { text-align:right; }
table.products tr.low { background:#fff7f7; }
table.products tr.inactive td { opacity:.65; }
table.products code, .task-product-line code, .product-details code { font-size:.85rem; }
@media (max-width:760px) {
  .products-scroll { overflow-x: hidden; }
  table.products { width: 100%; min-width: 0; table-layout: fixed; }
  table.products .col-category, table.products .col-location, table.products .col-sku, table.products .col-vin, table.products .col-year { display:none; }
  table.products td.col-name .mobile-meta { display:block; }
  table.products td.col-actions a:not(.btn) { display:none; }
  table.products td { white-space:normal; }
}

.product-layout { display:grid; grid-template-columns:minmax(0, 1.1fr) minmax(0, 1fr); gap:0 1rem; align-items:start; }
@media (max-width:860px) { .product-layout { grid-template-columns:1fr; } }
.panel-title { font-size:1rem; margin:.2rem 0 .6rem; }
.gallery-main { background:#f8fafc; border:1px solid var(--line); border-radius:6px; display:flex; align-items:center; justify-content:center; min-height:16rem; max-height:26rem; overflow:hidden; }
.gallery-main img { max-width:100%; max-height:26rem; object-fit:contain; }
.gallery-thumbs { list-style:none; padding:0; margin:.6rem 0; display:flex; flex-wrap:wrap; gap:.5rem; }
.gallery-thumb { position:relative; display:flex; flex-direction:column; align-items:center; gap:.2rem; }
.gallery-pick { padding:0; border:2px solid var(--line); border-radius:6px; background:#fff; cursor:pointer; line-height:0; }
.gallery-pick img { width:64px; height:64px; object-fit:cover; border-radius:4px; }
.gallery-thumb.is-uploading { align-items:flex-start; max-width:8rem; font-size:.75rem; }
.gallery-thumb.is-uploading img { width:64px; height:64px; object-fit:cover; }
.gallery-thumb.is-uploading progress { width:4.5rem; }
.gallery-thumb.is-main .gallery-pick { border-color:var(--brand); }
.gallery-thumb.is-selected .gallery-pick { outline:2px solid var(--accent); }
.gallery-badge { position:absolute; top:2px; left:2px; background:var(--brand); color:#fff; font-size:.65rem; padding:0 .3rem; border-radius:3px; }
.gallery-tools { display:flex; gap:.15rem; }
.product-image-form .logo-field { margin:0; }
.product-form-image { margin:.75rem 0 1rem; max-width:40rem; }
.product-form-image .logo-field { margin:0; }

.stock-history { width:100%; border-collapse:collapse; }
.stock-history th, .stock-history td { padding:.25rem .5rem; border-bottom:1px solid var(--line); text-align:left; }
.stock-history .num, .import-preview .num { text-align:right; font-variant-numeric:tabular-nums; }
.stock-history .neg { color:#b91c1c; font-weight:600; }
.stock-history .pos { color:#15803d; font-weight:600; }
.table-scroll { overflow-x:auto; }
.used-on-tasks { margin:.3rem 0; padding-left:1.1rem; }
.product-stock-head { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.stock-form { max-width:36rem; }
.stock-form fieldset label { display:block; margin:.2rem 0; }

.import-preview { border-collapse:collapse; width:100%; background:#fff; font-size:.9rem; }
.import-preview th, .import-preview td { padding:.25rem .45rem; border-bottom:1px solid var(--line); text-align:left; }
.import-preview tr.import-error { background:#fff1f2; }
.import-preview tr.import-skip td { opacity:.6; }
.import-preview tr.import-update .import-action { color:#1d4ed8; font-weight:600; }
.import-preview tr.import-create .import-action { color:#15803d; font-weight:600; }
.import-errors { color:#b91c1c; }

/* Task page Products section */
.product-picker { position:relative; margin:.4rem 0 .6rem; }
.product-picker-input { width:100%; padding:.5rem .65rem; font-size:1rem; box-sizing:border-box; }
.product-results { position:absolute; z-index:30; left:0; right:0; top:100%; margin:0; padding:0; list-style:none; background:#fff;
  border:1px solid var(--line); border-radius:0 0 6px 6px; box-shadow:0 6px 18px rgba(15,23,42,.12); max-height:22rem; overflow-y:auto; }
.product-result { display:grid; grid-template-columns:32px minmax(0, 1fr) auto auto auto; align-items:center; gap:.6rem; padding:.35rem .6rem; cursor:pointer; border-bottom:1px solid #f1f5f9; }
.product-result.active, .product-result:hover { background:#eef2ff; }
.product-result .pr-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; }
.product-result .pr-price { min-width:4.5rem; text-align:right; font-weight:600; }
.product-result-empty { padding:.5rem .6rem; }
@media (max-width:600px) { .product-result { grid-template-columns:32px minmax(0, 1fr) auto; } .product-result .pr-sku, .product-result .pr-stock { display:none; } }
.task-product-lines { list-style:none; margin:0; padding:0; border:1px solid var(--line); border-radius:6px; }
.task-product-line { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; padding:.35rem .6rem; border-bottom:1px solid var(--line); }
.task-product-line:last-child { border-bottom:0; }
.tpl-name { flex:1 1 14rem; min-width:10rem; display:flex; flex-direction:column; }
.tpl-name a { font-weight:600; }
.tpl-form { display:inline-flex; gap:.5rem; align-items:center; margin:0; }
.tpl-form input[type=number] { width:5.5rem; }
.tpl-qty input[type=number] { width:4.5rem; }
.tpl-total { min-width:5.5rem; text-align:right; font-variant-numeric:tabular-nums; }
.task-products-foot { display:flex; justify-content:space-between; align-items:center; gap:.6rem; flex-wrap:wrap; margin-top:.5rem; }
.task-products-total strong { font-size:1.05rem; }
.small-note { font-size:.8rem; }
.task-products-badge { display:inline-flex; align-items:center; gap:.2rem; margin-right:.4rem; vertical-align:middle; }
.task-products-badge .plus-n { font-size:.7rem; font-weight:700; background:#e2e8f0; color:#334155; border-radius:8px; padding:0 .35rem; }

/* New / edit product form: label left, input right, in the legacy order. */
.status.ntf-leased { display:inline-block; margin-left:.35rem; background:#e0e7ff; color:#3730a3; font-size:.72rem; font-weight:700; padding:.05rem .4rem; border-radius:3px; white-space:nowrap; vertical-align:middle; }
.ntf-lease-link { margin-left:.35rem; font-size:.85rem; }
.category-results { display:flex; align-items:center; gap:.6rem; margin:.8rem 0; }
.category-results select { width:auto; }
.categories { width:100%; border-collapse:collapse; }
.categories th { text-align:left; border-bottom:1px solid var(--line); padding:.4rem .5rem; }
.categories td { padding:.35rem .5rem; vertical-align:top; border-bottom:1px solid #f3f4f6; }
.category-parent td { background:#f7f7f7; }
.category-parent-name { color:#7a1c2e; font-weight:700; }
.category-child td:first-child { padding-left:1.6rem; }
.category-grandchild td:first-child { padding-left:3.2rem; }
.category-meta { color:#6b7280; font-size:.85rem; font-weight:400; margin-left:.25rem; }
.category-controls { text-align:right; width:8rem; }
.category-controls a, .category-controls button, .category-controls .category-control {
  display:block; background:none; border:0; padding:0; margin:0 0 .15rem auto; color:#6b7280;
  font-size:.72rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase; cursor:pointer;
}
.make-row td { vertical-align:middle; }
.make-name { color:#7a1c2e; font-weight:700; }
.make-models { margin:.25rem 0 0; padding-left:1.15rem; }
.make-models li { margin:0; }
.make-model-filter { display:flex; flex-wrap:wrap; gap:.4rem .6rem; }
.make-model-filter select { width:auto; min-width:8rem; }
.credit-app-search { margin:.6rem 0; }
.credit-app-search input { width:100%; max-width:100%; box-sizing:border-box; background:#f3f4f6; border:1px solid #e5e7eb; padding:.55rem .7rem; }
.credit-apps th a { color:#7a1c2e; text-decoration:none; }
.credit-app-view { text-transform:uppercase; letter-spacing:.04em; font-size:.72rem; padding:.15rem .45rem; }
.oem-name { color:#7a1c2e; font-weight:700; }
.product-subnav { display:flex; flex-wrap:wrap; gap:1.25rem; margin:0 0 .75rem; border-bottom:1px solid var(--line); }
.product-subnav a { padding:.45rem 0; border-radius:0; text-decoration:none; background:none; color:#7a1c2e; font-weight:700; border-bottom:3px solid transparent; }
.product-subnav a[aria-current="page"] { border-bottom-color:#7a1c2e; }
.product-command-row { display:flex; flex-wrap:wrap; gap:.55rem; margin:0 0 .8rem; }
.product-command { text-transform:uppercase; letter-spacing:.04em; font-weight:700; }
.legacy-product-filters { display:flex; flex-direction:column; align-items:flex-start; gap:.55rem; margin:0 0 1rem; }
.legacy-product-filters .product-search { width:100%; max-width:100%; box-sizing:border-box; background:#f3f4f6; border:1px solid #e5e7eb; padding:.55rem .7rem; }
#product-filter-panel { width:100%; border:1px solid var(--line); background:#fff; padding:.8rem .9rem; box-sizing:border-box; }
.pf-layout { display:grid; grid-template-columns:minmax(12rem, 16rem) minmax(0, 1fr); gap:.8rem 1.2rem; }
.pf-radios { border:0; margin:0; padding:0; display:flex; flex-direction:column; gap:.2rem; }
.pf-radios legend { font-weight:700; padding:0; margin:0 0 .2rem; }
.pf-archived { flex-direction:row; flex-wrap:wrap; gap:.35rem 1rem; margin:0 0 .6rem; }
.pf-dates { display:flex; flex-wrap:wrap; align-items:center; gap:.35rem; margin-top:.45rem; }
.pf-dates input { max-width:9.5rem; }
.pf-checks { display:flex; flex-direction:column; gap:.15rem; margin-top:.7rem; }
.pf-check { display:flex; align-items:center; gap:.35rem; }
.pf-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:.45rem .8rem; }
.pf-grid label { display:flex; flex-direction:column; gap:.15rem; font-weight:700; font-size:.82rem; min-width:0; }
.pf-grid input { font-weight:400; width:100%; box-sizing:border-box; }
.pf-spacer { display:block; }
.pf-search-row { margin:.9rem 0 .15rem; }
.pf-search { background:#7a1c2e; color:#fff; border:0; font-weight:800; letter-spacing:.08em; text-transform:uppercase; padding:.7rem 1.75rem; font-size:1rem; }
.pf-library { display:flex; flex-wrap:wrap; align-items:center; gap:.45rem .8rem; margin-top:.8rem; padding-top:.7rem; border-top:1px solid var(--line); }
.pf-library .pf-filter-name { display:none; }
.pf-library:has(#save-filter:checked) .pf-filter-name,
.pf-library:has(.save-filter-toggle:checked) .pf-filter-name { display:inline-flex; }
.pf-library .pf-saved { display:inline-flex; align-items:center; gap:.35rem; font-weight:700; }
.pf-library select, .pf-library input[type=text] { font-weight:400; }
.saved-filter-list { list-style:none; display:flex; flex-wrap:wrap; gap:.4rem .8rem; margin:.4rem 0 .8rem; padding:0; }
.saved-filter-list li { display:inline-flex; flex-wrap:wrap; align-items:center; gap:.35rem; }
.saved-filter-list input[type=text] { width:10rem; }
@media (max-width:900px) {
  .pf-layout { grid-template-columns:1fr; }
  .pf-grid { grid-template-columns:1fr; }
  .pf-spacer { display:none; }
}
.product-title { color:#7a1c2e; font-size:1.35rem; }
.product-neighbors { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin:0 0 .8rem; }
.product-neighbors a { color:#7a1c2e; font-weight:700; text-decoration:none; }
.product-list-link { color:#7a1c2e; display:inline-flex; }
.legacy-actions { display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; margin:0 0 .7rem; }
.legacy-actions .legacy-action, .legacy-card .legacy-action { background:#f3f4f6; color:#111; border:1px solid #d1d5db; text-transform:uppercase; font-size:.75rem; letter-spacing:.03em; font-weight:700; }
.product-public-url { margin:.2rem 0 .8rem; }
.view-product-details { margin:0 0 1rem; }
.view-product-details > summary { list-style:none; cursor:pointer; display:inline-flex; align-items:center; gap:.45rem; border:1px solid var(--line); background:#fff; padding:.45rem .75rem; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.view-product-details > summary::-webkit-details-marker { display:none; }
.view-product-details > summary::after { content:""; width:.45rem; height:.45rem; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(-45deg); }
.view-product-details[open] > summary::after { transform:rotate(45deg); }
.view-product-details > .legacy-fields { margin-top:.6rem; }
.legacy-card { background:#f3f4f6; border:1px solid #e5e7eb; padding:.9rem 1rem 1rem; margin:0 0 1rem; }
.legacy-card h2 { margin:.1rem 0 .7rem; font-size:1.05rem; }
.legacy-post { display:block; width:100%; background:#7a1c2e; color:#fff; border:0; font-weight:800; letter-spacing:.12em; padding:.7rem 1rem; margin:.6rem 0 .8rem; }
.comm-media { margin:.45rem 0; }
.comm-media-input { display:block; margin-top:.25rem; }
.comm-entry { display:grid; grid-template-columns:auto 1fr; gap:.15rem .6rem; border-top:1px solid #e5e7eb; padding:.45rem 0; background:#fff; }
.comm-tools { grid-row:span 2; display:flex; gap:.25rem; align-items:flex-start; }
.comm-who { font-weight:700; }
.comm-when { color:#6b7280; font-size:.85rem; }
.comm-body { grid-column:1 / -1; margin:0; }
.product-form .legacy-save { background:#7a1c2e; color:#fff; border:0; font-weight:800; letter-spacing:.08em; padding:.75rem 1.5rem; font-size:1.05rem; }
.product-form .legacy-fields { border:1px solid var(--line); margin:0 0 1.25rem; }
.product-form .legacy-row, .product-form fieldset.legacy-row { display:grid; grid-template-columns:minmax(9rem,16rem) minmax(0,1fr); border-bottom:1px solid var(--line); margin:0; max-width:none; gap:0; align-items:stretch; }
.product-form fieldset.legacy-row { border-left:0; border-right:0; border-top:0; padding:0; min-inline-size:0; }
.product-form .legacy-label { text-align:right; font-weight:700; padding:.65rem .8rem; background:#f7f7f7; border-right:1px solid var(--line); }
.product-form .legacy-input { padding:.55rem .75rem; min-width:0; }
.product-form .legacy-input input[type=text], .product-form .legacy-input input[type=number], .product-form .legacy-input input[type=url],
.product-form .legacy-input input[type=date], .product-form .legacy-input input[type=datetime-local], .product-form .legacy-input select,
.product-form .legacy-input textarea { width:100%; max-width:100%; box-sizing:border-box; font-size:16px; }
.product-form .legacy-inline, .product-form .pair { display:flex; flex-wrap:wrap; gap:.6rem 1rem; align-items:center; }
.product-form .money { display:inline-flex; align-items:center; gap:.3rem; }
.product-form .money input, .product-form .short-num { width:8rem; }
.product-form .short-num { width:6rem; }
.product-form .title-line, .product-form .order-line { margin-top:.4rem; }
.product-form .title-line strong, .product-form .order-label { color:#6b7280; font-size:.8rem; }
.product-form .text-add, .product-form .row-remove { background:none; border:0; color:#9b1c1c; cursor:pointer; font:inherit; padding:0; }
.product-form .row-remove { font-size:1.15rem; line-height:1; }
.product-form .csr-row, .product-form .nested-row { display:flex; flex-wrap:wrap; gap:.45rem .7rem; align-items:center; margin:0 0 .45rem; }
.product-form .nested-row .autocomplete, .product-form .legacy-input .autocomplete { flex:1 1 14rem; min-width:0; }
.receipt-drop { border:1px dashed #b9b9b9; border-radius:6px; padding:.45rem .6rem; min-width:12rem; background:#fff; }
.receipt-drop.is-over { outline:2px solid #3d9a4a; }
.receipt-drop-hint { margin:0 0 .25rem; color:#6b7280; font-size:.85rem; }
.cost-form, #add-cost { display:flex; flex-wrap:wrap; gap:.45rem .7rem; align-items:flex-start; margin:0 0 .45rem; }
.cost-lines { list-style:none; margin:0; padding:0; }
.cost-lines > li { border-bottom:1px solid var(--line); padding:.45rem 0; }
.cost-receipts { list-style:none; margin:.25rem 0 0; padding:0; }
.image-boxes { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; margin-top:.6rem; }
@media (max-width:760px) { .image-boxes { grid-template-columns:1fr; } }
.image-box { border:2px dashed #b9b9b9; border-radius:6px; min-height:8rem; padding:.65rem; background:#fff; }
.image-box.public { border-color:#3d9a4a; background:#f3faf4; }
.image-box.stored { border-color:#9aa0a6; background:#f5f5f5; }
.image-box.is-over { outline:2px solid #3d9a4a; }
.image-box-head { display:flex; justify-content:space-between; align-items:center; gap:.5rem; }
.image-box-head h3 { margin:0; letter-spacing:.04em; font-size:.95rem; }
.image-box.public .image-box-head h3 { color:#2e7d32; }
.image-box.stored .image-box-head h3 { color:#5f6368; }
.image-box-hint { color:#6b7280; margin:.35rem 0; font-size:.85rem; }
.image-box .image-file { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.image-box .gallery-tools { flex-wrap:wrap; justify-content:center; max-width:11rem; }
.product-form .image-drop { border:2px dashed #b9b9b9; border-radius:6px; min-height:7rem; padding:.75rem; margin:.45rem 0; position:relative; }
.product-form .image-drop.public { border-color:#3d9a4a; background:#f3faf4; }
.product-form .image-drop.private { border-color:#9aa0a6; background:#f5f5f5; }
.product-form .image-drop.is-over { outline:2px solid #3d9a4a; }
.product-form .image-drop-head { display:flex; justify-content:space-between; align-items:center; font-weight:700; letter-spacing:.04em; }
.product-form .image-drop.public .image-drop-head { color:#2e7d32; }
.product-form .image-drop.private .image-drop-head { color:#5f6368; }
.product-form .image-drop-hint { color:#6b7280; margin:.35rem 0 0; }
.product-form .image-file { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.product-form .comm-log { list-style:none; margin:.6rem 0 0; padding:0; }
.product-form .comm-log li, .comm-log li { border-top:1px solid var(--line); padding:.45rem 0; }
.product-form .hide-admins { display:inline-flex; gap:.35rem; align-items:center; margin-top:.35rem; }
.product-form h2.product-section { font-size:1.15rem; margin:1.25rem 0 .6rem; }
.product-form details.sales-commissions { background:#fff; border:1px solid var(--line); border-radius:0; padding:0; margin:0 0 1.25rem; }
.product-form details.sales-commissions > summary { list-style:none; cursor:pointer; display:flex; flex-wrap:wrap; align-items:center; gap:.35rem .75rem; padding:.7rem .9rem; }
.product-form details.sales-commissions > summary::-webkit-details-marker { display:none; }
.product-form details.sales-commissions > summary::marker { content:""; }
.product-form .sales-commissions-chevron { width:.45rem; height:.45rem; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(-45deg); transition:transform .15s ease; flex:0 0 auto; }
.product-form details.sales-commissions[open] > summary .sales-commissions-chevron { transform:rotate(45deg); }
.product-form .sales-commissions-title { font-weight:700; }
.product-form .sales-commissions-note { color:var(--muted); font-weight:400; font-size:.9rem; }
.product-form details.sales-commissions > .legacy-fields { border:0; border-top:1px solid var(--line); margin:0; }
@media (prefers-reduced-motion: reduce) { .product-form .sales-commissions-chevron { transition:none; } }

/* Product show. Scoped so the edit form keeps its own label column. */
main:has(.product-show) { max-width: 1280px; }
.product-show {
  --brand: #1d3557;
  --accent: #e63946;
  --maroon: #7a1c2e;
  --link: #9b1c1c;
  --bg: #f6f7f9;
  --line: #dfe3e8;
  --muted: #6b7280;
  --label-bg: #f7f7f8;
  --ok: #2e7d32;
}
.product-show .show-head { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); margin: 0 -1rem 0; padding: 10px 1rem; }
.product-show .show-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.product-show .title-block { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.product-show .show-title h1 { margin: 0; font-size: 22px; color: var(--maroon); }
.product-show .badges { display: inline-flex; gap: 6px; align-items: center; }
.product-show .badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid; letter-spacing: 0; text-transform: none; }
.product-show .badge.on { color: var(--ok); border-color: #a7d3aa; background: #eef8ef; }
.product-show .badge.off { color: var(--muted); border-color: var(--line); background: #fff; }
.product-show .show-title .stock-badge { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid #d1d5db; background: #fff; color: #111; }
.product-show .product-neighbors { margin-left: auto; display: flex; gap: 14px; align-items: center; font-size: 13px; white-space: nowrap; }
.product-show .show-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; align-items: center; }
.product-show .show-actions .btn,
.product-show .show-actions details.more > summary,
.product-show .mobile-bar .btn,
.product-show .mobile-bar details.more > summary {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; text-transform: uppercase;
  padding: 8px 11px; border: 1px solid #d1d5db; background: #fff; color: #111; border-radius: 5px; white-space: nowrap;
  text-decoration: none; cursor: pointer; line-height: 1.2; font-family: inherit;
}
.product-show .show-actions .btn.primary,
.product-show .mobile-bar .btn.primary,
.product-show #product-edit { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.product-show .more-menu .btn.danger { color: #b91c1c; border-color: #f1b4b4; background: #fff; }
.product-show details.more { position: relative; }
.product-show details.more > summary { list-style: none; }
.product-show details.more > summary::-webkit-details-marker { display: none; }
.product-show .more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 14rem; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(15, 23, 42, .12); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.product-show .more-menu .btn,
.product-show .more-menu form { width: 100%; }
.product-show .more-menu .btn { justify-content: flex-start; text-transform: none; white-space: normal; text-align: left; }
.product-show .more-menu form button { width: 100%; }
.product-show .mobile-bar { display: none; }
.product-show .glance { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; margin: 16px 0; align-items: start; }
.product-show .glance-photo { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; min-height: 0; display: block; }
.product-show .glance-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; border-radius: 5px; }
.product-show .facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; align-self: start; margin: 0; padding: 0; gap: 0; }
.product-show .facts div { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.product-show .facts dt { font-size: 11.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.product-show .facts dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; color: #111; overflow-wrap: anywhere; }
.product-show .product-public-url { margin: 0 0 16px; }
.product-show .product-public-url a,
.product-show a.record-link { color: var(--link); font-weight: 700; }
.product-show a.record-link { text-decoration: underline; }
.product-show .card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.product-show .field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 22px; padding: 16px 18px 18px; }
.product-show .field-grid .fact { min-width: 0; }
.product-show .field-grid .fact.wide { grid-column: 1 / -1; }
.product-show #used-on-tasks { margin: 18px 0; }
.product-show #used-on-tasks .product-task-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.product-show #used-on-tasks .table-scroll { overflow-x: auto; }
.product-show .csr-list { list-style: none; margin: 0; padding: 0; }
.product-show .csr-list li { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.product-show form.csr-add { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .45rem; }
.product-show form.csr-add select { width: auto; max-width: 100%; flex: 1 1 10rem; }
.product-show .fact .label { display: block; font-size: 13px; font-weight: 700; color: #374151; margin: 0 0 4px; }
.product-show .fact .value { font-size: 16px; line-height: 1.45; color: #111; overflow-wrap: anywhere; }
.product-show .fact.is-muted .value { color: #6b7280; font-weight: 500; }
.product-show .show-card .rich-value { font-size: 16px; line-height: 1.5; }
.product-show .show-card .rich-value p { margin: 0 0 .6rem; }
.product-show .card,
.product-show section.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; padding: 0; margin: 0; }
.product-show .span-2 { grid-column: 1 / -1; }
.product-show #used-on-tasks,
.product-show details.fold { margin-top: 18px; }
.product-show .card > h2,
.product-show .card-head {
  margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .07em; color: var(--brand); font-weight: 700;
  padding: 11px 14px; border-bottom: 2px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  gap: 10px; background: #fbfbfc; flex-wrap: wrap;
}
.product-show .card-head h2 { margin: 0; padding: 0; border: 0; background: transparent; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.product-show .show-card > h2 { font-size: 16px; letter-spacing: 0; text-transform: none; color: #111; }
.product-show .card-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.product-show .card h3,
.product-show .cost-head h3 { margin: 0; font-size: 12.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.product-show dl.rows { display: grid; grid-template-columns: minmax(150px, 38%) minmax(0, 1fr); margin: 0; padding: 0; gap: 0; background: transparent; border: 0; }
.product-show dl.rows > .row-label { margin: 0; font-weight: 700; text-align: right; padding: 8px 12px; background: var(--label-bg); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13.5px; color: #111; }
.product-show dl.rows > .row-value { margin: 0; padding: 8px 12px; min-width: 0; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); background: #fff; color: #111; }
.product-show .mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.product-show .flag { margin-left: .6rem; color: var(--muted); font-weight: 600; }
.product-show .title-flags { display: flex; flex-wrap: wrap; gap: .35rem .8rem; align-items: center; }
.product-show .check { display: inline-flex; width: 1.1rem; height: 1.1rem; align-items: center; justify-content: center; border: 1px solid #d1d5db; border-radius: 2px; font-size: .8rem; }
.product-show .check.on { background: #eef8ef; border-color: #a7d3aa; color: var(--ok); }
.product-show .split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0; align-items: start; }
.product-show .split > .rows { border-right: 1px solid var(--line); }
.product-show .cost-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0; padding: 10px 14px 6px; border-bottom: 1px solid var(--line); }
.product-show table.costs { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.product-show table.costs th { font-size: 11px; text-transform: uppercase; color: var(--muted); text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); background: #fbfbfc; font-weight: 700; }
.product-show table.costs td { padding: 4px 10px; border-bottom: 1px solid #eef0f3; vertical-align: top; line-height: 1.35; }
.product-show table.costs tbody tr:nth-child(even) td { background: #fcfcfd; }
.product-show table.costs .cost-when { width: 84px; white-space: nowrap; }
.product-show table.costs .num { width: 96px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.product-show table.costs .cost-tools { width: 52px; text-align: center; white-space: nowrap; }
.product-show table.costs td.cost-desc { min-width: 0; overflow: hidden; }
.product-show .clip { display: block; width: 100%; max-width: 100%; text-align: left; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-show .clip.is-open { white-space: normal; }
.product-show .receipt-link { position: relative; text-decoration: none; }
.product-show .receipt-name { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.product-show .cost-edit { margin-top: .45rem; }
.product-show .cost-receipts { margin: .35rem 0 0; padding-left: 1.1rem; }
.product-show .totals { border-top: 2px solid var(--line); font-variant-numeric: tabular-nums; margin: 0; }
.product-show .totals p { display: flex; justify-content: space-between; gap: 1rem; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 14px; margin: 0; }
.product-show .totals p span:first-child { font-weight: 700; }
.product-show .totals .grand { background: #fdf2f3; font-size: 16.5px; border-bottom: 0; }
.product-show .totals .grand span,
.product-show .totals .grand strong { font-weight: 800; color: var(--maroon); }
.product-show .spec-html { columns: 2; column-gap: 1.5rem; }
.product-show .spec-html > * { break-inside: avoid; }
.product-show .product-gallery { padding: 12px 14px 14px; }
.product-show .gallery-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.product-show .gallery-pick img { width: 84px; height: 63px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.product-show .gallery-badge { letter-spacing: .04em; }
.product-show #images, .product-show #costs, .product-show #documents, .product-show #stock { scroll-margin-top: 5.5rem; }
.product-show table.task-table { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; }
.product-show table.task-table th,
.product-show table.task-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.product-show .status-pill { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.product-show .status-pill.open { background: #e0e7ff; color: #3730a3; }
.product-show .status-pill.complete { background: #eef8ef; color: var(--ok); }
.product-show details.fold { border: 1px solid var(--line); border-radius: 8px; background: #f3f4f6; overflow: hidden; }
.product-show details.fold > summary { cursor: pointer; font-weight: 800; padding: 11px 14px; color: var(--maroon); }
.product-show details.fold > .fold-body { padding: 0 14px 14px; background: #fff; }
@media (max-width: 760px) {
  .product-show { padding-bottom: 4.5rem; }
  .product-show .show-head { margin: 0 -12px; padding: 8px 12px; }
  .product-show .title-block { flex-basis: 100%; }
  .product-show .show-title h1 { font-size: 18px; }
  .product-show .product-neighbors { margin-left: 0; white-space: normal; flex-wrap: wrap; }
  .product-show .show-actions { display: none; }
  .product-show .mobile-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff;
    border-top: 1px solid var(--line); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); gap: 6px; align-items: stretch;
  }
  .product-show .mobile-bar .btn,
  .product-show .mobile-bar details.more { flex: 1; }
  .product-show .mobile-bar form.inline { display: flex; flex: 1; margin: 0; }
  .product-show .mobile-bar .btn,
  .product-show .mobile-bar details.more > summary { flex: 1; justify-content: center; padding: 11px 6px; width: 100%; }
  .product-show .mobile-bar .more-menu { top: auto; bottom: calc(100% + 6px); right: 0; max-height: 70vh; overflow: auto; }
  .product-show .mobile-bar .more-menu .btn { justify-content: flex-start; text-align: left; width: 100%; }
  .product-show .glance,
  .product-show .card-grid,
  .product-show .field-grid,
  .product-show .split,
  .product-show .spec-html { grid-template-columns: 1fr; }
  .product-show .spec-html { columns: 1; }
  .product-show .span-2 { grid-column: auto; }
  .product-show .facts { grid-template-columns: 1fr 1fr; }
  .product-show .split > .rows { border-right: 0; }
  .product-show dl.rows { grid-template-columns: 40% minmax(0, 1fr); }
  .product-show dl.rows > .row-label { text-align: left; padding: 7px 10px; font-size: 12.5px; }
  .product-show dl.rows > .wide { grid-column: 1 / -1; }
  .product-show dl.rows > .row-label.wide { border-right: 0; }
  .product-show table.costs,
  .product-show table.costs tbody,
  .product-show table.task-table,
  .product-show table.task-table tbody { display: block; width: 100%; }
  .product-show table.costs thead,
  .product-show table.task-table thead { display: none; }
  .product-show table.costs tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; column-gap: 8px; padding: 6px 12px; border-bottom: 1px solid #eef0f3; }
  .product-show table.costs td { display: block; padding: 0; border: 0; width: auto; background: transparent; }
  .product-show table.costs .cost-when { grid-column: 1; grid-row: 1; }
  .product-show table.costs .cost-desc { grid-column: 1 / 4; grid-row: 2; }
  .product-show table.costs .num { grid-column: 3; grid-row: 1; text-align: right; }
  .product-show table.costs .cost-tools { grid-column: 4; grid-row: 1 / 3; align-self: center; }
  .product-show .gallery-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .product-show .gallery-pick img { width: 100%; height: auto; aspect-ratio: 4/3; }
  .product-show table.task-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; padding: 9px 12px; border-bottom: 1px solid var(--line); }
  .product-show table.task-table td { padding: 0 6px 0 0; border: 0; }
}

@media print {
  .product-subnav,
  .product-show .product-subnav,
  .product-show .show-actions,
  .product-show .mobile-bar,
  .product-show .product-neighbors,
  .product-show .card-actions,
  .product-show .btn,
  .product-show button,
  .product-show .product-gallery,
  .product-show .gallery-thumbs,
  .product-show .image-boxes { display: none !important; }
  .product-show .show-head { position: static !important; background: #fff; border: 0; }
  .product-show .show-title { padding-right: 1.7in; }
  .product-show .glance { display: block; break-inside: avoid; page-break-inside: avoid; }
  .product-show .glance-photo {
    float: right;
    width: 1.5in;
    margin: -1.7em 0 6pt 10pt;
    border: 0;
    padding: 0;
    background: transparent;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .product-show .glance-photo img,
  #product-advertisement-sheet img {
    display: block !important;
    width: 1.5in !important;
    max-width: 1.5in !important;
    height: auto !important;
    max-height: 1.25in !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  #product-advertisement-sheet img ~ img { display: none !important; }
}

@media (max-width:700px) {
  .product-form .legacy-row, .product-form fieldset.legacy-row { grid-template-columns:1fr; }
  .product-form .legacy-label { text-align:left; border-right:0; border-bottom:1px solid var(--line); }
  .product-form .money input, .product-form .short-num { width:100%; }
  .product-form .image-drop { min-height:8.5rem; }
  .product-subnav a { padding:.55rem 0; }
}
