/* Omni237 Admin Portal - App-specific styles */

/* Override SM360 brand colors for Omni237 */
:root {
    --sm360-tenant-primary: #00a99d;
    --sm360-tenant-secondary: #0f172a;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sm360-content div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

.omni237-context-switch-error {
    margin: 12px 16px;
}

/* ------------------------------------------------------------------
   Logo theming — show light or dark variant depending on active theme.
   ------------------------------------------------------------------ */
/* ------------------------------------------------------------------
   Brand: mark when sidebar collapsed, wordmark when expanded.
   Two axes:
     1. Light vs dark theme    (data-theme attribute)
     2. Collapsed vs expanded  (container query on .sm360-sidebar)
   ------------------------------------------------------------------ */

/* Sizing — fits inside SM360.UI's 56px sidebar header.
   The mark (icon shown when sidebar is collapsed) stays small so it
   doesn't overflow the narrow column. The wordmark (shown when expanded)
   uses nearly the full header height for visual presence — when the
   sidebar header isn't tall enough we override its min-height too. */
.omni237-logo { display: inline-flex; align-items: center; gap: 10px; }
.omni237-logo-mark { height: 32px; width: 32px; object-fit: contain; }
.omni237-logo-wordmark { height: 72px; width: auto; max-width: 240px; object-fit: contain; }

/* Give the sidebar header enough vertical room for the larger wordmark. */
.sm360-sidebar:hover .sm360-sidebar-header,
.sm360-sidebar.is-expanded .sm360-sidebar-header,
.sm360-sidebar[data-expanded="true"] .sm360-sidebar-header {
    min-height: 88px;
    height: auto;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* ------------------------------------------------------------------
   Sidebar contrast — SDK defaults render nav labels at ~20% opacity
   teal which is nearly invisible on the white sidebar in light mode
   and on the dark sidebar in dark mode. Override the relevant tokens
   so labels are readable in BOTH themes.
   ------------------------------------------------------------------ */

/* Light theme (default) — match the icon stroke colour (slate-500
   #64748b) so labels read at the same weight as icons, not heavier. */
:root {
    --sm360-sidebar-text: #64748b;          /* slate-500 — same as icons */
    --sm360-sidebar-hover: #334155;         /* slate-700 — one shade darker on hover */
    --sm360-sidebar-active: #00766c;        /* darker teal — keeps brand readable */
    --sm360-sidebar-active-bg: rgba(0, 169, 157, 0.10);
}

/* Dark theme override */
[data-theme="dark"] {
    --sm360-sidebar-text: #94a3b8;          /* slate-400 — same weight as icons */
    --sm360-sidebar-hover: #e2e8f0;
    --sm360-sidebar-active: #5eead4;        /* teal-300 — bright on dark */
    --sm360-sidebar-active-bg: rgba(94, 234, 212, 0.16);
}

/* Force the SDK to use these tokens (its built-in cascade picks
   transparent-teal otherwise). */
/* Keep the Portal's shared rail links comfortable to tap in either viewport. */
.omni-shell .sm360-nav-item {
    min-height: 44px;
}

.sm360-sidebar .sm360-nav-item {
    color: var(--sm360-sidebar-text) !important;
}
.sm360-sidebar .sm360-nav-item:hover {
    color: var(--sm360-sidebar-hover) !important;
}
.sm360-sidebar .sm360-nav-item.active {
    color: var(--sm360-sidebar-active) !important;
    background: var(--sm360-sidebar-active-bg) !important;
}
.sm360-sidebar .sm360-nav-item.active svg,
.sm360-sidebar .sm360-nav-item.active span {
    color: var(--sm360-sidebar-active) !important;
}

/* Labels must be visible whenever the sidebar is expanded — by hover
   OR by an explicit class/attribute. The SDK only handles :hover; we
   extend the rule. */
.sm360-sidebar.is-expanded .sm360-nav-item span,
.sm360-sidebar[data-expanded="true"] .sm360-nav-item span {
    opacity: 1 !important;
    width: auto !important;
    overflow: visible !important;
}

/* Step 1: hide every variant by default; rules below opt-in. */
.omni237-logo-mark,
.omni237-logo-wordmark { display: none !important; }

/* Step 2: light theme is the default. Show the LIGHT mark.
   The wordmark is then turned on by the wide-sidebar container query. */
.omni237-logo-mark.omni237-light-only { display: inline-block !important; }

[data-theme="dark"] .omni237-logo-mark.omni237-light-only { display: none !important; }
[data-theme="dark"] .omni237-logo-mark.omni237-dark-only { display: inline-block !important; }

/* Step 3: when the sidebar is hovered (= visually expanded — that's the
   SM360.UI convention) OR when the host marks it expanded explicitly,
   swap mark for wordmark. */
.sm360-sidebar:hover .omni237-logo-mark,
.sm360-sidebar.is-expanded .omni237-logo-mark,
.sm360-sidebar[data-expanded="true"] .omni237-logo-mark { display: none !important; }

.sm360-sidebar:hover .omni237-logo-wordmark.omni237-light-only,
.sm360-sidebar.is-expanded .omni237-logo-wordmark.omni237-light-only,
.sm360-sidebar[data-expanded="true"] .omni237-logo-wordmark.omni237-light-only { display: inline-block !important; }

[data-theme="dark"] .sm360-sidebar:hover .omni237-logo-wordmark.omni237-light-only,
[data-theme="dark"] .sm360-sidebar.is-expanded .omni237-logo-wordmark.omni237-light-only,
[data-theme="dark"] .sm360-sidebar[data-expanded="true"] .omni237-logo-wordmark.omni237-light-only { display: none !important; }

[data-theme="dark"] .sm360-sidebar:hover .omni237-logo-wordmark.omni237-dark-only,
[data-theme="dark"] .sm360-sidebar.is-expanded .omni237-logo-wordmark.omni237-dark-only,
[data-theme="dark"] .sm360-sidebar[data-expanded="true"] .omni237-logo-wordmark.omni237-dark-only { display: inline-block !important; }

/* ------------------------------------------------------------------
   Collapsed sidebar — hide all text content cleanly (truncation looks
   broken: "Head" instead of "Headquarters", "Setti" for "Settings").
   Targets BOTH the SM360.UI sidebar conventions AND the omni237 portal's
   StoreSwitcher to apply globally.
   ------------------------------------------------------------------ */

/* Container query: any sidebar narrower than 110px is treated as
   collapsed and ALL text nodes are hidden. Icons still render. */
.sm360-sidebar { overflow-x: hidden; container-type: inline-size; container-name: sm360sidebar; }

@container sm360sidebar (max-width: 110px) {
    /* SM360.UI labels */
    .sm360-sidebar .sm360-nav-label,
    .sm360-sidebar .sm360-nav-group-label,         /* group headings */
    .sm360-sidebar .sm360-sidebar-header-text,
    .sm360-sidebar .sm360-store-switcher-name,
    .sm360-sidebar .sm360-product-name,
    /* Omni237 portal StoreSwitcher classes (no sm360- prefix) */
    .sm360-sidebar .store-switcher,
    .sm360-sidebar .store-switcher-name,
    .sm360-sidebar .store-switcher-btn { display: none !important; }
}

/* Hard belt-and-braces: any text that DOES render must clip cleanly
   without ellipsis dangling. Applies to the SM360 + StoreSwitcher
   classes inside a narrow sidebar. */
.sm360-sidebar .sm360-nav-label,
.sm360-sidebar .sm360-nav-group-label,
.sm360-sidebar .sm360-sidebar-header-text,
.sm360-sidebar .sm360-store-switcher-name,
.sm360-sidebar .sm360-product-name,
.sm360-sidebar .store-switcher-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
}

/* Belt-and-braces hover: when the SDK's :hover expands the sidebar but
   the container query hasn't refired yet, hide group labels via :not(:hover). */
.sm360-sidebar:not(:hover):not(.is-expanded):not([data-expanded="true"]) .sm360-nav-group-label {
    visibility: hidden;
}

/* ─────────────────────────────────────────────────────────────────────────
   Mobile navigation drawer — keeping the toggle reachable while it is open.

   Below 1024px the shared SM360 layout turns the sidebar into a fixed
   off-canvas drawer at z-index 1000, anchored to the left edge directly
   beneath the header. The button that opens it lives in the breadcrumb bar
   at the top-left of the workspace — which is exactly the area the opened
   drawer covers. So the drawer paints over its own control: measured at
   400px, `div.store-switcher` (the Omni237 component in the drawer's header
   slot) is what a pointer at the toggle's centre actually hits, and the
   control that opens the drawer cannot close it.

   The backdrop still closes it on tap, so a pointer user was never stuck.
   A keyboard user had no close path at all; Escape is wired up in
   js/omni237-mobile-nav.js and this rule gives them back a visible control.

   Fixed just clear of the open drawer rather than raised in place: at 400px
   the drawer is 232px wide, so the toggle lands in the strip beside it
   instead of on top of the store switcher, which would be a button floating
   over unrelated text.

   Scoped to `.sm360-sidebar.open ~ .sm360-workspace` so it applies only while
   the drawer is open. The sibling relationship is the shared layout's own
   structure (aside, overlay, workspace all inside .sm360-body); if a future
   SM360.UI release changes it this rule stops matching and the toggle simply
   returns to the breadcrumb bar, which is the pre-existing behaviour rather
   than a new break. ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .sm360-sidebar.open ~ .sm360-workspace .sm360-mobile-toggle {
        position: fixed;
        top: calc(var(--header-height, 56px) + 8px);
        left: calc(var(--sidebar-width, 232px) + 8px);
        z-index: 1001; /* drawer is 1000, backdrop 999 */
    }
}

