.wh-icon {
    display: inline-block;
    flex: 0 0 auto;
    background-color: currentColor;
    -webkit-mask: var(--wh-icon-mask) no-repeat center / contain;
    mask: var(--wh-icon-mask) no-repeat center / contain;
    line-height: 1;
}


.wh-icon-warehouse    { --wh-icon-mask: url("../../images/inventory/warehouse-icons/warehouse.svg"); }
.wh-icon-distribution { --wh-icon-mask: url("../../images/inventory/warehouse-icons/distribution.svg"); }
.wh-icon-factory      { --wh-icon-mask: url("../../images/inventory/warehouse-icons/factory.svg"); }
.wh-icon-truckdock    { --wh-icon-mask: url("../../images/inventory/warehouse-icons/truckdock.svg"); }
.wh-icon-pallet       { --wh-icon-mask: url("../../images/inventory/warehouse-icons/pallet.svg"); }
.wh-icon-cold         { --wh-icon-mask: url("../../images/inventory/warehouse-icons/cold.svg"); }
.wh-icon-hazmat       { --wh-icon-mask: url("../../images/inventory/warehouse-icons/hazmat.svg"); }
.wh-icon-returns      { --wh-icon-mask: url("../../images/inventory/warehouse-icons/returns.svg"); }
.wh-icon-quarantine   { --wh-icon-mask: url("../../images/inventory/warehouse-icons/quarantine.svg"); }
.wh-icon-container    { --wh-icon-mask: url("../../images/inventory/warehouse-icons/container.svg"); }
.wh-icon-retail       { --wh-icon-mask: url("../../images/inventory/warehouse-icons/retail.svg"); }
.wh-icon-office       { --wh-icon-mask: url("../../images/inventory/warehouse-icons/office.svg"); }
.wh-icon-archive      { --wh-icon-mask: url("../../images/inventory/warehouse-icons/archive.svg"); }
.wh-icon-crane        { --wh-icon-mask: url("../../images/inventory/warehouse-icons/crane.svg"); }
.wh-icon-parts        { --wh-icon-mask: url("../../images/inventory/warehouse-icons/parts.svg"); }
.wh-icon-thirdparty   { --wh-icon-mask: url("../../images/inventory/warehouse-icons/thirdparty.svg"); }


.cim360-wh-color-blue   { --cim360-wh-c: var(--cim360-primary); color: var(--cim360-wh-c); }
.cim360-wh-color-navy   { --cim360-wh-c: var(--cim360-wh-navy);                color: var(--cim360-wh-c); }
.cim360-wh-color-teal   { --cim360-wh-c: var(--cim360-wh-teal);                color: var(--cim360-wh-c); }
.cim360-wh-color-green  { --cim360-wh-c: var(--cim360-success); color: var(--cim360-wh-c); }
.cim360-wh-color-amber  { --cim360-wh-c: var(--cim360-warning); color: var(--cim360-wh-c); }
.cim360-wh-color-red    { --cim360-wh-c: var(--cim360-danger);  color: var(--cim360-wh-c); }
.cim360-wh-color-violet { --cim360-wh-c: var(--cim360-violet);  color: var(--cim360-wh-c); }
.cim360-wh-color-slate  { --cim360-wh-c: var(--cim360-text-muted);                color: var(--cim360-wh-c); }

.cim360-wh-color-muted  { --cim360-wh-c: var(--cim360-text-muted); color: var(--cim360-wh-c); }

/* ─── THE ICON BADGE ───
   The tinted square a warehouse's icon sits in. Sized from --wh-badge-size so the tiles can be
   40px and the stock sourcing rows 32px off one rule, because everything else about them - the
   radius, the tint from currentColor, the centring - is the same and had drifted into a scoped
   sheet where a second screen could not reach it. */
.wh-icon-badge {
    flex: 0 0 auto;
    width: var(--wh-badge-size, 2rem);
    height: var(--wh-badge-size, 2rem);
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, currentColor 14%, transparent);
}

/* ─── THE WAREHOUSE TYPE PILL ───
   Shape from .c360-pill. Uppercase and the wider tracking stay: this is a category label and it
   reads as one at a glance on a row full of other text.

   Unscoped for the same reason the module pills below are - the warehouse tiles draw it and so do
   the stock sourcing rows, and a scoped copy reaches only the component that owns it. */
