/* Model 5ad8fa9. Scope prevents its primitives leaking into remaining legacy workflows. */
body {
    margin: 0;
}
* {
    box-sizing: border-box;
}
[hidden] {
    display: none !important;
}
#blazor-error-ui {
    display: none;
}
@scope (.blazor-desktop) to (.legacy-view) {
    :scope {
        font-family: "Segoe UI", Arial, sans-serif;
        color: #243349;
        background: #f4f6f9;
        font-size: 14px;
        --brand:#3656cd;
        --ink:#192940;
        --muted:#637084;
        --line:#e1e6ed;
        --soft:#f5f7fa;
        --selected:#edf1ff;
        --teal:#14796d;
        --radius:10px;
    }
    * {
        box-sizing: border-box;
    }
    body {
        margin: 0;
    }
    button,
    input,
    select,
    textarea {
        font: inherit;
    }
    button,
    a,
    input,
    select,
    textarea {
        outline-offset: 3px;
    }
    button:focus-visible,
    a:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
        outline: 3px solid #6787ea;
    }
    button {
        cursor: pointer;
    }
    a {
        color: var(--brand);
        text-decoration: none;
    }
    a:hover {
        text-decoration: underline;
    }
    button {
        color: inherit;
        background: white;
        border: 1px solid var(--line);
        border-radius: 7px;
        padding: 9px 13px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-weight: 600;
        line-height: 1.4;
    }
    button:hover {
        background: #f3f5fa;
        border-color: #bdc9dc;
    }
    button:disabled {
        opacity: .45;
        cursor: default;
    }
    button.primary {
        background: var(--brand);
        border-color: var(--brand);
        color: white;
        box-shadow: 0 2px 3px #354c9818;
    }
    button.primary:hover {
        background: #2947b9;
    }
    button.quiet {
        border-color: transparent;
        background: transparent;
    }
    button.quiet:hover {
        background: #e9eef7;
    }
    button.icon-button {
        padding: 8px;
        flex: none;
    }
    button.danger {
        color: #a52f42;
    }
    button.text-button {
        border: 0;
        background: transparent;
        color: var(--brand);
        padding: 5px 0;
        font-size: 13px;
    }
    .icon {
        width: 19px;
        height: 19px;
        flex: none;
    }
    .muted {
        color: var(--muted);
    }
    .small {
        font-size: 12px;
    }
    .eyebrow {
        font-size: 11px;
        letter-spacing: .11em;
        text-transform: uppercase;
        font-weight: 700;
        color: var(--muted);
    }
    h1,
    h2,
    h3,
    p {
        margin: 0;
    }
    h1 {
        font-size: 27px;
        letter-spacing: -.6px;
        font-weight: 650;
        color: var(--ink);
    }
    h2 {
        font-size: 17px;
        letter-spacing: -.2px;
    }
    h3 {
        font-size: 14px;
    }
    p {
        line-height: 1.65;
    }
    .stack {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .row {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .between {
        justify-content: space-between;
    }
    .wrap {
        flex-wrap: wrap;
    }
    .spacer {
        flex: 1;
    }
    .badge {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 4px 8px;
        border-radius: 5px;
        font-size: 11px;
        font-weight: 650;
        white-space: nowrap;
        background: #ecf0f6;
        color: #53617a;
    }
    .badge.active,
    .badge.available {
        background: #e8f5f1;
        color: #176854;
    }
    .badge.hold,
    .badge.low,
    .badge.configuration {
        background: #fff2d9;
        color: #8a5815;
    }
    .badge.planned,
    .badge.ordered {
        background: #edf0fc;
        color: #4058a1;
    }
    .badge.permission {
        background: #fbeaec;
        color: #9f3448;
    }
    .badge.completed {
        background: #eef1f4;
        color: #5e6a79;
    }
    .badge.partial,
    .badge.review {
        background: #e9f1fc;
        color: #385e9d;
    }
    .badge .icon {
        width: 13px;
        height: 13px;
    }
    /* Application shell and navigation. */
    .skip {
        position: fixed;
        top: -100px;
        left: 10px;
        z-index: 99;
        padding: 12px;
        background: white;
    }
    .skip:focus {
        top: 8px;
    }
    .shell {
        height: 100vh;
        display: grid;
        grid-template-columns: 248px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        transition: grid-template-columns .15s;
    }
    .shell.collapsed {
        grid-template-columns: 68px minmax(0, 1fr);
    }
    .sidebar {
        background: #f9fafc;
        border-right: 1px solid var(--line);
        display: flex;
        flex-direction: column;
        min-height: 0;
        position: relative;
        z-index: 10;
    }
    .brand {
        border: 0;
        border-radius: 0;
        background: transparent;
        justify-content: flex-start;
        text-align: left;
        height: 73px;
        padding: 0 16px;
        display: flex;
        align-items: center;
        gap: 10px;
        flex-shrink: 0;
    }
    .brand img {
        width: 32px;
        height: 32px;
    }
    .brand strong {
        font-size: 19px;
        letter-spacing: .8px;
        color: #1e3154;
    }
    .brand small {
        font-size: 9px;
        color: #748095;
    }
    .brand-copy {
        display: flex;
        flex-direction: column;
        gap: 3px;
    }
    .workspace {
        margin: 0 12px 15px;
        padding: 11px 10px;
        border: 1px solid var(--line);
        border-radius: 8px;
        display: flex;
        align-items: center;
        gap: 10px;
        background: white;
    }
    .workspace .initial {
        width: 31px;
        height: 31px;
        display: grid;
        place-items: center;
        background: #e9eef7;
        border-radius: 7px;
        color: #405b86;
        font-weight: 700;
    }
    .workspace strong {
        font-size: 12px;
    }
    .workspace small {
        display: block;
        color: var(--muted);
        font-size: 10px;
        margin-top: 2px;
    }
    .nav-scroll {
        padding: 0 10px 12px;
        overflow: auto;
        flex: 1;
        scrollbar-width: thin;
    }
    .nav-group {
        margin: 3px 0;
    }
    .group-button {
        width: 100%;
        border: 0;
        background: transparent;
        justify-content: flex-start;
        padding: 10px 9px;
        font-size: 13px;
        white-space: nowrap;
    }
    .group-button > .icon {
        color: #64748b;
    }
    .group-button .down {
        margin-left: auto;
        width: 14px;
        transition: transform .15s;
    }
    .group-button[aria-expanded=true] .down {
        transform: rotate(180deg);
    }
    .group-button.current {
        color: #293f8d;
    }
    .group-button.current > .icon {
        color: var(--brand);
    }
    .submenu {
        padding: 0 0 5px 27px;
    }
    .nav-link {
        width: 100%;
        border: 0;
        background: transparent;
        font-weight: 400;
        justify-content: flex-start;
        text-align: left;
        font-size: 12px;
        padding: 8px 10px;
        min-height: 33px;
        line-height: 1.3;
        position: relative;
    }
    .nav-link.selected {
        background: #e8edfc;
        color: #2b48ae;
        font-weight: 650;
    }
    .nav-link.selected:before {
        content: "";
        position: absolute;
        left: -6px;
        top: 9px;
        bottom: 9px;
        background: var(--brand);
        width: 3px;
        border-radius: 3px;
    }
    .nav-link .badge {
        font-size: 9px;
        padding: 2px 4px;
        margin-left: auto;
    }
    .nav-link .icon {
        width: 14px;
        height: 14px;
        margin-left: auto;
    }
    .sidebar-bottom {
        border-top: 1px solid var(--line);
        padding: 8px 10px 10px;
        flex: none;
    }
    .bottom-link {
        width: 100%;
        justify-content: flex-start;
        border: 0;
        background: transparent;
        font-size: 12px;
        font-weight: 500;
        padding: 8px 9px;
    }
    .profile {
        margin-top: 7px;
        border-top: 1px solid var(--line);
        border-radius: 0;
        padding-top: 13px;
    }
    .avatar {
        width: 29px;
        height: 29px;
        border-radius: 50%;
        background: #dee5f5;
        color: #38528a;
        display: grid;
        place-items: center;
        font-size: 10px;
        font-weight: 700;
        flex: none;
    }
    .profile-copy {
        min-width: 0;
        text-align: left;
    }
    .profile-copy strong {
        font-size: 12px;
        display: block;
    }
    .profile-copy small {
        font-size: 10px;
        color: var(--muted);
    }
    .collapsed .brand {
        padding: 0;
        justify-content: center;
    }
    .collapsed .brand-copy,
    .collapsed .workspace,
    .collapsed .nav-group > .submenu,
    .collapsed .nav-label,
    .collapsed .group-button .down,
    .collapsed .profile-copy {
        display: none;
    }
    .collapsed .nav-scroll {
        padding: 8px;
    }
    .collapsed .nav-group {
        margin-right: -8px;
        padding-right: 8px;
    }
    .collapsed .group-button {
        height: 43px;
        justify-content: center;
        padding: 10px;
    }
    .collapsed .group-button.current {
        background: var(--selected);
    }
    .collapsed .sidebar-bottom {
        padding: 8px;
    }
    .collapsed .bottom-link {
        justify-content: center;
    }
    .collapsed .profile {
        padding: 12px 0 4px;
    }
    .flyout {
        position: fixed;
        left: var(--flyout-left, 68px);
        top: var(--flyout-top, 80px);
        width: min(248px, calc(100vw - var(--flyout-left, 68px) - 8px));
        padding: 12px;
        background: white;
        border: 1px solid var(--line);
        box-shadow: 0 12px 35px #263c6524;
        border-radius: 11px;
        z-index: 35;
        max-height: calc(100dvh - 16px);
        overflow: auto;
    }
    .flyout h3 {
        padding: 4px 9px 10px;
    }
    .flyout .submenu {
        padding: 0;
    }
    .flyout .nav-link {
        padding: 10px;
    }
    .flyout .nav-link.selected:before {
        display: none;
    }
    .main {
        display: flex;
        flex-direction: column;
        min-width: 0;
        min-height: 0;
        background: #fff;
    }
    .topbar {
        height: 64px;
        flex: none;
        display: flex;
        align-items: center;
        gap: 18px;
        padding: 0 28px;
        border-bottom: 1px solid var(--line);
        background: #fff;
    }
    .crumb {
        font-size: 12px;
        color: #69768b;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .crumb .icon {
        width: 12px;
    }
    .crumb strong {
        color: #34435c;
        font-weight: 500;
    }
    .global-search {
        margin-left: auto;
        min-width: 230px;
        color: #7b8798;
        justify-content: flex-start;
        font-weight: 400;
        font-size: 12px;
        background: #f8fafc;
    }
    .global-search kbd {
        margin-left: auto;
        font-size: 10px;
        font-family: inherit;
        background: white;
        padding: 1px 5px;
        border: 1px solid var(--line);
        border-radius: 4px;
    }
    .shell-clock {
        flex-shrink: 0;
        text-align: right;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }
    .shell-clock > time {
        display: grid;
        justify-items: end;
        gap: 3px;
    }
    .shell-clock .clock-time {
        color: #24364e;
        font-size: 18px;
        font-weight: 650;
        line-height: 1.15;
    }
    .shell-clock .clock-date {
        color: #65758e;
        font-size: 11px;
        line-height: 1.3;
    }

    .lang-button {
        font-size: 11px;
        letter-spacing: .05em;
    }
    #content {
        flex: 1;
        min-height: 0;
        overflow: auto;
        background: #f7f8fb;
        scrollbar-width: thin;
        outline: none;
    }
    .page {
        padding: 27px 30px;
        max-width: 1800px;
        margin: auto;
    }
    .page-head {
        display: flex;
        gap: 16px;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 22px;
    }
    .page-head p {
        color: var(--muted);
        font-size: 13px;
        margin-top: 6px;
    }
    .page-head .eyebrow {
        display: block;
        margin-bottom: 8px;
    }
    .page-actions {
        display: flex;
        gap: 8px;
        flex: none;
    }

    .footer {
        height: 25px;
        flex: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 28px;
        border-top: 1px solid var(--line);
        background: white;
        font-size: 10px;
        color: #768297;
    }
    /* Shared cards, dashboards and list primitives. */
    .card {
        background: white;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        overflow: hidden;
    }
    .card-pad {
        padding: 22px;
    }
    .card-head {
        padding: 19px 22px;
        border-bottom: 1px solid var(--line);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .card-head p {
        font-size: 12px;
        color: var(--muted);
        margin-top: 4px;
    }
    .metrics {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
        margin-bottom: 24px;
    }
    .metric {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 18px;
        text-align: left;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        font-weight: 400;
    }
    .metric:hover {
        border-color: #92a4d8;
        box-shadow: 0 3px 12px #1f36500c;
    }
    .metric strong {
        font-size: 30px;
        font-weight: 600;
        color: var(--ink);
        letter-spacing: -1px;
    }
    .metric .icon {
        color: #7888a2;
    }
    .metric-label {
        font-size: 12px;
        color: #5b6980;
    }
    .metric-foot {
        font-size: 10px;
        color: var(--brand);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .metric-foot .icon {
        width: 14px;
    }
    .dashboard-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
        gap: 22px;
    }
    .dashboard-work {
        display: flex;
        gap: 14px;
        align-items: center;
        padding: 17px 22px;
        border-bottom: 1px solid #edf0f5;
    }
    .dashboard-work:last-child {
        border: 0;
    }
    .dashboard-work .work-icon {
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        border-radius: 9px;
        background: #f0f3fa;
        color: #59719a;
        flex: none;
    }
    .dashboard-work strong {
        display: block;
        font-size: 13px;
        color: var(--ink);
    }
    .dashboard-work small {
        display: block;
        font-size: 11px;
        color: var(--muted);
        margin-top: 6px;
    }
    .dashboard-work .text-button {
        font-size: 13px;
        text-align: left;
    }
    .dashboard-work > .badge {
        margin-left: auto;
    }
    .notice {
        padding: 17px;
        border-radius: 9px;
        background: #f5f7fc;
        border: 1px solid #e4e9f3;
    }
    .notice .icon {
        color: #536ab1;
    }
    .notice h3 {
        font-size: 12px;
        margin: 11px 0 5px;
    }
    .notice p {
        font-size: 12px;
        color: var(--muted);
    }
    .notice button {
        margin-top: 11px;
        font-size: 12px;
    }
    .shortcut-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .shortcut {
        min-height: 65px;
        text-align: left;
        justify-content: flex-start;
        font-size: 12px;
        background: #fbfcfe;
    }
    .shortcut .icon {
        color: #536ba2;
    }
    .pill-tabs {
        display: flex;
        gap: 5px;
        background: #eff2f7;
        border-radius: 7px;
        padding: 4px;
        width: fit-content;
    }
    .pill-tabs button {
        border: 0;
        background: transparent;
        padding: 6px 11px;
        font-size: 12px;
        font-weight: 500;
    }
    .pill-tabs button.selected {
        background: white;
        box-shadow: 0 1px 4px #25345218;
    }
    .toolbar {
        display: flex;
        gap: 10px;
        align-items: center;
        flex-wrap: wrap;
        padding: 14px 16px;
        border-bottom: 1px solid var(--line);
        background: #fff;
    }
    .field-search {
        display: flex;
        align-items: center;
        gap: 7px;
        border: 1px solid var(--line);
        background: #fff;
        border-radius: 6px;
        padding: 0 10px;
        max-width: 300px;
        flex: 1;
        min-width: 140px;
    }
    .field-search .icon {
        color: #8390a4;
        width: 16px;
    }
    .field-search input {
        border: 0;
        min-width: 0;
        width: 100%;
        padding: 9px 0;
        outline-offset: 1px;
        background: transparent;
        font-size: 12px;
    }
    .filter-label {
        display: flex;
        gap: 7px;
        align-items: center;
        font-size: 11px;
        color: var(--muted);
    }
    select {
        border: 1px solid var(--line);
        border-radius: 6px;
        padding: 8px;
        background: white;
        color: #36445c;
        font-size: 12px;
        max-width: 210px;
    }

    .list-layout {
        display: grid;
        grid-template-columns: minmax(300px, .9fr) minmax(430px, 1.2fr);
        gap: 17px;
        align-items: start;
    }
    .list-layout.single {
        display: block;
    }
    .list-card {
        min-width: 0;
    }
    .list-scroll {
        overflow: auto;
        max-height: calc(100vh - 335px);
        min-height: 150px;
        scrollbar-width: thin;
    }
    .list-row {
        display: block;
        text-align: left;
        border: 0;
        border-bottom: 1px solid #edf0f5;
        border-radius: 0;
        padding: 15px 17px;
        width: 100%;
        font-weight: 400;
        background: #fff;
    }
    .list-row:hover {
        background: #f7f9ff;
    }
    .list-row.selected {
        background: #f0f4ff;
        box-shadow: inset 3px 0 var(--brand);
    }
    .list-row .title {
        font-size: 13px;
        font-weight: 600;
        line-height: 1.4;
        color: #2c3d57;
    }
    .list-row .ref {
        font-size: 10px;
        color: #77869c;
        margin-bottom: 5px;
    }
    .list-row .meta {
        display: flex;
        gap: 9px;
        align-items: center;
        margin-top: 9px;
        font-size: 10px;
        color: #6a788b;
    }
    .list-row .meta .badge {
        font-size: 10px;
    }
    .list-row .asset-line {
        font-size: 11px;
        color: #687891;
        margin-top: 6px;
    }
    .data-table {
        border-collapse: collapse;
        width: 100%;
        text-align: left;
        background: white;
        font-size: 12px;
    }
    .data-table th {
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: .06em;
        color: #7b8798;
        background: #fafbfd;
        font-weight: 600;
        padding: 12px 14px;
        border-bottom: 1px solid var(--line);
        white-space: nowrap;
        position: sticky;
        top: 0;
        z-index: 1;
    }
    .data-table td {
        padding: 14px;
        border-bottom: 1px solid #edf0f5;
    }
    .data-table td:first-child {
        min-width: 250px;
    }
    .data-table td:nth-child(2) {
        min-width: 145px;
    }
    .data-table tr:hover td {
        background: #f8faff;
    }
    .data-table .text-button {
        color: #253b64;
        font-weight: 600;
        text-align: left;
    }

    .pager {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 11px 14px;
        font-size: 10px;
        color: #6c7b90;
        flex-wrap: wrap;
        border-top: 1px solid var(--line);
    }
    .pager label {
        display: flex;
        gap: 5px;
        align-items: center;
    }
    .pager select {
        padding: 5px;
        font-size: 10px;
    }
    .pager input {
        width: 43px;
        padding: 5px;
        border: 1px solid var(--line);
        border-radius: 5px;
        font-size: 11px;
    }
    .pager button {
        padding: 5px;
        font-size: 10px;
    }
    .pager .icon {
        width: 13px;
        height: 13px;
    }
    /* Details, tabs and record properties. */
    .detail {
        min-width: 0;
    }
    .detail-header {
        padding: 21px 22px 17px;
    }
    .detail-header h2 {
        font-size: 20px;
        margin: 8px 0 12px;
        letter-spacing: -.3px;
    }
    .detail-header .reference {
        font-size: 11px;
        color: #667b9c;
        letter-spacing: .03em;
    }
    .detail-actions {
        display: flex;
        gap: 6px;
        margin-top: 15px;
        flex-wrap: wrap;
    }
    .detail-actions button {
        font-size: 11px;
        padding: 7px 10px;
    }
    .tabs {
        display: flex;
        gap: 5px;
        border-bottom: 1px solid var(--line);
        padding: 0 17px;
        overflow: auto;
        scrollbar-width: thin;
    }
    .tabs button {
        white-space: nowrap;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #6a778a;
        font-size: 12px;
        font-weight: 500;
        padding: 11px 7px;
        border-bottom: 2px solid transparent;
    }
    .tabs button.selected {
        border-color: var(--brand);
        color: var(--brand);
        font-weight: 650;
    }
    .detail-body {
        padding: 21px 22px;
        min-height: 275px;
    }
    .detail-body p {
        font-size: 12px;
        color: #5e6e83;
    }
    .detail-body h3 {
        margin-bottom: 11px;
    }
    .properties {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 17px;
        margin: 20px 0;
    }
    .property dt {
        font-size: 10px;
        color: #7c889a;
        margin-bottom: 6px;
    }
    .property dd {
        margin: 0;
        font-size: 12px;
        font-weight: 500;
        color: #344965;
    }

    .line-item {
        display: flex;
        gap: 12px;
        align-items: center;
        padding: 14px 0;
        border-bottom: 1px solid #edf0f5;
    }
    .line-item:last-child {
        border: 0;
    }
    .line-item strong {
        font-size: 12px;
    }
    .line-item small {
        display: block;
        color: var(--muted);
        font-size: 11px;
        margin-top: 5px;
    }
    .line-item .icon {
        color: #7b8eaf;
    }
    .line-item button {
        margin-left: auto;
        font-size: 11px;
    }
    .empty-state {
        text-align: center;
        padding: 60px 24px;
        color: #738298;
    }
    .empty-state > .icon {
        width: 35px;
        height: 35px;
        margin-bottom: 15px;
    }
    .empty-state h2 {
        font-size: 17px;
        margin-bottom: 9px;
        color: #425878;
    }
    .empty-state p {
        font-size: 12px;
        margin-bottom: 17px;
    }
    .section-note {
        background: #f4f7fc;
        border-left: 3px solid #bac9e6;
        padding: 12px 14px;
        color: #61738e;
        font-size: 11px;
        line-height: 1.7;
        border-radius: 0 5px 5px 0;
        margin-top: 20px;
    }
    .gate {
        max-width: 760px;
        margin: 38px auto;
        padding: 35px;
    }

    .gate h2 {
        font-size: 24px;
        margin: 16px 0 12px;
    }
    .gate p {
        color: var(--muted);
        font-size: 13px;
    }
    .gate .row {
        margin-top: 24px;
    }

    .module {
        padding: 24px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 13px;
    }
    .module h2 {
        font-size: 17px;
    }
    .module p {
        font-size: 12px;
        color: var(--muted);
        flex: 1;
    }
    .module > .icon {
        width: 27px;
        height: 27px;
        color: #6077a9;
    }

    /* Editors, forms and dialogs. */
    .editor {
        max-width: 830px;
    }
    .editor .card-pad {
        padding: 27px;
    }
    .form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .form-field {
        gap: 8px;
        font-size: 12px;
    }
    .form-field.wide {
        grid-column: 1/-1;
    }
    .form-field input,
    .form-field textarea {
        border: 1px solid #cad4e3;
        border-radius: 6px;
        padding: 11px;
        width: 100%;
        color: #2a405e;
        background: white;
    }
    .form-field textarea {
        min-height: 110px;
        resize: vertical;
    }

    .editor .section-note {
        margin-top: 0;
        margin-bottom: 22px;
    }
    dialog {
        border: 1px solid var(--line);
        border-radius: 13px;
        padding: 0;
        width: 520px;
        max-width: calc(100vw - 40px);
        color: var(--ink);
        box-shadow: 0 25px 100px #0d203945;
    }
    dialog::backdrop {
        background: #10234150;
        backdrop-filter: blur(2px);
    }
    .dialog-head {
        padding: 21px 24px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--line);
    }
    .dialog-head h2 {
        font-size: 18px;
    }
    .dialog-body {
        padding: 24px;
    }
    .dialog-body p {
        font-size: 13px;
        color: var(--muted);
    }

    .dialog-body .form-field {
        margin-bottom: 15px;
    }
    .search-results {
        max-height: 360px;
        overflow: auto;
        margin-top: 15px;
    }
    .search-result {
        display: flex;
        align-items: center;
        width: 100%;

        border: 0;
        padding: 11px;
        font-size: 12px;
        text-align: left;
    }
    .search-result small {
        margin-left: auto;
        color: var(--muted);
        font-size: 10px;
    }
    #toast {
        position: fixed;
        bottom: 40px;
        left: 50%;
        transform: translateX(-50%);
        background: #263c58;
        color: #fff;
        font-size: 12px;
        padding: 12px 19px;
        border-radius: 7px;
        box-shadow: 0 8px 25px #13223b26;
        z-index: 100;
        max-width: 600px;
        display: none;
    }
    #toast.show {
        display: block;
    }
    /* Shell and list viewport adaptations. */
    @media (min-width: 1700px) {
        .list-layout {
            grid-template-columns: minmax(450px, 1fr) minmax(550px, 1.15fr);
        }
        .page {
            padding: 32px 42px;
        }
        .list-scroll {
            max-height: calc(100vh - 355px);
        }
    }
    @media (max-width: 1180px) {
        .shell {
            grid-template-columns: 220px minmax(0, 1fr);
        }
        .page {
            padding: 22px;
        }
        .list-layout {
            grid-template-columns: minmax(260px, .8fr) minmax(365px, 1.2fr);
        }
        .topbar {
            padding: 0 20px;
            gap: 10px;
        }
        .global-search {
            min-width: 180px;
        }
        .dashboard-grid {
            grid-template-columns: 1.5fr 1fr;
        }
        .metrics {
            gap: 10px;
        }

        .page-head h1 {
            font-size: 24px;
        }
    }
    @media (max-width: 950px) {
        .list-layout {
            grid-template-columns: 1fr;
        }
        .list-scroll {
            max-height: 400px;
        }
        .dashboard-grid {
            grid-template-columns: 1fr;
        }
        .page-head {
            flex-wrap: wrap;
        }
        .metrics {
            grid-template-columns: 1fr 1fr;
        }

        .crumb {
            display: none;
        }
        .global-search {
            margin-left: 0;
            flex: 1;
        }
    }

    /* Task-specific warehouse compositions. The shell stays shared. */
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    /* Catalogue stock and warehouse workflow primitives. */
    .incoming-line + .incoming-line {
        margin-top: 12px;
    }
    .incoming-line > .text-button {
        padding: 0;
        font-size: 12px;
        text-align: left;
    }
    .optional-note {
        font-size: 12px;
        color: #516889;
        margin: 16px 0;
    }
    .optional-note summary {
        cursor: pointer;
    }
    .optional-note[open] summary {
        margin-bottom: 13px;
    }
    .catalogue-layout:not(.single) {
        grid-template-columns: minmax(280px, .43fr) minmax(570px, 1fr);
    }
    .catalogue-layout:not(.single) .toolbar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .catalogue-layout:not(.single) .field-search {
        grid-column: 1/-1;
        max-width: none;
    }
    .catalogue-layout:not(.single) .filter-label {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .catalogue-layout:not(.single) .filter-label select {
        max-width: 100%;
        width: 100%;
    }

    .compact-table small {
        display: block;
        font-size: 10px;
        color: #738298;
        margin-top: 4px;
    }

    .column-sort {
        font: inherit;
        color: inherit;
        border: 0;
        background: transparent;
        padding: 0;
        text-align: left;
        line-height: 1.4;
        white-space: normal;
    }
    .location-tag {
        font-size: 10px;
        display: inline-block;
        background: #f0f3f8;
        padding: 3px 5px;
        margin: 2px;
        border-radius: 3px;
        white-space: nowrap;
    }
    .available-number {
        color: #216656;
    }
    .column-picker {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 14px;
        margin-top: 22px;
    }
    .column-picker label {
        display: flex;
        align-items: center;
        gap: 9px;
        font-size: 13px;
    }
    .column-picker input,
    .check-label input {
        width: 16px;
        height: 16px;
        flex: none;
    }

    .part-stock-summary {
        padding: 0 22px 17px;
    }
    .stock-metrics {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        border: 1px solid #dce4f1;
        border-radius: 8px;
        overflow: hidden;
    }
    .stock-metric {
        padding: 15px 13px;
        background: #f9fbfe;
        border-right: 1px solid #e3e8f2;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .stock-metric:last-child {
        border: 0;
    }
    .stock-metric > span {
        font-size: 11px;
        color: #52637e;
        min-height: 29px;
        line-height: 1.35;
    }
    .stock-metric > strong {
        font-size: 27px;
        letter-spacing: -.7px;
        color: #243c60;
        font-variant-numeric: tabular-nums;
    }
    .stock-metric small {
        font-size: 10px;
        letter-spacing: 0;
        font-weight: 400;
        margin-left: 5px;
    }
    .stock-metric.emphasized {
        background: #ecf6f1;
    }
    .stock-metric.emphasized strong {
        color: #176854;
    }
    .stock-context {
        display: flex;
        flex-wrap: wrap;
        gap: 9px 22px;
        font-size: 11px;
        color: #596c84;
        margin-top: 13px;
    }
    .stock-context b {
        color: #344965;
        font-weight: 600;
    }
    .stock-explanation {
        font-size: 10px;
        color: #687a94;
        margin: 10px 0 0;
        line-height: 1.5;
    }

    .compact-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
        text-align: left;
    }
    .compact-table th {
        font-size: 10px;
        color: #596a83;
        font-weight: 600;
        background: #f7f9fc;
        padding: 12px 13px;
        border-bottom: 1px solid #dfe5ef;
    }
    .compact-table td {
        padding: 14px 13px;
        border-bottom: 1px solid #e9edf4;
        vertical-align: middle;
    }
    .compact-table td > .text-button {
        padding: 0;
        font-size: 12px;
        text-align: left;
    }
    .compact-table .number {
        text-align: right;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }
    .table-overflow {
        overflow: auto;
        max-width: 100%;
    }

    .compact-table tr:last-child td {
        border-bottom: 0;
    }
    .badge.outOfStock,
    .badge.scrap {
        background: #fbeaec;
        color: #9f3448;
    }
    .badge.quarantine,
    .badge.recovery {
        background: #fff2d9;
        color: #8a5815;
    }
    .badge.serviceable,
    .badge.counted {
        background: #e8f5f1;
        color: #176854;
    }
    .warehouse-page > .card {
        margin-bottom: 20px;
    }
    .warehouse-section {
        padding: 22px;
        min-width: 0;
    }
    .warehouse-section .compact-table {
        margin-top: 18px;
    }
    .section-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 17px;
        gap: 16px;
    }
    .section-heading h2 {
        font-size: 16px;
    }
    .warehouse-section > p {
        font-size: 12px;
        color: #64738a;
        line-height: 1.6;
    }
    .inline-empty {
        padding: 28px 10px;
        color: #738298;
        font-size: 13px;
    }
    .warehouse-section .form-field {
        max-width: 600px;
    }
    .warehouse-section .form-grid .form-field {
        max-width: none;
    }

    .flow-steps {
        display: flex;
        justify-content: space-between;
        gap: 20px;
        font-size: 12px;
        color: #60738d;
        padding: 0 0 20px;
    }
    .flow-steps span {
        font-size: 10px;
        color: #77879c;
    }
    .operation-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 305px;
        gap: 22px;
        align-items: start;
    }
    .operation-layout .stack {
        gap: 18px;
    }
    .operation-summary {
        padding: 23px;
        position: sticky;
        top: 15px;
    }
    .operation-summary h2 {
        font-size: 17px;
        margin-bottom: 23px;
    }
    .operation-summary .form-field {
        margin-bottom: 17px;
    }
    .operation-summary .form-field > select {
        max-width: none;
        width: 100%;
    }
    .operation-summary .form-field textarea {
        min-height: 65px;
    }
    .operation-summary > button {
        width: 100%;
        margin-bottom: 12px;
    }
    .summary-total {
        display: flex;
        justify-content: space-between;
        margin: 22px 0;
        padding-top: 17px;
        border-top: 1px solid var(--line);
        font-size: 13px;
    }
    .summary-total strong {
        font-size: 22px;
    }
    .basket-line {
        border-bottom: 1px solid var(--line);
        padding: 8px 0 22px;
        margin-bottom: 20px;
    }
    .basket-line:last-child {
        margin-bottom: 0;
        border: 0;
    }
    .basket-line strong {
        font-size: 14px;
    }
    .basket-line small {
        display: block;
        font-size: 10px;
        color: #71839c;
        margin-top: 7px;
    }
    .basket-fields {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 15px;
        margin: 19px 0 10px;
    }
    .basket-fields select {
        max-width: none;
        width: 100%;
    }
    .basket-fields .form-field {
        margin: 0;
    }
    .quantity-input {
        display: flex;
        border: 1px solid var(--line);
        border-radius: 6px;
        overflow: hidden;
    }
    .quantity-input input {
        min-width: 0;
        width: 80px;
        flex: 1;
        border: 0;
        text-align: center;
        padding: 8px;
        border-radius: 0;
    }
    .quantity-input button {
        border: 0;
        border-radius: 0;
        background: #f4f6fb;
        padding: 8px 11px;
    }
    .form-alert {
        border: 1px solid #edb7b7;
        background: #fff3f3;
        color: #96363d;
        border-radius: 8px;
        padding: 16px 20px;
        font-size: 13px;
        margin-bottom: 20px;
    }
    .form-alert ul {
        margin: 9px 0 0;
        padding-left: 20px;
        line-height: 1.8;
    }
    .form-actions {
        display: flex;
        gap: 12px;
        justify-content: flex-end;
        margin-top: 24px;
    }

    .count-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 23px;
    }
    .count-heading h2 {
        font-size: 18px;
    }
    .count-heading p {
        font-size: 12px;
        color: #687e9b;
        margin-top: 8px;
    }
    .count-heading progress {
        display: block;
        margin-top: 9px;
        width: 200px;
        accent-color: var(--brand);
    }

    .document-meta {
        display: flex;
        align-items: center;
        gap: 19px;
        font-size: 12px;
        color: #637895;
    }

    .import-review {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 22px;
        align-items: start;
    }

    .check-label {
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 12px;
        line-height: 1.6;
        margin: 22px 0;
    }
    .picker-part {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        gap: 20px;
        padding: 15px 10px;
        border: 0;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
    }
    invenaro-part-search {
        display: block;
        position: relative;
    }
    .stock-matches {
        display: none;
    }
    invenaro-part-search[data-open] .stock-matches {
        display: block;
        max-height: min(20rem, 45vh);
        overflow: auto;
        margin-top: 4px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: white;
    }
    .stock-matches .picker-part[aria-selected=true] {
        background: var(--selected);
    }
    .stock-matches p {
        padding: 8px 12px;
    }
    .picker-part span:first-child {
        flex: 1;
    }
    .picker-part strong {
        font-size: 12px;
    }
    .picker-part small {
        display: block;
        font-size: 10px;
        color: #7486a0;
        margin-top: 5px;
    }
    .picker-part span:nth-child(2) {
        font-size: 10px;
        color: #68809b;
    }
    .picker-part span:nth-child(2) strong {
        display: block;
        color: #246453;
        margin-top: 5px;
    }
    .picker-part > .icon {
        color: var(--brand);
        width: 16px;
    }
    @media (max-width: 1350px) {
        .catalogue-layout:not(.single) {
            grid-template-columns: 290px minmax(480px, 1fr);
        }
        .operation-layout {
            grid-template-columns: minmax(0, 1fr) 270px;
        }
        .stock-metric {
            padding: 12px 9px;
        }
        .stock-metric > span {
            font-size: 10px;
        }
        .stock-metric > strong {
            font-size: 24px;
        }
    }
    @media (max-width: 1080px) {
        .catalogue-layout:not(.single) {
            grid-template-columns: 250px minmax(440px, 1fr);
        }
        .warehouse-page .page-head {
            flex-wrap: wrap;
        }
        .operation-layout,
        .import-review {
            grid-template-columns: 1fr;
        }
        .operation-summary {
            position: static;
        }
        .stock-metric > strong {
            font-size: 22px;
        }
        .catalogue-layout .detail-header,
        .catalogue-layout .detail-body {
            padding-left: 16px;
            padding-right: 16px;
        }
        .catalogue-layout .part-stock-summary {
            padding-left: 16px;
            padding-right: 16px;
        }
    }
    @media (prefers-reduced-motion: reduce) {
        * {
            transition: none !important;
            scroll-behavior: auto !important;
        }
    }

    /* Work states, media and retained shared controls. */
    .tab-count {
        background: #edf1f8;
        border-radius: 4px;
        padding: 2px 5px;
        font-size: 10px;
        margin-left: 3px;
    }
    .overdue-text {
        color: #a75d11 !important;
    }
    .badge.urgent,
    .badge.critical {
        color: #a2322a;
        background: #fff0ed;
    }
    .badge.high {
        color: #986014;
        background: #fff5df;
    }
    .badge.cancelled,
    .badge.unset {
        color: #65748b;
        background: #eef1f5;
    }
    .badge.cardActive,
    .badge.pass {
        color: #086c5b;
        background: #e6f4ef;
    }

    .part-thumb {
        width: 46px;
        height: 46px;
        object-fit: contain;
        border-radius: 7px;
        background: #f1f3f6;
        flex-shrink: 0;
    }

    .photo-button {
        border: 0;
        padding: 0;
        background: none;
        flex-shrink: 0;
    }
    .photo-button:hover {
        outline: 2px solid var(--brand);
    }

    .product-photo {
        float: right;
        margin: 0 0 16px 20px;
    }
    .product-photo .part-thumb {
        width: 115px;
        height: 115px;
    }
    .image-preview {
        display: block;
        max-width: 100%;
        max-height: 65vh;
        object-fit: contain;
        margin: auto;
    }

    .report-filter {
        padding: 20px;
        margin: 14px 0;
    }
    .report-filter .form-grid {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
        margin-bottom: 14px;
    }

    #purchase-picker-results {
        max-height: 50vh;
        overflow: auto;
    }

    /* Permission controls shared with the settings views. */
    .permission-group {
        border: 1px solid var(--line);
        border-radius: 10px;
        overflow: hidden;
        margin: 14px 0;
    }
    .permission-group h3 {
        padding: 12px 16px;
        background: #f5f7fb;
    }
    .permission-row {
        display: grid;
        grid-template-columns: minmax(250px, 1fr) 150px 145px;
        gap: 16px;
        align-items: center;
        padding: 14px 16px;
        border-top: 1px solid var(--line);
    }
    .permission-row small {
        display: block;
        font-size: 11px;
        color: var(--muted);
        margin-top: 5px;
        overflow-wrap: anywhere;
    }
    .permission-row select {
        width: 100%;
    }
    .permission-row .badge {
        white-space: normal;
    }

    .help-search input {
        width: 100%;
        max-width: 700px;
    }

    @media (max-width: 1250px) {
        .permission-row {
            grid-template-columns: minmax(190px, 1fr) 135px 110px;
            gap: 10px;
        }
    }

    .permission-group summary {
        padding: 14px 16px;
        background: #f5f7fb;
        cursor: pointer;
        font-weight: 600;
    }
    .permission-group summary span {
        float: right;
        font-weight: 400;
        color: var(--muted);
    }
}

