/* AVstackr friendly list pages — the shared register of the friendlier page style.
   ========================================================================
   The pieces every friendly list page uses: page root, title row (breadcrumbs, eyebrow, title, status line), buttons,
   search and filter panel, switch chip, plain panel, loading and empty states, bulk-actions panel, notice
   pills, progress bar, table panel and table (QuickGrid or a plain <table>), round pills, kebab and danger
   icon button and its disabled state, legend and paginator, and the settings form (grid, field, label, input,
   affix, sub-group heading, help line and its warn and danger tones). Products (/products) wore
   the register first; Projects, Leads, Customers, Calls, Vendors and AV Configurator take it from here
   (plan docs/superpowers/plans/2026-11-13-list-pages-friendly-style.md, kept on its feature branch), and
   Global Config (/global-config) adds the form pieces (plan docs/superpowers/plans/2026-11-14-global-config-friendly-style.md).
   The stat tiles came up from Inventory (/inventory) when the procurement worklist and purchase-order list took them
   (plan docs/superpowers/plans/2026-11-24-po-receiving-friendly-restyle.md). The breadcrumb row and the stat tile's
   sub-line came with the owner's procurement mockups (plan docs/superpowers/plans/2026-11-24-procurement-mockup-revision.md).

   Promotion rule. A class lives here once a second page uses it; a piece only one page needs stays with
   that page (Products-only pieces in css/products-page.css, the pp- classes; another page's in its scoped
   .razor.css). When a second page needs a page-only piece, it moves here under an ap- name, and the first
   page's markup gains the ap- class beside its own.

   A plain stylesheet rather than a scoped .razor.css because the rules must reach into QuickGrid's and
   Bootstrap's own markup (the column titles, the column-options popover, the sort indicator, the paginator,
   the kebab dropdown) and serve several pages. Every selector starts with the page root `.ap-page`, so
   nothing leaks to a page that has not taken the register. Linked in Components/App.razor after
   BlazorApp1.styles.css, so it wins source order over QuickGrid's scoped rules, and immediately before
   css/products-page.css, so a Products-only rule wins over a shared one at equal weight. A page's
   .razor.css loads before this file: to override an ap- rule it must raise its weight. A page's modals
   are not inside `.ap-page` and keep their own look.

   Register: sans body inherited from the app; the monospace stack (--ap-mono: 'SF Mono', 'Fira Code',
   monospace) for identifiers and numbers (SKUs, part and project numbers, phone numbers, prices, counts,
   credit pills) and for the uppercase eyebrow over the page title. Type: title 20px/600 at -0.01em;
   eyebrow 11px/500 mono at 0.12em; status line, buttons, links and fields 13px; table header 12px/500;
   table body 13px; pills 11–12px/500.
   Spacing, kept somewhat dense (owner 2026-11-13): no page padding or width cap of its own (full layout
   width), 10px between blocks; header buttons and form fields 32px; search field, switch chip and large button 36px;
   bulk controls, selects and small buttons 30px; kebab 28px; th and td padding 6px 10px.

   Colours. Every colour is an --app-* token from themes/theme-base.css (or a color-mix wash of one), so
   the pages follow every preset and both modes with no [data-theme] rules of their own. No literal
   colours and no important flags.

     role                           token
     -----------------------------  ------------------------------------------------------------
     page background                none: the layout's own background shows through
     panel, group box, field        --app-surface-panel
     header row, disabled button    --app-surface-sunken
     panel and row borders          --app-border-hairline
     field and button borders       --app-border-strong
     text                           --app-text-strong
     secondary text                 --app-text-data
     muted text, labels             --app-text-label
     accent fill (primary buttons)  --app-accent-fill, text on it --app-on-accent
     link, accent pill              --app-accent-border
     bulk panel, selected row       --app-accent-tint
     bulk panel and group borders   color-mix of --app-accent-border
     ok (pills, dots)               --app-status-ok and washes of it
     warn (credit pills, warn)      --app-warn-text and washes of it
     danger (Cancel, danger pill)   --app-danger-text and washes of it

   Radii come only from the four --ap-radius-* steps declared on .ap-page (10 panel, 8 button and
   field, 6 tool, 4 chip), 0, or 999px for the round pills and dots.

   Global rules this file cannot override (it carries no important flags): presets.css forces padding,
   font-size and colours on .btn, .btn-*, .badge, .form-control/.form-select, .input-group and .table
   cells, so a page's controls carry ap- classes instead of those Bootstrap classes; app.css's QuickGrid
   column-title rule is limited to tables outside .ap-page; app.css's paginator buttons (32px, 6px radius,
   their own border and fill) keep app.css's look, so only the paginator row is restyled here.

   The table panel scrolls sideways so the page never does. A scroll container clips its descendants:
   Bootstrap 5.1 has no markup switch to the fixed Popper strategy, and app.css pins .dropdown-menu to
   position: absolute with an important flag, so row menus are Popper-placed and flip upward at the
   panel's bottom edge. A page whose grid has a column-options popover gives its panel a minimum height
   that holds the popover over an empty grid (Products: 280px in products-page.css).
   ======================================================================== */