/* ── Single breadcrumb per Preview page (omni237#2064 item 7, round 3) ──
   The page trail (PageBreadcrumb) is authoritative. When it owns the trail
   (ancestor .omni-owns-trail from MainLayout), hide the shell's own breadcrumb
   nav but keep the mobile toggle button in the same bar, so the drawer stays
   reachable. Supported composition: Omni-owned CSS over the SDK's own
   structure (no SDK fork); if a future SM360.UI release changes the bar this
   rule stops matching and both trails show, which the single-trail test catches. */
.omni-owns-trail .sm360-breadcrumb-bar nav.sm360-breadcrumb { display: none; }

/* ── Today, "what needs you" (S1, omni237#1645) ─────────────────────────────
   Two columns, 7 : 5, proposals first (golden screens §1). At phone width the
   proposals are the page: "The day so far" collapses to one line above them and
   the full column is hidden, so Approve on the first card sits in the thumb
   zone. Colours come from the pack's tokens only; "Needs your OK" is drawn by
   the SM360 component in assist-text (theme packs §9), the action in go (§8).
   ─────────────────────────────────────────────────────────────────────────── */
.omni-today-head { margin-bottom: 20px; }
.omni-today-head h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.omni-today-intro { color: var(--sm360-text-muted); font-size: 0.875rem; margin: 4px 0 0; }
.omni-today-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px; align-items: start; }
.omni-today-proposals { display: flex; flex-direction: column; min-width: 0; }
.omni-today-h2 { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sm360-text-muted); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.omni-today-count { display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; align-items: center; justify-content: center; border-radius: var(--sm360-radius-full, 999px); background: var(--sm360-assist-wash, var(--sm360-bg-tertiary)); color: var(--sm360-assist-text, var(--sm360-text-primary)); font-size: 0.75rem; }
.omni-today-item { margin-bottom: 12px; }
.omni-today-notice { padding: 14px 18px; margin-bottom: 16px; border-left: 3px solid var(--sm360-assist, var(--sm360-border-primary)); }
.omni-today-notice p { margin: 4px 0 0; font-size: 0.875rem; color: var(--sm360-text-secondary); }
.omni-today-empty { padding: 28px; }
.omni-today-empty h3 { margin: 0 0 6px; font-size: 1.125rem; }
.omni-today-empty p { margin: 0 0 12px; color: var(--sm360-text-muted); font-size: 0.875rem; }
.omni-today-confirm { padding: 18px; border: 2px solid var(--sm360-assist, var(--sm360-border-primary)); }
.omni-today-confirm h3 { margin: 0 0 4px; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sm360-assist-text, var(--sm360-text-muted)); }
.omni-today-confirm-what { font-weight: 600; margin: 0 0 12px; }
.omni-today-changes { width: 100%; border-collapse: collapse; font-size: 0.875rem; margin-bottom: 14px; }
.omni-today-changes th { text-align: left; font-weight: 500; color: var(--sm360-text-muted); padding: 4px 8px 4px 0; border-bottom: 1px solid var(--sm360-border-primary); }
.omni-today-changes td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--sm360-border-secondary, var(--sm360-border-primary)); }
.omni-today-num { font-family: var(--sm360-font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.omni-today-confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.omni-today-preview { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 0.8125rem; color: var(--sm360-text-muted); }
.omni-today-error { color: var(--sm360-danger, #b91c1c); font-size: 0.8125rem; margin: 6px 0 0; }
.omni-today-side { display: flex; flex-direction: column; }
.omni-today-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.omni-today-figure { background: var(--brand-bg-card, var(--sm360-bg-primary)); border: 1px solid var(--brand-border, var(--sm360-border-primary)); border-radius: var(--sm360-radius-md, 8px); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.omni-today-figure-label { font-size: 0.75rem; color: var(--sm360-text-muted); }
.omni-today-withheld, .omni-today-muted { font-size: 0.8125rem; color: var(--sm360-text-muted); margin: 0; }
.omni-today-compact { display: none; }
.omni-today-auto-heading { margin-top: 4px; }
.omni-today-automatic { list-style: none; margin: 0; padding: 0; font-size: 0.8125rem; color: var(--sm360-text-secondary); }
.omni-today-automatic li { display: flex; gap: 10px; padding: 4px 0; }
.omni-today-skeleton { height: 132px; border-radius: var(--sm360-radius-md, 8px); background: var(--sm360-bg-tertiary); margin-bottom: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; animation: omni-today-pulse 1.4s ease-in-out infinite; }
.omni-today-skeleton span { display: block; height: 12px; border-radius: 4px; background: var(--sm360-bg-secondary); }
.omni-today-skeleton span:first-child { width: 60%; height: 16px; }
.omni-today-skeleton span:nth-child(2) { width: 85%; }
.omni-today-skeleton span:nth-child(3) { width: 30%; }
/* Preview pattern (omni237#2010): pack tokens only, no literal colours or sizes beyond the scale. */
.omni-preview-soon { max-width: 640px; }
.omni-setting-row { padding: 10px 0; border-bottom: 1px solid var(--sm360-border-secondary, var(--sm360-border-primary)); }
.omni-setting-row:last-child { border-bottom: 0; }
.omni-setting-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.omni-setting-label { color: var(--sm360-text-secondary); font-size: 0.875rem; }
.omni-setting-value { font-weight: 600; font-size: 0.875rem; }
.omni-setting-meta { color: var(--sm360-text-muted); font-size: 0.75rem; margin-top: 2px; }
@keyframes omni-today-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) {
    .omni-today-skeleton { animation: none; }
}
@media (max-width: 720px) {
    .omni-today-grid { grid-template-columns: minmax(0, 1fr); }
    .omni-today-side { order: -1; }
    .omni-today-side > .omni-today-h2,
    .omni-today-side .omni-today-figures,
    .omni-today-side .omni-today-automatic,
    .omni-today-side .omni-today-muted { display: none; }
    .omni-today-compact { display: block; margin: 0 0 12px; font-size: 0.875rem; color: var(--sm360-text-secondary); }
    .omni-today-head h1 { font-size: 1.25rem; }
}

/* Today · MOD-PLAT-AI tiers (omni237#1645 review). A Read proposal opens a page
   and changes nothing, so it carries no consequence label and no autonomy line.
   The SDK card draws both for every proposal today; this hides the two parts it
   marks with data-part until the SDK has a read mode (sm360-sdk#550). */
.omni-today-read [data-part='dial'],
.omni-today-read [data-part='consequence'] { display: none; }
.omni-today .sm360-proposal-figure,
.omni-today .sm360-proposal-explain,
.omni-today-figure,
.omni-today-num { font-variant-numeric: tabular-nums; }
.omni-today-num { text-align: right; }
.omni-today-changes td.omni-today-num, .omni-today-changes th.omni-today-num { text-align: right; }
.omni-today-drafted { display: flex; gap: 8px; align-items: center; margin: 6px 0 0; font-size: 0.8125rem; color: var(--sm360-text-secondary); }
.omni-today-drafted a { color: var(--sm360-assist-text, var(--sm360-text-primary)); }
.omni-today-review { padding: 16px 18px; margin-top: 8px; }
.omni-today-review h3 { margin: 0 0 10px; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sm360-text-muted); }

/* ── Shared chrome (omni237#908) ─────────────────────────────────────────────
   The header badge, store switcher, environment banner, scope notice and
   module guard were inline styles and hex literals. They are classes here,
   reading only --sm360-* tokens, so both themes follow the tenant and nothing
   is hard-coded. The store-switcher rules were a <style> block in the
   component; they moved here so all chrome CSS has one home.
   ─────────────────────────────────────────────────────────────────────────── */

.omni237-store-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--sm360-primary-subtle);
    color: var(--sm360-text-primary);
    font-size: 0.75rem;
    font-weight: 600;
}
.omni237-store-badge-icon { width: 14px; height: 14px; }

.omni237-app-ready { display: none; }


.omni237-environment-banner {
    width: 100%;
    padding: 7px 16px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    background: var(--sm360-warning);
    color: var(--sm360-warning-ink);
}

.omni237-operational-scope {
    padding: 16px;
    margin-bottom: 20px;
    border-color: var(--sm360-primary-subtle);
    background: var(--sm360-primary-subtle);
}
.omni237-operational-scope-text {
    margin: 0;
    color: var(--sm360-text-primary);
    font-size: 0.875rem;
}
.omni237-operational-scope-link {
    color: var(--sm360-teal);
    font-weight: 600;
    text-decoration: none;
}

.omni237-module-not-entitled {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: 12px;
    color: var(--sm360-text-muted);
    text-align: center;
    padding: 24px;
}
.omni237-module-not-entitled-title {
    margin: 0;
    color: var(--sm360-text-primary);
}
.omni237-module-not-entitled-body { margin: 0; max-width: 34rem; }
.omni237-module-not-entitled-hint { margin: 0; font-size: 0.8125rem; max-width: 34rem; }

/* Store switcher. */
.store-switcher { position: relative; margin: 8px 10px 4px; }

.store-switcher-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--sm360-border-primary);
    border-radius: var(--sm360-radius-md);
    background: var(--sm360-bg-secondary);
    color: var(--sm360-text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-align: left;
}
.store-switcher-btn:hover {
    background: var(--sm360-bg-tertiary);
    border-color: var(--sm360-teal);
}

