/* The root size is set in css/themes/site.css, which loads last - see "The whole UI scales" there. */

:root {
    --cim360-primary: #1D75BB;
    --cim360-primary-hover: #1a66a3;
    --cim360-primary-dark: #155389;
    --cim360-primary-tint: rgba(29, 117, 187, .14);
    --cim360-primary-soft: rgba(29, 117, 187, .08);
    --cim360-primary-light: rgba(255,255,255,0.18);
    --cim360-primary-zebra: #f4f8fc;
    --cim360-primary-field-bg: rgba(29, 117, 187, .05);
    --cim360-primary-field-border: rgba(29, 117, 187, .22);
    /* --cim360-button and -hover moved to css/themes/theme-fluent.css: they are aliases now,
       and an alias declared on :root freezes. See the note there. */

    /* Processing queue bar — values match the AddStock/RemoveStock footer queue. */
    /* The ten aliases that were here now live in css/themes/theme-fluent.css, on BODY, with
       the palette they point at. Declared on :root they resolved against :root - the light
       values - and froze there. See the long note in that file and prove-alias-token.js. */
    --cim360-queue-fg: #ffffff;
    --cim360-queue-track-bg: rgba(255, 255, 255, .28);
    --cim360-queue-btn-bg: rgba(255, 255, 255, .15);
    --cim360-queue-btn-border: rgba(255, 255, 255, .45);
    --cim360-queue-btn-hover: rgba(255, 255, 255, .30);

    --cim360-card: #ffffff;
    --cim360-surface: #f4f6f9;
    --cim360-surface-2: #f8fafc;
    --cim360-surface-3: #fafbfc;
    --cim360-text-strong: #0f172a;
    --cim360-text: #1f2937;
    --cim360-caption: #374151;
    /* #565d68, not #6b7280. The old grey measured 4.83:1 on pure white - a pass, and the reason it
       survived - but this token is almost never used ON white. On the KPI strip's #f4f6f9 tile it
       measured 4.46:1, under the 4.5:1 small text needs by four hundredths, and on the grid's
       focused row (a 14% blue tint) it reached only 3.38:1. A value chosen against the one
       background it is rarely seen on. #565d68 holds 6.64:1 on white and 4.65:1 on the focused
       tint, so every surface this token lands on clears the threshold. WCAG 1.4.3. */
    /* #4B5563. Every muted label in a grid row reads this - the progress percentage, the sub-line
       separators - and a row that is selected AND focused paints a 32% tint of the primary behind
       them, where the previous #565d68 measured 4.27:1 against a required 4.5 at 11.5px. This is
       7.56:1 on white and 4.86:1 on that tint, so it holds on both. WCAG 1.4.3, found 2026-09-15. */
    --cim360-text-muted: #4B5563;
    --cim360-muted-soft: #94a3b8;
    --cim360-text-inverse: #ffffff;

    /* Common card typography — one place to tune the font used across our cards
       (stocktake count-details, count sheet, etc.). Replaces the DevExpress
       --dxbl-grid-* vars, which are grid-scoped and don't resolve outside a grid. */
    --cim360-card-font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --cim360-card-font-size: 0.8125rem;

    /* Each of these read `--cim360-border: var(--cim360-border)` - a cycle, which computes to
       the guaranteed-invalid value and takes every `border: 1px solid var(--cim360-border)`
       down with it. Not a faint border: none. See the long note in css/themes/theme-fluent.css,
       and tools/a11y/prove-border-token.js, which asks a browser rather than the spec.
       Kept in step with that file - two copies of a palette is two chances to drift. */
    --cim360-border: rgba(15, 23, 42, .12);
    --cim360-border-strong: rgba(15, 23, 42, .18);
    --cim360-border-soft: rgba(15, 23, 42, .08);
    --cim360-border-cool: rgba(29, 117, 187, .18);
    --cim360-border-subtle: rgba(15, 23, 42, .06);
    --cim360-success: #16a34a;
    --cim360-success-bg: #dcfce7;
    --cim360-success-fg: #166534;
    --cim360-success-border: #bbf7d0;
    --cim360-warning: #d97706;
    --cim360-warning-bg: #fef3c7;
    --cim360-warning-fg: #92400e;
    --cim360-warning-border: #fde68a;
    --cim360-danger: #dc2626;
    --cim360-danger-bg: #fef2f2;
    --cim360-danger-fg: #991b1b;
    --cim360-danger-border: #fecaca;
    --cim360-info: #2563eb;
    --cim360-info-bg: #dbeafe;
    --cim360-info-fg: #1d4ed8;
    --cim360-info-border: #bfdbfe;
    --cim360-violet: #7c3aed;
    --cim360-violet-bg: #ede9fe;
    --cim360-violet-fg: #6d28d9;
    --cim360-violet-border: #ddd6fe;

    /* Stocktake status + variance semantics (aliases of the base palette so they track any future theming) */



    /* Its own value rather than var(--cim360-success), for the reason --cim360-status-loss carries
       just below: --cim360-success also fills buttons and badges, which are held to 3:1, while every
       use of THIS token is words. #16a34a measured 3.30:1 as text on white. WCAG 1.4.3. */
    --cim360-status-finalised: #146c34;


    /* Deliberately no longer var(--cim360-danger), and the split is the point. Every use of this
       token but one is a `color:` on words - a variance figure, a locked row, a blocked reason -
       while --cim360-danger also fills buttons and borders, which WCAG holds to 3:1 rather than
       4.5:1. #dc2626 met the shape threshold and failed the text one at 3.38:1 on the grid's
       focused row, so the value that is right for a danger button is wrong for danger text. 1.4.3. */
    --cim360-status-loss: #b91c1c;





    --cim360-pink: #db2777;
    --cim360-pink-bg: #fce7f3;
    --cim360-pink-fg: #9d174d;
    --cim360-pink-border: #fbcfe8;
    --cim360-accent: #29aae2;
    --cim360-soft: #73e6e6;
    --cim360-surface-strong: #eaf4fb;
    --cim360-shadow: 0 0.875rem 1.875rem rgba(13, 44, 77, 0.12);
    /* Layout */
    --cim360-nav-height: 3.75rem;
    --cim360-side-menu-width: 20rem;
    --cim360-side-menu-collapsed-offset: 1.5rem;
    --cim360-floating-safe-space: 6.5rem;
    --panel-top: 5rem;
    --panel-left: max(1rem, env(safe-area-inset-left));
    --panel-right: max(1rem, env(safe-area-inset-right));
    --panel-bottom-gap: 5.25rem;
}

html, body {
    font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    color: var(--cim360-text);
    background: var(--cim360-surface);
}

a, .btn-link {
    color: var(--cim360-primary);
}

.btn-primary {
    color: #fff;
    background-color: var(--cim360-primary-surface);
    border-color: var(--cim360-primary);
}

/* Bootstrap's own #0d6efd, left alone, measured just under 4.5:1 on the grey a toolbar puts behind it
   (axe, Company reports, 2026-09-25) and is not our blue in either theme. --cim360-primary is the
   brand's TEXT token, tuned per theme to clear 4.5:1 - the same pair the filled button uses. */
.btn-outline-primary {
    --bs-btn-color: var(--cim360-primary);
    --bs-btn-border-color: var(--cim360-primary);
    --bs-btn-hover-color: var(--cim360-on-primary);
    --bs-btn-hover-bg: var(--cim360-primary-surface);
    --bs-btn-hover-border-color: var(--cim360-primary-surface);
    --bs-btn-active-color: var(--cim360-on-primary);
    --bs-btn-active-bg: var(--cim360-primary-surface);
    --bs-btn-active-border-color: var(--cim360-primary-surface);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem color-mix(in srgb, var(--cim360-accent) 35%, var(--cim360-card));
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--cim360-success);
}

.invalid {
    outline: 1px solid var(--cim360-danger);
}

.validation-message {
    color: var(--cim360-danger);
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--cim360-danger-fg);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--cim360-card);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.icon {
    --icon-width: 1.25rem;
    --icon-height: 1.25rem;
    --icon-home-mask-image: url("images/home-fluent.svg");
    --icon-weather-mask-image: url("images/weather-fluent.svg");
    --icon-counter-mask-image: url("images/counter-fluent.svg");
    --icon-shelf-full-mask-image: url("images/shelf_full.svg");
}

.icon {
    width: var(--icon-width);
    height: var(--icon-height);
    background-color: currentcolor;
    mask-position: center center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-image: var(--icon-mask-image, none);
    mask-image: var(--icon-mask-image, none);
}

dxbl-popup-root {
    z-index: 25000 !important;
    pointer-events: none !important;
}

dxbl-popup-root .dxbl-popup-cell,
dxbl-popup-root .dxbl-popup,
dxbl-popup-root .dxbl-dropdown,
dxbl-popup-root .dxbl-itemlist-dropdown,
dxbl-popup-root .dxbl-calendar {
    pointer-events: auto !important;
}

/* ...except an item list with nothing in it. A closed DevExpress menu leaves its container behind -
   2px square, where the menu last stood - and the rule above made it catch the pointer, so
   right-clicking the same spot again hit the leftover and the menu did not reopen (DEV-748). The
   open menu's content sits inside it, so an empty one is always a closed one. */
dxbl-popup-root .dxbl-itemlist-dropdown:not(:has(.dxbl-dropdown-dialog)) {
    pointer-events: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

dxbl-popup-root .dxbl-popup-cell {
    z-index: 25000 !important;
}

/* An .ts-popup block stood here - 74 lines of !important that matched nothing, because no component
   ever carried the class. Half its selectors were .dxbl-popup-header/-body/-footer/-content, which
   DevExpress does not render at all (the real names are .dxbl-modal-*), so even with the class
   applied most of it would have done nothing. See css/forms/cim360-dialog.css for what that
   misspelling cost. The two blocks below have the same dead halves but do back live DxPopups:
   .cd-popup (Cim360ConfirmDialog) and .dcd-popup (Cim360DiscardChangesDialog). They are the last
   DxPopup-based dialogs outside Settings; the traceable prompts' .td-popup went with them (DEV-489). */

/*Confirm Dialogue styles*/
.cd-popup,
.dxbl-popup-cell.cd-popup,
dxbl-popup-root .cd-popup {
    --dxbl-popup-max-width: min(38.75rem, calc(100vw - 3rem));
    width: min(38.75rem, calc(100vw - 3rem)) !important;
    max-width: min(38.75rem, calc(100vw - 3rem)) !important;

    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;

    /* Stack above the TraceableDetails popup (z-index 26000). */
    z-index: 27000 !important;
}

.cd-popup .dxbl-popup-content,
.cd-popup .dxbl-modal-content,
.cd-popup > .dxbl-popup,
.cd-popup .dxbl-popup {
    width: min(38.75rem, calc(100vw - 3rem)) !important;
    max-width: min(38.75rem, calc(100vw - 3rem)) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 90vh !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    border-radius: 0.75rem;
    display: flex !important;
    flex-direction: column !important;
}

/* Broad - Cim360ConfirmDialog's Broad parameter, the dialog card's is-xxwide width, for a window with
   a grid of lines under its fields (the supplier invoice windows, DEV-778/779). */
.cd-popup.cd-popup-broad,
.dxbl-popup-cell.cd-popup.cd-popup-broad,
dxbl-popup-root .cd-popup.cd-popup-broad,
.cd-popup.cd-popup-broad .dxbl-popup-content,
.cd-popup.cd-popup-broad .dxbl-modal-content,
.cd-popup.cd-popup-broad > .dxbl-popup,
.cd-popup.cd-popup-broad .dxbl-popup {
    --dxbl-popup-max-width: min(77.5rem, calc(100vw - 3rem));
    width: min(77.5rem, calc(100vw - 3rem)) !important;
    max-width: min(77.5rem, calc(100vw - 3rem)) !important;
}

.cd-popup .dxbl-popup-header,
.cd-popup .dxbl-modal-header {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    flex: 0 0 auto !important;
}

.cd-popup .dxbl-popup-header > *,
.cd-popup .dxbl-modal-header > * { width: 100%; }

.cd-popup .dxbl-popup-body,
.cd-popup .dxbl-modal-body {
    background: var(--cim360-card);
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.cd-popup .dxbl-popup-footer,
.cd-popup .dxbl-modal-footer {
    flex: 0 0 auto !important;
    background: var(--cim360-surface-2) !important;
    padding: 0.875rem 1.25rem !important;
    margin: 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--cim360-border) !important;
    border-bottom-left-radius: 0.75rem !important;
    border-bottom-right-radius: 0.75rem !important;
}

/*Discad change popup styles*/
.dcd-popup,
.dxbl-popup-cell.dcd-popup,
dxbl-popup-root .dcd-popup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 28000 !important;
}