/* ── page shell ─────────────────────────────────────────────────────────── */

.ap-page {
    --ap-radius-panel: 10px;
    --ap-radius-btn: 8px;
    --ap-radius-tool: 6px;
    --ap-radius-chip: 4px;
    --ap-mono: 'SF Mono', 'Fira Code', monospace;

    /* No background, padding or width cap of its own: the page sits straight in the layout's content area and uses
       its full width (owner 2026-11-13). */
    color: var(--app-text-strong);
}

.ap-page .ap-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Some pages keep a global `button { margin-right: 10px }` in their inline <style>; inside the page the gaps
   come from the flex containers. */
.ap-page button {
    margin-right: 0;
}

.ap-page .ap-mono {
    font-family: var(--ap-mono);
}

.ap-page .ap-muted {
    color: var(--app-text-label);
}

/* An empty cell shows a muted dash; the dash is drawn, not written, so the cell's text stays empty. */
.ap-page .ap-dash::before {
    content: "—";
    color: var(--app-text-label);
}

/* ── buttons, links, fields ─────────────────────────────────────────────── */

.ap-page .ap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    margin: 0;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--ap-radius-btn);
    background: var(--app-surface-panel);
    color: var(--app-text-strong);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.ap-page .ap-btn:hover:not(:disabled) {
    background: var(--app-surface-hover);
    color: var(--app-text-strong);
}

.ap-page .ap-btn:focus,
.ap-page .ap-link:focus,
.ap-page .ap-icon-btn:focus,
.ap-page .ap-switch .form-check-input:focus {
    outline: none;
    box-shadow: none;
}

/* The focus ring shows for keyboard focus only, in the accent token. */
.ap-page .ap-btn:focus-visible,
.ap-page .ap-link:focus-visible,
.ap-page .ap-icon-btn:focus-visible,
.ap-page .ap-search-clear:focus-visible,
.ap-page .ap-switch .form-check-input:focus-visible {
    outline: 2px solid var(--app-accent-border);
    outline-offset: 1px;
}

/* Disabled controls read as disabled through the token disabled fill, border and text (the sunken
   surface and --app-text-disabled), with no fade on top. pointer-events stay off as on a disabled
   Bootstrap .btn, so a title on a wrapper shows while the button is disabled. */
.ap-page .ap-btn:disabled {
    background: var(--app-surface-sunken);
    border-color: var(--app-border-hairline);
    color: var(--app-text-disabled);
    pointer-events: none;
    cursor: default;
}

/* Buttons that keep their Font Awesome icons with Bootstrap's me-1 (an important margin) shrink their gap to keep
   icon and caption 6px apart. */
.ap-page .ap-btn:has(> i.me-1) {
    gap: 2px;
}

.ap-page .ap-btn-sm {
    height: 30px;
}

.ap-page .ap-btn-lg {
    height: 36px;
    padding: 0 14px;
}

/* The page's one primary action. */
.ap-page .ap-btn.ap-btn-primary {
    background: var(--app-accent-fill);
    border-color: var(--app-accent-fill);
    color: var(--app-on-accent);
    font-weight: 600;
}

.ap-page .ap-btn.ap-btn-primary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--app-accent-fill) 88%, var(--app-text-strong));
    border-color: var(--app-accent-fill);
    color: var(--app-on-accent);
}

.ap-page .ap-btn.ap-btn-primary:disabled {
    background: var(--app-surface-sunken);
    border-color: var(--app-border-hairline);
    color: var(--app-text-disabled);
    font-weight: 500;
}

.ap-page .ap-btn-primary:disabled .ap-credit-pill {
    background: var(--app-border-hairline);
    color: var(--app-text-disabled);
}

/* A destructive or caution action carries its colour at rest (owner, 2026-11-07: destructive actions show colour). */
.ap-page .ap-btn.ap-btn-warn {
    color: var(--app-warn-text);
    background: color-mix(in srgb, var(--app-warn-text) 8%, transparent);
    border-color: color-mix(in srgb, var(--app-warn-text) 45%, transparent);
}