.store-switcher-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.store-switcher-caret { width: 12px; height: 12px; flex-shrink: 0; opacity: 0.5; transition: transform 0.15s; }
.store-switcher-caret.is-open { transform: rotate(180deg); }
.store-switcher-option-icon { width: 14px; height: 14px; opacity: 0.5; }
.store-switcher-active-icon { width: 14px; height: 14px; margin-left: auto; }

.store-switcher-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.store-switcher-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--sm360-bg-primary);
    border: 1px solid var(--sm360-border-primary);
    border-radius: var(--sm360-radius-md);
    box-shadow: var(--sm360-shadow-lg);
    padding: 4px;
    max-height: 280px;
    overflow-y: auto;
}

.store-switcher-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: var(--sm360-radius-sm);
    background: transparent;
    color: var(--sm360-text-primary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.1s;
    text-align: left;
}
.store-switcher-option:hover { background: var(--sm360-bg-secondary); }
.store-switcher-option.active {
    background: var(--sm360-primary-subtle);
    color: var(--sm360-teal);
}

.store-count {
    margin-left: auto;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--sm360-bg-tertiary);
    color: var(--sm360-text-muted);
}

.store-switcher-tenant { font-weight: 600; }

.store-switcher-single {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--sm360-text-muted);
}
.store-switcher-single-icon { width: 16px; height: 16px; opacity: 0.5; }

