/* =====================================================================================
   cim360-dashboard.css - the shell every Cim360 dashboard is drawn in.

   GLOBAL, not scoped, for the reason css/lists/cim360-list.css is: these classes are used
   by the shell component AND by the tile bodies each module supplies, which are separate
   components with their own scope attributes. A .razor.css on the shell would not reach
   them, and every module would end up with its own copy of the grid.

   Registered in Cim360.cloud.Web/Components/App.razor and Cim360.cloud/wwwroot/index.html.
   ===================================================================================== */

/* The scroll container, and it has to be this element.

   The app shell gives a page a flex row to fill and scrolls nothing itself, so a dashboard
   taller than the viewport runs off the bottom with no scrollbar anywhere. min-height:0 is
   the half that is easy to miss: without it a flex child refuses to shrink below its content
   and overflow-y never engages, so the rule looks applied and does nothing.

   It is also what the sticky scope bar sticks to. */
.c360-dash {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.875rem 1rem 2.5rem;
    min-width: 0;
}

/* ---- 1. the scope bar ----------------------------------------------------------- */

/* Sticky on purpose. Re-scoping by warehouse or category recomputes every tile without a
   round trip, which is the best thing about this page and easy to miss when the controls
   have scrolled away above a screenful of charts.

   z-index 9, deliberately below the app's top bar (.cim-topbar, z-index 10). The top bar is
   its own stacking context, so its user menu's z-index of 10000 only counts inside the bar.
   At 20 this bar painted over the open user menu. 9 still clears every tile layer (2 at most).
   The pickers' popovers and backdrop sit inside this bar's context and rise with it. */
.c360-dash-scope {
    position: sticky;
    top: 0;
    z-index: 9;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5625rem;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.875rem;
    background: var(--cim360-card);
    border: 1px solid var(--cim360-border);
    border-radius: 0.75rem;
    /* Reaches further than a resting card's, because content passes underneath this one. The
       shadow is what says "in front" once a chart is sliding behind the bar. */
    box-shadow: 0 2px 0.375rem rgba(15, 23, 42, .08);
}

/* Paints the strip above the pinned bar, in the page's own ground.

   A sticky element is offset from the scrollport's PADDING edge, so the container's 14px of top
   padding leaves a 14px band above the pinned bar that belongs to the scrolling content - tiles
   ran up through it and reappeared between the site header and the bar, which reads as a
   rendering fault rather than as a gap. Nothing can be stacked in that band, because it is not a
   box; the bar has to reach up and cover it.

   Full-bleed past the container's side padding - a strip that stopped at the bar's rounded
   corners would leave two lit notches - and the container's overflow-x:hidden trims the
   overhang. */
.c360-dash-scope::before {
    content: "";
    position: absolute;
    left: -1.5rem;
    right: -1.5rem;
    top: -1rem;
    height: 1.0625rem;
    background: var(--cim360-surface);
    pointer-events: none;
}

.c360-dash-spacer { flex: 1 1 auto; }

/* The same button the module puts in the same bar - 28px tall, 4px radius, primary fill. A
   shell button styled to its own taste stands next to the module's controls and reads as a
   different kind of thing, which is precisely the drift a shared shell exists to stop. */
.c360-dash-btn {
    appearance: none;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    height: 1.75rem;
    padding: 0 0.625rem;
    white-space: nowrap;
    background: var(--cim360-primary-surface);
    color: #fff;
    border: 1px solid var(--cim360-primary);
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px color-mix(in srgb, var(--cim360-primary) 25%, transparent);
    transition: background-color var(--cim360-motion-fast) var(--cim360-ease-out), border-color var(--cim360-motion-fast) var(--cim360-ease-out), transform var(--cim360-motion-fast) var(--cim360-ease-out);
}

.c360-dash-btn:active:not([disabled]) { transform: translateY(1px); }

.c360-dash-btn > i { font-size: 0.75rem; color: #fff; flex: 0 0 auto; }

.c360-dash-btn:hover:not([disabled]) {
    background: var(--cim360-primary-surface-hover);
    border-color: var(--cim360-primary-hover);
}

.c360-dash-btn:focus-visible { outline: 2px solid var(--cim360-primary); outline-offset: 2px; }
.c360-dash-btn[disabled] { opacity: .62; cursor: not-allowed; }

.c360-dash-btn.is-primary { background: var(--cim360-primary-surface); }

/* Cancel and Reset are not commitments and must not be dressed as one beside Save. */
.c360-dash-btn.is-quiet {
    background: var(--cim360-surface-2);
    color: var(--cim360-text);
    border-color: var(--cim360-border);
    box-shadow: none;
}

.c360-dash-btn.is-quiet > i { color: var(--cim360-text-muted); }

.c360-dash-btn.is-quiet:hover:not([disabled]) {
    background: var(--cim360-card);
    border-color: var(--cim360-primary);
}

/* A plan gate looks different from a permission gate. is-quiet still does something on click
   (Cancel, Reset); this button does not, and dressing it identically would teach the reader that
   quiet buttons are sometimes inert for no visible reason. Muted toward the border colour rather
   than toward red or amber, because refusing the click is not a fault - the button is doing
   exactly what a Core plan means it to do. aria-disabled, never the disabled attribute: this
   button keeps its place in the tab order specifically so a keyboard user reaches it and hears
   the reason in its accessible name, rather than the control simply not being there to find. */
.c360-dash-btn.is-locked {
    background: var(--cim360-surface-2);
    color: var(--cim360-text-muted);
    border-color: var(--cim360-border);
    box-shadow: none;
    cursor: not-allowed;
}

.c360-dash-btn.is-locked > i { color: var(--cim360-muted-soft); }

/* No hover-to-primary the way is-quiet gets: that invites a click, and this button answers every
   click the same way - nothing. */
.c360-dash-btn.is-locked:hover {
    background: var(--cim360-surface-2);
    border-color: var(--cim360-border);
}

.c360-dash-btn.is-locked:focus-visible {
    outline: 2px solid var(--cim360-text-muted);
    outline-offset: 2px;
}

/* ---- 2. loading and failure ------------------------------------------------------ */

.c360-dash-status {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--cim360-text-muted);
    justify-content: center;
}

.c360-dash-status.is-error { color: var(--cim360-danger-fg); }

.c360-dash-spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid var(--cim360-border);
    border-top-color: var(--cim360-primary);
    animation: c360-dash-spin 800ms linear infinite;
}

@keyframes c360-dash-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .c360-dash-spinner { animation: none; border-top-color: var(--cim360-border); }
}

/* ---- 3. the grid ----------------------------------------------------------------- */

