﻿/* HUB portal - host-specific overrides.
   ------------------------------------------------------------------------------------------------
   The shared shell stylesheet loads FIRST:
   _content/SeamlessRewards.Portal.Shell/css/portal.css (SeamlessRewards.Portal.Shell package).

   This file is DELIBERATELY large and that is correct: only 4 of its 122 rule blocks duplicated the
   shell (removed 2026-09-07, plan 2.2). The rest is genuinely hub-only - merchant hovercards and
   tiles, dropzones, phone inputs, grid/skeleton loading states, rich-text grid cells. Hub is the
   model for what a host stylesheet should look like; CLO by contrast was a 100% fork of portal.css.

   Promoting these rules into the shell would push host concerns INTO the shared library, the
   opposite of the consolidation exercise - see plan 2.6. Revisit only if a second portal grows the
   same components.

   Hub declares NO brand palette: colours come from the Ent Design System tokens in portal.css
   (--rz-*, --sr-*), so light/dark theming follows the shell. Use var(--...) tokens, not hex. */

/* Hub portal host stylesheet.

   WHY THIS FILE EXISTS, and why these rules are NOT in a *.razor.css isolation file:
   the shared portal shell's App.razor links exactly three stylesheets - Radzen's theme,
   _content/SeamlessRewards.Portal.Shell/css/portal.css, and then "app.css" (App.razor:23,29,30) -
   and it links app.css LAST deliberately, so equal-specificity host rules win over the shell's and
   each portal can rebrand (see App.razor:26-28). It does NOT link the Blazor CSS-isolation bundle
   ({AssemblyName}.styles.css): there is no <link> for it and no @Assets[...] reference anywhere in
   App.razor. Nothing in this solution loads that bundle, and for this project it is not even emitted
   to the build output.

   So a *.razor.css file in THIS project is dead weight - its rules never reach the browser. That is
   what happened to the two rule sets below: both were written into
   Components/Pages/Dashboard/Dashboard.razor.css and neither ever applied. The .gradient rule was
   previously diagnosed as failing because RadzenCard's root element does not carry the isolation
   scope attribute; that diagnosis was wrong (or rather, incomplete) - the whole isolated stylesheet
   was never loaded in the first place.

   The other two portals on the same shell both ship wwwroot/app.css
   (clo-api/EntertainmentCLO-Portal/wwwroot/app.css, onboard-api/EntertainmentONBOARD.Blazor/wwwroot/
   app.css). Hub was the only one missing it, so the shell's app.css link 404'd on every page load.

   Because this is a plain global stylesheet, ::deep is neither needed nor valid here - it is an
   isolation-only construct. Descendant selectors reach into Radzen's rendered markup directly. */

/* --- Total Sales "hero" KPI tile -------------------------------------------------------------- */
/* Dashboard.razor's Total Sales RadzenCard carries class="gradient" (RadzenCard passes its class
   through to its own root .rz-card element). It highlights the hero tile against the other KPI tiles,
   using the shell's primary tokens. */
.gradient {
    background: linear-gradient(to bottom right, var(--rz-primary-light), var(--rz-primary));
    color: var(--sr-on-brand);
}

/* Everything inside the gradient card must be white: .gradient sets color on the card itself, but
   Radzen's own text styles (.rz-text-h6 and friends) each set their own colour from the theme token,
   which overrides the inherited white and left the "Total Sales" heading dark on the gradient.
   Enumerated deliberately rather than using ".gradient *" - the Dashboard's gradient tile also
   contains a RadzenDropDown, and forcing white on every descendant would make its trigger text
   invisible against the control's own light background. */
.gradient .rz-text-h1,
.gradient .rz-text-h2,
.gradient .rz-text-h3,
.gradient .rz-text-h4,
.gradient .rz-text-h5,
.gradient .rz-text-h6,
.gradient .rz-text-subtitle1,
.gradient .rz-text-subtitle2,
.gradient .rz-text-body1,
.gradient .rz-text-body2,
.gradient .rz-text-caption,
.gradient .merchant-total-sales-value,
.gradient .merchant-total-sales-delta,
.gradient .merchant-total-sales-delta .rzi,
.gradient .merchant-total-sales-delta i {
    color: var(--sr-on-brand);
}