.ap-page .ap-btn.ap-btn-warn:hover:not(:disabled) {
    color: var(--app-warn-text);
    background: color-mix(in srgb, var(--app-warn-text) 12%, transparent);
    border-color: var(--app-warn-text);
}

/* A disabled warn or danger button drops its colour and reads disabled like the rest. */
.ap-page .ap-btn.ap-btn-warn:disabled,
.ap-page .ap-btn.ap-btn-danger:disabled {
    background: var(--app-surface-sunken);
    border-color: var(--app-border-hairline);
    color: var(--app-text-disabled);
}

.ap-page .ap-btn.ap-btn-danger {
    color: var(--app-danger-text);
    background: color-mix(in srgb, var(--app-danger-text) 8%, transparent);
    border-color: color-mix(in srgb, var(--app-danger-text) 45%, transparent);
}

.ap-page .ap-btn.ap-btn-danger:hover:not(:disabled) {
    color: var(--app-danger-text);
    background: color-mix(in srgb, var(--app-danger-text) 12%, transparent);
    border-color: var(--app-danger-text);
}

.ap-page .ap-btn .spinner-border {
    width: 13px;
    height: 13px;
    border-width: 2px;
}

/* A text button that reads as a link (Clear Filters, Clear selection). */
.ap-page .ap-link {
    padding: 0 4px;
    margin: 0;
    border: 0;
    border-radius: var(--ap-radius-chip);
    background: transparent;
    color: var(--app-accent-border);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.ap-page .ap-link:hover {
    text-decoration: underline;
}

/* Credit estimate pill inside a button or a status line: "1 credit", "~10". */
.ap-page .ap-credit-pill {
    padding: 1px 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--app-warn-text) 12%, transparent);
    color: var(--app-warn-text);
    font-family: var(--ap-mono);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

.ap-page .ap-btn-primary .ap-credit-pill {
    background: color-mix(in srgb, var(--app-on-accent) 18%, transparent);
    color: var(--app-on-accent);
}

.ap-page .ap-select {
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--ap-radius-btn);
    background-color: var(--app-surface-panel);
    color: var(--app-text-data);
    font-size: 13px;
}

.ap-page .ap-select:disabled {
    background-color: var(--app-surface-sunken);
    color: var(--app-text-disabled);
}

/* A checkbox with its label. */
.ap-page .ap-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--app-text-data);
    white-space: nowrap;
}

.ap-page .ap-check input[type=checkbox],
.ap-page .ap-table input[type=checkbox] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--app-accent-fill);
}

.ap-page .ap-check label {
    margin: 0;
    cursor: pointer;
}

/* ── form fields ────────────────────────────────────────────────────────── */

/* A settings form: a label over each field on a 12-column grid, a field four columns wide (three to a row) unless it
   says otherwise, one column below 768px. Global Config (/global-config) is the first page with real forms; its
   section tables take the same fields (plan 2026-11-14-global-config-friendly-style, D1). */
.ap-page .ap-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 8px 12px;
    align-items: start;
}

/* A sub-group heading inside a section ("Project Percentages", "Colors"); in a grid it takes the whole row. */
.ap-page .ap-subhead {
    margin: 4px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--app-text-label);
}

.ap-page .ap-form-grid > .ap-subhead {
    grid-column: 1 / -1;
}

/* A label with its control and any help line under it. */
.ap-page .ap-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    grid-column: span 4;
}

.ap-page .ap-field.ap-field-half {
    grid-column: span 6;
}

.ap-page .ap-field.ap-field-full {
    grid-column: 1 / -1;
}

@media (max-width: 767.98px) {
    .ap-page .ap-field,
    .ap-page .ap-field.ap-field-half {
        grid-column: 1 / -1;
    }
}

.ap-page .ap-label {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--app-text-label);
}

/* A 32px text, number or email field, or a textarea at its own height. */
.ap-page .ap-input {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    margin: 0;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--ap-radius-btn);
    background: var(--app-surface-panel);
    color: var(--app-text-strong);
    font-size: 13px;
}

.ap-page textarea.ap-input {
    height: auto;
    padding: 6px 10px;
    line-height: 1.5;
    resize: vertical;
}

/* A native colour picker: a square swatch in the field border. */
.ap-page input[type=color].ap-input {
    flex: none;
    width: 44px;
    padding: 2px;
    cursor: pointer;
}

.ap-page .ap-input::placeholder {
    color: var(--app-text-label);
}