.dcd-popup .dxbl-popup-content,
.dcd-popup .dxbl-modal-content,
.dcd-popup > .dxbl-popup,
.dcd-popup .dxbl-popup {
    width: min(30rem, calc(100vw - 3rem)) !important;
    max-height: calc(100vh - 3rem) !important;
    border-radius: 0.75rem !important;
    overflow: hidden !important;
    box-shadow: 0 1.25rem 3.75rem rgba(0,0,0,0.25), 0 0.25rem 1rem rgba(0,0,0,0.12) !important;
}

.dcd-popup .dxbl-popup-header,
.dcd-popup .dxbl-modal-header {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
}

.dcd-popup .dxbl-popup-header > *,
.dcd-popup .dxbl-modal-header > * { width: 100%; }

.dcd-popup .dxbl-popup-body,
.dcd-popup .dxbl-modal-body {
    padding: 0 !important;
    background: var(--cim360-card) !important;
}

.dcd-popup .dxbl-popup-footer,
.dcd-popup .dxbl-modal-footer {
    flex: 0 0 auto !important;
    background: var(--cim360-surface-2) !important;
    padding: 0.875rem 1.25rem !important;
    margin: 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--cim360-border) !important;
    border-bottom-left-radius: 0.75rem !important;
    border-bottom-right-radius: 0.75rem !important;
}

/* The placeholders a document reference format may carry, listed under the format rows. Monospace
   because they are things to be typed literally, and a proportional font makes {0000} and {YYYY}
   look like different widths when they are not. */
.inv-token-help {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    min-height: 2.375rem;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

/* A derived value shown where a field would sit - the worked document references on the numbering
   tabs. Same height as .inv-input below so it lines up in a row of real inputs, but no border and
   no fill, because it cannot be typed into and must not invite the attempt. Tabular figures keep a
   row of references aligned digit for digit. */
.inv-static-value {
    display: flex;
    align-items: center;
    min-height: 2.375rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--cim360-text);
    white-space: pre-wrap;
}

/* The same field as css/forms/cim360-form-grid.css declares for a page form - on the tokens now
   rather than its own color-mix, which was 32% border against the token's 22% and made Inventory
   Settings a shade darker than Warehouse and Company Defaults. The geometry is repeated here only
   because this rule exists to beat DevExpress's own with !important; the VALUES come from the
   same two tokens, so the three cannot drift apart again. */
.inv-input {
    background: var(--cim360-primary-field-bg) !important;
    border: 1px solid var(--cim360-primary-field-border) !important;
    border-radius: 0.5rem !important;
    height: 2.375rem !important;
    min-height: 2.375rem !important;
    box-shadow: none !important;
    transition: border-color 160ms ease, box-shadow 160ms ease;
    box-sizing: border-box !important;
}

/* A textarea is the one field the fixed height above is wrong for: it pinned every note box to a
   single line whatever its rows said (the authorise and invoice-variance notes, the email message).
   Its rows decide its height; it keeps the single-line height as its floor and grows downwards. */
textarea.inv-input {
    height: auto !important;
    min-height: 2.375rem !important;
    padding: 0.5rem 0.75rem;
    line-height: 1.45;
    resize: vertical;
    font: inherit;
    color: var(--cim360-text);
}

.inv-input input,
.inv-input .dxbl-text-edit-input,
.inv-input .dxbl-edit-input,
.inv-input .dxbl-textbox-input,
.inv-input .dxbl-combobox-input,
.inv-input .dxbl-spin-edit-input,
.inv-input input[type="text"],
.inv-input input[type="number"] {
    background: transparent !important;
    border: 0 !important;
    outline: none !important;
    color: var(--cim360-text) !important;
    font-size: 0.8438rem !important;
    font-family: inherit !important;
    height: 100% !important;
    padding: 0 0.75rem !important;
    box-shadow: none !important;
}

.inv-input:focus-within {
    border-color: var(--cim360-primary) !important;
    box-shadow: 0 0 0 0.1875rem rgba(29, 117, 187, .15) !important;
}

.inv-input.dxbl-disabled,
.inv-input .dxbl-disabled {
    opacity: .55 !important;
}

