﻿/* ============================================================================================
   Cim360 settings dialog — the one definition of a settings card's chrome.

   WHY THIS FILE EXISTS
   Six settings modals had six private class prefixes — crm-, wh-new-loc-, wh-add-modal-,
   wh-loc-detail-, ncf-, cud- — each with its own header padding, banner colour, title size and
   footer buttons. Nothing was shared, so nothing stayed in step: three different header heights,
   two different blues, four different title sizes, and only some of them had an icon. Set by the
   project owner on 2026-08-28: every settings card takes the Invite Users card's chrome.

   NOT SCOPED, DELIBERATELY. A .razor.css file is rewritten per component with a [b-xxxx]
   attribute, which is the opposite of what a shared look needs. This is linked globally from each
   host's App.razor / index.html.

   THE SPEC, and where each number comes from:
     header  — CompanyInviteModal .cim-invite-head: 16px/20px padding, the 135deg brand gradient,
               a 38px translucent icon disc, 16px/700 title, 12.5px description at 85% white.
     footer  — .cim-invite-foot: same gradient, 12px/20px padding, 34px buttons, secondary as a
               translucent outline and primary as solid white with brand text.
     body    — CompanyRoleSettingsModal, which the owner called the cleaner of the two: 20px/24px
               padding, 16px between fields, and 11px/700 uppercase labels with .06em tracking.

   Every one of those was already in the product. This file is where they stop being copies.
   ============================================================================================ */

/* â”€â”€â”€ Shell â”€â”€â”€ */

/* AND A DIALOG THAT HOLDS ENTERED WORK HAS NO CLICK-AWAY AT ALL.

   Set by the project owner on 2026-09-08, after clicking beside a part-filled allocation
   dismissed it: "I don't like it clicking around that dialog closes it". The precedent is
   Cim360Window, which is how a record card behaves - CloseOnBackdropClick is declared, defaults
   to false, and nothing in the product sets it, so a click beside a card does nothing whatever.
   A dialog committing stock, goods or money holds work worth the same protection: it is dismissed
   by its own X, its Cancel, or Escape. The nine Sales fulfilment dialogs are that shape and carry
   no backdrop element at all.

   Where a click-away IS wanted - a confirm holding nothing, a picker - it goes on the sibling
   below, never on the overlay, for the reason under it. */

/* The click-to-close, as a sibling BEHIND the card rather than the overlay around it.

   Closing on the overlay's own @onclick meant relying on the card's @onclick:stopPropagation to
   hold every click inside the dialog. That works only while the card's DOM element survives, and it
   does not survive a child re-rendering its own subtree - which DxSpinEdit does on every keystroke.
   The result was that typing into any number field closed the dialog: reported on the packaging and
   warehouse-planning dialogs, and latent in every other one with a number in it.

   A sibling cannot receive a click that happened inside the card, whatever re-renders. The card
   paints over it because it comes later in the DOM and takes a stacking context of its own.

   The same shape had a second fault, in the pointer rather than the DOM: a click goes to the
   nearest common ancestor of the press and the release, so selecting a field's text by dragging
   past the dialog's edge landed on the overlay around the card and closed it, discarding what had
   been typed (DEV-962). A sibling is clicked only when both ends are on it. That holds for every
   modal layer in the product, not only these, and R-117 in Test-Cim360Regressions.ps1 enforces it. */
.c360-dlg-backdrop {
    position: absolute;
    inset: 0;
}

.c360-dlg-overlay {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(15, 23, 42, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    outline: none;
    animation: c360DlgFade .16s ease;
}

/* Positioned so it stacks above .c360-dlg-backdrop, which is absolutely placed behind it. */
.c360-dlg-card {
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    width: 35rem;
    max-width: 100%;

    /* Capped against the WINDOW as well as against the overlay.

       max-height: 100% alone resolves against the overlay's height rather than its content box, so
       a tall dialog grew past the 24px gutter and sat edge to edge - measured at 704px inside a
       720px window. The dvh term restores the gutter, and it is also the term that survives an
       ancestor turning the overlay's `position: fixed` into something smaller, because a viewport
       unit is always the viewport. */
    max-height: min(100%, calc(100dvh - 3rem));
    background: var(--cim360-card, var(--cim360-card));
    color: var(--cim360-text);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1.5rem 3.75rem rgba(15, 23, 42, .28), 0 0.375rem 1rem rgba(15, 23, 42, .12);
    animation: c360DlgPop .2s cubic-bezier(.2, .9, .3, 1.05);
}

/* Width is the one thing a dialog legitimately varies: a role's four fields and an invite card's
   recipient list are not the same shape. Everything else is fixed.
   Adding a variant here means adding it to the max-width:760px block at the foot of this file too. */
.c360-dlg-card.is-narrow { width: 28.75rem; }
.c360-dlg-card.is-medium { width: 41.25rem; }
.c360-dlg-card.is-wide   { width: 47.5rem; }
.c360-dlg-card.is-xwide  { width: 48.75rem; }

/* 820px - the traceable details window (Cim360TraceablePicker), at the width its design sets. It
   opens over dialogs of every width, so it takes its own rather than borrowing its parent's; the
   columns are sized to fit it. DEV-489. */
.c360-dlg-card.is-picker { width: 51.25rem; }

/* 990px — the step between is-xwide and is-xxwide, for a dialog that carries a row of fields ABOVE
   a table rather than only one or the other. The invoicing dialog is the case: two option cards
   side by side, then four fields across, then a five-column table of money. At 760px the option
   cards were squeezed to the point of crushing their own explanatory line, which is the half that
   makes the choice decidable. Reported by the project owner, 2026-09-13.

   A sixth width rather than growing is-wide, which six unrelated dialogs use and none of them asked
   to move. The name says what it is rather than where it sits in the ladder, on the same reasoning
   the is-xxwide note below gives: a width nobody can pick correctly is worse than one more name. */
.c360-dlg-card.is-broad  { width: 61.875rem; }

/* The allocation dialog and its stock picker, and the widest thing here by a distance. Six columns
   of figures, a unit beside the editable one, and a description column carrying batch chips - at
   780px the item code and the description fought over the same 200px and the batch chips wrapped
   under every row. The design's own modal is 860px for its four columns; these carry two more.

   1240 rather than 1080 because of the ONE column that has to be readable: the editable quantity
   holds a number, the unit docked inside its right edge (56px of it, minimum) and the button that
   names the stock, and a unit spelt "Each" beside a four-figure quantity left about 45px for the
   number itself. max-width: 100% on the card is what keeps this honest on a smaller screen.

   The Financial Audit Trail's entry and repost dialogs use it too (DEV-620): two tables of
   references, dates and money, which at is-broad wrapped their headings at this product's rem.

   Only these dialogs use it, which is why it grew rather than gaining a sibling - a sixth width
   in the ladder for one screen is a variant nobody else will ever pick correctly. */
.c360-dlg-card.is-xxwide { width: 77.5rem; }

/* A record's fields beside its own editable grid (.c360-dlg-split, below) - the stock card's supplier
   link window: a 24rem column of fields, then a price breaks grid whose six editable columns at the
   most - quantity, discount (on a discount link), unit price, two dates and notes - need about 60rem
   of their own, controls and cell padding included. Any narrower and the number boxes are squeezed
   until a quantity reads "100.00..." and a price "7.5...".

   96vw rather than a fixed step, as the planning board does: a window narrower than the dialog takes
   the window, and below the width where both halves fit the grid drops beneath the fields. */
.c360-dlg-card.is-split  { width: min(97rem, 96vw); }

/* Fixed in size whatever the content - the design's is-fixedh (DEV-486's reverse allocation). The
   body already scrolls (flex: 1 1 auto; overflow-y: auto), so a height is all it takes for the header,
   the detail section and the footer to stay put while a long line list scrolls. */
.c360-dlg-card.is-fixedh { height: min(47.5rem, calc(100dvh - 3rem)); }

/* The taller fixed size, for the despatch half of the reverse window (DEV-488, DEV-1003). Its despatch-note facts, stock
   treatment and reason come to more than 47.5rem leaves the line table, even compact, so this half is fixed at a greater height.
   Fixed all the same - whatever the line count - and still no taller than the viewport leaves. */
.c360-dlg-card.is-fixedh.is-tall { height: min(58rem, calc(100dvh - 3rem)); }

/* The two sections of that window, tightened: a thinner title bar, less padding in the body, and no margin below each section (the
   dialog body already gaps its children). Chained to .is-tall because the section's own rules are scoped to the component and outrank
   a lone class; and only here - a settings page's sections keep their room. At a 768px-high screen the page leaves this window 634px,
   and these few rem are what let the line table, the units band and Reverse everything stay in it. */
.c360-dlg-card.is-fixedh.is-tall .c360-dlg-body { gap: .4rem; padding-top: .5rem; padding-bottom: .5rem; }
.c360-dlg-card.is-fixedh.is-tall .c360-dlg-body > .cim360-form-section { margin-bottom: 0; }
.c360-dlg-card.is-fixedh.is-tall .c360-dlg-body > .cim360-form-section .cim360-form-section-header { min-height: 2.1rem; }
.c360-dlg-card.is-fixedh.is-tall .c360-dlg-body > .cim360-form-section .cim360-form-section-body { padding: .75rem 1.25rem; gap: .5rem 1rem; }

/* Fills the window, a small margin all round - for a review that edits dozens of lines at once, where
   a card sized to its content leaves the grid showing one row (the Autodesk Fusion import's review
   window). The overlay's own padding is 1.5rem, so the card takes the viewport less 2rem and the
   margin is the rest. It sets BOTH dimensions and lifts the max-width every card carries; the body
   still scrolls (or the caller draws its own single scroll region) between a fixed head and foot. */
.c360-dlg-card.is-full { width: calc(100vw - 2rem); height: calc(100dvh - 2rem); max-width: none; max-height: none; }

@keyframes c360DlgFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes c360DlgPop {
    from { transform: translateY(0.5rem) scale(.985); opacity: 0; }
    to { transform: none; opacity: 1; }
}

/* Somebody who asked for less motion gets the dialog without the entrance. An RDP session reports
   reduced-motion to every site, so this is not only an accessibility preference. */
@media (prefers-reduced-motion: reduce) {
    .c360-dlg-overlay,
    .c360-dlg-card {
        animation: none;
    }
}

/* â”€â”€â”€ Header banner â”€â”€â”€ */

/* The banner carries its OWN top radius rather than relying on the card's overflow:hidden to clip
   it square. Clipping a square corner against a rounded parent leaves the parent's white showing
   through the antialiased pixels - a hairline of white against the blue at each corner. Curving
   the banner itself means there is no corner to clip and nothing behind it to show through.

   The value has to match .c360-dlg-card's 12px. */
.c360-dlg-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background: var(--cim360-headerband-bg);
    color: var(--cim360-headerband-fg);
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Required, not optional. Half the dialogs had one and half did not, which made the ones without
   look unfinished rather than plainer. */
.c360-dlg-head-icon {
    width: 2.375rem;
    height: 2.375rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, .135);
    border: 1px solid color-mix(in srgb, var(--cim360-headerband-fg) 35%, transparent);
    font-size: 1rem;
}

.c360-dlg-head-main {
    flex: 1 1 auto;
    min-width: 0;
}

/* A small line above the title naming what the dialog is about - the traceable window's item and
   how it is traced. Same colour rule as the subtitle below: full strength, for contrast. */
.c360-dlg-head-kicker {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--cim360-headerband-fg);
    line-height: 1.3;
}

.c360-dlg-head-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

/* A title that holds the Viewing flag (a settings dialog opened read-only) is a row, with the flag at its right-hand
   end - where a record card puts it. The head's text column already takes the width the close button leaves. */
.c360-dlg-head-title:has(> .c360-rch-mode) {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Full strength, not 85%. The band's own foreground on the band's own background is 4.87:1 and
   passes AA; fading it to 85% took it to 3.97:1 and failed, on all 48 dialogs at once. Found by
   the rendered run the first time it could open one of these - Cim360ConfirmModal is cim-cfm-*
   chrome, so the c360-dlg-* header had never been in front of axe at all. DEV-227.

   The hierarchy the fade was for is already carried without it: 12.5px at normal weight under
   16px at 700. Contrast is the thing that cannot be restated another way. */
.c360-dlg-head-sub {
    margin-top: 2px;
    font-size: 0.7813rem;
    color: var(--cim360-headerband-fg);
    line-height: 1.45;
}

.c360-dlg-head-sub code {
    background: rgba(0, 0, 0, .113);
    padding: 1px 0.3125rem;
    border-radius: 0.1875rem;
    color: var(--cim360-headerband-fg);
    font-family: inherit;
    font-size: 0.75rem;
}

.c360-dlg-head-close {
    flex: 0 0 auto;
    width: 1.875rem;
    height: 1.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    color: color-mix(in srgb, var(--cim360-headerband-fg) 92%, transparent);
    cursor: pointer;
    font-size: 0.8125rem;
}

.c360-dlg-head-close:hover {
    background: rgba(0, 0, 0, .12);
    border-color: color-mix(in srgb, var(--cim360-headerband-fg) 28%, transparent);
}

/* â”€â”€â”€ Body â”€â”€â”€ */

.c360-dlg-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    --c360-sticky-inset: 1.25rem;
    padding: var(--c360-sticky-inset) 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* NOTHING IN A DIALOG BODY SHRINKS. The body scrolls instead.
   ---------------------------------------------------------------------------------------------
   This is the other half of the rule above, and without it the body's overflow-y never fires.

   The body is a COLUMN FLEX CONTAINER, so its children are flex items with the default
   flex-shrink: 1 - they give up height when the container runs out. .c360-dlg-sect also carries
   `overflow: hidden`, for its rounded corners. Put those two together and a tall dialog does not
   scroll: every section is squeezed a little shorter and CLIPS its own content, so the format
   tiles are sliced in half, a row of checkboxes is cut through the middle, and the last section
   shows as a header band with nothing under it.

   scrollHeight then EQUALS clientHeight, because nothing overflowed - everything was squashed to
   fit. Which is why this reads as "the dialog cuts content off" and measures as "the dialog does
   not need to scroll". DEV-227; found from a screenshot, not from the numbers.

   flex-shrink: 0 makes each child keep its content height, the body genuinely overflow, and
   overflow-y do its job. Growing is untouched - a child with flex-grow still fills spare space. */
.c360-dlg-body > * {
    flex-shrink: 0;
}

/* â”€â”€â”€ Fields â”€â”€â”€ */
/* From the New Role dialog: an 11px uppercase label with wide tracking above a 36px control. It
   reads as a form rather than as prose, which is what makes it the cleaner of the two. */

/* Fields stack by default. Where a dialog wants two or three across, wrap them in .c360-dlg-grid
   and give each a Span out of 12 - the same 12-column idea Cim360FormField used, kept so the
   warehouse dialogs' layouts survive the move onto Cim360DialogField. */
.c360-dlg-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}

.c360-dlg-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Spans apply ONLY inside .c360-dlg-grid, and only to its direct children.
   This was on the bare .c360-dlg-field, commented "harmless outside a grid" - which was wrong, and
   wrong in the way that matters: harmless outside ANY grid, but inside a *different* one it forces
   every field to span 12 of that grid's 2 columns, so a deliberate two-up row silently becomes two
   rows. It did exactly that to the invite dialog's Locale and Expires. */
.c360-dlg-grid > .c360-dlg-field {
    grid-column: span var(--field-span, 12);
}

/* One column on a phone, whatever the spans say. */
@media (max-width: 600px) {
    .c360-dlg-grid > .c360-dlg-field {
        grid-column: span 12;
    }
}

/* ─── A record's fields beside its rows ───
   A dialog whose fields describe one record and whose grid lists that record's own rows - an item's
   supplier link on the left, its price breaks on the right. Side by side while the dialog has room
   for both; once it has not, the grid drops beneath the last field and the body scrolls.

   A CONTAINER query, never @media: what decides it is the width the dialog's body actually has, and
   a dialog's width is not the window's (cim360-frontend, "A layout rule inside a card, a window or a
   panel is a CONTAINER query"). The host and the split are two elements because an element cannot
   query itself. The threshold is in rem, as the dialog's width is, so the root's 80-100% scaling moves
   both together and only a window too narrow for the dialog changes the answer. */
.c360-dlg-splithost {
    container: c360dlgsplit / inline-size;
}

.c360-dlg-split {
    display: grid;
    grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.c360-dlg-split > * {
    min-width: 0;
}

/* 24rem of fields, the 1.25rem gap, and the 60rem the price breaks grid's controls need (is-split). */
@container c360dlgsplit (max-width: 85rem) {
    .c360-dlg-split {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Validation messages, in the field's own red rather than each dialog's. */
.c360-dlg-problem {
    font-size: 0.75rem;
    line-height: 1.45;
    margin-top: 0.25rem;
    color: var(--cim360-danger-fg);
}

/* â”€â”€â”€ THE label treatment. Every caption in the product reads this way â”€â”€â”€
   Sentence case, and `--cim360-caption` (#374151). Set by the project owner on 2026-09-11, after
   finding the product using two: uppercase-and-grey here and in every dialog, sentence-case-and-
   dark on Cim360FormField's pages. All-caps is a transform, so it also hides the capitalisation
   the words were actually written with - a sentence-case caption and a Title Case one look
   identical until the day the transform comes off.

   `--cim360-caption` measures 10.31:1 on white, 9.89:1 on --cim360-surface-2 and 9.52:1 on
   --cim360-surface: AAA (7:1) on every surface a label lands on, against 6.64:1 for the
   --cim360-text-muted it replaced, which was AA only. It is one step lighter than
   --cim360-text so the caption stays subordinate to the value it names, and it already had a
   dark-theme counterpart (#cbd5e1), which a new token would not have.

   GRID COLUMN HEADINGS ARE NOT LABELS and stay uppercase - .c360-grid-cols, every thead th, the
   list views' blue band. They are a table's own band rather than a caption on a control.

   inline-flex rather than block so a label can carry something beside its caption - the required
   marker, or a count on the right - without a second class. width:100% keeps it filling the field
   as a block label would. */
/* .cud-pref-label is CompanyUserDetailModal's nine preference captions. It is named here rather
   than given its own copy of these values: the markup there has not moved to Cim360DialogField yet
   (each caption sits above an enforced-or-editable branch), and a second declaration would be the
   duplicate that drifts. One definition, two names, until the markup catches up. */
/* â”€â”€â”€ THE field label. One declaration, every screen â”€â”€â”€
   A caption naming a control is the same object whether it is on a page or in a dialog, so it has
   ONE definition and this is it. It was two components with two private ones - Cim360FormField at
   13px/600 and Cim360DialogField at 11px/700 - which is why "Code" in the Edit Nominal Code dialog
   did not match "Issues" on the Nominal Settings screen behind it. Project owner, 2026-09-11.

   Every private caption class in the product is named here rather than restating these four values
   in its own file. A consumer's own sheet keeps only what is genuinely local to it: layout, and a
   colour where the caption sits on a coloured ground. Change the treatment here and all of them
   move; that is the whole point, and 61 private copies were the alternative.

   New markup should use `.c360-label`, or one of the two components. The rest of this list is the
   existing estate, and it shrinks as screens move onto the component. */
.c360-label,
.cim360-form-field-caption,
.c360-dlg-field label,
.c360-dlg-field > .c360-dlg-label,
.cud-pref-label,
.c360-dlg-label,
.as-field-label,
.ts-field-label,
.tr-field-label,
.cim360-cf-label,
.cim-fm-label,
.crm-check-label,
.cse-search-label,
.scd-clashes-label,
.qtn-checklist-label,
.wh-module-card-caption,
.wh-layout-inspector-row-label,
.wh-layout-toolstrip-label,
.wh-loc-confirm-delete-label,
.qplan-field label,
.qic-cf label,
.qic-form label,
.qtn-field label,
.soa-field > label,
.sopb-field > label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cim360-caption);
    letter-spacing: .01em;
}

/* Layout, which is NOT shared: a dialog field stacks its own label above its control, while a
   form field is a grid item whose spacing comes from the grid it sits in. */
.c360-dlg-field label,
.c360-dlg-field > .c360-dlg-label,
.cud-pref-label,
.c360-dlg-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    margin-bottom: 0.375rem;
}