/* Dense, so a half-width tile followed by a full-width one does not leave a hole the
   reader has to look past. The old layout scaled each row's spans to fill twelve columns
   exactly, which kept the rows tidy at the cost of a chosen size never being the size you
   got - a tile set to a third rendered as a half whenever it shared a row with one other. */
.c360-dash-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: minmax(6.5rem, auto);
    grid-auto-flow: row dense;
    gap: 0.875rem;
}

/* Below 900px there are no columns worth dividing, so every tile is full width and the
   arrangement survives as an order rather than as a shape. */
.c360-dash-tile { grid-column: span 12; }

/* A tile's size is the size it was given, whatever is inside it.

   grid-auto-rows is minmax(104px, auto), so without a ceiling a tile grows to fit its
   content and the body's overflow-y never engages - the same min-height:0 trap one level
   up. A worklist of ninety-six lines then made a "medium" tile 3,460px tall, and because
   grid rows are shared it dragged the tile beside it to the same height.

   The cap is on the tile and the body scrolls inside it, so nothing is truncated: the
   difference is whether the reader scrolls the dashboard past one tile or scrolls the tile.
   Small carries no body, so it needs no ceiling. */
/* A floor as well as a ceiling, and the floor is the same number.

   The charts inside are drawn at a height C# works out from these two figures, and a
   drawing is not reflowable - it is sized once, in the viewBox, before the browser lays
   anything out. A tile free to settle anywhere below its ceiling therefore leaves a band
   of empty card under every chart on a row whose tallest tile happens to be short, and
   clips the bottom row of a bar chart on one that is not. Pinning the height makes the
   number C# used the number the tile actually has. */
.c360-dash-tile.is-medium { height: 28.75rem; max-height: 28.75rem; }
.c360-dash-tile.is-large { height: 42.5rem; max-height: 42.5rem; }

@media (min-width: 900px) {
    .c360-dash-tile.is-small  { grid-column: span 4; grid-row: span 1; }
    .c360-dash-tile.is-medium { grid-column: span 6; grid-row: span 2; }
    .c360-dash-tile.is-large  { grid-column: span 12; grid-row: span 3; }
}

@media (min-width: 1400px) {
    .c360-dash-tile.is-small { grid-column: span 3; }
}

.c360-dash-grid.is-custom .c360-dash-tile {
    outline: 2px dashed var(--cim360-primary);
    outline-offset: -1px;
}

.c360-dash-grid.is-custom .c360-dash-tile-head { cursor: grab; }

.c360-dash-tile.is-dragging { opacity: .45; }

/* The tile answers the pointer: a soft lift and shadow on hover, a small dip on press. `top`, not a
   transform: a transformed ancestor becomes the containing block for fixed-position menus placed
   from viewport coordinates, and a menu opened while the tile is hovered must stay where it is
   put. The tile is already position: relative, and a 2px offset moves nothing around it. The
   preview tile in the Add-a-tile dialog and a tile being dragged do not move. */
.c360-dash-tile:not(.is-preview) {
    transition: top var(--cim360-motion-base) var(--cim360-ease-out),
                box-shadow var(--cim360-motion-base) var(--cim360-ease-out);
}

.c360-dash-tile:not(.is-preview):not(.is-dragging):hover {
    top: var(--cim360-lift);
    box-shadow: var(--cim360-lift-shadow);
}

.c360-dash-tile:not(.is-preview):not(.is-dragging):active {
    top: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

/* ---- 4. the tile ----------------------------------------------------------------- */

.c360-dash-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    padding: 0.9375rem 1rem 0.8125rem;
    background: var(--cim360-card);
    border: 1px solid var(--cim360-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

/* Top-aligned, not centred. The controls column on the right is two rows tall once it carries a
   sparkline under the buttons, and centring made the icon and title drop half that height - the
   title sat a line lower on exactly the tiles that have history, and level on the ones that do
   not. Pinning to the top keeps the title on the same line as the buttons whatever is beneath
   them, and the icon square and the button row are both 28px so the two line up. */
.c360-dash-tile-head {
    display: flex;
    align-items: flex-start;
    gap: 0.5625rem;
    min-width: 0;
}

/* The title centres against the 28px first row rather than against the whole head, so it sits
   level with the icon beside it and the buttons opposite it - not half a sparkline lower. */
.c360-dash-tile-head > .c360-dash-tile-label {
    align-self: flex-start;
    min-height: 1.75rem;
    display: flex;
    align-items: center;
}

/* The accent tint and the 70% darkening are the KPI tile's, measured: the accent at full
   strength on its own 10% tint falls below 3:1 for several of the palette's colours. */
.c360-dash-tile-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    background: color-mix(in srgb, var(--tile-accent, var(--cim360-primary)) 10%, var(--cim360-card));
    color: color-mix(in srgb, var(--tile-accent, var(--cim360-primary)) 70%, var(--cim360-text-strong));
}

[data-fluent-darkmode] .c360-dash-tile-icon {
    color: color-mix(in srgb, var(--tile-accent, var(--cim360-primary)) 72%, var(--cim360-text-tint-base));
}

/* Sentence case and --cim360-caption: the product-wide caption rule of 2026-09-11. This is the
   tile's name, which is a caption like any other - not a grid column heading, which is the one
   family that keeps its capitals. --cim360-text-muted, which this carried, is the AA-only token
   (6.64:1) that rule replaced with a 10.31:1 one. */
.c360-dash-tile-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .01em;
    color: var(--cim360-caption);
    line-height: 1.25;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Proportional figures, never tabular: tabular-nums gives every digit the width of a zero,
   which makes a number like 121 read loose at this size. */
.c360-dash-tile-value {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.1;
    color: var(--cim360-text-strong);
    margin: 0.625rem 0 0;
}

.c360-dash-tile.is-small .c360-dash-tile-value { font-size: 1.625rem; }

.c360-dash-tile-sub {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--cim360-text-muted);
    margin-top: 0.1875rem;
}

/* Scrolls rather than clips, and the tile itself keeps overflow:hidden so the rounded corner
   still cuts cleanly. A body longer than its tile is normal here - a worklist is however many
   lines are short today - and the alternative is truncating it, which is how a tile comes to
   count ninety-two and draw five. min-height:0 is the half that is easy to miss: without it a
   flex child refuses to shrink below its content and overflow never engages. */
.c360-dash-tile-body {
    margin-top: 0.75rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* A table twin inside a tile is a scroll container of its own (.c360-chart-table-wrap is overflow:auto),
   nested in the body's, so a worklist drew two scrollbars side by side. The body is the one scroller:
   the wrap stops scrolling and the body takes the horizontal axis too when a table is wider than it. */
.c360-dash-tile-body .c360-chart-table-wrap { overflow: visible; }
.c360-dash-tile-body:has(.c360-chart-table-wrap) { overflow-x: auto; }

.c360-dash-tile-foot { margin-top: 0.625rem; }

.c360-dash-drill {
    appearance: none;
    background: none;
    border: 0;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--cim360-primary);
    cursor: pointer;
    padding: 2px 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
}

