/* ux-polish-r79.css — additive styling for the R79 UX batch (staging). */

/* §7 Colored toasts on top of the r54 feedback region — aligned to the native DARK
   panel pattern (bg #161922, ink #f0f2f5, elevated border, app shadow). The semantic
   meaning is carried by the LEFT ACCENT BAR + the TITLE colour, NOT a light tinted
   background (the old pastel #fef2f2 etc. clashed with the dark console). success =
   green, error = red, warning = amber, info = blue. */
.pp-feedback-region{position:fixed;top:74px;right:14px;z-index:2147483000;display:flex;flex-direction:column;gap:8px;max-width:min(92vw,380px)}
.pp-feedback-toast{background:#161922!important;color:#f0f2f5!important;border:1px solid #2a2f3d!important;border-left-width:6px!important;border-radius:12px;font-weight:600!important;box-shadow:0 8px 30px rgba(0,0,0,.4)!important}
.pp-feedback-toast>strong{display:block;font-size:.9rem;margin-bottom:2px}
.pp-feedback-toast>span{font-weight:500;line-height:1.4;color:#f0f2f5!important}
.pp-feedback-toast>button{color:#a0a7b9!important}
.pp-feedback-toast>button:hover{color:#f0f2f5!important}
.pp-feedback-toast.ok{border-left-color:#16a34a!important}.pp-feedback-toast.ok>strong{color:#4ade80!important}
.pp-feedback-toast.error{border-left-color:#dc2626!important}.pp-feedback-toast.error>strong{color:#f87171!important}
.pp-feedback-toast.warning{border-left-color:#d97706!important}.pp-feedback-toast.warning>strong{color:#fbbf24!important}
.pp-feedback-toast.info{border-left-color:#2563eb!important}.pp-feedback-toast.info>strong{color:#60a5fa!important}

/* §5 "2b · AI enrichment review" block — card header + consistent spacing with 2a/3 blocks. */
.r79-review-block{display:block;border:1px solid var(--line,#e2e8f0);border-radius:12px;padding:16px 16px 14px;margin:14px 0}
.r79-review-block>strong:first-child{display:block;font-size:1.02rem;line-height:1.3;margin-bottom:6px}
.r79-review-block>strong:first-child::before{content:"2b";display:inline-block;font-size:.72rem;font-weight:700;letter-spacing:.02em;color:#161922;background:#ff741f;border-radius:999px;padding:2px 9px;margin-right:8px;vertical-align:middle}
.r79-review-block .product-review-check{display:flex;align-items:center;gap:8px;margin-top:10px}
.r79-review-block .product-review-check input[type=checkbox]{width:18px;height:18px;flex:0 0 auto}
@media (max-width:640px){.r79-review-block .pub-editor-controls,.r79-review-block>div{flex-wrap:wrap}}

/* §1 fix — the app only styles these draft fields under a `.product-draft-review`
   wrapper that this block does not carry, so fieldset labels fall back to UA
   display:inline and their inline-block textareas baseline-align ~200px ABOVE the
   label text (the overlap), and the min-content fieldset forces a ~996px table.
   Re-scope the intended flex-column label layout onto .r79-review-block and allow it
   to shrink so the fields sit neatly under each label and fit the scroll container. */
.r79-review-block fieldset{min-width:0;border:1px solid var(--line,#2a2f3d);border-radius:8px;padding:12px;margin:8px 0}
.r79-review-block fieldset>label,.r79-review-block .form-2>label{display:flex;flex-direction:column;gap:6px;font-size:.8rem;font-weight:600;margin:14px 0}
.r79-review-block .form-2{min-width:0}
.r79-review-block textarea,.r79-review-block input:not([type=checkbox]){width:100%;min-width:0;box-sizing:border-box}
.r79-review-block textarea{resize:vertical}
.r79-review-block .product-review-check{flex-direction:row;align-items:flex-start}

/* §6 Header notification bell — injected INLINE into the header control cluster
   (div.admin-topbar-right) so it aligns with the theme/store/password/logout buttons
   on every viewport instead of floating as a fixed island over the content. */
#r79-bell{position:relative;display:inline-flex;align-items:center;z-index:40}
#r79-bell-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:8px;border:1px solid #2a2f3d;background:#1e222d;color:#f0f2f5;cursor:pointer;font-size:18px;line-height:1}
#r79-bell-badge{position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;padding:0 4px;border-radius:999px;background:#dc2626;color:#fff;font-size:11px;font-weight:700;display:none;align-items:center;justify-content:center}
#r79-bell-badge.show{display:inline-flex}
#r79-bell-panel{display:none;position:absolute;top:calc(100% + 22px);right:0;width:min(88vw,340px);max-height:60vh;overflow:auto;background:#161922;color:#f0f2f5;border:1px solid #2a2f3d;border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.4)}
#r79-bell-panel.open{display:block}
#r79-bell-panel header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid #2a2f3d;position:sticky;top:0;background:#161922}
#r79-bell-panel .btn{background:#1e222d!important;color:#f0f2f5!important;border:1px solid #2a2f3d!important}
#r79-bell-panel .btn:hover{border-color:#ff741f!important;color:#ff741f!important}
.r79-note{padding:10px 12px;border-bottom:1px solid #2a2f3d;cursor:pointer;color:#f0f2f5}
.r79-note:hover{background:#1e222d}
.r79-note .t{font-weight:600;font-size:.9rem;display:flex;gap:6px;align-items:center;color:#f0f2f5}
.r79-note .b{font-size:.82rem;color:#a0a7b9;margin-top:2px}
.r79-note .m{font-size:.72rem;color:#a0a7b9;margin-top:3px}
.r79-note.unread .t::before{content:"";width:8px;height:8px;border-radius:50%;background:#2563eb;display:inline-block}
.r79-note.sev-success .t::before{background:#16a34a}.r79-note.sev-error .t::before{background:#dc2626}.r79-note.sev-warning .t::before{background:#d97706}

/* §8 Publishing payment filter chips (explicit dark text so they read on light AND dark themes). */
.r79-pay-chips{display:inline-flex;gap:6px;align-items:center;margin-left:8px}
.r79-pay-chips button{border:1px solid #2a2f3d;background:#1e222d;color:#a0a7b9;border-radius:999px;padding:0 14px;height:38px;line-height:1;display:inline-flex;align-items:center;font-size:.82rem;cursor:pointer;font-weight:600}
.r79-pay-chips button:hover{border-color:#ff741f;color:#e2e8f0}
.r79-pay-chips button.active{background:#ff741f;color:#161922;border-color:#ff741f}

/* §4 Publishing single-row selection popup. */
#r79-rowpop{position:fixed;z-index:2147483050;display:none;gap:8px;align-items:center;background:#161922;color:#f0f2f5;border:1px solid #2a2f3d;border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.4);padding:8px 10px}
#r79-rowpop.open{display:flex}
#r79-rowpop img{width:34px;height:34px;object-fit:cover;border-radius:6px;background:#1e222d}
#r79-rowpop .nm{font-weight:600;font-size:.85rem;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#f0f2f5}
#r79-rowpop button{border:1px solid #2a2f3d;background:#1e222d;color:#f0f2f5;border-radius:8px;padding:5px 9px;font-size:.8rem;cursor:pointer}
#r79-rowpop button:hover{border-color:#ff741f;color:#ff741f}

/* §9 Merchandising "AI assist" panel REMOVED — the user does not want it in the
   project; the enhancer no longer injects it (the merchandisingDraft client method
   stays defined but unused so the invariant canary is untouched). */

/* §4 product thumbnail injected into each Publishing row (data already in the API). */
.r79-rowimg{width:34px;height:34px;object-fit:cover;border-radius:6px;vertical-align:middle;margin:0 8px 0 0;background:var(--surface-2,#1e222d);display:inline-block}

/* §12 Publishing table — ROOMY mode. Per the user's decision we NO LONGER shrink rows or
   clamp columns. That compaction was keyed off the JS-added .r79-pub-table class (stamped on a
   1.5s tick), which caused a visible "normal → small" jump after the data loaded. The app's
   natural table is kept as-is: tall rows, action buttons stacked in their own column, no
   horizontal overflow, Hide/Publish always reachable. Only the additive features remain —
   the product thumbnail and the per-row save-freeze pulse (full detail via the View popover). */
tr[data-barcode] .r79-rowimg{width:30px;height:30px}
.r79-rowimg-ph{background:#161922;border-radius:6px}
tr[data-barcode].r79-freezing>td{opacity:.5;pointer-events:none}
tr[data-barcode].r79-freezing{animation:r79freeze 1s ease-in-out infinite}
@keyframes r79freeze{0%,100%{background:transparent}50%{background:rgba(255,116,31,.14)}}
/* Roomy mode keeps the app's natural (996px) table, which overflows the 869px .table-scroll
   by ~127px at 1200px and pushes the Actions column past the right edge — with no reachable
   horizontal scrollbar (the scroller has no max-height). Pin the Actions column to the right
   edge so Publish/Hide/Enrichment/View stay visible at any scroll position, WITHOUT shrinking
   any row. Scoped off tr[data-barcode] + :has() so it applies on first paint (no class tick). */
/* .table{overflow:hidden} (from the app's index css) hijacks the sticky containing block: the
   table becomes the nearest scroll container and, since it never scrolls itself, the right:0
   inset resolves to 0 and the column never pins (same trap as the stock page's sticky header).
   Make the table non-scrolling so sticky resolves against the real overflow-x:.table-scroll. */
table:has(tr[data-barcode]){overflow:visible !important}
tr[data-barcode]>td:nth-child(8){position:sticky;right:0;background:#161922;z-index:1;border-left:1px solid #2a2f3d}
table:has(tr[data-barcode]) thead th:nth-child(8){position:sticky;right:0;background:#1e222d;z-index:2;border-left:1px solid #2a2f3d}

/* §12 view popover card — full un-truncated detail for the selected row.
   Literal self-consistent dark colors (NOT var(--ink)): the app defines --ink per
   theme (dark ink in light mode), which would render dark-on-dark and invisible here. */
.r79-viewpop{position:fixed;z-index:2147483060;display:flex;gap:12px;max-width:min(92vw,380px);background:#161922;color:#f0f2f5;border:1px solid #2a2f3d;border-radius:12px;box-shadow:0 8px 30px rgba(0,0,0,.4);padding:14px}
.r79-viewimg{width:96px;height:96px;object-fit:cover;border-radius:8px;background:#1e222d;flex:0 0 auto}
.r79-viewbody{flex:1;min-width:0}
.r79-viewpop h4{margin:0 0 8px;font-size:1rem;line-height:1.3;color:#f0f2f5;word-break:break-word}
.r79-vrow{display:flex;justify-content:space-between;gap:12px;font-size:.82rem;padding:3px 0;border-bottom:1px dashed #2a2f3d}
.r79-vrow span{color:#a0a7b9;flex:0 0 auto}
.r79-vrow b{color:#f0f2f5;text-align:right;font-weight:600;word-break:break-word}
.r79-viewacts{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}
.r79-viewacts a,.r79-viewacts button{border:1px solid #2a2f3d!important;background:#1e222d!important;color:#f0f2f5!important;border-radius:8px;padding:6px 10px;font-size:.8rem;cursor:pointer;text-decoration:none}
.r79-viewacts a:hover,.r79-viewacts button:hover{border-color:#ff741f;color:#ff741f}

/* §13 Stock table — the app declared .table-scroll overflow:auto but gave it NO max-height,
   so 25 rows ballooned the page to ~3100px; and each row was ~122px because the narrow
   "Shop has" column wrapped its muted note to 4 lines and the status pill to 2. Bound the
   scroll region (internal scroll + sticky header) and clamp the verbose muted/small lines to
   one line so rows go compact. Full per-product detail stays in the expandable Details row. */
.r79-stock-scroll{max-height:calc(100vh - 210px);overflow:auto}
/* the app sets .table{overflow:hidden}, which turns the table into the nearest scrollport and
   silently breaks the sticky header; make the table itself non-scrolling so sticky resolves
   against .r79-stock-scroll. */
.r79-stock-table{overflow:visible !important}
.r79-stock-scroll thead th{position:sticky;top:0;z-index:2;background:#1e222d}
.r79-stock-table th,.r79-stock-table td{padding:6px 8px;vertical-align:middle}
.r79-stock-table td .muted,.r79-stock-table td small{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
.r79-stock-table td:nth-child(5) .pill{white-space:nowrap}

/* §14 Publishing pager — additive client-side pagination so the heavy tabs
   (all / draft / missing images = thousands of rows) stay light. The enhancer shows
   100 rows per page and appends this bar after the .table-scroll, styled to the native panel. */
.r79-paged-out{display:none !important}
#r79-pub-pager{display:flex;gap:10px;align-items:center;margin-top:10px;background:#161922;border:1px solid #2a2f3d;border-radius:8px;padding:8px 12px;color:#f0f2f5}
#r79-pub-pager .ppg-info{margin-right:auto;font-size:.85rem;color:#a0a7b9}
#r79-pub-pager button:disabled{opacity:.45;cursor:default}

/* §17 Publishing payment filter — when ?payment=marked / =unmarked is set the
   enhancer hides the non-matching rows via this class (the backend already
   supports payment=marked; this just closes the loop on the client). */
.r79-pay-out{display:none !important}

/* §18 Level-1 customer payment QR — a scan-to-pay card shown on the checkout advance
   quote and the order payment panel (dark, self-contained), plus the owner-only upload
   card on /admin/merchant-payment. Additive; never disturbs the native panel layout. */
.r79-qr-card{display:flex;flex-direction:column;align-items:center;gap:8px;margin:12px 0;padding:12px 14px;background:#161922;border:1px solid #2a2f3d;border-radius:10px;max-width:280px}
.r79-qr-card img{width:180px;height:180px;max-width:60vw;background:#fff;border-radius:8px;padding:6px;image-rendering:pixelated}
.r79-qr-cap{font-size:.82rem;line-height:1.35;color:#a0a7b9;text-align:center}
.r79-qr-admin label{display:block;margin:8px 0;color:#f0f2f5}
.r79-qr-admin input[type=text]{width:100%;max-width:440px;margin-top:4px;background:#0f121a;border:1px solid #2a2f3d;border-radius:6px;color:#f0f2f5;padding:6px 8px}
.r79-qr-preview{margin:8px 0}
.r79-qr-preview img{width:140px;height:140px;background:#fff;border-radius:8px;padding:6px;image-rendering:pixelated}
.r79-qr-msg{margin-left:10px}

/* §19 / §20 Customer order confirmation + advance-item group on /account. Injected after
   the native section.account-panel, styled with the storefront's own variables so it sits
   inside the existing panel language without overriding it. */
#r82-acct{margin-top:18px}
.r82-confirm,.r82-adv-card{margin:0 0 18px;padding:16px 18px;border:1px solid rgba(128,128,128,.28);border-radius:12px}
.r82-confirm h2,.r82-adv-card h2{margin:0 0 4px;font-size:1.12rem}
.r82-note{color:var(--muted);font-size:.88rem;line-height:1.45;margin:6px 0}
.r82-note.bad{color:#c0392b}
.r82-order{border-top:1px solid rgba(128,128,128,.22);margin-top:12px;padding-top:12px}
.r82-order-head{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.r82-order-head .muted{font-size:.86rem}
.r82-chips{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.r82-tag{font-size:.76rem;line-height:1.4;padding:2px 8px;border-radius:999px;background:rgba(128,128,128,.16);color:inherit}
.r82-tag.ok{background:rgba(21,128,61,.14);color:#15803d}
.r82-tag.warn{background:rgba(180,83,9,.16);color:#b45309}
.r82-form{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px;margin:8px 0}
.r82-form label{display:flex;flex-direction:column;font-size:.8rem;gap:3px}
.r82-form input{min-width:170px;padding:6px 8px;border:1px solid rgba(128,128,128,.4);border-radius:7px;background:transparent;color:inherit}
.r82-msg{font-size:.82rem}
.r82-foot{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:8px}
.r82-cancel{border-color:rgba(192,57,43,.5);color:#c0392b}
.r82-adv-table{margin-top:8px}
.r82-adv-table td .muted{font-size:.78rem}
.r82-adv-total{font-weight:600;margin:8px 0 0}

/* §21 Advance-payment badge on the public catalogue. Positioned inside the product card
   without touching the app's own image/price markup. */
.r82-adv-tag{display:inline-block;font-size:.72rem;font-weight:600;letter-spacing:.01em;padding:2px 7px;border-radius:999px;background:rgba(180,83,9,.14);color:#b45309;border:1px solid rgba(180,83,9,.3);margin:4px 0 0 8px;vertical-align:middle}
article>.r82-adv-tag,.card>.r82-adv-tag,li>.r82-adv-tag,.about-strip>.r82-adv-tag{position:static;margin:6px 8px 0;display:inline-block}

/* §22 Advisory order-approval window card on the admin payment pages + a soft reminder
   tint on approve-style buttons outside the published review times. Never hidden, never
   disabled — the owner can always approve. */
#r82-win{margin:0 0 16px;padding:14px 16px;border:1px solid rgba(128,128,128,.3);border-radius:12px;color:inherit}
#r82-win h3{margin:0 0 4px;font-size:1rem}
#r82-win label{display:block;margin:8px 0;font-size:.86rem}
#r82-win input[type=text]{display:block;width:100%;max-width:340px;margin-top:4px;padding:6px 8px;border:1px solid rgba(128,128,128,.4);border-radius:7px;background:transparent;color:inherit}
.r82-win-state{margin-top:8px;font-size:.84rem}
.r82-dim{opacity:.62}