/* A heading over a group of controls - "Recipients (3)", "Assign roles" - rather than the caption
   for one. It looks like a field label because it is doing the same visual job at the next level up,
   but it is not a label: it has no control, so it takes no `for`, and Cim360DialogField would be the
   wrong component. Kept as its own class so the distinction survives a grep. */
.c360-dlg-section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cim360-caption);
    letter-spacing: .01em;
}

/* â”€â”€â”€ Pills â”€â”€â”€ */
/* The shape of every pill, chip and badge in Settings. Colour is NOT here - that belongs to the
   thing the pill stands for (see cim360-frontend, "A pill inherits the colour of the thing it
   stands for"), and a role's accent arrives as an inline style from Cim360RolePill.

   Set by the project owner on 2026-08-28. Company and Users pills were all fully rounded
   (border-radius: 999px) and every Warehouse pill was 4px, so the same product had two pill
   languages either side of one settings menu. Sizes had drifted with them: 10.5px, 11px, 11.5px,
   .65rem and .7rem for the same object.

   A scoped .razor.css rule carries a [b-xxxx] attribute and therefore outranks anything global, so
   a pill opts in by wearing this class in the markup - the scoped sheets keep only their colours. */
.c360-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 2px 0.5rem;
    border-radius: 62.4375rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;

    /* The border is a tint of the pill's OWN text colour, so a variant that sets only `background`
       and `color` still gets an outline in its own hue - no variant has to name a border at all.
       32% matches RoleAccentPalette.PillStyle, which is where the treatment came from.

       `transparent` rather than `white` as the mix partner: white is right on a card and wrong on
       the footer's blue gradient, and a pill should not need to know what it is sitting on. */
    border: 1px solid color-mix(in srgb, currentColor 32%, transparent);
}

/* A pill you can click. Same language as .c360-pill - round, tinted, bordered from its own colour -
   but sized as a control rather than a label, because it is a real tap target.

   There are two shapes in this design language and only two: a pill states something, a chip
   toggles something. Warehouse had three implementations of the chip at 4px radius, two different
   paddings and two font sizes, while every pill beside them was round.

   Colour stays with the caller: a module chip is green when Sales is on, and that belongs to the
   module, not to the chip. */
.c360-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.75rem;
    border-radius: 62.4375rem;
    border: 1px solid var(--cim360-border);
    background: var(--cim360-card);
    color: var(--cim360-text-muted);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

@media (prefers-reduced-motion: reduce) {
    .c360-chip { transition: none; }
}

/* â”€â”€â”€ Messages â”€â”€â”€ */
/* One error, one warning, one info, one success, for the whole Settings area - dialogs and panels
   alike, which is why they live in the sheet both hosts link rather than in any one component.

   Ten spellings preceded this, at five font sizes and three radii, three of them on raw hex and one
   on Bootstrap's tokens instead of the theme's. Sizing is stated once here; only the palette changes
   between kinds. */
.c360-msg {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 0.7813rem;
    line-height: 1.45;
}

.c360-msg > i {
    flex: 0 0 auto;
    margin-top: 1px;
    font-size: 0.8125rem;
}

.c360-msg > span {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

/* Inherits the message's colour rather than picking its own, so one rule serves all four kinds. */
.c360-msg-dismiss {
    flex: 0 0 auto;
    margin: -2px -0.25rem 0 0.25rem;
    padding: 2px 0.25rem;
    border: 0;
    background: none;
    color: inherit;
    opacity: .7;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
}

.c360-msg-dismiss:hover {
    opacity: 1;
}

.c360-msg.is-error {
    background: var(--cim360-danger-bg);
    border-color: var(--cim360-danger-border);
    color: var(--cim360-danger-fg);
}

.c360-msg.is-warning {
    background: var(--cim360-warning-bg);
    border-color: var(--cim360-warning-border);
    color: var(--cim360-warning-fg);
}

.c360-msg.is-info {
    background: var(--cim360-info-bg);
    border-color: var(--cim360-info-border);
    color: var(--cim360-info-fg);
}

.c360-msg.is-success {
    background: var(--cim360-success-bg);
    border-color: var(--cim360-success-border);
    color: var(--cim360-success-fg);
}

/* On the footer's blue gradient the theme's light-surface palettes are unreadable, so a message
   there states its colours against the blue instead - the same lesson as .c360-dlg-foot-blocked. */
.c360-dlg-foot .c360-msg {
    background: rgba(0, 0, 0, .105);
    border-color: color-mix(in srgb, var(--cim360-headerband-fg) 38%, transparent);
    color: var(--cim360-headerband-fg);
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    max-width: 21.25rem;
}

.c360-dlg-foot .c360-msg.is-error {
    background: rgba(220, 38, 38, .92);
    border-color: rgba(255, 255, 255, .55);
}

/* â”€â”€â”€ Locked marker â”€â”€â”€ */
/* The padlock beside a field whose control is shown but cannot be changed on this record. Muted,
   and a step smaller than the caption: it is saying "not yours to change here", which is quieter
   than what the caption and the control are already saying. Product-wide, like the required
   marker below and for the same reason - this is the one form stylesheet every host links. */
.c360-locked {
    display: inline-flex;
    align-items: center;
    margin-left: 0.375rem;
    font-size: 0.75rem;
    line-height: 1;
    color: var(--cim360-text-muted);
}

/* The same lock with its reason on screen - a section header, a banner, a card chip. The gap is
   what separates glyph from words; the size steps up because this one is read, not just seen. */
.c360-locked.is-inline {
    gap: 0.3125rem;
    font-size: 0.75rem;
    line-height: 1.35;
}

/* On a coloured ground the lock takes the ground's own text colour rather than the muted grey,
   which would be unreadable on the card header's blue. */
.c360-locked.on-colour {
    color: inherit;
}

/* Warning marker: the triangle after a field's caption whose value needs attention. Sized like
   the padlock so the caption row keeps its height.
   A road sign: a light yellow fill under a dark outline and "!". No yellow light enough to look
   yellow reaches the 3:1 WCAG 1.4.11 asks of an icon (#fbbf24 is 1.54:1 on --cim360-surface), so
   the outline carries the contrast (6.55:1) and the fill is free to be light. The same colours in
   every theme: the yellow fill is what the outline is read against, not the page. */
.c360-warning-mark {
    display: inline-flex;
    align-items: center;
    margin-left: 0.375rem;
    font-size: 0.75rem;
    line-height: 1;
    cursor: help;
}

.c360-warning-mark-icon {
    position: relative;
    display: inline-block;
    width: 1em;
    height: 1em;
}

.c360-warning-mark-icon > .bi {
    position: absolute;
    inset: 0;
    line-height: 1;
}

.c360-warning-mark-fill {
    color: #fbbf24;
}

.c360-warning-mark-outline {
    color: var(--cim360-warning-fg);
}

.c360-warning-mark:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* â”€â”€â”€ Required marker â”€â”€â”€ */
/* Form-wide, not dialog-only, despite living in this file: it is the one form stylesheet every
   host links, and a marker linked in one host is a marker in one host.

   Always red, always with the word. Four treatments existed before this: blue on the New Custom
   Field dialog, and #d33a3a / #dc2626 / #c0392b elsewhere. There is no optional marker - if
   required is always marked, unmarked means optional. */

.c360-required {
    display: inline-flex;
    align-items: baseline;
    gap: 0.1875rem;
    margin-left: 0.375rem;
}

.c360-required-star {
    color: var(--cim360-danger-fg);
    font-weight: 700;
    line-height: 1;
}

/* Sized to sit inside a field label rather than compete with it - the caption is the heading and
   this is a note on it. Keeps the label's own tracking so the two read as one line.

   It reads "Required", not "REQUIRED": the caption beside it is sentence case now, and one word
   still shouting next to it reads as a different component rather than as part of the label.
   It stays red - the colour is the whole point of the marker, and #c0392b measures 5.44:1 on
   white, past the 4.5:1 that text this size needs. 10.5px rather than the 9.5px the uppercase
   form used, because lowercase letters at 9.5px are appreciably smaller than capitals were. */
.c360-required-text {
    color: var(--cim360-danger-fg);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .01em;
}

/* On a coloured band the light-surface red is unreadable: #991b1b on the header blue measures
   1.71:1, and 1.12:1 in the high-contrast theme, against the 4.5:1 WCAG 1.4.3 asks for. The marker
   brings its own ground rather than taking the band's text colour the way .c360-locked.on-colour
   does, because red IS the marker - a white "Required" reads as a caption. The danger triple is
   already paired per theme, so the word measures 7.60:1 light and 10.01:1 high-contrast inside it.
   Same lesson as .c360-dlg-foot .c360-msg. DEV-451. */
.c360-required.on-colour {
    align-items: center;
    padding: 1px 0.5rem;
    border: 1px solid var(--cim360-danger-border);
    border-radius: 62.4375rem;
    background: var(--cim360-danger-bg);
}

/* The bare asterisk span, kept for markup that has not moved to Cim360RequiredMark yet. Same red,
   so nothing is blue while the sweep finishes. */
.c360-dlg-req,
.ncf-required-star,
.as-req,
.a-req {
    color: var(--cim360-danger-fg);
}

.c360-dlg-hint {
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
    margin-top: 0.25rem;
    line-height: 1.45;
}

/* .cud-select joins for the same reason as .cud-pref-label above: it was a fifth control size
   (32px, 5px radius, 12.5px) in a product that had already settled on 36/6/13. */
.c360-dlg-input,
.cud-select {
    width: 100%;
    height: 2.25rem;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--cim360-text);
    background: var(--cim360-card);
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    outline: none;
    box-sizing: border-box;
}

.c360-dlg-input:focus {
    border-color: var(--cim360-primary);
    box-shadow: 0 0 0 0.1875rem color-mix(in srgb, var(--cim360-primary) 18%, transparent);
}

/* Shown but not editable reads as locked rather than absent - the field stays, greyed. */
.c360-dlg-input:disabled {
    background: var(--cim360-info-bg);
    border-color: var(--cim360-border-cool);
    color: var(--cim360-muted-soft);
    cursor: not-allowed;
}

/* A value the dialog is TELLING you, in the shape of the field it would be if you could change it.
   The item a picker was opened for, the rule it is following, the quantity it has reached.

   Not a disabled input, and the distinction is the whole reason this exists: disabled means "this
   control is unavailable to you", which invites the reader to wonder what they have to do to unlock
   it. These values have no control behind them at all - they are read from elsewhere on the screen -
   so they read as a filled panel with ordinary text rather than a greyed-out box. It is also not
   focusable and takes no `for`, so it goes in a Cim360DialogField's slot with a plain label rather
   than one pointing at an input that is not there.

   Two consumers on arrival, both in the stock picker: the three boxes above its grid and the two
   quantity boxes below it. The design draws all five as readonly inputs; this is the same look
   without an input nobody can type in. */