.inv-input *:not(input) {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.inv-input *::before,
.inv-input *::after {
    display: none !important;
    content: none !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}


/* Muted at rest, blue when the field is being used - the product-wide chevron rule at the
   foot of this file, repeated here only because every declaration in this block is
   !important and a normal rule cannot reach past it. It used to be blue at rest, which is
   where half of "the chevron is grey on some screens and blue on others" came from. */
.inv-input .dxbl-image,
.inv-input .dxbl-button-icon,
.inv-input button,
.inv-input .dxbl-btn,
.inv-input .dxbl-edit-spin-button {
    color: var(--cim360-text-muted) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.inv-input:hover .dxbl-image,
.inv-input:hover .dxbl-button-icon,
.inv-input:hover .dxbl-btn,
.inv-input:hover .dxbl-edit-spin-button,
.inv-input:focus-within .dxbl-image,
.inv-input:focus-within .dxbl-button-icon,
.inv-input:focus-within .dxbl-btn,
.inv-input:focus-within .dxbl-edit-spin-button {
    color: var(--cim360-primary) !important;
}

.inv-input button:hover,
.inv-input button:focus,
.inv-input button:active {
    background: rgba(29, 117, 187, .08) !important;
}

.inv-input svg {
    fill: var(--cim360-primary) !important;
    color: var(--cim360-primary) !important;
}


dxbl-popup-root .dxbl-itemlist-dropdown {
    border: 1px solid color-mix(in srgb, var(--cim360-primary) 30%, var(--cim360-card)) !important;
    box-shadow: 0 0.5rem 1.5rem rgba(13, 44, 77, .12) !important;
}


/* There is no .ncf-popup any more: the New Custom Field dialog is a hand-rolled c360-dlg-card like
   every other settings dialog, and the shadow now comes from that shared rule. What used to be here
   painted a white rounded rect at 14px behind everything, which is what showed as a ring of white in
   the corners once the banner became full-bleed brand colour. It also targeted .dxbl-popup-content
   and .dxbl-popup-body, neither of which DevExpress renders - so most of it never applied at all,
   and looked like it had. */



/* Header */




.ncf-code {
    background: rgba(0, 0, 0, .135);
    color: #fff;
    border-radius: 0.25rem;
    padding: 1px 0.375rem;
    font-family: inherit;
    font-size: 0.75rem;
    margin: 0 2px;
}

/* The header close button is .c360-dlg-head-close in css/forms/cim360-dialog.css, shared by every
   settings dialog. The .ncf-close block that was here existed only to beat a DxButton's own theme
   back off the brand banner with ten !important declarations - which is the argument for not
   putting a DxButton on the banner in the first place. */

/* Body */





/* Dropdown options editor (shown when DataType == Dropdown). */
.ncf-options-head {
    justify-content: space-between;
    width: 100%;
}

.ncf-options-count {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 600;
    color: var(--cim360-text-muted);
}

.ncf-options {
    border: 1px solid var(--cim360-border);
    border-radius: 0.5rem;
    background: var(--cim360-surface-2);
    padding: 0.625rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ncf-option-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ncf-option-num {
    flex: 0 0 auto;
    width: 1.125rem;
    text-align: center;
    color: var(--cim360-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.ncf-option-input {
    flex: 1 1 auto;
}

.ncf-option-btn {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--cim360-border);
    background: var(--cim360-card);
    border-radius: 0.375rem;
    color: var(--cim360-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .ncf-option-btn:hover:not(:disabled) {
        border-color: var(--cim360-primary);
        color: var(--cim360-primary);
    }

    .ncf-option-btn:disabled {
        opacity: .4;
        cursor: default;
    }

.ncf-option-remove:hover:not(:disabled) {
    border-color: var(--cim360-danger);
    color: var(--cim360-danger);
}

.ncf-add-option {
    align-self: flex-start;
    border: 1px dashed color-mix(in srgb, var(--cim360-primary) 45%, var(--cim360-card));
    background: transparent;
    color: var(--cim360-primary);
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

    .ncf-add-option:hover {
        background: var(--cim360-primary-soft);
    }

/* Boolean default value — radio pair. */
.ncf-radio-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 2.375rem;
}

.ncf-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--cim360-text);
    font-weight: 600;
}

    .ncf-radio input[type="radio"] {
        accent-color: var(--cim360-primary);
        width: 1rem;
        height: 1rem;
        cursor: pointer;
    }

/* Native date input for the Date default value — styled to match the other fields. */
.ncf-date-input {
    width: 100%;
    height: 2.375rem;
    padding: 0 0.75rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: var(--cim360-card);
    color: var(--cim360-text);
    font: inherit;
    box-sizing: border-box;
}

    .ncf-date-input:focus {
        outline: none;
        border-color: var(--cim360-primary);
        box-shadow: 0 0 0 0.1875rem var(--cim360-primary-soft);
    }

/* Two-column row for Data Type + Module */
.ncf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
}

/* Inline error message under an invalid input */

/* DxTextBox / DxComboBox in the Custom Field dialog. CssClass lands on the control's own root
   element, which DevExpress documents - unlike its internals, which is the distinction that matters
   here: sizing the root is fine, reaching inside it is what produced a stylesheet of selectors that
   never matched.

   The numbers are the shared .c360-dlg-input's, deliberately. They were 38px and 8px, against 36px
   and 6px everywhere else - a difference nobody chose and everybody could see, because a Custom
   Field box sat next to a Role box in the same product looking two sizes apart. If you change
   .c360-dlg-input, change these to match, or add the control here properly. */
.ncf-input {
    background: var(--cim360-card) !important;
    border: 1px solid var(--cim360-border) !important;
    border-radius: 0.375rem !important;
    height: 2.25rem !important;
    min-height: 2.25rem !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.ncf-input input,
.ncf-input .dxbl-text-edit-input,
.ncf-input .dxbl-edit-input,
.ncf-input .dxbl-textbox-input,
.ncf-input .dxbl-combobox-input {
    background: transparent !important;
    border: 0 !important;
    outline: none !important;
    color: var(--cim360-text) !important;
    font-size: 0.8125rem !important;
    font-family: inherit !important;
    height: 100% !important;
    padding: 0 0.75rem !important;
    box-shadow: none !important;
}

.ncf-input:focus-within {
    border-color: var(--cim360-primary) !important;
    box-shadow: 0 0 0 0.1875rem rgba(29, 117, 187, .15) !important;
}

.ncf-input.ncf-input-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 0.1875rem rgba(220, 38, 38, .15) !important;
}

/* Strip DevExpress's inner button divider so the chevron sits flush */
.ncf-input *:not(input) {
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.ncf-input *::before,
.ncf-input *::after {
    display: none !important;
    content: none !important;
    background: transparent !important;
    border: 0 !important;
}

/* Combobox chevron + any inner button. Muted at rest and blue while the field is in use, to
   match .inv-input and the product-wide rule at the foot of this file; !important here only
   because the rest of this block is, and a mixed block is how one of them gets missed. */
.ncf-input .dxbl-image,
.ncf-input .dxbl-button-icon,
.ncf-input button,
.ncf-input .dxbl-btn {
    color: var(--cim360-text-muted) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.ncf-input:hover .dxbl-image,
.ncf-input:hover .dxbl-button-icon,
.ncf-input:hover .dxbl-btn,
.ncf-input:focus-within .dxbl-image,
.ncf-input:focus-within .dxbl-button-icon,
.ncf-input:focus-within .dxbl-btn {
    color: var(--cim360-primary) !important;
}

.ncf-input svg {
    fill: var(--cim360-primary) !important;
    color: var(--cim360-primary) !important;
}

/* ── DxCheckBox styling (Required field / Active row) ── */
.ncf-checkboxes {
    display: inline-flex;
    align-items: center;
    gap: 1.75rem;
    margin-top: 2px;
    padding-top: 0.25rem;
    flex-wrap: wrap;
}

.ncf-checkbox.dxbl-cb,
.ncf-checkbox .dxbl-cb {
    font-family: inherit !important;
    font-size: 0.8125rem !important;
    color: var(--cim360-text) !important;
}

.ncf-checkbox .dxbl-cb-input-container {
    border-color: var(--cim360-border) !important;
}

/* Footer */

/* ── Edit mode: locked fields, guarded delete, typed confirmation. DEV-253 ── */

/* margin-right:auto rather than a second flex container, so Delete is pushed away from the
   primary action while Cancel and Save keep the footer's existing flex-end alignment. */
.ncf-footer-danger {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-right: auto;
    min-width: 0;
}

/* .ncf-delete-blocked is gone: Cim360DialogFooter renders the blocked reason for every dialog now,
   as .c360-dlg-foot-blocked in css/forms/cim360-dialog.css. Worth knowing why it had to go rather
   than just being renamed - it set colour to --cim360-text-muted, which is a token for text on the
   page's surface, and this sits on the footer's blue gradient. Grey on blue. The Location dialog
   had solved the same problem with a bordered pill under a different class name, so the same
   message looked like two different things depending on which dialog you were in.

   The wrapping behaviour it documented is kept: the reason is the whole point of the message, and
   a truncated "In use by 3 rec…" tells the user nothing actionable. */

/* Button labels never wrap - "Save changes" broke onto two lines once Delete joined the footer. */

.ncf-hint {
    margin-top: 0.25rem;
    font-size: .74rem;
    color: var(--cim360-text-muted);
}

.ncf-confirm {
    padding: 1.375rem 1.5rem 1.25rem;
}

/* The confirmation's title and lead are the shared banner's .c360-dlg-head-title / -sub now. They
   were a heading and a grey paragraph inside a plain white card, while the Location dialog's
   identical typed-name confirmation had a full banner - two designs for one interaction. */

.ncf-confirm-prompt {
    font-size: .84rem;
    margin-bottom: 0.5rem;
}

.ncf-confirm-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.5rem;
    font-size: .9rem;
    background: var(--cim360-card);
    color: var(--cim360-text);
}

/* Confirms the typed name matches before the button enables, so the state is visible
   as you type rather than only in the disabled attribute. */
.ncf-confirm-input.is-match {
    border-color: var(--cim360-danger);
}

/* The confirmation's buttons are Cim360DialogFooter/Cim360DialogButton now, so .ncf-confirm-actions
   has gone with them. */

/* Double-click affordance on the Custom Fields rows. */
.cf-row-actionable {
    cursor: pointer;
}

/* The .ncf-btn / -cancel / -create blocks that stood here are gone with the DxButtons they styled -
   about 40 lines of !important spent making a DevExpress button look like a plain one. The footer
   buttons are Cim360DialogButton, and the footer stacks on a narrow screen via
   css/forms/cim360-dialog.css rather than here. */

/* Responsive */
@media (max-width: 600px) {
    .ncf-grid {
        grid-template-columns: 1fr;
    }
}


.inv-input-combo {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 2.375rem;
    background: color-mix(in srgb, var(--cim360-primary) 5%, var(--cim360-card));
    border: 1px solid color-mix(in srgb, var(--cim360-primary) 32%, var(--cim360-card));
    border-radius: 0.5rem;
    box-sizing: border-box;
    overflow: hidden;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.inv-input-combo:focus-within {
    border-color: var(--cim360-primary);
    box-shadow: 0 0 0 0.1875rem rgba(29, 117, 187, .15);
}


.inv-input-combo > .inv-input {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    height: 100% !important;
    min-height: 100% !important;
}

.inv-input-combo > .inv-input-combo-main {
    flex: 1 1 auto;
    min-width: 0;
    border-right: 1px solid color-mix(in srgb, var(--cim360-primary) 22%, var(--cim360-card)) !important;
}

.inv-input-combo > .inv-input-combo-unit {
    flex: 0 0 auto;
    width: 6.25rem;
}

.inv-form {
    display: block;

    /* The gap BETWEEN sections lives here, not on .inv-fl-group. Each partial view renders
       exactly one .inv-form, whereas .inv-fl-group is handed to DxFormLayoutGroup as CssClass
       and DevExpress decides which element in its own DOM wears it - so a margin there is not
       reliably the box that sits between two sections.

       0.625rem is the standard gap between form sections, and Cim360FormSection now uses the
       same value - so Inventory Settings and Warehouse Settings match. Keep them equal if either
       changes. DEV-286. */
    margin-bottom: 0.625rem;
}

.inv-fl-group {
    /* No border on the group itself. It wraps the blue header as well as the body, so a border
       here drew grey lines down either side of the header - which Warehouse Settings does not
       have. Cim360FormSection puts its border on the BODY only, and this now matches.

       border:0 is load-bearing, not tidiness. The old rule here was
       border: 1px solid var(--cim360-border) !important, which was silently OVERRIDING a border
       DevExpress puts on this element itself. Removing ours un-masked theirs, and the radius
       override below then squared it off - so the body drew a rounded edge and the group drew a
       square one just outside it. That is the double border. DEV-286. */
    border: 0 !important;
    box-shadow: none !important;
    background: var(--cim360-card);
}

/* Scoped from .settings-section, which is our own div on both Inventory Settings pages, NOT
   from .inv-fl-group. CssClass on a DxFormLayoutGroup does not land on the .dxbl-group root -
   devtools showed that root carrying its own 1.33px border and the 10px radius while every
   .inv-fl-group rule sailed past it. That second, squarer border sitting just outside the
   rounded body is what read as a double border.

   The other two DxFormLayoutGroup users - DragAndDropTemplate and QuarantineInspectionCard -
   are not inside .settings-section, so they keep the global 10px rule untouched. DEV-286. */
.settings-section .dxbl-group {
    border: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
    background: transparent !important;
}

.settings-section .dxbl-group-header {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
}

.dxbl-group {
    border-radius: 0.625rem 0.625rem 0 0 !important;
}
.inv-group-header {
    /* Same geometry as .cim360-form-section-header: a 44px bar, same padding. It was 12px/18px
       with no min-height, so the two screens rendered visibly different bar heights. DEV-286. */
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 .75rem 0 1.25rem;
    background: var(--cim360-headerband-bg);
    color: var(--cim360-headerband-fg);
    width: 100%;
    border-radius: 0.3125rem 0.3125rem 0 0;
}

.inv-group-header-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cim360-headerband-fg);
    letter-spacing: .01em;
}

/* Matches .cim360-form-section-body: sides and bottom only, square where it meets the header,
   rounded at the bottom. Both class names are targeted because DevExpress renders one or the
   other depending on the group - and the rule below neutralises the inner one if it renders
   BOTH nested, which would otherwise draw two borders one inside the other. DEV-286. */
.settings-section .dxbl-group-content,
.settings-section .dxbl-group-body {
    /* Longhands, not the border shorthand. DevExpress loads AFTER app.css (App.razor lines 29 vs
       38+), so at equal specificity their !important longhands beat our !important shorthand -
       which is why this border rendered at their 1.33px in currentColor while only the separately
       declared border-top and border-radius survived. Scoped from .settings-section rather than
       .inv-fl-group because CssClass on a DxFormLayoutGroup does not reach these elements at all.
       DEV-286. */
    border-width: 1px !important;
    border-style: solid !important;
    border-color: var(--cim360-border) !important;
    border-top-width: 0 !important;
    border-radius: 0 0 0.3125rem 0.3125rem !important;
    padding: 1.375rem 1.5rem 1.5rem !important;
    background: var(--cim360-card) !important;
}

/* If DevExpress nests the two, the inner one drops everything so only one border shows. */
.settings-section .dxbl-group-content .dxbl-group-body,
.settings-section .dxbl-group-body .dxbl-group-content {
    border-width: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

.inv-fl-item {
    display: flex !important;
    flex-direction: column;
    min-width: 0;
}

.inv-fl-item .dxbl-fl-cpt {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cim360-text);
    padding-bottom: 0.25rem;
}

.inv-fl-item .dxbl-fl-ctrl {
    width: 100%;
}

.inv-fl-spacer {
    visibility: hidden;
}

/* A refused save marks the field it named, not just the banner at the top of the page. Cim360FormField
   does its own marking; these screens lay out with DxFormLayoutItem instead, so the mark is driven by
   the presence of a Cim360FieldProblem inside the item.

   :has() rather than a class on the item, because the item's CssClass is written into nine section
   files by hand and a section that forgot to compute it would look correct while never marking
   anything - the failure would be invisible in exactly the situation it exists for. The problem
   element is rendered by the component, so it cannot be forgotten.

   These reds are Cim360ValidationSummary's, as literals rather than tokens, because that component
   uses literals and the two are read together. DEV-205. */
.inv-fl-item:has(.cim360-field-problem) .dxbl-fl-cpt {
    color: var(--cim360-danger-fg);
}

.inv-fl-item:has(.cim360-field-problem) .dxbl-edit,
.inv-fl-item:has(.cim360-field-problem) .dxbl-combobox,
.inv-fl-item:has(.cim360-field-problem) input {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, .12);
}

.cim360-field-problem {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--cim360-danger-fg);
}

.inv-hint {
    font-size: 0.75rem;
    font-style: italic;
    color: var(--cim360-text-muted);
    line-height: 1.4;
    margin-bottom: 0.625rem;
}

/* Empty state used by stub sections */
.inv-empty {
    color: var(--cim360-text-muted);
    font-style: italic;
    padding: 0.75rem 0;
}

/* Spin edit followed by a literal "days" / "%" / etc. trailing label */
.inv-suffix-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
}

.inv-suffix-row .dxbl-spin-edit {
    flex: 1 1 auto;
    min-width: 0;
}

.inv-suffix-label {
    flex: 0 0 auto;
    color: var(--cim360-text-muted);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Side-by-side pair of section groups (Units of Measure + Finance) */
.inv-group-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.375rem;
    align-items: stretch;
    margin-bottom: 1.375rem;
}

.inv-group-pair > * {
    min-width: 0;
}

.inv-group-pair .inv-fl-group {
    margin-bottom: 0;
    height: 100%;
}

@media (max-width: 900px) {
    .inv-group-pair {
        grid-template-columns: 1fr;
        gap: 1.125rem;
    }
}

/* ---- Stocktake list view (global: grid cell templates, cards and the drawer render outside the page scope) ---- */
/* Round, like every other pill in the product - it was the only 6px one left in app.css. The rest
   of its metrics are its own: it rides inline beside a heading rather than standing alone.
   Canonical shape: .c360-pill in css/forms/cim360-dialog.css. */
.stk-cycle-badge {
    margin-left: 0.5rem;
    padding: 1px 0.375rem;
    border: 1px solid var(--cim360-border);
    border-radius: 62.4375rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .05em;
    color: var(--cim360-text-muted);
    vertical-align: middle;
}

.stk-status-chip,
.stk-scope,
.stk-move {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
}

.stk-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 62.4375rem;
    flex: none;
}

.stk-scope i { color: var(--cim360-text-muted); }

.stk-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stk-progress-track {
    flex: 1;
    height: 0.375rem;
    border-radius: 62.4375rem;
    background: var(--cim360-surface-muted);
    overflow: hidden;
}

.stk-progress-fill {
    height: 100%;
    border-radius: 62.4375rem;
}

.stk-progress-text {
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
    min-width: 2.625rem;
    text-align: right;
}