/* Indented so the tenant/Location hierarchy is legible at a glance rather
   than inferred from the names. The tree has no depth cap, so the depth
   travels on the row as the --loc-depth custom property and the base offset
   and step live here, not in the markup. */
.store-switcher .store-switcher-location {
    padding-inline-start: calc(24px + var(--loc-depth, 0) * 14px);
}

.store-switcher-empty {
    padding: 4px 10px 6px 24px;
    font-size: 0.75rem;
    font-style: italic;
    color: var(--sm360-text-muted);
}

.store-badge {
    margin-left: auto;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--sm360-bg-tertiary);
    color: var(--sm360-text-muted);
}

.store-switcher-divider {
    height: 1px;
    background: var(--sm360-border-primary);
    margin: 4px 6px;
}
.store-switcher-divider:first-of-type { margin-top: 4px; }

/* Pricing Preview pages (omni237 P4, P5, P6): layout only, on pack tokens. The components are SM360.UI's. */
.omni-preview { display: flex; flex-direction: column; gap: 16px; }
.omni-preview-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 0; font-size: 0.8125rem; color: var(--sm360-text-muted); }
.omni-preview-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.omni-preview-kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.omni-preview-two { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: start; }
.omni-preview-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.omni-preview-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.omni-preview-list { margin: 8px 0 0; padding-left: 18px; font-size: 0.875rem; }
.omni-preview-more, .omni-preview-muted { margin: 8px 0 0; font-size: 0.8125rem; color: var(--sm360-text-muted); }
/* The "and N more" control is a button that reads as a link (omni237#2064 item 9). */
button.omni-preview-more { background: none; border: none; padding: 0; color: var(--sm360-teal); text-decoration: underline; cursor: pointer; text-align: left; font: inherit; }
.omni-preview-hint { font-size: 0.75rem; color: var(--sm360-text-muted); }
.omni-preview-note { margin: 8px 0 0; font-size: 0.875rem; color: var(--sm360-text-muted); }
.omni-kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.875rem; border-bottom: 1px solid var(--sm360-border-secondary, var(--sm360-border-primary)); }
.omni-kv:last-of-type { border-bottom: 0; }
.omni-kv > span:first-child { color: var(--sm360-text-secondary); }
.omni-kv > span:last-child { text-align: right; min-width: 0; }
.omni-bar { width: 100%; height: 8px; margin: 6px 0; accent-color: var(--sm360-action, var(--sm360-primary)); }
.omni-preview-choices { display: grid; gap: 8px; margin-top: 10px; }
.omni-preview-choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--sm360-border-primary); border-radius: var(--sm360-radius-md, 8px); font-size: 0.875rem; cursor: pointer; }
.omni-preview-choice.is-on { border-color: var(--sm360-action, var(--sm360-primary)); background: var(--sm360-primary-subtle, var(--sm360-bg-secondary)); }
.omni-agenda { padding: 0; overflow: hidden; }
.omni-agenda-day { padding: 10px 16px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; color: var(--sm360-text-muted); background: var(--sm360-bg-secondary); border-bottom: 1px solid var(--sm360-border-primary); }
.omni-agenda .sm360-btn { display: block; width: 100%; padding: 0; text-align: left; border-radius: 0; border-width: 0 0 1px; }
.omni-agenda .sm360-btn[aria-pressed="true"] { background: var(--sm360-action, var(--sm360-primary, var(--sm360-teal))); border-color: var(--sm360-action, var(--sm360-primary, var(--sm360-teal))); color: var(--sm360-action-ink, var(--sm360-tenant-on-brand, #ffffff)); }
.omni-agenda-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px 16px; text-align: left; color: inherit; font: inherit; }
.omni-agenda-time { font-family: var(--sm360-font-mono, ui-monospace, monospace); font-size: 0.8125rem; color: var(--sm360-text-muted); }
.omni-agenda-body { display: flex; flex-direction: column; min-width: 0; }
.omni-agenda-title { font-weight: 600; font-size: 0.875rem; }
.omni-agenda-sub { font-size: 0.75rem; color: var(--sm360-text-muted); }
@media (max-width: 720px) {
    .omni-preview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .omni-preview-two { grid-template-columns: minmax(0, 1fr); }
    .omni-agenda-item { grid-template-columns: 52px minmax(0, 1fr); }
    .omni-agenda-item > :last-child { grid-column: 2; justify-self: start; }
}
/* Inventory Preview pages (omni237 S5, S4b): layout only, on pack tokens. The components are SM360.UI's. */
.omni-preview { display: flex; flex-direction: column; gap: 16px; }
.omni-preview-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 0; font-size: 0.8125rem; color: var(--sm360-text-muted); }
.omni-preview-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.omni-preview-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.omni-preview-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.omni-preview-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.omni-preview-hint { font-size: 0.75rem; color: var(--sm360-text-muted); }
.omni-queue { display: flex; flex-direction: column; min-width: 0; }
.omni-queue .sm360-btn { min-width: 0; max-width: 100%; white-space: normal; }
.omni-queue-item { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) auto minmax(0, 1.1fr); gap: 12px; align-items: center; width: 100%; max-width: 100%; min-width: 0; text-align: left; overflow-wrap: anywhere; }
.omni-queue-what, .omni-queue-with { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.omni-queue-headline { font-weight: 600; font-size: 0.875rem; overflow-wrap: anywhere; }
.omni-queue-detail { font-size: 0.75rem; color: var(--sm360-text-muted); }
.omni-queue-where { font-size: 0.8125rem; color: var(--sm360-text-secondary); }
.omni-queue-with { font-size: 0.8125rem; }
@media (max-width: 720px) {
    .omni-preview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .omni-preview-two { grid-template-columns: minmax(0, 1fr); }
}
/* A wide grid in a narrow column keeps its columns and scrolls sideways; a business name wrapped
   over four lines reads as a broken cell (omni237#2118 item 4, the rule from omni237#2064 item 4). */
.omni-rollup-table { min-width: 0; }
.omni-rollup-table .sm360-table-container { overflow-x: auto; }
.omni-rollup-table .sm360-table, .omni-rollup-table .sm360-table th, .omni-rollup-table .sm360-table td { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
    .omni-queue-item { transition: none; }
}
/* Money Preview pages (omni237 M3, M5): layout only, on pack tokens. The components are SM360.UI's. */
.omni-preview { display: flex; flex-direction: column; gap: 16px; }
.omni-preview-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 0; font-size: 0.8125rem; color: var(--sm360-text-muted); }
.omni-preview-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.omni-preview-two { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: start; }
.omni-preview-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.omni-preview-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.omni-preview-list { margin: 8px 0 0; padding-left: 18px; font-size: 0.875rem; }
.omni-preview-hint { margin: 10px 0 0; font-size: 0.75rem; color: var(--sm360-text-muted); }
.omni-kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.875rem; border-bottom: 1px solid var(--sm360-border-secondary, var(--sm360-border-primary)); }
.omni-kv:last-of-type { border-bottom: 0; }
.omni-kv > span:first-child { color: var(--sm360-text-secondary); }
.omni-kv > span:last-child { text-align: right; min-width: 0; }
.omni-preview-choices { display: grid; gap: 8px; margin-top: 10px; }
.omni-preview-choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--sm360-border-primary); border-radius: var(--sm360-radius-md, 8px); font-size: 0.875rem; cursor: pointer; }
.omni-preview-choice.is-on { border-color: var(--sm360-action, var(--sm360-primary)); background: var(--sm360-primary-subtle, var(--sm360-bg-secondary)); }
.omni-cardrec-negative { color: var(--sm360-danger, var(--sm360-alert)); }
.omni-journal-label { display: block; }
.omni-journal-source { display: block; font-size: 0.6875rem; color: var(--sm360-text-muted); }
.omni-journal-refused { color: var(--sm360-danger, var(--sm360-alert)); }
.omni-journal-total { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 10px 4px; margin-top: 6px; border-top: 2px solid var(--sm360-border-primary); font-weight: 600; }
.omni-journal-total-label { font-weight: 600; }
.omni-po-created { margin-bottom: 12px; font-size: 0.8125rem; }
@media (max-width: 720px) {
    .omni-preview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .omni-preview-two { grid-template-columns: minmax(0, 1fr); }
}
/* Product-catalogue Preview pages (omni237 B3, B5, B6, B8, S12): layout only, on pack tokens. */
.omni-matrix { display: flex; flex-direction: column; gap: 6px; }
.omni-matrix-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(96px, 1fr); gap: 6px; }
.omni-matrix-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 8px; border: 1px solid var(--sm360-border-primary); border-radius: var(--sm360-radius-md, 8px); text-align: center; }
.omni-matrix-head .omni-matrix-cell, .omni-matrix-rowhead, .omni-matrix-colhead { font-weight: 600; }
.omni-matrix-corner { border: 0; background: none; }
.omni-cell-low { border-color: var(--sm360-warning, #b45309); background: color-mix(in srgb, var(--sm360-warning, #b45309) 12%, transparent); }
.omni-cell-amber { color: var(--sm360-warning, #b45309); font-weight: 600; }
.omni-h3 { margin: 12px 0 0; font-size: 0.9375rem; font-weight: 600; }
.omni-rules { margin: 8px 0 0; padding-left: 20px; font-size: 0.875rem; }
.omni-rules li { margin: 4px 0; }

/* Franchise-network Preview pages (omni237 F1 to F3, #2032): layout only, on pack tokens.
   Every visible element is an SM360.UI component or the shared Preview stand-ins. */
.omni-preview { display: flex; flex-direction: column; gap: 16px; }
.omni-preview-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 0; font-size: 0.8125rem; color: var(--sm360-text-muted); }
.omni-preview-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.omni-preview-two { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: start; }
.omni-preview-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.omni-preview-focus { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.omni-preview-focus-name { margin: 0; font-size: 1rem; }
.omni-preview-sharing { display: flex; flex-direction: column; min-width: 0; }
.omni-preview-loading { display: flex; flex-direction: column; gap: 16px; padding: 16px 0; }
.omni-preview-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.omni-preview-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.omni-preview-muted { color: var(--sm360-text-muted); font-size: 0.75rem; }
.omni-preview-hint { font-size: 0.75rem; color: var(--sm360-text-muted); }
.omni-kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 0.875rem; border-bottom: 1px solid var(--sm360-border-secondary, var(--sm360-border-primary)); }
.omni-kv:last-of-type { border-bottom: 0; }
.omni-kv > span:first-child { color: var(--sm360-text-secondary); }
.omni-kv > span:last-child { text-align: right; min-width: 0; }
@media (max-width: 720px) {
    .omni-preview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .omni-preview-two { grid-template-columns: minmax(0, 1fr); }
    .omni-preview-three { grid-template-columns: minmax(0, 1fr); }
}

/* omni237#2149 item 6: a number or amount never breaks across lines ("≈ $380.00", "-$184.92"). */
.sm360-num { white-space: nowrap; }

/* Minimum touch target for page-authored controls that carry no other inline style (omni237#1407).
   Element + class so it outranks any single-class rule; the other authored controls state the same floor inline. */
button.omni-target, input.omni-target, select.omni-target { min-height: 44px; min-width: 44px; }
button.omni-target-mt { margin-top: 12px; }