.c360-dlg-static {
    display: flex;
    align-items: center;
    width: 100%;
    height: 2.25rem;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    color: var(--cim360-text);
    background: var(--cim360-surface-2);
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* A figure, rather than a name: tabular so a column of them lines up, and heavy because it is the
   number the reader came to check. */
.c360-dlg-static.is-figure {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* A figure with its UNIT docked inside the right-hand edge, the way an editable quantity wears it.
   Two boxes reading "4" and "4 Each" side by side on the same screen is one unit rendered two ways;
   this makes the read-only pair match the grid above them.

   The unit segment is .c360-numbox-affix - the editable control's own, reused rather than copied.
   Those selectors are standalone, not descendants of .c360-numbox, so the class works here and
   there is one definition of what a docked unit looks like. The box gives up its horizontal padding
   for it: the affix has to sit flush against the border, and the value carries the padding instead. */
.c360-dlg-static.is-affixed {
    align-items: stretch;
    padding: 0;
}

.c360-dlg-static-value {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* On a tinted box the affix cannot keep its own near-white background - it would read as a white
   panel cut into a green one. Derived from currentColor so all three tones are covered once. */
.c360-dlg-static.is-ok .c360-numbox-affix,
.c360-dlg-static.is-warn .c360-numbox-affix,
.c360-dlg-static.is-error .c360-numbox-affix {
    background: color-mix(in srgb, currentColor 8%, transparent);
    border-left-color: color-mix(in srgb, currentColor 30%, transparent);
    color: inherit;
}

/* The three tones a running total can be in. Message colours, not new ones, so a box saying "you
   are short" is the same amber as the banner saying it above. */
.c360-dlg-static.is-ok {
    border-color: var(--cim360-success-border);
    background: var(--cim360-success-bg);
    color: var(--cim360-success-fg);
}

.c360-dlg-static.is-warn {
    border-color: var(--cim360-warning-border);
    background: var(--cim360-warning-bg);
    color: var(--cim360-warning-fg);
}

.c360-dlg-static.is-error {
    border-color: var(--cim360-danger-border);
    background: var(--cim360-danger-bg);
    color: var(--cim360-danger-fg);
}

/* ============================================================================================
   THE SALES DOCUMENT LINE GRID, shared by the Allocate and Reverse dialogs.

   These rules were SalesOrderAllocateDialog.razor.css, scoped to that one component. They are
   here, unchanged and under the same class names, because the reverse dialog has to be "the same
   look and feel as allocate, showing only what is allocated" - and a scoped rule compiles to
   .soa-table[b-hash] and reaches exactly one component. Copying them into a second .razor.css
   would give two definitions of one grid, which is R-002's whole subject.

   The names keep their soa- prefix rather than being renamed to something neutral. A rename would
   have touched every class in a screen that had just been signed off, late in a long session, for
   no behavioural gain - and the risk of a silently broken grid is worse than a prefix that now
   reads as "sales order lines" rather than "sales order allocate".

   .soa-takecell and .soa-pick moved here too, on 2026-09-08. They were left behind on the
   reasoning that "reversing names no stock" - true until the reversal screen gained its own
   picker, which pairs a quantity with a button choosing which committed holdings come OFF the
   line. Same cell, same job, opposite direction, so it is the same rule.

   Tokens only, no literal colours, so it follows the theme like every other surface.
   -------------------------------------------------------------------------------------------- */

/* The Allocate now / Reverse cell: the quantity, and the button that names the holdings behind it.
   Shared by both dialogs - the allocation picker chooses stock to take, the reversal picker chooses
   commitments to release, and the cell is identical. */
.soa-takecell {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.375rem;
}

/* Beside the quantity rather than in a column of its own - a column would cost width on every row
   for an override many lines never use, and this table is already six wide. Quiet until it has
   something to say. */
.soa-pick {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: transparent;
    color: var(--cim360-text-muted);
    font-size: 0.8125rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease;
}

.soa-pick:hover:not(:disabled) {
    border-color: var(--cim360-primary);
    color: color-mix(in srgb, var(--cim360-primary) 72%, var(--cim360-text-strong));
    background: color-mix(in srgb, var(--cim360-primary) 8%, transparent);
}

/* A line whose holdings have been NAMED reads differently from one following the default. Without
   this the only sign of an override is the chips under the description, which say what is involved
   but not that somebody chose it. */
.soa-pick.is-set {
    border-color: var(--cim360-primary);
    background: var(--cim360-primary-surface);
    color: var(--cim360-text-inverse);
}

/* A traced line waiting for its batches or serials - it is what holds the commit. */
.soa-pick.is-pending {
    border-color: var(--cim360-danger);
    color: var(--cim360-danger);
}

.soa-pick:disabled {
    opacity: .4;
    cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
    .soa-pick { transition: none; }
}

.soa-loading {
    padding: 1.5rem 0.5rem;
    color: var(--cim360-text-muted);
    text-align: center;
}

/* Cim360WheelLoader - the design's WheelLoad: the Cim360 wheel turning over a line naming what is
   being prepared. Used by the Allocate, Reverse and Despatch dialogs while their first read is in
   flight. DEV-485. */
.c360-wheel-load {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 9.5rem;
    padding: 1.5rem 0.75rem;
}

.c360-wheel-load-wheel {
    display: block;
    width: 2.875rem;
    height: 2.875rem;
}

.c360-wheel-load-wheel img {
    display: block;
    width: 100%;
    height: 100%;
    transform-origin: 50% 50%;
    animation: c360-de-spin 1s linear infinite;
}

.c360-wheel-load-text {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--cim360-text-muted);
}

@media (prefers-reduced-motion: reduce) {
    .c360-wheel-load-wheel img { animation: none; }
}

/* EVERY RULE THAT OVERRIDES .c360-grid-table CHAINS BOTH CLASSES, and that is not decoration.
   While these lived in a .razor.css they compiled to `.soa-table tbody td[b-hash]` - the scope
   attribute added specificity, invisibly, and that is what made them win. Moved here as
   `.soa-table tbody td` they tied with `.c360-grid-table tbody td` on specificity and lost on
   source order, which is 200 lines further down this same file. The padding went back to the
   settings grid's 14px/16px and the density tray turned pale, both silently.
   `.c360-grid-table.soa-table` is two classes and cannot lose to one, whatever the order. */

/* The header stays put while the lines scroll under it. Six columns of figures are unreadable
   without their headings, and the wrap above is what scrolls. */
.c360-grid-table.soa-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Tighter than the shared table. That geometry is right for a page-width list of a dozen rows; in
   a dialog holding an order's lines above a footer it costs a visible row per line.

   Two tokens now rather than a `padding` that had to out-specify the shared rule - and the height
   token with them, or this table would keep the 44px floor it is trying to get under. */
.c360-grid-table.soa-table {
    --c360-row-pad-y: 0.5rem;
    --c360-row-pad-x: 0.75rem;
    --c360-row-h: 2.125rem;
    --c360-head-h: 2.125rem;
}

/* Top-aligned, because the description cell is two lines and the rest are one: centred against a
   two-line cell leaves every figure floating in the middle of its row. */
.c360-grid-table.soa-table tbody td {
    vertical-align: top;
}

/* Compact is one line in every cell, so the cells centre. The top alignment above is for the
   two-line description cell - against a one-line row it hangs every figure off the ceiling. */
.c360-grid-table.soa-table.is-compact tbody td {
    vertical-align: middle;
}

/* Column widths. The shared table stylesheet deliberately leaves these to the consumer, and the
   description is the only elastic one - it holds prose and a row of chips, and everything else is
   a code or a figure of known width.

   The item column SIZES ITSELF to the code plus its pill, between a floor and a ceiling. A fixed
   150px made the pill wrap under the code, because the cell had no room for both; letting it grow
   without a ceiling would let one long code take the width the description needs. `width: 1%` with
   `white-space: nowrap` is the table-layout idiom for "as narrow as the content allows" - the
   browser expands it to fit rather than honouring the 1%. */
.soa-col-item {
    width: 1%;
    min-width: 9.375rem;
    max-width: 20rem;
    white-space: nowrap;
}

.soa-col-n {
    width: 6.25rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* The one column that has to be readable. In the allocate dialog it holds three things side by
   side: the number, the unit docked inside the box's right edge - .c360-numbox-affix, 56px at its
   narrowest - and the 28px button that names the stock. At 170px that left about 45px for the
   number, so a four-figure quantity beside a unit spelt "Each" was unreadable. */
.soa-col-take {
    width: 13.75rem;
    text-align: right;
}

/* Traced stock (DEV-777): the chip naming what a traced line needs or what was chosen, which opens
   the stock picker. As narrow as its words allow, the item column's idiom, so the description keeps
   the width - the reverse, receive and despatch windows share it. */
.soa-col-trace {
    width: 1%;
    white-space: nowrap;
}

.soa-trace-none {
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

.soa-code {
    font-weight: 700;
}

/* The two-line cell, the shape Custom Fields uses for a name with "Required · Text" under it. */
.soa-desc {
    font-size: 0.8125rem;
    color: var(--cim360-text);
}

.soa-subtitle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.1875rem;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

.soa-trace-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--cim360-primary);
    font-weight: 600;
    white-space: nowrap;
}

/* One batch or serial. Monospaced, because these are identifiers read character by character
   against a label on a shelf. */
/* A lot or batch label inside a grid cell. The outline and the smaller size make it a chip; the
   typeface is the grid's, with tabular figures, because a second face inside one row is the same
   defect wherever it appears - see the note on .c360-ct-code. */
.soa-chip {
    display: inline-block;
    padding: 1px 0.375rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.625rem;
    background: var(--cim360-card);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
    white-space: nowrap;
}

/* The "+3". Carries the full list in its title attribute, so nothing chosen is unreachable. */
.soa-chip.is-more {
    font-family: inherit;
    font-weight: 700;
    color: var(--cim360-primary);
    border-color: var(--cim360-primary);
    cursor: help;
}

/* Free stock that cannot cover what is outstanding. The row is still fully usable - a short line
   allocates what there is - so this is a warning colour rather than an error one. */
/* ─── A line that cannot be met - the one treatment across Sales and Purchasing (DEV-485) ───
   Short of free stock in the Allocate window, planned for more than was ordered on either planning
   board: an amber bar down the row's left edge, and the shortfall stated in words beside a warning
   icon in the cell it is about. NEVER a wash across the row - at 10% amber over every cell a table
   where every line is short read as one salmon block, and colour alone told nobody what was wrong
   (WCAG 1.4.1). The bar is an inset shadow on the first cell, so it takes no width and leaves the
   zebra, the entry band and hover painting as they do on every other row. A new grid that flags a
   line uses these two classes rather than a colour of its own. */
tr.c360-row-short > :first-child {
    box-shadow: inset 0.25rem 0 0 var(--cim360-warning);
}

.c360-row-short-note {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
    color: var(--cim360-warning-fg);
    font-weight: 700;
}

.soa-nostock {
    font-weight: 400;
    color: var(--cim360-text-muted);
}

/* ─── DEV-485: the allocate line table's design pieces ───────────────────────────────────────
   Zebra rows, the tinted entry band, amber short rows, the Traced stock chip, the document nodes of
   a multi-document tree, and the blue footer band. Every selector chains .c360-grid-table.soa-table
   where it competes with the shared table rule - see the note above on why one class loses. */
/* Scoped to .soa-zebra - the Allocate and Reverse tables - and not the whole .soa-table family,
   which the despatch and invoice dialogs share and did not ask for any of this. */
.c360-grid-table.soa-table.soa-zebra tbody tr:not(.soa-docnode):nth-child(even) > td {
    background-color: color-mix(in srgb, var(--cim360-text) 2.5%, var(--cim360-card));
}

/* Hover over the zebra and the amber: they paint the CELLS, so the table's own row hover would be
   hidden under them on every even row. */
.c360-grid-table.soa-table.soa-zebra tbody tr:not(.soa-docnode):hover > td {
    background-color: color-mix(in srgb, var(--cim360-primary) 9%, var(--cim360-card));
}

/* The entry column in its own band, so the one editable figure in a row of read-only ones is where
   the eye lands - unbroken down the column. Every rule in this group has the SAME specificity
   (0,5,3), each carrying `:not(.soa-docnode)`, so the file order decides: zebra, then amber, then
   hover, then this band last. Add `:not` to one and not the others and the band or the amber loses
   on every even row - which is exactly what happened once. */
.c360-grid-table.soa-table.soa-zebra tbody tr:not(.soa-docnode) > td.soa-col-take,
.c360-grid-table.soa-table.soa-zebra thead tr:not(.soa-docnode) > th.soa-col-take {
    background-color: color-mix(in srgb, var(--cim360-primary) 7%, var(--cim360-card));
}

/* The Traced stock chip: Pick batches / Pick serials while a traced line waits (amber, "needed"),
   Picked once its stock is named (green), and a quiet one for a plain line's optional bins. */
.soa-trace-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    min-height: 1.75rem;
    padding: 0 0.625rem;
    border: 1px dashed var(--cim360-border);
    border-radius: 62.4375rem;
    background: transparent;
    color: var(--cim360-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.soa-trace-chip:hover:not(:disabled) {
    border-color: var(--cim360-primary);
    color: var(--cim360-primary);
}

.soa-trace-chip.is-needed {
    border-style: solid;
    border-color: var(--cim360-warning);
    background: color-mix(in srgb, var(--cim360-warning) 12%, var(--cim360-card));
    color: var(--cim360-warning-fg);
}

.soa-trace-chip.is-picked {
    border-style: solid;
    border-color: var(--cim360-success);
    background: color-mix(in srgb, var(--cim360-success) 12%, var(--cim360-card));
    color: var(--cim360-success-fg);
}

.soa-trace-chip:disabled {
    cursor: default;
    opacity: 0.55;
}

span.soa-trace-chip { cursor: default; }

/* A document's node on a multi-document tree. */
.c360-grid-table.soa-table tbody tr.soa-docnode > td {
    background-color: color-mix(in srgb, var(--cim360-primary) 8%, var(--cim360-card));
    border-top: 1px solid var(--cim360-border);
}

.soa-docnode-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.soa-docnode-cust {
    color: var(--cim360-text-muted);
}

.soa-docnode-units {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* The design's blue footer band under the line table: the lines on the left, how much of what is
   still needed is being committed (or reversed) on the right. Rendered in the grid's AfterBody, so
   the card draws the outline and rounds the corners - it needs no margin or radius of its own, and
   the old negative margin that tried to pull it up against the card is what left the gap. */
.soa-lfoot {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0.875rem;
    background: var(--cim360-primary-surface);
    color: var(--cim360-on-primary);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}

.soa-note {
    margin: 0.5rem 0 0;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

/* The item cell: the code, and one pill saying what kind of line it is - side by side on one line.
   NOT flex-wrap: wrap, which is what put the pill underneath: with the column fixed at 150px there
   was no room for both, so the pill took a second line and every row grew. The column autosizes
   now and this refuses to wrap. */
.soa-itemcell {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.375rem;
}

/* Nor may anything in it shrink: a pill squeezed narrower than its label wraps the label instead,
   one syllable a line - "Ch / arg / e" on the receive window (DEV-773). */
.soa-itemcell > * {
    flex-shrink: 0;
    white-space: nowrap;
}

/* The pill variants. .c360-pill owns the shape and derives its border from currentColor, so a
   variant names only a background and a text colour. The token pairs are the message palette's, so
   a charge pill and an info banner are the same blue rather than two blues nobody chose. */
.soa-pill.is-service {
    background: var(--cim360-info-bg);
    color: var(--cim360-info-fg);
}

.soa-pill.is-charge {
    background: var(--cim360-warning-bg);
    color: var(--cim360-warning-fg);
}

.soa-pill.is-batch,
.soa-pill.is-serial {
    background: color-mix(in srgb, var(--cim360-primary) 10%, transparent);
    color: color-mix(in srgb, var(--cim360-primary) 72%, var(--cim360-text-strong));
}

/* The card's own margin. Inside a dialog body that already gaps its children, the settings grid's
   page-level bottom margin would double it - and the rule box sits right above the table, so a
   negative top margin closes the body's 16px gap without touching the shared component. */
.soa-card {
    margin: 0;
    margin-top: -0.5rem;
}

/* The lines scroll inside the card rather than the dialog growing until its footer is off screen.
   Cim360SettingsGrid renders the body, so this arrives through its BodyCssClass. */
.soa-body {
    max-height: 44vh;
    overflow: auto;
}

/* On a phone the dialog is full screen and its body scrolls, so a second scroll container inside
   it is one the reader has to find. */
@media (max-width: 900px) {
    .soa-body {
        max-height: none;
        overflow: visible;
    }
}

/* THE REVERSE ALLOCATION WINDOW (SalesOrderReverseDialog, is-fixedh): the line table is the only thing in it that scrolls.

   The window is fixed in height and the design puts the Reversal detail ABOVE the table "so the window does
   not scroll". But the table kept the Allocate window's cap, 44vh, whatever was left over: on a 20-line order
   the sections, a 44vh table, the units band and the Reverse everything bar came to more than the body, so the
   BODY scrolled (207px at 1600x900), the band and the quantity actions started below the fold, and scrolling to
   them took the Reason out of view.

   Here the table takes what the sections above and the bar below leave, with a floor of 13rem - a line and a
   half of table under its header and above the band, so a short list is never cut mid-line. The body still
   scrolls where even that floor cannot fit - a window shorter than its sections need - which is the only time.
   Not on a phone (the rule above), where the dialog is full screen and its body scrolls. The despatch half of the
   same dialog asks for is-fit too: its sections are laid out in two rows and one, and its window is the taller
   fixed size (.is-tall above), so a long despatch list scrolls inside the table with the units band and the
   Reverse everything bar in view.

   The Convert window (quotation -> order) and the Receive return window ask for is-fit too. Their line table is
   the in-card grid (.c360-grid-incard, not filling), which holds its natural height, so a long quotation or
   return grew the table until the Target fields, the units band, Take everything and the consequence line were
   below the fold. The same rules apply to it: the card takes what the sections above and below leave, floor 13rem,
   and its body is the only scroller. Receive's units band is the grid's AfterBody, so it stays in view.

   Defined here, like .soa-body: Cim360SettingsGrid is a shared component, so a scoped rule never reaches its
   markup. The grid's own header, footer and the units band keep their height; only the table body gives way. */
@media (min-width: 901px) {
    .c360-dlg-body.is-fit > .soa-card,
    .c360-dlg-body.is-fit > .c360-grid.c360-grid-incard {
        flex: 1 1 0;
        min-height: 13rem;
        display: flex;
        flex-direction: column;
    }

    .c360-dlg-body.is-fit > .soa-card > .c360-grid-head,
    .c360-dlg-body.is-fit > .soa-card > .soa-lfoot,
    .c360-dlg-body.is-fit > .c360-grid-incard > .c360-grid-head,
    .c360-dlg-body.is-fit > .c360-grid-incard > .soa-lfoot,
    .c360-dlg-body.is-fit > .c360-grid-incard > .c360-grid-foot {
        flex-shrink: 0;
    }

    .c360-dlg-body.is-fit > .soa-card > .soa-body,
    .c360-dlg-body.is-fit > .c360-grid-incard > .c360-grid-body {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
    }
}

/* THE TRACEABLE DETAILS WINDOW (Cim360TraceablePicker): the line table is the only thing that scrolls.

   Everything in a dialog body keeps its height (the rule near the top of this file) and the body
   scrolls instead, which for this window carried the pinned cells, the table heading, the banner and
   the totals out of view with it. The one child allowed to give height back is the grid card that
   holds the table: it shrinks to the room the dialog has, the shared .c360-grid-body inside it then
   scrolls, and the table heading stays put because it is sticky inside that scroller. No height is
   guessed in vh - the room is whatever the dialog's own max-height leaves.

   The floor is the card's bar, the column heading and about three rows. Below it the body scrolls
   instead, which is the only way the buttons stay reachable in a window that short. There is no
   narrow-screen exception: the table is the only scrolling region at every width, which is what the
   window's own acceptance criterion says, and the footer is outside the body so it never scrolls away.

   It is NOT done through the grid's BodyCssClass. That class lands on a div Cim360SettingsGrid draws,
   which a rule in the picker's scoped stylesheet can never match; R-139 keeps it that way. */
.c360-dlg-card.is-picker .c360-dlg-body > .ctp-card {
    flex: 0 1 auto;
    min-height: 13.5rem;
}

/* The density group, on the blue bar. .filter-density is the shared control and keeps its shape,
   its sizes and its 24px target; its buttons are dark text on a light tray, which is invisible
   here, so only the colours change. */
/* Chained for the same reason as the table rules above, and this one fights across FILES:
   .filter-density sets `background: var(--cim360-info-bg)` in css/lists/cim360-list.css, which is loaded after
   this one, so a lone .soa-density lost and the tray came out pale on a blue bar. */
/* --cim360-text-inverse is #ffffff in BOTH modes, which is correct for text on a blue bar and
   wrong the moment it is used as a FILL: the active button was a solid white pill on a dark
   bar carrying --cim360-primary, which in dark is #4DA3E8, so pale blue on white measured
   2.72:1 and the selected view mode became the one you could not read. Reported from the
   screen, on the picking and delivery lists.

   The band's own tokens instead. They are white in light, so none of this moves there. */
.filter-density.soa-density {
    background: rgba(0, 0, 0, .12);
    border-color: color-mix(in srgb, var(--cim360-headerband-fg) 35%, transparent);
}

.filter-density.soa-density button {
    color: var(--cim360-headerband-fg);
}

.filter-density.soa-density button:hover:not(.active):not(:disabled) {
    background: rgba(0, 0, 0, .135);
    color: var(--cim360-headerband-fg);
}

.filter-density.soa-density button.active {
    background: var(--cim360-headerband-control-bg);
    color: var(--cim360-headerband-control-accent);
}

/* TWO LINES, held by refusing to WRAP rather than by clipping a height.

   This was `max-height: 1.7em; overflow: hidden`, and it cut the bottom off every pill. A chip is
   1.5 line-heights of 10.5px text plus 2px of padding and 2px of border - about 19.75px - and
   1.7em of the subtitle's 11.5px is 19.55px. Fractionally too short, so the row of pills was
   trimmed along its underside. Any number chosen there is a number to get wrong again the next
   time a font size moves.

   nowrap makes it right by construction: the subtitle is one flex line because it cannot become
   two, so there is no overflow to clip vertically and nothing to measure. What overflows now is
   the RIGHT edge, and only on identifiers longer than the column - where the "+n" chip's title
   still carries every one of them.

   Relaxed is deliberately exempt: "never collapse" is the whole point of it. */
.soa-desccell.is-capped .soa-subtitle {
    flex-wrap: nowrap;
    overflow: hidden;
}

/* Neither the count nor a chip squashes to make room. A flex item shrinks below its content by
   default, which on a nowrap line would compress the pills into unreadable slivers - and a sliver
   of a batch number is worse than a clipped one, because it looks like a complete identifier that
   happens to be short. */
.soa-desccell.is-capped .soa-trace-count,
.soa-desccell.is-capped .soa-chip {
    flex: 0 0 auto;
}

/* Compact is one line per row, so the description itself must not wrap either. */
.soa-desccell.is-oneline .soa-desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* â”€â”€â”€ Bulk actions under a grid â”€â”€â”€ */
/* The pair that acts on every row of a table in a dialog - "fill them all in" and "rub them all
   out". Hard left, under the table, beneath any message about it.

   NOT in the footer, and not on the grid's blue bar. The footer is for the two buttons that END the
   dialog; these change what is in it. And .c360-grid-new is the bar's own button, which is a
   different shape and a different colour because it means something else.

   Global rather than scoped, because both the allocation dialog and its stock picker have this pair
   and they must be one control. In a .razor.css the rule would compile to .c360-dlg-bulk[b-hash]
   and reach exactly one of them - which is how the allocation dialog's private copy started, and
   the picker would have grown a second one that drifted. */
.c360-dlg-bulkbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

/* What the pair beside it decides - "Every allocated unit goes back…". DEV-486. */
.soa-bulk-caption {
    margin-left: 0.25rem;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

/* Filled blue, as the design has always called it (see the comment above) - DEV-489's AC on the
   traceable picker ("both as filled blue buttons") is what caught this being a pale tint instead,
   on every dialog sharing the class, not only the picker. DEV-912. */
.c360-dlg-bulk {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 2rem;
    padding: 0 0.75rem;
    border: 1px solid var(--cim360-primary-surface);
    border-radius: 0.375rem;
    background: var(--cim360-primary-surface);
    color: var(--cim360-on-primary);
    font: inherit;
    font-size: 0.7813rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease;
}

.c360-dlg-bulk:hover:not(:disabled) {
    background: var(--cim360-primary-surface-hover);
    border-color: var(--cim360-primary-surface-hover);
}

/* The second one is quieter: the pair is "fill them all in" and "rub them all out", and the
   destructive-ish half should not shout as loudly as the useful one. */
.c360-dlg-bulk.is-ghost {
    border-color: var(--cim360-border);
    background: transparent;
    color: var(--cim360-text-muted);
}

.c360-dlg-bulk.is-ghost:hover:not(:disabled) {
    border-color: var(--cim360-text-muted);
    background: color-mix(in srgb, var(--cim360-text-muted) 8%, transparent);
}

.c360-dlg-bulk:disabled {
    opacity: .5;
    cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
    .c360-dlg-bulk {
        transition: none;
    }
}

.c360-dlg-textarea {
    height: auto;
    min-height: 4.375rem;
    padding: 0.625rem 0.75rem;
    resize: vertical;
    line-height: 1.5;
}

/* Cim360Select is 28px with a 4px radius and .75rem text, which is right in a grid toolbar and
   wrong beside a 36px input - in Add Warehouse the two sat in the same row at different heights.
   Matched here rather than changed globally, because the toolbar uses are correct as they are.
   Scoped to .c360-dlg-field so it only applies where a select is acting as a form control. */
.c360-dlg-field .cim360-select-trigger {
    height: 2.25rem;
    padding: 0 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 400;
}

.c360-dlg-field .cim360-select-trigger:focus-visible {
    border-color: var(--cim360-primary);
    box-shadow: 0 0 0 0.1875rem color-mix(in srgb, var(--cim360-primary) 18%, transparent);
}

/* â”€â”€â”€ Footer banner â”€â”€â”€ */

/* Its own bottom radius, for the same reason as the header. */
.c360-dlg-foot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem;
    padding: 0.75rem 1.25rem;
    background: var(--cim360-headerband-bg);
    color: var(--cim360-headerband-fg);
    border-radius: 0 0 0.75rem 0.75rem;
}

/* The left-hand note. Where a dialog has nothing to say there, an empty span keeps the buttons
   right-aligned without a second layout rule.

   Full strength for the same reason as .c360-dlg-head-sub: 88% measured 4.14:1 on the band and
   failed AA, where the undiluted pair is 4.87:1. This one carries the sentence somebody reads
   before pressing the button beside it, so it is the worst place in the dialog to be faint. */
.c360-dlg-foot-note {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--cim360-headerband-fg);
    min-width: 0;
}

/* Wraps rather than overflowing. With flex 0 0 auto and no wrap, buttons wider than the card ran
   straight through the footer's right padding to the edge (Trial kit's Done prompt, 2026-10-02).
   A footer whose buttons fit lays out exactly as before; one that does not drops a button onto a
   second right-aligned row and keeps its margin. */
.c360-dlg-foot-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    flex: 0 1 auto;
    min-width: 0;
}

/* The footer's blocked reason and refusal are Cim360Message now - see the .c360-dlg-foot .c360-msg
   overrides above, which restate the palette against the blue gradient. The two private blocks that
   were here duplicated the message layout a third and fourth time. */

/* Labels never wrap. "Save changes" broke onto two lines the day Delete joined the footer. */
.c360-dlg-btn > span {
    white-space: nowrap;
}

/* The fill DARKENS the band rather than lightening it, which is the opposite of what it did until
   DEV-227, and the reason is contrast rather than taste.

   The button's label is white and cannot get lighter, so the only lever is what is behind it. A
   15% white tint on the brand blue composites to #3f8ac5 and the label measures 3.71:1 - a fail -
   and hover at 28% was worse still, 2.96:1, which axe never sees because it only ever measures the
   resting state. Tinting the other way keeps the label on a surface DARKER than the band it sits
   on: 5.96:1 here and 6.83:1 on hover, and hover now reads as more pressed rather than less. */
.c360-dlg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.125rem;
    padding: 0 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, .45);
    background: rgba(0, 0, 0, .12);
    color: #fff;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 140ms ease;
}

/* The cross on Cancel is NOT red. Red means one thing in this product - a record is being
   deleted - and Cancel closes a dialog without touching a record. It was red until 2026-09-16,
   uniformly across all eight dialogs, so this is a convention being changed rather than an
   inconsistency being fixed: the cross keeps its size and takes the button's own colour. */
.c360-dlg-btn .bi-x-lg {
    font-size: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
    .c360-dlg-btn { transition: none; }
}

.c360-dlg-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, .2);
}