/* A select in a form takes the field's width and height. */
.ap-page .ap-field .ap-select {
    width: 100%;
    height: 32px;
}

.ap-page .ap-input:focus,
.ap-page .ap-field .ap-select:focus {
    outline: none;
    border-color: var(--app-accent-border);
    box-shadow: 0 0 0 3px var(--app-accent-tint);
}

.ap-page .ap-input:disabled {
    background: var(--app-surface-sunken);
    color: var(--app-text-disabled);
}

/* A field with a fixed prefix or suffix ("$", "%", "hrs"): the pieces share one border. */
.ap-page .ap-affix {
    display: flex;
    min-width: 0;
}

.ap-page .ap-affix > .ap-input {
    flex: 1 1 auto;
    min-width: 0;
}

.ap-page .ap-affix-text {
    display: inline-flex;
    flex: none;
    align-items: center;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--app-border-strong);
    background: var(--app-surface-sunken);
    color: var(--app-text-label);
    font-family: var(--ap-mono);
    font-size: 12px;
}

.ap-page .ap-affix > * {
    border-radius: 0;
}

.ap-page .ap-affix > * + * {
    margin-left: -1px;
}

.ap-page .ap-affix > :first-child {
    border-top-left-radius: var(--ap-radius-btn);
    border-bottom-left-radius: var(--ap-radius-btn);
}

.ap-page .ap-affix > :last-child {
    border-top-right-radius: var(--ap-radius-btn);
    border-bottom-right-radius: var(--ap-radius-btn);
}

/* The focused input's ring sits over its neighbour's border. */
.ap-page .ap-affix > .ap-input:focus {
    position: relative;
    z-index: 1;
}

/* A 12px muted line: a section's description or a field's help; the warn tone for a caution under a field. */
.ap-page .ap-help {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--app-text-label);
}

.ap-page .ap-help.ap-help-warn {
    color: var(--app-warn-text);
}

/* An error under a field or a table: the help line in the danger tone. */
.ap-page .ap-help.ap-help-danger {
    color: var(--app-danger-text);
}

/* ── record form page ───────────────────────────────────────────────────── */

/* A page that edits one record (the customer Add and Edit pages): the header and the form panels in one centred column,
   then a footer bar pinned to the bottom of the view across the page's full width, its contents lined up with the
   column — the shape of the New project footer, promoted for the customer pages (plan
   2026-11-28-customer-add-edit-friendly-style). */
.ap-page .ap-form-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

.ap-page .ap-form-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: 10px;
    padding: 10px 0;
    border-top: 1px solid var(--app-border-hairline);
    background: var(--app-surface-primary);
}

/* The validation summary sits beside the button that triggers it. */
.ap-page .ap-form-summary {
    margin: 0;
    padding-left: 18px;
}

.ap-page .ap-form-footer-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ap-page .ap-form-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* "Unsaved changes": shown only while the form differs from what was loaded. */
.ap-page .ap-dirty {
    font-size: 13px;
    font-weight: 500;
    color: var(--app-warn-text);
}

/* A text button: Cancel beside a form's primary action. */
.ap-page .ap-btn.ap-btn-text {
    border-color: transparent;
    background: transparent;
}

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

.ap-page .ap-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
}

.ap-page .ap-head-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* The page's sidebar group ("Catalog", "Work", "Design tools") over the title. */
.ap-page .ap-eyebrow {
    font-family: var(--ap-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--app-text-label);
}

/* A breadcrumb row over the title, in place of the eyebrow, on a page that sits under another record ("Projects /
   HV-4471 / What to order"): a <nav class="ap-crumbs" aria-label="Breadcrumb"> of links and "/" separators, the current
   page last as plain text. Separators take the muted row colour; links the accent; the current page the data tone. */
.ap-page .ap-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    color: var(--app-text-label);
}

.ap-page .ap-crumbs a {
    color: var(--app-accent-border);
    text-decoration: none;
}

.ap-page .ap-crumbs a:hover {
    text-decoration: underline;
}

.ap-page .ap-crumbs .is-here {
    color: var(--app-text-data);
}

.ap-page .ap-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--app-text-strong);
}

/* The meta / status line under the title: a real count or status, numbers in .ap-mono. */
.ap-page .ap-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--app-text-label);
}

.ap-page .ap-status-dot {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 999px;
    background: var(--app-status-ok);
}

.ap-page .ap-status-dot.is-warn {
    background: var(--app-warn-text);
}

.ap-page .ap-status-text {
    border-radius: var(--ap-radius-chip);
}