/* B01/B02 extensions for existing production controls absent from the model. */
.blazor-desktop .legacy-workspace {
    padding: 27px 30px;
    max-width: 1800px;
    margin: auto;
}
/* Context returns cross the legacy scope boundary; keep their layout in both surfaces. */
.blazor-desktop .catalogue-return {
    max-width: 100%;
    margin-bottom: 16px;
    white-space: normal;
    text-align: left;
    justify-content: flex-start;
}
.blazor-desktop .catalogue-return > span {
    min-width: 0;
    overflow-wrap: anywhere;
}
@scope (.blazor-desktop) to (.legacy-view) {
    .detail-actions a.button {
        color: inherit;
        background: white;
        border: 1px solid var(--line);
        border-radius: 7px;
        padding: 7px 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        font-size: 11px;
        font-weight: 600;
        line-height: 1.4;
        text-decoration: none;
    }
    .detail-actions a.button:hover {
        background: #f3f5fa;
        border-color: #bdc9dc;
    }
    .catalogue-options {
        padding: 14px 16px;
        border-bottom: 1px solid var(--line);
    }
    .filter-grid {
        display: flex;
        align-items: end;
        gap: 12px;
        flex-wrap: wrap;
    }
    .filter-grid label {
        display: flex;
        flex-direction: column;
        gap: 5px;
        font-size: 12px;
    }
    .filter-grid .checkbox {
        flex-direction: row;
        align-items: center;
    }
    .filter-grid input:not([type=checkbox]),
    .filter-grid select {
        max-width: 260px;
    }
    .attempt-data {
        white-space: pre-wrap;
        overflow-wrap: anywhere;
        max-height: 240px;
        overflow: auto;
        font-size: 11px;
    }
    .form-alert {
        margin: 12px 0;
        padding: 12px;
        border: 1px solid #e9c58c;
        background: #fff8eb;
        border-radius: 7px;
    }
    .form-alert button {
        margin: 5px;
    }
    .form-alert label {
        display: block;
    }
    .notification-button {
        position: relative;
    }

    .screen-search-results {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-top: 12px;
        max-height: 55vh;
        overflow: auto;
    }
    .search-result {
        justify-content: flex-start;
    }
    .form-field {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin: 12px 0;
    }
    .catalogue-dialog .modal-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 18px 22px;
        border-bottom: 1px solid var(--line);
    }
    .catalogue-dialog .modal-top + .form-error {
        margin: 16px;
    }
    .catalogue-dialog .catalogue-form-body {
        padding: 22px;
    }
    .catalogue-dialog .form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        margin: 18px 0;
    }
    .catalogue-dialog .form-grid label {
        display: flex;
        flex-direction: column;
        gap: 6px;
        font-size: 12px;
    }
    .catalogue-dialog .span2 {
        grid-column: 1/-1;
    }
    .catalogue-dialog .modal-actions {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }
    .catalogue-dialog h2 {
        font-size: 22px;
    }
    .catalogue-dialog p {
        font-size: 12px;
        color: var(--muted);
    }
    .catalogue-dialog fieldset {
        border: 0;
        padding: 0;
        margin: 0;
        min-width: 0;
    }
}