.c360-dlg-btn:disabled {
    opacity: .45;
    cursor: default;
}

.c360-dlg-btn.is-primary {
    background: var(--cim360-card);
    border-color: var(--cim360-card);
    color: var(--cim360-primary);
}

.c360-dlg-btn.is-primary:hover:not(:disabled) {
    background: rgba(255, 255, 255, .88);
}

.c360-dlg-btn.is-primary:disabled {
    background: rgba(0, 0, 0, .188);
    border-color: rgba(255, 255, 255, .35);
    color: rgba(255, 255, 255, .75);
}

/* Destructive sits in the footer with everything else rather than being hoisted somewhere louder.
   On the brand gradient a red fill is unreadable, so it is an outline that reddens on hover. */
.c360-dlg-btn.is-danger {
    border-color: rgba(255, 255, 255, .55);
    background: transparent;
    color: #fff;
}

.c360-dlg-btn.is-danger:hover:not(:disabled) {
    background: var(--cim360-danger-surface-hover);
    border-color: #b91c1c;
}

/* â”€â”€â”€ Refusal â”€â”€â”€ */
/* Inline, above the body, dialog stays open. The reason has to sit next to the control that
   caused it - see the project's dialog-refusal convention. */


/* â”€â”€â”€ No DxPopup rules here, deliberately â”€â”€â”€ */
/* Every settings dialog is now a hand-rolled c360-dlg-card. There used to be a large block here
   fighting DevExpress chrome, and it is gone with the popups it targeted.

   Why the conversion happened, so nobody reintroduces one: a DxPopup paints its own background and
   radius on elements whose DOM is undocumented and whose class names are not what they look like
   (.dxbl-modal-content, not .dxbl-popup-content). app.css was separately painting one white at a
   14px radius, and wh-modals.css - since deleted, all 80 selectors unreachable - was full of the
   same dead spelling, which is how rules that never applied went on looking like they had. The
   result was a white edge at the rounded corners that survived four attempts to remove it, because
   each attempt was guessing at a structure that could not be inspected from here.

   The project owner made the call, and it is the right one: ONE mechanism for every settings card.
   A bug that is everywhere is fixable in one place; a bug in half of them is two problems. If a new
   settings dialog is needed, copy CompanyRoleSettingsModal — do not reach for DxPopup. */

/* The hand-rolled cards need the same treatment for the same reason: the card was painting white
   behind the banner, so its rounded corner showed through. The card is now a frame - each region
   paints itself. Both body classes are named because the Invite card kept its own body class. */
.c360-dlg-card {
    background: transparent;
}

.c360-dlg-body,
.cim-invite-body,
.cud-body {
    background: var(--cim360-card, var(--cim360-card));
}

@media (max-width: 760px) {
    .c360-dlg-overlay {
        padding: 0;
    }

    /* Every width variant, not just the two that existed when this was written - a new one added
       later silently kept its desktop width here, which is how this list rots. */
    .c360-dlg-card,
    .c360-dlg-card.is-narrow,
    .c360-dlg-card.is-medium,
    .c360-dlg-card.is-wide,
    .c360-dlg-card.is-xwide,
    .c360-dlg-card.is-picker,
    .c360-dlg-card.is-broad,
    .c360-dlg-card.is-xxwide,
    .c360-dlg-card.is-split,
    .c360-dlg-card.is-full {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    /* The footer stacks rather than letting the actions squeeze the note. Custom Fields had this
       for its own two buttons and nothing else did; it belongs to every dialog, and the buttons go
       full width so they are reachable with a thumb. */
    .c360-dlg-foot {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .c360-dlg-foot-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .c360-dlg-foot-actions .c360-dlg-btn {
        width: 100%;
        justify-content: center;
    }
}

/* â”€â”€â”€ Route guard â”€â”€â”€ */
/* Shown in place of a screen somebody cannot open. Deliberately calm: nothing has gone wrong and
   nobody has done anything suspicious - they followed a link to a door that is not theirs. */

/* The guard's "answer not known yet" state, held while the permission fetch is in flight on a
   fresh circuit - a new tab, a bookmark, a pasted link. It reserves the same block the refusal
   would occupy so the page does not jump when the answer lands, and says nothing: the fetch is
   normally over within a frame or two, and a flash of "Loading…" on every guarded page is a worse
   trade than a moment of nothing. */
.c360-noaccess-pending {
    min-height: 13.75rem;
}

.c360-noaccess {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 20rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--cim360-text-muted);
}

.c360-noaccess-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: var(--cim360-surface-2);
    border: 1px solid var(--cim360-border);
    color: var(--cim360-text-muted);
    font-size: 1.375rem;
}

.c360-noaccess-title {
    margin: 0.375rem 0 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--cim360-text);
}

.c360-noaccess-body {
    margin: 0;
    max-width: 28.75rem;
    font-size: 0.8125rem;
    line-height: 1.55;
}

.c360-noaccess-hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

/* â”€â”€â”€ Sortable column headers â”€â”€â”€ */
/* Cim360SortHeader. Global rather than scoped: the same header appears in the role members table
   and in the add-people picker, and a scoped copy in each is how two tables end up with two
   different carets. */
/* `font: inherit` is NOT enough, and this cost a regression worth naming: the shorthand covers
   family, size, weight, style, stretch and line-height - it does NOT carry text-transform or
   letter-spacing. Browsers' UA stylesheet then sets `text-transform: none` on form controls, and a
   UA rule on the element beats an inherited value from its parent. So a sort header inside an
   uppercase column header rendered in sentence case, and every table that gained sorting quietly
   lost its capitals.
   Inherited rather than hardcoded to uppercase, so a sort header works in a sentence-case table
   too - it takes whatever its container declares. */
.c360-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    cursor: pointer;
    text-align: left;
    min-width: 0;
}

/* The Users tab's two states, adopted here so every sortable grid in Settings reads the same. */
.c360-sort:hover {
    color: var(--cim360-primary);
}

.c360-sort:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
    border-radius: 0.1875rem;
}

/* Alignment modifiers, passed to Cim360SortHeader through its CssClass parameter.

   They live here rather than in a screen's own stylesheet because the button renders INSIDE the
   component: Blazor scoped CSS stops at a component boundary, so a `.c360-sort` rule written in a
   panel's .razor.css is rewritten to demand that panel's scope attribute and matches nothing at
   all - it looks applied and does nothing.

   Setting text-align on the th is not enough either. The button is the cell's only child and
   fills it, so the label moves only when the flex box itself is told where to put it. A money
   column needs both: `text-align: right` on the th for the figures, this for the heading above
   them. */
.c360-sort-end { justify-content: flex-end; width: 100%; }
.c360-sort-center { justify-content: center; width: 100%; }

.c360-sort-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hidden until the header is hovered, and 10px wide whatever the state so nothing shifts when a
   sort is applied or the pointer crosses a heading.

   This file used to argue the other way - "an arrow that only appears on hover tells somebody the
   column is sortable after they have already guessed that it is" - and that reasoning still holds.
   It was overruled on 2026-08-30 in favour of matching the Users tab, on the grounds that one
   convention applied everywhere beats a better convention applied to only some screens: a mixture
   is what forces every screen to be reviewed by hand. Flip these three values to restore it. */
.c360-sort-arrow {
    flex: 0 0 auto;
    font-size: 0.75rem;
    line-height: 1;
    width: 0.625rem;
    opacity: 0;
    transition: opacity 120ms ease;
}

.c360-sort:hover .c360-sort-arrow {
    opacity: .45;
}

.c360-sort.is-active {
    color: var(--cim360-primary);
}

.c360-sort.is-active .c360-sort-arrow {
    opacity: 1;
}

/* ============================================================================================
   THE GRID
   One definition of a Cim360 data grid: blue header bar, grey column header attached directly
   beneath it, banded 44px rows.

   Set by the project owner on 2026-08-28 after the add-people picker shipped with a grey header,
   a gap between the column header and the first row, and no banding. The standard existed - the
   Locations grid - but only as one component's private CSS, so there were FOUR re-implementations
   (wh-loc-grid, rmp-table, rpm-*, rap-list) and nothing to follow.

   The numbers are the Locations grid's, which is the reference: 44px bar, 36px column header,
   44px rows, 8px outer radius, --cim360-primary-zebra on even rows.

   Column widths stay with the grid that uses them - those are the one thing genuinely particular
   to each table. Everything else is here.
   ============================================================================================ */

.c360-grid {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* The blue bar: title, count, search, actions. Rounded at the top because it IS the top. */
.c360-grid-head {
    flex: 0 0 auto;
    height: 2.75rem;
    padding: 0 0.875rem 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: var(--cim360-headerband-bg);
    color: var(--cim360-headerband-fg);
    border-radius: 0.5rem 0.5rem 0 0;
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 0;
}

.c360-grid-head-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
    min-width: 0;
}

/* The count rides in the bar as a translucent pill rather than a second line. */
.c360-grid-head-count {
    padding: 2px 0.5rem;
    border-radius: 62.4375rem;
    /* A DARKER wash, not a lighter one. This pill sits on the blue header and its text is white:
       white on the bar alone is 4.87:1, and washing 18% white underneath lifted the ground to
       #468ec7 and dropped the text to 3.53:1. The pill was made visible by moving its background
       towards its own text colour. 18% black separates it from the bar just as clearly and takes
       the text to 6.62:1. WCAG 1.4.3. */
    background: var(--cim360-headerband-pill);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.c360-grid-head-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
}

/* Two declared variants, so a grid that genuinely differs says so rather than keeping a private
   copy of the whole definition. Same principle as the dialog widths.

   is-card: the grid IS the panel, rather than sitting inside one - so it carries the border and
   the rounded corner itself. Custom Fields and Users are both this.

   is-wrap: a bar with more in it than a title and a search box. Custom Fields carries a search, a
   status filter, a module select and a New button; Users the same shape. Those do not fit 44px on
   a narrow column, so the bar grows and wraps instead of clipping. Everything else about it - the
   blue, the type, the count pill - is unchanged, which is the point of it being a variant rather
   than a second bar. */
.c360-grid.is-card {
    border: 1px solid var(--cim360-border);
    border-radius: 0.625rem;
    overflow: hidden;
    background: var(--cim360-card);
}

.c360-grid-head.is-wrap {
    height: auto;
    min-height: 2.75rem;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: .75rem;
}

/* The card owns the rounding, so the bar inside it must not round its own corners as well - two
   radii on the same corner is what leaves a hairline of the parent showing through. */
.c360-grid.is-card > .c360-grid-head {
    border-radius: 0;
}
/* Likewise the body: the card already draws the outline, so the body must not draw a second one
   inside it. */
.c360-grid.is-card > .c360-grid-body {
    border: 0;
    border-radius: 0;
}

/* is-detached: the bar stands 0.375rem clear of a separately bordered box, as the Manufacturing
   designs draw every register (bom-resources.jsx MfgRegGrid and bom-card.css .bomc-cfreg: a 4px
   bar, marginTop 6, then a box with no top border and a 4px bottom radius). OPT-IN and used only
   in Manufacturing Settings - ResourceRegister, BomSettingsTable, the carbon fuels register, the
   BOM custom fields register (CustomFieldsListPartialView Detached) and the operation card's price
   breaks - so every other module's register keeps the joined card above. The other modules'
   designs draw the same detached bar; whether they adopt it is a separate decision, and this class
   is the one place it would be switched on.

   The card stops drawing the outline and the box takes it over: the body draws the sides, the
   footer the sides and the bottom (its own top border stays as the rule above the count), and a
   body with no footer after it closes the box itself. The gap is a margin on the bar rather than on
   the body, so a message in BeforeBody sits in the gap's place rather than being pushed down by it. */
.c360-grid.is-card.is-detached {
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}

.c360-grid.is-card.is-detached > .c360-grid-head {
    border-radius: 0.25rem;
    margin-bottom: 0.375rem;
}

.c360-grid.is-card.is-detached > .c360-grid-head.is-wrap {
    padding: 0.375rem 0.875rem 0.375rem 1.25rem;
}

.c360-grid.is-card.is-detached > .c360-grid-body {
    border: 1px solid var(--cim360-border);
    border-top: 0;
    border-bottom: 0;
    border-radius: 0;
    background: var(--cim360-card);
}

/* ShowFooter="false": nothing below the body draws the box's bottom edge, so the body does. */
.c360-grid.is-card.is-detached > .c360-grid-body:last-child {
    border-bottom: 1px solid var(--cim360-border);
    border-radius: 0 0 0.25rem 0.25rem;
}

.c360-grid.is-card.is-detached > .c360-grid-foot {
    border: 1px solid var(--cim360-border);
    border-radius: 0 0 0.25rem 0.25rem;
}

/* Attached to the bar above it - no margin, no radius, no top border. The gap between a column
   header and its rows is what made the picker read as two unrelated blocks. */
.c360-grid-cols {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    height: 2.25rem;
    padding-left: 0.875rem;
    background: var(--cim360-surface-2);
    border-left: 1px solid var(--cim360-border);
    border-right: 1px solid var(--cim360-border);
    border-bottom: 1px solid var(--cim360-border);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--cim360-text-muted);
}

.c360-grid-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    background: var(--cim360-card);
    border: 1px solid var(--cim360-border);
    border-top: 0;
    border-radius: 0 0 0.5rem 0.5rem;
}

.c360-grid-row {
    display: flex;
    align-items: center;
    min-height: 2.75rem;
    padding-left: 0.875rem;
    background: var(--cim360-card);
    border-bottom: 1px solid var(--cim360-border);
    font-size: 0.7813rem;
    color: var(--cim360-text);
}

/* Banded. nth-of-type rather than a flag on the row: the list re-filters as somebody types, and a
   computed index would have to be recomputed with it. */
.c360-grid-row:nth-of-type(even) {
    background: var(--cim360-primary-zebra);
}

.c360-grid-row:last-child {
    border-bottom: 0;
}

.c360-grid-row:hover {
    background: color-mix(in srgb, var(--cim360-primary) 5%, var(--cim360-card));
}

/* Empty and no-match states sit inside the body, so the grid keeps its borders and its height
   rather than collapsing to a bare sentence. */
.c360-grid-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 8.75rem;
    padding: 1rem;
    text-align: center;
    font-size: 0.7813rem;
    color: var(--cim360-text-muted);
}

/* ============================================================================================
   THE SETTINGS LIST GRID - Cim360SettingsGrid
   The controls that ride on the blue bar, the table they sit above, and the footer beneath it.
   One definition, consumed by the component; a settings panel declares only its column widths.

   Lifted from Custom Fields on 2026-09-03 (DEV-342), which was the reference the rules were
   written from. Custom Fields, Users, Locations and the two catalogue panels each carried a
   private copy under its own prefix (cf-, cu-, wh-loc-, sc-, pc-) and they had drifted - 150ms
   against 200ms debounce, a 7-button pager against a 5-button one, a count pill at two sizes.

   Controls on the blue bar are WHITE. The search and the status tray are white controls sitting
   on the blue, not translucent wells cut into it - this was got backwards once and it is the
   single most visible mistake available here.
   ============================================================================================ */

.c360-grid-title {
    white-space: nowrap;
}

/* Search: a white pill, 28px, with the icon in the flow rather than absolutely positioned. */
.c360-grid-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--cim360-headerband-control-bg);
    border: 1px solid var(--cim360-headerband-control-line);
    height: 1.75rem;
    padding: 0 0.75rem;
    border-radius: 62.4375rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
    flex: 1 1 20rem;
    min-width: 12.5rem;
}

/* The ring goes on the wrapper, not the input: the input is transparent and fills only part of the
   pill, so a ring on it would trace a rectangle inside a rounded shape. */
.c360-grid-search:focus-within {
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 0.1875rem rgba(255, 255, 255, .25);
}

.c360-grid-search-icon {
    flex: 0 0 auto;
    font-size: 0.75rem;
    line-height: 1;
    color: var(--cim360-text-muted);
    pointer-events: none;
}

.c360-grid-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    background: transparent;
    border: 0;
    outline: none;
    color: var(--cim360-text);
    font-size: 0.75rem;
    font-family: inherit;
}

.c360-grid-search-input::placeholder {
    color: var(--cim360-text-muted);
}

.c360-grid-search-clear {
    flex: 0 0 auto;
    width: 1.125rem;
    height: 1.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--cim360-text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    opacity: .7;
}

.c360-grid-search-clear:hover {
    opacity: 1;
    background: color-mix(in srgb, var(--cim360-headerband-control-fg) 12%, transparent);
}

.c360-grid-search-clear:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 1px;
    opacity: 1;
}

/* Status tray: a white tray, 8px radius, 3px padding; the chosen button goes primary with inverse
   text - not white-on-primary. */
.c360-grid-status {
    display: inline-flex;
    align-items: stretch;
    background: var(--cim360-headerband-control-bg);
    border: 1px solid var(--cim360-headerband-control-line);
    border-radius: 0.5rem;
    padding: 0.1875rem;
    gap: 2px;
    /* Scrolls sideways once it is wider than the bar, the way the list pages' status segments
       (.cim-segments) do. It was flex: 0 0 auto with no overflow, so at 700px and below the bar
       clipped it and "Not in directory" (and at 480 Disabled and Removed) could not be reached.
       The bar wraps first; this only takes over when the tray alone is wider than a line.
       DEV-TC-946. */
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
}

.c360-grid-status > .c360-grid-status-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.c360-grid-status-btn {
    background: transparent;
    border: 0;
    color: var(--cim360-text);
    font-family: inherit;
    font-size: 0.7813rem;
    font-weight: 500;
    padding: 0.3125rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    transition: background 160ms ease, color 160ms ease;
}

.c360-grid-status-btn:hover {
    background: color-mix(in srgb, var(--cim360-primary) 8%, var(--cim360-card));
}

.c360-grid-status-btn.active {
    background: var(--cim360-primary-surface);
    color: var(--cim360-text-inverse);
    font-weight: 600;
}