.ap-page .ap-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── search and filter panel ────────────────────────────────────────────── */

.ap-page .ap-search-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: var(--app-surface-panel);
    border: 1px solid var(--app-border-hairline);
    border-radius: var(--ap-radius-panel);
}

.ap-page .ap-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* The input is the bordered field; the magnifier and the clear button sit over its padding. */
.ap-page .ap-search-field {
    position: relative;
    flex: 1 1 420px;
    min-width: 0;
}

.ap-page .ap-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--app-text-label);
    pointer-events: none;
}

.ap-page .ap-search-input {
    width: 100%;
    height: 36px;
    padding: 0 36px 0 36px;
    border: 1px solid var(--app-border-strong);
    border-radius: var(--ap-radius-btn);
    background: var(--app-surface-panel);
    color: var(--app-text-strong);
    font-size: 14px;
}

.ap-page .ap-search-input::placeholder {
    color: var(--app-text-label);
}

.ap-page .ap-search-input:focus {
    outline: none;
    border-color: var(--app-accent-border);
    box-shadow: 0 0 0 3px var(--app-accent-tint);
}

.ap-page .ap-search-input:disabled {
    background: var(--app-surface-sunken);
    color: var(--app-text-disabled);
}

.ap-page .ap-search-clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: var(--ap-radius-tool);
    background: transparent;
    color: var(--app-text-label);
    cursor: pointer;
}

.ap-page .ap-search-clear:hover {
    background: var(--app-surface-hover);
    color: var(--app-text-strong);
}

/* A switch chip ("Semantic Search", "Show archived"). Bootstrap's .form-switch draws the switch; the chip undoes
   its left padding and floated input. */
.ap-page .ap-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    min-height: 0;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--app-border-hairline);
    border-radius: var(--ap-radius-btn);
    color: var(--app-text-data);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
}

.ap-page .ap-switch .form-check-input {
    float: none;
    margin: 0;
    cursor: pointer;
}

.ap-page .ap-switch .form-check-input:checked {
    background-color: var(--app-accent-fill);
    border-color: var(--app-accent-fill);
}

.ap-page .ap-switch.is-disabled {
    color: var(--app-text-disabled);
    cursor: default;
}

/* A switch in a page header with no chip frame (the customer pages' "Active customer"). */
.ap-page .ap-switch.ap-switch-plain {
    padding: 0;
    border-color: transparent;
}

.ap-page .ap-search-meta {
    font-size: 13px;
    color: var(--app-text-label);
}

.ap-page .ap-notice-warn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--app-warn-text) 35%, transparent);
    border-radius: var(--ap-radius-tool);
    background: color-mix(in srgb, var(--app-warn-text) 8%, transparent);
    color: var(--app-warn-text);
    font-size: 13px;
}

/* A load or save error: the warn notice in the danger tone, its dismiss button at the right end. */
.ap-page .ap-notice-danger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--app-danger-text) 35%, transparent);
    border-radius: var(--ap-radius-tool);
    background: color-mix(in srgb, var(--app-danger-text) 8%, transparent);
    color: var(--app-danger-text);
    font-size: 13px;
}

.ap-page .ap-notice-danger .ap-icon-btn {
    margin-left: auto;
    color: currentColor;
}

/* ── plain panel, loading and empty states ──────────────────────────────── */

/* A plain panel holding a block that is not a search, bulk or table panel (the Equipment Advisor Index, an
   empty state). */
.ap-page .ap-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
    background: var(--app-surface-panel);
    border: 1px solid var(--app-border-hairline);
    border-radius: var(--ap-radius-panel);
    font-size: 13px;
}

.ap-page .ap-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ap-page .ap-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--app-text-strong);
}

/* While the list loads: a small spinner and its muted line, centred where the table will be, with no frame. */
.ap-page .ap-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 120px;
    color: var(--app-text-label);
    font-size: 13px;
}

/* No rows, or none matching the filters: one muted line and its button, centred in a plain panel
   (class="ap-panel ap-empty"). */
.ap-page .ap-panel.ap-empty {
    align-items: center;
    padding: 16px;
    color: var(--app-text-label);
    text-align: center;
}

.ap-page .ap-loading p,
.ap-page .ap-empty p {
    margin: 0;
}

.ap-page .ap-empty strong {
    color: var(--app-text-strong);
}

/* A long-running job's progress: a flat token-coloured bar. */
.ap-page .ap-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--app-border-hairline);
    border-radius: var(--ap-radius-tool);
    background: var(--app-surface-sunken);
    font-size: 12px;
    color: var(--app-text-label);
}

