/* Store workspace shell: quiet ink, mineral surfaces, and tenant colour as an accent. */
body.workspace-shell {
    --workspace-ink: #283b43;
    --workspace-ink-soft: #52666d;
    --workspace-muted: #788990;
    --workspace-paper: #f3f5f2;
    --workspace-surface: #fbfcf9;
    --workspace-line: #dce4df;
    /* Tenant hue tokens are generated by shop-theme.js; fallbacks remain
       readable if a page is rendered before the tenant theme is available. */
    --workspace-accent: var(--workspace-theme-accent, color-mix(in srgb, var(--primary, #416c68) 35%, #17221e));
    --workspace-action: var(--workspace-theme-action, color-mix(in srgb, var(--primary, #416c68) 35%, #17221e));
    --workspace-action-hover: var(--workspace-theme-action-hover, color-mix(in srgb, var(--workspace-action) 82%, #111b18));
    --workspace-action-ink: var(--workspace-theme-action-ink, #fff);
    --workspace-soft: var(--workspace-theme-soft, color-mix(in srgb, var(--primary, #416c68) 11%, var(--workspace-surface)));
    --workspace-hover: var(--workspace-theme-hover, color-mix(in srgb, var(--primary, #416c68) 16%, var(--workspace-surface)));
    --workspace-accent-line: var(--workspace-theme-accent-line, color-mix(in srgb, var(--primary, #416c68) 32%, var(--workspace-line)));
    --workspace-secondary: var(--workspace-theme-secondary, color-mix(in srgb, var(--secondary, var(--primary, #416c68)) 35%, #17221e));
    --workspace-secondary-soft: var(--workspace-theme-secondary-soft, color-mix(in srgb, var(--secondary, var(--primary, #416c68)) 13%, var(--workspace-surface)));
    --workspace-focus: var(--workspace-theme-focus, color-mix(in srgb, var(--primary, #416c68) 35%, #17221e));
    --workspace-sidebar-width: 256px;
    --workspace-rail-width: 72px;
    background: var(--workspace-paper);
    color: var(--workspace-ink);
}

body.workspace-shell *,
body.workspace-shell *::before,
body.workspace-shell *::after { box-sizing: border-box; }

body.workspace-shell :is(.store-dashboard, .stock-overview-workspace, .workspace-reports, .dispatch-workspace, .workspace-indie-order)
    :is(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--workspace-focus);
    outline-offset: 2px;
}

body.workspace-shell .master-header {
    min-height: 60px;
    margin-left: 0;
    padding: .55rem 1.35rem;
    background: var(--workspace-surface) !important;
    border-bottom: 1px solid var(--workspace-line);
    box-shadow: 0 2px 8px rgba(40, 59, 67, .035) !important;
    color: var(--workspace-ink);
    z-index: 1020;
}

body.workspace-shell .master-header .header-top-row {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

body.workspace-shell .master-header .header-left,
body.workspace-shell .master-header .header-right { display: flex; align-items: center; gap: .65rem; }
body.workspace-shell .master-header .header-left { min-width:0; }
body.workspace-shell .master-header .header-store-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
body.workspace-shell .master-header .header-store-name {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--workspace-ink);
    font-size: .91rem;
    font-weight: 650;
    letter-spacing: .005em;
}
body.workspace-shell .workspace-header-logo { max-width: 64px; max-height: 30px; width: auto; height: auto; object-fit: contain; flex-shrink: 0; }

body.workspace-shell .master-header .nav-link,
body.workspace-shell .master-header .btn,
body.workspace-shell .master-header .user-greeting-btn {
    color: var(--workspace-ink-soft) !important;
    background: transparent !important;
    border-color: var(--workspace-line) !important;
    box-shadow: none !important;
}

body.workspace-shell .master-header .nav-link:hover,
body.workspace-shell .master-header .btn:hover,
body.workspace-shell .master-header .user-greeting-btn:hover {
    color: var(--workspace-accent) !important;
    background: var(--workspace-soft) !important;
}

body.workspace-shell .master-header #navMenuToggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--workspace-ink);
    background: transparent;
    border: 1px solid var(--workspace-line);
    border-radius: 8px;
}

body.workspace-shell .navbar-left#sideNav {
    width: var(--workspace-sidebar-width);
    height: 100dvh;
    padding: 0;
    margin:0;
    top:0;
    left:0;
    overflow: hidden;
    background: #f8faf7;
    border-right: 1px solid var(--workspace-line);
    box-shadow: none;
    z-index: 1050;
}

body.workspace-shell #sideNav .nav-header {
    display: flex;
    flex: 0 0 auto;
    min-height: 76px;
    padding: 1rem 1.15rem;
    color: var(--workspace-ink);
    background: transparent;
    border-bottom: 1px solid var(--workspace-line);
}

body.workspace-shell #sideNav .nav-header :is(img, .store-mark) { max-width: 38px; max-height: 38px; }
body.workspace-shell #sideNav .nav-store-identity { display:flex; align-items:center; flex:1; min-width:0; color:var(--workspace-ink); font-weight:700; text-decoration:none; }
body.workspace-shell #sideNav .nav-store-identity > .store-logo-contained {
    max-width: 100% !important; max-height: 64px !important;
}
body.workspace-shell #sideNav .nav-store-identity [hidden] { display:none !important; }
body.workspace-shell #sideNav .nav-store-identity span { overflow-wrap:anywhere; line-height:1.4; font-size:.9rem; }
body.workspace-shell #sideNav .nav-close-btn { display:none; color:var(--workspace-ink); background:transparent; flex-shrink:0; }
body.workspace-shell #sideNav .nav-badge { margin-left:auto; padding:.1rem .4rem; border-radius:1rem; background:#b42318; color:#fff; font-size:.72rem; }
body.workspace-shell #sideNav .nav-system { border-top:1px solid var(--workspace-line); margin-top:.6rem; padding-top:.4rem; }
body.workspace-shell #sideNav .nav-personal { border-top:1px solid var(--workspace-line); margin-top:.6rem; padding-top:.4rem; }
body.workspace-shell .workspace-nav-tooltip { position:fixed; z-index:1100; max-width:260px; padding:.5rem .7rem; background:#21333a; color:white; border-radius:5px; font-size:.82rem; overflow-wrap:anywhere; pointer-events:none; }
body.workspace-shell .workspace-nav-tooltip[hidden] { display:none; }
body.workspace-shell .workspace-skip-link { position:fixed; top:-100px; left:1rem; z-index:1100; padding:.8rem; background:white; color:#21333a; }
body.workspace-shell .workspace-skip-link:focus { top:.5rem; }
body.workspace-shell #sideNav .nav-header :is(.store-name, .nav-title) {
    overflow: hidden;
    color: var(--workspace-ink);
    font-size: .95rem;
    font-weight: 700;
    text-overflow: ellipsis;
}

body.workspace-shell #sideNav .nav-scroll {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
    overscroll-behavior: contain;
    padding: .65rem .55rem;
}

body.workspace-shell #sideNav .navbar-nav { padding: 0; }
body.workspace-shell #sideNav .nav-group { list-style: none; }
body.workspace-shell #sideNav .nav-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    padding: .65rem .75rem .35rem;
    color: var(--workspace-muted);
    background: none;
    border: 0;
    text-align: left;
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .09em;
    line-height: 1.3;
    text-transform: uppercase;
}
body.workspace-shell #sideNav .nav-group-toggle span { flex:1; min-width:0; overflow-wrap:anywhere; }
body.workspace-shell #sideNav .nav-group-toggle > i { flex-shrink:0; }
body.workspace-shell #sideNav .nav-group-nested { padding-left: .5rem; }
body.workspace-shell #sideNav .nav-group-nested > .nav-group-toggle {
    min-height: 40px;
    padding: .55rem .75rem;
    color: var(--workspace-ink-soft);
    border-radius: 7px;
    font-size: .86rem;
    font-weight: 520;
    letter-spacing: normal;
    text-transform: none;
    transition: background-color .16s ease, color .16s ease;
}
body.workspace-shell #sideNav .nav-group-nested > .nav-group-toggle:hover {
    color: var(--workspace-accent);
    background: var(--workspace-hover);
}
body.workspace-shell #sideNav .nav-group-nested > .nav-group-toggle > i:first-child {
    width: 19px;
    flex: 0 0 19px;
    color: #81918d;
    text-align: center;
}
body.workspace-shell #sideNav .nav-group-nested > .nav-submenu { padding-left: .55rem; }
body.workspace-shell #sideNav .nav-supplier-disabled .nav-link {
    color: var(--workspace-muted);
    cursor: default;
    opacity: .62;
}
body.workspace-shell #sideNav .nav-coming-soon {
    margin-left: auto;
    font-size: .66rem;
    white-space: nowrap;
}

body.workspace-shell #sideNav .nav-submenu[hidden] { display: none !important; }
body.workspace-shell #sideNav .nav-submenu {
    display: block;
    padding: 0;
    margin: 0;
    list-style: none;
    max-height:none;
    overflow:visible;
}

body.workspace-shell #sideNav .navbar-nav .nav-link {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: .72rem;
    margin: 2px 0;
    padding: .55rem .75rem;
    overflow: hidden;
    color: var(--workspace-ink-soft);
    background: transparent;
    border-radius: 7px;
    font-size: .86rem;
    font-weight: 520;
    text-overflow: ellipsis;
    transition: background-color .16s ease, color .16s ease;
    white-space:normal;
    overflow-wrap:anywhere;
}
body.workspace-shell #sideNav .navbar-nav .nav-link > span { min-width:0; }

body.workspace-shell #sideNav .navbar-nav .nav-link i {
    width: 19px;
    flex: 0 0 19px;
    color: #81918d;
    text-align: center;
}

body.workspace-shell #sideNav .navbar-nav .nav-link:hover {
    color: var(--workspace-accent) !important;
    background: var(--workspace-hover) !important;
}
body.workspace-shell #sideNav .navbar-nav .nav-link:hover i { color: var(--workspace-accent); }

body.workspace-shell #sideNav .navbar-nav .nav-link.active,
body.workspace-shell #sideNav .navbar-nav .nav-link[aria-current="page"] {
    color: var(--workspace-accent) !important;
    background: var(--workspace-soft) !important;
    box-shadow: inset 3px 0 var(--workspace-accent);
    font-weight: 700;
}

body.workspace-shell #sideNav .navbar-nav .nav-link.active i,
body.workspace-shell #sideNav .navbar-nav .nav-link[aria-current="page"] i { color: var(--workspace-accent); }

body.workspace-shell #sideNav :is(a, button):focus-visible,
body.workspace-shell .master-header :is(a, button):focus-visible {
    outline: 3px solid var(--workspace-focus);
    outline-offset: 2px;
    z-index: 1;
}

body.workspace-shell #sideNav .nav-footer {
    flex: 0 0 auto;
    padding: .65rem .55rem .75rem;
    background: #f8faf7;
    border-top: 1px solid var(--workspace-line);
}

body.workspace-shell #sideNav #navExpandToggle {
    min-height: 38px;
    margin-top: .35rem;
    color: var(--workspace-ink-soft);
    background: transparent;
    border: 1px solid var(--workspace-line);
    border-radius: 7px;
    position:static;
    transform:none;
    gap:.5rem;
}

body.workspace-shell #sideNav #navExpandToggle:hover { color: var(--workspace-accent); background: var(--workspace-soft); }

@media (min-width: 1200px) {
    body.workspace-shell.sidebar-collapsed #sideNav .nav-store-identity > .store-logo-contained {
        max-width: 38px !important; max-height: 38px !important;
    }
    body.workspace-shell.has-sidebar .page-wrapper { padding-left: var(--workspace-sidebar-width); }
    body.workspace-shell.has-sidebar .master-header { margin-left: var(--workspace-sidebar-width); }
    body.workspace-shell.sidebar-collapsed #sideNav { width: var(--workspace-rail-width); }
    body.workspace-shell.sidebar-collapsed.has-sidebar .page-wrapper { padding-left: var(--workspace-rail-width); }
    body.workspace-shell.sidebar-collapsed.has-sidebar .master-header { margin-left: var(--workspace-rail-width); }
    body.workspace-shell.sidebar-collapsed #sideNav .nav-header { justify-content: center; padding-inline: .5rem; }
    body.workspace-shell.sidebar-collapsed #sideNav .nav-header :is(.store-name, .store-label, .nav-title) { display: none; }
    body.workspace-shell.sidebar-collapsed #sideNav .nav-group-toggle { display: none; }
    body.workspace-shell.sidebar-collapsed #sideNav .nav-submenu { display: block !important; }
    body.workspace-shell.sidebar-collapsed #sideNav .nav-store-identity span,
    body.workspace-shell.sidebar-collapsed #sideNav #navExpandToggle span { display:none; }
    body.workspace-shell.sidebar-collapsed #sideNav .nav-scroll { padding-inline: .45rem; }
    body.workspace-shell.sidebar-collapsed #sideNav .navbar-nav .nav-link {
        justify-content: center;
        gap: 0;
        padding-inline: .35rem;
        white-space: nowrap;
    }
    body.workspace-shell.sidebar-collapsed #sideNav .navbar-nav .nav-link span,
    body.workspace-shell.sidebar-collapsed #sideNav .navbar-nav .nav-link .nav-label { display: none; }
    body.workspace-shell.sidebar-collapsed #sideNav .navbar-nav .nav-link i { font-size: 1rem; }
    body.workspace-shell.sidebar-collapsed #sideNav .nav-footer :is(.nav-label, .footer-label) { display: none; }
}

@media (max-width: 1199.98px) {
    body.workspace-shell.nav-open { overflow:hidden; }
    body.workspace-shell #sideNav .nav-close-btn { display:flex; }
    body.workspace-shell #sideNav #navExpandToggle { display:none; }
    body.workspace-shell #sideNav .navbar-nav .nav-link span { display:inline; }
    body.workspace-shell #sideNav .navbar-nav .nav-link { justify-content:flex-start; }
    body.workspace-shell.sidebar-collapsed #sideNav .nav-submenu:not([hidden]) { display:block !important; }
    body.workspace-shell.sidebar-collapsed #sideNav .navbar-nav .nav-link span { display:inline; }
    body.workspace-shell .navbar-left#sideNav {
        width: min(320px, calc(100vw - 48px));
        transform: translateX(-102%);
        transition: transform .22s ease;
        box-shadow: 12px 0 32px rgba(40, 59, 67, .12);
    }
    body.workspace-shell.nav-open .navbar-left#sideNav { transform: translateX(0); }
    body.workspace-shell.has-sidebar .page-wrapper { padding-left: 0; }
    body.workspace-shell.has-sidebar .master-header { margin-left: 0; }
    body.workspace-shell .master-header #navMenuToggle { display: inline-flex; }
    body.workspace-shell #sideNav .nav-header { display: flex; }
    body.workspace-shell .nav-overlay { z-index: 1040; }
}

body.workspace-shell .page-content-wrapper {
    min-height: calc(100dvh - 60px);
    background: var(--workspace-paper);
}

body.workspace-shell .page-content { padding: clamp(1rem, 2.3vw, 1.8rem); }
body.workspace-shell .modern-card,
body.workspace-shell .stat-card-compact {
    border: 1px solid var(--workspace-line);
    border-radius: 9px;
    box-shadow: 0 2px 7px rgba(40, 59, 67, .035);
}
body.workspace-shell .modern-card:hover,
body.workspace-shell .stat-card-compact:hover { transform: none; box-shadow: 0 4px 12px rgba(40, 59, 67, .07); }
body.workspace-shell .modern-card .card-header { background: #f5f8f5; }

/* Dense, scan-first staff dashboard. Business panels retain their own interaction contracts. */
body.workspace-shell .store-dashboard {
    max-width: 1480px;
    display: flex;
    flex-direction: column;
    margin-inline: auto;
    min-width:0;
}
body.workspace-shell .store-dashboard > .row { margin-inline:0; }
body.workspace-shell .store-dashboard > .welcome-banner { order: 0; }
body.workspace-shell .store-dashboard > .quick-actions { order: 1; }
body.workspace-shell .store-dashboard > .alert { order: 2; }
body.workspace-shell .store-dashboard > .demand-panel.modern-card { order: 3; }
body.workspace-shell .store-dashboard > .demand-reconcile { order: 4; }
body.workspace-shell .store-dashboard > .dashboard-metrics { order: 5; }
body.workspace-shell .store-dashboard > .sales-channel-summary { order: 6; }
body.workspace-shell .store-dashboard > .comic-news-ticker { order: 7; }
body.workspace-shell .store-dashboard > .modern-card:not(.demand-reconcile) { order: 8; }
body.workspace-shell .store-dashboard > .demand-panel.modern-card { order: 3; }
body.workspace-shell .store-dashboard > .sales-channel-summary.modern-card { order: 6; }
body.workspace-shell .store-dashboard .welcome-banner {
    padding: 1.2rem 1.45rem;
    margin-bottom: 1.1rem;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-accent-line);
    border-left: 4px solid var(--workspace-accent);
    border-radius: 9px;
}
body.workspace-shell .store-dashboard .welcome-banner::before { content:none; }
body.workspace-shell .store-dashboard .dashboard-kicker,
body.workspace-shell .customer-dashboard-refresh .account-eyebrow {
    margin: 0 0 .25rem;
    color: var(--workspace-accent);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .12em;
}
body.workspace-shell .store-dashboard .welcome-banner h2 { margin: 0 0 .25rem; color: var(--workspace-ink); font-size: clamp(1.25rem, 2vw, 1.65rem); }
body.workspace-shell .store-dashboard .welcome-banner p { margin: 0; color: var(--workspace-ink-soft); }
body.workspace-shell .store-dashboard .welcome-banner .dashboard-kicker { margin-bottom: .35rem; }
body.workspace-shell .store-dashboard .dashboard-period { margin-left: .55rem; color: var(--workspace-muted); font-size: .72rem; font-weight: 500; }
body.workspace-shell .store-dashboard .quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: .8rem 0 1.15rem;
}
body.workspace-shell .store-dashboard .quick-action {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .48rem .75rem;
    color: var(--workspace-ink-soft);
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-line);
    border-radius: 7px;
    font-size: .82rem;
    font-weight: 650;
    text-decoration: none;
}
body.workspace-shell .store-dashboard .quick-action:hover { color: var(--workspace-accent); background: var(--workspace-soft); border-color: var(--workspace-accent-line); }
body.workspace-shell .store-dashboard .action-icon { color: var(--workspace-accent); }
body.workspace-shell .store-dashboard a:not(.quick-action):not(.btn) { color: var(--workspace-accent); }
body.workspace-shell .store-dashboard .badge:not(.badge-success, .badge-warning, .badge-danger, .badge-error) {
    color: var(--workspace-secondary);
    background: var(--workspace-secondary-soft);
}
body.workspace-shell .store-dashboard .personal-dashboard-link { margin-left: auto; color: var(--workspace-muted); }
body.workspace-shell .store-dashboard .quick-action.personal-dashboard-link { color:var(--workspace-ink-soft); opacity:1; }
body.workspace-shell .store-dashboard .quick-action.personal-dashboard-link .action-icon { color:var(--workspace-ink-soft); }
body.workspace-shell .store-dashboard .comic-news-ticker,
body.workspace-shell .store-dashboard .news-ticker-header,
body.workspace-shell .store-dashboard .news-ticker-content { background:var(--workspace-surface); color:var(--workspace-ink); }
body.workspace-shell .store-dashboard .news-ticker-header { border-bottom:1px solid var(--workspace-line); }
body.workspace-shell .store-dashboard .news-ticker-header :is(.ticker-title, .ticker-refresh-btn),
body.workspace-shell .store-dashboard .news-ticker-content :is(.ticker-loading, .ticker-error) { color:var(--workspace-ink-soft); }
body.workspace-shell .store-dashboard .row.mb-4 > [class*="col-"] { min-width: 0; }
body.workspace-shell .store-dashboard .stat-card-compact { min-height: 74px; background: var(--workspace-surface); }
body.workspace-shell .store-dashboard .stat-value-compact { font-variant-numeric: tabular-nums; }
body.workspace-shell .store-dashboard .demand-panel { margin-top: .85rem !important; background: var(--workspace-surface); }
body.workspace-shell .store-dashboard .demand-panel-toggle { min-height: 76px; padding: .9rem 1.2rem; }
body.workspace-shell .store-dashboard .demand-panel-toggle > span:first-child { min-width: 0; }
body.workspace-shell .store-dashboard .demand-counts { flex-wrap: wrap; justify-content: flex-end; }
body.workspace-shell .store-dashboard .demand-reconcile .card-header { background: #f5f8f5; }
body.workspace-shell .store-dashboard .comic-news-ticker { border: 1px solid var(--workspace-line); border-radius: 9px; box-shadow: none; }

/* Light personal overview treatment, without repainting other legacy documents. */
body.workspace-shell .customer-dashboard-refresh .dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.3rem;
    margin-bottom: 1rem;
    background: var(--workspace-surface) !important;
    border: 1px solid var(--workspace-line);
    border-radius: 9px;
}
body.workspace-shell .customer-dashboard-refresh .store-name-header { color: var(--workspace-ink) !important; font-size: clamp(1.25rem, 3vw, 1.8rem); }
body.workspace-shell .customer-dashboard-refresh .dashboard-info-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}
body.workspace-shell .customer-dashboard-refresh .account-overview-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0 .75rem;
}
body.workspace-shell .customer-dashboard-refresh .account-overview-heading h2 {
    margin: 0;
    color: var(--workspace-ink);
    font-size: 1.2rem;
}
body.workspace-shell .customer-dashboard-refresh .account-overview-heading > p {
    margin: 0;
    color: var(--workspace-muted);
    font-size: .84rem;
}
body.workspace-shell .account-utility-links { display:flex; flex-wrap:wrap; gap:.6rem 1.25rem; font-size:.84rem; }
body.workspace-shell .account-utility-links a { text-decoration:underline; text-underline-offset:3px; }
body.workspace-shell .customer-dashboard-refresh .info-card {
    min-width: 0;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-line);
    border-radius: 9px;
    box-shadow: none;
}
body.workspace-shell .customer-dashboard-refresh .info-card:hover { transform: translateY(-1px); }

/* Shared staff-page treatment for the stock, reporting and dispatch workspaces.
   Each page opts in by document class; customer and wholesale surfaces stay untouched. */
body.workspace-shell :is(.stock-overview-workspace, .workspace-reports, .dispatch-workspace) {
    width: min(1480px, 100%);
    min-width: 0;
    margin-inline: auto;
    color: var(--workspace-ink);
}

body.workspace-shell .stock-overview-workspace .card-header .badge,
body.workspace-shell .workspace-reports .report-card-header .badge:not(.badge-warning):not(.badge-danger):not(.badge-success) {
    color: var(--workspace-secondary) !important;
    background: var(--workspace-secondary-soft) !important;
}

body.workspace-shell .stock-overview-workspace .modern-card,
body.workspace-shell .dispatch-workspace .modern-card,
body.workspace-shell .workspace-reports .report-card {
    overflow: hidden;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-line);
    border-radius: 9px;
    box-shadow: 0 2px 7px rgba(40, 59, 67, .035);
}

body.workspace-shell .stock-overview-workspace .card-header,
body.workspace-shell .workspace-reports .report-card-header {
    min-width: 0;
    padding: .95rem 1.15rem !important;
    color: var(--workspace-ink);
    background: #f5f8f5 !important;
    border-bottom: 1px solid var(--workspace-accent-line);
}

body.workspace-shell .stock-overview-workspace .card-header h4,
body.workspace-shell .workspace-reports .reports-header h1,
body.workspace-shell .dispatch-workspace .page-header h1 {
    color: var(--workspace-ink);
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    font-weight: 720;
    letter-spacing: -.025em;
}

body.workspace-shell .stock-overview-workspace .stat-icon-compact {
    width: 40px !important;
    height: 40px !important;
    flex: 0 0 40px;
    color: var(--workspace-accent) !important;
    background: var(--workspace-soft) !important;
    border-radius: 8px !important;
}

body.workspace-shell .stock-overview-workspace .card-header .badge {
    color: var(--workspace-secondary);
    background: var(--workspace-secondary-soft);
    font-size: .75rem !important;
    font-weight: 650;
    margin-left: .5rem;
}
body.workspace-shell .stock-overview-workspace .card-header { gap: .75rem; flex-wrap: wrap; }
body.workspace-shell .stock-overview-workspace .card-header > div:last-child { gap: .5rem; }
body.workspace-shell .stock-overview-workspace .stock-page-controls { gap: .75rem; flex-wrap: wrap; }
body.workspace-shell .stock-overview-workspace .stock-page-controls > div:first-child { gap: .5rem; }
body.workspace-shell .stock-overview-workspace a:not(.btn) { color: var(--workspace-accent); }

body.workspace-shell :is(.store-dashboard, .stock-overview-workspace, .workspace-reports, .dispatch-workspace) .btn {
    min-height: 36px;
    border-radius: 7px !important;
    box-shadow: none;
    font-weight: 650;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

body.workspace-shell :is(.store-dashboard, .stock-overview-workspace, .workspace-reports, .dispatch-workspace) .btn-primary,
body.workspace-shell :is(.store-dashboard, .stock-overview-workspace, .workspace-reports, .dispatch-workspace) .btn-success {
    color: var(--workspace-action-ink) !important;
    background: var(--workspace-action) !important;
    border: 1px solid var(--workspace-action) !important;
}
body.workspace-shell :is(.store-dashboard, .stock-overview-workspace, .workspace-reports, .dispatch-workspace) .btn-primary:hover,
body.workspace-shell :is(.store-dashboard, .stock-overview-workspace, .workspace-reports, .dispatch-workspace) .btn-success:hover {
    color: var(--workspace-action-ink) !important;
    background: var(--workspace-action-hover) !important;
    border-color: var(--workspace-action-hover) !important;
}
body.workspace-shell :is(.store-dashboard, .stock-overview-workspace, .workspace-reports, .dispatch-workspace) .btn-outline-primary,
body.workspace-shell :is(.store-dashboard, .stock-overview-workspace, .workspace-reports, .dispatch-workspace) .btn-outline-secondary,
body.workspace-shell :is(.store-dashboard, .stock-overview-workspace, .workspace-reports, .dispatch-workspace) .btn-outline-success {
    color: var(--workspace-accent) !important;
    background: #fbfcf9 !important;
    border: 1px solid var(--workspace-accent-line) !important;
}
body.workspace-shell :is(.store-dashboard, .stock-overview-workspace, .workspace-reports, .dispatch-workspace) .btn-outline-primary:hover,
body.workspace-shell :is(.store-dashboard, .stock-overview-workspace, .workspace-reports, .dispatch-workspace) .btn-outline-secondary:hover,
body.workspace-shell :is(.store-dashboard, .stock-overview-workspace, .workspace-reports, .dispatch-workspace) .btn-outline-success:hover {
    color: var(--workspace-accent) !important;
    background: var(--workspace-soft) !important;
    border-color: var(--workspace-accent-line) !important;
}
body.workspace-shell :is(.stock-overview-workspace, .workspace-reports, .dispatch-workspace) .btn-danger,
body.workspace-shell :is(.stock-overview-workspace, .workspace-reports, .dispatch-workspace) .btn-outline-danger {
    color: #fff;
    background: #a83c35;
    border-color: #a83c35;
}

body.workspace-shell .stock-overview-workspace .p-3.border-bottom.bg-light {
    background: #f7f9f6 !important;
}
body.workspace-shell .stock-overview-workspace .form-label,
body.workspace-shell .stock-overview-workspace .form-check-label {
    color: var(--workspace-ink-soft);
    font-size: .82rem;
    font-weight: 650;
}
body.workspace-shell .stock-overview-workspace .form-control {
    min-height: 38px;
    color: var(--workspace-ink);
    background: var(--workspace-surface);
    border-color: #cbd6cf;
    border-radius: 7px;
}
body.workspace-shell .stock-overview-workspace .form-control:focus {
    border-color: var(--workspace-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--workspace-focus) 20%, transparent);
}
body.workspace-shell .stock-overview-workspace .table-responsive { max-width: 100%; }
body.workspace-shell .stock-overview-workspace #storeStockTable {
    color: var(--workspace-ink);
    border-color: var(--workspace-line);
    font-size: .84rem;
}
body.workspace-shell .stock-overview-workspace #storeStockTable thead th {
    padding-top: .72rem;
    padding-bottom: .72rem;
    color: var(--workspace-ink-soft);
    background: #f1f5f1;
    border-color: var(--workspace-line);
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .045em;
    text-transform: uppercase;
    white-space: nowrap;
}
body.workspace-shell .stock-overview-workspace #storeStockTable thead a {
    color: inherit !important;
}
body.workspace-shell .stock-overview-workspace #storeStockTable tbody tr:not(.table-secondary):hover {
    background: #f5f8f5;
}
body.workspace-shell .stock-overview-workspace #storeStockTable .table-secondary td {
    color: var(--workspace-ink) !important;
    background: var(--workspace-secondary-soft) !important;
    border-color: var(--workspace-line);
    font-size: .82rem;
    letter-spacing: .01em;
}
body.workspace-shell .stock-overview-workspace .pagination .page-link {
    color: var(--workspace-ink-soft);
    background: var(--workspace-surface);
    border-color: var(--workspace-line);
}
body.workspace-shell .stock-overview-workspace .pagination .page-item.active .page-link {
    color: #fff;
    background: var(--workspace-accent);
    border-color: var(--workspace-accent);
}