/* A state nobody is in stays visible but recedes. Still clickable: a zero is an answer, and a
   filter bar whose buttons come and go is harder to use than one that stays put.

   Receding is done with COLOUR, not opacity. At .6 the label measured 4.03:1 - and the sentence
   above is the reason that matters: these buttons stay clickable, so 1.4.3's exemption for an
   inactive component does not cover them. The muted token recedes just as clearly at 6.64:1, and
   unlike an opacity it cannot drift below the threshold when the background behind it changes.
   WCAG 1.4.3. */
.c360-grid-status-btn.is-empty {
    color: var(--cim360-text-muted);
}

/* NO OPACITY, and the rule immediately above is why - it was written for the label and this rule
   then broke the same way for the count.

   `opacity: .9` on white over the primary blue is not a 10% adjustment to a colour, it is a
   composite: measured in the browser on 2026-09-08, white on --cim360-primary is 4.87:1 and the
   same text painted at .9 is 4.27:1. That fails 1.4.3's 4.5:1 with 0.6 to spare, and axe reported
   it as a serious violation the first time the rendered run visited a page whose status tray has
   an ACTIVE facet carrying a count. Every page in the run before that had a tray with no active
   count, so nothing had ever painted this combination.

   Weight is what makes the count read as a count. It needed no opacity to do that. */
.c360-grid-status-count {
    font-weight: 700;
}

.c360-grid-status-btn.active .c360-grid-status-count {
    color: var(--cim360-text-inverse);
}

/* The 7px state dot, the same colours as the lifecycle chips so green and red mean the same thing
   on every screen. Decorative - the word beside it carries the meaning. */
.c360-state-dot {
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
}

.c360-state-dot.is-success { background: var(--cim360-success); }
.c360-state-dot.is-danger  { background: var(--cim360-danger); }
.c360-state-dot.is-warning { background: var(--cim360-warning); }
.c360-state-dot.is-info    { background: var(--cim360-info); }
.c360-state-dot.is-neutral { background: var(--cim360-text-muted); }

/* An extra filter on the bar - a module select, a role select. White, 34px, matching the New
   button beside it. */
.c360-grid-select {
    appearance: none;
    height: 2.125rem;
    padding: 0 2rem 0 0.75rem;
    border: 0;
    border-radius: 0.5rem;
    background-color: var(--cim360-card);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 4.5 L6 8 L9.5 4.5' stroke='%231d75bb' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    color: var(--cim360-text);
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    flex: 0 0 auto;
}

.c360-grid-select:focus {
    box-shadow: 0 0 0 0.1875rem rgba(255, 255, 255, .25);
}

/* The New button: white, primary text, 34px. Verb + Thing, Title Case. */
.c360-grid-new {
    background: var(--cim360-headerband-control-bg);
    /* Brand text on a brand-tinted control, so mixed towards the strong text - darker in light,
       lighter in dark. Bare --cim360-primary measured 3.96:1 on dark mode's control fill
       (2026-10-06); the skill's colour rule for brand text on a brand tint. */
    color: color-mix(in srgb, var(--cim360-primary) 72%, var(--cim360-text-strong));
    border: 0;
    border-radius: 0.5rem;
    height: 2.125rem;
    padding: 0 0.875rem;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex: 0 0 auto;
    transition: background 160ms ease;
}

.c360-grid-new:hover:not(:disabled) {
    background: color-mix(in srgb, var(--cim360-primary) 10%, var(--cim360-card));
}

/* Disabled has to LOOK disabled. There was no rule here, so a disabled New button kept its full
   colour, its hover wash and a pointer cursor, and was reported as a button that did nothing
   (DEV-554). The same .45 and not-allowed every other button family here uses. */
.c360-grid-new:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* The bar's SECOND action - Expand all, and anything else that acts on the list rather than adding
   to it. Outlined rather than filled, because a bar carrying two solid white pills reads as two
   primary actions and the eye cannot tell which one adds a record. */
.c360-grid-new.is-quiet {
    background: transparent;
    color: var(--cim360-headerband-fg);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cim360-text-inverse) 55%, transparent);
}

.c360-grid-new.is-quiet:hover:not(:disabled) {
    background: var(--cim360-headerband-quiet-hover);
}

.c360-grid-new .bi {
    font-size: 0.875rem;
    line-height: 1;
}

/* The primary column's link to the row editor (Cim360GridLink). A button reset to read as a link:
   it inherits the cell's font so a monospace code class on it still applies, and it only ever shows
   for a user who may edit - the component renders plain text otherwise. */
.c360-grid-link {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    text-transform: inherit;
    text-align: left;
    color: var(--cim360-primary);
    cursor: pointer;
    text-decoration: none;
}

.c360-grid-link:hover,
.c360-grid-link:focus-visible {
    text-decoration: underline;
}

.c360-grid-link:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
    border-radius: 0.1875rem;
}

/* The table. A flat settings grid is a <table>, not divs. The header row is the 11px uppercase
   band; rows are 14px/16px cells. Column widths belong to the consumer. */
/* â”€â”€â”€ THE grid table. `.c360-ct` is the same table under another name â”€â”€â”€
   A settings grid, an in-card grid and a document card's tab all render the same object, so they
   share this declaration. `.c360-ct` is the sales document card's own name for it and is listed
   here rather than redefining the geometry in cim360-card.css, which is what it used to do: a
   solid-blue header with white uppercase text, 12.5px rows, a blue zebra and 9px padding, against
   this one's near-white band, muted caption, 13px rows, no banding and 14/16 padding. Two tables
   that were never meant to be different objects. Project owner, 2026-09-11 - "the grids just
   don't look the same as the inventory settings".

   The HEADER is the exception and lives in css/lists/cim360-list.css: the card's tables are
   registers, so they wear the brand bar the list views wear, not this file's quiet band. What
   they share with a settings grid is the geometry below - width, row padding, borders, the
   empty cell and the numeric columns. Project owner, 2026-09-11. */
/* ROW GEOMETRY IS THREE TOKENS, and they hold the LIST VIEW'S numbers.
   (`css/lists/cim360-list.css`, `.grid-viewport.density-*`.)

   This table was 14px top and bottom against a list view's 7px at the same density, and its header
   45px against the list's 40px. Measured 2026-09-23: a sales order's lines were 49 / 57 / 56px in
   one table, Settings > Item categories 57px, Settings > Units of measure **67px**, against 49px
   everywhere on a list. The variance inside one table is the part that reads as wrong - a row
   holding a chip is 28px of chip against 21px of text, and with the height coming from padding
   plus content, one line of a document is visibly taller than the line above it for a reason
   nobody can see.

   So `--c360-row-h` sets a MINIMUM the cell's content sits inside, instead of adding to. A chip
   row and a text row are then the same height, which is what a register is.

   Tokens rather than values in each rule because there are four densities across three files -
   compact, cosy, relaxed and the dialog's own tighter table - and each was a separate override
   that had to out-specify this one. Now each sets one number.

   The four are declared on `:root` in css/themes/site.css, not here: the price-break panel draws
   the same register out of spans rather than a table, so it cannot inherit anything scoped to one.
   A variant re-declares them on its own element and wins for its subtree without a specificity
   fight - which is what the overrides below used to be. */
.c360-grid-table,
.c360-ct {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    color: var(--cim360-text);
}

.c360-grid-table thead th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--cim360-text-muted);

    /* 40px, which is a list view's header, and no vertical padding: the height IS the rule, so a
       header holding a sort button does not come out taller than one holding a word. */
    height: var(--c360-head-h);
    padding: 0 var(--c360-row-pad-x);

    background: color-mix(in srgb, var(--cim360-primary) 4%, var(--cim360-card));
    border-bottom: 1px solid var(--cim360-border);
}

.c360-grid-table tbody td,
.c360-ct tbody td,
.c360-grid-table tbody th[scope="row"],
.c360-ct tbody th[scope="row"] {
    /* `height` on a table cell is a MINIMUM, not a cap - a cell whose content genuinely needs more
       still gets it, which is what keeps a wrapped description readable. A row's header cell (the
       accessible way to name a row) takes the same metrics; without them it sat flush to the edge and
       a pixel taller than its row, which put a scrollbar on a one-row grid. */
    height: var(--c360-row-h);
    padding: var(--c360-row-pad-y) var(--c360-row-pad-x);

    border-bottom: 1px solid color-mix(in srgb, var(--cim360-border) 60%, transparent);
    vertical-align: middle;
}

.c360-grid-table tbody tr:last-child td,
.c360-ct tbody tr:last-child td,
.c360-grid-table tbody tr:last-child th[scope="row"],
.c360-ct tbody tr:last-child th[scope="row"] {
    border-bottom: 0;
}

.c360-grid-table tbody tr.inactive td,
.c360-ct tbody tr.inactive td {
    color: color-mix(in srgb, var(--cim360-text-muted) 80%, transparent);
}

.c360-grid-table tbody tr:hover,
.c360-ct tbody tr:hover {
    background: color-mix(in srgb, var(--cim360-primary) 3%, transparent);
}

/* A row that opens on double-click says so with the cursor. */
.c360-grid-table tbody tr.is-actionable,
.c360-ct tbody tr.is-actionable {
    cursor: pointer;
}

/* Right-aligned, tabular figures. `.n` is the card table's spelling of `.is-num`; both are here
   so a column reads the same whichever table it is in. */
.c360-grid-table thead th.n,
.c360-grid-table tbody td.n,
.c360-grid-table tfoot td.n,
.c360-ct thead th.n,
.c360-ct tbody td.n,
.c360-ct tfoot td.n {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* The empty / loading / failed cell. Inside the table, so the grid keeps its columns. */
.c360-grid-table .c360-grid-table-empty,
.c360-ct .c360-grid-table-empty {
    text-align: center;
    color: var(--cim360-text-muted);
    padding: 2rem 1rem;
}

/* The footer: the visible count on a 3% primary tint with a top border, the pager on the right. */
/* 7px, matching the row padding above. It was 12px, so a strip carrying one line of 12.5px muted
   text - "Showing 3 of 3" - came to 44px, very nearly a whole extra line of the table it is
   counting. */
.c360-grid-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4375rem 1rem;
    background: color-mix(in srgb, var(--cim360-primary) 3%, var(--cim360-card));
    border-top: 1px solid var(--cim360-border);
}

.c360-grid-foot-count {
    font-size: 0.7813rem;
    color: var(--cim360-text-muted);
}

/* The detached register's footer (is-detached, Manufacturing Settings only): 10px by 16px, the
   design's register footer (bom-resources.jsx MfgRegGrid, padding '10px 16px') - 7px pressed the
   count against the rule above it. The top border is the one line between the last row and the
   count - the design draws it as the last row's bottom border, which this table removes (tbody
   tr:last-child), so the footer carries it instead. */
.c360-grid.is-detached > .c360-grid-foot {
    padding: 0.625rem 1rem;
}

/* Never shrinks and never wraps there: a long FootNote beside it squeezed "Showing 3 of 3" to two
   lines (G8). The note is the part that gives way and wraps. */
.c360-grid.is-detached .c360-grid-foot-count {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Cim360SettingsGrid's FootNote: the same muted type as the count. Beside the count it takes the
   rest of the strip and sits right, as the design's register footers do; alone it reads from the
   left. Only rendered when a caller passes a note. */
.c360-grid-foot-note {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.7813rem;
    line-height: 1.35;
    color: var(--cim360-text-muted);
}

.c360-grid-foot-note.is-after-count {
    margin-left: 1rem;
    text-align: right;
}

.c360-grid-pager {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.c360-grid-pager-btn {
    min-width: 1.875rem;
    height: 1.875rem;
    padding: 0 0.5rem;
    border: 1px solid var(--cim360-border);
    background: var(--cim360-card);
    color: var(--cim360-text);
    border-radius: 0.375rem;
    font-size: 0.7813rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.c360-grid-pager-btn:hover {
    background: color-mix(in srgb, var(--cim360-primary) 8%, var(--cim360-card));
    border-color: color-mix(in srgb, var(--cim360-primary) 25%, var(--cim360-card));
    color: color-mix(in srgb, var(--cim360-primary) 72%, var(--cim360-text-strong));
}

.c360-grid-pager-btn.active {
    background: var(--cim360-primary-surface);
    color: var(--cim360-text-inverse);
    border-color: var(--cim360-primary);
}

.c360-grid-pager-btn:disabled {
    opacity: .5;
    cursor: default;
}

@media (max-width: 900px) {
    .c360-grid-toolbar {
        gap: .5rem;
    }

    .c360-grid-search {
        flex: 1 1 100%;
        order: 5;
    }
}

/* ============================================================================================
   THE IN-CARD GRID - Cim360InCardGrid

   The settings grid inside a record card. Everything above still applies - this section adds only
   what an in-card list needs and a settings list never did: a sticky totals row, a body that
   scrolls one long list instead of paging, and the column picker's menu.

   Deliberately NOT a second set of grid classes. Cim360InCardGrid wraps Cim360SettingsGrid rather
   than forking it, so the bar, the search pill, the tray, the table and the pager are the ones
   defined above. Five private copies of that chrome had drifted before DEV-342 replaced them; a
   sixth differing only in its defaults would be harder to spot, not easier.
   ============================================================================================ */

/* The tab pane already draws the outline, so the grid inside it must not draw a second one - the
   same reasoning as .c360-grid.is-card, in the other direction. The head keeps its own top radius
   because here it IS the top of something. */
.c360-grid-incard > .c360-grid-head {
    border-radius: 0.5rem 0.5rem 0 0;
}

/* The bar is denser in a card than on a settings page: a tab pane is narrower than a settings
   column and the title is the tab's own name, which the rail already shows. */
.c360-grid-incard > .c360-grid-head.is-wrap {
    padding: 0.5rem 0.75rem;
}

/* The column picker's trigger. A white control on the blue, matching the search pill and the status
   tray - not a translucent well cut into the bar. */
.c360-grid-cols-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    background: var(--cim360-headerband-control-bg);
    color: var(--cim360-headerband-control-fg);
    border: 1px solid var(--cim360-headerband-control-line);
    border-radius: 62.4375rem;
    box-shadow: 0 1px 2px rgb(15 23 42 / 12%);
    cursor: pointer;
    font-size: 0.8125rem;
}

.c360-grid-cols-btn:hover {
    background: color-mix(in srgb, var(--cim360-primary) 8%, var(--cim360-card));
}

.c360-grid-cols-btn:focus-visible {
    outline: 2px solid var(--cim360-card);
    outline-offset: 2px;
}

/* The button and its menu share one positioned box, so the menu hangs off the button. */
.c360-grid-cols-wrap {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
}

/* Anchored to the button rather than to the pointer, and absolute rather than fixed.

   A fixed menu cannot work inside a record card: .cim-window carries a transform from its pop-in
   animation, which makes IT the containing block for fixed descendants, so a viewport clamp measures
   against the card and the card's overflow: hidden then clips whatever hangs past its edge. The
   picker opened half off the right-hand side of the card however the clamp was computed.

   Right-aligned to the button because the button sits at the right-hand end of the blue bar; opening
   leftwards is the only direction with room. */
.c360-grid-cols-menu {
    position: absolute;
    top: calc(100% + 0.375rem);
    right: 0;
    left: auto;
    min-width: 13.75rem;
    max-height: 50vh;
    overflow-y: auto;
    padding-bottom: 0.25rem;
    z-index: 30;
}

.c360-grid-cols-menu-head {
    padding: 0.5rem 0.75rem 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--cim360-caption);
}

.c360-grid-cols-menu-sep {
    margin: 0.25rem 0;
    border-top: 1px solid var(--cim360-border);
}

/* A column that cannot be turned off is shown greyed rather than left out, so the menu is the whole
   set of columns and not a subset somebody has to reconcile against the table. */
.c360-grid-cols-item:disabled {
    opacity: .55;
    cursor: default;
}

/* The totals row. Sticky to the bottom of the body so it stays put while the rows scroll under it,
   which is the whole reason it is a <tfoot> in the caller's table rather than a strip below the
   grid: only cells in the same table line up with the columns above them. */
.c360-grid-table tfoot.c360-grid-totals td {
    position: sticky;
    bottom: 0;
    z-index: 1;
    padding: 0.75rem 1rem;
    background: color-mix(in srgb, var(--cim360-primary) 6%, var(--cim360-card));
    border-top: 1px solid var(--cim360-border);
    font-weight: 700;
    font-size: 0.7813rem;
    color: var(--cim360-text);
}

/* The totals row's own heading cell, which names what is being totalled rather than sitting blank.
   It matches .c360-grid-table thead th exactly, capitals included: it is the table's own band at
   the other end, not a caption on a control, so the caption rule does not reach it. Renamed off
   "-label" because that name was the only thing making it look like one. */
.c360-grid-table tfoot.c360-grid-totals .c360-grid-totals-head {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: .06em;
    color: var(--cim360-text-muted);
}

/* A numeric column: right-aligned in the heading, the body AND the totals row.

   The heading needs saying explicitly. `.c360-grid-table thead th` sets text-align: left and
   outranks a single column class - a tab's own `.xx-col-qty { text-align: right }` is (0,1,0)
   against (0,2,1) - so every numeric column had a right-aligned column of figures under a
   left-aligned heading, with the heading floating away from the numbers it names.

   Right-aligning the cell is enough to move the sort header with it: `.c360-sort` is an
   inline-flex button, so the cell's text-align positions the button as a whole. */
.c360-grid-table thead th.is-num,
.c360-grid-table tbody td.is-num,
.c360-grid-table tfoot td.is-num {
    text-align: right;
}

/* A grid that is NOT filling must still not be squashed.

   On a tab that stacks several blocks the grid is a flex child, and a flex child shrinks below its
   content by default - so the sections above it squeezed the packaging grid down to its header with
   no rows visible at all. It holds its natural height now and the TAB scrolls, which is the rule:
   several blocks means the panel scrolls; a single grid docks and fills. */
.c360-grid.c360-grid-incard:not(.is-fill) {
    flex: 0 0 auto;
}

/* â”€â”€ Docking to the tab â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   A grid that is the only thing on a tab fills it, rather than growing with its rows.

   Grown-to-fit, an item with three barcodes sat in a short box at the top of a tall pane with the
   card's own background below it - and the footer, carrying the count and the pager, floated up
   under the last row instead of along the bottom edge where every other footer in the product is.
   The design prototype docks it: rows, then empty body, then the totals and the footer on the
   bottom edge.

   The tab's own host element has to be a flex column with min-height: 0 for this to have anything
   to fill - every converted tab's .razor.css sets that. */
.c360-grid.c360-grid-incard.is-fill {
    flex: 1 1 auto;
    min-height: 0;
}

/* min-height: 0 on the body as well, or a flex child refuses to shrink below its content and the
   grid pushes its own footer off the bottom of the pane instead of scrolling. */
.c360-grid.c360-grid-incard.is-fill > .c360-grid-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* A virtualised body scrolls one list rather than paging, so it needs a bounded height for
   <Virtualize> to have anything to measure against. */
.c360-grid-body-virtual {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* The 220px floor is only for a grid that is NOT filling its tab.
   It used to apply to every virtualised body, which made the Stock tab the odd one out: is-fill
   already gives the body a bounded height, so the floor did nothing but stop it shrinking to the
   pane - and flicking between tabs, Stock sat differently from every other grid for no reason the
   reader could see. A non-filling virtualised grid still needs it, or a short list collapses the
   card to the height of its own header. */
.c360-grid-incard:not(.is-fill) .c360-grid-body-virtual {
    min-height: 13.75rem;
}

/* The column headers have to stay put while the rows scroll under them - a virtualised list is long
   by definition, and a header that scrolls away leaves unlabelled columns. */
.c360-grid-body-virtual .c360-grid-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

/* ============================================================================
   THE NUMBER BOXES

   Three controls share this block and none of them owns it: Cim360NumberWithUnit
   (a measurement and the unit it is in), Cim360PriceBox (an amount and its
   currency) and Cim360QuantityBox (a bare quantity). They are deliberately three
   separate components - a price is not a special case of a measurement, and
   nesting them made a change to one ripple into the others - but they must look
   identical, so the chrome lives here, once, rather than in three scoped
   stylesheets that would drift the way the four private "number and unit"
   drawings before them did.

   Here rather than in a .razor.css for a second reason: a component's scoped CSS
   does not reach a CHILD component's markup, so styling DxSpinEdit from one needs
   ::deep and silently matches nothing without it. Global rules have no such trap.

   36px / 6px radius / 13px is the settled control size across this product - the
   same numbers .c360-dlg-input uses above - so any of the three drops into a
   dialog grid beside a text field and the two line up.
   ============================================================================ */

.c360-numbox {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 2.25rem;
    background: var(--cim360-card);
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    box-sizing: border-box;
    overflow: hidden;
}

.c360-numbox:focus-within {
    border-color: var(--cim360-primary);
    box-shadow: 0 0 0 0.1875rem color-mix(in srgb, var(--cim360-primary) 18%, transparent);
}

.c360-numbox.is-disabled {
    background: var(--cim360-info-bg);
    border-color: var(--cim360-border-cool);
}

/* Refused, and it must read as refused at a glance - the same treatment .c360-dlg-input
   carries, on the box the three number controls share. */
.c360-numbox.is-bad {
    border-color: var(--cim360-danger);
    box-shadow: 0 0 0 0.1875rem color-mix(in srgb, var(--cim360-danger) 12%, transparent);
}

/* The editor inside is made transparent so the wrapper's single outline reads as
   one control. Driven through DevExpress's own --dxbl-edit-* custom properties
   rather than by overriding its internal rules: the variables are the supported
   surface and the class names underneath them move between versions.
   cim360-form-grid.css already drives the same two. */
.c360-numbox .c360-numbox-editor,
.c360-numbox .dxbl-spin-edit {
    --dxbl-edit-border-color: transparent;
    --dxbl-edit-border-color-hover: transparent;
    --dxbl-edit-border-color-focus: transparent;
    --dxbl-edit-background-color: transparent;
    --dxbl-edit-box-shadow-focus: none;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.c360-numbox .c360-numbox-input {
    height: 100%;
    padding: 0 0.625rem;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--cim360-text);
    background: transparent;
    border: 0;
    outline: none;
    /* Tabular figures so a column of these does not jitter on every digit width. */
    font-variant-numeric: tabular-nums;
}

/* EVERY figure in the product is typed and read on the right, as figures sit in every table column - a
   price, a quantity, a rate, a number of days. One rule for the four ways a number is entered:
   - the shared number boxes (Cim360QuantityBox, Cim360PriceBox, Cim360NumberWithUnit);
   - a DevExpress spin edit used directly, whose input is a .dxbl-text-edit-input inside <dxbl-spinedit>.
     The body prefix outranks DevExpress's own rule on the same input, as the token overrides here do;
   - a native number input;
   - a text input showing a figure, marked is-num (an exchange rate, a total, a landed cost). */
.c360-numbox .c360-numbox-input,
body dxbl-spinedit .dxbl-text-edit-input,
input[type="number"],
.c360-dlg-input.is-num {
    text-align: right;
}

/* The docked half. Its left border is the only line inside the box, so the two
   parts read as one control divided rather than two controls touching, and the
   tinted ground is what makes it look docked INTO the field rather than laid
   over it. Whatever sits there - a unit chooser, a unit, a currency - is the
   same shape, which is the whole point of sharing this.

   No max-width: the segment is as wide as what it holds. A 6rem cap clipped a closed
   select reading "Percentage" to "Percentag" (DEV-565) - a native select sizes itself to
   its widest option plus the chevron, and the cap cut that short - and would clip a
   static unit too, since a line's unit of measure runs to 16 characters and the affix
   never wraps. The number beside it is the part that gives (min-width: 0 on the editor). */
.c360-numbox-affix,
.c360-numbox-select {
    flex: 0 0 auto;
    min-width: 3.5rem;
    height: 100%;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--cim360-text);
    background: color-mix(in srgb, var(--cim360-primary) 5%, var(--cim360-card));
    border: 0;
    border-left: 1px solid var(--cim360-border);
    box-sizing: border-box;
    text-align: center;
}

.c360-numbox-select {
    cursor: pointer;
    outline: none;
    /* text-align-last, not text-align: a select's closed value ignores
       text-align in Chromium. */
    text-align-last: center;
}

.c360-numbox-select:focus-visible {
    background: color-mix(in srgb, var(--cim360-primary) 12%, var(--cim360-card));
}

.c360-numbox-select:disabled {
    color: var(--cim360-muted-soft);
    cursor: not-allowed;
}

/* A static affix carries no chevron and takes no focus, so it needs the vertical
   centring a select does for itself. Muted, because a unit or currency nobody can
   change is context rather than a value. */
.c360-numbox-affix {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cim360-text-muted);
    white-space: nowrap;
}