.ap-page .ap-progress-head,
.ap-page .ap-progress-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ap-page .ap-progress-track {
    height: 6px;
    border-radius: 999px;
    background: var(--app-border-hairline);
    overflow: hidden;
}

.ap-page .ap-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--app-accent-fill);
    transition: width 0.3s ease;
}

.ap-page .ap-progress-percent {
    color: var(--app-status-ok);
    font-family: var(--ap-mono);
}

/* ── stat tiles ─────────────────────────────────────────────────────────── */

/* A strip of summary tiles over a page's table: a label over a mono figure. Inventory's tiles, promoted unchanged when
   the procurement worklist and purchase-order list took them. */
.ap-page .ap-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.ap-page .ap-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 12px;
    background: var(--app-surface-panel);
    border: 1px solid var(--app-border-hairline);
    border-radius: var(--ap-radius-panel);
}

.ap-page .ap-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--app-text-label);
}

.ap-page .ap-stat-value {
    font-family: var(--ap-mono);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--app-text-strong);
    overflow-wrap: anywhere;
}

/* The rollup's headline tile: size and weight carry the hierarchy, not colour. */
.ap-page .ap-stat.is-hero {
    border-color: var(--app-border-strong);
}

.ap-page .ap-stat.is-hero .ap-stat-value {
    font-size: 28px;
    font-weight: 700;
}

.ap-page .ap-stat.is-warn .ap-stat-value {
    color: var(--app-warn-text);
}

/* A small line under a tile's figure that qualifies it ("across 4 POs", "of 64 units"); .is-warn when it names
   something to act on. */
.ap-page .ap-stat-sub {
    font-size: 12px;
    color: var(--app-text-label);
}

.ap-page .ap-stat-sub.is-warn {
    color: var(--app-warn-text);
}

/* A tile's money in more than one currency: one figure per currency side by side, never summed (owner ruling A1,
   2026-11-26). The three Financials lists (/invoices, /change-orders, /purchase-orders). */
.ap-page .ap-totals {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 14px;
}

/* ── filter tabs ────────────────────────────────────────────────────────── */

/* Round chips with their counts, the active one in the accent: the project change order list's status tabs
   (ChangeOrderPages/Index.razor.css co-tab), promoted when the three Financials lists took them. */
.ap-page .ap-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ap-page .ap-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--app-border-hairline);
    border-radius: 999px;
    background: var(--app-surface-panel);
    color: var(--app-text-data);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.ap-page .ap-tab:hover {
    background: var(--app-surface-hover);
    color: var(--app-text-strong);
}

.ap-page .ap-tab.active {
    background: var(--app-accent-tint);
    border-color: color-mix(in srgb, var(--app-accent-border) 45%, transparent);
    color: var(--app-accent-border);
}

.ap-page .ap-tab:focus {
    outline: none;
}

.ap-page .ap-tab:focus-visible {
    outline: 2px solid var(--app-accent-border);
    outline-offset: 1px;
}

.ap-page .ap-tab-count {
    padding: 0 6px;
    border-radius: 999px;
    background: var(--app-surface-sunken);
    color: var(--app-text-label);
    font-family: var(--ap-mono);
    font-size: 11px;
    line-height: 1.6;
}

.ap-page .ap-tab.active .ap-tab-count {
    background: color-mix(in srgb, var(--app-accent-border) 14%, transparent);
    color: var(--app-accent-border);
}

/* ── row meter ──────────────────────────────────────────────────────────── */

/* A fixed-width bar with its percent beside it and the fraction under them, never instead of it (ux-hierarchy rules 3
   and 9): the change order Billed and purchase order Received cells of the Financials lists. */
.ap-page .ap-meter {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 150px;
}

.ap-page .ap-meter-track {
    flex: 1 1 auto;
    height: 6px;
    border-radius: 999px;
    background: var(--app-border-hairline);
    overflow: hidden;
}

.ap-page .ap-meter-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--app-accent-fill);
}

.ap-page .ap-meter-percent {
    min-width: 36px;
    font-family: var(--ap-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--app-text-strong);
    text-align: right;
}

.ap-page .ap-meter-fraction {
    margin-top: 2px;
    font-family: var(--ap-mono);
    font-size: 12px;
    color: var(--app-text-strong);
}

/* ── bulk-actions panel ─────────────────────────────────────────────────── */

/* Shown only while rows are ticked. */
.ap-page .ap-bulk {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
    background: var(--app-accent-tint);
    border: 1px solid color-mix(in srgb, var(--app-accent-border) 35%, transparent);
    border-radius: var(--ap-radius-panel);
}