.c360-dash-drill {
    transition: color var(--cim360-motion-fast) var(--cim360-ease-out), transform var(--cim360-motion-fast) var(--cim360-ease-out);
}

.c360-dash-drill:hover { text-decoration: underline; }
.c360-dash-drill:active { transform: translateY(1px); }
.c360-dash-drill:focus-visible { outline: 2px solid var(--cim360-primary); outline-offset: 2px; }

.c360-dash-delta-row {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    margin-top: 0.5625rem;
    flex-wrap: wrap;
}

.c360-dash-delta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 0.4375rem;
    border-radius: 62.4375rem;
}

.c360-dash-delta.is-good { background: var(--cim360-success-bg); color: var(--cim360-success-fg); }
.c360-dash-delta.is-bad  { background: var(--cim360-danger-bg);  color: var(--cim360-danger-fg); }

/* A figure whose direction the product takes no view on - stock value, active SKUs. Plain ink on
   the ordinary surface: the movement is reported, and nothing is claimed about whether it is good
   news. Green or red here would be an opinion the measure does not carry. */
.c360-dash-delta.is-neutral {
    background: var(--cim360-surface-2);
    color: var(--cim360-text);
}

.c360-dash-delta-note {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--cim360-text-muted);
}

/* The prior-period figure beneath the delta, in the delta note's own voice. DEV-736. */
.c360-dash-tile-prior {
    margin-top: 0.125rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--cim360-text-muted);
    font-variant-numeric: tabular-nums;
}

/* The figure sits left of whatever the head's right-hand column holds. No wrapping: a
   sparkline that drops below the figure on one tile and sits beside it on another is the same
   control in two places, which is what wrapping produced. min-width:0 lets a long value
   ellipsis rather than forcing the row wider than its tile. */
.c360-dash-tile-figure {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.c360-dash-tile-figure-text { min-width: 0; flex: 1 1 auto; }

.c360-dash-spark { margin-top: 2px; line-height: 0; }

/* The sparkline sits on the figure's row, in the tile's right-hand column - the same column the
   head's controls occupy directly above it. Both are pinned to one width, declared once here, so
   the two right-hand columns line up without either having to measure the other. Change this and
   both move together; that is the point of it being a single custom property. */
/* The measured span of the controls themselves - the left edge of the first view button to the
   right edge of the pop-out button - not a round number. Three view buttons, their gaps, and the
   pop-out beside them. If the switch ever gains or loses an option this needs re-measuring, which
   is why it is one property rather than a figure repeated in two rules. */
.c360-dash-tile { --c360-tile-actions-w: 10.25rem; }

.c360-dash-tile-actions,
.c360-dash-spark.is-aligned {
    width: var(--c360-tile-actions-w);
    flex: 0 0 var(--c360-tile-actions-w);
}

/* Stretched across that column, which the sparkline's own preserveAspectRatio="none" turns into
   a full-width line rather than one letterboxed in the middle of empty space. Height stays fixed
   so the row does not grow with the tile's width. */
.c360-dash-spark.is-aligned svg {
    width: 100%;
    height: 1.75rem;
    display: block;
}

/* Small has no controls to align to, so the sparkline keeps its own drawn width and simply sits
   below the figure. Deliberately NOT stretched to the card: there is nothing on a Small tile for
   it to line up with, so full width would just make it the largest thing on a tile whose whole
   job is to lead with a number. */
.c360-dash-spark.is-wide {
    margin-top: 0.625rem;
}

.c360-dash-spark.is-wide svg {
    display: block;
}

/* ---- 5. the customise tools ------------------------------------------------------ */

.c360-dash-tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 0 0 auto;
}

.c360-dash-grip {
    color: var(--cim360-muted-soft);
    cursor: grab;
    display: flex;
    padding: 0 2px;
}

.c360-dash-tool {
    appearance: none;
    border: 1px solid var(--cim360-border);
    background: var(--cim360-surface-2);
    color: var(--cim360-text-muted);
    width: 1.5rem;
    height: 1.375rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 800;
}

.c360-dash-tool { transition: color var(--cim360-motion-fast) var(--cim360-ease-out), border-color var(--cim360-motion-fast) var(--cim360-ease-out), transform var(--cim360-motion-fast) var(--cim360-ease-out); }
.c360-dash-tool:hover:not([disabled]) { color: var(--cim360-primary); border-color: var(--cim360-primary); }
.c360-dash-tool:active:not([disabled]) { transform: translateY(1px); }
.c360-dash-tool:focus-visible { outline: 2px solid var(--cim360-primary); outline-offset: 1px; }
.c360-dash-tool[disabled] { opacity: .35; cursor: not-allowed; }

.c360-dash-tool[aria-pressed="true"] {
    background: var(--cim360-primary-surface);
    border-color: var(--cim360-primary);
    color: #fff;
}

.c360-dash-sizes { display: flex; gap: 2px; margin-left: 2px; }
.c360-dash-sizes .c360-dash-tool.is-size { width: 1.625rem; }

/* Reading mode's head controls - the Live/Trend/Table switch and the pop-out button - with the
   sparkline stretched underneath them.

   A column, not a row, and that is what makes the alignment hold: the sparkline sits in the same
   container as the controls, so its ends line up with the left of the first view button and the
   right of the pop-out button by construction. Matching those edges across two separate flex
   containers would work until the first time somebody changed a padding.

   margin-left:auto belongs to this column rather than to the pop-out button alone: the tile's
   label sits left, and this is the only thing to the right of it once the customise tools go. */
.c360-dash-tile-actions {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.375rem;
}

/* The controls keep their own row inside that column, hard right, so the column is only ever as
   wide as they are - which is the width the sparkline beneath then inherits.

   This rule is load-bearing rather than tidy: without it the switch (itself a flex box, so a
   block-level item) and the pop-out button are two items in a COLUMN, and the button drops onto
   its own line under the switch. */
.c360-dash-tile-actions-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    align-self: flex-end;
}

/* The Live/Trend/Table switch (DEV-418), moved here from Dashboards.razor.css because it is now
   shell chrome beside the pop-out button rather than something the module draws inside its own
   Body. Built from .c360-dash-tool rather than a bespoke pill so it reads as the same set of
   controls as the pop-out button and the customise-mode size buttons either side of it -
   .is-view only widens the button and drops the single-letter sizing, since these carry words
   ("Live"/"Trend"/"Table") rather than initials. The active option is marked the same way the
   size buttons already are, through .c360-dash-tool's own [aria-pressed="true"] rule below -
   nothing extra is needed here for it. */
