/* AVstackr Products page (/products) — the Products-only pieces of the friendlier register.
   ========================================================================
   The page wears the shared register of css/app-page.css (root .ap-page, ap- classes: title row, buttons,
   search panel, bulk-actions panel, notice pills, progress bar, table, pills, kebab, legend, paginator).
   This file keeps only what no other page uses: the embedding status-line flash and batch controls, the
   credit link, the bulk-action result notices, the column-filter fields in QuickGrid's options popover, the
   Products columns (select, Model, Part#, description, price, actions, Role), the linked-manufacturer cell,
   the category chip, the match-score tones, the thumbnail, the AI status dots and their legend dots, the
   disabled-button title wrapper, and the New Product link's colour. Promotion rule (app-page.css's header):
   once a second page uses one of these, it moves to app-page.css under an ap- name and Products' markup
   gains the ap- class beside the pp- one. Products' markup carries both, e.g. class="ap-btn pp-btn": every
   pp- class tests pin stays.

   Every selector starts with the page root `.pp-page` (Products' root is class="ap-page pp-page"), so
   nothing leaks to another page: the pp- class names are not unique in the app (Measure.razor has its own
   pp-btn and pp-head), so no rule may start at a bare pp- class. Linked in Components/App.razor on the line
   after app-page.css, so a rule here wins over a shared rule of equal weight. The page's modals are not
   inside `.pp-page` and keep their own look.

   Source: the owner's mockup "9 · Products" (2026-11-13) and the plan
   docs/superpowers/plans/2026-11-13-products-page-visual-refresh.md, kept on its feature branch; the
   split into a shared file is plan docs/superpowers/plans/2026-11-13-list-pages-friendly-style.md.
   Type and spacing follow app-page.css; the Products-only sizes are the 1200px minimum table width, the
   280px minimum panel height that holds the column-options popover over an empty grid, 30px column-filter
   fields, 36px thumbnails and 20px AI dots.

   Colours. Every colour is an --app-* token from themes/theme-base.css (or a color-mix wash of one), as in
   app-page.css. No literal colours and no important flags.

   Radii come only from the four --pp-radius-* steps declared on .pp-page (10 panel, 8 button and field,
   6 tool, 4 chip; the same values as app-page.css's --ap-radius-* steps), 0, or 999px for the round dots.
   ======================================================================== */

/* ── page root ──────────────────────────────────────────────────────────── */

/* The register's colour and layout come from .ap-page; these custom properties serve the rules below. */
.pp-page {
    --pp-radius-panel: 10px;
    --pp-radius-btn: 8px;
    --pp-radius-tool: 6px;
    --pp-radius-chip: 4px;
    --pp-mono: 'SF Mono', 'Fira Code', monospace;
}

/* ── title row ──────────────────────────────────────────────────────────── */

/* New Product is a link; the dark presets recolour links that are not .btn, so its text colour is
   restated at a higher weight than theirs. */
.pp-page .pp-head .pp-head-actions a.pp-btn.pp-btn-primary,
.pp-page .pp-head .pp-head-actions a.pp-btn.pp-btn-primary:hover {
    color: var(--app-on-accent);
    text-decoration: none;
}

/* The status line flashes once when the embedded count changes. */
.pp-page .embedding-stats-flash {
    animation: pp-stats-flash 1.5s ease-out;
}

@keyframes pp-stats-flash {
    0% {
        background-color: color-mix(in srgb, var(--app-warn-text) 22%, transparent);
    }
    100% {
        background-color: transparent;
    }
}

.pp-page .pp-embed-controls {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pp-page .pp-embed-controls .embedding-batch-slider {
    width: 80px;
    height: 8px;
    padding: 0;
    cursor: pointer;
    accent-color: var(--app-accent-fill);
}

.pp-page .pp-credit-link {
    color: var(--app-warn-text);
    font-size: 13px;
    text-decoration: none;
}

/* ── bulk-actions panel and notices ─────────────────────────────────────── */

/* Wrapper that carries a disabled button's title. */
.pp-page .pp-title-wrap {
    display: inline-flex;
}

/* The bulk-action result notices, ok pills beside the shared .ap-notice-warn pill in .ap-notices. */
.pp-page .pp-notices > .category-notice,
.pp-page .pp-notices > .role-notice,
.pp-page .pp-notices > .link-notice {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--app-status-ok);
    background: color-mix(in srgb, var(--app-status-ok) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--app-status-ok) 30%, transparent);
}