.ap-page .ap-bulk-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ap-page .ap-bulk-head-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* "N selected", the bulk panel's heading. */
.ap-page .ap-bulk-count {
    color: var(--app-text-strong);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.ap-page .ap-bulk-groups {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
}

.ap-page .ap-bulk-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: var(--app-surface-panel);
    border: 1px solid color-mix(in srgb, var(--app-accent-border) 22%, transparent);
    border-radius: var(--ap-radius-panel);
}

.ap-page .ap-bulk-group-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--app-text-label);
}

.ap-page .ap-bulk-sub {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ap-page .ap-divider {
    width: 1px;
    height: 24px;
    background: var(--app-border-hairline);
}

/* ── notice pills ───────────────────────────────────────────────────────── */

.ap-page .ap-notices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ap-page .ap-notices > .ap-notice-warn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
}

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

/* The panel scrolls sideways so the page never does (see the header on clipped menus). */
.ap-page .ap-table-panel {
    overflow-x: auto;
    background: var(--app-surface-panel);
    border: 1px solid var(--app-border-hairline);
    border-radius: var(--ap-radius-panel);
}

.ap-page table.ap-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--app-text-strong);
}

.ap-page table.ap-table > thead > tr > th {
    padding: 6px 10px;
    background: var(--app-surface-sunken);
    border-bottom: 1px solid var(--app-border-hairline);
    color: var(--app-text-label);
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}

.ap-page table.ap-table > tbody > tr > td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--app-border-hairline);
    color: var(--app-text-strong);
    font-size: 13px;
    vertical-align: top;
}

/* A table whose rows hold 28px buttons or avatars sits its text cells centred beside them. */
.ap-page table.ap-table.ap-table-middle > tbody > tr > td {
    vertical-align: middle;
}

.ap-page table.ap-table > tbody > tr:last-child > td {
    border-bottom: 0;
}

.ap-page table.ap-table > tbody > tr:hover > td {
    background: var(--app-surface-hover);
}

/* A ticked row (a checkbox in its first cell) is tinted. */
.ap-page table.ap-table > tbody > tr:has(td:first-child input[type=checkbox]:checked) > td {
    background: var(--app-accent-tint);
}

/* QuickGrid's column header, sort indicator and column-options popover. */
.ap-page .ap-table .col-header-content {
    padding-right: 0;
    gap: 2px;
}