.stk-var-none { color: var(--cim360-text-muted); }

.stk-var-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.1875rem;
    padding: 2px 0.5rem;
    border-radius: 62.4375rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.stk-var-chip.gain {
    color: var(--cim360-violet-fg);
    background: var(--cim360-violet-bg);
}

.stk-var-chip.loss {
    color: var(--cim360-danger-fg);
    background: var(--cim360-danger-bg);
}

.stk-move.allowed { color: var(--cim360-status-finalised); }
.stk-move.locked { color: var(--cim360-status-loss); }

/* .stk-card, .stk-card-head and .stk-card-name were the stocktake card's own layout. The card is
   Cim360RecordCard now (css/cards/cim360-card.css, c360-lc-*), so all three are deleted rather
   than left as dead rules for someone to find and edit.

   Two of them were wrong as well as private. `.stk-card { padding: 12px 14px }` sat on top of
   .cim-cardview-card-wrap's own 16px, insetting everything about 30px; and the created line was
   `.desc-sub`, whose every rule in css/lists/cim360-list.css is written `.td-desc .desc-sub` - a
   grid cell selector. A card has no .td-desc ancestor, so that line took no styling at all and
   rendered at body size beside the name it was meant to sit under. Neither was visible from the
   markup, which is the argument for one shared card structure over a fourth private one. */

.stk-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--cim360-border);
    padding: 0 0.75rem;
}

.stk-tab {
    padding: 0.625rem 0.875rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--cim360-text-muted);
    border-bottom: 2px solid transparent;
}

.stk-tab.is-active {
    color: var(--cim360-primary);
    border-bottom-color: var(--cim360-primary);
}

.stk-drawer-body { padding: 1rem; }

.stk-activity {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 0.5rem 1rem;
}

.stk-activity dt {
    font-weight: 700;
    color: var(--cim360-text-muted);
}

.stk-activity dd {
    margin: 0;
    color: var(--cim360-text);
}

.stk-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    padding: 3rem 1rem;
    color: var(--cim360-text-muted);
    text-align: center;
}

.stk-placeholder i { font-size: 1.75rem; }

/* ── Stocktake count sheet (DEV-225) ───────────────────────────── */
.stk-cs-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.stk-cs-search-wrap { position: relative; display: inline-flex; align-items: center; }
.stk-cs-search-icon {
    position: absolute; left: 0.625rem; top: 50%; transform: translateY(-50%);
    color: var(--cim360-text-muted); font-size: 0.875rem; pointer-events: none;
}
.stk-cs-search {
    flex: 0 0 auto;
    min-width: 15rem;
    padding: 0.375rem 0.625rem 0.375rem 2rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: var(--cim360-surface);
    color: var(--cim360-text);
    font-size: 0.8125rem;
}
.stk-cs-toolbar-spacer { flex: 1 1 auto; }
.stk-cs-btn {
}
.stk-cs-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.stk-switch { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.stk-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.stk-switch .stk-switch-track {
    width: 2.25rem; height: 1.25rem; border-radius: 62.4375rem;
    background: var(--cim360-muted-soft); position: relative; transition: background 0.15s;
}
.stk-switch .stk-switch-track::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 1rem; height: 1rem; border-radius: 50%; background: var(--cim360-card); transition: left 0.15s;
}
.stk-switch input:checked + .stk-switch-track { background: var(--cim360-primary-surface); }
.stk-switch input:checked + .stk-switch-track::after { left: 1.05rem; }
.stk-switch input:disabled + .stk-switch-track { opacity: 0.55; }

.stk-cs-hint {
    display: flex; gap: 0.5rem; align-items: flex-start;
    padding: 0.625rem 0.75rem; margin-bottom: 0.75rem;
    border-radius: 0.375rem;
    background: var(--cim360-info-bg);
    border: 1px solid var(--cim360-info-border);
    color: var(--cim360-info-fg); font-size: 0.8125rem;
}
.stk-cs-progress { margin-bottom: 0.75rem; font-weight: 600; color: var(--cim360-text); font-size: 0.8125rem; }

.stk-loc-group { border: 1px solid var(--cim360-border); border-radius: 0.5rem; overflow: hidden; margin-bottom: 0.75rem; }
.stk-loc-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0.75rem; background: var(--cim360-headerband-bg); color: var(--cim360-headerband-fg); font-weight: 800; font-size: 0.8125rem;
}
.stk-loc-count { font-weight: 700; opacity: 0.9; font-size: 0.75rem; }
.stk-cs-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.stk-cs-table th {
    text-align: left; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
    color: var(--cim360-text-muted); padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--cim360-border);
}
.stk-cs-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--cim360-border); vertical-align: middle; }
.stk-cs-table tr:last-child td { border-bottom: none; }
.stk-cs-code { font-weight: 600; color: var(--cim360-primary); white-space: nowrap; }
.stk-cs-system, .stk-cs-counted, .stk-cs-variance { text-align: right; white-space: nowrap; }
.stk-cs-masked { letter-spacing: 0.15em; color: var(--cim360-text-muted); }
.stk-cs-muted { color: var(--cim360-text-muted); }
.stk-cs-input {
    width: 6rem; text-align: right; padding: 0.3rem 0.5rem;
    border: 1px solid var(--cim360-border); border-radius: 0.375rem;
    background: var(--cim360-surface); color: var(--cim360-text); font-size: 0.8125rem;
}
.stk-cs-input.has-value { border-color: var(--cim360-status-finalised); }

.stk-var { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 62.4375rem; font-weight: 600; font-size: 0.75rem; }
.stk-var-loss { background: color-mix(in srgb, var(--cim360-status-loss) 15%, transparent); color: var(--cim360-status-loss); }
.stk-var-gain { background: color-mix(in srgb, var(--cim360-status-gain) 15%, transparent); color: var(--cim360-status-gain); }
.stk-var-inline { background: var(--cim360-muted-soft); color: var(--cim360-text-muted); }
/* The warning pair rather than a color-mix of --cim360-warning, which at 15% leaves 12px bold text
   near 3:1 - short of AA, and this chip is the only thing separating a half-counted bin from a
   reconciled one. DEV-363, WCAG 1.4.3. */
.stk-var-partial {
    display: inline-flex; align-items: center; gap: 0.25rem;
    background: var(--cim360-warning-bg); color: var(--cim360-warning-fg);
}

.stk-cs-counter, .stk-cs-counters { display: inline-flex; align-items: center; gap: 0.375rem; }
.stk-batch-badge {
    display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.1rem 0.5rem; border-radius: 62.4375rem;
    background: var(--cim360-muted-soft); color: var(--cim360-text-muted); font-size: 0.75rem;
}
/* Found stock: the batch badge's shape in the success role, beside the description. DEV-563. */
.stk-found-chip {
    display: inline-flex; align-items: center; gap: 0.375rem; margin-left: 0.5rem;
    padding: 0.1rem 0.5rem; border-radius: 62.4375rem;
    background: var(--cim360-success-bg); color: var(--cim360-success-fg); font-size: 0.75rem; font-weight: 600;
}

/* ── Stocktake drawer chrome & count details (DEV-225 / DEV-44) ─── */
.stk-drawer { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--cim360-surface); }

.stk-subhead {
    flex: 0 0 auto;
    background: var(--cim360-headerband-bg);
    color: var(--cim360-headerband-fg);
    padding: 0.625rem 1rem 0.75rem;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.stk-subhead-tags { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.8125rem; color: var(--cim360-headerband-fg); }
.stk-subhead-tag { display: inline-flex; align-items: center; gap: 0.375rem; }
.stk-subhead-progress {
    display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start;
    font-size: 0.75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    background: rgba(0, 0, 0, .105); border: 1px solid color-mix(in srgb, var(--cim360-headerband-fg) 20%, transparent);
    padding: 0.3125rem 0.75rem; border-radius: 0.375rem;
}
.stk-subhead-dot { width: 0.5625rem; height: 0.5625rem; border-radius: 50%; box-shadow: 0 0 0 0.1875rem rgba(255, 255, 255, .25); }
.stk-subhead-sep { opacity: .6; }

.stk-main { flex: 1 1 auto; min-height: 0; display: flex; }
.stk-rail {
    flex: 0 0 13.125rem; background: var(--cim360-card, var(--cim360-card));
    border-right: 1px solid var(--cim360-border);
    padding: 0.875rem 0.625rem; display: flex; flex-direction: column; gap: 0.25rem;
}
.stk-rail-item {
    display: flex; align-items: center; gap: 0.625rem; width: 100%;
    padding: 0.6875rem 0.75rem; border: 0; border-radius: 0.5rem; background: transparent;
    color: var(--cim360-text); font-weight: 600; font-size: 0.875rem; cursor: pointer; text-align: left;
    transition: background .12s, color .12s;
}
.stk-rail-item > span { flex: 1 1 auto; }
.stk-rail-item:hover { background: var(--cim360-surface-hover, rgba(0, 0, 0, .04)); }
.stk-rail-item.is-active { background: var(--cim360-primary-soft, rgba(37, 99, 235, .12)); color: var(--cim360-primary-dark); }
.stk-rail-item i { font-size: 1rem; }
.stk-rail-badge {
    flex: 0 0 auto; min-width: 1.25rem; text-align: center;
    background: var(--cim360-status-approval); color: var(--cim360-card);
    border-radius: 62.4375rem; padding: 1px 0.5rem; font-size: 0.75rem; font-weight: 700;
}
.stk-tabpanel { flex: 1 1 auto; min-width: 0; overflow: auto; padding: 1.125rem 1.25rem; }

.stk-detail { max-width: 62.5rem; }
/* The count's status is the shared record-card stripe (Cim360RecordCardStripe), so it has no banner
   rules here. */

.stk-detail-hero {
    display: flex; align-items: center; gap: 1rem;
    background: var(--cim360-headerband-bg);
    color: var(--cim360-headerband-fg); border-radius: 0.75rem; padding: 1.125rem 1.25rem; margin-bottom: 1.375rem;
}
.stk-detail-hero-icon {
    flex: 0 0 auto; width: 3rem; height: 3rem; border-radius: 0.625rem;
    background: rgba(0, 0, 0, .12); display: flex; align-items: center; justify-content: center; font-size: 1.375rem;
}
.stk-detail-hero-main { flex: 1 1 auto; min-width: 0; }
.stk-detail-hero-code { font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.stk-detail-hero-scope { font-size: 0.8125rem; color: var(--cim360-headerband-fg); margin-top: 2px; }
.stk-detail-status {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(0, 0, 0, .12); border: 1px solid rgba(255, 255, 255, .24);
    padding: 0.25rem 0.75rem; border-radius: 62.4375rem; font-weight: 600; font-size: 0.8125rem;
}
.stk-detail-status-dot { width: 0.5625rem; height: 0.5625rem; border-radius: 50%; background: var(--tone, var(--cim360-card)); box-shadow: 0 0 0 0.1875rem rgba(255, 255, 255, .25); }

.stk-detail-section { margin-bottom: 1.375rem; }
.stk-detail-label {
    display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem;
    font-size: 0.8125rem; font-weight: 700; letter-spacing: .01em; color: var(--cim360-caption);
    -webkit-text-stroke: 0.35px currentColor;   /* faux extra-bold: grid font caps at 700 */
    text-stroke: 0.35px currentColor;
}
.stk-detail-label i { color: var(--cim360-primary); -webkit-text-stroke: 0; text-stroke: 0; }
.stk-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.875rem; }
.stk-detail-card {
    position: relative; overflow: hidden;
    border: 1px solid var(--cim360-border); border-radius: 0.625rem;
    padding: 0.75rem 0.875rem 0.75rem 1.125rem; background: var(--cim360-card, var(--cim360-card));
}
.stk-detail-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0.25rem;
    background: var(--cim360-primary-surface);
}
.stk-detail-card-label {
    display: flex; align-items: center; gap: 0.375rem; margin-bottom: 0.375rem;
    font-size: 0.75rem; font-weight: 700; letter-spacing: .01em; color: var(--cim360-primary);
    -webkit-text-stroke: 0.3px currentColor;   /* faux extra-bold: grid font caps at 700 */
    text-stroke: 0.3px currentColor;
}
.stk-detail-card-value { font-size: 0.875rem; font-weight: 700; color: var(--cim360-text-strong); word-break: break-word; }
.stk-detail-flag { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem 0.625rem; border-radius: 62.4375rem; font-weight: 600; font-size: 0.8125rem; }
.stk-detail-flag.on { background: color-mix(in srgb, var(--cim360-status-finalised) 15%, transparent); color: var(--cim360-status-finalised); }
/* off/neutral were muted text on --cim360-muted-soft, an opaque #94a3b8 in light AND dark:
   2.95:1 light, 1.52:1 dark, 1.35 / 1.29:1 with more contrast. A raised surface with a hairline
   instead, like the other neutral pills. danger's words are text-grade red (--cim360-status-loss),
   not the fill red, which measured 4.01:1 on its own tint in light. DEV-TC-1076. */