/* A currency code is an identifier, so it reads as one - the same treatment the
   unit-of-measure symbol column gets in its grid. */
.c360-numbox-affix.is-currency {
    font-weight: 600;
    letter-spacing: .01em;
}

.c360-numbox.is-disabled .c360-numbox-affix,
.c360-numbox.is-disabled .c360-numbox-select {
    background: var(--cim360-info-bg);
    border-left-color: var(--cim360-border-cool);
    color: var(--cim360-muted-soft);
}


/* ─── A grid whose rows are edited in place ───
   Price breaks in the stock card's supplier link window: every cell holds its control, and the last
   cell removes the row. The remove button is an icon, so it carries an aria-label naming the row;
   its size is floored at 24px because the whole UI scales down to 80% and 2.5.8 is measured in CSS
   pixels on the screen. */
.c360-ct-rowx {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max(1.625rem, 24px);
    height: max(1.625rem, 24px);
    padding: 0;
    border: 0;
    border-radius: 0.3125rem;
    background: transparent;
    color: var(--cim360-text-muted);
    font-size: 0.75rem;
    cursor: pointer;
}

.c360-ct-rowx:hover {
    background: var(--cim360-danger-bg);
    color: var(--cim360-danger-fg);
}

.c360-ct-rowx:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
}

/* The column the remove button sits in: wide enough for the button and its focus ring. */
.c360-ct .c360-ct-col-x {
    width: 2.75rem;
    text-align: right;
}

/* A control in a cell fills the cell rather than its own default width, so a column's width is the
   one thing that decides how wide its editors are. */
.c360-ct td > .c360-dlg-input,
.c360-ct td > .c360-numbox {
    width: 100%;
    min-width: 0;
}


/* ============================================================================================
   TREE ROWS IN AN IN-CARD GRID - Cim360TreeToggle and .is-child

   Where a grid's rows own a small, bounded set of child rows - a customer's price breaks, a tax
   mapping's components - the children belong under their parent rather than in a second grid.

   A second grid made the relationship something the reader had to infer from a sentence in the
   header ("Price breaks for Acme Ltd"), and made it unreadable for more than one parent at a time:
   to compare two customers' breaks you selected one, read it, selected the other, and remembered.
   It also cost a whole grid's chrome - title, count, pager, empty state - for a list that is
   usually three rows.

   The caller still owns its table. This is the chevron, the indent and the tint; the caller renders
   its own child <tr> and decides what a child row contains.
   ============================================================================================ */

/* The chevron cell. Narrow and fixed, so the first real column starts in the same place on every
   row whether or not that row has children.

   Left-aligned with the padding taken off, not centred: the cell inherits the table's own cell
   padding, and at 34px wide with ~12px either side the chevron sat marooned in the middle of a gap
   wider than the glyph. The button itself is 22px, so 26px of cell with 4px of lead-in puts it
   where the eye expects the first column to start. */
.c360-grid-tree-col {
    width: 1.625rem;
    min-width: 1.625rem;
    max-width: 1.625rem;
    padding-left: 0.25rem !important;
    padding-right: 0 !important;
    text-align: left;
}

.c360-grid-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.375rem;
    height: 1.375rem;
    padding: 0;
    border: 0;
    border-radius: 0.25rem;
    background: transparent;
    color: var(--cim360-text-muted);
    cursor: pointer;
    transition: background .12s, color .12s;
}

.c360-grid-tree-toggle:hover {
    background: color-mix(in srgb, var(--cim360-primary) 10%, transparent);
    color: var(--cim360-primary);
}

.c360-grid-tree-toggle:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 1px;
}

/* Rotated rather than swapped for a second glyph, so the chevron animates between the two states
   and there is only one icon to keep in step. */
.c360-grid-tree-toggle i {
    font-size: 0.75rem;
    line-height: 1;
    transition: transform .14s ease;
}

.c360-grid-tree-toggle.is-open i {
    transform: rotate(90deg);
}

/* A row that can never have children keeps the cell, so nothing shifts left. Not display:none -
   an empty cell holds the column width; a removed button would let the cell collapse. */
.c360-grid-tree-spacer {
    display: inline-block;
    width: 1.375rem;
    height: 1.375rem;
}

/* A tree more than one level deep: the toggle and the node's name in the first column, indented by
   how deep the node sits. The caller sets --c360-tree-depth on the span (0 at the top), so every
   level lines its chevron up under its parent's name, whatever the tree. */
.c360-grid-tree-node {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding-inline-start: calc(var(--c360-tree-depth, 0) * 1.375rem);
    white-space: nowrap;
}

.c360-grid-tree-node > i {
    flex: none;
    color: var(--cim360-text-muted);
}

/* ---- The child rows -------------------------------------------------------------------------
   Tinted and inset, because a child row is read as belonging to the row above it and the eye needs
   something other than indentation to hold the group together at a glance. */
.c360-grid-table tr.is-child > td {
    background: color-mix(in srgb, var(--cim360-primary) 4%, var(--cim360-card));
    border-top: 0;
    font-size: 0.75rem;
}

/* The last child of a group closes the block. Without it two adjacent groups run together and the
   tint alone does not say where one parent's children stop. */
.c360-grid-table tr.is-child-last > td {
    box-shadow: inset 0 -1px 0 var(--cim360-border);
}

/* The child block's own heading row - the column names for the children, which differ from the
   parent's. Rendered once per expanded parent. */
.c360-grid-table tr.is-child-head > td {
    background: color-mix(in srgb, var(--cim360-primary) 7%, var(--cim360-card));
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--cim360-text-muted);
}

/* Docked under the table's own sticky header, the same way the header itself docks - top is the
   header's own height, pulled up by the same inset, so the two sit flush with no gap and no
   overlap. Scoped to `.c360-ct`, the one table shape where the header above is ALWAYS sticky
   (css/cards/cim360-card.css); `.c360-grid-table` alone does not promise that, and docking a
   second row under a header that never left the top would have nothing to dock under.
   A parent with few children never scrolls far enough for this to be seen - it is the long
   child block (DEV-TC-2569's 40-line schedule) that showed the plain row scrolling away while
   the OUTER header it had no business standing in for stayed put. */
.c360-ct tr.is-child-head > td {
    position: sticky;
    top: calc(var(--c360-head-h) - var(--c360-sticky-inset, 0px));
    z-index: 1;
}

/* ---- A tree's top-level row, docked ---------------------------------------------------------
   For a tree grid whose top-level rows each head a long block - a warehouse over its areas,
   locations and bins. Tinted, opaque, and docked where a child block's heading docks: it stays in
   view while the rows under it scroll, and because every top-level row docks at the same place, the
   next one slides up over it and takes its place. */
.c360-grid-table tr.is-group > td {
    background: color-mix(in srgb, var(--cim360-primary) 7%, var(--cim360-card));
    border-top: 1px solid var(--cim360-border);
    font-weight: 700;
}

.c360-ct tr.is-group > td {
    position: sticky;
    top: calc(var(--c360-head-h) - var(--c360-sticky-inset, 0px));
    z-index: 1;
}

/* A figure read for what it means: stock free to use (green), demand outstanding (red), stock held
   back (amber). The -fg tokens, which hold 4.5:1 on the card and on a docked row's tint, not the
   base colours. */
.c360-grid-table .c360-fig-pos {
    color: var(--cim360-success-fg);
}

.c360-grid-table .c360-fig-neg {
    color: var(--cim360-danger-fg);
}

.c360-grid-table .c360-fig-amber {
    color: var(--cim360-warning-fg);
}

/* ---- Due dates: late in red, due today in amber ---------------------------------------------
   A row that is late, or due today, carries a bar down its first cell in that colour, and its date
   says so with a dot as well as a colour, so the state is never colour alone. A selected row keeps
   the selection's own bar, which is the one thing that must not be mistaken. */
.c360-ct tbody tr.is-overdue:not(.is-sel) td:first-child {
    box-shadow: inset 0.1875rem 0 0 var(--cim360-danger);
}

.c360-ct tbody tr.is-due-today:not(.is-sel) td:first-child {
    box-shadow: inset 0.1875rem 0 0 var(--cim360-warning);
}

.c360-due {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.c360-due > i {
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}

.c360-due.is-overdue { color: var(--cim360-danger-fg); font-weight: 700; }
.c360-due.is-overdue > i { background: var(--cim360-danger); }
.c360-due.is-today { color: var(--cim360-warning-fg); font-weight: 700; }
.c360-due.is-today > i { background: var(--cim360-warning); }

/* The key in a grid's title bar - what the colours mean, and how many rows are late. The dot is
   ringed in white so it holds its shape on the blue bar. */
.c360-grid-key {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.c360-grid-key > i {
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--cim360-card) 85%, transparent);
}

.c360-grid-key.is-overdue > i { background: var(--cim360-danger); }
.c360-grid-key.is-today > i { background: var(--cim360-warning); }

/* The indent, applied to the child block's first cell rather than to the row, so a child row's
   own columns still line up with the parent's where they should. */
.c360-grid-table tr.is-child > td:first-child,
.c360-grid-table tr.is-child-head > td:first-child {
    padding-left: 1.625rem;
}

/* A child block that is loading, empty or failed gets the same three states every other list in
   the product gets - never a bare "none" while the fetch is still running. */
.c360-grid-child-state {
    padding: 0.375rem 0;
}


/* ============================================================================================
   DRAGGABLE COLUMNS - Cim360InCardTable

   A heading a reader can move needs to say so before they try it, and to show where the column
   will land while they are dragging. Both are the header's job; the cells follow because the
   component emits them in the same order.
   ============================================================================================ */

.c360-grid-table thead th.is-draggable {
    cursor: grab;
}

.c360-grid-table thead th.is-draggable:active {
    cursor: grabbing;
}

/* The column being dragged, dimmed so the drop marker is the thing the eye follows. */
.c360-grid-table thead th.is-dragging {
    opacity: .45;
}

/* Where it will land. A left edge rather than a filled background: the marker is a POSITION, and a
   highlighted column reads as "this column is selected" instead. */
.c360-grid-table thead th.is-drop-target {
    box-shadow: inset 2px 0 0 0 var(--cim360-primary);
}

/* An anchored column takes the ordinary cursor. Nothing marks it out beyond that - a lock icon on
   the identifying column of every grid is noise about a rule nobody was going to break. */
.c360-grid-table thead th.is-anchored-col {
    cursor: default;
}


/* The blue bar's right-hand group: the column picker and the caller's own actions, held together.

   .c360-grid-head is justify-content: space-between and renders its children directly, so every
   extra control it gains becomes another thing to spread apart. One New button read as "pushed
   right" by accident; adding the picker beside it put the picker in the middle of the bar. This
   wrapper makes the pair a single child again, so space-between has the two groups it means. */
.c360-grid-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
    margin-left: auto;
}

/* -----------------------------------------------------------------------------
   THE BUSY OVERLAY - Cim360BusyOverlay.

   Covers whatever is saving so it cannot be typed into while it saves. A write on
   this stack is not instantaneous - converting a document was measured at eight
   seconds - and the form underneath stayed live for all of it, taking edits that
   never reached the request. Reported 2026-09-12.

   ABSOLUTE, not fixed: it blocks the dialog or the card that is saving and leaves
   the rest of the product alone. The host has to be positioned; every dialog card
   and window body here already is.
   -------------------------------------------------------------------------- */

.c360-busy {
    position: absolute;
    inset: 0;
    z-index: 40;

    display: flex;
    align-items: center;
    justify-content: center;

    /* Legible over both a white dialog and a card's grey, and light enough that
       the form stays readable underneath - somebody waiting wants to see what
       they are waiting for. */
    background: rgba(255, 255, 255, .66);

    /* The point of the whole component. Nothing underneath takes a click, a
       keystroke or a focus ring while this is up. */
    cursor: progress;
}

/* Focus rests on the panel while it shows (set from script) so it is not lost to the page behind. */
.c360-busy-panel:focus { outline: none; }

.c360-busy-panel {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;

    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    background: var(--cim360-surface, var(--cim360-card));
    border: 1px solid var(--cim360-border);
    box-shadow: 0 0.375rem 1.25rem rgba(15, 23, 42, .12);
}

/* The same spinner as the document entry screens, not a second one. */
.c360-busy-spinner {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid var(--cim360-border);
    border-top-color: var(--cim360-primary);
    border-radius: 50%;
    animation: c360-de-spin .7s linear infinite;
}

.c360-busy-text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cim360-text);
}

@media (prefers-reduced-motion: reduce) {
    .c360-busy-spinner {
        animation: none;
        opacity: .6;
    }
}

/* â”€â”€â”€ Dialog sections: Cim360DialogSection â”€â”€â”€
   A titled block inside a dialog - a caption band, an optional figure on the right, and a body.
   The prototype draws every multi-part dialog this way, and this is here rather than in a
   .razor.css for the reason this file exists at all: a scoped sheet cannot reach the body content
   a caller passes in through a RenderFragment, so the block would draw its frame and leave
   everything inside it unstyled. */
/* overflow: hidden makes a section the sticky container of any table inside it, and it has no top
   padding, so it hands its tables no inset - see .c360-ct thead th in css/cards/cim360-card.css. */
.c360-dlg-sect {
    --c360-sticky-inset: 0px;
    border: 1px solid var(--cim360-border);
    border-radius: 0.625rem;
    background: var(--cim360-card, var(--cim360-card));
    overflow: hidden;
}

.c360-dlg-sect + .c360-dlg-sect {
    margin-top: 0.75rem;
}

/* ...except directly inside a dialog body, which is a flex column that already gaps them by 16px.
   The two ADD, so every pair of sections was separated by 28px and a four-section dialog spent
   36px of its height on spacing nobody chose. The margin stays for the bodies that are not flex
   containers - several dialogs stack their sections in a plain div. */
.c360-dlg-body > .c360-dlg-sect + .c360-dlg-sect {
    margin-top: 0;
}

/* space-between so the meta sits hard right whether or not there is one - a band with no meta must
   not centre its caption. */