.ap-page .ap-table .col-title {
    padding: 0;
    gap: 4px;
    color: var(--app-text-label);
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.ap-page .ap-table .sort-indicator {
    opacity: 0.6;
}

.ap-page .ap-table .col-options-button {
    width: 20px;
    border-radius: var(--ap-radius-chip);
    background-size: 12px;
    color: var(--app-text-label);
    opacity: 0.6;
}

.ap-page .ap-table .col-options-button:hover {
    opacity: 1;
    background-color: var(--app-surface-hover);
}

.ap-page .ap-table .col-options {
    padding: 8px;
    background: var(--app-surface-panel);
    border: 1px solid var(--app-border-hairline);
    border-radius: var(--ap-radius-tool);
    color: var(--app-text-strong);
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
}

/* A small round pill; on its own it carries no colour, a tone below gives it one. */
.ap-page .ap-pill {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* Status pill tones: ok (done, active, connected), warn, danger, accent (in progress), neutral (inactive, draft). */
.ap-page .ap-pill.ap-pill-ok {
    background: color-mix(in srgb, var(--app-status-ok) 14%, transparent);
    color: var(--app-status-ok);
}

.ap-page .ap-pill.ap-pill-warn {
    background: color-mix(in srgb, var(--app-warn-text) 14%, transparent);
    color: var(--app-warn-text);
}

.ap-page .ap-pill.ap-pill-danger {
    background: color-mix(in srgb, var(--app-danger-text) 14%, transparent);
    color: var(--app-danger-text);
}

.ap-page .ap-pill.ap-pill-accent {
    background: var(--app-accent-tint);
    color: var(--app-accent-border);
}

.ap-page .ap-pill.ap-pill-neutral {
    background: var(--app-surface-sunken);
    color: var(--app-text-label);
}

/* Info: a state of its own beside accent (a purchase order the vendor acknowledged, never merged with issued). */
.ap-page .ap-pill.ap-pill-info {
    background: color-mix(in srgb, var(--app-info) 14%, transparent);
    color: var(--app-info);
}

/* A leading dot in the pill's own colour marks it as a status at a glance. */
.ap-page .ap-pill.has-dot::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 999px;
    background: currentColor;
    vertical-align: middle;
}

/* ── document list cells ────────────────────────────────────────────────── */

/* The Financials lists' rows: the whole row opens the document, its identifier is a real link (Cmd/Ctrl-click opens
   a tab), money is right-aligned in the mono stack, dates are mono, and a title or project name wraps rather than
   clips. */
.ap-page table.ap-table > tbody > tr.ap-row-open {
    cursor: pointer;
}

.ap-page .ap-cell-id {
    padding: 0;
    border: 0;
    background: transparent;
    font-family: var(--ap-mono);
    font-weight: 600;
    color: var(--app-text-strong);
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.ap-page .ap-cell-id:hover {
    color: var(--app-accent-border);
    text-decoration: underline;
}

.ap-page .ap-cell-id:focus {
    outline: none;
}

.ap-page .ap-cell-id:focus-visible {
    outline: 2px solid var(--app-accent-border);
    outline-offset: 1px;
}

.ap-page .ap-cell-title {
    color: var(--app-text-strong);
    overflow-wrap: anywhere;
}

.ap-page .ap-cell-project {
    color: var(--app-text-strong);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.ap-page a.ap-cell-project:hover {
    color: var(--app-accent-border);
    text-decoration: underline;
}

.ap-page .ap-cell-job {
    font-family: var(--ap-mono);
    font-size: 12px;
    color: var(--app-text-data);
}

.ap-page table.ap-table > thead > tr > th.ap-cell-num,
.ap-page table.ap-table > tbody > tr > td.ap-cell-num {
    text-align: right;
}

.ap-page table.ap-table > tbody > tr > td.ap-cell-num {
    font-family: var(--ap-mono);
    font-weight: 600;
    white-space: nowrap;
}

.ap-page table.ap-table > tbody > tr > td.ap-cell-date {
    font-family: var(--ap-mono);
    font-size: 12px;
    white-space: nowrap;
}

.ap-page .ap-cell-none {
    color: var(--app-text-label);
}

/* Kebab or icon button and its menu. */
.ap-page .ap-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--ap-radius-btn);
    background: transparent;
    color: var(--app-text-label);
    cursor: pointer;
}

.ap-page .ap-icon-btn:hover {
    background: var(--app-surface-hover);
    color: var(--app-text-strong);
}

/* A destructive icon button (Archive, Delete) carries the danger colour at rest (owner 2026-11-07: destructive
   actions show colour). */
.ap-page .ap-icon-btn.ap-icon-btn-danger,
.ap-page .ap-icon-btn.ap-icon-btn-danger:hover {
    color: var(--app-danger-text);
}

.ap-page .ap-icon-btn.ap-icon-btn-danger:hover {
    background: color-mix(in srgb, var(--app-danger-text) 12%, transparent);
}

/* A move or remove that does not apply (the first row cannot move up, the last segment cannot go): greyed, no hover wash, the danger tone
   dropped. After the hover and danger rules so it wins at equal or higher weight. */
.ap-page .ap-icon-btn:disabled,
.ap-page .ap-icon-btn:disabled:hover,
.ap-page .ap-icon-btn.ap-icon-btn-danger:disabled,
.ap-page .ap-icon-btn.ap-icon-btn-danger:disabled:hover {
    background: transparent;
    color: var(--app-text-disabled);
    cursor: default;
}

.ap-page .ap-table .dropdown-menu {
    min-width: 160px;
    padding: 4px;
    border: 1px solid var(--app-border-hairline);
    border-radius: var(--ap-radius-btn);
    background: var(--app-surface-panel);
    box-shadow: var(--app-shadow);
    font-size: 13px;
}

.ap-page .ap-table .dropdown-item {
    border-radius: var(--ap-radius-chip);
    color: var(--app-text-strong);
}

.ap-page .ap-table .dropdown-item:hover {
    background: var(--app-surface-hover);
}

.ap-page .ap-table .dropdown-item.text-danger {
    color: var(--app-danger-text);
}

.ap-page .ap-table .dropdown-item i {
    width: 16px;
    text-align: center;
}

.ap-page .ap-table .dropdown-divider {
    margin: 2px 4px;
    border-top-color: var(--app-border-hairline);
}

/* ── legend and paginator ───────────────────────────────────────────────── */

.ap-page .ap-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--app-text-label);
}

.ap-page .ap-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ap-page .paginator {
    margin-top: 0;
    padding: 0;
    border-top: 0;
    font-size: 13px;
    color: var(--app-text-label);
}