.stk-detail-flag.off, .stk-detail-flag.neutral { background: var(--cim360-surface-2); color: var(--cim360-text-muted); box-shadow: inset 0 0 0 1px var(--cim360-border); }
.stk-detail-flag.danger { background: color-mix(in srgb, var(--cim360-danger) 12%, transparent); color: var(--cim360-status-loss); }
/* The reason a person typed, under the who-and-when line in the CANCELLED card. Normal weight and
   muted, so the card's own value line stays the heading and this reads as the quotation. DEV-373. */
.stk-detail-cancel-reason {
    margin-top: 0.25rem; font-size: 0.8125rem; font-weight: 400;
    color: var(--cim360-text-muted); word-break: break-word; white-space: pre-wrap;
}

.stk-detail-notes {
    display: flex; gap: 0.5rem; align-items: flex-start;
    border: 1px solid var(--cim360-border); border-radius: 0.625rem; padding: 0.75rem 0.875rem;
    background: var(--cim360-info-bg, var(--cim360-surface)); color: var(--cim360-text); font-size: 0.8125rem;
}
@media (max-width: 900px) { .stk-detail-grid { grid-template-columns: 1fr; } }

/* Count sheet — code chevron, batch badge, flag stubs */
.stk-cs-code { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.stk-cs-code-id { color: var(--cim360-primary); font-weight: 800; }
.stk-cs-expand { color: var(--cim360-text-muted); cursor: default; }
.stk-batch-badge { text-transform: uppercase; letter-spacing: .03em; }
.stk-cs-flag { white-space: nowrap; text-align: right; }
.stk-cs-flagbtn {
    width: 1.875rem; height: 1.875rem; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--cim360-border); border-radius: 0.375rem;
    background: var(--cim360-surface); color: var(--cim360-text-muted); margin-left: 0.25rem;
}
.stk-cs-flagbtn:disabled { opacity: .5; cursor: not-allowed; }

/* Tolerance flags — DEV-362. Both dimensions can show at once, so they wrap. */
.stk-tolflag {
    display: inline-block; margin-right: 0.25rem; margin-bottom: 2px;
    padding: 1px 0.375rem; border-radius: 0.625rem;
    font-size: .75rem; white-space: nowrap;
}
.stk-tolflag-in { background: var(--cim360-surface); color: var(--cim360-text-muted); border: 1px solid var(--cim360-border); }
.stk-tolflag-out { background: var(--cim360-warning-bg); color: var(--cim360-status-loss); border: 1px solid var(--cim360-status-loss); }

/* ── Stocktake traceable tree (batch / serial) — DEV-226 ─────────── */
.stk-cs-expand {
    border: 0; background: transparent; cursor: pointer;
    color: var(--cim360-text-muted); padding: 2px 0.25rem; border-radius: 0.25rem;
    display: inline-flex; align-items: center;
}
.stk-cs-expand:hover { background: var(--cim360-surface-hover, rgba(0, 0, 0, .05)); color: var(--cim360-primary); }
.stk-cs-expand.open { color: var(--cim360-primary); }

.stk-cs-agg { font-weight: 700; color: var(--cim360-text-strong); }
.stk-cs-units-pill {
    display: inline-block; margin-left: 0.375rem; padding: 0 0.4375rem; border-radius: 62.4375rem;
    font-size: 0.75rem; font-weight: 700; background: var(--cim360-muted-soft); color: var(--cim360-card);
}
.stk-cs-units-pill.full { background: var(--cim360-status-finalised); }

.stk-cs-subrow { background: var(--cim360-primary-zebra); }
.stk-cs-subrow td { border-bottom: 1px solid var(--cim360-border-soft, var(--cim360-border)); }
.stk-cs-subcode { padding-left: 2rem !important; }
.stk-cs-subtick { color: var(--cim360-muted-soft); margin-right: 0.375rem; }
.stk-cs-unit-label { font-weight: 600; color: var(--cim360-text); }
.stk-cs-subdesc { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--cim360-text-muted); }

.stk-fm { display: inline-flex; border: 1px solid var(--cim360-border); border-radius: 0.375rem; overflow: hidden; }
.stk-fm-btn {
    border: 0; background: var(--cim360-surface); color: var(--cim360-text-muted);
    font-weight: 600; font-size: 0.75rem; padding: 0.25rem 0.875rem; cursor: pointer;
}
.stk-fm-btn + .stk-fm-btn { border-left: 1px solid var(--cim360-border); }
.stk-fm-btn:disabled { cursor: not-allowed; opacity: .6; }
.stk-fm-btn.found.sel { background: var(--cim360-status-finalised); color: var(--cim360-card); }
.stk-fm-btn.missing.sel { background: var(--cim360-danger); color: var(--cim360-card); }

/* ── Common card font across stocktake (our own variable, not the grid's) ──── */
.stk-drawer, .stk-countsheet, .stk-detail {
    font-family: var(--cim360-card-font-family);
    font-size: var(--cim360-card-font-size);
}
/* Body text sits at the card font-size; small uppercase captions/pills stay as accents. */
.stk-drawer, .stk-drawer td, .stk-drawer th, .stk-drawer span, .stk-drawer div,
.stk-drawer input, .stk-drawer button, .stk-drawer a, .stk-drawer p,
.stk-drawer dt, .stk-drawer dd, .stk-drawer label {
    font-family: var(--cim360-card-font-family);
}
.stk-cs-table, .stk-cs-table td, .stk-cs-input, .stk-cs-search, .stk-cs-btn,
.stk-cs-hint, .stk-cs-progress, .stk-loc-header, .stk-rail-item,
.stk-cs-code-id, .stk-cs-agg, .stk-cs-unit-label, .stk-cs-counter, .stk-cs-counters,
.stk-detail-card-value, .stk-detail-notes, .stk-detail-hero-scope, .stk-detail-status {
    font-size: var(--cim360-card-font-size);
}

/* Form controls don't inherit font-family by default — force stocktake inputs/buttons onto the same font. */
.stk-cs-search, .stk-cs-input, .stk-cs-btn, .stk-fm-btn, .stk-cs-flagbtn,
.stk-cs-toolbar input, .stk-cs-toolbar button {
    font-family: inherit;
}

/* ── Count sheet export dropdown (DEV-227 menu UI; header is small + bold) ──── */
.stk-cs-export { position: relative; }
.stk-cs-caret { font-size: 0.7em; margin-left: 2px; }
.stk-cs-btn.open { border-color: var(--cim360-primary); color: var(--cim360-primary); }
.stk-cs-export-backdrop { position: fixed; inset: 0; z-index: 40; }
.stk-cs-export-menu {
    position: absolute; top: calc(100% + 0.375rem); right: 0; z-index: 41;
    min-width: 15.625rem; padding: 0.375rem;
    background: var(--cim360-card); border: 1px solid var(--cim360-border);
    border-radius: 0.5rem; box-shadow: var(--cim360-shadow);
}
.stk-cs-export-head {
    padding: 0.5rem 0.625rem 0.4375rem; margin-bottom: 0.25rem;
    border-bottom: 1px solid var(--cim360-border-soft, var(--cim360-border));
    font-size: 0.75rem; font-weight: 700; letter-spacing: .01em;
    color: var(--cim360-caption);
}
.stk-cs-export-item {
    display: flex; align-items: center; gap: 0.5625rem; width: 100%;
    padding: 0.4375rem 0.625rem; border: 0; border-radius: 0.375rem; background: transparent;
    color: var(--cim360-text); cursor: pointer; text-align: left; font-family: inherit;
    font-size: 0.8125rem; font-weight: 500;
}
.stk-cs-export-item:hover { background: var(--cim360-surface-hover, rgba(0, 0, 0, .04)); }
.stk-cs-export-item i { color: var(--cim360-primary); font-size: 0.9375rem; }

/* Info banner icon — solid full blue. */
.stk-cs-hint i { color: var(--cim360-primary); font-size: 0.9375rem; flex: 0 0 auto; margin-top: 1px; }

/* ── Stocktake reconcile tab (DEV-229) ─────────────────────────── */
.stk-rec { font-family: var(--cim360-card-font-family); font-size: var(--cim360-card-font-size); }
.stk-rec-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.stk-rec-tile {
    position: relative; overflow: hidden; padding: 0.75rem 0.875rem 0.75rem 1.125rem;
    border: 1px solid var(--cim360-border); border-radius: 0.625rem; background: var(--cim360-card, var(--cim360-card));
}
.stk-rec-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0.25rem; background: var(--cim360-primary-surface); }
.stk-rec-tile-label { font-size: 0.75rem; font-weight: 700; letter-spacing: .01em; color: var(--cim360-caption); margin-bottom: 0.375rem; }
.stk-rec-tile-value { font-size: 1.625rem; font-weight: 800; line-height: 1.1; color: var(--cim360-text-strong); }
.stk-rec-tile-sub { margin-top: 2px; font-size: 0.75rem; font-weight: 600; color: var(--cim360-text-muted); }
.stk-rec-tile-sub.stk-rec-gain { color: var(--cim360-success); }
.stk-rec-tile-sub.stk-rec-loss { color: var(--cim360-danger); }
.stk-rec-gain { color: var(--cim360-status-gain); }
.stk-rec-loss { color: var(--cim360-status-loss); }

.stk-rec-banner { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.625rem 0.75rem; border-radius: 0.5rem; margin-bottom: 0.75rem; font-size: 0.8125rem; border: 1px solid transparent; }
.stk-rec-banner.warn   { background: var(--cim360-warning-bg); border-color: var(--cim360-warning-border); color: var(--cim360-warning-fg); }
.stk-rec-banner.danger { background: var(--cim360-danger-bg); border-color: var(--cim360-danger-border); color: var(--cim360-danger-fg); }

.stk-rec-empty { padding: 1.25rem; text-align: center; color: var(--cim360-text-muted); }
.stk-rec-table { width: 100%; border-collapse: collapse; }
.stk-rec-table th { text-align: left; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--cim360-text-muted); padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--cim360-border); }
.stk-rec-table th.num, .stk-rec-table td.num { text-align: right; white-space: nowrap; }
.stk-rec-table td { padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--cim360-border); vertical-align: middle; }
.stk-rec-row.blocked { background: color-mix(in srgb, var(--cim360-danger) 6%, transparent); }
.stk-rec-row.posted { opacity: .6; }
.stk-rec-code { display: flex; align-items: center; gap: 0.375rem; white-space: nowrap; }
.stk-rec-subrow { background: var(--cim360-primary-zebra); }

.stk-rec-type { display: inline-block; padding: 1px 0.5rem; border-radius: 62.4375rem; font-size: 0.75rem; font-weight: 700; }
.stk-rec-type.inc { background: color-mix(in srgb, var(--cim360-status-gain) 15%, transparent); color: var(--cim360-status-gain); }
.stk-rec-type.dec { background: color-mix(in srgb, var(--cim360-status-loss) 15%, transparent); color: var(--cim360-status-loss); }