/* --- Equal-height dashboard panels with inner scroll ------------------------------------------ */
/* Offer Categories, Logs and Total Success Fees are one RadzenRow of three SizeMD="4" columns, but
   each RadzenCard sizes to its own content, so a long category list or a growing log feed leaves the
   row ragged beside Total Success Fees' fixed-size widget.

   Total Success Fees is the REFERENCE panel: the other two are sized to match it, and it has no
   inner scroll container of its own (see Dashboard.razor) because by definition it must never
   scroll. 420px is set against that panel's computed natural height of ~376px (40px RadzenCard
   padding + ~46 heading + ~36 amount + ~34 caption + the chart's explicit 220px; Radzen's
   clamp()-based heading size makes this an estimate, not a pixel-exact reading). The deliberate
   ~44px of headroom means theme, zoom or line-height variance cannot push the reference panel past
   its own fixed height and give IT a scrollbar - the inverse of what was asked for. Tune here; it is
   the single source of the value.

   .dash-panel is our own wrapper div around each RadzenCard, authored in Dashboard.razor. */
.dash-panel {
    --dash-panel-height: 420px;
}

.dash-panel .rz-card {
    height: var(--dash-panel-height);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Equal-height row where the cards size to the TALLEST sibling ------------------------------ */
/* Used by the Sales Reports + Activity row (Dashboard.razor). Unlike .dash-panel above, there is no
   fixed pixel height here: RadzenRow renders a flex row whose columns already stretch to the tallest
   sibling, so all this needs to do is make the RadzenCard fill its column instead of shrink-wrapping
   its own content. The taller card (Sales Reports, whose chart has an explicit height) therefore sets
   the row height, and the shorter one (Activity) grows to match rather than leaving a ragged edge.

   Pair this with .dash-panel-scroll on whichever child can overflow - that is what turns "grew to
   match" into "grew to match, and scrolls internally when there are more entries than fit". */
.dash-equal-row > div {
    display: flex;
}

.dash-equal-row .rz-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Fills whatever space the fixed heading above it leaves inside the fixed-height card. min-height:0
   is load-bearing: without it this flex item's default min-height:auto is content-based, so it
   refuses to shrink and the card overflows instead of scrolling internally. overflow-y:auto shows a
   scrollbar only when the content actually exceeds the space. Applied to Offer Categories and Logs
   only - the two panels that genuinely can overflow. */
.dash-panel-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

/* --- Log / activity feed rows ----------------------------------------------------------------- */
/* Dashboard.razor's Logs and Activity panels render one row per entry as "message ... timestamp".
   With both halves at the same size and weight the timestamp competes with the message for
   attention, and a column of full-size timestamps reads as a second content column rather than as
   metadata. These rules keep the message as the primary text and demote the timestamp to smaller,
   lighter, non-wrapping metadata pinned to the right. */
.log-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.log-row-message {
    min-width: 0;
    overflow-wrap: anywhere;
}

.log-row-time {
    flex: 0 0 auto;
    font-size: 0.75rem;
    line-height: 1.2;
    opacity: 0.65;
    white-space: nowrap;
}

/* --- Merchant detail profile card ------------------------------------------------------------- */
/* Reproduces hub Angular's own profile card shape (merchant-details.component.html's
   .card.hovercard.text-center, styled in src/assets/scss/theme/_user-profile.scss): a full-bleed
   banner strip across the top, the logo centred and overlapping the bottom of it, and the Edit
   affordance as a small circular icon button beside the logo.

   Numbers are taken from that stylesheet rather than invented: banner 470px, dropping to 350px then
   300px at Angular's own two breakpoints (_responsive.scss); avatar 125x125 with a 7px white ring
   pulled up by -100px; the icon wrapper 40x40, circular, white, with the same soft shadow. */
.merchant-hovercard {
    /* RadzenCard pads its own root, which would inset the banner - the banner must be full-bleed,
       so the padding moves onto .merchant-info below instead. */
    padding: 0;
    overflow: hidden;
    text-align: center;
}

/* 300px flat. Angular's ladder was 470 / 350 / 300 across its two breakpoints, but 470 filled most
   of the viewport before any merchant detail was reachable, so this takes Angular's own smallest
   value at every width - which also makes the two step-down media queries redundant. Single source
   of the value; change it here. */
.merchant-cardheader {
    height: 300px;
    background-color: var(--rz-base-300, #e9ecef);
    background-size: cover;
    background-position: 10%;
}

/* FIX (2026-08-31): this strip used to be height:0 with a margin-top:-100px avatar, copying the
   Angular rule literally. That margin COLLAPSED through the zero-height parent, shifting the parent -
   and therefore everything after it - up by 100px, so the whole info block rendered on top of the
   banner image instead of below the logo.

   Positioning the avatar absolutely removes margin-collapsing from the picture entirely and makes the
   overlap explicit: the avatar is 139px tall (125 + 2x7 ring), centred, and sits half above this
   strip's top edge (= the banner's bottom edge) and half below it. The strip then reserves that lower
   half as real layout height, so .merchant-info starts cleanly underneath. */
.merchant-user-image {
    /* The avatar is 139px tall (125 + 2x7 ring). It sits mostly OVER the banner: 95px above this
       strip's top edge (= the banner's bottom edge), leaving 44px below, which is all this strip
       needs to reserve. Raising the overlap is a one-line change - keep the two numbers summing to
       139 so the identity block still starts flush under the logo. */
    position: relative;
    height: 44px;
}

.merchant-avatar {
    position: absolute;
    top: -95px;
    left: 50%;
    transform: translateX(-50%);
}

.merchant-avatar img {
    width: 125px;
    height: 125px;
    object-fit: cover;
    border-radius: 50%;
    border: 7px solid #fff;
    display: block;
}

/* Just right of centre and just below the banner edge - the same spot Angular's own
   "left:51%; bottom:-20px" puts it, i.e. over the avatar's lower-right quadrant. */
.merchant-icon-wrapper {
    /* Tucked into the avatar's lower-right quadrant - it should read as attached to the logo, not
       floating beside it. Negative top keeps it on the avatar now that the avatar rides higher. */
    position: absolute;
    top: -26px;
    left: calc(50% + 30px);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    color: var(--rz-text-color, #212529);
    cursor: pointer;
    overflow: hidden;
    font-size: 17px;
    text-decoration: none;
    box-shadow: 0 0 6px 3px rgba(68, 102, 242, 0.1);
}

.merchant-icon-wrapper:hover {
    background-color: var(--rz-base-200, #f8f9fa);
}

.merchant-info {
    padding: 30px;
    /* The avatar already provides the visual break from the banner; a full 30px on top of it read as
       too much space between the logo and the merchant name. */
    padding-top: 12px;
}

/* Muted, label-sized, and aligned with the label text it prefixes - matching Angular, which puts a
   Font Awesome icon inside each field's own <h6> heading (fa-envelope / fa-calendar / fa-phone /
   fa-location-arrow; the Material equivalents are used here since that is this portal's icon set). */
.merchant-field-icon {
    font-size: 1rem;
    line-height: 1;
    vertical-align: text-bottom;
    margin-right: 0.35rem;
    opacity: 0.7;
}

.merchant-identity-status {
    margin-top: 0.5rem;
}

/* The identity block (trading name, legal name, status pill) is centred under the avatar; the
   flanking field columns keep their content left-aligned, as Angular's .ttl-info.text-left does. */
.merchant-identity {
    text-align: center;
}

.merchant-info-side {
    text-align: left;
}

/* Labels are metadata, so they are lighter and smaller than the values they head - the previous
   version inherited the same weight as the value and competed with it. */
.merchant-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 400;
    opacity: 0.6;
    margin-bottom: 0.15rem;
}

/* Word wrap: these values are user data (long emails, multi-part locations) in narrow half-columns,
   so they must break rather than overflow their column or force the row wider. overflow-wrap:anywhere
   breaks mid-token when there is no space to break at - which is exactly the long-email case. */
.merchant-field-value {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

/* --- Data grid header alignment --------------------------------------------------------------- */
/* Goal: numeric columns whose HEADING is centred but whose VALUES stay right-aligned. Radzen 11.1.6
   has no HeaderTextAlign - TextAlign moves both together.

   Two earlier attempts at this failed, both times by trying to out-CSS the header:
     1. The first used .rz-datatable as the ancestor. Radzen renders .rz-grid-table, so it never
        matched at all.
     2. The second matched, but Radzen's own right-align rule is
        ".rz-grid-table thead th.rz-text-align-right .rz-column-title{justify-content:right}" -
        (0,3,2), IDENTICAL specificity to the override, so the two just fought.

   So this does the opposite and lets Radzen own the header: the column declares
   TextAlign="Center" (Radzen's native centring, header and cells) and the cells are pushed back to
   the right with a column CssClass. Cell alignment is plain text-align on a <td> - no flex container
   and no competing framework rule - which is why this direction is stable where the other was not.

   !important is load-bearing here and is NOT laziness: Radzen writes the alignment as an INLINE
   style on the cell - `<td style="text-align:center;" class="cell-align-right">` - and an inline
   style beats any stylesheet selector regardless of specificity. !important is the only lever that
   overrides it. TransactionGridAlignmentTests pins both halves against the real rendered markup.

   Verified in the running app via DevTools: the Total heading measures 63px of slack on each side of
   its label, and its cells compute text-align:right despite that inline style.

   The heading needs BOTH TextAlign="Center" and HeaderCssClass="grid-header-center" below. That
   measurement was taken with the HeaderCssClass override present, so it does NOT prove Radzen's
   native centring is sufficient on its own - an earlier attempt to drop the override on that
   reasoning was a mis-inference and was reverted. If you want to remove it, verify the heading in a
   real browser with the override absent FIRST; the bUnit tests cannot see computed style. */
.rz-grid-table thead th.grid-header-center .rz-column-title,
th.grid-header-center .rz-column-title {
    justify-content: center !important;
}

.rz-grid-table thead th.grid-header-center .rz-column-title-content,
th.grid-header-center .rz-column-title-content {
    text-align: center !important;
}

.rz-grid-table tbody td.cell-align-right,
.rz-grid-table tbody td.cell-align-right .rz-cell-data {
    text-align: right !important;
    justify-content: flex-end;
}

/* The merchant-detail edit affordance is an <a> but reads as an icon button, not a link.

   The colour is a FIXED dark value, deliberately not var(--rz-text-color): that token flips to light
   grey (#e0e0e0) under the dark theme, and this button's circle is hardcoded white in both themes
   (matching the avatar's white ring, as Angular has it) - so the token produced #e0e0e0 on #fff,
   measured at 1.32:1 and effectively invisible. A white puck needs a dark glyph regardless of theme.
   The fixed #212529 is kept because the puck is white in both themes, so the glyph must stay dark in
   both; there is no longer a specificity war with a theme token to resolve. */
.merchant-icon-wrapper {
    color: #212529;
}

/* --- Merchant list summary widgets ------------------------------------------------------------- */
/* Angular's merchant-list.component.html puts the four COUNT widgets in a 2x2 block filling the left
   half of the row, with Total Sales alone on the right half as a gradient "headline" card. These
   rules reproduce that, and make the two halves end flush.

   The row is flex (RadzenRow), so its two columns already stretch to the taller one. What the grid
   below adds is the guarantee that the four tiles SPLIT that height evenly (two 1fr rows) instead of
   each shrink-wrapping its own content and leaving the block short of the card beside it. */
.merchant-widgets > div {
    display: flex;
}

.merchant-tile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1rem;
    width: 100%;
}

/* Icon left, label above value on the right - Angular's .media.static-top-widget shape. */
.merchant-tile.rz-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
}

.merchant-tile-icon {
    font-size: 2.25rem;
    color: var(--rz-primary);
    flex: 0 0 auto;
}

.merchant-tile-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.merchant-tile-label {
    font-size: 0.8125rem;
    opacity: 0.7;
    line-height: 1.2;
}

.merchant-tile-value {
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.15;
}

/* The headline card: same .gradient treatment as the Dashboard's Total Sales tile, with the figure
   set larger than any tile value so it dominates the row rather than matching them. */
.merchant-total-sales.rz-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.merchant-total-sales-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
}

.merchant-total-sales-delta {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Stacked below LG, where the 2x2 sits above the headline card - neither should be forced to fill a
   height the other set, so the grid rows go back to content height. */
@media (max-width: 991px) {
    .merchant-tile-grid {
        grid-template-rows: auto auto;
    }
}

/* --- Wrapping grid cells ----------------------------------------------------------------------- */
/* Radzen truncates cell text with an ellipsis by default (.rz-cell-data carries .rz-text-truncate,
   which is white-space:nowrap + overflow:hidden + text-overflow:ellipsis). For a column holding a
   long name that is the whole point of the row - a merchant's trading or legal name - that hides the
   tail. Hang this off a column's CssClass to let it wrap onto a second line instead.

   Both the <td> and Radzen's inner span need it: the span is what carries .rz-text-truncate, so
   overriding only the cell leaves the truncation in place. */
.rz-grid-table tbody td.grid-cell-wrap,
.rz-grid-table tbody td.grid-cell-wrap .rz-cell-data {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* --- Separation below a page's summary widgets -------------------------------------------------- */
/* The results caption and search box sat tight under the summary tiles, so the two groups read as
   one block. This gives the summary row a wider gap beneath it than the standard rz-mb-3 (1rem),
   marking the boundary between "page totals" and "the list and its controls". */
.merchant-widgets {
    margin-bottom: 2.25rem;
}

/* --- "opens in a new tab" affordance ------------------------------------------------------------ */
/* Postfix icon on an external link, matching Angular's trailing "fa fa-external-link". Sized down
   and nudged up so it reads as a marker on the label rather than a second glyph competing with it;
   inherits the link colour, so it tracks the light/dark link rules above automatically. */
.link-external-icon {
    font-size: 0.9375rem;
    line-height: 1;
    vertical-align: -2px;
    margin-left: 0.25rem;
    color: inherit;
}

/* ---------------------------------------------------------------------------------------------------
   File drop zones (Components/Shared/FileDropZone.razor) - the dashed drop target Angular shows for
   every media upload (.dropzone / .dz-message, merchant-create.component.html:291-306).

   GREY rather than Angular's blue, at Mike's request. The palette is theme tokens where one exists so
   the zone tracks light/dark with the rest of the shell, with literal greys only for the dashed border
   and the tinted fill (no token carries "subtle inset surface").

   The input is stretched over the whole panel at opacity 0 - that is what makes both the drop and the
   click work with no JS at all (see the component's own remarks). It must stay ABOVE the icon/label in
   the stacking order or the text would swallow the pointer, hence position:relative on the children. */
.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-height: 130px;
    padding: 1.25rem 1rem;
    border: 2px dashed var(--sr-ink-3);
    border-radius: 8px;
    background: var(--rz-base-200);
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone:hover,
/* :focus-within covers keyboard users - the invisible input is what actually takes focus, so the
   visible affordance has to come from its parent. */
.dropzone:focus-within {
    border-color: var(--sr-ink-2);
    background: var(--rz-base-300);
}

.dropzone-icon {
    font-size: 2.25rem;
    line-height: 1;
    color: var(--sr-ink-4);
}

.dropzone-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--sr-ink-1);
}

.dropzone-hint {
    font-size: 0.8125rem;
    color: var(--sr-ink-2);
}

.dropzone-icon,
.dropzone-label,
.dropzone-hint {
    position: relative;
    z-index: 0;
}

/* Fills the panel so a drop anywhere inside registers. z-index beats the labels above; opacity 0
   rather than visibility/display because a hidden input accepts neither drops nor focus. */
.dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.dropzone-disabled {
    opacity: 0.6;
}

.dropzone-disabled .dropzone-input {
    cursor: not-allowed;
}

/* Narrows a drop zone to half the row so a zone sitting in a full-width column still lines up with the
   half-width columns beside/above it (MerchantMediaSection's Banners zone under Logo/Video). Uses the
   same 768px breakpoint Radzen's own SizeMD columns collapse at, so the zone goes full width exactly
   when the columns above it stack. */
.dropzone-half {
    max-width: calc(50% - 0.5rem);
}

@media (max-width: 768px) {
    .dropzone-half {
        max-width: 100%;
    }
}

/* ---------------------------------------------------------------------------------------------------
   Paired field: a narrow qualifier select butted against the value it qualifies, so the two read as ONE
   labelled control. Used by the merchant form's "Business Registration" (ABN/NZBN + number). The phone
   field below is the same idea with a third element (the validity icon), kept separate because its
   select is a different width. */
.paired-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.paired-field-select {
    flex: 0 0 7rem;
    min-width: 7rem;
}

.paired-field-value {
    flex: 1 1 auto;
    min-width: 0; /* Without this the input's intrinsic width wins and overflows the flex row. */
}

/* ---------------------------------------------------------------------------------------------------
   Phone field with country selector (Components/Shared/PhoneNumberInput.razor) - Angular's
   ngx-intl-tel-input with separateDialCode: a narrow dial-code select butted against the number box so
   the two read as ONE control, then the validity icon. */
.phone-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

/* Wide enough for the longest "XX +NNN" label without stealing room from the number itself. */
.phone-input-region {
    flex: 0 0 8.5rem;
    min-width: 8.5rem;
}

.phone-input-number {
    flex: 1 1 auto;
    min-width: 0; /* Without this the input's intrinsic width wins and overflows the flex row. */
}

.phone-input-valid {
    color: #2e7d32;
    flex: 0 0 auto;
}

.phone-input-invalid {
    color: #b26a00;
    flex: 0 0 auto;
}

.phone-input-hint {
    display: block;
    color: #b26a00;
}

:root:not([data-theme="light"]) .phone-input-valid,
:root[data-theme="dark"] .phone-input-valid {
    color: #81c784;
}

:root:not([data-theme="light"]) .phone-input-invalid,
:root[data-theme="dark"] .phone-input-invalid,
:root:not([data-theme="light"]) .phone-input-hint,
:root[data-theme="dark"] .phone-input-hint {
    color: #ffb74d;
}

/* ---------------------------------------------------------------------------------------------------
   Required-field marker and failed-validation highlight on form fields (MerchantForm and friends).

   The highlight is on the .filters-field WRAPPER, not the input: Radzen's inputs are not
   InputBase-derived, so Blazor's usual .invalid class never lands on them (see MerchantForm's
   FieldClass). The border is drawn on the wrapper's direct child controls instead, which is what makes
   it read as "this control is wrong" rather than "this whole block is wrong". */
.field-required {
    color: var(--sr-error);
    font-weight: 700;
    margin-left: 0.125rem;
    cursor: help;
}

.field-invalid > label {
    color: var(--sr-error);
}

/* Radzen renders each control as a wrapper div/span carrying one of these classes. Colour ONLY - no
   layout properties - so switching a field to invalid never shifts anything on the page. */
.field-invalid .rz-textbox,
.field-invalid .rz-dropdown,
.field-invalid .rz-autocomplete,
.field-invalid .rz-html-editor {
    border-color: var(--sr-error) !important;
    box-shadow: 0 0 0 1px var(--sr-error);
}

/* The validation message itself, which Blazor renders as .validation-message. */
.field-invalid .validation-message,
.validation-message {
    display: block;
    color: var(--sr-error);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.form-required-legend {
    display: block;
    margin-bottom: 0.75rem;
}

/* ---------------------------------------------------------------------------------------------------
   Badges (status pills) inside a .filters-field.

   The shell's portal.css defines .filters-field as `display: flex; flex-direction: column`, whose
   default align-items is `stretch` - so a pill placed directly in one is stretched to the full width
   of the card instead of hugging its own text. align-self pulls it back to its content width without
   touching the label above it. The RadzenStack case covers the pills that sit beside a tooltip icon
   (offer status), where the STACK is the stretched child rather than the badge itself. */
.filters-field > .rz-badge,
.filters-field > .rz-stack {
    align-self: flex-start;
}

/* ---------------------------------------------------------------------------------------------------
   Grid responsiveness after per-column widths.

   Fixed Width="NNNpx" columns put Radzen's table into a fixed layout: the columns stop absorbing or
   yielding space, so on a narrow viewport the table is simply wider than its container and used to push
   the whole page sideways. Two complementary fixes:

     1. Responsive="true" on the grids themselves (see each .razor) - below Radzen's breakpoint each row
        collapses into a stacked label/value card, where column widths no longer apply at all.
     2. This rule, for the MID-RANGE widths where it is still a real table but wider than the space it
        has: the overflow is contained and scrolls WITHIN the grid, instead of widening the document.

   -webkit-overflow-scrolling keeps the inner scroll feeling native on touch devices. */
/* CORRECTION (2026-08-31): this used to put `overflow-x: auto` on .rz-data-grid itself. That was both
   redundant and harmful. Redundant because Radzen already scrolls the table through its inner
   .rz-data-grid-data { overflow: auto }; harmful because .rz-data-grid is the positioning context for
   the loading overlay (.rz-datatable-loading / -loading-content, both position:absolute), and an
   overflow value other than visible turns the element into a clipping container - which clipped BOTH
   the skeleton and Radzen's own spinner out of view. Constrain the width only; leave overflow to
   Radzen's inner scroller. */
.rz-data-grid,
.rz-datatable {
    max-width: 100%;
}

/* MinWidth columns are the ones meant to absorb slack; a fixed table layout would ignore that, so the
   table is left auto-laid-out and the widths act as hints rather than hard sizes. */
.rz-data-grid .rz-grid-table {
    table-layout: auto;
}

/* In Radzen's stacked (responsive) mode a cell becomes a label/value row, so the fixed widths and the
   right-alignment overrides that suit a table would look wrong. Neutralise them there. */
@media (max-width: 768px) {
    .rz-data-grid .rz-grid-table tbody td.cell-align-right {
        text-align: left !important;
    }
}

.stat-tile-figure {
    min-width: 0;
}

.stat-tile-row .stat-tile-spark {
    flex: 0 1 auto;
}

/* Below the card breakpoint the tiles are already narrow; the decoration is the first thing to go. */
@media (max-width: 480px) {
    .stat-tile-row .stat-tile-spark {
        display: none;
    }
}

/* ---------------------------------------------------------------------------------------------------
   Skeleton loading (Shared/GridSkeleton.razor, Shared/TileSkeleton.razor) - replaces the small spinner
   Radzen renders in a grid header, and the blank/"-" state on the summary tiles.

   Angular does the same thing on its grids (ten empty <tr class="loading"> rows), and a skeleton is the
   better signal regardless: it reserves the space the content is about to occupy, so nothing jumps when
   the data lands, and it hints at how much is coming. */

/* No screen-reader-only utility exists in the shell, so define one here. Kept to the standard clip-rect
   pattern rather than display:none, which would hide it from assistive tech too - the whole point is
   that the loading state IS announced while the bars themselves stay aria-hidden. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.grid-skeleton {
    padding: 0.5rem 0;
}

/* Radzen's loading overlay is built for a SPINNER: .rz-datatable-loading-content is absolutely
   positioned at 50%/50% and pulled back with translate(-50%, -50%), so it hugs a small centred icon.
   Row placeholders need the opposite - they have to span the grid body so they read as rows rather
   than as a floating panel. :has() lets the overlay respond to what was actually put inside it, so the
   spinner keeps its centred treatment on every other grid.

   :has() is supported by Chrome/Edge 105+, Safari 15.4+ and Firefox 121+ - fine for an internal admin
   tool. The fallback if it is ever unsupported is the ORIGINAL centred box: the skeleton still renders
   and is still visible, just narrower - degraded, not broken. .grid-skeleton's own min-width below is
   what guarantees that. */
.rz-datatable-loading-content:has(.grid-skeleton) {
    position: absolute;
    inset: 0;
    left: 0;
    top: 0;
    transform: none;
    width: 100%;
    /* The shell paints the spinning crown on this container for plain grids; the skeleton replaces
       it here, so cancel the spin and the 36x29 crown box. */
    height: 100%;
    margin: 0;
    animation: none;
    overflow: hidden;
    background: var(--rz-base-background-color, #fff);
}

/* The dim backdrop makes sense behind a spinner (it says "the content underneath is stale"), but the
   skeleton IS the content, so the wash just muddies it. */
.rz-data-grid:has(.grid-skeleton) .rz-datatable-loading {
    opacity: 0;
}

.grid-skeleton {
    min-width: 20rem;
    width: 100%;
}

:root:not([data-theme="light"]) .rz-datatable-loading-content:has(.grid-skeleton),
:root[data-theme="dark"] .rz-datatable-loading-content:has(.grid-skeleton) {
    background: var(--rz-base-background-color, #1e1e1e);
}

.grid-skeleton-row {
    display: flex;
    gap: 1rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--rz-base-300, #e0e0e0);
}

.grid-skeleton-cell {
    flex: 1 1 0;
    min-width: 0;
}

.grid-skeleton-bar,
.tile-skeleton-bar {
    display: block;
    height: 0.75rem;
    border-radius: 4px;
    background: linear-gradient(90deg, #e8e8e8 25%, #f4f4f4 37%, #e8e8e8 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* Summary tiles: a tall bar for the figure, a short one for the label beneath it. */
.tile-skeleton-value {
    height: 2rem;
    width: 60%;
    margin-bottom: 0.5rem;
}

.tile-skeleton-label {
    height: 0.75rem;
    width: 40%;
}

/* A shimmer that never stops is exactly the kind of motion that triggers vestibular symptoms, and it
   conveys nothing a static placeholder does not. Hold it still when the viewer has asked for that. */
@media (prefers-reduced-motion: reduce) {
    .grid-skeleton-bar,
    .tile-skeleton-bar {
        animation: none;
        background: #e8e8e8;
    }
}

:root:not([data-theme="light"]) .grid-skeleton-bar,
:root:not([data-theme="light"]) .tile-skeleton-bar,
:root[data-theme="dark"] .grid-skeleton-bar,
:root[data-theme="dark"] .tile-skeleton-bar {
    background: linear-gradient(90deg, #3a3a3a 25%, #4a4a4a 37%, #3a3a3a 63%);
    background-size: 400% 100%;
}

:root:not([data-theme="light"]) .grid-skeleton-row,
:root[data-theme="dark"] .grid-skeleton-row {
    border-bottom-color: #3a3a3a;
}

@media (prefers-reduced-motion: reduce) {
    :root:not([data-theme="light"]) .grid-skeleton-bar,
    :root:not([data-theme="light"]) .tile-skeleton-bar,
    :root[data-theme="dark"] .grid-skeleton-bar,
    :root[data-theme="dark"] .tile-skeleton-bar {
        background: #3a3a3a;
    }
}

/* The Dashboard's four KPI tiles are centre-aligned, unlike the Payments/Transactions tiles which are
   left-aligned - so their skeleton bars have to be centred too, or the placeholder sits off to one side
   of the figure it is standing in for. */
.tile-skeleton-centered .tile-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Roughly the height the figure + delta caption occupy, so the card does not resize when the real
   values arrive. Reserving the space is half the reason to use a skeleton at all. */
.tile-skeleton-centered {
    padding-top: 0.5rem;
    min-height: 4.5rem;
}

/* ---------------------------------------------------------------------------------------------------
   Feed skeleton (Shared/FeedSkeleton.razor) - mirrors the .log-row shape the Activity and Logs panels
   use for real entries: message on the left, timestamp on the right. */
.feed-skeleton-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.55rem 0;
}

/* The message bar's OWN column, and the reason it exists: a percentage width on a flex item resolves
   against the whole row, so a bar at "92%" next to a fixed-width timestamp added up to more than the
   row could hold and the two collided. Nested here, the percentage is a share of the space left once
   the timestamp has taken its own - which is what it was always meant to mean. */
.feed-skeleton-message-col {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

/* Slimmer than the grid bars: a feed line is one line of body text, not a table cell. */
.feed-skeleton-message {
    height: 0.625rem;
}

/* Fixed and narrow - it stands in for a timestamp, which is always about the same length. */
.feed-skeleton-time {
    flex: 0 0 4rem;
    width: 4rem;
    height: 0.625rem;
}

/* Grouped feed skeleton (Activity): a heading placeholder followed by its entry rows. Shorter and
   heavier than a message bar so it reads as a heading - the real category names come from the response
   and cannot be known before it arrives. */
.feed-skeleton-group {
    margin-bottom: 1.5rem;
}

.feed-skeleton-group:last-child {
    margin-bottom: 0;
}

.feed-skeleton-heading {
    width: 5.5rem;
    height: 0.8rem;
    margin-bottom: 0.4rem;
}

/* --- Stored rich text inside a grid cell -------------------------------------------------------- */
/* The Recent Updates Description columns render merchant-authored HTML (sanitized - see
   RichTextSanitizer), which arrives wrapped in <p> tags. A <p>'s default 1em top/bottom margin makes
   a one-line description twice the height of every other row in the grid, and a trailing empty
   paragraph - common in rich-text editor output - adds a third line of nothing. Collapse the outer
   margins and keep only the gap BETWEEN paragraphs, so the cell is as tall as its text and no
   taller. Pair with CssClass="grid-cell-wrap" on the column for the wrapping itself. */
.grid-rich-text > :first-child {
    margin-top: 0;
}

.grid-rich-text > :last-child {
    margin-bottom: 0;
}

.grid-rich-text p {
    margin: 0 0 0.5rem;
}

/* Sanitized markup can still carry a link. Keep it visually a link, but never let a long URL push
   the column wider than its share of the grid. */
.grid-rich-text a {
    overflow-wrap: anywhere;
}