@scope (.blazor-desktop) to (.legacy-view) {
    .catalogue-extended .knowledge {
        margin: 0;
        padding: 0;
        border: 0;
    }
    .catalogue-extended .knowledge-tabs {
        gap: 4px;
        padding-bottom: 10px;
    }
    .catalogue-extended .knowledge-tabs .button {
        padding: 8px 10px;
        border: 0;
        background: transparent;
        font-size: 12px;
        box-shadow: none;
    }
    .catalogue-extended .knowledge-tabs .button[aria-pressed=true] {
        background: #eef1fd;
        color: var(--brand);
    }
    .catalogue-extended .knowledge-form {
        border-radius: 8px;
        background: #f7f9fc;
    }
    .catalogue-extended .notice {
        margin: 12px 0;
        padding: 12px;
        border-radius: 7px;
        background: #f4f7fc;
        border: 1px solid var(--line);
        font-size: 12px;
    }
    .catalogue-extended .notice.warning {
        background: #fff8eb;
        border-color: #e9c58c;
    }
    .catalogue-extended .knowledge-form textarea,
    .catalogue-extended .knowledge-form select {
        width: 100%;
    }
    .catalogue-extended small,
    .catalogue-extended .muted {
        color: var(--muted);
        font-size: 11px;
    }
    .catalogue-extended .purchase-sources {
        margin-top: 20px;
    }
}
/* B03: real stock controls retain their existing handlers and draft owner. */
@scope (.blazor-desktop) to (.legacy-view) {
    .warehouse-page .notice {
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 16px 20px;
        margin: 0 0 20px;
        display: flex;
        gap: 12px;
        align-items: start;
        background: white;
        font-size: 13px;
    }
    .warehouse-page .notice.success {
        background: #e8f5f1;
        border-color: #b5d9cf;
    }
    .warehouse-page .notice > div {
        flex: 1;
    }
    .warehouse-page .draft-tools {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-top: 12px;
    }
    .warehouse-page .page-actions {
        flex-wrap: wrap;
    }
    .warehouse-page .section-heading {
        flex-wrap: wrap;
    }
    .stock-scan .field-search {
        flex: 1;
        min-width: 190px;
    }
    .stock-scan .field-search input {
        width: 100%;
    }
    .stock-part {
        min-width: 0;
        align-items: start;
    }
    .stock-part > div {
        min-width: 0;
    }
    .stock-part strong {
        overflow-wrap: anywhere;
    }
    .stock-part img,
    .stock-part .product-placeholder {
        width: 42px;
        height: 42px;
        object-fit: contain;
        background: #f4f6f9;
        border-radius: 7px;
        flex: none;
    }
    .stock-part .product-placeholder {
        display: grid;
        place-items: center;
        font-size: 11px;
        color: var(--muted);
    }
    .stock-editor .stock-location-picker label,
    .stock-editor .assignment-fields label,
    .stock-dialog label {
        display: flex;
        flex-direction: column;
        gap: 6px;
        font-size: 12px;
    }
    .stock-editor input,
    .stock-editor select,
    .stock-editor textarea {
        min-width: 0;
        max-width: 100%;
    }
    .stock-editor .stock-location-picker label select {
        width: 100%;
    }
    .stock-editor .assignment-fields {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
        gap: 14px;
        margin: 16px 0;
    }
    .stock-editor .assignment-fields small {
        grid-column: 1/-1;
    }
    .stock-editor .assignment-fields label {
        margin: 0;
    }
    .stock-editor .stock-location-picker small {
        color: var(--muted);
        font-size: 10px;
        line-height: 1.6;
    }
    .stock-editor .basket-line > .small {
        margin-top: 10px;
    }
    .stock-editor .basket-fields {
        grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    }
    .stock-editor .operation-summary > .small {
        margin: 8px 0 16px;
    }
    .stock-editor .operation-summary select,
    .stock-editor .operation-summary textarea {
        width: 100%;
    }
    .stock-editor .optional-note {
        margin-top: 18px;
    }
    .stock-editor summary {
        cursor: pointer;
        font-size: 12px;
    }
    .stock-context {
        margin: 18px 0;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 7px;
        overflow-wrap: anywhere;
    }
    .stock-context p {
        margin-top: 6px;
    }
    .stock-editor .operation-summary button {
        white-space: normal;
    }
    .stock-editor .flow-steps {
        padding-bottom: 10px;
    }
    .stock-dialog .modal {
        padding: 0;
        width: min(940px, calc(100vw - 40px));
        max-height: calc(100vh - 40px);
        overflow: auto;
        border: 1px solid var(--line);
        border-radius: 12px;
        color: var(--ink);
    }
    .stock-dialog .modal-top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 22px;
        border-bottom: 1px solid var(--line);
        position: sticky;
        top: 0;
        background: white;
        z-index: 3;
    }
    .stock-dialog .modal > :not(.modal-top) {
        margin-left: 22px;
        margin-right: 22px;
    }
    .stock-dialog h2 {
        font-size: 24px;
        margin-top: 22px;
        margin-bottom: 8px;
    }
    .stock-dialog h3 {
        margin-top: 24px;
        margin-bottom: 12px;
    }
    .stock-dialog p {
        font-size: 12px;
        margin-top: 10px;
        margin-bottom: 12px;
    }
    .stock-dialog small {
        display: block;
        font-size: 10px;
        color: var(--muted);
        margin-top: 6px;
    }
    .stock-dialog .table-scroll {
        overflow: auto;
        margin-top: 20px;
    }
    .stock-dialog .table-scroll table {
        width: 100%;
        border-collapse: collapse;
    }
    .stock-dialog .modal-actions {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        justify-content: flex-end;
        margin-top: 22px;
        margin-bottom: 22px;
    }
    .stock-dialog .search-field {
        display: flex;
        gap: 10px;
        align-items: center;
        margin-top: 18px;
        margin-bottom: 18px;
    }
    .stock-dialog .search-field input {
        flex: 1;
        min-width: 0;
    }
    .stock-dialog .picker-results {
        max-height: 50vh;
        overflow: auto;
    }
    .stock-dialog .picker-part img,
    .stock-dialog .product-placeholder {
        width: 40px;
        height: 40px;
        object-fit: contain;
        border-radius: 6px;
    }
    .stock-dialog .picker-part span {
        flex: 1;
    }
    .stock-dialog .audit-row {
        border-top: 1px solid var(--line);
        padding: 12px 0;
    }
    .stock-dialog .notice {
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 7px;
        background: var(--soft);
        font-size: 12px;
    }
    .stock-dialog .notice.warning {
        background: #fff8eb;
        border-color: #e9c58c;
    }
    .stock-dialog .document-actions .action-editor {
        background: white;
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 22px;
    }
    .stock-dialog .document-actions .action-fields {
        grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
        gap: 15px;
    }
    .stock-dialog .document-actions .action-line {
        padding: 8px 0 22px;
        margin-bottom: 20px;
    }
    .stock-dialog .document-actions .action-line-heading {
        font-size: 14px;
    }
    .stock-dialog .document-actions .action-explanation {
        color: var(--muted);
        font-size: 12px;
    }
    .stock-dialog .document-actions .return-overview {
        background: var(--soft);
        border: 1px solid var(--line);
        border-radius: 8px;
    }
    .stock-dialog textarea,
    .stock-dialog select {
        width: 100%;
    }
    .stock-dialog .action-scan {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
    }
    .stock-dialog .action-scan input {
        flex: 1;
        min-width: 160px;
    }
    .stock-dialog .quantity-control {
        display: flex;
        border: 1px solid var(--line);
        border-radius: 6px;
        overflow: hidden;
    }
    .stock-dialog .quantity-control input {
        flex: 1;
        min-width: 0;
        width: 100%;
        border: 0;
    }
    .stock-dialog .quantity-arrows {
        display: flex;
        flex-direction: column;
    }
    .stock-dialog .quantity-arrows button {
        padding: 0 8px;
        border: 0;
        border-radius: 0;
        font-size: 10px;
    }
    .stock-dialog .action-metadata {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .stock-dialog .action-metadata .span2 {
        grid-column: 1/-1;
    }
    @media (max-width: 900px) {
        .group-button {
            white-space: normal;
        }
        .group-button .nav-label {
            min-width: 0;
            overflow-wrap: anywhere;
            text-align: left;
        }
        .group-button > .icon {
            flex-shrink: 0;
        }
        .shell {
            grid-template-columns: 190px minmax(0, 1fr);
        }
        .shell.collapsed {
            grid-template-columns: 68px minmax(0, 1fr);
        }
        .topbar {
            height: auto;
            min-height: 64px;
            padding: 10px 14px;
            gap: 8px;
            flex-wrap: wrap;
        }
        .global-search {
            min-width: 0;
        }
        .global-search kbd {
            display: none;
        }
        .page {
            padding: 20px 16px;
        }
        .page-head {
            flex-wrap: wrap;
        }
        .page-actions {
            flex-wrap: wrap;
        }
        .catalogue-layout:not(.single) {
            grid-template-columns: minmax(0, 1fr);
        }

        .catalogue-layout .list-panel {
            min-width: 0;
        }
        .catalogue-layout .detail {
            min-width: 0;
        }

        .toolbar {
            flex-wrap: wrap;
        }
        .operation-layout {
            grid-template-columns: minmax(0, 1fr);
        }
        .operation-summary {
            position: static;
        }

        .stock-dialog .return-overview-row {
            grid-template-columns: 1fr;
        }
        .stock-dialog .action-metadata {
            grid-template-columns: 1fr;
        }
        .stock-dialog .action-metadata .span2 {
            grid-column: auto;
        }
        .stock-dialog .modal {
            width: calc(100vw - 24px);
        }
    }
}