.stk-rec-actions { text-align: right; white-space: nowrap; }
.stk-rec-post { border: 1px solid var(--cim360-primary); background: var(--cim360-primary-surface); color: var(--cim360-card); border-radius: 0.375rem; padding: 0.25rem 0.75rem; font-size: 0.75rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.stk-rec-post:hover:not(:disabled) { background: var(--cim360-primary-surface-hover); }
.stk-rec-post:disabled { opacity: .45; cursor: not-allowed; }

/* Section heading above the adjustments table. */
.stk-rec-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.125rem 0 0.625rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--cim360-caption);
}
.stk-rec-heading-count { font-weight: 700; }

/* Lot progress chip beside a traceable item code. */
.stk-rec-lot-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    margin-left: 0.5rem;
    padding: 2px 0.5625rem;
    border-radius: 62.4375rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--cim360-violet-bg);
    color: var(--cim360-violet-fg);
}

/* Blue action ribbon pinned to the bottom of the card, matching the quarantine card. */
.stk-rec { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.stk-rec-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

.stk-rec-footer {
    flex: 0 0 auto;
    min-height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 1.25rem;
    background: var(--cim360-headerband-bg);
    color: var(--cim360-headerband-fg);
}

.stk-wiz-error {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 1.25rem .75rem;
    padding: .6rem .85rem;
    border: 1px solid var(--cim360-status-loss);
    border-radius: 0.375rem;
    background: var(--cim360-danger-bg);
    color: var(--cim360-status-loss);
    font-size: .875rem;
}
.stk-rec-allocation-short {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-left: .5rem;
    color: var(--cim360-status-approval);
    font-size: .8125rem;
    white-space: nowrap;
}
.stk-rec-row.allocation-short td {
    background: var(--cim360-warning-bg);
}
.stk-rec-footer-end {
    justify-content: flex-end;
}

.stk-rec-approval {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--cim360-text-inverse);
}
.stk-rec-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 0.5rem;
    padding: 0.5625rem 1.125rem;
    background: rgba(0, 0, 0, .113);
    color: var(--cim360-text-inverse);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
}
.stk-rec-submit:hover:not(:disabled) { background: rgba(0, 0, 0, .21); }
.stk-rec-submit:disabled { opacity: .45; cursor: not-allowed; }
.stk-rec-posted { display: inline-flex; align-items: center; gap: 0.3125rem; color: var(--cim360-status-finalised); font-weight: 700; font-size: 0.75rem; }
.stk-rec-blocked { display: inline-flex; align-items: center; gap: 0.3125rem; color: var(--cim360-status-loss); font-weight: 700; font-size: 0.75rem; }

/* ── Stocktake new-count wizard (DEV-224) ──────────────────────── */
.stk-wiz-overlay { position: fixed; inset: 0; z-index: 1050; background: rgba(15,23,42,.32); backdrop-filter: blur(0.25rem); display: flex; align-items: center; justify-content: center; }
.stk-wiz {
    /* Positioned so it stacks above .c360-dlg-backdrop, which is absolutely placed behind it. */
    position: relative; z-index: 1;
    font-family: var(--cim360-card-font-family);
    width: min(67.5rem, calc(100% - 3rem)); max-height: calc(100% - 4rem);
    display: flex; flex-direction: column; background: var(--cim360-card, var(--cim360-card));
    border-radius: 0.75rem; overflow: hidden; box-shadow: var(--cim360-shadow);
}
.stk-wiz-head { background: linear-gradient(135deg, var(--cim360-primary-surface), var(--cim360-primary-surface-strong)); color: var(--cim360-card); padding: 1rem 1.5rem; display: flex; align-items: flex-start; justify-content: space-between; }
.stk-wiz-title { font-size: 1.375rem; font-weight: 800; margin-top: 0.25rem; }
.stk-wiz-close { background: transparent; border: 0; color: var(--cim360-card); font-size: 1.125rem; cursor: pointer; opacity: .85; }
.stk-wiz-close:hover { opacity: 1; }

.stk-wiz-steps { display: flex; align-items: center; gap: 0.5rem; padding: 0.875rem 1.5rem; border-bottom: 1px solid var(--cim360-border); }
.stk-wiz-step { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--cim360-text-muted); font-weight: 700; font-size: 0.8125rem; }
.stk-wiz-step.active { color: var(--cim360-primary); }
.stk-wiz-step.done { color: var(--cim360-status-finalised); }
.stk-wiz-step-num { width: 1.375rem; height: 1.375rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; background: var(--cim360-muted-soft); color: var(--cim360-card); }
.stk-wiz-step.active .stk-wiz-step-num { background: var(--cim360-primary-surface); }
.stk-wiz-step.done .stk-wiz-step-num { background: var(--cim360-status-finalised); }
.stk-wiz-step-line { flex: 1 1 auto; height: 1px; background: var(--cim360-border); }

.stk-wiz-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 1.375rem 1.5rem; }
.stk-wiz-section-label { font-size: 0.75rem; font-weight: 800; letter-spacing: .01em; color: var(--cim360-caption); margin-bottom: 0.75rem; }

.stk-wiz-scope-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0.875rem; }
.stk-wiz-scope-card { display: flex; gap: 0.75rem; text-align: left; padding: 0.875rem; border: 1px solid var(--cim360-border); border-radius: 0.625rem; background: var(--cim360-card, var(--cim360-card)); cursor: pointer; }
.stk-wiz-scope-card:hover:not(:disabled) { border-color: var(--cim360-primary); }
.stk-wiz-scope-card.sel { border-color: var(--cim360-primary); background: var(--cim360-primary-soft, rgba(29,117,187,.08)); box-shadow: 0 0 0 1px var(--cim360-primary) inset; }
.stk-wiz-scope-card:disabled { opacity: .55; cursor: not-allowed; }
.stk-wiz-scope-ico { flex: 0 0 auto; width: 2.25rem; height: 2.25rem; border-radius: 0.5rem; background: var(--cim360-primary-soft, rgba(29,117,187,.08)); color: var(--cim360-primary); display: flex; align-items: center; justify-content: center; font-size: 1.0625rem; }
.stk-wiz-scope-name { display: block; font-weight: 800; color: var(--cim360-text-strong); }
.stk-wiz-scope-desc { display: block; font-size: 0.75rem; color: var(--cim360-text-muted); margin-top: 2px; }
.stk-wiz-scope-soon { display: block; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: var(--cim360-text-muted); margin-top: 0.25rem; }

.stk-wiz-param { margin-top: 1.25rem; }
.stk-wiz-select { min-width: 16.25rem; padding: 0.5rem 0.625rem; border: 1px solid var(--cim360-border); border-radius: 0.5rem; background: var(--cim360-surface); color: var(--cim360-text); font-family: inherit; font-size: 0.875rem; }
.stk-wiz-input { width: 100%; padding: 0.5625rem 0.75rem; border: 1px solid var(--cim360-border); border-radius: 0.5rem; background: var(--cim360-surface); color: var(--cim360-text); font-family: inherit; font-size: 0.875rem; }
.stk-wiz-preview { margin-top: 1.125rem; display: flex; gap: 1.375rem; align-items: baseline; padding: 0.875rem 1rem; border: 1px solid var(--cim360-border); border-radius: 0.625rem; background: var(--cim360-surface); }
.stk-wiz-preview b { font-size: 1.25rem; font-weight: 800; }
.stk-wiz-preview .locked b { color: var(--cim360-status-loss); }
.stk-wiz-preview span { font-size: 0.75rem; color: var(--cim360-text-muted); margin-left: 0.25rem; }

.stk-wiz-field { margin-bottom: 1.125rem; }
.stk-wiz-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.875rem 1rem; border: 1px solid var(--cim360-border); border-radius: 0.625rem; margin-bottom: 0.75rem; }
.stk-wiz-toggle-text { min-width: 0; }
.stk-wiz-toggle-title { font-weight: 800; color: var(--cim360-text-strong); }
.stk-wiz-toggle-desc { font-size: 0.7813rem; color: var(--cim360-text-muted); margin-top: 2px; }

.stk-wiz-tiles { display: flex; gap: 1.625rem; padding: 0.875rem 1.125rem; border: 1px solid var(--cim360-border); border-radius: 0.625rem; margin-bottom: 0.875rem; }
.stk-wiz-tile b { font-size: 1.125rem; font-weight: 800; color: var(--cim360-text-strong); }
.stk-wiz-tile span { display: block; font-size: 0.75rem; color: var(--cim360-text-muted); margin-top: 2px; }
.stk-wiz-tile b.locked { color: var(--cim360-status-loss); }
.stk-wiz-lockbanner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.625rem 0.875rem; border-radius: 0.5rem; background: var(--cim360-info-bg); border: 1px solid var(--cim360-info-border); color: var(--cim360-info-fg); margin-bottom: 0.875rem; font-size: 0.8125rem; }
.stk-wiz-table { width: 100%; border-collapse: collapse; }
.stk-wiz-table th { text-align: left; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--cim360-text-muted); padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--cim360-border); }
.stk-wiz-table td { padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--cim360-border); font-size: 0.8125rem; }
.stk-wiz-table td.num { text-align: right; }
.stk-wiz-code { color: var(--cim360-primary); font-weight: 700; }
.stk-wiz-ready { color: var(--cim360-status-finalised); font-weight: 700; }
.stk-wiz-locked { color: var(--cim360-status-loss); font-weight: 700; }
/* Sits in .stk-wiz-foot, which is --cim360-primary, so it takes the inverse text colour the
   rest of that ribbon uses. The loss red it started as is a body-background colour and fails
   contrast on the blue. */
.stk-wiz-locked-note { display: inline-flex; align-items: center; gap: 0.375rem; margin-right: .75rem; color: var(--cim360-text-inverse); font-size: .8125rem; font-weight: 600; }

.stk-wiz-foot { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0.875rem 1.5rem; background: var(--cim360-primary-surface); }
.stk-wiz-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.375rem 0.9375rem; border-radius: 0.5rem; font-weight: 700; font-size: 0.875rem; cursor: pointer; border: 1px solid transparent; font-family: inherit; }
.stk-wiz-btn.ghost { background: rgba(0, 0, 0, .09); border-color: rgba(255,255,255,.35); color: var(--cim360-card); }
.stk-wiz-btn.primary { background: var(--cim360-card); color: var(--cim360-primary); }
.stk-wiz-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Reuse the count-sheet switch for toggles */
@media (max-width: 900px) { .stk-wiz-scope-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* Manual-selection item picker */
.stk-wiz-cf { margin-top: 1.375rem; padding: 0.875rem 1.125rem; border: 1px solid var(--cim360-info-border); border-radius: 0.625rem; background: var(--cim360-info-bg); }
.stk-wiz-cf-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.stk-wiz-cf-ico { flex: 0 0 auto; color: var(--cim360-primary); font-size: 0.9375rem; }
.stk-wiz-cf-expr { flex: 1 1 auto; min-width: 0; color: var(--cim360-text); font-family: inherit; font-size: 0.7813rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.stk-wiz-cf-expr.empty { font-family: inherit; font-size: 0.8438rem; color: var(--cim360-text-muted); }
.stk-wiz-cf-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border: 1px solid var(--cim360-border); border-radius: 0.5rem; background: var(--cim360-card, var(--cim360-card)); color: var(--cim360-text); font-family: inherit; font-size: 0.8438rem; font-weight: 700; cursor: pointer; transition: border-color .14s, color .14s; }
.stk-wiz-cf-btn:hover { border-color: var(--cim360-primary); color: var(--cim360-primary); }
.stk-wiz-cf-saved { display: flex; align-items: center; gap: 0.625rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--cim360-info-border); }
.stk-wiz-cf-saved label { font-size: 0.75rem; font-weight: 800; letter-spacing: .01em; color: var(--cim360-caption); }
.stk-wiz-cf-error { margin-top: 0.625rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.7813rem; font-weight: 600; color: var(--cim360-status-loss); }