/* Report dashboard: quiet panels, tenant-context neutral header, and calm
   controls keep the existing chart/filter workflow visually subordinate. */
body.workspace-shell .workspace-reports { max-width: 1480px; }
body.workspace-shell .workspace-reports .reports-header {
    min-height: 88px;
    padding: 1.05rem 1.3rem;
    margin-bottom: 1rem;
    color: var(--workspace-ink) !important;
    background: var(--workspace-surface) !important;
    border: 1px solid var(--workspace-accent-line);
    border-left: 4px solid var(--workspace-accent);
    border-radius: 9px;
    box-shadow: 0 2px 7px rgba(40, 59, 67, .035);
}
body.workspace-shell .workspace-reports .reports-header h1 { margin: 0; }
body.workspace-shell .workspace-reports .reports-header p {
    margin: .25rem 0 0;
    color: var(--workspace-muted);
    font-size: .86rem;
    opacity: 1;
}
body.workspace-shell .workspace-reports .report-card { margin-bottom: 1rem; }
body.workspace-shell .workspace-reports .report-card-header {
    flex-wrap: wrap;
    gap: .7rem 1rem;
}
body.workspace-shell .workspace-reports .report-card-header .header-left { min-width: 0; }
body.workspace-shell .workspace-reports .report-card-header i {
    color: var(--workspace-accent);
    font-size: 1rem;
}
body.workspace-shell .workspace-reports .report-card-header h3 {
    color: var(--workspace-ink);
    font-size: 1rem;
    font-weight: 700;
}
body.workspace-shell .workspace-reports .report-card-header .badge {
    color: var(--workspace-secondary);
    background: var(--workspace-secondary-soft);
    font-weight: 650;
}
body.workspace-shell .workspace-reports .report-card-body { padding: 1.1rem 1.2rem; }
body.workspace-shell .workspace-reports .quick-filters { gap: .35rem; }
body.workspace-shell .workspace-reports .quick-filter-btn {
    min-height: 32px;
    padding: .32rem .65rem;
    color: var(--workspace-ink-soft);
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-line);
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 600;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
body.workspace-shell .workspace-reports .quick-filter-btn:hover,
body.workspace-shell .workspace-reports .quick-filter-btn.active {
    color: var(--workspace-accent);
    background: var(--workspace-soft);
    border-color: var(--workspace-accent-line);
}
body.workspace-shell .workspace-reports .report-custom-date-range {
    gap: .65rem;
    padding: .8rem 1.2rem;
    color: var(--workspace-ink-soft);
    background: #f7f9f6;
    border-color: var(--workspace-line);
}
body.workspace-shell .workspace-reports .report-custom-date-range label {
    color: var(--workspace-ink-soft);
    font-size: .8rem;
    font-weight: 650;
}
body.workspace-shell .workspace-reports .report-custom-date-range input[type="date"] {
    min-height: 36px;
    color: var(--workspace-ink);
    background: var(--workspace-surface);
    border: 1px solid #cbd6cf;
    border-radius: 6px;
}
body.workspace-shell .workspace-reports .btn-apply,
body.workspace-shell .workspace-reports .action-btn {
    min-height: 36px;
    padding: .45rem .8rem;
    color: var(--workspace-action-ink) !important;
    background: var(--workspace-action) !important;
    border: 1px solid var(--workspace-action) !important;
    border-radius: 7px;
    font-size: .8rem;
    font-weight: 650;
    transition: background-color .16s ease, border-color .16s ease;
}
body.workspace-shell .workspace-reports .btn-apply:hover,
body.workspace-shell .workspace-reports .action-btn:hover {
    background: var(--workspace-action-hover) !important;
    border-color: var(--workspace-action-hover) !important;
    transform: none;
    box-shadow: none;
}
body.workspace-shell .workspace-reports .stats-row { gap: .65rem; margin-bottom: 1rem; }
body.workspace-shell .workspace-reports .stat-box {
    min-width: 0;
    padding: .85rem 1rem;
    text-align: left;
    background: #f2f6f2 !important;
    border: 1px solid var(--workspace-line);
    border-radius: 8px;
}
body.workspace-shell .workspace-reports #refundStats .stat-box:nth-child(-n+2) {
    background: #faf1ef !important;
    border-color: #ead1cd;
}
body.workspace-shell .workspace-reports .stat-box .value {
    margin-bottom: .2rem;
    color: var(--workspace-ink);
    font-size: clamp(1.2rem, 2.1vw, 1.6rem);
    font-variant-numeric: tabular-nums;
}
body.workspace-shell .workspace-reports #refundStats .stat-box:nth-child(-n+2) .value {
    color: #963c35 !important;
}
body.workspace-shell .workspace-reports .stat-box .label {
    color: var(--workspace-muted);
    font-size: .75rem;
}
body.workspace-shell .workspace-reports .report-table {
    color: var(--workspace-ink);
    border-collapse: separate;
    border-spacing: 0;
    font-size: .84rem;
}
body.workspace-shell .workspace-reports .report-table th {
    color: var(--workspace-ink-soft);
    background: #f1f5f1;
    border-bottom: 1px solid var(--workspace-line);
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .045em;
}
body.workspace-shell .workspace-reports .report-table td {
    color: var(--workspace-ink);
    border-color: #e6ebe6;
}
body.workspace-shell .workspace-reports .report-table tbody tr:hover { background: #f5f8f5; }
body.workspace-shell .workspace-reports .report-table .customer-name { color: var(--workspace-accent); }
body.workspace-shell .workspace-reports .report-table .warning { color: #8a651b; }
body.workspace-shell .workspace-reports .report-table .danger { color: #963c35; }
body.workspace-shell .workspace-reports .report-table .success { color: #356b4f; }
body.workspace-shell .workspace-reports .empty-state { color: var(--workspace-muted); }
body.workspace-shell .workspace-reports .empty-state h4 { color: var(--workspace-ink-soft); }

/* Dispatch list uses the same staff-page hierarchy while retaining explicit
   ready/pending semantics and every existing order action. */
body.workspace-shell .dispatch-workspace .page-header {
    text-align: left;
    margin-bottom: 1rem;
    padding: 1.05rem 1.3rem;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-accent-line);
    border-left: 4px solid var(--workspace-accent);
    border-radius: 9px;
    box-shadow: 0 2px 7px rgba(40, 59, 67, .035);
}
body.workspace-shell .dispatch-workspace .page-header .header-content { margin: 0; padding: 0; width: 100%; }
body.workspace-shell .dispatch-workspace .page-header h1 { display: flex; align-items: center; gap: .65rem; }
body.workspace-shell .dispatch-workspace .page-header h1 { margin: 0; }
body.workspace-shell .dispatch-workspace .page-header p {
    margin: .3rem 0 0;
    color: var(--workspace-muted);
    font-size: .86rem;
}
body.workspace-shell .dispatch-workspace .stats-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .7rem !important;
    margin-bottom: 1rem !important;
}
body.workspace-shell .dispatch-workspace .stat-card {
    min-width: 0;
    padding: .85rem 1rem;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-line);
    border-radius: 8px;
    box-shadow: none;
}
body.workspace-shell .dispatch-workspace .stat-value {
    color: var(--workspace-ink);
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
}
body.workspace-shell .dispatch-workspace .stat-label {
    color: var(--workspace-muted);
    font-size: .76rem;
}
body.workspace-shell .dispatch-workspace .modern-card { overflow-x: auto; }
body.workspace-shell .dispatch-workspace table {
    min-width: 760px;
    color: var(--workspace-ink);
    border-color: var(--workspace-line);
    font-size: .84rem;
}
body.workspace-shell .dispatch-workspace table thead th {
    padding: .75rem .7rem;
    color: var(--workspace-ink-soft);
    background: #f1f5f1;
    border-color: var(--workspace-line);
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}
body.workspace-shell .dispatch-workspace table tbody td {
    padding: .75rem .7rem;
    vertical-align: middle;
    border-color: #e6ebe6;
}
body.workspace-shell .dispatch-workspace table tbody tr:hover { background: #f5f8f5; }
body.workspace-shell .dispatch-workspace .badge-success {
    color: #2e6147;
    background: #e3eee6;
}
body.workspace-shell .dispatch-workspace .badge-warning {
    color: #765918;
    background: #f3ecd9;
}
body.workspace-shell .dispatch-workspace .badge-info {
    color: var(--workspace-secondary);
    background: var(--workspace-secondary-soft);
}

/* The Indie order document keeps its dense order-card workflow, but shares the
   workspace paper, ink, surfaces and restrained accent used by staff pages. */
body.workspace-shell .workspace-indie-order {
    --ri-ink: var(--workspace-ink);
    --ri-muted: var(--workspace-muted);
    --ri-paper: var(--workspace-paper);
    --ri-card: var(--workspace-surface);
    --ri-line: var(--workspace-line);
    --ri-teal: var(--workspace-accent);
    --ri-deep: var(--workspace-action-hover);
    --ri-coral: #a83c35;
    --ri-soft: var(--workspace-soft);
    --ri-demand: #f3ecd9;
    max-width: none;
    padding: 0;
    font-family: inherit;
}
body.workspace-shell .workspace-indie-order .ri-masthead,
body.workspace-shell .workspace-indie-order .ri-layout {
    width: min(1480px, 100%);
}
body.workspace-shell .workspace-indie-order .ri-masthead {
    align-items: center;
    padding: 1rem 1.3rem;
    margin-bottom: 0;
    background: var(--workspace-surface);
    border: 1px solid var(--workspace-accent-line);
    border-left: 4px solid var(--workspace-accent);
    border-radius: 9px;
}
body.workspace-shell .workspace-indie-order .ri-eyebrow {
    color: var(--workspace-accent);
    font-size: .66rem;
    letter-spacing: .1em;
}
body.workspace-shell .workspace-indie-order .ri-masthead h1 {
    margin: .3rem 0;
    color: var(--workspace-ink);
    font-size: clamp(1.2rem, 2vw, 1.55rem);
    letter-spacing: -.035em;
}
body.workspace-shell .workspace-indie-order .ri-masthead p { color: var(--workspace-ink-soft); font-size: .86rem; }
body.workspace-shell .workspace-indie-order .ri-back-link {
    color: var(--workspace-ink-soft) !important;
    background: var(--workspace-surface);
    border-color: var(--workspace-line);
    border-radius: 7px;
}
body.workspace-shell .workspace-indie-order .ri-layout {
    grid-template-columns: minmax(0, 1fr) 292px;
    gap: 1rem;
    padding-top: 1rem;
}
body.workspace-shell .workspace-indie-order :is(.ri-order-strip, .ri-summary, .ri-meta-card) {
    background: var(--workspace-surface);
    border-color: var(--workspace-line);
    border-radius: 9px;
    box-shadow: 0 2px 7px rgba(40, 59, 67, .035);
}
body.workspace-shell .workspace-indie-order .ri-order-strip {
    border-left-color: #ad8b42;
}
body.workspace-shell .workspace-indie-order :is(.ri-order-strip h2, .ri-summary h2, .ri-list-heading h2) {
    color: var(--workspace-ink);
}
body.workspace-shell .workspace-indie-order :is(.ri-order-strip p, .ri-summary-intro, .ri-sort-note) {
    color: var(--workspace-muted);
}
body.workspace-shell .workspace-indie-order .ri-state-badge {
    color: var(--workspace-secondary);
    background: var(--workspace-secondary-soft);
}
body.workspace-shell .workspace-indie-order .ri-tools input,
body.workspace-shell .workspace-indie-order .ri-tools select {
    color: var(--workspace-ink);
    background: var(--workspace-surface);
    border-color: #cbd6cf;
    border-radius: 7px;
}
body.workspace-shell .workspace-indie-order .ri-tools label { color: var(--workspace-ink-soft); }
body.workspace-shell .workspace-indie-order .ri-release-card {
    background: var(--workspace-surface);
    border-color: var(--workspace-line);
    border-radius: 9px;
    box-shadow: 0 2px 7px rgba(40, 59, 67, .035);
}
body.workspace-shell .workspace-indie-order .ri-release-card.ri-has-demand {
    background: #fbf7e9;
    border-color: #c9b575;
}
body.workspace-shell .workspace-indie-order .ri-quantity-cell,
body.workspace-shell .workspace-indie-order .ri-price-cell,
body.workspace-shell .workspace-indie-order .ri-line-total {
    background: #f5f7f3;
    border-color: #e0e7e1;
}
body.workspace-shell .workspace-indie-order .ri-customer-cell {
    background: #f6f1e4;
    border-color: #e5dac0;
}
body.workspace-shell .workspace-indie-order .ri-extra-cell {
    background: #edf3ee;
    border-color: #d2e0d5;
}
body.workspace-shell .workspace-indie-order .ri-demand-note {
    color: #58471f;
    background: #f5efdE;
    border-color: #dfd1a8;
}
body.workspace-shell .workspace-indie-order .ri-demand-mark {
    color: #fff;
    background: #816a31;
}
body.workspace-shell .workspace-indie-order .ri-checkout-button {
    color: var(--workspace-action-ink);
    background: var(--workspace-action);
    border: 1px solid var(--workspace-action);
    border-radius: 7px;
}
body.workspace-shell .workspace-indie-order .ri-checkout-button:hover:not(:disabled) {
    background: var(--workspace-action-hover);
}
body.workspace-shell .workspace-indie-order .ri-finalised-note {
    color: var(--workspace-secondary);
    background: var(--workspace-secondary-soft);
}
body.workspace-shell .workspace-indie-order .ri-summary-column { gap: .75rem; }

@media (max-width: 767.98px) {
    body.workspace-shell .stock-overview-workspace .card-header { flex-direction: column; align-items: stretch !important; }
    body.workspace-shell .stock-overview-workspace .card-header > div:last-child { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    body.workspace-shell .stock-overview-workspace .card-header .btn { white-space: normal; padding: .5rem .6rem !important; }
    body.workspace-shell .stock-overview-workspace .stock-page-controls { flex-direction: column; align-items: flex-start !important; }
    body.workspace-shell .workspace-reports .reports-header,
    body.workspace-shell .dispatch-workspace .page-header { padding: .9rem 1rem; }
    body.workspace-shell .workspace-reports .report-card-body { padding: .85rem; }
    body.workspace-shell .dispatch-workspace .stats-row { grid-template-columns: 1fr; }
    body.workspace-shell .workspace-indie-order .ri-layout { grid-template-columns: 1fr; }
    body.workspace-shell .workspace-indie-order .ri-summary-column { grid-row: 1; }
    body.workspace-shell .workspace-indie-order .ri-masthead { align-items: flex-start; }
}

@media (max-width: 767.98px) {
    body.workspace-shell .master-header { padding-inline: .7rem; }
    body.workspace-shell .master-header .header-right { flex-shrink:0; gap:.2rem; }
    body.workspace-shell .master-header .kiosk-btn .btn-label,
    body.workspace-shell .master-header .epos-btn span,
    body.workspace-shell .master-header .user-greeting-btn span { display:none; }
    body.workspace-shell .master-header .epos-btn,
    body.workspace-shell .master-header .kiosk-btn,
    body.workspace-shell .master-header .user-greeting-btn { margin:0; padding:.45rem .55rem; min-width:38px; min-height:38px; }
    body.workspace-shell .master-header .epos-btn i { margin:0; }
    body.workspace-shell .master-header .header-store-name { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    body.workspace-shell .page-content { padding: .85rem; }
    body.workspace-shell .store-dashboard .personal-dashboard-link { margin-left: 0; }
    body.workspace-shell .store-dashboard .quick-actions { gap: .4rem; }
    body.workspace-shell .store-dashboard .quick-action { flex: 1 1 calc(50% - .4rem); justify-content: flex-start; }
    body.workspace-shell .store-dashboard .demand-panel-toggle { align-items: flex-start; padding: .8rem; }
    body.workspace-shell .store-dashboard .demand-counts { flex-direction: column; align-items: flex-end; gap: .1rem; white-space: normal; }
    body.workspace-shell .customer-dashboard-refresh .dashboard-info-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.workspace-shell .customer-dashboard-refresh .account-overview-heading { align-items: flex-start; flex-direction: column; gap: .2rem; }
}

@media (prefers-reduced-motion: reduce) {
    body.workspace-shell *,
    body.workspace-shell *::before,
    body.workspace-shell *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