.wh-type-pill {
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    width: fit-content;
}

.wh-type-physical    { background: var(--cim360-primary-tint);  color: var(--cim360-primary-dark); }
.wh-type-virtual     { background: var(--cim360-violet-bg);     color: var(--cim360-violet-fg); }
.wh-type-external3pl { background: var(--cim360-warning-bg);    color: var(--cim360-warning-fg); }
.wh-type-quarantine  { background: var(--cim360-danger-bg);     color: var(--cim360-danger-fg); }

/* ─── A WAREHOUSE'S MODULE VALIDITY, AS FOUR PILLS ───
   Shape comes from .c360-pill in css/forms/cim360-dialog.css; only the colours are here.

   Unscoped and shared, because two screens draw them: the warehouse tiles on Settings - Warehouse
   - Defaults, and the stock sourcing rows underneath, which show each source warehouse's validity
   so somebody ranking one can see what it is actually valid for. They lived in
   WarehouseTile.razor.css until DEV-36, where scoped CSS meant the second screen could not reach
   them - and the first attempt at that row invented four lettered squares instead, which is a
   third pill language on a screen that already had one.

   border-color, not the `border` shorthand: the shorthand would replace .c360-pill's width and
   style as well, and this only wants a different colour. */
/* --cim360-text-muted, NOT --cim360-muted-soft, and this one was measured rather than chosen.
   The soft token is #94a3b8, which on the #f4f6f9 surface below it measures 2.37:1 against the
   4.5:1 small text needs under WCAG 1.4.3. --cim360-text-muted is #4B5563 and measures 6.98:1 on
   the same ground. Both figures come off tools/a11y/measure-sourcing-rows.mjs, 2026-09-21.

   An off flag is INFORMATION, not an inactive control, so the exemption for a disabled component
   does not apply: it says the warehouse is not valid for that module, which is exactly what
   somebody ranking it needs to read. The tiles have carried the soft value since they shipped and
   this rule is shared, so the same change fixes both. */
.wh-flag-pill.off {
    background: var(--cim360-surface);
    color: var(--cim360-text-muted);
    border-color: var(--cim360-border-soft);
}

/* Tinted, like the other twenty-five pills in the product - these four were solid fills with white
   text, which is a different pill language, and they sat on the same tile as a tinted type pill.
   On/off still reads clearly: grey tint against a coloured one. */
.wh-flag-sales.on         { background: var(--cim360-success-bg); color: var(--cim360-success-fg); border-color: var(--cim360-success-border); }
.wh-flag-purchase.on      { background: var(--cim360-info-bg);    color: var(--cim360-info-fg);    border-color: var(--cim360-info-border); }
.wh-flag-quarantine.on    { background: var(--cim360-warning-bg); color: var(--cim360-warning-fg); border-color: var(--cim360-warning-border); }
.wh-flag-manufacturing.on { background: var(--cim360-violet-bg);  color: var(--cim360-violet-fg);  border-color: var(--cim360-violet-border); }

/* ─── THE SAME FOUR AS LETTERED SQUARES ───
   S P Q M, 17px, one per module, which is what the prototype draws on a stock sourcing row: four
   words and a type pill on one line leaves nothing for the warehouse name. It is a MODIFIER on
   .wh-flag-pill, so the four hues above are the same four here and there is still one place to
   change a colour.

   THE FILL IS THE TINT, NOT THE SOLID, and that is a deliberate departure from the prototype.
   It draws the on state as white on the module's solid colour, and two of the four cannot carry
   white text: white on #16a34a is 3.26:1 and on #d97706 is 3.19:1, against the 4.5:1 a letter
   needs as small text under WCAG 1.4.3. A letter is TEXT, not a glyph, so the 3:1 shape threshold
   does not apply to it. The tinted pairs measure 6.49:1 (S), 5.49:1 (P), 6.37:1 (Q) and 6.98:1
   (off) - and they are the only version that also works in dark mode, where the -fg tokens flip
   to light and a white letter would vanish.

   The state is still in the pill's title and in a visually-hidden word beside the letter, because
   a coloured square against a grey one is colour alone and a single letter names nothing. */
.wh-flag-letter {
    width: 1.0625rem;
    height: 1.0625rem;
    padding: 0;
    gap: 0;
    border-radius: 0.1875rem;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
    text-transform: none;
}