.c360-dash-view-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.c360-dash-tool.is-view {
    width: auto;
    padding: 0 0.5rem;
    text-transform: none;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
}

/* ---- 6. the tray ----------------------------------------------------------------- */

.c360-dash-tray {
    margin-top: 0.875rem;
    border: 1px dashed var(--cim360-primary);
    border-radius: 0.75rem;
    background: var(--cim360-primary-soft);
    padding: 0.75rem 0.875rem;
}

/* No text-transform, for the same reason as .c360-dash-tile-label above. R-048 does not flag
   this one - it matches -label/-caption/-eyebrow/-kicker and this ends -title - but it is the
   tray's section heading, and neither family that heading could belong to is set in capitals by
   CSS: a caption reads in sentence case, and a group box title takes its capitals from the
   string. The colour stays: this sits on the tray's tinted panel, not on a page surface. */
.c360-dash-tray-title {
    margin: 0 0 0.1875rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--cim360-primary-dark);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

[data-fluent-darkmode] .c360-dash-tray-title { color: #9ecbf0; }

.c360-dash-tray-note {
    margin: 0 0 0.625rem;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

.c360-dash-tray-items { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.c360-dash-tray-empty { font-size: 0.7813rem; color: var(--cim360-text-muted); }

.c360-dash-tray-btn {
    appearance: none;
    font: inherit;
    font-size: 0.7813rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    background: var(--cim360-card);
    border: 1px solid var(--cim360-border);
    border-radius: 0.5625rem;
    padding: 0.4375rem 0.6875rem;
    color: var(--cim360-text);
}

.c360-dash-tray-btn { transition: color var(--cim360-motion-fast) var(--cim360-ease-out), border-color var(--cim360-motion-fast) var(--cim360-ease-out), transform var(--cim360-motion-fast) var(--cim360-ease-out); }
.c360-dash-tray-btn:hover:not([disabled]) { border-color: var(--cim360-primary); color: var(--cim360-primary); }
.c360-dash-tray-btn:active:not([disabled]) { transform: translateY(1px); }
.c360-dash-tray-btn:focus-visible { outline: 2px solid var(--cim360-primary); outline-offset: 2px; }
.c360-dash-tray-btn[disabled] { opacity: .6; cursor: not-allowed; }

.c360-dash-tray-btn small {
    font-weight: 600;
    color: var(--cim360-text-muted);
    font-size: 0.75rem;
}

/* ---- 7. pop-out: a tile enlarged and pulled forward to fill the screen (DEV-425) ------- */

@keyframes c360DashPopFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes c360DashPopIn {
    from { opacity: .5; transform: scale(.985); }
    to { opacity: 1; transform: none; }
}

/* An inert copy of a tile or pop-out that is playing its exit (Cim360DashboardPage.razor.js). It is
   already the end of a movement, so its own entry animations must not start again. */
.is-leaving,
.is-leaving * { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
    .c360-dash-pop-backdrop, .c360-dash-pop { animation: none; }
}

/* Below the .dcat-overlay below (z-index 4000) on purpose, not above it.
   The tile's own drill-through still works while popped out - clicking a category bar re-runs the
   same Body markup that opens a breakdown dialog from the dashboard proper - and that dialog has
   to land ON TOP of the enlarged tile, not be replaced by it, or closing the breakdown would leave
   the reader looking at the dashboard instead of the tile they were reading. */
.c360-dash-pop-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(2px);
    display: flex;
    padding: 1.25rem;
    animation: c360DashPopFade var(--cim360-motion-base) var(--cim360-ease-out);
}

.c360-dash-pop {
    /* Positioned so it stacks above .c360-dlg-backdrop, which is absolutely placed behind it. */
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--cim360-card);
    border-radius: 0.75rem;
    overflow-y: auto;
    padding: 1.25rem 1.5rem 1.5rem;
    box-shadow: 0 1.5rem 3.75rem rgba(15, 23, 42, .34), 0 0.25rem 0.875rem rgba(15, 23, 42, .18);
    animation: c360DashPopIn var(--cim360-motion-slow) var(--cim360-ease-out);
}

.c360-dash-pop-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Twice .c360-dash-tile-icon's size - the pop-out is the tile at its largest, and a 28px icon
   square lifted onto a full screen without changing would read as the same chrome shrunk into the
   corner of something bigger, not as the tile enlarged. */
.c360-dash-pop-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: color-mix(in srgb, var(--tile-accent, var(--cim360-primary)) 10%, var(--cim360-card));
    color: color-mix(in srgb, var(--tile-accent, var(--cim360-primary)) 70%, var(--cim360-text-strong));
}

[data-fluent-darkmode] .c360-dash-pop-icon {
    color: color-mix(in srgb, var(--tile-accent, var(--cim360-primary)) 72%, var(--cim360-text-tint-base));
}

.c360-dash-pop-head-text {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.c360-dash-pop-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--cim360-text-strong);
    letter-spacing: -.01em;
}

/* The scope line (DEV-425): which warehouse and category the enlarged figure is under. Quieter
   than the title - it is context for the reading, not the reading itself. */
.c360-dash-pop-scope {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--cim360-text-muted);
}

.c360-dash-pop-close {
    flex: 0 0 auto;
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 0.5rem;
    border: 1px solid var(--cim360-border);
    background: var(--cim360-surface-2);
    color: var(--cim360-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--cim360-motion-fast) var(--cim360-ease-out), border-color var(--cim360-motion-fast) var(--cim360-ease-out), color var(--cim360-motion-fast) var(--cim360-ease-out), transform var(--cim360-motion-fast) var(--cim360-ease-out);
}

.c360-dash-pop-close:active { transform: translateY(1px); }
.c360-dash-pop-close:hover { color: var(--cim360-primary); border-color: var(--cim360-primary); }
.c360-dash-pop-close:focus-visible { outline: 2px solid var(--cim360-primary); outline-offset: 2px; }

/* Larger than .c360-dash-tile-value's 30px for the same reason the icon above is bigger - this is
   the tile's headline drawn at the size a pop-out exists to give it. */
.c360-dash-pop-value {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.1;
    color: var(--cim360-text-strong);
    margin: 1.125rem 0 0;
}

.c360-dash-pop-sub {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--cim360-text-muted);
    margin-top: 0.25rem;
}

/* min-height:0 for the reason .c360-dash-tile-body carries it - without it a flex child refuses
   to shrink below its content and the card's own overflow-y never gets a chance to engage. */