.stk-wiz-picker { margin-top: 1.25rem; }
.stk-wiz-search { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border: 1px solid var(--cim360-border); border-radius: 0.5rem; background: var(--cim360-surface); }
.stk-wiz-search > i { color: var(--cim360-text-muted); font-size: 0.875rem; flex: 0 0 auto; }
.stk-wiz-search-input { flex: 1 1 auto; border: 0; background: transparent; color: var(--cim360-text); font-family: inherit; font-size: 0.875rem; outline: none; }
.stk-wiz-picker-count { margin: 0.625rem 2px; font-size: 0.75rem; font-weight: 700; color: var(--cim360-text-muted); }
.stk-wiz-picker-list { max-height: 16.25rem; overflow-y: auto; border: 1px solid var(--cim360-border); border-radius: 0.5rem; }
.stk-wiz-picker-row { display: flex; align-items: center; gap: 0.75rem; margin: 0; padding: 0.5625rem 0.75rem; border-bottom: 1px solid var(--cim360-border); cursor: pointer; font-size: 0.8125rem; }
.stk-wiz-picker-row:last-child { border-bottom: 0; }
.stk-wiz-picker-row:hover:not(.locked) { background: var(--cim360-surface); }
.stk-wiz-picker-row input { flex: 0 0 auto; }
.stk-wiz-picker-row.locked { background: color-mix(in srgb, var(--cim360-status-approval) 12%, transparent); }
.stk-wiz-picker-desc { flex: 1 1 auto; color: var(--cim360-text); }
.stk-wiz-lock-badge { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.3125rem; padding: 2px 0.5625rem; border-radius: 62.4375rem; font-size: 0.75rem; font-weight: 700; background: color-mix(in srgb, var(--cim360-status-approval) 20%, transparent); color: var(--cim360-status-approval); }
.stk-wiz-picker-empty { padding: 1.125rem; text-align: center; color: var(--cim360-text-muted); font-size: 0.8125rem; }
.cim360-qty-box {
    width: 5.25rem !important;
    min-width: 5.25rem;
    box-shadow: none !important;
    border: 1px solid var(--cim360-border) !important;
    border-radius: 0.375rem !important;
    background: var(--cim360-card) !important;
}
.cim360-qty-box:focus-within {
    border-color: var(--cim360-primary) !important;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--cim360-primary) 25%, transparent) !important;
}
/* DevExpress renders the actual <input> as .dxbl-text-edit-input — target it directly */
.cim360-qty-box .dxbl-text-edit-input,
.cim360-qty-box input {
    text-align: right !important;
    background: transparent !important;
}


/* ===== cim360 shared footer action button (DxButton) — use CssClass="ts-footer-btn" ===== */
.ts-footer-btn {
    background: var(--cim360-button) !important;
    color: var(--cim360-headerband-fg) !important;
    min-width: 8rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    white-space: nowrap;
}
.ts-footer-btn:hover:not(:disabled) { background: var(--cim360-button) !important; }
.ts-footer-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ts-footer-btn i { font-size: .9rem; }

/* Server refusal shown inside the New Custom Field dialog footer (DEV-255). Distinct from
   .ncf-error, which flags a single field; this one explains why the whole save was rejected. */
.ncf-save-error {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0 0 0.625rem 0;
    padding: 0.5625rem 0.6875rem;
    border: 1px solid var(--cim360-danger-border);
    border-radius: 0.375rem;
    background: var(--cim360-danger-bg);
    color: var(--cim360-danger-fg);
    font-size: 0.7813rem;
    line-height: 1.45;
}

.ncf-save-error i {
    flex: 0 0 auto;
    margin-top: 1px;
}

/* Server refusal (DEV-233) is Cim360DialogFooter's Error parameter now, rendered as
   .c360-dlg-foot-error in css/forms/cim360-dialog.css - one design, in the footer, for every
   settings dialog. The two copies that were here read "identically to each other" and differently
   from the Location detail dialog, which put the same message in a different place entirely. */

/* A stored dropdown option: a lock instead of the remove/reorder buttons, so the row keeps the
   same width and the list does not jump between locked and new rows. DEV-291.

   The 28px slot only. The padlock inside it is Cim360LockMark, which owns its own colour and
   size - this used to draw one by hand, which is how the product came to have two. */
.ncf-option-locked {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
}

/* Processing queue widget — shared by AddStock, RemoveStock and the stocktake card.
   Renders the widget only: the surrounding footer (background, padding) belongs to the
   consumer, because AddStock and RemoveStock already have one holding Cancel/Save. */
.cim-queue {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    margin-right: auto;
    color: var(--cim360-queue-fg);
    font-size: 0.75rem;
    font-weight: 600;
}

.cim-queue-label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
    opacity: .95;
}

.cim-queue-track {
    position: relative;
    width: 8.75rem;
    height: 0.375rem;
    background: var(--cim360-queue-track-bg);
    border-radius: 62.4375rem;
    overflow: hidden;
}

.cim-queue-fill {
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
    background: var(--cim360-queue-fg);
    border-radius: 62.4375rem;
    transition: width 200ms ease;
}

.cim-queue-count { white-space: nowrap; opacity: .95; }

/* The queue moving on (Cim360ProcessingQueue sets is-advancing for 1.6s): the strip flashes, the bar
   slides rather than jumps, the count pulses. The committed badge fades in and out. All of it is
   decoration on a change the count already states, so reduced motion simply goes without. */
.cim-queue.is-advancing { animation: cimQueueFlash 900ms ease; border-radius: 0.375rem; }
.cim-queue.is-advancing .cim-queue-fill { transition: width 450ms cubic-bezier(.2, .7, .3, 1); }
.cim-queue.is-advancing .cim-queue-count { animation: cimQueuePulse 500ms ease; display: inline-block; }

.cim-queue-committed {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 62.4375rem;
    background: var(--cim360-success-bg);
    color: var(--cim360-success-fg);
    font-size: 0.6875rem;
    font-weight: 700;
    white-space: nowrap;
    animation: cimQueueBadge 1600ms ease forwards;
}

@keyframes cimQueueFlash {
    0% { background: color-mix(in srgb, var(--cim360-queue-fg) 22%, transparent); }
    100% { background: transparent; }
}

@keyframes cimQueuePulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

@keyframes cimQueueBadge {
    0% { opacity: 0; transform: translateY(0.25rem); }
    15% { opacity: 1; transform: none; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cim-queue.is-advancing,
    .cim-queue.is-advancing .cim-queue-count,
    .cim-queue-committed { animation: none; }
    .cim-queue.is-advancing .cim-queue-fill { transition: none; }
}

.cim-queue-skip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.875rem;
    height: 1.875rem;
    background: var(--cim360-queue-btn-bg);
    border: 1px solid var(--cim360-queue-btn-border);
    color: var(--cim360-queue-fg);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 140ms ease;
}

.cim-queue-skip:hover { background: var(--cim360-queue-btn-hover); }

/* Footer slot for the stocktake card — the blue strip the queue widget sits in.
   AddStock/RemoveStock supply their own equivalent (.as-footer / .ts-footer). */
.stk-drawer-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--cim360-queue-bg);
    padding: 0.875rem 1.25rem;
}

/* Count sheet load failure banner. */
.stk-cs-load-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--cim360-danger-bg);
    color: var(--cim360-danger-fg);
    border: 1px solid var(--cim360-danger-border);
}

/* ---- Quarantine list view -----------------------------------------------------------------
   The status palette and the three grid-cell classes that survived the rewrite of
   Quarantine.razor on 2026-08-31. They were declared inside that page's 409-line inline
   <style> block, which is gone; the rest of that block was a parallel `q-*` re-implementation
   of shared components and was deleted rather than moved.

   Global, next to the Stocktake block above, for the same reason that one is: the values are
   read by SHARED components - Cim360KpiStrip, Cim360StatusSegments and Cim360Chip all receive
   these as `var(--cim360-q-*)` strings from Quarantine.razor.cs. A custom property inherits
   down the DOM, but its DECLARATION still has to be in a stylesheet that reaches an ancestor,
   and a scoped .razor.css cannot declare on :root - the compiler rewrites it to
   :root[b-<hash>], which matches nothing.
   ------------------------------------------------------------------------------------------ */

:root {

    --cim360-q-pending: #f59e0b;
    --cim360-q-passed: #16a34a;
    --cim360-q-failed: #dc2626;
    --cim360-q-rework: #7c3aed;
    --cim360-q-returned: #0891b2;
    --cim360-q-scrapped: #6b7280;
    --cim360-q-overdue: #d97706;
}

.q-locpath {
    white-space: nowrap;
}