/* THE BRAND BAND, not a grey strip. It was --cim360-surface-2, which is #f8fafc in light - so a
   section read as a faint divider between two white areas, and a pale band carrying a small
   caption reads as an accordion header somebody forgot to make clickable. These never collapse;
   nothing here opens, and the band should say so by looking like the dialog's own chrome.

   --cim360-headerband-bg/-fg rather than --cim360-primary, and that distinction is the whole
   point. In dark mode --cim360-primary is a LIGHT blue (#4DA3E8) meant as an accent ON a dark
   surface - white text on it measures 2.72:1. The headerband pair is mode-aware and resolves to a
   dark navy in dark mode, which is why .c360-dlg-head has always used it. Measured on the rendered
   element in all four modes: 4.87 light, 19.21 dark, 8.96 light+HC, 21.00 dark+HC. */
.c360-dlg-sect-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.875rem;
    background: var(--cim360-headerband-bg);
    border-bottom: 1px solid var(--cim360-headerband-line);
}

/* Scoped to the band. .c360-dlg-section-label is also used on its own elsewhere, where the caption
   grey is still right - only the one sitting on the blue has to change. */
.c360-dlg-sect-head .c360-dlg-section-label {
    color: var(--cim360-headerband-fg);
}

/* The figure on the right - "1 invoice", "3 of 8 selected", "2 required". It was the brand colour,
   which on a brand-coloured band is invisible: primary on primary measures exactly 1:1.

   Full-strength headerband-fg, and the hierarchy against the caption comes from WEIGHT and SIZE
   rather than from fading it. Receding a value with opacity is how small text lands under the
   threshold, and this one is the number somebody is reading. */
.c360-dlg-sect-meta {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cim360-headerband-fg);
    white-space: nowrap;
}

.c360-dlg-sect-body {
    padding: 0.75rem 0.875rem;
}

/* THE SECTION OWNS THE RHYTHM BETWEEN ITS PARTS, and the caller cannot.
   A section body stacks separate questions - a row of option cards, then a row of fields, then the
   ticks - and the space between two questions has to beat the 16px the field grid puts BETWEEN
   fields, or the grouping inverts and the reader sees one block where there are two.

   It lives HERE rather than as a margin the dialog puts on each part, because the dialog cannot
   reach the first part. `CssClass="soi-basis"` passed to Cim360RadioCards lands on markup that
   component authors, so it never carries the caller's scope attribute and the scoped rule compiled
   to `.soi-basis[b-x5xgb173jm]` matched nothing at all - the gap was zero, and it looked like a
   value that was simply too small. Reported twice by the project owner, 2026-09-13.

   The sibling dialogs already knew: .soa-card, .soa-body and .soa-density are all passed into
   shared components and all defined in this file, never in a .razor.css. */
.c360-dlg-sect-body > * + * {
    margin-top: 1.5rem;
}

/* A flush body holds one table and nothing to space. Stated rather than left to the fact that a
   single child has no sibling, so a second element added later does not inherit a gap the table
   was never meant to have. */
.c360-dlg-sect-body.is-flush > * + * {
    margin-top: 0;
}

/* A section whose body IS a table gives up its padding - the table draws its own header band edge
   to edge, and 14px of card showing round it reads as a mistake. */
.c360-dlg-sect-body.is-flush {
    padding: 0;
}

/* â”€â”€â”€ Radio cards: Cim360RadioCards â”€â”€â”€
   For the choice whose option NAMES are not the whole answer - "Despatched quantities" against
   "Full order value". Where the names do say it, a plain radio list is the right control. */
.c360-radiocards {
    display: grid;
    gap: 0.625rem;
}

.c360-radiocards.is-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.c360-radiocards.is-stacked {
    grid-template-columns: minmax(0, 1fr);
}

/* One column on a phone whatever the group asked for: two cards each carrying a sentence do not
   fit side by side at 400px, and the sentence is the reason the cards exist. */
@media (max-width: 640px) {
    .c360-radiocards.is-two {
        grid-template-columns: minmax(0, 1fr);
    }
}

.c360-radiocard {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.5rem;
    background: var(--cim360-card, var(--cim360-card));
    cursor: pointer;
    transition: var(--cim360-tile-transition);
}

.c360-radiocard:hover {
    border-color: var(--cim360-border-strong);
}

/* THREE signals, and the radio's own dot is the one that would be sufficient on its own. The border
   and the tint are there so the choice is readable across the dialog at a glance; neither carries
   the state by itself. WCAG 1.4.1. */
.c360-radiocard.is-on {
    border-color: var(--cim360-primary);
    background: var(--cim360-primary-soft);
}

/* The focus ring goes on the CARD, from the input inside it. The input is 16px in the corner of a
   full-width card, so a ring on the input alone is almost invisible against the border beside it -
   and this control is operated by arrow keys, where knowing which card has focus is the whole
   navigation. WCAG 2.4.7. */
.c360-radiocard:focus-within {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
}

.c360-radiocard input[type="radio"] {
    margin: 2px 0 0;
    accent-color: var(--cim360-primary);
    flex: 0 0 auto;
}

.c360-radiocard-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.c360-radiocard-text strong {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--cim360-text);
}

/* The sentence that makes the choice decidable. Not italic despite the <em>: it is a whole line of
   explanation rather than an emphasis inside a sentence, and italic at 12px is the first thing to
   become unreadable. */
.c360-radiocard-text em {
    font-size: 0.75rem;
    font-style: normal;
    color: var(--cim360-text-muted);
    line-height: 1.4;
}

.c360-radiocard.is-disabled {
    cursor: not-allowed;
    opacity: .6;
}

@media (prefers-reduced-motion: reduce) {
    .c360-radiocard { transition: none; }
}

/* â”€â”€â”€ The invoicing dialog's "Will be raised" table â”€â”€â”€
   One row per invoice that would be raised. It borrows .c360-grid-table and .soa-table so it is the
   same table as the allocate and despatch dialogs' - what is here is only the column widths, which
   that shared sheet deliberately leaves to the consumer.

   These live here rather than in SalesOrderInvoiceDialog.razor.css for the reason the note above
   .soa-table gives: in a scoped sheet the scope attribute adds specificity invisibly, so a rule
   that looks like a tie wins, and moving it later silently loses. */
.soi-table {
    table-layout: auto;
}

/* The section body gives up its padding for this table, so the header band reaches both edges. */
.c360-dlg-sect-body > .soi-table {
    border-radius: 0;
}

.soi-col-cust {
    min-width: 11.25rem;
}

/* Wraps rather than truncates. A consolidated invoice covers several orders and every one of them
   has to be readable - a cell showing three of four would be the most misleading cell on the
   screen. */
.soi-col-against {
    width: 1%;
    min-width: 10rem;
    white-space: normal;
}

/* Wider than .soa-col-n and heavier in the body, because gross is the figure the reader came to
   check and the two beside it are its working. */
.soi-col-gross {
    width: 8.125rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Why a card cannot be chosen. It reads under the description rather than replacing it, because
   both are still true - what the option means, and why it is not available. The warning colour is
   the token, not a second amber: a reason that looks like an error would read as something having
   gone wrong rather than as a setting being off.

   Measured on --cim360-card and --cim360-surface-2, the two grounds a dialog card sits on. */
.c360-radiocard-text em.is-blocked {
    color: var(--cim360-warning-fg);
    font-weight: 600;
}

/* A disabled card keeps its full text contrast. The .is-disabled opacity above fades the whole
   card, and the sentence explaining WHY it is disabled is the one thing on it that has to stay
   readable - fading the reason along with the option is how a control ends up saying nothing.
   WCAG 1.4.3. */
.c360-radiocard.is-disabled {
    opacity: 1;
    background: var(--cim360-surface-2);
    border-color: var(--cim360-border-soft);
}

.c360-radiocard.is-disabled .c360-radiocard-text strong {
    color: var(--cim360-text-muted);
}

/* "Coming soon" on a card for something not here yet - the side menu's Coming soon pill (.c360-nav-soon), so
   the product has one look for it. .c360-pill owns the shape; this states only the colours, and the border comes
   free as a tint of the text. fit-content because the card's text column would otherwise stretch it. */
.c360-radiocard-soon {
    width: fit-content;
    background: color-mix(in srgb, var(--cim360-text-muted) 12%, transparent);
    color: var(--cim360-text-muted);
}

/* ManualActivation renders each card as a <button role="radio"> rather than a label round a native
   radio - see Cim360RadioCards. A button brings its own font, alignment and width, none of which a
   card wants, so they are put back to the label's. */
.c360-radiocards.is-manual .c360-radiocard {
    width: 100%;
    font: inherit;
    color: var(--cim360-text);
    text-align: left;
}

/* A button takes :focus on a click as well as from the keyboard, so the ring is keyboard-only
   here; the label form keeps :focus-within because its input never shows a ring of its own. */
.c360-radiocards.is-manual .c360-radiocard:focus-within {
    outline: none;
}

.c360-radiocards.is-manual .c360-radiocard:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
}

/* A locked card in a manual group is aria-disabled, never disabled, so it stays reachable by Tab.
   The :disabled branch never matches today and is kept so a scan reading class and attribute alike
   sees this button's disabled look. R-094. */
.c360-radiocards.is-manual .c360-radiocard:disabled,
.c360-radiocards.is-manual .c360-radiocard[aria-disabled="true"] {
    cursor: not-allowed;
}

/* Tiles: a logo above a centred name, in a grid that fills the width. auto-fill rather than a
   count, so the same group is one column on a phone and a row on a monitor. */
.c360-radiocards.is-tiles {
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 0.75rem;
}

.c360-radiocards.is-tiles .c360-radiocard {
    position: relative;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    text-align: center;
}

.c360-radiocards.is-tiles .c360-radiocard-text {
    align-items: center;
}

/* Sits in the tile's top-right corner, so it reads as a badge on the choice rather than a line of
   text. aria-hidden in the markup; aria-checked already carries the state. */
.c360-radiocard-check {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    color: var(--cim360-primary);
    font-size: 0.875rem;
}

/* A plate for a third party's logo. --cim360-logo-plate is white in BOTH themes, deliberately:
   Xero, QuickBooks and Sage Intacct ship marks drawn for a light ground - QuickBooks' near-black
   wordmark would all but vanish on the dark card - and they are the vendors' marks, not this
   product's palette, so they are never recoloured or filtered. object-fit: contain honours the
   plate's width too, which is why the wide QuickBooks lockup sits smaller than Xero's rather than
   cropped. Used by Cim360RadioCards and by any screen that shows the chosen mark on its own. */
.c360-logo-plate {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--cim360-logo-plate);
    border: 1px solid var(--cim360-logo-plate-border);
    border-radius: 0.375rem;
}

.c360-logo-plate img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* The glyph for an option with no logo of its own, standing where a logo would. */
.c360-logo-plate i {
    color: var(--cim360-caption);
}

.c360-radiocard-logo {
    width: 100%;
    height: 3.5rem;
    padding: 0.75rem;
}

.c360-radiocard-logo i {
    font-size: 1.5rem;
}

/* Cim360RadioCards with a TrailingTile: the radiogroup is an inner element that takes no box of its
   own, so its cards and the action tile after it are the same grid's items. The element keeps its
   radiogroup role - display: contents only removes the box. DEV-731. */
.c360-radiocards-group {
    display: contents;
}

/* The action tile: the same footprint as a provider tile, but a dashed border and a plus in the
   plate say it adds something rather than choosing something. The border is dashed as well as
   coloured, so the difference does not rest on colour alone. */
.c360-radiocards .c360-radiocard.is-action {
    width: 100%;
    font: inherit;
    color: var(--cim360-text);
    border-style: dashed;
    background: transparent;
}

.c360-radiocards .c360-radiocard.is-action:hover {
    border-color: var(--cim360-primary);
    background: var(--cim360-card);
}

.c360-radiocards .c360-radiocard.is-action:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
}

.c360-radiocards .c360-radiocard.is-action .c360-radiocard-logo i {
    color: var(--cim360-primary);
}

/* â•â•â• THE DELIVERY PLANNING BOARD â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   GLOBAL, and that is the point. This was SalesOrderPlanBoardDialog.razor.css - a SCOPED sheet,
   so the purchase side's board could not reach a line of it and would have had to copy all 520.
   The classes were sopb-* and are c360-pb-* for the same reason: a name that says which screen
   owns it is a name the second screen cannot use.

   THIS COMMENT WAS NOT CLOSED when the block was first appended, on 2026-09-14. A CSS comment runs
   until the next closing token wherever that is, so it swallowed the card, the body and the split -
   the three rules that make the board a rail beside a detail pane - and the parser then resumed in
   the middle of a rule. The screen rendered as one column with no layout at all, and nothing
   failed: no build error, no console message, and every other rule in this 3,000-line sheet still
   worked.

   Writing the closing token inside a comment ends it early, which is the same mistake wearing the
   other hat - so this says "closing token" in words. R-074 fails both shapes now. */

/* The board is a WORK SURFACE, not a form, and it is sized like one: a 300px rail, and everything
   left over for a table that carries an item, a description, three figures and a two-part move
   control. 96vw keeps a margin at every width, and min() means a laptop still gets a dialog rather
   than a full-bleed panel.

   THE SELECTOR IS COMPOUND, and that is not decoration. The board's card also wears `is-wide`, and
   `.c360-dlg-card.is-wide` is 760px at two classes of specificity. A bare `.c360-pb-card` is one
   class, so it lost every time and the board rendered at 760px however large the number here said -
   which is why raising it from 1180 to 1640 changed nothing on screen.

   It did NOT lose while these rules lived in the board's own scoped sheet: a scoped rule carries
   the component's attribute, so `.sopb-card[b-hash]` is also two and later in the cascade. Moving a
   scoped rule into a global sheet silently drops a level of specificity, and anything it used to
   beat starts beating it. */
.c360-dlg-card.c360-pb-card {
    width: min(102.5rem, 96vw);
}

.c360-pb-body {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    min-height: 0;
}

.c360-pb-split {
    display: flex;
    gap: 0.875rem;
    min-height: 0;

    /* Tall enough to be worth the split, short enough that the footer stays on screen. The card's
       own max-height keeps the whole thing inside the viewport, so this is how much of that the
       working area takes rather than an absolute height. */
    height: 68vh;
}

/* ---------- the rail ---------- */

.c360-pb-rail {
    flex: 0 0 18.75rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid var(--cim360-border);
    border-radius: 0.5rem;
    background: var(--cim360-surface);
    overflow: hidden;
}

.c360-pb-rail-head {
    flex: 0 0 auto;
    padding: 0.625rem;
    border-bottom: 1px solid var(--cim360-border);
    background: var(--cim360-card);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.c360-pb-rail-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.8125rem;
}

.c360-pb-rail-new {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 0.3125rem 0.5625rem;
    border-radius: 0.375rem;
    border: 1px solid var(--cim360-primary);
    background: var(--cim360-primary-surface);
    color: #fff;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.c360-pb-rail-new:disabled {
    background: var(--cim360-surface);
    border-color: var(--cim360-border);
    color: var(--cim360-text-muted);
    cursor: not-allowed;
}

.c360-pb-rail-new:focus-visible,
.c360-pb-btn:focus-visible,
.c360-pb-item:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
}

.c360-pb-rail-search {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0 0.5rem;
    height: 1.875rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: var(--cim360-card);
}

.c360-pb-rail-search .bi {
    color: var(--cim360-text-muted);
    font-size: 0.75rem;
}

.c360-pb-rail-search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.7813rem;
    color: var(--cim360-text);
}

/* The ring goes on the WRAPPER, not the input. The input is borderless inside a bordered box, so an
   outline on it would draw a rectangle floating inside another one; :focus-within puts the indicator
   on the thing that actually looks like the control. Without this the input dropped its outline and
   put nothing back - focusing the search box showed nothing at all. 2.4.7. */
.c360-pb-rail-search:focus-within {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 1px;
    border-color: var(--cim360-primary);
}

.c360-pb-rail-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.c360-pb-item {
    display: flex;
    align-items: center;
    gap: 0.5625rem;
    padding: 0.5625rem 0.625rem;
    border-bottom: 1px solid var(--cim360-border-soft);
    background: var(--cim360-card);
    cursor: pointer;
    transition: background .12s, box-shadow .12s;
}

.c360-pb-item:hover {
    background: rgba(29, 117, 187, .05);
}

.c360-pb-item.is-selected {
    background: rgba(29, 117, 187, .10);
    box-shadow: inset 0.1875rem 0 0 0 var(--cim360-primary);
}

/* The unplanned pile reads as a holding area rather than a consignment - it has no date, no carrier
   and no number, and colouring it like one would invite it being treated as a delivery. */
.c360-pb-item.is-unplanned {
    background: repeating-linear-gradient(
        45deg,
        rgba(148, 163, 184, .06) 0,
        rgba(148, 163, 184, .06) 0.5rem,
        rgba(148, 163, 184, .11) 0.5rem,
        rgba(148, 163, 184, .11) 1rem);
}

.c360-pb-item.is-unplanned.is-selected {
    box-shadow: inset 0.1875rem 0 0 0 var(--cim360-text-muted);
}

.c360-pb-item-logo {
    flex: 0 0 auto;
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 0.375rem;
    object-fit: contain;
    background: var(--cim360-card);
    border: 1px solid var(--cim360-border);
}

.c360-pb-item-logo.is-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cim360-text-muted);
    font-size: 0.875rem;
}

.c360-pb-item-main {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.c360-pb-item-date {
    font-size: 0.7813rem;
    font-weight: 800;
    color: var(--cim360-text);
}

.c360-pb-item-carrier {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.c360-pb-item-sub {
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.c360-pb-rail-note {
    padding: 0.875rem 0.75rem;
    font-size: 0.75rem;
    font-style: italic;
    color: var(--cim360-text-muted);
}

/* ---------- the detail ---------- */

.c360-pb-detail {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--cim360-border);
    border-radius: 0.5rem;
    background: var(--cim360-card);
    overflow: hidden;
}

.c360-pb-detail-head {
    flex: 0 0 auto;
    padding: 0.75rem;
    border-bottom: 1px solid var(--cim360-border);
    background: var(--cim360-surface);
    container-type: inline-size;
}

.c360-pb-detail-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--cim360-text);
}

.c360-pb-detail-note {
    margin: 0;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

/* Three columns: the consignment's dates (or, on the purchase board, its dates and warehouse) on the
   first line, carrier, service and booking reference on the second. A wrapping row put all six on
   one line at their minimum width. Fields line up by their tops, so every caption and every box
   share a line - lining up bottoms put a field with a hint under it a hint's height above the
   rest. One column once the detail is too narrow for three. */
.c360-pb-detail-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: start;
}

@container (max-width: 36rem) {
    .c360-pb-detail-fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* "Delivering to" and its map, side by side under the consignment's fields - DEV-495. Two equal
   columns, stacking once the detail is too narrow to read an address beside a map. */
.c360-pb-where {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
    align-items: start;
}

.c360-pb-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

/* Instructions are a sentence rather than a value, so the box takes a line of its own. */
.c360-pb-field-wide {
    grid-column: 1 / -1;
}

/* A caption in a field, sentence case in the caption token like every other label in the product -
   see the R-049 rule set. The board's own private copy of this was removed on 2026-09-11 and
   nothing replaced it, so these labels had been taking whatever they inherited. */
.c360-pb-field > label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cim360-caption);
    letter-spacing: .01em;
}

/* Wraps inside the field's width rather than setting it, or a sentence stretches its date box to
   the sentence's length. */
.c360-pb-field-hint {
    width: 0;
    min-width: 100%;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

/* A warning under a field - a past planned ship date just entered (DEV-500). Words and an icon,
   so it is never the colour alone; it warns and does not block. */
.c360-pb-field-hint.is-warn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--cim360-warning-fg);
}

/* The consignment's buttons, on a line of their own under its fields. */
.c360-pb-field-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 0.375rem;
}