.c360-dash-pop-body {
    margin-top: 1.125rem;
    flex: 1 1 auto;
    min-height: 0;
}

.c360-dash-pop-foot { margin-top: 1rem; }

/* ---- 9. tiles the reader built (DEV-426) ------------------------------------------

   Building a tile is one of the things a Complete subscription is bought for, so it is a control
   of its own beside Customise rather than a strip at the bottom of the customise tray - which was
   where it began, and which meant the feature was reachable only by entering customise mode,
   scrolling past every tile the module ships, and finding it under the list of hidden ones.

   What it opens is a dialog, and the preview is the reason. The reader is choosing between two
   tiles that differ in kind - a figure on its own, and the same figure with its chart under it -
   and the only way to choose is to see both at once. The grid has no room to show two, so the
   dialog makes it: the conversation on one side, both cards on the other.

   Nothing here restyles a tile. A described tile IS a tile - same card, same head, same figure,
   same charts - and the preview cards below are built from the grid's own classes rather than
   from a copy of them, so a change to how a tile looks reaches the preview on the same day. */

/* ---- 9a. the control that opens it ---------------------------------------------------- */

/* There is no rule here, and that is deliberate: Build uses the base .c360-dash-btn treatment,
   the same one Customise uses. They are peers - the two things a reader can do to the dashboard -
   and building a tile is what a Complete subscription is bought for, so it is not the control to
   dress down.

   It DID have a rule, and the rule was a contrast bug. It set `color: var(--cim360-primary)`
   without setting a background, and the base class is `background: var(--cim360-primary-surface)` with
   white text - so it rendered blue text on a blue ground, reported from the screen on 2026-09-13.
   The obvious repair, primary text on the quiet surface, fails too: #1D75BB on the light theme's
   #f8fafc is 4.65:1, which passes, but on the dark theme's surface-2 (#122036) it is 3.36:1,
   which does not. Taking the base treatment needs no new colour pair and therefore cannot drift
   from one that has been measured. */

/* ---- 9b. the dialog ------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .c360-dash-build-backdrop, .c360-dash-build { animation: none; }
}

/* Same z-index band as the pop-out, and for the same reason it is not higher: a breakdown dialog
   opened from a chart inside the preview renders into @Overlays and must land on top of this. */
.c360-dash-build-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(2px);
    display: flex;
    padding: 1.25rem;
    animation: c360DashPopFade var(--cim360-motion-base) var(--cim360-ease-out);
}

.c360-dash-build {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--cim360-card);
    border-radius: 0.75rem;
    overflow: hidden;
    padding: 1.125rem 1.375rem 1.25rem;
    box-shadow: 0 1.5rem 3.75rem rgba(15, 23, 42, .34), 0 0.25rem 0.875rem rgba(15, 23, 42, .18);
    animation: c360DashPopIn var(--cim360-motion-slow) var(--cim360-ease-out);
}

.c360-dash-build-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
}

.c360-dash-build-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    background: color-mix(in srgb, var(--cim360-primary) 10%, var(--cim360-card));
    color: color-mix(in srgb, var(--cim360-primary) 70%, var(--cim360-text-strong));
}

[data-fluent-darkmode] .c360-dash-build-icon {
    color: color-mix(in srgb, var(--cim360-primary) 72%, var(--cim360-text-tint-base));
}

.c360-dash-build-head-text {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.c360-dash-build-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--cim360-text-strong);
    letter-spacing: -.01em;
}

.c360-dash-build-scope {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--cim360-text-muted);
}

/* Conversation left, tile right, and the tile side gets the room: a chat turn is a sentence and a
   preview is two cards at their real proportions. Below 1000px they stack, conversation first -
   the box you type into has to be reachable without scrolling past a tile that does not exist
   yet. */
.c360-dash-build-panes {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 1rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

@media (min-width: 1000px) {
    .c360-dash-build-panes { grid-template-columns: minmax(18.75rem, 5fr) minmax(0, 7fr); }
}

.c360-dash-build-chat,
.c360-dash-build-stage {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.c360-dash-build-stage { overflow-y: auto; }

.c360-dash-build-stage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cim360-text-muted);
    margin-bottom: 0.625rem;
}

/* Not an error and not a spinner: nothing has been asked for yet. Centred in its own half so the
   empty side of the dialog reads as waiting rather than as broken. */
.c360-dash-build-stage-empty {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    margin: 0;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--cim360-text-muted);
    border: 1px dashed var(--cim360-border);
    border-radius: 0.75rem;
}

.c360-dash-build-stage-empty i { font-size: 1.625rem; opacity: .5; }

/* Nine columns, so Small at three and Medium at six hold exactly the 1:2 ratio they hold on the
   dashboard itself. Reproducing the proportion is most of what the preview is FOR - two equal
   boxes would show the difference in content and hide the difference in size, which is the half
   the reader is actually choosing between. */
.c360-dash-build-previews {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 0.875rem;
    align-items: start;
}

.c360-dash-build-preview {
    margin: 0;
    padding: 0.5rem;
    border: 1px solid transparent;
    border-radius: 0.875rem;
    grid-column: span 9;
}

@media (min-width: 700px) {
    .c360-dash-build-preview.is-s { grid-column: span 3; }
    .c360-dash-build-preview.is-m { grid-column: span 6; }
}

/* The note that stands in for the size switch when a tile has only one size to offer. Quiet, and
   beside the label rather than under the preview, because it explains the CONTROL that is missing
   rather than anything about the tile that was drawn. */
.c360-dash-build-onesize {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 500;
    color: var(--cim360-text-muted);
}

.c360-dash-build-preview figcaption {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--cim360-text-muted);
    margin-bottom: 0.375rem;
}

/* The chosen one, marked on the card's surround rather than on the card. An outline on the tile
   itself would be the provisional outline again, in a place where every tile on screen is
   provisional and the outline would therefore say nothing. */
.c360-dash-build-preview.is-chosen {
    border-color: var(--cim360-primary);
    background: color-mix(in srgb, var(--cim360-primary) 6%, transparent);
}

.c360-dash-build-preview.is-chosen figcaption { color: var(--cim360-primary); }

/* The card is the grid's card. The only thing this does is stop it being dragged or outlined by
   rules meant for a tile that is actually on the dashboard. */
.c360-dash-tile.is-preview { cursor: default; }
.c360-dash-tile.is-preview .c360-dash-tile-head { cursor: default; }

/* Docked to the bottom right of the dialog, across the full width, rather than tucked under the
   previews in the right-hand pane. It is a decision about the whole exchange - these two are what
   close the dialog - and a control that closes something belongs to that thing rather than to one
   column inside it. flex: 0 0 auto so the panes above keep every pixel they can and this stays
   put while they scroll. */