/* The check mark, drawn so the notice's text stays exactly the message. */
.pp-page .pp-notices > .category-notice::before,
.pp-page .pp-notices > .role-notice::before,
.pp-page .pp-notices > .link-notice::before {
    content: "";
    width: 4px;
    height: 8px;
    margin: -2px 2px 0 1px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

/* ── product table ──────────────────────────────────────────────────────── */

/* Holds the column-options popover over an empty grid; the panel's scroll would otherwise clip it. */
.pp-page .pp-table-panel {
    min-height: 280px;
}

.pp-page table.pp-table {
    min-width: 1200px;
}

/* Column filter fields inside the options popover. */
.pp-page .product-search-input {
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--pp-radius-btn);
    background: var(--app-surface-panel);
    color: var(--app-text-strong);
    font-size: 13px;
}

.pp-page label.product-search-input.pp-filter-check {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    cursor: pointer;
}

.pp-page .product-search-input.filtered {
    background: var(--app-accent-tint);
    border-color: var(--app-accent-border);
}

.pp-page .pp-table td.role-col {
    white-space: nowrap;
}

.pp-page table.pp-table > thead > tr > th.pp-col-select,
.pp-page table.pp-table > tbody > tr > td.pp-col-select {
    width: 40px;
    padding-left: 12px;
}

.pp-page table.pp-table > tbody > tr > td.pp-col-model {
    font-family: var(--pp-mono);
    font-weight: 500;
    white-space: nowrap;
}

.pp-page table.pp-table > tbody > tr > td.pp-col-part {
    font-family: var(--pp-mono);
    color: var(--app-text-data);
}

.pp-page table.pp-table > tbody > tr > td.pp-col-desc {
    max-width: 380px;
    line-height: 1.35;
}

.pp-page table.pp-table > tbody > tr > td.pp-col-price {
    font-family: var(--pp-mono);
    font-weight: 500;
    white-space: nowrap;
}

.pp-page .pp-table .pp-col-price .col-header-content {
    justify-content: flex-end;
}

.pp-page table.pp-table > tbody > tr > td.pp-col-actions {
    width: 40px;
    padding: 2px 6px;
}

.pp-page .pp-mfr {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.pp-page .pp-mfr-icon {
    color: var(--app-status-ok);
    flex: none;
}

.pp-page .linked-manufacturer:empty {
    display: none;
}

.pp-page .pp-category {
    padding: 1px 7px;
    border-radius: var(--pp-radius-chip);
    background: var(--app-accent-tint);
    color: var(--app-accent-border);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.pp-page .pp-match-high {
    background: color-mix(in srgb, var(--app-status-ok) 14%, transparent);
    color: var(--app-status-ok);
}

.pp-page .pp-match-mid {
    background: var(--app-accent-tint);
    color: var(--app-accent-border);
}

.pp-page .pp-match-low {
    background: var(--app-surface-sunken);
    color: var(--app-text-label);
}

.pp-page .pp-thumb {
    display: block;
    max-width: 36px;
    max-height: 36px;
    border-radius: var(--pp-radius-tool);
    object-fit: contain;
}

/* AI status dots: connection metadata first, enriched second. */
.pp-page .pp-ai-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.pp-page .pp-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
}

.pp-page .pp-dot-ok {
    background: color-mix(in srgb, var(--app-status-ok) 16%, transparent);
    color: var(--app-status-ok);
}

.pp-page .pp-dot-accent {
    background: color-mix(in srgb, var(--app-accent-border) 16%, transparent);
    color: var(--app-accent-border);
}

.pp-page .pp-dot-empty {
    width: 18px;
    height: 18px;
    margin: 1px;
    border: 1px dashed var(--app-border-strong);
}

/* ── legend ─────────────────────────────────────────────────────────────── */

.pp-page .pp-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.pp-page .pp-legend-dot.pp-dot-ok {
    border: 1px solid color-mix(in srgb, var(--app-status-ok) 45%, transparent);
}

.pp-page .pp-legend-dot.pp-dot-accent {
    border: 1px solid color-mix(in srgb, var(--app-accent-border) 45%, transparent);
}

.pp-page .pp-legend-dot.pp-dot-empty {
    width: 12px;
    height: 12px;
    margin: 0;
}