.c360-pb-input,
.c360-pb-q,
.c360-pb-move {
    height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: var(--cim360-card);
    color: var(--cim360-text);
    font-family: inherit;
    font-size: 0.7813rem;
}

.c360-pb-q {
    width: 5.75rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.c360-pb-move {
    width: 100%;
    max-width: 13.125rem;
}

.c360-pb-input:focus,
.c360-pb-q:focus,
.c360-pb-move:focus {
    outline: none;
    border-color: var(--cim360-primary);
    box-shadow: 0 0 0 0.1875rem rgba(29, 117, 187, .16);
}

/* Muted ground rather than opacity: below about .7 the figures stop clearing 4.5:1, and a disabled
   board still has to be readable while a save is in flight. */
.c360-pb-input:disabled,
.c360-pb-q:disabled,
.c360-pb-move:disabled {
    background: var(--cim360-surface);
    color: var(--cim360-text-muted);
    cursor: not-allowed;
}

.c360-pb-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    height: 2rem;
    padding: 0 0.625rem;
    border-radius: 0.375rem;
    border: 1px solid var(--cim360-border);
    background: var(--cim360-card);
    color: var(--cim360-text);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.c360-pb-btn:hover:not(:disabled) {
    border-color: var(--cim360-primary);
    color: var(--cim360-primary);
}

.c360-pb-btn.is-danger:hover:not(:disabled) {
    border-color: var(--cim360-danger);
    color: var(--cim360-danger);
}

.c360-pb-btn:disabled {
    background: var(--cim360-surface);
    color: var(--cim360-text-muted);
    cursor: not-allowed;
}

.c360-pb-lines {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

/* table-layout: fixed, so the fixed widths below are honoured and the item column takes the rest.
   On auto the browser sizes columns from their CONTENT, so one long description stretched the item
   column and squeezed the move control into two lines - which is the shape of "unusable" that the
   extra width alone would not have fixed. */
.c360-pb-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.7813rem;
}

.c360-pb-table th,
.c360-pb-table td {
    padding: 0.4375rem 0.625rem;
    border-bottom: 1px solid var(--cim360-border-soft);
    text-align: left;
    vertical-align: middle;
    background: var(--cim360-card);
}

.c360-pb-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--cim360-surface);
    border-bottom: 1px solid var(--cim360-border);
    font-weight: 700;
}

.c360-pb-table tbody tr[draggable="true"] {
    cursor: grab;
}

.c360-pb-table tbody tr[draggable="true"]:active {
    cursor: grabbing;
}

.c360-pb-grip {
    margin-right: 0.3125rem;
    color: var(--cim360-text-muted);
}

/* The description takes whatever the row has left rather than a fixed 320px. On a wide board that
   was a truncated line with empty space beside it; the quantity and move columns are fixed widths,
   so "the rest" is exactly what this cell is. It still truncates - a description can be a
   paragraph - but only once there is genuinely no more room. */
.c360-pb-desc {
    display: block;
    font-weight: 500;
    color: var(--cim360-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.c360-pb-c-n {
    width: 7.375rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* The status a delivery line is at. A fixed width because the table is fixed-layout now: a column
   with no width would split the remainder with the item column and take half the table for one
   word. */
.c360-pb-c-status {
    width: 9.375rem;
}

.c360-pb-c-move {
    width: 15.625rem;
}

/* How much, then where. Side by side because they are one gesture: a figure typed with no
   destination does nothing, and a destination with no figure moves everything. */
/* Allocated stock a line cannot send because it is held in quarantine (DEV-488). */
.soa-held {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--cim360-danger);
}

/* A return line's batch or serial entry, under the description it belongs to. */
.soa-trace-entry {
    display: block;
    width: 100%;
    max-width: 26rem;
    margin-top: 0.3125rem;
    height: 1.875rem;
    padding: 0 0.5rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: var(--cim360-card);
    color: var(--cim360-text);
    font: inherit;
    font-size: 0.8125rem;
}

.soa-trace-entry[aria-invalid="true"] {
    border-color: var(--cim360-danger);
}

.c360-pb-movegroup {
    display: flex;
    align-items: center;
    gap: 0.3125rem;
}

/* The quantity box stays small and the delivery picker takes the rest. Unpinned, the box grew and
   the picker shrank to its first letter ("M") - which delivery a line moves to was unreadable. */
.c360-pb-movegroup .c360-pb-mq {
    flex: 0 0 4.625rem;
    width: 4.625rem;
    min-width: 0;
}

.c360-pb-movegroup .c360-pb-move {
    flex: 1 1 auto;
    min-width: 8.5rem;
}

.c360-pb-mq {
    flex: 0 0 4.625rem;
    height: 2rem;
    padding: 0 0.4375rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: var(--cim360-card);
    color: var(--cim360-text);
    font-family: inherit;
    font-size: 0.7813rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.c360-pb-mq:focus {
    outline: none;
    border-color: var(--cim360-primary);
    box-shadow: 0 0 0 0.1875rem rgba(29, 117, 187, .16);
}

.c360-pb-mq:disabled {
    background: var(--cim360-surface);
    color: var(--cim360-text-muted);
    cursor: not-allowed;
}

/* The placeholder carries a real instruction - "All" - so it has to stay readable rather than
   fading to the browser's default grey, which does not clear 4.5:1 at this size. */
.c360-pb-mq::placeholder {
    color: var(--cim360-text-muted);
    opacity: 1;
}

/* What has shipped on this line. Said in words as well as by the floor on the input, because a
   number box that refuses to go lower and says nothing reads as broken. */
.c360-pb-locked {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;

    /* Muted enough to recede, dark enough to clear 4.5:1 at 11px on the card. */
    color: var(--cim360-text-muted);
}

/* Status chips, toned by meaning rather than by colour name so a status can be re-toned in one
   place. Each carries its own text, so the tone is never the only thing saying it. */
.c360-pb-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 0.5rem;
    border-radius: 62.4375rem;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.c360-pb-status.is-done { background: var(--cim360-success-bg); color: var(--cim360-success-fg); }
.c360-pb-status.is-partial { background: var(--cim360-warning-bg); color: var(--cim360-warning-fg); }
.c360-pb-status.is-open { background: var(--cim360-info-bg); color: var(--cim360-info-fg); }
/* Picked - in hand, waiting to go - in the violet it wears on the order card and on Picking & Deliveries. DEV-502. */
.c360-pb-status.is-staged { background: var(--cim360-violet-bg); color: var(--cim360-violet-fg); }
.c360-pb-status.is-void { background: color-mix(in srgb, var(--cim360-text-muted) 22%, transparent); color: var(--cim360-text-muted); }
.c360-pb-status.is-idle { background: color-mix(in srgb, var(--cim360-text-muted) 16%, transparent); color: var(--cim360-text-muted); }

/* Over-planned rows use the shared c360-row-short / c360-row-short-note treatment (DEV-485), with
   the warning under the table as well. */

.c360-pb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    color: var(--cim360-text-muted);
    font-size: 0.7813rem;
    font-style: italic;
}

.c360-pb-empty .bi {
    font-size: 1.5rem;
}

/* One column below the width where a rail and a table stop fitting side by side. */
@media (max-width: 860px) {
    .c360-pb-split {
        flex-direction: column;
        height: auto;
    }

    .c360-pb-rail {
        flex: 0 0 auto;
        max-height: 30vh;
    }
}

/* -----------------------------------------------------------------------------
   A SHORT window - the dialog chrome
   -----------------------------------------------------------------------------
   The same problem cim360-card.css describes, on the other shell. Dialogs start in
   better shape than the cards did: .c360-dlg-card already caps at max-height: 100%
   and .c360-dlg-body already scrolls, so a dialog has never collapsed to nothing.
   What it does instead is spend height it has not got on chrome -

     overlay padding 48px (24 top and 24 bottom, before the card even starts)
     + head 32 + foot 24, plus each band's own content

   - which on a 400px window is over a third of the screen given to borders. Every
   dialog and popup in the product wears this chrome, so this reaches all of Sales
   and Purchasing's dialogs at once rather than one at a time.

   Padding only, at the same three tiers as the cards, so a dialog and the card
   behind it compress together rather than at different moments.

   The body takes overflow: auto rather than overflow-y at these tiers. A form or a
   table that is too wide for a short window wants a scrollbar; clipping a column is
   the same failure as clipping a row, and WCAG 1.4.10 allows two-dimensional
   scrolling for content that needs a two-dimensional layout. */
@media (max-height: 900px) {
    .c360-dlg-overlay {
        padding: 0.75rem;
    }

    .c360-dlg-head {
        padding: 0.625rem 1.25rem;
    }

    .c360-dlg-body {
        --c360-sticky-inset: 0.875rem;
        padding: var(--c360-sticky-inset) 1.25rem;
        overflow: auto;
    }

    .c360-dlg-foot {
        padding: 0.5rem 1.25rem;
    }
}

@media (max-height: 740px) {
    .c360-dlg-overlay {
        padding: 0.5rem;
    }

    .c360-dlg-head {
        padding: 0.4375rem 1.125rem;
    }

    .c360-dlg-body {
        --c360-sticky-inset: 0.625rem;
        padding: var(--c360-sticky-inset) 1.125rem;
    }

    .c360-dlg-foot {
        padding: 0.375rem 1.125rem;
    }
}

@media (max-height: 620px) {
    .c360-dlg-overlay {
        padding: 0.25rem;
    }

    .c360-dlg-head {
        padding: 0.3125rem 1rem;
    }

    .c360-dlg-body {
        --c360-sticky-inset: 0.5rem;
        padding: var(--c360-sticky-inset) 1rem;
    }

    .c360-dlg-foot {
        padding: 0.25rem 1rem;
    }
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   Import column map (ImportColumnMap)

   Here rather than in Cim360ImportDialog.razor.css because ImportColumnMap is a CHILD COMPONENT:
   a scoped rule compiles to .imp-maprow[b-hash] and the markup a child emits never carries the
   parent's scope attribute. This is the same trap the file picker hit on DEV-227.
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.imp-map-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Four tracks: the file's header, the arrow, what it became, and a value from the first row. The
   sample is the track that earns the width - two plausible-sounding headers are told apart in one
   glance by what sits under them, and a mapping one column out shows a bin name under Counted
   Quantity. */
.imp-maprow {
    display: grid;
    grid-template-columns:  1.125rem minmax(0, 1fr) 1.25rem minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.3125rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 0.7813rem;
}

.imp-maprow:nth-child(odd) {
    background: var(--cim360-surface-muted);
}

.imp-maprow-from {
    font-weight: 600;
    color: var(--cim360-text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.imp-maprow-arrow {
    color: var(--cim360-text-muted);
    text-align: center;
}

.imp-maprow-to {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    min-width: 0;
    flex-wrap: wrap;
}

.imp-maprow-col {
    color: var(--cim360-text-strong);
}

/* An unused column is stated, never faded out. Somebody scanning this list for the column they
   expected to see has to be able to read the row that says it was ignored - which is precisely the
   row a low opacity would hide. */
.imp-maprow.is-unused .imp-maprow-from {
    font-weight: 400;
    color: var(--cim360-text-muted);
}

.imp-maprow-unused {
    color: var(--cim360-text-muted);
    font-style: italic;
}

.imp-maprow-guess,
.imp-maprow-chosen {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* The guess is the one thing on this list somebody has to check, so it is the one thing that is
   coloured. A close match is not an error - it is usually right - so it is advisory, not danger. */
.imp-maprow-guess {
    color: var(--cim360-warning-fg);
}

.imp-maprow-chosen {
    color: var(--cim360-text-muted);
}

/* Monospace, because these are being compared down a column rather than read as prose, and a
   proportional font makes two similar codes look alike. */
.imp-maprow-sample {
    min-width: 0;
    font-variant-numeric: tabular-nums;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.imp-maprow-blank {
    font-style: italic;
}

.imp-map-missing {
    margin-top: 0.625rem;
    padding-top: 0.625rem;
    border-top: 1px solid var(--cim360-border);
}

.imp-map-missing-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

/* Two rows under a phone's width: header and arrow above, destination and sample below. Four
   tracks in 360px gives every one of them about 80px, which fits nothing. */
@media (max-width: 640px) {
    .imp-maprow {
        grid-template-columns:  1.125rem minmax(0, 1fr) 1.25rem;
        row-gap: 2px;
    }

    .imp-maprow-to,
    .imp-maprow-sample {
        grid-column:  2 / -1;
        padding-left: 0;
    }
}

/* â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   Import column chips

   Moved out of Cim360ImportDialog.razor.css when ImportColumnMap started drawing them too. A class
   defined in a scoped stylesheet belongs to ONE component: the rule compiles to .imp-col[b-hash]
   and a child component's markup never carries the parent's attribute, so the chips rendered by
   the map would have been unstyled while the identical ones in the dialog looked right. R-066 is
   the regression check that catches it, and it did.
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.imp-cols {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.imp-col {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border: 1px solid var(--cim360-border);
    border-radius: 0.375rem;
    background: var(--cim360-surface-muted);
    font-size: 0.7813rem;
}

/* Same headerband pair as the icon disc, and for the same reason: filled with
   --cim360-primary-surface this chip was dark text on solid blue in light mode (3.67:1) with the
   REQUIRED tag at 1.55:1, and legible in dark. Both are white-on-brand here, in every mode. */
.imp-col.is-required {
    border-color: var(--cim360-headerband-bg);
    background: var(--cim360-headerband-bg);
}

.imp-col-name {
    font-weight: 600;
    color: var(--cim360-text-strong);
}

.imp-col.is-required .imp-col-name {
    color: var(--cim360-headerband-fg);
}

/* The hierarchy against the name comes from size and letter-spacing, never from fading it - an
   opacity below about .7 takes small text under the threshold, and this is the smallest text here. */
.imp-col-tag {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--cim360-headerband-fg);
}

/* Outside a required chip the tag sits on the panel rather than on brand blue, so it takes the
   ordinary muted colour - white on white is what it would otherwise be. */
.imp-maprow .imp-col-tag,
.imp-map .imp-col-tag {
    color: var(--cim360-text-muted);
}

/* The status mark: a tick for a column read correctly, a question mark for one the reader worked
   out, a dash for a header this import ignores.

   Colour is never the only carrier. Each mark has a word beside it in the row, the same words are
   in a visually-hidden span and in the title, and the three glyphs differ in SHAPE as well as in
   hue - so the three states are readable in greyscale and at any contrast setting. WCAG 1.4.1. */
.imp-maprow-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    line-height: 1;
}

.imp-maprow.is-settled .imp-maprow-mark { color: var(--cim360-success-fg); }
.imp-maprow.is-guessed .imp-maprow-mark { color: var(--cim360-warning-fg); }
.imp-maprow.is-unused  .imp-maprow-mark { color: var(--cim360-text-muted); }

/* The required columns nothing answers, which is the one block on this screen somebody must act
   on. A left edge rather than a fill, for the same reason the mapping rows use one: several of
   these at once should read as a list of questions, not as a broken screen. */
.imp-map-missing.is-blocking {
    border-top: 0;
    margin-top: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-left: 0.1875rem solid var(--cim360-danger);
    border-radius: 0 0.5rem 0.5rem 0;
    background: var(--cim360-danger-bg, var(--cim360-surface-muted));
}

.imp-map-missing.is-blocking .imp-map-missing-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    color: var(--cim360-danger-fg);
}

/* The all-clear. Shared by the import dialog's check step and by ImportColumnMap, which is why it
   is here and not in either one's scoped stylesheet. */
.imp-clean {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--cim360-success-fg);
}

/* A section band that folds its body away. Opt-in: see Cim360DialogSection.Collapsible for why
   this is not the default, and DEV-227 for the ticket that asked the ordinary bands to stop
   looking pressable. */
button.c360-dlg-sect-head {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--cim360-headerband-line);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

/* The caret carries the state as SHAPE, not only as rotation - pointing down when open and right
   when shut - so the two states differ for somebody who cannot see a transition. aria-expanded
   says the same thing for a screen reader. */
.c360-dlg-sect-caret {
    flex: 0 0 auto;
    font-size: 0.75rem;
    color: var(--cim360-headerband-fg);
}

/* The label takes the slack so the meta figure stays hard right, exactly as it does on a band
   that is not a button. */
button.c360-dlg-sect-head .c360-dlg-section-label {
    flex: 1 1 auto;
}

/* The control tint the header band already uses for anything pressable on it - a token, so it
   follows the theme into dark and high contrast. R-078 refuses a literal here, and rightly: a
   hard-coded white mix is invisible in one mode and glaring in another. */
button.c360-dlg-sect-head:hover {
    background: color-mix(in srgb, var(--cim360-headerband-control-bg) 35%, var(--cim360-headerband-bg));
}

button.c360-dlg-sect-head:focus-visible {
    outline: 2px solid var(--cim360-headerband-fg);
    outline-offset: -0.1875rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Dialog choice blocks: a legend and a stack of radios, each with its consequence in words.

   Shared chrome because two dialogs draw them - the export's "What goes in it" and the count
   sheet's import settings - and a class defined in a scoped stylesheet belongs to one component.
   ───────────────────────────────────────────────────────────────────────────── */

.c360-dlg-choice {
    margin: 0 0 0.75rem 0;
    padding: 0;
    border: 0;
}

.c360-dlg-choice:last-child {
    margin-bottom: 0;
}

.c360-dlg-choice legend {
    padding: 0 0 0.375rem 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: var(--cim360-text-muted);
}

/* The radio sits in its own column so the two lines of text align with each other rather than
   wrapping back under the control. */
.c360-dlg-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    column-gap: 0.5625rem;
    padding: 0.4375rem 0.625rem;
    border: 1px solid transparent;
    border-radius: 0.4375rem;
    cursor: pointer;
}

.c360-dlg-option:hover {
    background: var(--cim360-surface-muted);
}

.c360-dlg-option input {
    grid-row: 1 / span 2;
}

.c360-dlg-option-main {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--cim360-text-strong);
}

/* The consequence of the choice, in words. Which of these two a person wants is not obvious from
   "Leave it blank" alone - it is obvious from "a sheet to count onto". */
.c360-dlg-option-sub {
    grid-column: 2;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}


/* Choice blocks side by side where the dialog is wide enough for them.

   auto-fit with a 280px floor rather than a media query, so it answers the question that actually
   matters - is there room for two - rather than how wide the WINDOW is. A dialog is a fixed width
   inside the window, so a viewport query would give the wrong answer in both directions.

   280px is the width at which a choice's explanatory sub-line still reads as a sentence; below it
   the line that makes the choice decidable starts wrapping every three words. */
.c360-dlg-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
    gap: 0.25rem 1.5rem;
    align-items: start;
}

/* The stacking margin belongs to a column layout. Side by side, it pushes the second block down
   by a row for no reason. */
.c360-dlg-choices > .c360-dlg-choice {
    margin-bottom: 0;
}

/* The "On hold" pill beside an action window's title - Cim360HoldPill, DEV-492. The record card
   header's chip (.c360-rch-chip) on the same header-band tokens, so the window and the card behind
   it carry the same mark. Global rather than scoped: it renders inside both the c360-dlg header and
   Cim360ConfirmDialog's, which a scoped sheet on either could not reach. */
.c360-hold-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5625rem;
    vertical-align: middle;
    border: 1px solid color-mix(in srgb, var(--cim360-headerband-fg) 40%, transparent);
    border-radius: 62.4375rem;
    background: rgba(0, 0, 0, .105);
    color: var(--cim360-headerband-fg);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}