.c360-dash-build-decide {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.875rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--cim360-border-soft);
}

/* ---- 9c. the conversation -------------------------------------------------------------- */

/* A chat, because that is what it is. The reader says what they want, the product answers in a
   sentence - what it built and what it decided for them, or which half of the question stock
   cannot be asked - and they reply to that answer.

   It replaced a Describe box plus a Reword box behind a button. Two boxes is a mode, and it made
   a correction feel like filing a second request rather than answering what had just been said. */

.c360-dash-chat {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--cim360-border);
    border-radius: 0.75rem;
    background: var(--cim360-surface-2);
    overflow: hidden;
}

.c360-dash-chat-log {
    flex: 1 1 auto;
    min-height: 10rem;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.c360-dash-chat-turn {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    max-width: 92%;
}

/* The reader's own turns on the right, mirrored - the one convention every chat window shares,
   and the only thing on screen saying which half of the exchange a sentence belongs to without
   reading it. */
.c360-dash-chat-turn.is-you {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.c360-dash-chat-who {
    width: 1.5rem;
    height: 1.5rem;
    flex: 0 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    background: var(--cim360-card);
    border: 1px solid var(--cim360-border);
    color: var(--cim360-text-muted);
}

.c360-dash-chat-turn.is-them .c360-dash-chat-who {
    color: var(--cim360-primary);
    border-color: color-mix(in srgb, var(--cim360-primary) 35%, var(--cim360-border));
}

.c360-dash-chat-said {
    min-width: 0;
    padding: 0.5rem 0.6875rem;
    border-radius: 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    background: var(--cim360-card);
    border: 1px solid var(--cim360-border);
    color: var(--cim360-text);
}

.c360-dash-chat-turn.is-you .c360-dash-chat-said {
    background: color-mix(in srgb, var(--cim360-primary) 10%, var(--cim360-card));
    border-color: color-mix(in srgb, var(--cim360-primary) 28%, var(--cim360-border));
}

.c360-dash-chat-said p { margin: 0; }
.c360-dash-chat-said p + p { margin-top: 0.375rem; }

.c360-dash-chat-eg {
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

.c360-dash-chat-turn.is-working .c360-dash-chat-said {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--cim360-text-muted);
}

/* What was not recognised, under the sentence rather than instead of it. Muted rather than red:
   "stock cannot be asked that" is an answer to a question, not an error the reader has made, and
   colouring it as a failure would make describing a tile feel like something you can get wrong. */
.c360-dash-chat-problems {
    margin: 0.5rem 0 0;
    padding-left: 1.125rem;
    font-size: 0.7813rem;
    color: var(--cim360-text-muted);
}

.c360-dash-chat-problems li { margin-bottom: 0.1875rem; }
.c360-dash-chat-problems b { color: var(--cim360-text-strong); margin-right: 0.25rem; }
.c360-dash-chat-problems em { display: block; font-style: normal; font-size: 0.75rem; }

/* What stands in for the box when there is nothing to type into: the plan gate, an installation
   with no model configured, or a dashboard at its ceiling. Never an absent control - one that is
   simply missing reads as a fault and generates a support call. */
.c360-dash-chat-closed {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.6875rem 0.75rem;
    font-size: 0.7813rem;
    font-weight: 700;
    color: var(--cim360-text-strong);
    background: var(--cim360-card);
    border-top: 1px solid var(--cim360-border);
}

.c360-dash-chat-closed.is-quiet {
    font-weight: 500;
    color: var(--cim360-text-muted);
    border-top: 0;
    padding-top: 0;
}

.c360-dash-chat-compose {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem;
    background: var(--cim360-card);
    border-top: 1px solid var(--cim360-border);
}

.c360-dash-chat-input {
    flex: 1 1 auto;
    min-width: 0;
    font: inherit;
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--cim360-border);
    border-radius: 1.25rem;
    background: var(--cim360-surface-2);
    color: var(--cim360-text);
}

.c360-dash-chat-input:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 1px;
    border-color: var(--cim360-primary);
}

.c360-dash-chat-input[disabled] { opacity: .6; }

.c360-dash-chat-send {
    appearance: none;
    flex: 0 0 auto;
    width: 2.125rem;
    height: 2.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: 50%;
    cursor: pointer;
    background: var(--cim360-primary-surface);
    border: 1px solid var(--cim360-primary);
    color: #fff;
}

.c360-dash-chat-send:focus-visible { outline: 2px solid var(--cim360-primary); outline-offset: 2px; }
.c360-dash-chat-send[disabled] { opacity: .45; cursor: not-allowed; }

/* ---- 9d. the tile itself ---------------------------------------------------------------- */

/* The delete control, beside hide rather than instead of it. Kept in the muted palette until
   hovered, exactly as every other tool is: an always-red bin among grey controls reads as a
   warning about the tile rather than as one of the things you can do to it. */
.c360-dash-tool.is-delete:hover:not([disabled]) {
    color: var(--cim360-danger);
    border-color: var(--cim360-danger);
}

/* A tile that has been drawn but not kept. Solid where customise mode's own outline is dashed,
   so the one tile awaiting a decision is distinguishable from the several that are merely
   arrangeable - both outlines are on screen at the same time, which is the whole reason this
   cannot simply reuse the dashed one. */
.c360-dash-tile.is-provisional {
    outline: 2px solid var(--cim360-primary);
    outline-offset: -1px;
}

.c360-dash-grid.is-custom .c360-dash-tile.is-provisional { outline-style: solid; }

/* Where a kept tile lands.

   The same primary the provisional outline uses, and that is the point: the tile the reader was
   deciding about is the tile now sitting in their arrangement, and carrying the colour across says
   so without a word. It fades rather than staying, because it answers "where did it go" and is not
   a state the tile is in. */
@keyframes c360DashLanded {
    from { outline-color: var(--cim360-primary); }
    to   { outline-color: transparent; }
}

.c360-dash-tile.is-landed {
    outline: 2px solid var(--cim360-primary);
    outline-offset: -1px;
    animation: c360DashLanded 1.8s ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
    .c360-dash-tile.is-landed { animation: none; }
}

/* The card can hold focus so the keyboard has somewhere to land when the builder closes, but a
   tile is not a control - so it shows a ring only when focus arrived by keyboard. Without
   :focus-visible, clicking a chart inside a tile would ring the whole card. */
.c360-dash-tile:focus { outline: none; }

.c360-dash-tile:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
}

/* Keep and discard. Still their own two shapes rather than the dialog's chrome, because they are
   the module's controls: the shell places them and Inventory decides what they say. */