/* B03 issue register: the same desktop list/detail vocabulary as the catalogue. */
@scope (.blazor-desktop) to (.legacy-view) {
    .issue-toolbar {
        padding: 16px;
        margin-bottom: 16px;
    }
    .issue-filter-row {
        display: flex;
        gap: 10px;
        align-items: end;
        flex-wrap: wrap;
    }
    .issue-filter-row .field-search {
        flex: 1;
        min-width: 220px;
    }
    .issue-filter-row .field-search input {
        width: 100%;
    }
    .issue-filter {
        display: flex;
        flex-direction: column;
        gap: 6px;
        font-size: 11px;
        color: var(--muted);
        min-width: 130px;
    }
    .issue-filter select,
    .issue-filter input {
        min-width: 0;
        max-width: 100%;
        color: var(--ink);
    }
    .issue-extra-filters {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 14px;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid var(--line);
    }
    .issue-filter-hint {
        font-size: 11px;
        color: var(--muted);
        margin: 12px 0 0;
        line-height: 1.6;
    }
    .issue-detail > .issue-filter-hint {
        padding: 0 20px 10px;
    }
    .issue-layout {
        display: grid;
        grid-template-columns: minmax(320px, 32%) minmax(0, 1fr);
        gap: 18px;
        align-items: start;
    }
    .issue-layout.single {
        grid-template-columns: minmax(0, 1fr);
    }
    .issue-layout .list-panel,
    .issue-layout .detail {
        min-width: 0;
        overflow: hidden;
        height: max(320px, calc(100vh - 360px));
    }
    .issue-layout .list-panel {
        display: flex;
        flex-direction: column;
    }
    .issue-layout .list-scroll {
        flex: 1;
        min-height: 0;
        overflow: auto;
        scrollbar-gutter: stable;
    }
    .issue-layout .detail {
        overflow: auto;
        scrollbar-gutter: stable;
    }
    .issue-layout .pager {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }
    .issue-layout .pager label {
        font-size: 10px;
    }
    .issue-layout .pager .row {
        flex-wrap: wrap;
    }
    .issue-sortbar {
        padding: 12px 14px;
        gap: 8px;
        flex-wrap: wrap;
    }
    .issue-sortbar label {
        display: flex;
        flex: 1;
        min-width: 0;
        gap: 8px;
        align-items: center;
        font-size: 11px;
        color: var(--muted);
    }
    .issue-sortbar select {
        max-width: 140px;
        min-width: 0;
        flex: 1;
    }
    .issue-sortbar .icon-button {
        flex: none;
        padding: 7px;
    }
    .issue-layout.single .issue-sortbar label {
        flex: 0 1 auto;
    }
    .issue-sortbar > button:last-child {
        margin-left: auto;
    }
    .issue-list-row {
        display: block;
        width: 100%;
        padding: 16px 18px;
        white-space: normal;
        text-align: left;
        border-radius: 0;
        border-left: 3px solid transparent;
    }
    .issue-list-row.selected {
        border-left-color: var(--brand);
        background: var(--selected,#f0f3ff);
    }
    .issue-list-row .row {
        flex-wrap: wrap;
        gap: 8px;
    }
    .issue-list-row strong {
        font-size: 13px;
    }
    .issue-list-person {
        font-size: 12px;
        margin: 8px 0 5px;
    }
    .issue-list-parts {
        font-size: 11px;
        line-height: 1.6;
        margin: 10px 0 6px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .issue-list-row small {
        font-size: 10px;
        color: var(--muted);
        display: block;
        line-height: 1.5;
    }
    .issue-list-row .asset-line {
        font-size: 10px;
    }
    .issue-table {
        min-width: 900px;
    }
    .issue-table td {
        font-size: 12px;
        padding: 14px;
    }
    .issue-table td:first-child {
        white-space: nowrap;
    }
    .issue-table th {
        padding: 12px 14px;
    }
    .issue-table .column-sort {
        white-space: nowrap;
    }
    .issue-detail-tools {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 16px;
        border-bottom: 1px solid var(--line);
        font-size: 10px;
        color: var(--muted);
    }
    .issue-document-header {
        padding: 18px 22px;
    }
    .issue-document-header h2 {
        font-size: 23px;
        margin: 10px 0;
    }
    .issue-document-header .meta {
        font-size: 12px;
        line-height: 1.6;
    }
    .issue-document-header button {
        margin-top: 12px;
    }
    .issue-detail .tabs {
        display: flex;
        flex-wrap: wrap;
        position: sticky;
        top: 0;
        z-index: 2;
        background: white;
        padding: 0 14px;
    }
    .issue-detail .tabs button {
        font-size: 12px;
    }
    .issue-document-body {
        padding: 20px 22px;
    }
    .issue-document-body section[hidden] {
        display: none;
    }
    .issue-document-body .table-scroll {
        overflow: auto;
    }
    .issue-document-body table {
        width: 100%;
        border-collapse: collapse;
    }
    .issue-document-body th,
    .issue-document-body td {
        font-size: 12px;
        padding: 12px 10px;
        vertical-align: top;
    }
    .issue-document-body td:first-child {
        min-width: 180px;
    }
    .issue-document-body td:last-child {
        min-width: 145px;
    }
    .issue-document-body small {
        display: block;
        font-size: 10px;
        color: var(--muted);
        line-height: 1.6;
        margin-top: 4px;
    }
    .issue-document-body .button {
        font-size: 11px;
        margin-top: 9px;
        white-space: normal;
    }
    .issue-document-body p {
        font-size: 12px;
        line-height: 1.7;
    }
    .issue-document-body .product-notes {
        white-space: pre-wrap;
        border-top: 1px solid var(--line);
        padding-top: 18px;
        margin-top: 20px;
    }
    .issue-document-body h3 {
        font-size: 15px;
        margin: 0 0 14px;
    }
    .issue-document-body h4 {
        font-size: 13px;
    }
    .issue-document-body .audit-row {
        border-bottom: 1px solid var(--line);
        padding: 14px 0;
    }
    .issue-document-body .audit-row p {
        margin: 5px 0;
    }
    .issue-detail-empty {
        min-height: 340px;
    }
    .issue-detail-empty .icon {
        width: 32px;
        height: 32px;
        color: var(--muted);
    }
    .issue-detail-empty h2 {
        font-size: 18px;
    }
    .issue-detail-empty p {
        font-size: 12px;
        color: var(--muted);
        max-width: 310px;
        line-height: 1.7;
    }
    .issue-document-body .notice {
        padding: 12px;
        margin-bottom: 14px;
    }
    .issue-document-body .action-buttons {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin: 15px 0;
    }
    .issue-document-body .action-editor {
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 18px;
    }
    .issue-document-body label {
        display: flex;
        flex-direction: column;
        gap: 6px;
        font-size: 12px;
    }
    .issue-document-body textarea,
    .issue-document-body select {
        width: 100%;
    }
    .issue-document-body .action-fields {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
    }
    .issue-document-body .action-line {
        padding: 14px 0;
        border-bottom: 1px solid var(--line);
    }
    .issue-document-body .action-line-heading {
        display: flex;
        justify-content: space-between;
        font-size: 13px;
        margin-bottom: 12px;
    }
    .issue-document-body .action-scan {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }
    .issue-document-body .action-scan input {
        min-width: 0;
        flex: 1;
    }
    .issue-document-body .quantity-control {
        display: flex;
        border: 1px solid var(--line);
        border-radius: 6px;
        overflow: hidden;
    }
    .issue-document-body .quantity-control input {
        min-width: 0;
        width: 100%;
        border: 0;
    }
    .issue-document-body .quantity-arrows {
        display: flex;
        flex-direction: column;
    }
    .issue-document-body .quantity-arrows button {
        border: 0;
        padding: 0 8px;
        font-size: 10px;
        border-radius: 0;
    }
    .issue-document-body .return-overview-row {
        display: flex;
        gap: 10px;
        justify-content: space-between;
        align-items: start;
        padding: 12px 0;
        border-bottom: 1px solid var(--line);
        font-size: 12px;
    }
    .issue-document-body .return-overview-row > span:first-child {
        flex: 1;
    }
    .issue-document-body .action-preview {
        padding: 14px;
        background: var(--soft);
        border-radius: 7px;
        margin: 14px 0;
    }
    .issue-document-body .action-preview > div {
        display: flex;
        justify-content: space-between;
        font-size: 12px;
        margin-top: 10px;
    }
    .issue-document-body .related-document {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        text-align: left;
        margin-top: 8px;
        white-space: normal;
        gap: 12px;
    }
    .issue-document-body .related-documents {
        margin-top: 20px;
        font-size: 12px;
    }
    .issue-document-body .action-reason {
        margin-top: 16px;
    }
    .issue-document-body .action-metadata {
        display: grid;
        gap: 12px;
        margin-top: 14px;
    }
    @media (min-width: 1600px) {
        .issue-layout:not(.single) {
            grid-template-columns: 380px minmax(0, 1fr);
        }
    }
    @media (max-width: 1000px) {
        .issue-layout:not(.single) {
            grid-template-columns: minmax(0, 1fr);
        }
        .issue-layout .list-panel {
            height: 370px;
        }
        .issue-layout .detail {
            height: auto;
            max-height: none;
        }
        .issue-filter-row .field-search {
            min-width: 180px;
        }
        .issue-document-body .return-overview-row {
            flex-wrap: wrap;
        }
    }
}

/* Receipt register: delivery context within the shared stock-document layout. */
@scope (.blazor-desktop) to (.legacy-view) {
    .receipt-register-tabs {
        display: flex;
        gap: 6px;
        margin: 0 0 16px;
        border-bottom: 1px solid var(--line);
        padding-bottom: 10px;
        flex-wrap: wrap;
    }
    .receipt-register-tabs button {
        background: transparent;
        border-color: transparent;
        font-size: 12px;
    }
    .receipt-register-tabs button.selected {
        background: var(--selected,#eef1fd);
        border-color: var(--line);
        color: var(--brand);
    }
    .stock-register-page {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    .stock-register-page > .page-head,
    .stock-register-page > .receipt-register-tabs,
    .stock-register-page > .notice {
        flex: none;
    }
    .stock-register-page > .receipt-register,
    .stock-register-page > .issue-register {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }
    .stock-register-page .issue-toolbar {
        flex: none;
    }
    .stock-register-page .issue-layout {
        flex: 1;
        min-height: 320px;
        grid-template-rows: minmax(0, 1fr);
    }
    .stock-register-page .issue-layout .list-panel,
    .stock-register-page .issue-layout .detail {
        height: 100%;
    }
    @media (max-width: 1000px) {
        .stock-register-page {
            height: auto;
            min-height: 100%;
        }
        .stock-register-page .issue-layout {
            grid-template-rows: auto;
        }
        .stock-register-page .issue-layout .detail {
            height: auto;
        }
        .stock-register-page .issue-layout .list-panel {
            height: 370px;
        }
    }
    .receipt-source {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 16px;
        margin: 0 0 20px;
        padding-bottom: 18px;
        border-bottom: 1px solid var(--line);
    }
    .receipt-source dt {
        font-size: 11px;
        color: var(--muted);
        margin-bottom: 7px;
    }
    .receipt-source dd {
        font-size: 13px;
        margin: 0;
        overflow-wrap: anywhere;
    }
    .receipt-prices {
        margin-bottom: 18px;
    }
}

/* B04: task-specific assignment queue and relocation workspace. */
.pending-detail-body p {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.65;
}
.pending-detail-body .stock-metrics {
    grid-template-columns: 1fr;
    margin-bottom: 18px;
}
.pending-detail-body .form-field {
    margin: 20px 0;
}
.pending-source {
    border-top: 1px solid var(--line);
    margin-top: 28px;
    padding-top: 20px;
}
.stock-register-page > .relocation-register-host {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.relocation-register-host > .issue-register {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.relocation-register-host[hidden] {
    display: none !important;
}
.relocation-register-host > .page-head {
    flex: none;
}
.relocation-workspace .quantity-input {
    max-width: 230px;
}
.relocation-workspace .notice.warning {
    background: #fff7e7;
    border-color: #edd6a8;
}
.relocation-workspace .draft-tools {
    margin: 0 0 16px;
}
.relocation-workspace .operation-status {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 14px 18px;
    background: #eef3fd;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 16px;
}
.relocation-workspace .operation-status.warning {
    background: #fff7e7;
    border-color: #edd6a8;
}
.pending-detail-body h3 {
    font-size: 14px;
    margin: 0 0 18px;
}

/* B04.3: storage locations retain their list while contents and actions stay beside it. */
@scope (.blazor-desktop) to (.legacy-view) {
    .stock-register-page > .location-register {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        gap: 16px;
    }
    .location-register .issue-toolbar {
        margin: 0;
    }
    .location-register .issue-layout.location-full {
        grid-template-columns: minmax(0, 1fr);
    }
    .location-register [hidden] {
        display: none !important;
    }
    .location-detail {
        overflow: auto !important;
    }
    .location-detail-tools {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 18px;
        border-bottom: 1px solid var(--line);
        color: var(--muted);
        font-size: 11px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 2;
    }
    .location-detail-body > .detail-header {
        padding: 20px;
    }
    .location-detail-body h2 {
        margin: 0;
        font-size: 21px;
    }
    .location-detail-body .detail-header p {
        font-size: 13px;
        color: var(--muted);
        margin: 10px 0 16px;
    }
    .location-detail-body .tabs {
        padding: 0 20px;
    }
    .location-detail-body > .form-alert,
    .location-filter-note {
        margin: 16px 20px;
    }
    .location-filter-note {
        font-size: 12px;
        color: var(--muted);
    }
    .location-data,
    .location-history,
    .location-editor {
        padding: 22px;
    }
    .location-data p,
    .location-editor .field-help {
        font-size: 12px;
        line-height: 1.65;
        color: var(--muted);
    }
    .location-data .properties {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .location-data dd {
        margin: 6px 0 20px;
    }
    .location-history .audit-row {
        padding: 16px 0;
        border-bottom: 1px solid var(--line);
        font-size: 13px;
    }
    .location-history small {
        font-size: 11px;
        color: var(--muted);
    }
    .location-editor h2 {
        margin-bottom: 22px;
    }
    .location-editor .form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
    .location-editor label {
        display: flex;
        flex-direction: column;
        gap: 7px;
        font-size: 12px;
    }
    .location-editor input,
    .location-editor select {
        width: 100%;
        height: 40px;
        border: 1px solid var(--line);
        border-radius: 7px;
        background: white;
        padding: 9px 11px;
        color: inherit;
        font: inherit;
    }
    .location-editor .modal-actions {
        display: flex;
        justify-content: flex-end;
        gap: 10px;
        margin-top: 24px;
    }

    .location-detail .badge.warning {
        color: #8c5000;
        background: #fff2d8;
    }
    .location-detail .badge.good {
        color: #08735d;
        background: #e8f5ef;
    }
    @media (max-width: 1100px) {
        .location-editor .form-grid {
            grid-template-columns: 1fr;
        }
        .location-register .issue-filter-row {
            flex-wrap: wrap;
        }
    }
}
.location-detail-body .location-heading {
    padding: 16px 20px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.location-detail-body .location-heading p {
    margin: 6px 0 0;
}
.location-heading > .row {
    flex-wrap: wrap;
    justify-content: flex-end;
}
.location-detail-tools {
    padding: 6px 18px;
}
.location-detail-body .tabs button {
    padding-top: 12px;
    padding-bottom: 12px;
}

/* B04.4: stocktakes use the shared desktop shell, with their own counting worksheet. */
@scope (.blazor-desktop) to (.legacy-view) {
    .stock-register-page > .count-desktop {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        gap: 12px;
    }
    .count-desktop > .page-head {
        margin-bottom: 2px;
        flex: none;
    }
    .count-desktop > .count-toolbar {
        margin: 0;
        flex: none;
        border-bottom: 1px solid var(--line);
        padding-bottom: 10px;
    }
    .count-desktop > .count-register {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        gap: 12px;
    }
    .count-register .issue-toolbar {
        margin: 0;
    }
    .count-register .issue-layout {
        grid-template-columns: minmax(290px, 30%) minmax(0, 1fr);
        min-height: 350px;
    }
    .count-register .issue-layout.single,
    .count-register .issue-layout.count-full {
        grid-template-columns: minmax(0, 1fr);
    }
    .count-register-detail {
        overflow: auto !important;
    }
    .count-detail-tools {
        position: sticky;
        top: 0;
        z-index: 3;
        background: white;
        border-bottom: 1px solid var(--line);
        display: flex;
        justify-content: space-between;
        padding: 7px 18px;
        color: var(--muted);
        font-size: 11px;
    }
    .count-register .issue-list-row {
        gap: 9px;
    }
    .count-register progress {
        width: 100%;
        height: 5px;
        accent-color: var(--brand);
        border: 0;
    }
    .count-register .list-row strong {
        font-size: 15px;
    }
    .count-filter-note {
        font-size: 12px;
        color: var(--muted);
        padding: 10px 20px;
        background: var(--soft);
    }
    .count-desktop .count-start {
        max-width: 920px;
        width: 100%;
        align-self: center;
        overflow: auto;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: white;
        padding: 24px;
    }
    .count-start h2 {
        margin-bottom: 12px;
    }
    .count-start .form-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
        margin: 22px 0;
    }
    .count-start .span2 {
        grid-column: 1/-1;
    }
    .count-desktop label {
        display: flex;
        flex-direction: column;
        gap: 7px;
        font-size: 12px;
    }
    .count-desktop input,
    .count-desktop select,
    .count-desktop textarea {
        border: 1px solid var(--line);
        border-radius: 7px;
        color: inherit;
        background: white;
        padding: 9px 11px;
        min-width: 0;
        font: inherit;
    }
    .count-desktop input:disabled,
    .count-desktop textarea:disabled {
        background: #f5f7fa;
    }
    .count-desktop input[aria-invalid=true] {
        border-color: #b73346;
    }
    .count-desktop .modal-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .count-desktop .notice {
        padding: 12px 18px;
        margin: 0;
        font-size: 12px;
    }
    .count-desktop .notice.warning {
        background: #fff7e7;
        border: 1px solid #ecd7ae;
        border-radius: 7px;
    }
    .count-desktop .notice.success {
        background: #ecf8f0;
        border: 1px solid #bde0cc;
        border-radius: 7px;
    }
    .count-desktop > .panel {
        overflow: auto;
        background: white;
        border: 1px solid var(--line);
        border-radius: 10px;
    }
    .count-desktop .panel-heading {
        padding: 20px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
    }
    .count-desktop .count-scan .scan-form {
        display: flex;
        gap: 10px;
    }
    .count-desktop .count-scan input {
        flex: 1;
        min-width: 0;
    }
    .count-desktop .search-field {
        display: flex;
        gap: 10px;
    }
    .count-desktop .picker-row {
        display: flex;
        justify-content: space-between;
        width: 100%;
        text-align: left;
        margin-top: 8px;
    }
    .count-desktop .picker-row small {
        display: block;
    }
    .count-desktop .count-detail-tabs button.active,
    .count-desktop .count-toolbar button.selected {
        color: var(--brand);
        background: var(--selected);
        border-color: var(--line);
    }
    .count-desktop .count-entry .quantity-control {
        display: flex;
        position: relative;
    }
    .count-desktop .count-entry .quantity-control input {
        width: 100%;
        padding-right: 30px;
    }
    .count-desktop .quantity-arrows {
        position: absolute;
        right: 1px;
        top: 1px;
        bottom: 1px;
        display: flex;
        flex-direction: column;
        width: 25px;
    }
    .count-desktop .quantity-arrows button {
        height: 50%;
        border: 0;
        border-left: 1px solid var(--line);
        border-radius: 0;
        background: var(--soft);
        line-height: 1;
    }
    .count-desktop .operation-status {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 8px;
        font-size: 12px;
        padding: 10px 16px;
        background: #eef3fd;
        border: 1px solid var(--line);
        border-radius: 7px;
    }
    @media (max-width: 1100px) {
        .count-register .issue-filter-row {
            flex-wrap: wrap;
        }
        .count-register .issue-layout {
            grid-template-columns: minmax(250px, 32%) minmax(0, 1fr);
        }
    }
    @media (max-width: 900px) {
        .count-register .issue-layout {
            grid-template-columns: minmax(0, 1fr);
        }
        .count-desktop .count-start .form-grid {
            grid-template-columns: 1fr;
        }
        .stock-register-page > .count-desktop {
            min-height: 100%;
            height: auto;
        }
        .count-register-detail {
            min-height: 400px;
        }
    }
}

@scope (.blazor-desktop) to (.legacy-view) {
    .count-register label.field-search {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 0 10px;
        height: 38px;
    }
    .count-register .field-search input {
        padding: 8px 0;
        border: 0;
        background: transparent;
        width: 100%;
    }
    .count-register .issue-sortbar label {
        flex-direction: row;
        align-items: center;
    }
    .count-register .issue-list-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }
    .count-register progress {
        appearance: none;
        border-radius: 5px;
        background: #e9eef7;
    }
    .count-register progress::-webkit-progress-bar {
        background: #e9eef7;
        border-radius: 5px;
    }
    .count-register progress::-webkit-progress-value {
        background: var(--brand);
        border-radius: 5px;
    }
    .count-register .list-pager label {
        flex-direction: row;
        align-items: center;
    }
    .count-desktop .count-toolbar button {
        padding: 7px 12px;
    }
}

@scope (.blazor-desktop) to (.legacy-view) {
    .count-register > .issue-toolbar {
        padding: 12px 16px;
    }
    .count-register label.issue-filter {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    .count-desktop .count-heading {
        margin: 0;
    }
    .count-desktop .count-heading > div {
        flex: 1;
    }
}

/* B04.5: one warehouse ledger, preserving its applied filters and document actions. */
@scope (.blazor-desktop) to (.legacy-view) {
    .history-register {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        gap: 12px;
    }
    .history-register > .page-head {
        flex: none;
        margin: 0 0 6px;
    }
    .history-filters {
        padding: 14px 16px;
        flex: none;
    }

    .history-register input,
    .history-register select {
        min-width: 0;
        max-width: 100%;
        height: 37px;
        padding: 8px 10px;
        border: 1px solid var(--line);
        border-radius: 6px;
        color: var(--ink);
        background: white;
        font: inherit;
        font-size: 12px;
    }

    .history-register .issue-layout {
        min-height: 300px;
        grid-template-columns: minmax(300px, 32%) minmax(0, 1fr);
    }
    .history-register .issue-layout.single {
        grid-template-columns: minmax(0, 1fr);
    }
    .history-row {
        display: flex;
        flex-direction: column;
        gap: 5px;
        align-items: stretch;
        text-align: left;
        padding: 14px 16px;
    }
    .history-kind {
        display: inline-flex;
        gap: 7px;
        align-items: center;
        font-size: 12px;
    }
    .history-kind svg {
        width: 15px;
        height: 15px;
    }
    .history-row .issue-list-parts {
        font-size: 11px;
        color: var(--muted);
        margin: 0;
    }
    .history-register .issue-detail-tools {
        padding: 4px 16px;
    }
    .history-register .issue-detail-tools .icon-button {
        padding: 5px;
    }
    .history-register .issue-document-header {
        padding: 10px 18px;
    }
    .history-register .issue-document-header h2 {
        font-size: 21px;
        margin: 5px 0;
    }
    .history-register .issue-document-header .meta {
        margin: 5px 0 0;
    }
    .history-register .issue-document-body {
        padding: 14px 18px;
    }
    .history-register .list-scroll .results-heading {
        font-size: 11px;
        padding: 8px 16px;
        margin: 0;
        color: var(--muted);
    }
    .history-register table small {
        display: block;
        font-size: 10px;
        color: var(--muted);
        margin-top: 5px;
    }
    .history-sources {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 16px;
        font-size: 12px;
    }
    .history-sources:empty {
        display: none;
    }
    @media (max-width: 1100px) {
        .history-register .issue-layout {
            grid-template-columns: minmax(250px, 30%) minmax(0, 1fr);
        }
    }
    @media (max-width: 900px) {
        .history-register .issue-layout {
            grid-template-columns: minmax(0, 1fr);
        }
        .history-register .issue-detail {
            min-height: 400px;
        }
    }
}

/* B05.1: model dashboard and focused daily queue; no legacy form styles. */
@scope (.blazor-desktop) to (.legacy-view) {
    .desktop-dashboard,
    .desktop-day {
        min-width: 0;
    }
    .daily-scope-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        flex-wrap: wrap;
        margin-bottom: 20px;
    }
    .daily-scope-row .pill-tabs {
        flex-wrap: wrap;
    }
    .desktop-dashboard .dashboard-grid {
        align-items: start;
    }
    .desktop-dashboard .dashboard-work {
        width: 100%;
        border: 0;
        border-bottom: 1px solid #edf0f5;
        border-radius: 0;
        text-align: left;
        justify-content: flex-start;
        font-weight: 400;
    }
    .desktop-dashboard .dashboard-work:hover {
        background: #f8faff;
    }
    .dashboard-work-main {
        flex: 1;
        min-width: 0;
    }
    .dashboard-work-main strong {
        overflow-wrap: anywhere;
        line-height: 1.5;
    }
    .dashboard-work-main .reference {
        font-size: 10px;
        font-weight: 400;
        color: var(--muted);
    }
    .dashboard-work-state {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 5px;
        flex-shrink: 0;
    }
    .dashboard-card-footer {
        border-top: 1px solid var(--line);
        padding: 14px 22px;
        font-size: 12px;
    }
    .dashboard-attention {
        padding: 4px 20px 16px;
    }
    .dashboard-attention > a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 15px 0;
        border-bottom: 1px solid var(--line);
        font-size: 12px;
        color: var(--ink);
    }
    .dashboard-attention > a span {
        flex: 1;
    }
    .dashboard-attention strong {
        font-size: 18px;
    }
    .dashboard-attention .icon {
        width: 17px;
        flex: none;
        color: var(--brand);
    }
    .dashboard-attention p {
        font-size: 11px;
        margin: 12px 0 0;
        line-height: 1.6;
    }
    .desktop-dashboard .card-head {
        gap: 12px;
        flex-wrap: wrap;
    }
    .desktop-dashboard .card-head h2,
    .desktop-dashboard .card-pad h2 {
        font-size: 15px;
    }
    .desktop-dashboard .card-head .text-button {
        font-size: 11px;
    }
    .dashboard-stock {
        margin-top: 24px;
    }
    .dashboard-stock h2 {
        font-size: 16px;
        margin-bottom: 14px;
    }
    .dashboard-metrics > a {
        text-decoration: none;
    }
    .dashboard-metrics > a:hover {
        color: inherit;
    }
    .dashboard-popular summary {
        padding: 17px 22px;
        cursor: pointer;
        font-weight: 600;
        font-size: 13px;
    }
    .dashboard-popular .section-note {
        margin: 0 20px 8px;
    }
    .dashboard-footnote {
        margin-top: 8px;
        color: var(--muted);
        font-size: 11px;
    }
    .daily-views {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
        margin-bottom: 17px;
    }
    .daily-views button {
        font-size: 12px;
        font-weight: 500;
        padding: 9px 12px;
    }
    .daily-views strong {
        background: #eef1f7;
        padding: 2px 7px;
        border-radius: 5px;
        font-size: 12px;
    }
    .daily-views .selected {
        color: var(--brand);
        border-color: #a8b6ef;
        background: #f0f3ff;
    }
    .daily-views .selected strong {
        background: #dce4ff;
    }
    .daily-toolbar {
        gap: 8px;
    }
    .daily-toolbar .field-search {
        max-width: 400px;
        min-width: 220px;
    }
    .daily-sort {
        display: flex;
        align-items: center;
        gap: 7px;
        font-size: 11px;
        color: var(--muted);
        margin-left: auto;
    }
    .daily-toolbar .pill-tabs {
        margin-left: 4px;
    }
    .daily-results-heading {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 13px 16px;
        border-bottom: 1px solid var(--line);
        gap: 12px;
    }
    .daily-results-heading h2 {
        font-size: 14px;
    }
    .daily-results-heading button {
        font-size: 11px;
    }
    .daily-results .section-note {
        margin: 0;
    }
    .daily-table th,
    .daily-table td {
        padding: 12px 16px;
    }
    .daily-table td {
        vertical-align: top;
    }
    .daily-table td:first-child {
        width: 36%;
        min-width: 260px;
    }
    .daily-table td:nth-child(2) {
        min-width: 130px;
    }
    .daily-table td:nth-child(3) {
        min-width: 150px;
    }
    .daily-table td:nth-child(4) {
        min-width: 140px;
    }
    .daily-table small {
        display: block;
        font-size: 11px;
        color: var(--muted);
        margin-top: 5px;
        line-height: 1.5;
    }
    .daily-order-link {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        font-size: 12px;
    }
    .daily-order-link .reference {
        font-weight: 400;
        font-size: 10px;
        color: var(--muted);
    }
    .daily-dates,
    .daily-status {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        font-size: 12px;
    }
    .daily-dates small,
    .daily-status small {
        display: block;
        color: var(--muted);
        font-size: 11px;
        line-height: 1.5;
    }
    .daily-status .badge {
        margin-bottom: 4px;
    }
    .badge.on_hold,
    .badge.high {
        background: #fff3db;
        color: #805000;
    }
    .badge.critical {
        background: #ffebeb;
        color: #ab3535;
    }
    .badge.in_progress {
        background: #edf1ff;
        color: #3656cd;
    }
    .badge.planned {
        background: #edf3f7;
        color: #47627b;
    }
    .overdue-text,
    .daily-table .overdue-text,
    .daily-dates .overdue-text,
    .dashboard-work .overdue-text {
        color: #a65b0a;
    }
    .daily-work-row {
        display: flex;
        align-items: center;
        gap: 18px;
        width: 100%;
        padding: 17px 20px;
        border: 0;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
        text-align: left;
        font-weight: 400;
        justify-content: flex-start;
    }
    .daily-work-row:hover {
        background: #f8faff;
    }
    .daily-row-main {
        display: flex;
        flex-direction: column;
        gap: 5px;
        flex: 1;
        min-width: 160px;
    }
    .daily-row-main .reference {
        font-size: 10px;
        color: var(--muted);
    }
    .daily-row-main strong {
        font-size: 13px;
    }
    .daily-row-main small {
        font-size: 11px;
        color: var(--muted);
    }
    .daily-work-row > .work-icon {
        color: var(--brand);
    }
    .daily-work-row > span:last-child {
        min-width: 140px;
    }
    .daily-explanation {
        font-size: 11px;
        color: var(--muted);
        margin: 16px 0;
    }
    .daily-explanation summary {
        cursor: pointer;
    }
    .daily-explanation p {
        margin: 10px 0;
        line-height: 1.6;
    }
    .desktop-day .machine-entry {
        padding: 15px 18px;
        margin-top: 14px;
        background: white;
        border: 1px solid var(--line);
        border-radius: 10px;
        font-size: 12px;
    }
    .desktop-day .machine-entry summary {
        cursor: pointer;
        font-weight: 600;
    }
    .desktop-day .machine-entry form {
        display: flex;
        align-items: end;
        gap: 12px;
        margin: 15px 0;
    }
    .desktop-day .machine-entry label {
        display: grid;
        gap: 7px;
        flex: 1;
        max-width: 500px;
    }
    .desktop-day .machine-entry input {
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: 7px;
    }
    .desktop-day .machine-entry small {
        color: var(--muted);
    }
    @media (max-width: 1100px) {
        .desktop-dashboard .dashboard-grid {
            grid-template-columns: 1fr;
        }
        .desktop-day .page-head,
        .desktop-dashboard .page-head {
            flex-wrap: wrap;
        }
        .daily-sort {
            margin-left: 0;
        }
    }
    @media (max-width: 750px) {
        .dashboard-metrics {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
        .desktop-day .page-actions,
        .desktop-dashboard .page-actions {
            flex-wrap: wrap;
        }
        .daily-work-row {
            flex-wrap: wrap;
        }
        .daily-work-row > .daily-row-main {
            flex-basis: 70%;
        }
        .daily-scope-row .pill-tabs button {
            white-space: normal;
        }
    }
}

/* B05.2: the work wrapper supplies a bounded desktop workspace to the two panes. */
.blazor-desktop .work-page:has(> .desktop-work-host) {
    height: 100%;
    min-height: 0;
}
.blazor-desktop .meter-page {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.blazor-desktop .meter-page > .meter-workspace {
    flex: 1;
    min-height: 0;
}
.blazor-desktop .budget-centre-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 22px;
}
.blazor-desktop .register-history-heading {
    font-size: 16px;
    margin: 0 0 12px;
}
.blazor-desktop :is(h1, h2)[tabindex="-1"]:focus-visible {
    outline: 2px solid #3656cd;
    outline-offset: 4px;
}