.q-received {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.q-daysheld {
    color: var(--cim360-text-muted);
}

/* The description and its quarantine-rule chip on one line; the text gives way, the chip does not.
   AIO DEV-TC-558. */
.q-desc {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-width: 0;
}

.q-desc-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.q-desc > :not(.q-desc-text) {
    flex-shrink: 0;
}

/* Bootstrap ships `code` at #d63384, which measures 4.16:1 on the #f4f6f9 panels this product
   uses - under the 4.5:1 small text needs, and it clears the bar on pure white at exactly 4.50:1
   only by rounding. Inline code carries identifiers somebody is expected to read character by
   character, which is the worst possible place for a marginal colour. #b02a6b keeps the magenta
   and holds 5.72:1 on the panel and 6.20:1 on white. WCAG 1.4.3. */
code {
    color: var(--cim360-pink-fg);
}

/* =====================================================================================
   THE RECONNECT OVERLAY  #components-reconnect-modal
   =====================================================================================
   "Rejoining the server..." - Blazor's own, not ours. Nothing in this repository defines
   it: the framework injects the element AND a default stylesheet for it, and that default
   is a white panel. So on a dark screen the one thing that appears when the connection
   drops arrives as a white slab, which is both the worst moment for a surprise and the
   one piece of UI somebody cannot dismiss.

   Overridden here rather than left alone, because there is nowhere else to do it - the
   element is created by blazor.server.js and has no Razor file to carry a scoped rule.
   Every value is a token, so it follows the greyscale and high-contrast modes too.
   ===================================================================================== */

/* WHY THIS IS OUR MARKUP AND NOT AN OVERRIDE.

   Left to itself, blazor.web.js builds this panel with:

       this.host = document.createElement("div");
       this.host.id = "components-reconnect-modal";
       const root = this.host.attachShadow({ mode: "open" });
       root.appendChild(this.style);          // ITS stylesheet, inside the shadow root

   A shadow root is a styling boundary. No sheet of ours reaches inside one, with or
   without !important - which is why three passes at styling #components-reconnect-modal
   from here were served correctly and ignored completely, and the panel kept coming back
   white while the rules sat in the file looking right.

   When an element with that id already exists, Blazor skips all of it and toggles state
   classes on ours instead. So the markup lives in both host pages and these are ordinary
   rules over ordinary elements. */

.cim-reconnect {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20000;
    align-items: center;
    justify-content: center;

    /* A dark scrim in BOTH modes. It is a scrim: one that lightens the page in dark mode
       draws the eye away from the message rather than towards it. */
    background: rgb(0 0 0 / 55%);
}

/* ALL SIX non-hidden states, read out of blazor.web.js rather than assumed. The class Go
   declares show, retrying, failed, rejected, paused and resume-failed; a list written from
   memory had the first four and would have left the panel invisible for the other two -
   which is the connection dropping and nothing at all appearing to say so. */
.cim-reconnect.components-reconnect-show,
.cim-reconnect.components-reconnect-retrying,
.cim-reconnect.components-reconnect-failed,
.cim-reconnect.components-reconnect-rejected,
.cim-reconnect.components-reconnect-paused,
.cim-reconnect.components-reconnect-resume-failed {
    display: flex;
}

.cim-reconnect-panel {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 17.5rem;
    max-width: 26.25rem;
    padding: 1.125rem 1.25rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.625rem;
    background: var(--cim360-card);
    color: var(--cim360-text);
    box-shadow: 0 1.125rem 2.75rem rgb(0 0 0 / 35%);
}

.cim-reconnect-spinner {
    flex: 0 0 auto;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid var(--cim360-border);
    border-top-color: var(--cim360-primary);
    animation: cim-reconnect-spin 900ms linear infinite;
}

/* Under five seconds is 2.2.2's exemption and this is not: it spins for as long as the
   connection is down. Stopped outright for anybody who has asked for less motion, rather
   than slowed - a spinner is decoration and the words beside it carry the meaning. */
@media (prefers-reduced-motion: reduce) {
    .cim-reconnect-spinner {
        animation: none;
        border-top-color: var(--cim360-border);
    }
}

@keyframes cim-reconnect-spin {
    to { transform: rotate(360deg); }
}

.cim-reconnect-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cim-reconnect-title {
    font-size: 0.875rem;
}

.cim-reconnect-detail {
    display: none;
    font-size: 0.7813rem;
    color: var(--cim360-text-muted);
}

/* One line per state, so the panel says which of the three it is rather than "something
   happened". */
.components-reconnect-show .cim-reconnect-when-show,
.components-reconnect-retrying .cim-reconnect-when-show,
.components-reconnect-paused .cim-reconnect-when-show,
.components-reconnect-failed .cim-reconnect-when-failed,
.components-reconnect-resume-failed .cim-reconnect-when-failed,
.components-reconnect-rejected .cim-reconnect-when-rejected {
    display: inline;
}

.cim-reconnect-retry {
    margin-inline-start: auto;
    min-height: 2rem;
    padding: 0 0.875rem;
    border: 1px solid var(--cim360-primary);
    border-radius: 0.375rem;
    background: var(--cim360-primary-tint);
    color: var(--cim360-primary-dark);
    font-size: 0.7813rem;
    cursor: pointer;
}

.cim-reconnect-retry:focus-visible {
    outline: 2px solid var(--cim360-primary-dark);
    outline-offset: 2px;
}

/* Only offered once retrying has stopped. A Reload button beside "Rejoining…" invites
   somebody to throw away a reconnection that was about to succeed. */
.cim-reconnect-retry { display: none; }

/* The reload button is the same control in a quieter dress: Try again keeps the page, Reload
   throws it away, so the destructive one must not be the one the eye lands on. */
.cim-reconnect-reload {
    min-height: 2rem;
    padding: 0 0.875rem;
    border: 1px solid var(--cim360-border-strong);
    border-radius: 0.375rem;
    background: transparent;
    color: var(--cim360-text-muted);
    font-size: 0.7813rem;
    cursor: pointer;
}

.cim-reconnect-reload:focus-visible {
    outline: 2px solid var(--cim360-primary-dark);
    outline-offset: 2px;
}

.cim-reconnect-reload { display: none; }

.components-reconnect-failed .cim-reconnect-retry,
.components-reconnect-resume-failed .cim-reconnect-retry,
.components-reconnect-rejected .cim-reconnect-retry,
.components-reconnect-failed .cim-reconnect-reload,
.components-reconnect-resume-failed .cim-reconnect-reload,
.components-reconnect-rejected .cim-reconnect-reload {
    display: inline-flex;
    align-items: center;
}

/* Only Try again gets the auto margin, so the pair sits together at the end of the panel
   rather than one at each edge. */
.components-reconnect-failed .cim-reconnect-reload,
.components-reconnect-resume-failed .cim-reconnect-reload,
.components-reconnect-rejected .cim-reconnect-reload {
    margin-inline-start: 0.5rem;
}

/* =====================================================================================
   THE THING ON THE END OF A FIELD THAT OPENS  .dxbl-edit-btn-dropdown, .c360-sp-btn > .bi
   =====================================================================================
   A combo box, a date edit and a search picker all end in a chevron, and before this they
   drew it three different ways: DevExpress's neutral grey, our primary blue on the two
   screens that had asked for it by hand, and full-strength body ink on the picker. Nobody
   chose three; each was chosen once, locally, and none of them knew about the others.

   WHAT DARK MODE MADE VISIBLE
   The chevron was never the whole of it. DevExpress gives that button its own OPAQUE fill
   and its own border, so what sits at the end of the field is a rectangle, not an icon.
   Measured on the harness before this rule existed:

       light   field rgba(29,117,187,.05)   button #fffffe   near-white on near-white
       dark    field rgba(29,117,187,.12)   button #252525   neutral grey on blue-tinted

   In light the rectangle is invisible and only the icon reads, which is why this went
   years without being mentioned. In dark it is a grey block with a grey border welded to
   the end of a blue field - and the grey is a TRUE neutral, #c8c8c7, while every other
   pixel in that field is on the blue axis. It does not look like a quiet control; it
   looks like a control belonging to another application.

   AND IT OPTED OUT OF HIGH CONTRAST ENTIRELY
   Worse than a preference: in dark + high contrast the field goes to pure black and the
   text to pure white, and this button stayed #252525 on #c8c8c7 - unchanged from ordinary
   dark, in the one mode whose entire purpose is raising contrast. A person who turns high
   contrast on is told by every other pixel that it worked.

   WHAT IT IS NOW
   The button is part of the field rather than a thing bolted onto it: no fill, no border,
   and the chevron carries the state instead.

       at rest      --cim360-text-muted     quiet, and on the same hue axis as the field
       hover/open   --cim360-primary        the same blue the field's focus border takes

   Muted rather than primary at rest is deliberate. Blue is this product's ACTION colour;
   a form of eight dropdowns each flying a blue flag reads as eight things wanting to be
   pressed. It earns the blue when the pointer is on it or the list is open, which is also
   when the field border is already blue - so the control changes as one piece.

   MEASURED, NOT PICKED - chevron against the fill it actually sits on, all six modes.
   tools/a11y/prove-chevron.js re-runs this and fails under 3:1 (WCAG 1.4.11):
       light 7.08  dark 7.94  light+HC 17.04  dark+HC 16.83  and the blue 4.87 / 5.53.
   ===================================================================================== */
/* THE TOKENS GO ON THE EDITOR, NOT ON THE BUTTON.

   DevExpress paints the fill on a .dxbl-btn-group WRAPPER around the buttons, with

       .dxbl-text-edit > .dxbl-btn-group { background-color: var(--dxbl-text-edit-btn-bg) }

   The first version of this set --dxbl-text-edit-btn-bg on the BUTTON, which is a child of
   that wrapper - and a custom property inherits downwards only, so the wrapper went on
   reading the theme's value and the grey rectangle never moved. The icon was right, so it
   looked fixed. Setting it on .dxbl-text-edit puts it above both the wrapper and the
   buttons, which is the only element that can reach both.

   Tokens rather than properties for the same reason throughout: a plain `background` here
   ties with DevExpress's own rule on specificity and is then settled by which stylesheet
   loaded last, and the mode sheet is swapped by href at run time. A token has no such
   argument to lose - their rule reads it and paints what it is given.

   `body` ON THE FRONT OF EVERY SELECTOR HERE IS LOad-BEARING. DevExpress declares this
   exact token on this exact selector - `.dxbl-text-edit { --dxbl-text-edit-btn-bg: ... }` -
   so a bare `.dxbl-text-edit` ties on specificity and the winner is decided by which
   stylesheet came last. Theirs does: the framework re-registers its theme sheets after the
   page's own, and dark mode swaps one of them by href at run time. `body .dxbl-text-edit`
   is one element-selector heavier and cannot lose the tie. Removing it puts the grey
   rectangle straight back, with no other visible change. */
body .dxbl-text-edit {
    --dxbl-text-edit-btn-bg: transparent;
    --dxbl-text-edit-btn-hovered-bg: transparent;
    --dxbl-text-edit-btn-hover-bg: transparent;
    --dxbl-text-edit-btn-color: var(--cim360-text-muted);
    --dxbl-text-edit-btn-hover-color: var(--cim360-primary);
    --dxbl-text-edit-btn-image-color: var(--cim360-text-muted);
    --dxbl-text-edit-btn-hover-image-color: var(--cim360-primary);
    --dxbl-text-edit-close-btn-bg: transparent;
    --dxbl-text-edit-close-btn-hovered-bg: transparent;
    --dxbl-text-edit-close-btn-color: var(--cim360-text-muted);
    --dxbl-text-edit-close-btn-hovered-color: var(--cim360-primary);
}

/* EVERY BUTTON IN AN EDITOR, NOT THE CHEVRON ONE. A spin edit ends in two stacked buttons
   of class .dxbl-edit-spin-button, in their own wrapper - so the first version of this,
   which named the dropdown and clear buttons, left the spin edit drawing a #d3d3d2 divider
   in light and #767676 in dark, both DevExpress neutrals that follow neither our theme nor
   high contrast. It is on 21 screens, more than the date edit. Matching on the container
   rather than on each button class is what stops the next editor type needing this again. */
body .dxbl-text-edit > .dxbl-btn,
body .dxbl-text-edit > .dxbl-btn-group > .dxbl-btn,
body .dxbl-text-edit > .dxbl-btn-group-vertical > .dxbl-btn,
body .dxbl-text-edit .dxbl-edit-spin-button {
    color: var(--cim360-text-muted);

    /* Each edge named separately. `border-color` is a shorthand and loses to any DevExpress
       rule setting a single edge - which is what draws the divider line between the input
       and the button, and it survived a shorthand that looked like it covered everything. */
    border-top-color: transparent;
    border-right-color: transparent;
    border-bottom-color: transparent;
    border-left-color: transparent;

    --dxbl-btn-bg: transparent;
    --dxbl-btn-hover-bg: transparent;
    --dxbl-btn-active-bg: transparent;
    --dxbl-btn-border-color: transparent;
    --dxbl-btn-hover-border-color: transparent;
    --dxbl-btn-active-border-color: transparent;
    --dxbl-btn-color: var(--cim360-text-muted);
    --dxbl-btn-hover-color: var(--cim360-primary);
    --dxbl-btn-active-color: var(--cim360-primary);
}

/* The icon is an <svg> using currentColor, so colouring the button is enough - but the
   fill is stated anyway, because a DevExpress build that ships a hard-coded fill would
   otherwise be invisible until somebody looked at it in a browser. */
body .dxbl-text-edit .dxbl-btn svg,
body .dxbl-text-edit .dxbl-edit-spin-button svg {
    fill: currentColor;
}

/* :focus-within on the EDITOR, not :focus on the button - the button carries tabindex="-1"
   and never takes focus. Keyboard focus lands on the input, so keying into the field has to
   light the chevron the same way hovering does, or the control answers a mouse and not a
   keyboard. */
body .dxbl-text-edit:hover > .dxbl-btn,
body .dxbl-text-edit:hover > .dxbl-btn-group > .dxbl-btn,
body .dxbl-text-edit:hover > .dxbl-btn-group-vertical > .dxbl-btn,
body .dxbl-text-edit:hover .dxbl-edit-spin-button,
body .dxbl-text-edit:focus-within > .dxbl-btn,
body .dxbl-text-edit:focus-within > .dxbl-btn-group > .dxbl-btn,
body .dxbl-text-edit:focus-within > .dxbl-btn-group-vertical > .dxbl-btn,
body .dxbl-text-edit:focus-within .dxbl-edit-spin-button,
body .dxbl-text-edit > .dxbl-btn[aria-expanded="true"],
body .dxbl-text-edit > .dxbl-btn-group > .dxbl-btn[aria-expanded="true"] {
    color: var(--cim360-primary);
    --dxbl-btn-color: var(--cim360-primary);
    --dxbl-text-edit-btn-color: var(--cim360-primary);
    --dxbl-text-edit-btn-image-color: var(--cim360-primary);
}

/* Cim360SearchPicker's chevron, on the same three states. It is a Bootstrap <i>, not an
   svg, and it had no colour rule at all - so it inherited the button's --cim360-text and
   sat a full step darker than the DevExpress one beside it on the same form. */
.c360-sp-btn > .bi-chevron-down {
    color: var(--cim360-text-muted);
    transition: color .12s ease;
}

.c360-sp-btn:hover > .bi-chevron-down,
.c360-sp-btn:focus-visible > .bi-chevron-down,
.c360-sp-btn.is-open > .bi-chevron-down {
    color: var(--cim360-primary);
}