.c360-dash-builder-go,
.c360-dash-builder-cancel {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font: inherit;
    font-size: 0.7813rem;
    font-weight: 700;
    padding: 0.4375rem 0.875rem;
    border-radius: 0.5625rem;
    cursor: pointer;
    white-space: nowrap;
}

.c360-dash-builder-go {
    background: var(--cim360-primary-surface);
    border: 1px solid var(--cim360-primary);
    color: #fff;
}

.c360-dash-builder-cancel {
    background: var(--cim360-surface-2);
    border: 1px solid var(--cim360-border);
    color: var(--cim360-text);
}

.c360-dash-builder-go:focus-visible,
.c360-dash-builder-cancel:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: 2px;
}

.c360-dash-builder-go[disabled],
.c360-dash-builder-cancel[disabled] { opacity: .5; cursor: not-allowed; }

.c360-dash-tray-btn.is-locked { opacity: .72; cursor: not-allowed; }

/* ---- 10. tiles a colleague shared (DEV-428) --------------------------------------------- */

/* A second group inside the tray, separated by a rule rather than by a card of its own. The two
   lists answer different questions - "put mine back" and "take a copy of somebody else's" - but
   they are both "what can go on this dashboard", and boxing the second one would read as a
   different feature rather than as more of the same one. */
.c360-dash-tray-shared {
    margin-top: 0.875rem;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--cim360-primary);
}

/* Muted, and it keeps the lock beside it. The plan gate on the tray group says the same thing the
   locked Customise and Build controls do, in the same voice: what is missing is a plan, not a
   permission, and the group is present rather than absent so that nothing reads as broken. */
.c360-dash-tray-note.is-locked {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0;
    font-style: italic;
}

/* The star marks a tile nobody designed by hand, exactly as it does on the tile itself - so a
   shared entry and the described tile it becomes carry one mark between them rather than two. */
.c360-dash-tray-btn.is-shared { align-items: baseline; }

.c360-dash-tray-btn.is-shared > .bi { color: var(--cim360-primary); align-self: center; }

/* Stacked under the name rather than beside it. Who shared a tile and when is what distinguishes
   two entries that may otherwise read alike, so it has to survive the row wrapping at phone
   width instead of being pushed off the end of it. */
.c360-dash-tray-btn.is-shared > span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
}

.c360-dash-tray-btn.is-shared small { white-space: normal; }

/* The share control on a tile, in the same muted palette as every other tool until it is either
   hovered or already on - the same treatment the delete control gets, and for the same reason.
   Pressed is a real state here rather than a hover: a tile that is currently shared says so
   without being pointed at, because that is a fact about the tile rather than an action. */
.c360-dash-tool.is-sharing {
    background: var(--cim360-primary-surface);
    border-color: var(--cim360-primary);
    color: #fff;
}

.c360-dash-tool.is-sharing:hover:not([disabled]) {
    background: var(--cim360-primary-surface-strong);
    border-color: var(--cim360-primary-dark);
    color: #fff;
}

.c360-dash-tool.is-locked { opacity: .45; cursor: not-allowed; }

/* =====================================================================================
   Shared dashboard chrome lifted from the Inventory page (DEV-670): the page title, count
   pill and "as at" stamp, the scope bar's picker popovers, and the breakdown dialogs. Class
   names are unchanged. The scoped sheet gave .dash-ctl-btn / .dash-reset-btn an attribute
   selector's extra weight over the shared .c360-btn; the .c360-btn. prefix keeps that.
   ===================================================================================== */

.dash-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 0.625rem;
    min-width: 0;
}

.dash-pagetitle {
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--cim360-text-strong);
    letter-spacing: -.01em;
    white-space: nowrap;
}

.dash-count {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cim360-primary);
    background: var(--cim360-primary-soft);
    padding: 2px 0.5625rem;
    border-radius: 62.4375rem;
    white-space: nowrap;
    align-self: center;
}

/* Freshness stamp. Deliberately quieter than .dash-count — it is context for the
   figures, not one of them, and should not compete with the SKUs-in-scope pill. */
.dash-asat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--cim360-text-muted);
    white-space: nowrap;
    align-self: center;
}

.dash-asat .bi {
    font-size: 0.75rem;
    opacity: .8;
}

/* Scope pickers — solid brand-blue pills, matching the Inventory List toolbar */

.dash-ctl {
    position: relative;
    flex: 0 0 auto;
}

/* Layout only. The height, padding, colour, radius and type all come from the shared .c360-btn
   in css/forms/cim360-form-grid.css - restated here, this screen's controls drift from every
   other page button the moment one of them changes. Carried over from develop, where bfdb2e7e
   reduced this rule to its shadow; the rewrite above had not seen that sweep. */
.c360-btn.dash-ctl-btn {
    box-shadow: 0 1px 2px color-mix(in srgb, var(--cim360-primary) 25%, transparent);
}

.c360-btn.dash-ctl-btn:hover:not([disabled]) {
    background: var(--cim360-primary-surface-hover);
    border-color: var(--cim360-primary-hover);
}

.c360-btn.dash-ctl-btn > i {
    font-size: 0.75rem;
    color: #fff;
    flex: 0 0 auto;
}

.dash-ctl-caret {
    font-size: 0.75rem !important;
    opacity: .85;
    margin-left: 1px;
}

.dash-ctl-val {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 10.625rem;
}

.c360-btn.dash-reset-btn[disabled] {
    opacity: .4;
    cursor: default;
}

/* Popover list */

.dash-pop-backdrop {
    position: fixed;
    inset: 0;
    z-index: 19;
    background: transparent;
    border: 0;
    cursor: default;
}

.dash-pop {
    position: absolute;
    top: calc(100% + 0.375rem);
    right: 0;
    z-index: 20;
    min-width: 13.125rem;
    white-space: nowrap;
    background: var(--cim360-card);
    border: 1px solid var(--cim360-border);
    border-radius: 0.5rem;
    box-shadow: 0 0.75rem 1.875rem rgba(15, 23, 42, .16);
    padding: 0.375rem;
}

/* Sentence case and --cim360-caption, carried over from develop's bfdb2e7e: the picker's heading
   is a caption, and --cim360-text-muted is the AA-only token that sweep replaced. The rewrite
   above predates it. */
.dash-pop-head {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--cim360-caption);
    padding: 0.375rem 0.5rem 0.25rem;
}

.dash-pop-item {
    display: flex;
    align-items: center;
    gap: 0.5625rem;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0.4375rem 0.5rem;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 0.7813rem;
    color: var(--cim360-text);
    cursor: pointer;
    text-align: left;
}

.dash-pop-item:hover { background: var(--cim360-primary-soft); }

.dash-pop-item.on { font-weight: 700; }

.dash-pop-item .trail {
    margin-left: auto;
    color: var(--cim360-primary);
}

.dash-ctl-lead {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    flex: 0 0 auto;
}

.dash-ctl-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 0.1875rem;
    flex: 0 0 auto;
}

/* The dashboard grid, its card chrome and the bar and item rows that were here went to the shared
   dashboard components with DEV-419. Their deletion left a comment with no close here, which
   kept an @media (min-width: 900px) open for every scoped stylesheet bundled after this one -
   the bin tree, among others, lost all its layout below 900px. */

/* ---------- Empty state / footnote ---------- */

.dash-empty {
    text-align: center;
    color: var(--cim360-text-muted);
    font-size: 0.7813rem;
    padding: 1.625rem 0.625rem;
}

.dash-empty .ic {
    font-size: 1.5rem;
    color: var(--cim360-success);
    display: block;
    margin-bottom: 0.375rem;
}

/* ---------- Breakdown overlays ---------- */

.dcat-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(15, 23, 42, .46);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.125rem 1.25rem;
    animation: dashOverlayFade var(--cim360-motion-base) var(--cim360-ease-out);
}

@keyframes dashOverlayFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dcat-modal {
    /* Positioned so it stacks above .c360-dlg-backdrop, which is absolutely placed behind it. */
    position: relative;
    z-index: 1;
    width: min(55rem, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: var(--cim360-card);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1.5rem 3.75rem rgba(15, 23, 42, .34), 0 0.25rem 0.875rem rgba(15, 23, 42, .18);
    animation: dashOverlayPop var(--cim360-motion-slow) var(--cim360-ease-out);
}

@keyframes dashOverlayPop {
    from { opacity: 0; transform: translateY(0.5rem) scale(.985); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .dcat-overlay, .dcat-modal { animation: none; }
}

.dcat-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.125rem;
    background: var(--cim360-headerband-bg);
    position: relative;
    z-index: 2;
    box-shadow: 0 0.375rem 0.875rem -0.25rem rgba(15, 23, 42, .18), 0 2px 0.25rem rgba(15, 23, 42, .10), inset 0 -1px 0 color-mix(in srgb, var(--cim360-headerband-fg) 10%, transparent);
}

.dcat-head-dot {
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 0.25rem;
    flex: 0 0 auto;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--cim360-headerband-fg) 50%, transparent);
}

.dcat-head-dot.round { border-radius: 50%; }

.dcat-head-ic {
    width: 2.125rem;
    height: 2.125rem;
    border-radius: 0.5rem;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .135);
}

.dcat-head-text {
    min-width: 0;
    flex: 1;
}

.dcat-head-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--cim360-headerband-fg);
    letter-spacing: -.01em;
}

.dcat-head-sub {
    font-size: 0.75rem;
    /* Full strength: small text has no headroom to fade on the band (85% measured 3.98:1 against 4.5:1),
       so the figures in it stand out by weight (the bold below), not by the rest being dimmer. */
    color: var(--cim360-headerband-fg);
    margin-top: 2px;
}

.dcat-head-sub b {
    color: var(--cim360-headerband-fg);
    font-weight: 800;
}

.dcat-close {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 0.25rem;
    border: 0;
    background: rgba(0, 0, 0, .135);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--cim360-motion-fast) var(--cim360-ease-out);
}

.dcat-close:hover { background: rgba(0, 0, 0, .225); }

.dcat-close-x {
    font-size: 1.5rem;
    line-height: 1;
    font-weight: 400;
    display: block;
    transform: translateY(-1px);
}

.dcat-kpis {
    padding: 0.875rem 1.125rem 0.25rem;
}

.dcat-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.625rem 1.125rem 0.375rem;
}

.dcat-list {
    display: flex;
    flex-direction: column;
}

.dcat-row {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(6.875rem, 1fr) auto;
    align-items: center;
    gap: 0.875rem;
    padding: 0.5625rem 0.625rem;
    border-radius: 0.5rem;
    cursor: pointer;
    border-top: 1px solid var(--cim360-border-soft);
    transition: background-color var(--cim360-motion-fast) var(--cim360-ease-out);
}

.dcat-row:first-child { border-top: 0; }

.dcat-row:nth-child(even) { background: color-mix(in srgb, var(--cim360-primary) 5%, transparent); }

.dcat-row:hover { background: color-mix(in srgb, var(--cim360-primary) 11%, transparent); }

.dcat-row:focus-visible {
    outline: 2px solid var(--cim360-primary);
    outline-offset: -2px;
}

.dcat-id { min-width: 0; }

.dcat-code {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--cim360-primary);
}

.dcat-desc {
    display: block;
    font-size: 0.7813rem;
    color: var(--cim360-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}

.dcat-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
    margin-top: 0.1875rem;
}

.dcat-health {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex: 0 0 auto;
}

.dcat-sep { opacity: .5; }

.dcat-bar {
    height: 0.875rem;
    background: var(--cim360-border-soft);
    border-radius: 0.3125rem;
    overflow: hidden;
}

.dcat-bar-fill {
    height: 100%;
    border-radius: 0.3125rem;
    min-width: 0.1875rem;
}

.dcat-val {
    text-align: right;
    white-space: nowrap;
    min-width: 6.5rem;
}

.dcat-val .v {
    font-size: 0.8125rem;
    font-weight: 800;
    color: var(--cim360-text);
}

.dcat-val .p {
    font-size: 0.75rem;
    color: var(--cim360-text-muted);
}

.dcat-foot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.125rem;
    background: var(--cim360-headerband-bg);
    position: relative;
    z-index: 2;
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--cim360-headerband-fg) 10%, transparent), 0 -0.375rem 0.875rem -0.25rem rgba(15, 23, 42, .18);
}

.dcat-foot-note {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--cim360-headerband-fg);
}

.dcat-foot-note i { color: var(--cim360-headerband-fg); }

.dcat-foot-link {
    margin-left: auto;
    border: 1px solid color-mix(in srgb, var(--cim360-headerband-fg) 45%, transparent);
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, .113);
    color: var(--cim360-headerband-fg);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3125rem 0.625rem;
    cursor: pointer;
    transition: background-color var(--cim360-motion-fast) var(--cim360-ease-out);
}

.dcat-foot-link:hover { background: rgba(0, 0, 0, .225); }

/* The Live/Trend/Table switch (DEV-418) that used to live here moved to shell chrome in
   wwwroot/css/dashboards/cim360-dashboard.css: it now sits in the tile head beside the pop-out
   button rather than inside this module's own Body, since choosing how to look at a tile is the
   shell's job, exactly as choosing its size already is. */

