* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background: #07111f;
    color: #e8eef8;
}

/* Shared V3 site footer */

.bm-site-footer {
    width: 100%;
    margin-top: 54px;
    padding: 38px clamp(20px, 4vw, 46px) 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(4, 12, 24, 0.72);
    color: #91a4bf;
}

.bm-site-footer-inner {
    width: min(100%, 1280px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(150px, 0.7fr) minmax(220px, 1fr);
    gap: clamp(30px, 6vw, 80px);
}

.bm-site-footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    text-decoration: none;
}

.bm-site-footer-logo img {
    width: 38px;
    height: 38px;
    display: block;
    border-radius: 50%;
}

.bm-site-footer-brand p {
    max-width: 480px;
    margin: 13px 0 0;
    font-size: 13px;
    line-height: 1.6;
}

.bm-site-footer-brand .bm-site-footer-trademark {
    color: #6f829d;
    font-size: 11px;
}

.bm-site-footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
}

.bm-site-footer-links > strong {
    margin-bottom: 3px;
    color: #e8eef8;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bm-site-footer-links a {
    color: #9fb0c8;
    text-decoration: none;
}

.bm-site-footer-links a:hover {
    color: #ffffff;
}

.bm-site-footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.bm-site-footer-socials a {
    padding: 6px 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 11px;
}

.bm-site-footer-socials a:hover {
    border-color: rgba(96, 165, 250, 0.5);
    background: rgba(59, 130, 246, 0.12);
}

.bm-site-footer-bottom {
    width: min(100%, 1280px);
    margin: 30px auto 0;
    padding-top: 18px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    color: #60738f;
    font-size: 11px;
}

.bm-site-footer a:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.65);
    outline-offset: 3px;
}

@media (max-width: 760px) {
    .bm-site-footer {
        margin-top: 38px;
        padding: 30px 20px 18px;
    }

    .bm-site-footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .bm-site-footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .bm-site-footer-inner {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .bm-site-footer-brand {
        grid-column: auto;
    }

    .bm-site-footer-bottom {
        flex-direction: column;
        gap: 7px;
    }
}

.bm-app {
    display: flex;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(55, 91, 255, 0.18), transparent 30%),
        radial-gradient(circle at top right, rgba(23, 209, 139, 0.12), transparent 25%),
        #07111f;
}

/* Sidebar */

.bm-sidebar {
    width: 270px;
    background: rgba(5, 13, 27, 0.92);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    flex: 0 0 270px;
}

.bm-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 0 8px;
}

.bm-logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #14f195);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.bm-logo-text {
    font-size: 17px;
    font-weight: 800;
	line-height: 1.1;
}

.bm-logo-sub {
    display: inline-block;
    margin-top: 3px;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #9fb0c8;
}

.bm-logo-image {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: block;
}

.bm-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bm-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    color: #c7d2e4;
    text-decoration: none;
    border-radius: 10px;
    transition: 0.2s ease;
    font-size: 15px;
}

.bm-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.bm-nav-item.active {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
}

.bm-nav-icon {
    width: 22px;
    text-align: center;
    opacity: 0.9;
}

.bm-sidebar-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bm-store-card,
.bm-user-card {
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 15px;
}

.bm-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bm-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14f195, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.bm-small-label {
    color: #8ea0b8;
    font-size: 12px;
    margin-bottom: 5px;
}





@media (min-width: 901px) {
    .bm-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }

    .bm-sidebar-bottom {
        margin-top: auto;
        padding-top: 16px;
        padding-bottom: 8px;
    }
}




/* Main */

.bm-main {
    flex: 1;
    padding: 18px 32px 32px;
    min-width: 0;
}

.bm-topbar {
    height: 54px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.bm-topbar-right {
    margin-left: auto;
}

.bm-search {
    width: 440px;
    max-width: 100%;
    height: 42px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    color: #7f91aa;
}

.bm-search input {
    width: 100%;
    background: transparent;
    border: 0;
    outline: none;
    color: #e8eef8;
    font-size: 14px;
}

.bm-search input::placeholder {
    color: #7f91aa;
}

.bm-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bm-api-widget {
    display: block;
    width: 170px;
    font-size: 12px;
    color: #a8b5ca;
    text-decoration: none;
}

.bm-api-widget:hover strong,
.bm-api-widget:focus-visible strong {
    color: #5eead4;
}

.bm-api-widget:focus-visible {
    outline: 2px solid rgba(94, 234, 212, .65);
    outline-offset: 4px;
    border-radius: 4px;
}

.bm-api-widget strong {
    float: right;
    color: #ffffff;
}

.bm-api-bar {
    clear: both;
    margin-top: 8px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.bm-api-bar div {
    height: 100%;
    background: linear-gradient(90deg, #14f195, #22c55e);
    border-radius: 999px;
}

.bm-icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.045);
    color: #e8eef8;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    padding: 0;
    text-decoration: none;
}

.bm-icon-button:hover {
    background: rgba(255, 255, 255, 0.09);
}

.bm-account-button svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bm-alert-control {
    position: relative;
    display: flex;
}

#bm-alerts-toggle { position: relative; }
.bm-alert-badge { position: absolute; top: -6px; right: -7px; min-width: 17px; padding: 1px 4px; border-radius: 12px; background: #ef4444; color: #fff; font-size: 10px; line-height: 16px; font-weight: 700; }
.bm-alert-badge[hidden] { display: none; }

.bm-alerts-popover {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 10px);
    right: 0;
    width: min(350px, calc(100vw - 20px));
    max-height: min(70vh, 560px);
    overflow-y: auto;
    padding: 15px 16px;
    border: 1px solid rgba(96, 165, 250, .26);
    border-radius: 14px;
    background: #101d31;
    color: #e8eef8;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .38);
}

.bm-alerts-popover[hidden] {
    display: none;
}

.bm-alerts-popover::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 13px;
    width: 10px;
    height: 10px;
    border-top: 1px solid rgba(96, 165, 250, .26);
    border-left: 1px solid rgba(96, 165, 250, .26);
    background: #101d31;
    transform: rotate(45deg);
}

.bm-alerts-popover strong {
    display: block;
    margin-bottom: 5px;
    color: #fff;
    font-size: 14px;
}

.bm-alerts-popover p {
    margin: 0;
    color: #9dadc4;
    font-size: 13px;
    line-height: 1.45;
}
.bm-alert-panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bm-alert-item, .bm-alert-row { border-top: 1px solid rgba(148, 163, 184, .22); padding: 11px 0; overflow-wrap: anywhere; }
.bm-alert-item.is-unread, .bm-alert-row.is-unread { border-left: 3px solid #60a5fa; padding-left: 9px; }
.bm-alert-item strong, .bm-alert-row strong { overflow-wrap: anywhere; }
.bm-alert-item small, .bm-alert-row span { color: #9dadc4; font-size: 12px; }
.bm-alert-item small { display: block; margin-top: 4px; }
.bm-alert-item p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.bm-alert-action-form { display: inline; }
.bm-alert-action, .bm-alert-view-all { border: 0; background: none; color: #93c5fd; cursor: pointer; padding: 4px 0; font: inherit; font-size: 13px; text-decoration: underline; }
.bm-alert-open-button { display: inline-block; margin-top: 7px; padding: 5px 12px; border: 1px solid rgba(147, 197, 253, .55); border-radius: 7px; background: rgba(59, 130, 246, .18); color: #dbeafe; font-weight: 600; line-height: 1.3; text-decoration: none; }
.bm-alert-open-button:hover, .bm-alert-open-button:focus-visible { background: rgba(59, 130, 246, .32); }
.bm-alert-action:disabled { opacity: .55; cursor: wait; }
.bm-alerts-popover .bm-alert-error { margin: 8px 0; color: #fecaca; }
.bm-alerts-popover .bm-alert-error[hidden] { display: none; }
.bm-alert-view-all { display: block; border-top: 1px solid rgba(148, 163, 184, .22); padding-top: 10px; }
.bm-alert-history .bm-alert-row p { white-space: normal; overflow-wrap: anywhere; }
.bm-alert-history .bm-alert-row > div { display: flex; flex-wrap: wrap; gap: 4px 12px; }

.bm-logout-form {
    margin: 0;
}

.bm-logout-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid rgba(248, 113, 113, 0.28);
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.08);
    color: #fecaca;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.bm-logout-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bm-logout-button:hover {
    border-color: rgba(248, 113, 113, 0.5);
    background: rgba(239, 68, 68, 0.16);
    color: #ffffff;
}

.bm-logout-button:focus-visible {
    outline: 3px solid rgba(248, 113, 113, 0.35);
    outline-offset: 3px;
}

/* Page Header */

.bm-page-header {
    margin-top: 22px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bm-page-header h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.03em;
}

.bm-page-header p {
    margin: 8px 0 0;
    color: #9dadc4;
}

.bm-sync-status {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #c7d2e4;
}

.bm-sync-status small {
    display: block;
    color: #8ea0b8;
}

.bm-pulse {
    width: 14px;
    height: 14px;
    background: #14f195;
    border-radius: 50%;
    box-shadow: 0 0 0 8px rgba(20, 241, 149, 0.1);
}

/* Empty Dashboard */

.bm-dashboard-empty {
    min-height: 620px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.025);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bm-empty-card {
    text-align: center;
    max-width: 460px;
    padding: 40px;
}

.bm-empty-card h2 {
    margin-top: 0;
    font-size: 24px;
}

.bm-empty-card p {
    color: #9dadc4;
}

/* Responsive */

@media (max-width: 900px) {
    .bm-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

.bm-mobile-topbar-brand,
.bm-mobile-drawer-close,
.bm-mobile-drawer-backdrop,
.bm-sidebar-api-widget,
.bm-sidebar-logout {
    display: none;
}

.bm-page-loading-overlay {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 6, 23, .72);
    backdrop-filter: blur(3px);
}

body.bm-page-navigation-loading {
    overflow: hidden;
}

.bm-page-loading-overlay[hidden] {
    display: none;
}

.bm-page-loading-indicator {
    min-width: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
    border: 1px solid rgba(96, 165, 250, .28);
    border-radius: 15px;
    background: #101d31;
    color: #fff;
    box-shadow: 0 20px 55px rgba(0, 0, 0, .4);
}

.bm-page-loading-spinner {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border: 3px solid rgba(147, 197, 253, .25);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: bm-page-loading-spin .7s linear infinite;
}

@keyframes bm-page-loading-spin {
    to { transform: rotate(360deg); }
}

/* Shared tablet/mobile navigation foundation */
@media (max-width: 900px) {
    body.bm-mobile-drawer-open {
        overflow: hidden;
    }

    .bm-app {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .bm-main {
        width: 100%;
        min-width: 0;
        padding: 12px 14px 24px;
    }

    .bm-topbar {
        position: sticky;
        top: 0;
        z-index: 1050;
        height: 56px;
        margin: -12px -14px 0;
        padding: 0 14px;
        gap: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
        background: rgba(7, 17, 31, .96);
        backdrop-filter: blur(16px);
    }

    .bm-mobile-topbar-brand {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 9px;
    }

    .bm-mobile-topbar-brand img {
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
        border-radius: 50%;
    }

    .bm-mobile-topbar-brand strong {
        overflow: hidden;
        color: #fff;
        font-size: 15px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bm-mobile-menu-button,
    .bm-mobile-drawer-close {
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        align-items: center;
        justify-content: center;
        padding: 0;
        border: 1px solid rgba(148, 163, 184, .24);
        border-radius: 12px;
        background: rgba(255, 255, 255, .055);
        color: #e8eef8;
        cursor: pointer;
    }

    .bm-mobile-menu-button {
        display: inline-flex;
    }

    .bm-mobile-menu-button svg,
    .bm-mobile-drawer-close svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }

    .bm-mobile-menu-button:focus-visible,
    .bm-mobile-drawer-close:focus-visible {
        outline: 3px solid rgba(96, 165, 250, .55);
        outline-offset: 2px;
    }

    .bm-topbar-right {
        min-width: 0;
        margin-left: auto;
        gap: 8px;
    }

    .bm-topbar-right > .bm-api-widget,
    .bm-topbar-right > .bm-logout-form,
    #bm-qr-open {
        display: none;
    }

    .bm-topbar .bm-icon-button {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .bm-sidebar,
    body.bm-sidebar-collapsed .bm-sidebar {
        position: fixed;
        z-index: 1200;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(85vw, 320px);
        height: 100dvh;
        max-height: none;
        flex-basis: auto;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 18px 16px;
        transform: translateX(-105%);
        transition: transform .24s ease;
        box-shadow: 22px 0 55px rgba(0, 0, 0, .42);
    }

    body.bm-mobile-drawer-open .bm-sidebar {
        transform: translateX(0);
    }

    .bm-mobile-drawer-backdrop:not([hidden]) {
        position: fixed;
        z-index: 1150;
        inset: 0;
        display: block;
        background: rgba(2, 6, 23, .72);
        backdrop-filter: blur(2px);
    }

    .bm-sidebar .bm-logo,
    body.bm-sidebar-collapsed .bm-sidebar .bm-logo {
        flex-direction: row;
        justify-content: flex-start;
        gap: 11px;
        margin-bottom: 20px;
        padding: 0 4px;
    }

    .bm-sidebar .bm-logo-text,
    .bm-sidebar .bm-logo-sub,
    .bm-sidebar .bm-nav-item span:last-child,
    .bm-sidebar .bm-sidebar-bottom,
    body.bm-sidebar-collapsed .bm-sidebar .bm-logo-text,
    body.bm-sidebar-collapsed .bm-sidebar .bm-logo-sub,
    body.bm-sidebar-collapsed .bm-sidebar .bm-nav-item span:last-child,
    body.bm-sidebar-collapsed .bm-sidebar .bm-sidebar-bottom {
        display: block;
    }

    .bm-sidebar .bm-logo-image,
    body.bm-sidebar-collapsed .bm-sidebar .bm-logo-image {
        width: 40px;
        height: 40px;
    }

    .bm-sidebar-toggle {
        display: none !important;
    }

    .bm-mobile-drawer-close {
        display: inline-flex;
        margin-left: auto;
    }

    .bm-sidebar .bm-nav,
    body.bm-sidebar-collapsed .bm-sidebar .bm-nav {
        margin-top: 0;
    }

    .bm-sidebar .bm-nav-item,
    body.bm-sidebar-collapsed .bm-sidebar .bm-nav-item {
        position: relative;
        justify-content: flex-start;
        padding: 12px 14px;
    }

    body.bm-sidebar-collapsed .bm-nav-item::after {
        display: none;
    }

    .bm-sidebar-bottom,
    body.bm-sidebar-collapsed .bm-sidebar-bottom {
        display: flex !important;
        flex-direction: column;
        margin-top: 24px;
        align-items: stretch;
    }

    .bm-sidebar-api-widget {
        display: block !important;
        width: auto;
        padding: 14px;
        border: 1px solid rgba(255, 255, 255, .08);
        border-radius: 12px;
        background: rgba(255, 255, 255, .045);
    }

    .bm-sidebar-logout {
        display: block !important;
    }

    .bm-sidebar-logout .bm-logout-button {
        width: 100%;
        min-height: 44px;
    }

    body.bm-sidebar-collapsed .bm-sidebar .bm-store-card,
    body.bm-sidebar-collapsed .bm-sidebar .bm-user-card {
        display: flex;
        width: auto;
        height: auto;
        padding: 15px;
        justify-content: flex-start;
    }

    body.bm-sidebar-collapsed .bm-sidebar .bm-user-card > div:not(.bm-avatar),
    body.bm-sidebar-collapsed .bm-sidebar .bm-sidebar-bottom strong,
    body.bm-sidebar-collapsed .bm-sidebar .bm-sidebar-bottom .bm-small-label {
        display: block;
    }

    .bm-page-header {
        margin-top: 18px;
    }

    .bm-alerts-popover {
        position: fixed;
        top: 62px;
        right: 10px;
        width: min(350px, calc(100vw - 20px));
    }

    .bm-alerts-popover::before {
        display: none;
    }
}

@media (max-width: 430px) {
    .bm-main {
        padding-right: 12px;
        padding-left: 12px;
    }

    .bm-topbar {
        margin-right: -12px;
        margin-left: -12px;
        padding-right: 10px;
        padding-left: 10px;
    }

    .bm-mobile-topbar-brand strong {
        max-width: 92px;
    }

    .bm-topbar-right {
        gap: 6px;
    }
}

@media (max-width: 350px) {
    .bm-mobile-topbar-brand strong {
        display: none;
    }
}



/* Dashboard KPI Grid */

.bm-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.bm-stat-card {
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;

    padding: 22px;

    backdrop-filter: blur(12px);

    transition: all 0.2s ease;
}

.bm-stat-card:hover {
    transform: translateY(-3px);

    border-color: rgba(255,255,255,0.16);

    box-shadow:
        0 20px 40px rgba(0,0,0,0.25);
}

.bm-stat-label {
    color: #8ea0b8;
    font-size: 14px;
    margin-bottom: 14px;
}

.bm-stat-value {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.bm-stat-card.warning {
    border-color: rgba(255, 170, 0, 0.25);
}

.bm-stat-card.success {
    border-color: rgba(20, 241, 149, 0.25);
}


.bm-sync-status {
    text-decoration: none;
}

.bm-sync-status:hover strong {
    color: #14f195;
}


/* Dashboard Sections */

.bm-dashboard-section {
    margin-top: 24px;
}

.bm-card {
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    padding: 26px;
    backdrop-filter: blur(12px);
}

.bm-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.bm-card-header h2 {
    margin: 0;
    font-size: 21px;
    letter-spacing: -0.02em;
}

.bm-card-header p {
    margin: 7px 0 0;
    color: #8ea0b8;
    font-size: 14px;
}

.bm-card-link {
    color: #14f195;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.bm-card-link:hover {
    text-decoration: underline;
}

.bm-orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.bm-order-status {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;
    padding: 18px;
}

.bm-order-status.warning {
    border-color: rgba(255, 170, 0, 0.28);
}

.bm-order-label {
    display: block;
    color: #8ea0b8;
    font-size: 13px;
    margin-bottom: 10px;
}

.bm-order-status strong {
    display: block;
    color: #ffffff;
    font-size: 26px;
    letter-spacing: -0.03em;
}


/* Hot Part Card */

.bm-hot-part-content {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: nowrap;
}

.bm-hot-part-image {
    flex: 0 0 140px;
}

.bm-hot-part-image img,
.bm-hot-part-placeholder {
    width: 140px;
    height: 140px;
    object-fit: contain;
    border-radius: 14px;
}

.bm-hot-part-details {
    display: flex;
    align-items: center;
    gap: 28px;
    flex: 1;
    min-width: 0;
}

.bm-hot-part-meta {
    min-width: 240px;
}

.bm-hot-part-meta h3 {
    margin: 0 0 8px 0;
    font-size: 42px;
    line-height: 1;
}

.bm-hot-part-description {
    margin-bottom: 8px;
}

.bm-hot-part-condition {
    margin-top: 14px;
}

.bm-hot-part-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 16px;
    flex: 1;
}

.bm-hot-stat {
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 16px;
    padding: 16px 18px;
}

.bm-hot-stat span {
    display: block;
    font-size: 13px;
    margin-bottom: 8px;
    color: #94a3b8;
}

.bm-hot-stat strong {
    font-size: 18px;
    color: #f8fafc;
}





/* Restock Suggestions */

.bm-restock-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.bm-restock-item {
    display: flex;
    align-items: center;
    gap: 20px;

    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;

    padding: 18px;
}

.bm-restock-image {
    width: 80px;
    flex-shrink: 0;
}

.bm-restock-image img {
    width: 100%;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    padding: 8px;
}

.bm-restock-placeholder {
    width: 100%;
    aspect-ratio: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;
    background: rgba(255,255,255,0.04);

    color: #8ea0b8;
    font-size: 12px;
}

.bm-restock-details {
    flex: 1;
}

.bm-restock-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.bm-restock-description {
    color: #d7dfeb;
    margin-bottom: 6px;
}

.bm-restock-colour {
    color: #8ea0b8;
    font-size: 14px;
}

.bm-restock-metrics {
    display: flex;
    gap: 14px;
}

.bm-restock-metric {
    min-width: 90px;

    background: rgba(255,255,255,0.04);
    border-radius: 12px;

    padding: 12px;
    text-align: center;
}

.bm-restock-metric span {
    display: block;
    color: #8ea0b8;
    font-size: 12px;
    margin-bottom: 8px;
}

.bm-restock-metric strong {
    font-size: 20px;
    letter-spacing: -0.03em;
}

.bm-restock-metric.highlight {
    border: 1px solid rgba(20, 241, 149, 0.25);
}


.bm-condition-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.bm-condition-badge.new {
    background: rgba(20, 241, 149, 0.14);
    color: #14f195;
    border: 1px solid rgba(20, 241, 149, 0.35);
}

.bm-condition-badge.used {
    background: rgba(255, 170, 0, 0.14);
    color: #ffb020;
    border: 1px solid rgba(255, 170, 0, 0.35);
}







.bm-orders-marketplace-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.bm-orders-total,
.bm-packed-order-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.12);
    color: inherit;
    text-decoration: none;
}

.bm-orders-total {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 20px;
}

.bm-orders-total-item {
    min-width: 0;
}

.bm-orders-total-item .bm-order-label {
    margin-bottom: 0;
}

.bm-orders-total-item strong,
.bm-packed-order-summary strong {
    display: block;
    color: #ffffff;
    font-size: 24px;
}

.bm-packed-order-summary {
    margin-top: 16px;
    border-color: rgba(52, 211, 153, 0.25);
    background: rgba(16, 185, 129, 0.10);
}

.bm-packed-order-summary span {
    color: #a7f3d0;
}

@media (max-width: 700px) {
    .bm-orders-total {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.bm-marketplace-order-card {
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 14px;
    padding: 18px;
    background: rgba(15, 23, 42, 0.65);
}

.bm-marketplace-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.bm-marketplace-order-header h3 {
    margin: 0;
    color: #e5e7eb;
    font-size: 18px;
}

.bm-marketplace-order-card .bm-orders-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bm-marketplace-order-card .bm-order-status {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

/* Dashboard phone layouts */
@media (max-width: 700px) {
    .bm-dashboard-section {
        min-width: 0;
        margin-top: 16px;
    }

    .bm-dashboard-section .bm-card,
    .bm-stat-card {
        min-width: 0;
        max-width: 100%;
        padding: 16px;
        border-radius: 17px;
    }

    .bm-dashboard-section .bm-card-header {
        min-width: 0;
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 16px;
    }

    .bm-dashboard-section .bm-card-header h2 {
        font-size: 18px;
        line-height: 1.25;
    }

    .bm-orders-marketplace-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .bm-marketplace-order-card {
        min-width: 0;
        width: 100%;
        padding: 14px;
    }

    .bm-marketplace-order-card .bm-orders-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .bm-marketplace-order-card .bm-order-status,
    .bm-orders-total {
        min-width: 0;
        padding: 14px;
    }

    .bm-marketplace-order-card .bm-order-status strong,
    .bm-orders-total-item strong,
    .bm-packed-order-summary strong {
        overflow-wrap: anywhere;
        font-size: 21px;
    }

    .bm-orders-total {
        gap: 12px;
    }

    .bm-dashboard-section > .bm-card > .bm-orders-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .bm-dashboard-section > .bm-card > .bm-orders-grid .bm-order-status {
        min-width: 0;
        padding: 14px;
    }

    .bm-dashboard-section > .bm-card > .bm-orders-grid .bm-order-status strong {
        overflow-wrap: anywhere;
        font-size: 21px;
    }

    .bm-restock-item {
        min-width: 0;
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr);
        align-items: start;
        gap: 12px;
        padding: 14px;
        border-radius: 15px;
    }

    .bm-restock-image {
        width: 72px;
    }

    .bm-restock-details,
    .bm-restock-description {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .bm-restock-title {
        font-size: 17px;
    }

    .bm-restock-metrics {
        grid-column: 1 / -1;
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .bm-restock-metric {
        min-width: 0;
        padding: 10px 8px;
    }

    .bm-restock-metric strong {
        overflow-wrap: anywhere;
        font-size: 18px;
    }

    .bm-hot-part-content {
        min-width: 0;
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        align-items: start;
        gap: 14px;
    }

    .bm-hot-part-image {
        min-width: 0;
        flex: none;
    }

    .bm-hot-part-image img,
    .bm-hot-part-placeholder {
        width: 88px;
        height: 88px;
    }

    .bm-hot-part-meta {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .bm-hot-part-meta h3 {
        font-size: 25px;
    }

    .bm-hot-part-stats {
        grid-column: 1 / -1;
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .bm-hot-stat {
        min-width: 0;
        padding: 11px 10px;
    }

    .bm-hot-stat strong {
        overflow-wrap: anywhere;
        font-size: 17px;
    }

    .bm-chart-container {
        min-width: 0;
        height: 300px;
    }
}

.bm-order-status-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.bm-order-status-link:hover,
.bm-order-status-link:focus-visible {
    border-color: rgba(96, 165, 250, 0.65);
    background: rgba(37, 99, 235, 0.22);
    transform: translateY(-2px);
    outline: none;
}

/* V3 order picker */
.bm-order-picker-page .bm-card {
    padding: 24px;
}

.bm-picker-page-header {
    align-items: center;
}

.bm-picker-page-header h1,
.bm-picker-access-card h1 {
    margin: 0 0 6px;
}

.bm-picker-page-header p,
.bm-picker-access-card p {
    margin: 0;
    color: #94a3b8;
}

.bm-picker-access-card .bm-secondary-button {
    margin-top: 18px;
    width: fit-content;
}

.bm-picker-message {
    margin-bottom: 16px;
}

.bm-picker-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
}

.bm-picker-toolbar strong {
    margin-right: auto;
    color: #cbd5e1;
}

.bm-picker-marker-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 7px 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
}

.bm-picker-marker-choice legend {
    padding: 0 4px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.bm-picker-marker-choice label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #dbeafe;
    font-size: 13px;
    font-weight: 800;
}

.bm-picker-order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.bm-picker-order-card {
    display: block;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.7);
    color: #e8eef8;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.bm-picker-order-card:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.45);
}

.bm-picker-order-card.selected {
    border-color: rgba(59, 130, 246, 0.75);
    background: rgba(30, 64, 175, 0.2);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.bm-picker-card-top,
.bm-picker-order-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.bm-picker-card-top,
.bm-picker-order-number,
.bm-picker-customer,
.bm-picker-order-meta {
    margin-right: 16px;
    margin-left: 16px;
}

.bm-picker-card-top {
    margin-top: 16px;
}

.bm-picker-card-top input {
    width: 21px;
    height: 21px;
    accent-color: #2563eb;
}

.bm-picker-platform {
    display: inline-flex;
    padding: 6px 10px;
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.16);
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bm-picker-platform.bo {
    border-color: rgba(34, 197, 94, 0.38);
    background: rgba(34, 197, 94, 0.14);
    color: #bbf7d0;
}

.bm-picker-order-number {
    margin-top: 16px;
    color: #f8fafc;
    font-size: 18px;
    font-weight: 900;
}

.bm-picker-customer {
    margin-top: 5px;
    color: #cbd5e1;
    font-weight: 700;
}

.bm-picker-order-meta {
    margin-top: 14px;
    margin-bottom: 16px;
    color: #94a3b8;
    font-size: 13px;
}

.bm-picker-order-meta strong {
    color: #14f195;
    font-size: 16px;
}

.bm-picker-card-totals {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(2, 6, 23, 0.25);
}

.bm-picker-card-totals div {
    padding: 12px;
    text-align: center;
}

.bm-picker-card-totals div + div {
    border-left: 1px solid rgba(148, 163, 184, 0.16);
}

.bm-picker-card-totals strong,
.bm-picker-card-totals span {
    display: block;
}

.bm-picker-card-totals strong {
    color: #f8fafc;
    font-size: 18px;
}

.bm-picker-card-totals span {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.bm-picker-bottom-action {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.bm-picker-empty {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
    color: #cbd5e1;
}

@media (max-width: 760px) {
    .bm-picker-page-header,
    .bm-picker-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .bm-picker-toolbar strong {
        margin-right: 0;
    }

    .bm-picker-order-grid {
        grid-template-columns: 1fr;
    }
}

/* V3 active picking workspace */
.bm-picking-header {
    align-items: center;
}

.bm-picking-header h1 {
    margin: 0 0 6px;
}

.bm-picking-header p {
    margin: 0;
    color: #94a3b8;
}

.bm-picking-progress {
    display: flex;
    overflow: hidden;
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 14px;
    background: rgba(34, 197, 94, 0.12);
    color: #bbf7d0;
    white-space: nowrap;
}

.bm-picking-progress > span {
    min-width: 92px;
    padding: 9px 14px;
    text-align: center;
}

.bm-picking-progress > span + span { border-left: 1px solid rgba(34, 197, 94, 0.2); }
.bm-picking-progress strong { color: #f8fafc; font-size: 17px; }
.bm-picking-progress small { display: block; margin-top: 2px; color: #86efac; font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }

.bm-picking-workspace {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    margin-top: 18px;
}

.bm-picking-order-panel {
    position: sticky;
    top: 16px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.62);
}

.bm-picking-panel-label {
    display: block;
    margin-bottom: 10px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.bm-picking-order-key {
    display: grid;
    gap: 10px;
    margin: 0;
}

.bm-picking-order-key > a {
    display: grid;
    grid-template-columns: 30px auto;
    column-gap: 8px;
    align-items: center;
    padding: 8px 11px;
    border: 1px solid color-mix(in srgb, var(--order-colour) 55%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--order-colour) 13%, transparent);
    color: inherit;
    text-decoration: none;
}

.bm-picking-back { display: flex; justify-content: center; margin-top: 12px; }

.bm-picking-order-key > a:hover {
    background: color-mix(in srgb, var(--order-colour) 22%, transparent);
}

.bm-picking-order-key span,
.bm-pick-order-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--order-colour);
    color: #fff;
    font-weight: 900;
}

.bm-picking-order-key span {
    grid-row: 1 / 3;
    width: 30px;
    height: 30px;
}

.bm-picking-order-key strong {
    color: #f8fafc;
    font-size: 13px;
}

.bm-picking-order-key small {
    color: #94a3b8;
}

.bm-pick-list {
    display: grid;
    gap: 10px;
}

.bm-pick-line {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-left: 5px solid var(--order-colour);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.7);
    transition: opacity 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.bm-pick-line.current {
    border-color: color-mix(in srgb, var(--order-colour) 64%, #334155);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.36), 0 0 0 2px color-mix(in srgb, var(--order-colour) 32%, transparent);
}

.bm-pick-line.picked {
    background: rgba(20, 83, 45, 0.2);
}

.bm-pick-line-main {
    display: grid;
    grid-template-columns: 42px minmax(110px, 180px) 54px minmax(220px, 1fr) 72px 72px 82px;
    gap: 12px;
    align-items: center;
    width: 100%;
    min-height: 78px;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.bm-pick-line-main:hover {
    background: rgba(255, 255, 255, 0.035);
}

.bm-pick-line.current .bm-pick-line-main {
    grid-template-areas:
        "marker image item condition condition"
        "marker image location location quantity"
        ". image location location state";
    grid-template-columns: 48px 168px minmax(230px, 1fr) 72px minmax(140px, .42fr);
    grid-template-rows: auto 96px auto;
    gap: 12px 16px;
    min-height: 238px;
    padding: 18px;
    background: radial-gradient(circle at 18% 25%, color-mix(in srgb, var(--order-colour) 12%, transparent), transparent 38%), rgba(2, 6, 23, 0.42);
}

.bm-pick-line.current .bm-pick-order-marker { grid-area: marker; align-self: start; }
.bm-pick-line.current .bm-pick-item-image { grid-area: image; width: 168px; height: 168px; border-radius: 16px; padding: 12px; }
.bm-pick-line.current .bm-pick-item-text { grid-area: item; align-self: end; }
.bm-pick-line.current .bm-pick-item-text strong { font-size: 20px; }
.bm-pick-line.current .bm-pick-item-text small { font-size: 14px; }
.bm-pick-line.current .bm-pick-item-text .bm-pick-colour,
.bm-pick-line.current .bm-pick-item-text .bm-pick-colour-separator { display: none; }
.bm-pick-line.current .bm-pick-location { grid-area: location; position: relative; align-self: stretch; overflow: hidden; padding: 27px 18px 40px; border: 1px solid rgba(96, 165, 250, 0.2); border-radius: 13px; background: rgba(248, 250, 252, 0.96); color: #0f172a; font-size: 27px; }
.bm-pick-line.current .bm-pick-location::before { content: "Location"; position: absolute; top: 9px; left: 18px; color: #64748b; font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.bm-pick-line.current .bm-pick-condition { grid-area: condition; align-self: end; justify-self: end; }
.bm-pick-line.current .bm-pick-location-colour {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 18px;
    border-top: 1px solid rgba(15, 23, 42, 0.22);
    background: var(--brick-colour, #64748b);
    color: var(--brick-colour-text, #ffffff);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .01em;
}
.bm-pick-line.current .bm-pick-quantity { grid-area: quantity; position: relative; align-self: stretch; padding: 25px 16px 8px; border: 1px solid rgba(96, 165, 250, 0.2); border-radius: 13px; background: rgba(248, 250, 252, 0.96); text-align: left; }
.bm-pick-line.current .bm-pick-quantity small { position: absolute; top: 9px; left: 16px; color: #64748b; }
.bm-pick-line.current .bm-pick-quantity strong { color: #0f172a; font-size: 30px; }
.bm-pick-line.current .bm-pick-state { grid-area: state; justify-self: stretch; }

.bm-pick-order-marker {
    width: 38px;
    height: 38px;
    font-size: 17px;
}

.bm-pick-location {
    color: #fde68a;
    font-size: 15px;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.bm-pick-location-colour { display: none; }

.bm-pick-item-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.bm-pick-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.bm-pick-item-text strong,
.bm-pick-item-text small,
.bm-pick-quantity small,
.bm-pick-quantity strong {
    display: block;
}

.bm-pick-item-text strong {
    color: #f8fafc;
    font-size: 15px;
}

.bm-pick-item-text small {
    margin-top: 4px;
    color: #94a3b8;
}

.bm-pick-colour {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.bm-pick-colour-swatch {
    display: inline-block;
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: 4px;
    background: var(--brick-colour);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.55);
}

.bm-pick-condition {
    display: flex;
    justify-content: center;
}

.bm-pick-quantity {
    text-align: center;
}

.bm-pick-quantity small {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.bm-pick-quantity strong {
    color: #fff;
    font-size: 26px;
}

.bm-pick-state {
    padding: 7px 9px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    color: #fde68a;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.bm-pick-line.picked .bm-pick-state {
    background: rgba(34, 197, 94, 0.16);
    color: #bbf7d0;
}

.bm-pick-details-toggle {
    width: 100%;
    padding: 8px 14px;
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(2, 6, 23, 0.25);
    color: #93c5fd;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.bm-pick-details {
    padding: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(2, 6, 23, 0.4);
}

.bm-pick-detail-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 12px;
    color: #94a3b8;
    font-size: 13px;
}

.bm-pick-detail-stats strong {
    color: #f8fafc;
}

.bm-pick-detail-stats a {
    margin-left: auto;
    color: #60a5fa;
    font-weight: 800;
}

.bm-pick-detail-form {
    display: block;
}

.bm-pick-edit-panel {
    padding: 14px;
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 14px;
    background: rgba(15, 118, 110, 0.14);
}

.bm-pick-edit-controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.bm-pick-edit-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bm-pick-edit-control > span,
.bm-pick-edit-notes .bm-transfer-field > span {
    color: #9ca3af;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.bm-pick-edit-control .bm-edit-lot-stepper {
    flex: 0 0 138px;
}

.bm-pick-edit-control .bm-edit-lot-stepper input {
    margin: 0;
}

.bm-pick-edit-options {
    display: grid;
    grid-template-columns: auto auto minmax(160px, 240px);
    align-items: end;
    gap: 12px;
    margin: 12px 0;
}

.bm-pick-edit-options .bm-edit-lot-toggle {
    border-radius: 10px;
}

.bm-pick-edit-options .bm-edit-lot-stockroom-id input {
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 10px;
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.84);
}

.bm-pick-edit-options .bm-edit-lot-stockroom-id input:disabled {
    color: #94a3b8;
    border-color: rgba(96, 165, 250, 0.16);
    background: rgba(15, 23, 42, 0.62);
    cursor: not-allowed;
}

.bm-pick-edit-notes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.bm-pick-edit-notes textarea {
    width: 100%;
    min-height: 58px;
    margin-top: 5px;
    resize: vertical;
}

.bm-pick-edit-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.bm-pick-edit-actions .bm-secondary-button,
.bm-pick-edit-actions .bm-primary-button {
    width: auto;
    min-width: 140px;
}

.bm-pick-detail-form [data-detail-message] {
    min-height: 18px;
    color: #bfdbfe;
    font-size: 13px;
    font-weight: 700;
}

.bm-pick-no-inventory {
    color: #fca5a5;
}

@media (max-width: 900px) {
    .bm-picking-workspace { grid-template-columns: 1fr; }
    .bm-picking-order-panel { position: static; }
    .bm-picking-order-key { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .bm-pick-line.current .bm-pick-line-main {
        grid-template-areas: "marker item condition" "image location quantity" "image state state";
        grid-template-columns: 120px minmax(160px, 1fr) 120px;
        grid-template-rows: auto 96px auto;
    }
    .bm-pick-line.current .bm-pick-item-image { width: 120px; height: 120px; }

    .bm-pick-line-main {
        grid-template-columns: 38px minmax(90px, 1fr) 48px minmax(160px, 2fr) 60px;
    }

    .bm-pick-state {
        grid-column: 1 / -1;
    }

    .bm-pick-detail-form {
        display: block;
    }

    .bm-pick-edit-controls { grid-template-columns: 1fr; }
    .bm-pick-edit-control { justify-content: space-between; }
    .bm-pick-edit-options { grid-template-columns: 1fr; }
    .bm-pick-edit-notes { grid-template-columns: 1fr; }

    .bm-pick-detail-stats a {
        margin-left: 0;
    }
}

@media (max-width: 620px) {
    .bm-picking-header { align-items: stretch; flex-direction: column; }
    .bm-picking-progress { width: 100%; }
    .bm-picking-progress > span { flex: 1; min-width: 0; }
    .bm-picking-order-key { grid-template-columns: 1fr; }
    .bm-pick-line.current .bm-pick-line-main {
        grid-template-areas: "marker condition" "item item" "image image" "location quantity" "state state";
        grid-template-columns: minmax(0, 1fr) 110px;
        grid-template-rows: auto auto 150px 96px auto;
    }
    .bm-pick-line.current .bm-pick-item-image { display: flex; width: 100%; height: 150px; }
    .bm-pick-line.current .bm-pick-order-marker { justify-self: start; }
    .bm-pick-line.current .bm-pick-condition { align-self: center; }
    .bm-pick-line.current .bm-pick-location { font-size: 20px; }

    .bm-pick-line-main {
        grid-template-columns: 38px 1fr 60px;
    }

    .bm-pick-item-image {
        display: none;
    }

    .bm-pick-item-text {
        grid-column: 1 / -1;
    }
}

/* =========================================================
   Shared mobile accordion and data-card table foundation
   ========================================================= */
.bm-mobile-accordion-toggle {
  display: none;
}

.bm-set-inventory-content[hidden] {
  display: none !important;
}

@media (max-width: 800px) {
  .bm-sets-page,
  .bm-set-detail-page,
  .bm-sets-page .bm-card,
  .bm-set-detail-page .bm-card {
    min-width: 0;
    max-width: 100%;
  }

  .bm-sets-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
  }

  .bm-sets-toolbar > *,
  .bm-sets-toolbar .bm-inventory-search,
  .bm-sets-toolbar .bm-inventory-select,
  .bm-sets-toolbar .bm-primary-button,
  .bm-sets-toolbar .bm-link-button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    box-sizing: border-box;
  }

  .bm-set-inventory-card {
    padding: 14px;
    overflow: visible;
  }

  .bm-mobile-accordion-toggle {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(96, 165, 250, .34);
    border-radius: 13px;
    color: #f1f5f9;
    background: rgba(37, 99, 235, .12);
    font: inherit;
    font-weight: 850;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
  }

  .bm-mobile-accordion-toggle:hover {
    border-color: rgba(96, 165, 250, .62);
    background: rgba(37, 99, 235, .2);
  }

  .bm-mobile-accordion-toggle:focus-visible {
    outline: 3px solid #60a5fa;
    outline-offset: 3px;
  }

  .bm-mobile-accordion-indicator {
    flex: 0 0 auto;
    color: #93c5fd;
  }

  .bm-set-inventory-content {
    min-width: 0;
    padding-top: 16px;
  }

  .bm-set-inventory-content > .bm-card-header {
    display: none;
  }

  .bm-set-inventory-content .bm-item-search-panel {
    min-width: 0;
    padding: 14px;
  }

  .bm-set-inventory-content .bm-item-search-main-row,
  .bm-set-inventory-content .bm-item-search-filter-row-primary,
  .bm-set-inventory-content .bm-advanced-search-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bm-set-inventory-content .bm-item-search-main-row,
  .bm-set-inventory-content .bm-item-search-filter-row-primary {
    gap: 12px;
  }

  .bm-set-inventory-content .bm-item-search-field,
  .bm-set-inventory-content .bm-item-search-actions,
  .bm-set-inventory-content .bm-sell-thru-range,
  .bm-set-inventory-content .bm-search-number-stepper {
    min-width: 0;
    max-width: 100%;
  }

  .bm-set-inventory-content .bm-item-search-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bm-set-inventory-content .bm-item-search-actions > * {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
  }

  .bm-set-inventory-content .bm-sell-thru-range {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .bm-set-table-actions {
    z-index: 20;
    align-items: stretch;
    justify-content: space-between;
  }

  .bm-set-table-actions .bm-wanted-bulk-actions {
    min-width: 0;
    flex: 1 1 210px;
    flex-wrap: wrap;
  }

  .bm-set-table-actions .bm-column-chooser {
    margin-left: auto;
  }

  .bm-set-table-actions .bm-column-menu {
    right: 0;
    left: auto;
    width: min(280px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
    max-height: min(70vh, 520px);
    overflow-y: auto;
  }

  .bm-mobile-card-toolbar {
    z-index: 20;
    width: 100%;
    min-width: 0;
    align-items: stretch;
  }

  .bm-mobile-card-toolbar > *,
  .bm-mobile-card-toolbar .bm-wanted-bulk-actions,
  .bm-mobile-card-toolbar .bm-bulk-toolbar-actions,
  .bm-mobile-card-toolbar .bm-external-bulk-actions {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
  }

  .bm-mobile-card-toolbar .bm-column-chooser {
    margin-left: auto;
  }

  .bm-mobile-card-toolbar .bm-column-menu {
    right: 0;
    left: auto;
    width: min(280px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
    max-height: min(70vh, 520px);
    overflow-y: auto;
  }

  .bm-mobile-card-toolbar .bm-inventory-select {
    min-width: 0;
    max-width: 100%;
  }

  .bm-mobile-card-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .bm-mobile-card-table,
  .bm-mobile-card-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .bm-mobile-card-table thead {
    display: none;
  }

  .bm-mobile-card-table tbody {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .bm-mobile-card-table tbody tr.bm-inventory-main-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 16px;
    background: rgba(15, 32, 52, .82);
    box-shadow: 0 9px 24px rgba(0, 0, 0, .14);
  }

  .bm-mobile-card-table tbody tr.bm-inventory-main-row > td {
    display: flex;
    min-width: 0;
    min-height: 66px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
    padding: 12px 14px;
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, .11);
    background: transparent;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .bm-mobile-card-table tbody tr.bm-inventory-main-row > td:nth-of-type(even) {
    border-left: 1px solid rgba(148, 163, 184, .11);
  }

  .bm-mobile-card-table tbody tr.bm-inventory-main-row > td[data-mobile-label]::before {
    content: attr(data-mobile-label);
    display: block;
    color: #8fa2ba;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .045em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .bm-mobile-card-table tbody tr.bm-inventory-main-row > .bm-mobile-card-identity {
    grid-column: 1 / -1;
    min-height: 96px;
    border-top: 0;
    border-left: 0;
    background: rgba(30, 58, 94, .38);
  }

  .bm-mobile-card-table .bm-inventory-part-cell {
    width: 100%;
    min-width: 0;
    align-items: flex-start;
  }

  .bm-mobile-card-table .bm-inventory-part-text {
    min-width: 0;
    white-space: normal;
  }

  .bm-mobile-card-table .bm-inventory-part-text span,
  .bm-mobile-card-table .bm-inventory-part-text a,
  .bm-mobile-card-table .bm-truncate-text {
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }

  .bm-mobile-card-table .bm-inventory-image {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
  }

  .bm-mobile-card-table tbody tr.bm-inventory-main-row > .bm-mobile-card-wide,
  .bm-mobile-card-table tbody tr.bm-inventory-main-row > .bm-mobile-card-actions {
    grid-column: 1 / -1;
    border-left: 0;
  }

  .bm-mobile-card-table .bm-mobile-card-actions .bm-inventory-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .bm-mobile-card-table .bm-mobile-card-actions .bm-recheck-btn {
    min-height: 42px;
  }

  .bm-mobile-card-table tbody tr:not(.bm-inventory-main-row) td.bm-empty-row {
    display: block;
    width: 100%;
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, .18);
    border-radius: 14px;
    white-space: normal;
  }

  .bm-mobile-card-table tbody tr.bm-transfer-row,
  .bm-mobile-card-table tbody tr.bm-inventory-details-row[style*="table-row"] {
    display: block !important;
    width: 100%;
    min-width: 0;
  }

  .bm-mobile-card-table tbody tr.bm-transfer-row > td,
  .bm-mobile-card-table tbody tr.bm-inventory-details-row > td {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    white-space: normal;
  }

  .bm-mobile-card-table .bm-inventory-details-panel {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .bm-mobile-card-table tbody tr.bm-inventory-main-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .bm-mobile-card-table tbody tr.bm-inventory-main-row > td,
  .bm-mobile-card-table tbody tr.bm-inventory-main-row > td:nth-of-type(even) {
    grid-column: 1;
    border-left: 0;
  }

  .bm-set-inventory-content .bm-item-search-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .bm-mobile-card-table .bm-inventory-details-panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 800px) {
  .bm-inventory-table-wrap.bm-mobile-card-table-wrap {
    overflow: visible;
  }

  .bm-inventory-table.bm-mobile-card-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .bm-mobile-card-table tbody tr:not(.bm-inventory-main-row) {
    display: block;
    width: 100%;
  }
}



.bm-health-status {
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #4ade80;
    font-weight: 600;
}


.bm-chart-container {
    position: relative;
    height: 360px;
    width: 100%;
}







/* Inventory View */

.bm-inventory-toolbar {
    display: grid;
    grid-template-columns: 1fr 180px 220px auto;
    gap: 14px;
    margin-bottom: 22px;
}

.bm-inventory-search,
.bm-inventory-select {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #e5e7eb;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
}

.bm-primary-button,
.bm-small-button {
    border: 0;
    border-radius: 12px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.bm-primary-button {
    padding: 12px 18px;
}

.bm-small-button {
    padding: 8px 10px;
    font-size: 12px;
}

.bm-inventory-table-wrap {
    overflow-x: auto;
}

.bm-inventory-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

.bm-inventory-table th {
    text-align: left;
    color: #93a4bc;
    font-size: 12px;
    font-weight: 700;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    white-space: nowrap;
}

.bm-inventory-table td {
    padding: 14px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    color: #e5e7eb;
    font-size: 13px;
    vertical-align: middle;
    white-space: nowrap;
}

.bm-inventory-part-cell {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 300px;
}

.bm-inventory-part-cell strong {
    display: block;
    color: #f8fafc;
    font-size: 15px;
    margin-bottom: 3px;
}

.bm-inventory-part-cell span {
    display: block;
    color: #cbd5e1;
    margin-bottom: 3px;
    white-space: normal;
}

.bm-inventory-part-cell em {
    display: block;
    color: #94a3b8;
    font-style: normal;
}

.bm-inventory-image {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 52px;
}

.bm-inventory-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bm-inventory-image span {
    font-size: 10px;
    color: #64748b;
}

.bm-inventory-actions {
    display: flex;
    gap: 8px;
}

.bm-empty-row {
    text-align: center;
    padding: 30px !important;
    color: #94a3b8 !important;
}
.bm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
    color: #94a3b8;
}

.bm-pagination a {
    padding: 9px 14px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.18);
    color: #bfdbfe;
    text-decoration: none;
    font-weight: 700;
}

.bm-pagination a:hover {
    background: rgba(37, 99, 235, 0.32);
}


.bm-page-chooser {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
    color: #94a3b8;
}

.bm-page-chooser a {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #bfdbfe;
    text-decoration: none;
    font-weight: 700;
}

.bm-page-chooser a.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.bm-page-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.bm-page-jump input {
    width: 80px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.75);
    color: #e5e7eb;
    padding: 0 10px;
}

.bm-page-jump button {
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 800px) {
    .bm-page-chooser,
    .bm-pagination {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        flex-wrap: wrap;
        justify-content: center;
        gap: 7px;
    }

    .bm-page-chooser > span:first-child {
        flex: 1 0 100%;
        text-align: center;
        line-height: 1.35;
    }

    .bm-page-chooser a,
    .bm-pagination a {
        min-width: 44px;
        min-height: 44px;
        height: 44px;
        padding: 0 9px;
        box-sizing: border-box;
    }

    .bm-page-jump {
        display: flex;
        width: 100%;
        min-width: 0;
        margin: 5px 0 0;
        justify-content: center;
        flex-wrap: wrap;
        gap: 7px;
    }

    .bm-page-jump label {
        line-height: 44px;
    }

    .bm-page-jump input,
    .bm-page-jump button {
        height: 44px;
    }

    .bm-page-jump input {
        width: 72px;
        min-width: 0;
        box-sizing: border-box;
    }
}



.bm-inventory-table th a {
    color: #93a4bc;
    text-decoration: none;
    font-weight: 700;
}

.bm-inventory-table th a:hover {
    color: #ffffff;
}


.bm-inventory-details-row td {
    padding: 0 12px 18px 76px;
    background: transparent;
    border-top: 0;
}

.bm-inventory-details-panel {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.bm-detail-box {
    padding: 12px 14px;
    background: rgba(2, 6, 23, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
}

.bm-detail-box span {
    display: block;
    margin-bottom: 6px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bm-detail-box strong {
    display: block;
    color: #e5e7eb;
    font-size: 15px;
    font-weight: 800;
}

.bm-inventory-main-row.details-open td {
    border-bottom-color: transparent;
}

@media (max-width: 1200px) {
    .bm-inventory-details-panel {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
}

@media (max-width: 700px) {
    .bm-inventory-details-row td {
        padding-left: 12px;
    }

    .bm-inventory-details-panel {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

.bm-metric-link {
    color: #38bdf8;
    font-weight: 700;
    text-decoration: none;
    transition: 0.15s ease;
}

.bm-metric-link:hover {
    color: #7dd3fc;
    text-decoration: underline;
}


.bm-column-chooser {
    position: relative;
    z-index: 100;
    margin: 18px 0 14px;
}

.bm-column-menu {
    position: absolute;
    z-index: 101;
    top: 42px;
    left: 0;
    min-width: 220px;
    padding: 12px;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.bm-column-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 6px;
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.bm-column-menu label:hover {
    background: rgba(37, 99, 235, 0.16);
    border-radius: 8px;
}

.bm-column-menu input {
    width: 15px;
    height: 15px;
}

/* V3 contextual help prototype */
.bm-context-help {
    display: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 5px;
    padding: 0;
    border: 1px solid rgba(96, 165, 250, .55);
    border-radius: 999px;
    color: #dbeafe;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    vertical-align: middle;
}
.bm-help-mode-active .bm-context-help { display: inline-flex; }
.bm-context-help:hover, .bm-context-help:focus-visible {
    outline: 3px solid rgba(96, 165, 250, .28);
    outline-offset: 2px;
}
.bm-help-mode-toggle.is-active {
    color: #fff;
    border-color: rgba(52, 211, 153, .65);
    background: rgba(16, 185, 129, .2);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .1);
}
body.bm-help-modal-open { overflow: hidden; }
.bm-help-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: rgba(2, 6, 23, .82);
    backdrop-filter: blur(6px);
}
.bm-help-modal[hidden] { display: none !important; }
.bm-help-modal-card {
    display: flex;
    flex-direction: column;
    width: min(820px, 100%);
    max-height: min(880px, calc(100vh - 44px));
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, .5);
    border-radius: 18px;
    color: #e8eef8;
    background: linear-gradient(145deg, #14263e, #0c192b);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .58);
}
.bm-help-modal-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 13px;
    align-items: start;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(96, 165, 250, .22);
}
.bm-help-modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    font-weight: 900;
}
.bm-help-modal-header h2 { margin: 0 0 4px; color: #fff; font-size: 1.45rem; }
.bm-help-modal-header p { margin: 0; color: #aebed3; line-height: 1.4; }
.bm-help-modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(148, 163, 184, .3);
    border-radius: 10px;
    color: #dbe7f5;
    background: rgba(15, 23, 42, .66);
    font-size: 23px;
    cursor: pointer;
}
.bm-help-modal-close:hover, .bm-help-modal-close:focus-visible { border-color: #60a5fa; color: #fff; }
.bm-help-modal-content { overflow-y: auto; padding: 4px 22px 24px; }
.bm-help-video-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border: 1px solid rgba(96, 165, 250, .35);
    border-radius: 14px;
    background: rgba(37, 99, 235, .1);
}
.bm-help-video-copy { display: grid; gap: 4px; }
.bm-help-video-copy strong { color: #f8fafc; }
.bm-help-video-copy span, .bm-help-video-copy small { color: #aebed3; }
.bm-help-video-player { position: relative; width: 100%; overflow: hidden; border-radius: 12px; background: #020617; }
.bm-help-video-player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #020617; }
.bm-help-video-watermark {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 5px 8px;
    border-radius: 6px;
    color: rgba(255,255,255,.82);
    background: rgba(2,6,23,.58);
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
}
.bm-help-video-error { margin-top: 10px; color: #fca5a5; font-weight: 700; }
.bm-help-section { padding-top: 18px; }
.bm-help-section h3 { margin: 0 0 9px; color: #f8fbff; font-size: 1.08rem; }
.bm-help-section p { margin: 0 0 9px; color: #c7d3e3; line-height: 1.58; }
.bm-help-step-list, .bm-help-data-card ul { margin: 0; padding-left: 22px; color: #c7d3e3; line-height: 1.55; }
.bm-help-step-list li + li, .bm-help-data-card li + li { margin-top: 6px; }
.bm-help-data-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bm-help-data-card {
    padding: 12px;
    border: 1px solid rgba(96, 165, 250, .2);
    border-radius: 12px;
    background: rgba(15, 23, 42, .5);
}
.bm-help-data-card h4 { margin: 0 0 8px; color: #8fc2ff; }
.bm-help-formula {
    margin-top: 10px;
    padding: 11px 13px;
    overflow-wrap: anywhere;
    border: 1px solid rgba(96, 165, 250, .28);
    border-radius: 10px;
    color: #dbeafe;
    background: rgba(7, 18, 34, .78);
    font-family: Consolas, monospace;
}
.bm-help-example-table { width: 100%; border-collapse: collapse; color: #dbe7f5; }
.bm-help-example-table th, .bm-help-example-table td { padding: 8px 10px; border-bottom: 1px solid rgba(148, 163, 184, .16); }
.bm-help-example-table th { text-align: left; font-weight: 600; }
.bm-help-example-table td { text-align: right; font-weight: 800; }
.bm-help-example-table .is-result { color: #8fc2ff; font-size: 1.05rem; }
.bm-help-example-note { margin-top: 9px !important; color: #93a8c1 !important; font-size: .85rem; }
.bm-help-content-version { margin-top: 20px; padding-top: 12px; border-top: 1px solid rgba(148, 163, 184, .14); color: #71839b; font-size: .75rem; text-align: right; }
.bm-help-callout { margin-top: 16px; padding: 13px 15px; border: 1px solid; border-radius: 12px; }
.bm-help-callout strong { display: block; margin-bottom: 4px; }
.bm-help-callout p { margin: 0; line-height: 1.5; }
.bm-help-callout-important { border-color: rgba(245, 158, 11, .42); color: #fde68a; background: rgba(120, 53, 15, .2); }
.bm-help-callout-tip { border-color: rgba(52, 211, 153, .38); color: #bbf7d0; background: rgba(6, 78, 59, .2); }
.bm-help-faq { border-bottom: 1px solid rgba(148, 163, 184, .18); }
.bm-help-faq summary { padding: 11px 2px; color: #dbeafe; font-weight: 800; cursor: pointer; }
.bm-help-faq p { padding: 0 2px 12px; }
@media (max-width: 720px) {
    .bm-help-modal { padding: 10px; }
    .bm-help-modal-card { max-height: calc(100vh - 20px); border-radius: 14px; }
    .bm-help-modal-header { padding: 15px; }
    .bm-help-modal-content { padding: 2px 15px 18px; }
    .bm-help-data-grid { grid-template-columns: 1fr; }
}


.bm-truncate-cell {
    max-width: 260px;
    width: 260px;
}

.bm-truncate-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
    cursor: help;
}

.bm-detail-box-full {
    grid-column: 1 / -1;
}

.bm-detail-box-full strong {
    white-space: normal;
    line-height: 1.45;
}


.bm-apply-price-btn {
    background: #198754;
    color: #fff;
    border: 0;
    padding: 5px 9px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.bm-apply-price-btn:hover {
    background: #157347;
}

.bm-apply-price-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.bm-price-updated {
    background: #6c757d;
}



.bm-part-link {
    color: #e5edf8;
    text-decoration: none;
    font-weight: 700;
}

.bm-part-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.bm-part-link:visited {
    color: #e5edf8;
}

.bm-description-link {
    color: #cfd8e6;
    text-decoration: none;
}

.bm-description-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.bm-description-link:visited {
    color: #cfd8e6;
}


/* =========================================================
   Pricing Engine page
   ========================================================= */
/* Pricing Engine page */

.bm-pricing-page,
.bm-pricing-page * {
    font-family: Inter, Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}

.bm-pricing-page {
    width: 100%;
    max-width: 100%;
    color: #e8eef8;
}

.bm-pricing-page .wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.bm-pricing-page .bm-header {
    display: none;
}

.bm-pricing-page .flash,
.bm-pricing-page .info-box,
.bm-pricing-page .ok-box {
    background: rgba(20, 241, 149, 0.10);
    border: 1px solid rgba(20, 241, 149, 0.25);
    color: #dffdf0;
    border-radius: 14px;
}

/* Match the existing v3 cards from brickmetrics-v3.css */
.bm-pricing-page .bm-card,
.bm-pricing-page .bm-tester,
.bm-pricing-page .bm-acc,
.bm-pricing-page .bm-tester-card,
.bm-pricing-page .bm-matches,
.bm-pricing-page .bm-combo-card,
.bm-pricing-page .bm-modal {
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    color: #e8eef8;
    box-shadow: none;
    backdrop-filter: blur(12px);
}

.bm-pricing-page .bm-card {
    padding: 26px;
    margin: 0 0 14px;
}

.bm-pricing-page .bm-tester {
    width: 100%;
    max-width: 100%;
    margin: 24px 0;
    padding: 26px;
    overflow: hidden;
}

.bm-pricing-page h1,
.bm-pricing-page h2,
.bm-pricing-page h3,
.bm-pricing-page h4,
.bm-pricing-page .bm-acc-title {
    color: #ffffff;
    letter-spacing: -0.02em;
}

.bm-pricing-page h3 {
    font-size: 21px;
    margin: 0 0 20px;
}

.bm-pricing-page .bm-label,
.bm-pricing-page label,
.bm-pricing-page .stat-label,
.bm-pricing-page .bm-acc-sub,
.bm-pricing-page .bm-columns,
.bm-pricing-page .bm-combo-title,
.bm-pricing-page .bm-combo-note,
.bm-pricing-page .bm-pipe-label,
.bm-pricing-page .bm-pipe-note-key {
    color: #8ea0b8;
    font-size: 14px;
    font-weight: 500;
}

/* Match v3 form controls */
.bm-pricing-page .bm-input,
.bm-pricing-page input,
.bm-pricing-page select,
.bm-pricing-page textarea,
.bm-pricing-page .bm-result,
.bm-pricing-page .stat-box {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #e5e7eb;
    border-radius: 12px;
    box-shadow: none;
}

.bm-pricing-page .bm-input,
.bm-pricing-page input,
.bm-pricing-page select {
    height: 44px;
    line-height: 44px;
}

.bm-pricing-page .bm-input:focus,
.bm-pricing-page input:focus,
.bm-pricing-page select:focus,
.bm-pricing-page textarea:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.75);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.bm-pricing-page select option {
    background: #0f172a;
    color: #e5e7eb;
}

/* Buttons */
.bm-pricing-page .bm-btn,
.bm-pricing-page button {
    border-radius: 12px;
    font-weight: 700;
    transition: 0.2s ease;
}

.bm-pricing-page .bm-btn:not(.bm-primary):not(.bm-danger),
.bm-pricing-page button:not(.bm-primary):not(.bm-danger):not(.t-random-type) {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #e8eef8;
}

.bm-pricing-page .bm-primary,
.bm-pricing-page .bm-refresh-btn {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border: 0;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.20);
}

.bm-pricing-page .bm-danger {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
}

/* Engine settings form */
.bm-pricing-page #engineSettingsForm .bm-card > div {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
    align-items: end;
}

.bm-pricing-page #engineSettingsForm .bm-card > div > div {
    min-width: 0;
}

.bm-pricing-page #engineSettingsForm select {
    width: 100%;
}

/* Rule tester layout: stop overflow and match v3 dark cards */
.bm-pricing-page .bm-tester-summary {
    display: grid;
    grid-template-columns: 120px repeat(4, minmax(140px, 1fr)) repeat(5, minmax(95px, 0.75fr));
    gap: 14px;
    align-items: end;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 18px;
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
}

.bm-pricing-page .bm-tester-summary .bm-field {
    min-width: 0;
}

.bm-pricing-page .bm-tester-summary .bm-input {
    width: 100%;
    min-width: 0;
}

.bm-pricing-page #bmRuleTester .img-field img {
    width: 96px;
    height: 96px;
    background: rgba(255,255,255,0.94);
}

.bm-pricing-page .bricklink-field {
    grid-column: 1 / -1;
    align-items: flex-start;
}

.bm-pricing-page .bricklink-field .bm-btn {
    display: inline-flex;
    width: auto;
    height: auto;
}

.bm-pricing-page .bm-market-wrap {
    max-width: none;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.bm-pricing-page .bm-market-wrap > .bm-tester-card {
    width: auto;
    max-width: 100%;
}

/* Rule sections */
.bm-pricing-page .bm-columns,
.bm-pricing-page .bm-row {
    min-width: 1120px;
}

.bm-pricing-page .bm-acc-body {
    overflow-x: auto;
}

.bm-pricing-page .bm-acc > summary,
.bm-pricing-page .bm-pipe-acc summary {
    background: rgba(15, 23, 42, 0.60);
    color: #ffffff;
}

.bm-pricing-page .bm-modal-backdrop.open {
    background: rgba(2, 6, 23, 0.72);
}

.bm-pricing-page .bm-modal-body,
.bm-pricing-page .bm-modal-body li,
.bm-pricing-page .bm-modal-body strong,
.bm-pricing-page .bm-pipe-note-val,
.bm-pricing-page .bm-combo-value,
.bm-pricing-page .bm-pipe-title {
    color: #e8eef8;
}

.bm-pricing-page .rule-example,
.bm-pricing-page .bm-pipe-summary,
.bm-pricing-page .bm-pipe-body,
.bm-pricing-page .bm-pipe-empty,
.bm-pricing-page .bm-pipe-hint {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(148, 163, 184, 0.18);
    color: #d7dfeb;
}

@media (max-width: 1500px) {
    .bm-pricing-page .bm-tester-summary {
        grid-template-columns: 120px repeat(3, minmax(140px, 1fr)) repeat(3, minmax(95px, 1fr));
    }
}

@media (max-width: 1100px) {
    .bm-pricing-page #engineSettingsForm .bm-card > div,
    .bm-pricing-page .bm-tester-summary,
    .bm-pricing-page .bm-market-wrap {
        grid-template-columns: 1fr 1fr;
    }

    .bm-pricing-page .img-field {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .bm-pricing-page #engineSettingsForm .bm-card > div,
    .bm-pricing-page .bm-tester-summary,
    .bm-pricing-page .bm-market-wrap {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 1500px) {
    .bm-dashboard-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .bm-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .bm-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Pricing Engine v3 stabilisation
   Uses the existing v3 visual language, scoped to this page only.
   ========================================================= */
.bm-pricing-engine {
    max-width: 100%;
    overflow-x: hidden;
}

.bm-pricing-engine .wrap {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.bm-pricing-engine .flash,
.bm-pricing-engine .bm-pe-notice {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(20, 241, 149, 0.12);
    border: 1px solid rgba(20, 241, 149, 0.35);
    color: #14f195;
    font-weight: 600;
	animation: bmNoticeFadeOut 0.5s ease forwards;
	animation-delay: 3s;
}

@keyframes bmNoticeFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-4px);
        visibility: hidden;
    }
}

.bm-pricing-engine .bm-label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px;
    color: #9dadc4;
    font-size: 13px;
    line-height: 1.2;
}

.bm-pe-engine-settings {
    margin-bottom: 22px;
}

.bm-pe-engine-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.2fr) minmax(180px, 220px) minmax(180px, 220px) auto;
    gap: 16px;
    align-items: end;
}

.bm-pe-engine-field,
.bm-pe-engine-save {
    min-width: 0;
}

.bm-pe-engine-field .bm-inventory-select {
    width: 100%;
    min-width: 0;
}

.bm-pe-engine-save {
    display: flex;
    justify-content: flex-end;
}

.bm-pe-engine-save .bm-primary-button {
    height: 44px;
    white-space: nowrap;
    padding-left: 20px;
    padding-right: 20px;
}

.bm-pe-info,
.info-icon,
.bm-help-btn {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.bm-pricing-engine .bm-input,
.bm-pricing-engine .bm-inventory-search,
.bm-pricing-engine .bm-inventory-select,
.bm-pricing-engine input,
.bm-pricing-engine select {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #e5e7eb;
    border-radius: 12px;
    min-height: 44px;
}

.bm-pricing-engine select option {
    background: #0f172a;
    color: #e5e7eb;
}

.bm-pricing-engine .bm-tester {
    width: 100%;
    max-width: 100%;
    margin: 22px 0;
    padding: 26px;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.bm-pricing-engine .bm-tester h3,
.bm-pricing-engine .bm-tester-card h4 {
    margin-top: 0;
    color: #ffffff;
}

.bm-pricing-engine .bm-tester-random-wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 12px 0 22px;
}

.bm-pricing-engine .t-random-type {
    border: 0;
    border-radius: 12px;
    padding: 10px 16px;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.bm-pricing-engine .t-random-type[data-random-type=""] { background: linear-gradient(135deg,#64748b,#475569); }
.bm-pricing-engine .t-random-type[data-random-type="PART"] { background: linear-gradient(135deg,#2563eb,#4f46e5); }
.bm-pricing-engine .t-random-type[data-random-type="MINIFIG"] { background: linear-gradient(135deg,#f59e0b,#b45309); }
.bm-pricing-engine .t-random-type[data-random-type="SET"] { background: linear-gradient(135deg,#10b981,#047857); }
.bm-pricing-engine .t-random-type[data-random-type="INSTRUCTION"] { background: linear-gradient(135deg,#ec4899,#be185d); }
.bm-pricing-engine .t-random-type[data-random-type="GEAR"] { background: linear-gradient(135deg,#8b5cf6,#5b21b6); }

.bm-pricing-engine .bm-tester-summary {
    display: grid;
    grid-template-columns: 112px repeat(5, minmax(120px, 1fr));
    gap: 14px;
    align-items: end;
    width: 100%;
    max-width: 100%;
    padding: 18px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.46);
    border: 1px solid rgba(148, 163, 184, 0.16);
    overflow: hidden;
}

.bm-pricing-engine .bm-tester-summary .bm-field { min-width: 0; }
.bm-pricing-engine .bm-tester-summary .bm-input { width: 100%; min-width: 0; }
.bm-pricing-engine .img-field { grid-row: span 2; align-self: center; }
.bm-pricing-engine #t-image {
    width: 96px !important;
    height: 96px !important;
    background: #ffffff;
    object-fit: contain;
    border-radius: 12px;
}
.bm-pricing-engine .bricklink-field { align-self: end; }
.bm-pricing-engine .bricklink-field .bm-primary { display: inline-flex; align-items: center; justify-content: center; }

.bm-pricing-engine .bm-market-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin: 20px 0;
    max-width: none;
}

.bm-pricing-engine .bm-tester-card,
.bm-pricing-engine .bm-acc,
.bm-pricing-engine .bm-combo-card,
.bm-pricing-engine .bm-matches,
.bm-pricing-engine .bm-result {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    color: #e8eef8;
}

.bm-pricing-engine .bm-tester-card { padding: 18px; }
.bm-pricing-engine .result-card { max-width: none; }

.bm-pricing-engine .stats-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
}
.bm-pricing-engine .stat-row {
    display: grid;
    grid-template-columns: 120px minmax(80px, 1fr);
    gap: 10px;
    align-items: center;
}
.bm-pricing-engine .stat-box,
.bm-pricing-engine .bm-result {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.65);
}

.bm-pricing-engine .bm-combo-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.bm-pricing-engine .bm-combo-card { padding: 16px; }
.bm-pricing-engine .bm-combo-card.is-selected {
    border-color: rgba(37,99,235,0.75);
    box-shadow: 0 0 0 2px rgba(37,99,235,0.18);
}

.bm-pricing-engine .actions,
.bm-pricing-engine .bm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 18px;
}

.bm-pricing-engine .bm-acc {
    overflow: hidden;
    margin: 16px 0;
}
.bm-pricing-engine .bm-acc > summary {
    cursor: pointer;
    list-style: none;
    padding: 18px 20px;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.bm-pricing-engine .bm-acc > summary::-webkit-details-marker { display: none; }
.bm-pricing-engine .bm-acc-title { color: #ffffff; font-weight: 800; }
.bm-pricing-engine .bm-acc-sub { color: #9dadc4; margin-left: 8px; }
.bm-pricing-engine .bm-acc-body {
    padding: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    overflow-x: auto;
}
.bm-pricing-engine .bm-columns,
.bm-pricing-engine .bm-row {
    display: grid;
    grid-template-columns: 70px 210px 160px 220px repeat(4, minmax(140px, 1fr)) 120px;
    gap: 12px;
    align-items: center;
    min-width: 1100px;
}
.bm-pricing-engine .bm-columns {
    color: #9dadc4;
    font-size: 12px;
    font-weight: 800;
    padding: 0 0 8px;
}
.bm-pricing-engine .bm-card .bm-row,
.bm-pricing-engine .bm-row.bm-card {
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 14px;
    margin: 0 0 12px;
}
.bm-pricing-engine .bm-inline-rule { color: #ffffff; font-weight: 800; }
.bm-pricing-engine .bm-toggle {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
}
.bm-pricing-engine .bm-chip {
    border: 0;
    border-radius: 999px;
    padding: 6px 10px;
    color: #c7d2e4;
    background: transparent;
    font-weight: 700;
    cursor: pointer;
}
.bm-pricing-engine .bm-chip.active {
    background: linear-gradient(135deg,#2563eb,#4f46e5);
    color: #ffffff;
}

.bm-modal-backdrop,
.user-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(2, 6, 23, 0.72);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.bm-modal-backdrop.open,
.user-modal[style*="block"] { display: flex !important; }
.bm-modal,
.user-modal .modal-content,
.user-modal-content {
    max-width: 760px;
    width: min(760px, 96vw);
    max-height: 86vh;
    overflow: auto;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 22px;
    padding: 26px;
    color: #e8eef8;
    box-shadow: 0 28px 70px rgba(0,0,0,0.45);
}
.bm-modal-close,
.close {
    float: right;
    border: 0;
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    border-radius: 10px;
    padding: 8px 11px;
    cursor: pointer;
}

@media (max-width: 1450px) {
    .bm-pricing-engine .bm-tester-summary {
        grid-template-columns: 112px repeat(4, minmax(120px, 1fr));
    }
}
@media (max-width: 1100px) {
    .bm-pe-engine-row,
    .bm-pricing-engine .bm-market-wrap,
    .bm-pricing-engine .bm-combo-grid {
        grid-template-columns: 1fr 1fr;
    }
    .bm-pe-engine-save { justify-content: flex-start; }
    .bm-pricing-engine .bm-tester-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .bm-pricing-engine .img-field,
    .bm-pricing-engine .bricklink-field { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    .bm-pe-engine-row,
    .bm-pricing-engine .bm-market-wrap,
    .bm-pricing-engine .bm-combo-grid,
    .bm-pricing-engine .bm-tester-summary {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Pricing Engine polish pass - current v3 page only
   ========================================================= */
.bm-pricing-engine {
    width: 100%;
}

.bm-pricing-engine .bm-card,
.bm-pricing-engine .bm-tester,
.bm-pricing-engine .bm-tester-card,
.bm-pricing-engine .bm-acc,
.bm-pricing-engine .bm-combo-card {
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    color: #e8eef8;
}

.bm-pricing-engine .bm-primary-button,
.bm-pricing-engine .bm-btn.bm-primary,
.bm-pricing-engine .bm-refresh-btn,
.bm-pricing-engine #btn-test-rules,
.bm-pricing-engine .bm-save-row,
.bm-pricing-engine .bm-add-row {
    border: 0 !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    padding: 10px 16px !important;
    text-decoration: none !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    box-shadow: 0 12px 28px rgba(37,99,235,0.18);
}

.bm-pricing-engine .bm-delete,
.bm-pricing-engine .bm-danger {
    border: 1px solid rgba(239,68,68,0.35) !important;
    border-radius: 10px !important;
    background: rgba(239,68,68,0.12) !important;
    color: #fecaca !important;
    font-weight: 700;
    padding: 8px 11px;
}

.bm-pe-engine-row {
    grid-template-columns: minmax(320px, 2fr) minmax(210px, 1fr) minmax(255px, 1fr) minmax(235px, auto) !important;
    align-items: end;
}

.bm-pe-engine-row > .bm-pe-engine-field:nth-child(5) {
    grid-column: 1 / 3;
}

.bm-pe-engine-row .bm-pe-engine-unlimited {
    align-self: center;
    padding-bottom: 3px;
}

.bm-pe-engine-save {
    align-self: end;
    justify-content: flex-end !important;
}

.bm-pricing-engine .bm-tester-random-wrap {
    justify-content: center;
    margin: 4px 0 22px;
}

.bm-pricing-engine .bm-tester-summary {
    grid-template-columns: 112px repeat(5, minmax(130px, 1fr)) !important;
    gap: 16px !important;
    padding: 20px !important;
}

.bm-pricing-engine .img-field {
    grid-row: 1 / span 2;
}

.bm-pricing-engine .bricklink-field {
    grid-column: 2 / span 4;
    align-self: end;
}

.bm-pricing-engine #t-bm-btn {
    width: auto;
    white-space: nowrap;
}

.bm-pricing-engine .bm-tester-item-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    flex-wrap: wrap;
}

.bm-pricing-engine #t-refresh-current {
    width: auto;
    margin: 0;
    white-space: nowrap;
}

.bm-pricing-engine .bm-market-wrap {
    align-items: stretch;
}

.bm-pricing-engine .stats-two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bm-pricing-engine .stat-row {
    grid-template-columns: 120px minmax(95px, 1fr);
}

.bm-pricing-engine .result-card {
    margin-top: 20px !important;
    padding: 22px !important;
}

.bm-pricing-engine .tester-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
}

.bm-pricing-engine .tester-grid .span-4 {
    grid-column: span 1 !important;
}

.bm-pricing-engine .tester-grid .span-12 {
    grid-column: 1 / -1 !important;
}

.bm-pricing-engine .bm-matches {
    min-height: 48px;
    padding: 12px 14px;
    background: rgba(15,23,42,0.55);
    overflow-wrap: anywhere;
}

.bm-pricing-engine #t-combination-card {
    margin-top: 18px !important;
}

.bm-pricing-engine .bm-combo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.bm-pricing-engine .bm-combo-card {
    padding: 16px;
}

.bm-pricing-engine .actions {
    justify-content: flex-end;
    margin: 18px 0 0;
}

.bm-pricing-engine .bm-acc > summary {
    padding: 18px 20px;
}

.bm-pricing-engine .bm-acc-chevron {
    color: #9dadc4;
    font-size: 18px;
}

.bm-pricing-engine .bm-acc[open] .bm-acc-chevron {
    transform: rotate(180deg);
}

.bm-pricing-engine .bm-acc-body {
    padding: 18px;
}

.bm-pricing-engine .bm-columns {
    display: flex !important;
    align-items: center;
    gap: 14px;
    min-width: 0;
    margin: 0 0 10px;
    padding: 10px 14px;
    border: 1px solid #2d405c;
    border-radius: 12px;
    color: #aebed2;
    background: #0d192b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.bm-pricing-engine .bm-columns > div {
    flex: 1 1 150px;
    min-width: 135px;
}

.bm-pricing-engine .bm-columns > div:first-child {
    flex: 0 0 70px;
    min-width: 70px;
}

.bm-pricing-engine .bm-columns > div:last-child {
    flex: 0 0 120px;
    min-width: 120px;
}

.bm-pricing-engine .bm-row {
    display: flex !important;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    min-width: 0 !important;
}

@media (max-width: 900px) {
    .bm-pricing-engine .bm-columns {
        display: none !important;
    }
}

.bm-pricing-engine .bm-row .cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 135px;
    flex: 1 1 150px;
}

.bm-pricing-engine .bm-row .cell:first-child {
    flex: 0 0 70px;
    min-width: 70px;
}

.bm-pricing-engine .bm-row .bm-actions,
.bm-pricing-engine .bm-row .cell:last-child {
    flex: 0 0 auto;
    min-width: 150px;
    align-items: flex-end;
}

.bm-pricing-engine .bm-row .bm-input,
.bm-pricing-engine .bm-row .bm-inventory-search,
.bm-pricing-engine .bm-row .bm-inventory-select {
    width: 100%;
}

.bm-pricing-engine .bm-toggle {
    width: fit-content;
}

.bm-pricing-engine article.bm-card {
    padding: 18px !important;
    margin: 0 0 14px !important;
    background: rgba(15,23,42,0.48) !important;
}

.bm-pricing-engine .user-modal,
.bm-pricing-engine .bm-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2,6,23,0.74);
}

/* Pricing engine usability: compact rules, clear tester inputs and one save action. */
.bm-pricing-engine,
.bm-pricing-engine input,
.bm-pricing-engine select,
.bm-pricing-engine button {
    font-family: inherit;
}

.bm-pricing-engine .bm-pe-engine-save,
.bm-pricing-engine form[id^="form-"] > .actions button[type="submit"],
.bm-pricing-engine .bm-save-row {
    display: none !important;
}

.bm-pricing-engine .bm-pricing-number-stepper {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #344b6b;
    border-radius: 9px;
    background: #0d192b;
}

.bm-pricing-engine .bm-pricing-number-stepper input {
    width: 100% !important;
    min-width: 0;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-align: center;
    -moz-appearance: textfield;
}

.bm-pricing-engine .bm-pricing-number-stepper input::-webkit-inner-spin-button,
.bm-pricing-engine .bm-pricing-number-stepper input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.bm-pricing-engine .bm-pricing-step-button {
    border: 0;
    border-radius: 0;
    background: #2563eb;
    color: #fff;
    font-size: 19px;
    font-weight: 900;
    cursor: pointer;
}

.bm-pricing-engine .bm-pricing-step-button:hover,
.bm-pricing-engine .bm-pricing-step-button:focus-visible {
    background: #3b82f6;
}

.bm-pricing-engine .stat-row.base-price-active {
    padding: 6px;
    border: 1px solid #60a5fa;
    border-radius: 11px;
    background: rgba(37,99,235,.18);
    box-shadow: 0 0 0 3px rgba(37,99,235,.13);
}

.bm-pricing-engine .base-price-active .bm-pricing-number-stepper,
.bm-pricing-engine input.base-price-active {
    border-color: #60a5fa !important;
}

.bm-pricing-engine .stat-row.base-price-active .stat-label::after {
    content: "Base price";
    display: block;
    margin-top: 3px;
    color: #93c5fd;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.bm-pricing-engine .bm-price-safeguard-notice {
    padding: 12px 14px;
    border: 1px solid rgba(245,158,11,.5);
    border-radius: 10px;
    background: rgba(120,53,15,.25);
    color: #fde68a;
    font-weight: 750;
    line-height: 1.45;
}

.bm-pricing-engine .bm-matches {
    min-height: 0;
    padding: 14px 16px;
    border: 1px solid #496789;
    border-radius: 12px;
    background: #172a42;
    color: #edf5ff;
    line-height: 1.5;
}

.bm-pricing-engine .bm-matches details {
    margin: 0 0 7px;
    padding: 8px 10px;
    border: 1px solid rgba(147,197,253,.16);
    border-radius: 8px;
    background: rgba(7,18,34,.38);
}

.bm-pricing-engine .bm-matches details:last-child {
    margin-bottom: 0;
}

.bm-pricing-engine .bm-matches summary {
    color: #f8fbff;
    font-weight: 800;
    cursor: pointer;
}

.bm-pricing-engine .bm-matches a {
    color: #93c5fd;
}

.bm-pricing-engine .bm-columns {
    gap: 8px;
    margin-bottom: 7px;
    padding: 7px 10px;
    border-radius: 8px;
}

.bm-pricing-engine .bm-row {
    gap: 8px;
}

.bm-pricing-engine .bm-row .cell {
    min-width: 112px;
    flex: 1 1 125px;
    gap: 4px;
}

.bm-pricing-engine .bm-row .cell:first-child,
.bm-pricing-engine .bm-columns > div:first-child {
    flex-basis: 48px;
    min-width: 48px;
}

.bm-pricing-engine .bm-row .bm-actions,
.bm-pricing-engine .bm-row .cell:last-child,
.bm-pricing-engine .bm-columns > div:last-child {
    flex: 0 0 auto;
    min-width: 76px;
}

.bm-pricing-engine article.bm-card {
    margin-bottom: 8px !important;
    padding: 10px !important;
    border-radius: 11px !important;
}

.bm-pricing-engine .bm-actions {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-end;
    gap: 6px;
}

.bm-pricing-engine .bm-actions .bm-btn,
.bm-pricing-engine .bm-delete {
    min-height: 34px;
    padding: 6px 10px !important;
    border-radius: 8px !important;
}

.bm-pricing-engine .bm-toggle .bm-chip {
    padding: 6px 8px;
    border-radius: 7px;
}

.bm-pricing-engine .bm-pricing-save-bar {
    position: fixed;
    z-index: 10020;
    right: 24px;
    bottom: 18px;
    left: max(24px, calc(var(--bm-sidebar-width, 0px) + 24px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 16px;
    border: 1px solid #4f77a6;
    border-radius: 13px;
    background: #12243b;
    color: #f8fbff;
    box-shadow: 0 18px 45px rgba(0,0,0,.42);
}

.bm-pricing-engine .bm-pricing-save-bar[hidden] {
    display: none !important;
}

.bm-pricing-engine .bm-pricing-save-bar > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bm-pricing-engine .bm-pricing-save-bar span {
    color: #adc1da;
    font-size: 13px;
}

.bm-pricing-engine .bm-pricing-save-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 720px) {
    .bm-pricing-engine .bm-pricing-save-bar {
        right: 10px;
        bottom: 10px;
        left: 10px;
        align-items: stretch;
        flex-direction: column;
    }

    .bm-pricing-engine .bm-pricing-save-actions > button {
        flex: 1 1 0;
    }
}

.bm-pe-dialog {
    position: fixed;
    z-index: 10100;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2,6,23,.78);
    backdrop-filter: blur(4px);
}

.bm-pe-dialog[hidden] {
    display: none !important;
}

.bm-pe-dialog-card {
    width: min(480px, 100%);
    padding: 24px;
    border: 1px solid #45658b;
    border-radius: 16px;
    background: #12243b;
    color: #f8fbff;
    box-shadow: 0 24px 70px rgba(0,0,0,.5);
}

.bm-pe-dialog-card h2 {
    margin: 0 0 10px;
    font-size: 21px;
}

.bm-pe-dialog-card p {
    margin: 0;
    color: #c4d3e6;
    line-height: 1.55;
}

.bm-pe-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 20px;
}

.bm-pe-dialog .bm-primary-button {
    min-height: 40px;
    padding: 10px 16px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 1180px) {
    .bm-pe-engine-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .bm-pe-engine-row > .bm-pe-engine-field:nth-child(5) {
        grid-column: 1 / -1;
    }
}

/* Pricing engine compact editing layout. */
.bm-page-header-sticky {
    position: sticky;
    top: 0;
    z-index: 90;
    margin: 0 0 12px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(79,119,166,.4);
    background: rgba(7,20,38,.96);
    box-shadow: 0 10px 24px rgba(0,0,0,.24);
    backdrop-filter: blur(10px);
}

.bm-page-header-sticky h1 {
    font-size: clamp(20px, 2vw, 27px);
}

.bm-pricing-engine .bm-pe-page-nav {
    margin-bottom: 10px;
    padding: 4px;
}

.bm-pricing-engine .bm-pe-page-nav a {
    padding: 6px 12px;
}

.bm-pricing-engine .bm-pe-profile-panel {
    margin-bottom: 10px;
    padding: 14px;
    border-radius: 14px;
}

.bm-pricing-engine .bm-pe-profile-heading {
    gap: 12px;
}

.bm-pricing-engine .bm-pe-profile-heading h2 {
    margin: 0 0 2px;
    font-size: 1.25rem;
}

.bm-pricing-engine .bm-pe-profile-heading p {
    font-size: .82rem;
}

.bm-pricing-engine .bm-pe-profile-grid {
    gap: 10px;
    margin-top: 10px;
}

.bm-pricing-engine .bm-pe-profile-control > label {
    margin-bottom: 4px;
}

.bm-pricing-engine .bm-pe-profile-actions {
    gap: 6px;
    margin-top: 9px;
    padding-top: 9px;
}

.bm-pricing-engine .bm-pe-engine-settings {
    margin-bottom: 10px;
    padding: 15px !important;
    border-radius: 14px;
}

.bm-pricing-engine .bm-pe-engine-settings .bm-card-header {
    margin-bottom: 12px;
}

.bm-pricing-engine .bm-pe-engine-settings .bm-card-header h2 {
    margin-bottom: 3px;
    font-size: 1.25rem;
}

.bm-pricing-engine .bm-pe-engine-settings .bm-card-header p {
    font-size: .82rem;
}

.bm-pricing-engine .bm-pe-engine-row {
    grid-template-columns: minmax(280px, 1.55fr) minmax(185px, .85fr) minmax(270px, 1.1fr) minmax(210px, .9fr) !important;
    gap: 11px;
    align-items: start;
}

.bm-pricing-engine .bm-pe-engine-row > .bm-pe-engine-field:nth-child(5) {
    grid-column: auto;
}

.bm-pricing-engine .bm-pe-engine-row .bm-label {
    min-height: 18px;
    margin-bottom: 5px;
}

.bm-pricing-engine .bm-pe-field-help {
    margin-top: 3px;
    font-size: .7rem;
}

.bm-pricing-engine .bm-pe-engine-row .bm-pe-check {
    min-height: 24px;
    margin-top: 4px;
    font-size: .78rem;
}

.bm-pricing-engine .bm-pe-rules-section {
    padding: 14px;
    border-radius: 14px;
}

.bm-pricing-engine .bm-pe-rules-section > .bm-acc:first-of-type {
    margin-top: 10px;
}

@media (max-width: 1260px) {
    .bm-pricing-engine .bm-pe-engine-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

.bm-pricing-engine .user-modal[style*="block"],
.bm-pricing-engine .bm-modal-backdrop.open {
    display: flex !important;
}

.bm-pricing-engine .user-modal-content,
.bm-pricing-engine .modal-content,
.bm-pricing-engine .bm-modal {
    width: min(760px, 96vw);
    max-height: 86vh;
    overflow: auto;
    background: #0f172a;
    border: 1px solid rgba(148,163,184,0.25);
    border-radius: 22px;
    padding: 26px;
    color: #e8eef8;
    box-shadow: 0 28px 70px rgba(0,0,0,0.45);
}

.bm-pricing-engine .close,
.bm-pricing-engine .bm-modal-close {
    float: right;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    padding: 8px 11px;
    cursor: pointer;
}

@media (max-width: 1350px) {
    .bm-pricing-engine .bm-tester-summary {
        grid-template-columns: 112px repeat(3, minmax(130px, 1fr)) !important;
    }
    .bm-pricing-engine .bricklink-field {
        grid-column: 2 / span 2;
    }
}

@media (max-width: 900px) {
    .bm-pe-engine-row,
    .bm-pricing-engine .bm-market-wrap,
    .bm-pricing-engine .bm-combo-grid,
    .bm-pricing-engine .tester-grid {
        grid-template-columns: 1fr !important;
    }
    .bm-pricing-engine .bm-tester-summary {
        grid-template-columns: 1fr 1fr !important;
    }
    .bm-pricing-engine .img-field,
    .bm-pricing-engine .bricklink-field {
        grid-column: 1 / -1;
    }
}


.bm-stat-inner-link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    color: inherit;
    text-decoration: none;
}






.bm-qr-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(2, 6, 23, 0.72);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bm-qr-modal.open {
    display: flex;
}

.bm-qr-box {
    width: 320px;
    max-width: 95vw;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 22px;
    padding: 26px;
    text-align: center;
    color: #e8eef8;
    box-shadow: 0 28px 70px rgba(0,0,0,0.45);
    position: relative;
}

.bm-qr-box h3 {
    margin: 0 0 18px;
    color: #ffffff;
}

.bm-qr-box img {
    background: #ffffff;
    padding: 12px;
    border-radius: 14px;
}

.bm-qr-box p {
    margin: 16px 0 0;
    color: #9dadc4;
    font-size: 14px;
}

.bm-qr-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: 0;
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 18px;
}

/* =========================================================
   Inventory Transfer Modal
   Used by the OOS Used with New in Stock workflow
   ========================================================= */

.bm-transfer-row td {
    padding: 4px 10px !important;
    background: rgba(20, 241, 149, 0.045);
    border-top: 0;
    border-bottom: 1px solid rgba(20, 241, 149, 0.16);
    text-align: center;
}

.bm-transfer-btn {
    min-height: 28px;
    padding: 4px 16px;
    border: 1px solid rgba(20, 241, 149, 0.35);
    border-radius: 999px;
    background: rgba(20, 241, 149, 0.12);
    color: #14f195;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.bm-transfer-btn:hover {
    background: rgba(20, 241, 149, 0.2);
}

.bm-transfer-modal {
    display: none;
    position: fixed !important;
    inset: 0 !important;
    z-index: 100000 !important;
    width: 100vw;
    height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bm-transfer-modal.open {
    display: flex !important;
}

.bm-transfer-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(2, 6, 23, 0.76);
    backdrop-filter: blur(6px);
}

.bm-transfer-modal-panel {
    position: relative;
    z-index: 1;
    width: min(980px, calc(100vw - 48px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 22px;
    padding: 18px 22px;
    color: #e8eef8;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
}


.bm-transfer-modal-panel h3 {
    margin: 0 44px 8px 0;
    color: #ffffff;
    font-size: 22px;
    letter-spacing: -0.02em;
}

.bm-transfer-modal-intro {
    margin: 0 0 12px;
}

.bm-transfer-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.bm-transfer-modal-close:hover {
    background: rgba(255, 255, 255, 0.14);
}

.bm-transfer-summary {
    display: grid;
    grid-template-columns: 120px repeat(5, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.bm-transfer-summary div,
.bm-transfer-warning {
    background: rgba(2, 6, 23, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    padding: 12px 14px;
}

.bm-transfer-summary span,
.bm-transfer-field span {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.bm-transfer-summary strong {
    display: block;
    color: #e5e7eb;
    font-size: 15px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

#bm-transfer-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.bm-transfer-field-full {
    grid-column: span 1;
}
.bm-transfer-warning,
.bm-transfer-actions {
    grid-column: 1 / -1;
}

.bm-transfer-field input,
.bm-transfer-field textarea {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
}

.bm-transfer-field input {
    height: 44px;
    min-height: 44px;
}

.bm-transfer-field textarea {
    resize: vertical;
    height: 64px;
    min-height: 64px;
}

.bm-transfer-field input:focus,
.bm-transfer-field textarea:focus {
    border-color: rgba(59, 130, 246, 0.75);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.bm-transfer-warning {
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.35);
    background: rgba(250, 204, 21, 0.08);
}

.bm-transfer-actions {
    margin-top: 0;
}



.bm-transfer-message {
    grid-column: 1 / -1;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.bm-transfer-message.success {
    background: rgba(20, 241, 149, 0.10);
    border: 1px solid rgba(20, 241, 149, 0.32);
    color: #14f195;
}

.bm-transfer-message.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}


.bm-secondary-button {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #e8eef8;
    font-weight: 700;
    cursor: pointer;
    padding: 12px 18px;
}

.bm-secondary-button:hover {
    background: rgba(255, 255, 255, 0.10);
}



@media (max-width: 700px) {
    .bm-transfer-row td {
        padding: 6px 8px !important;
        position: sticky;
        left: 0;
        z-index: 2;
    }

    .bm-transfer-btn {
        width: 100%;
        max-width: 280px;
    }

    .bm-transfer-modal {
        align-items: flex-end;
        padding: 0;
    }

    .bm-transfer-modal-panel {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: 22px 22px 0 0;
        padding: 22px 18px max(22px, env(safe-area-inset-bottom));
		transform: none;
    }

    .bm-transfer-summary,
    #bm-transfer-form {
        grid-template-columns: 1fr;
    }

    .bm-transfer-actions {
        flex-direction: column-reverse;
    }

    .bm-transfer-actions button {
        width: 100%;
    }
}



/* =========================================================
   BrickMetrics v3 Settings page
   ========================================================= */
.bm-settings-page {
    width: 100%;
}

.bm-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

.bm-settings-card {
    margin: 0;
}

.bm-settings-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 18px;
}

.bm-settings-field {
    min-width: 0;
}

.bm-settings-wide-field {
    grid-column: span 2;
}

.bm-settings-field label {
    display: block;
    margin-bottom: 8px;
    color: #9dadc4;
    font-size: 13px;
    font-weight: 700;
}

.bm-settings-field small {
    display: block;
    margin-top: 7px;
    color: #8ea0b8;
    font-size: 12px;
    line-height: 1.35;
}

.bm-settings-field input,
.bm-settings-field select,
.bm-settings-field textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.75);
    color: #e5e7eb;
    padding: 11px 14px;
    font-size: 14px;
    outline: none;
}

.bm-settings-field input:focus,
.bm-settings-field select:focus,
.bm-settings-field textarea:focus {
    border-color: rgba(59, 130, 246, 0.75);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.bm-settings-field select option {
    background: #0f172a;
    color: #e5e7eb;
}

.bm-settings-subheading {
    margin: 10px 0 16px;
    color: #ffffff;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.bm-settings-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.bm-settings-message {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 700;
}

.bm-settings-message.success {
    background: rgba(20, 241, 149, 0.10);
    border: 1px solid rgba(20, 241, 149, 0.32);
    color: #14f195;
}

.bm-settings-message.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.bm-toggle-secrets {
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .bm-settings-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .bm-settings-form-grid {
        grid-template-columns: 1fr;
    }

    .bm-settings-wide-field {
        grid-column: span 1;
    }

    .bm-settings-actions {
        justify-content: stretch;
    }

    .bm-settings-actions button {
        width: 100%;
    }
}




.bm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.72);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bm-modal-box {
    width: min(460px, calc(100% - 32px));
    background: #0b1628;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.45);
}

.bm-modal-box h3 {
    margin: 0 0 10px;
}

.bm-modal-box p {
    color: #9dadc4;
    line-height: 1.5;
}

.bm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}




.bm-rebuild-status {
    width: 100%;
    margin-top: 22px;
}

.bm-rebuild-complete {
    width: 100%;
    border: 1px solid rgba(34, 197, 94, 0.45);
    background: rgba(34, 197, 94, 0.08);
    border-radius: 18px;
    padding: 22px;
}

.bm-rebuild-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
}

.bm-rebuild-subtitle {
    color: #b6c4d8;
    margin-bottom: 18px;
}

.bm-rebuild-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 14px;
}

.bm-rebuild-card {
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 14px;
    padding: 16px;
}

.bm-rebuild-label {
    color: #9dadc4;
    font-size: 13px;
    margin-bottom: 8px;
}

.bm-rebuild-value {
    font-size: 30px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.bm-rebuild-note {
    margin-top: 16px;
    color: #9dadc4;
    font-size: 13px;
}

@media (max-width: 800px) {
    .bm-rebuild-grid {
        grid-template-columns: 1fr;
    }
}

.bm-sort-arrow {
    font-size: 11px;
    margin-left: 4px;
    opacity: 0.8;
}


.bm-sidebar-card-link,
.bm-sidebar-card-link:visited,
.bm-sidebar-card-link:hover,
.bm-sidebar-card-link:active {
    color: inherit;
    text-decoration: none;
}

.bm-sidebar-card-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.bm-sidebar-card-link:hover {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(96, 165, 250, 0.35);
    transform: translateY(-1px);
}

.bm-user-card.bm-sidebar-card-link {
    flex-direction: row;
    align-items: center;
}

.bm-store-card strong,
.bm-user-card strong {
    color: #f8fafc;
    font-weight: 700;
}

.bm-store-card .bm-small-label,
.bm-user-card .bm-small-label {
    color: #94a3b8;
}



/* =========================================================
   BrickMetrics v3 My Account page
   ========================================================= */
.bm-account-page {
    width: 100%;
}

.bm-account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.bm-account-card {
    margin: 0;
}

.bm-account-card-wide {
    grid-column: 1 / -1;
}

.bm-account-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.16);
    border: 1px solid rgba(59, 130, 246, 0.25);
    font-size: 22px;
    flex: 0 0 44px;
}

.bm-account-stack-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bm-account-checkbox {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    color: #d7dfeb !important;
    cursor: pointer;
}

.bm-account-checkbox input {
    width: 18px !important;
    min-height: 18px !important;
    height: 18px;
    flex: 0 0 18px;
}

.bm-account-actions-full {
    grid-column: 1 / -1;
}

.bm-account-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.16);
    margin-bottom: 18px;
}

.bm-account-summary-row span,
.bm-account-muted {
    color: #9dadc4;
}

.bm-account-summary-row strong {
    color: #ffffff;
}

.bm-account-danger-card {
    border-color: rgba(239, 68, 68, 0.25);
}

.bm-danger-button {
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.38);
    color: #fecaca;
    font-weight: 800;
    cursor: pointer;
}

.bm-danger-button:hover {
    background: rgba(239, 68, 68, 0.24);
}

@media (max-width: 1100px) {
    .bm-account-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .bm-account-card .bm-card-header {
        flex-direction: column;
    }

    .bm-account-actions-full,
    .bm-settings-wide-field {
        grid-column: 1 / -1;
    }
}


/* Refresh Metrics Modal */

.bm-refresh-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(8, 21, 38, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.bm-refresh-modal {
    width: min(560px, 100%);
    background: #ffffff;
    color: #102033;
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.bm-refresh-modal-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    color: #102033;
}

.bm-refresh-modal-header p {
    margin: 0 0 22px;
    color: #64748b;
}

.bm-refresh-progress-wrap {
    margin-bottom: 24px;
}

.bm-refresh-progress-bar {
    height: 14px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.bm-refresh-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    border-radius: 999px;
    transition: width 0.35s ease;
}

.bm-refresh-progress-text {
    margin-top: 10px;
    font-weight: 700;
    color: #334155;
    white-space: pre-line;
}

.bm-refresh-steps {
    display: grid;
    gap: 12px;
}

.bm-refresh-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
}

.bm-step-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #cbd5e1;
    flex: 0 0 auto;
}

.bm-refresh-step.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.bm-refresh-step.is-active .bm-step-dot {
    background: #2563eb;
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.16);
}

.bm-refresh-step.is-complete {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #166534;
}

.bm-refresh-step.is-complete .bm-step-dot {
    background: #22c55e;
}

.bm-refresh-step.is-error {
    border-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.bm-refresh-step.is-error .bm-step-dot {
    background: #ef4444;
}

.bm-refresh-modal-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
}

#bm-refresh-done-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

#bm-refresh-done-btn:hover {
    background: #1d4ed8;
}




.bm-analytics-table {
    width: 100%;
    border-collapse: collapse;
}

.bm-analytics-table th {
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #7b8794;
    padding: 14px 16px;
    border-bottom: 2px solid #e5e7eb;
}

.bm-analytics-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf2f7;
}

.bm-analytics-table tbody tr:hover {
    background: #f8fafc;
}



.bm-customer-link {
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.bm-customer-link:hover {
    text-decoration: underline;
}


.bm-value-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-weight: 600;
}

/* =========================================================
   Analytics tables / Customer Explorer
   ========================================================= */

.bm-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.45);
}

.bm-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.bm-table th {
    text-align: left;
    padding: 14px 16px;
    color: #93a4bc;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    white-space: nowrap;
}

.bm-table td {
    padding: 14px 16px;
    color: #e5e7eb;
    font-size: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.10);
    vertical-align: middle;
    white-space: nowrap;
}

.bm-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.12);
}

.bm-table tbody tr:last-child td {
    border-bottom: 0;
}

.bm-table a {
    color: #38bdf8;
    font-weight: 800;
    text-decoration: none;
}

.bm-table a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

.bm-table a:visited {
    color: #38bdf8;
}

.bm-table td:nth-child(5),
.bm-table td:nth-child(6),
.bm-table td:nth-child(8) {
    font-weight: 800;
    color: #ffffff;
}

.bm-table td:nth-child(5) {
    color: #14f195;
}
/* =========================================================
   Analytics sortable table headers
   ========================================================= */

.bm-table th a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #93a4bc;
    text-decoration: none;
    font-weight: 800;
}

.bm-table th a:hover {
    color: #ffffff;
}

.bm-table th a:visited {
    color: #93a4bc;
}

.bm-sort-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 1;
}

.bm-sort-arrow.muted {
    color: #64748b;
}

.bm-sort-arrow.active {
    color: #14f195;
    background: rgba(20, 241, 149, 0.10);
    border: 1px solid rgba(20, 241, 149, 0.25);
}





.bm-create-lot-btn {
    background: #1f9d55;
    border: 1px solid #1f9d55;
    color: #fff;
}

.bm-create-lot-btn:hover {
    background: #178347;
    border-color: #178347;
}


/* =========================================================
   Sticky table headers
   ========================================================= */

.bm-inventory-table-wrap {
    overflow-x: visible;
    overflow-y: visible;
}

.bm-inventory-table thead {
    position: sticky;
    top: 0;
    z-index: 80;
}

.bm-inventory-table thead th {
    position: sticky;
    top: 0;
    z-index: 81;
    background: #101b2b;
    box-shadow: 0 1px 0 rgba(148, 163, 184, 0.22), 0 8px 18px rgba(0,0,0,0.22);
}


/* =========================================================
   Jump to top / bottom buttons
   ========================================================= */

.bm-scroll-jump {
    position: fixed;
    right: 22px;
    bottom: 28px;
    z-index: 9000;

    display: flex;
    flex-direction: column;

    gap: 12px;

    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: 0.2s ease;
}

.bm-scroll-jump.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.bm-scroll-jump button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(232, 238, 248, 0.85);
    background: rgba(232, 238, 248, 0.96);
    color: #2f3136;
    font-size: 0;
    cursor: pointer;
    position: relative;
    box-shadow: 0 12px 28px rgba(0,0,0,0.35);
    backdrop-filter: blur(10px);
}

.bm-scroll-jump button::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 15px;
    height: 15px;
    border-left: 5px solid #2f3136;
    border-top: 5px solid #2f3136;
    transform: translate(-50%, -35%) rotate(45deg);
    border-radius: 3px;
}

#bm-scroll-bottom::before {
    transform: translate(-50%, -65%) rotate(225deg);
}

.bm-scroll-jump button:hover {
    transform: scale(1.06);
    background: #ffffff;
}

@media (max-width: 700px) {
    .bm-scroll-jump {
        right: 14px;
        bottom: 18px;
    }

    .bm-scroll-jump button {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
}



/* =========================================================
   Collapsible Sidebar
   ========================================================= */

.bm-sidebar {
    transition: width 0.22s ease, flex-basis 0.22s ease, padding 0.22s ease, transform 0.24s ease;
}

.bm-logo {
    position: relative;
}

/* Toggle button - sits next to the logo */
.bm-sidebar-toggle {
    margin-left: auto;
    width: 30px;
    height: 30px;
    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    background: rgba(255,255,255,0.055);
    color: #c7d2e4;

    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.bm-sidebar-toggle:hover {
    background: rgba(37, 99, 235, 0.22);
    color: #ffffff;
}

/* Collapsed sidebar - desktop only */
@media (min-width: 901px) {
body.bm-sidebar-collapsed .bm-sidebar {
    width: 86px;
    flex-basis: 86px;
    padding-left: 14px;
    padding-right: 14px;
}

body.bm-sidebar-collapsed .bm-logo {
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

body.bm-sidebar-collapsed .bm-logo-text,
body.bm-sidebar-collapsed .bm-logo-sub,
body.bm-sidebar-collapsed .bm-nav-item span:last-child,
body.bm-sidebar-collapsed .bm-sidebar-bottom strong,
body.bm-sidebar-collapsed .bm-sidebar-bottom .bm-small-label,
body.bm-sidebar-collapsed .bm-user-card > div:not(.bm-avatar),
body.bm-sidebar-collapsed .bm-store-card {
    display: none;
}

body.bm-sidebar-collapsed .bm-logo-image {
    width: 42px;
    height: 42px;
}

body.bm-sidebar-collapsed .bm-sidebar-toggle {
    margin-left: 0;
}

body.bm-sidebar-collapsed .bm-nav {
    margin-top: 22px;
}

body.bm-sidebar-collapsed .bm-nav-item {
    justify-content: center;
    padding: 13px 0;
    position: relative;
}

body.bm-sidebar-collapsed .bm-nav-icon {
    width: auto;
}

body.bm-sidebar-collapsed .bm-sidebar-bottom {
    align-items: center;
}

body.bm-sidebar-collapsed .bm-user-card {
    width: 52px;
    height: 52px;
    padding: 7px;
    justify-content: center;
}

body.bm-sidebar-collapsed .bm-avatar {
    width: 38px;
    height: 38px;
}

/* Collapsed menu tooltip - appears underneath icon */
body.bm-sidebar-collapsed .bm-nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;

    background: #0f172a;
    color: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    padding: 7px 10px;

    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    z-index: 100000;

    box-shadow: 0 14px 30px rgba(0,0,0,0.35);
}

body.bm-sidebar-collapsed .bm-nav-item:hover::after {
    opacity: 1;
}


body:not(.bm-sidebar-collapsed) .bm-sidebar-toggle,
body.bm-sidebar-collapsed .bm-sidebar-toggle {
    position: relative;
}

.bm-sidebar-toggle::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;

    background: #0f172a;
    color: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 10px;
    padding: 7px 10px;

    font-size: 11px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    z-index: 100000;

    box-shadow: 0 14px 30px rgba(0,0,0,0.35);
}

.bm-sidebar-toggle:hover::after {
    opacity: 1;
}
}


/* Fix sidebar sticky after sticky table/header updates */
@media (min-width: 901px) {
    .bm-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        overflow-x: visible;
        align-self: flex-start;
    }
}



/* =========================================================
   Recheck Modal - SSE version
   ========================================================= */

body > .bm-recheck-modal-overlay,
.bm-recheck-modal-overlay {
    display: none !important;
}

body > .bm-recheck-modal-overlay.open,
.bm-recheck-modal-overlay.open {
    position: fixed !important;
    inset: 0 !important;
    width: 100dvw !important;
    height: 100dvh !important;
    z-index: 2147483647 !important;
    display: grid !important;
    place-items: center !important;
    padding: 20px !important;
    background: rgba(2, 6, 23, 0.72) !important;
    backdrop-filter: blur(8px);
}

.bm-recheck-modal-box {
    position: relative !important;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94));
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.50);
    border-radius: 22px;
    padding: 24px;
    color: #e5e7eb;
}

.bm-recheck-modal-header h2 {
    margin: 0 0 10px;
    font-size: 30px;
    line-height: 1.1;
    color: #ffffff;
}

.bm-recheck-modal-header p {
    margin: 0 0 22px;
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.45;
}

.bm-recheck-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
}

.bm-recheck-step {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #cbd5e1;
    font-size: 15px;
    line-height: 1.25;
}

.bm-recheck-dot {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.20);
    border: 1px solid rgba(148, 163, 184, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
}

.bm-recheck-step.is-running .bm-recheck-dot {
    background: rgba(37, 99, 235, 0.22);
    border-color: rgba(59, 130, 246, 0.75);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.14);
    animation: bmRecheckPulse 1s ease-in-out infinite;
}

.bm-recheck-step.is-running .bm-recheck-dot::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #60a5fa;
}

.bm-recheck-step.is-complete .bm-recheck-dot {
    background: rgba(20, 241, 149, 0.18);
    border-color: rgba(20, 241, 149, 0.55);
}

.bm-recheck-step.is-complete .bm-recheck-dot::after {
    content: '✓';
    color: #14f195;
    font-weight: 900;
    font-size: 15px;
}

.bm-recheck-step.is-error .bm-recheck-dot {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.6);
}

.bm-recheck-step.is-error .bm-recheck-dot::after {
    content: '!';
    color: #fca5a5;
    font-weight: 900;
}

.bm-recheck-error {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
    font-weight: 700;
    line-height: 1.4;
}

.bm-recheck-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.bm-recheck-running {
    opacity: 0.75;
    cursor: wait !important;
}

@keyframes bmRecheckPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.82; }
}

.bm-recheck-btn {
    border: 0;
    border-radius: 10px;
    padding: 7px 10px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.bm-recheck-fresh {
    background: #198754;
}

.bm-recheck-stale {
    background: #f59e0b;
    color: #111827;
}

.bm-recheck-running {
    background: #64748b;
    color: #ffffff;
    cursor: wait;
}
/* =========================================================
   Shared Item Search Panel
   ========================================================= */

.bm-item-search-panel {
    margin: 0 0 18px;
    padding: 18px;
    background: rgba(15, 23, 42, 0.56);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
}

.bm-item-search-main-row {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 14px;
}

.bm-item-search-filter-grid {
    display: grid;
    gap: 12px;
    align-items: start;
}

.bm-item-search-filter-row-primary {
    grid-template-columns: 140px minmax(260px, 1fr) 160px minmax(260px, 1fr);
    margin-bottom: 14px;
}

.bm-item-search-filter-row-secondary {
    grid-template-columns: 250px 250px minmax(160px, 1fr) minmax(170px, 1fr) minmax(160px, 1fr);
}

.bm-item-search-filter-row-secondary-inventory {
    grid-template-columns: 250px 250px 250px minmax(150px, 1fr) minmax(160px, 1fr) minmax(150px, 1fr);
}

.bm-item-search-field label {
    display: block;
    margin: 0 0 6px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bm-item-search-field .bm-inventory-search,
.bm-item-search-field .bm-inventory-select,
.bm-item-search-panel .bm-inventory-search,
.bm-item-search-panel .bm-inventory-select {
    width: 100%;
    height: 42px;
}

.bm-item-search-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.bm-secondary-button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 0 15px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.06);
    color: #e8eef8;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.bm-secondary-button:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
}

.bm-sell-thru-pair {
    display: grid;
    grid-template-columns: 72px minmax(70px, 1fr);
    gap: 8px;
}

.bm-search-summary-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding: 11px 14px;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.24);
    color: #c7d2e4;
    font-size: 14px;
}

.bm-search-summary-line span {
    color: #94a3b8;
    font-weight: 700;
}

.bm-search-summary-line strong {
    color: #f8fafc;
}

.bm-save-search-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.74);
    padding: 20px;
}

.bm-save-search-dialog {
    width: min(520px, 100%);
    padding: 22px;
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45);
}

.bm-save-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.bm-save-search-header h3 {
    margin: 0;
    color: #ffffff;
}

.bm-save-search-header button {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: #e8eef8;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.bm-save-search-dialog label {
    display: block;
    margin-bottom: 7px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
}

.bm-save-search-summary {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.10);
    border: 1px solid rgba(37, 99, 235, 0.20);
    color: #dbeafe;
    font-size: 13px;
}

.bm-save-search-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 1450px) {
    .bm-item-search-filter-grid {
        grid-template-columns: repeat(4, minmax(150px, 1fr));
    }
}

@media (max-width: 900px) {
    .bm-item-search-main-row,
    .bm-item-search-filter-grid {
        grid-template-columns: 1fr;
    }

    .bm-item-search-actions {
        justify-content: flex-start;
    }
}

/* =========================================================
   Shared Item Search Panel - multi filters / ranges
   ========================================================= */

.bm-chip-builder {
    min-width: 220px;
}

.bm-chip-add-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.bm-selected-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
    min-height: 28px;
}

.bm-selected-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.28);
    color: #dbeafe;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.bm-chip-remove {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.bm-chip-remove:hover {
    background: rgba(239, 68, 68, 0.45);
}

.bm-sell-thru-range {
    display: grid;
    grid-template-columns: minmax(70px, 1fr) auto minmax(70px, 1fr);
    gap: 8px;
    align-items: center;
}

.bm-sell-thru-range span {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

/* =========================================================
   Shared Item Search Panel - advanced metric filters
   ========================================================= */

.bm-advanced-search {
    margin-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    padding-top: 12px;
}

.bm-advanced-search summary {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    color: #e5e7eb;
    font-weight: 800;
    list-style: none;
}

.bm-advanced-search summary::-webkit-details-marker {
    display: none;
}

.bm-advanced-search summary::before {
    content: '+';
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.26);
    color: #bfdbfe;
    font-size: 15px;
    line-height: 1;
}

.bm-advanced-search[open] summary::before {
    content: '−';
}

.bm-advanced-search summary em {
    color: #94a3b8;
    font-size: 12px;
    font-style: normal;
    font-weight: 700;
}

.bm-advanced-search-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.bm-search-range-pair {
    display: grid;
    grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr);
    gap: 8px;
    align-items: center;
}

.bm-search-range-pair span {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.bm-search-number-stepper {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.84);
}

.bm-item-search-panel .bm-search-number-stepper input[type="number"] {
    width: auto !important;
    min-width: 0;
    height: 40px;
    padding: 0 4px;
    border: 0 !important;
    border-right: 1px solid rgba(96, 165, 250, 0.22) !important;
    border-left: 1px solid rgba(96, 165, 250, 0.22) !important;
    border-radius: 0 !important;
    background: transparent !important;
    text-align: center;
    font-weight: 800;
    -moz-appearance: textfield;
    appearance: textfield;
}

.bm-search-number-stepper input::-webkit-inner-spin-button,
.bm-search-number-stepper input::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.bm-search-number-stepper button {
    min-width: 30px;
    min-height: 40px;
    padding: 0;
    border: 0;
    background: rgba(37, 99, 235, 0.72);
    color: #dbeafe;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
}

.bm-search-number-stepper button:hover,
.bm-search-number-stepper button:focus-visible {
    background: rgba(34, 197, 94, 0.82);
}

@media (max-width: 1450px) {
    .bm-advanced-search-grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

@media (max-width: 900px) {
    .bm-advanced-search-grid {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   BrickMetrics v3 Sets pages
   Add to /assets/css/brickmetrics-v3.css
   ========================================================= */

.bm-sets-toolbar {
    grid-template-columns: 1fr 180px auto auto;
}

.bm-set-barcode-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.bm-set-barcode-open svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

.bm-set-barcode-modal[hidden] {
    display: none;
}

.bm-set-barcode-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 8, 23, 0.82);
    backdrop-filter: blur(6px);
}

.bm-set-barcode-dialog {
    width: min(560px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 22px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 20px;
    background: #13253c;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.bm-set-barcode-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.bm-set-barcode-header h2,
.bm-set-barcode-header p {
    margin: 0;
}

.bm-set-barcode-header p {
    margin-top: 5px;
    color: #a8b5c8;
}

.bm-set-barcode-close {
    flex: 0 0 auto;
}

.bm-set-barcode-header .bm-set-barcode-close {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 11px;
    background: rgba(15, 23, 42, 0.7);
    color: #e8eef8;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.bm-set-barcode-camera {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 16px;
    background: #050b16;
}

.bm-set-barcode-camera video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.bm-set-barcode-target {
    position: absolute;
    left: 9%;
    right: 9%;
    top: 35%;
    height: 30%;
    border: 3px solid #38bdf8;
    border-radius: 12px;
    box-shadow: 0 0 0 999px rgba(2, 8, 23, 0.34);
    pointer-events: none;
}

.bm-set-barcode-status {
    min-height: 24px;
    margin: 14px 0;
    color: #cbd5e1;
}

.bm-set-barcode-status.is-error {
    color: #fca5a5;
}

.bm-set-barcode-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.bm-set-barcodes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 7px 0 0;
    color: #94a3b8;
    font-size: 0.82rem;
}

.bm-set-barcodes strong {
    color: #b9c6d8;
    font-weight: 700;
}

.bm-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.bm-set-summary-layout {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 26px;
    align-items: start;
}

.bm-set-summary-image {
    width: 210px;
    min-height: 170px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 14px;
}

.bm-set-summary-image img {
    width: 100%;
    height: 100%;
    max-height: 190px;
    object-fit: contain;
}

.bm-set-summary-image span {
    color: #94a3b8;
}

.bm-set-summary-main .bm-card-header {
    margin-bottom: 18px;
}

.bm-set-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 14px;
}

/* Personalised set score */
.bm-set-score-card {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.bm-set-score-card .bm-card-header {
    margin-bottom: 0;
    align-items: center;
}

.bm-set-score-card .bm-card-header h2 {
    margin-bottom: 6px;
}

.bm-set-score-card .bm-card-header p {
    margin: 0;
    max-width: 720px;
}

.bm-set-score-summary-grid .bm-hot-stat,
.bm-set-score-facts-grid .bm-hot-stat {
    min-height: 98px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bm-set-score-card .bm-hot-stat span {
    margin-bottom: 9px;
}

.bm-set-score-card .bm-hot-stat strong {
    display: block;
    line-height: 1.2;
}

.bm-set-score-card .bm-hot-stat small {
    display: block;
    margin-top: 7px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.35;
}

.bm-set-score-hero {
    position: relative;
    overflow: hidden;
    border-width: 2px;
}

.bm-set-score-hero strong {
    font-size: 44px !important;
    line-height: 1 !important;
    letter-spacing: -1.5px;
}

.bm-set-score-hero small {
    font-weight: 800;
    letter-spacing: 0.02em;
}

.bm-set-score-hero.excellent {
    background: linear-gradient(135deg, rgba(20, 241, 149, 0.22), rgba(20, 241, 149, 0.07));
    border-color: rgba(20, 241, 149, 0.58);
}
.bm-set-score-hero.excellent strong,
.bm-set-score-hero.excellent small { color: #34d399; }

.bm-set-score-hero.strong {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(59, 130, 246, 0.07));
    border-color: rgba(96, 165, 250, 0.58);
}
.bm-set-score-hero.strong strong,
.bm-set-score-hero.strong small { color: #60a5fa; }

.bm-set-score-hero.consider {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.23), rgba(245, 158, 11, 0.07));
    border-color: rgba(251, 191, 36, 0.58);
}
.bm-set-score-hero.consider strong,
.bm-set-score-hero.consider small { color: #fbbf24; }

.bm-set-score-hero.weak {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.22), rgba(249, 115, 22, 0.07));
    border-color: rgba(251, 146, 60, 0.58);
}
.bm-set-score-hero.weak strong,
.bm-set-score-hero.weak small { color: #fb923c; }

.bm-set-score-hero.poor {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(239, 68, 68, 0.07));
    border-color: rgba(248, 113, 113, 0.58);
}
.bm-set-score-hero.poor strong,
.bm-set-score-hero.poor small { color: #f87171; }

.bm-set-score-preferences {
    display: grid;
    grid-template-columns: minmax(230px, max-content) minmax(220px, 300px) auto;
    gap: 14px;
    align-items: end;
    justify-content: start;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.38);
}

.bm-set-score-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.bm-set-score-field > span {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

.bm-set-score-field .bm-inventory-search,
.bm-set-score-field .bm-inventory-select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.bm-set-score-checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 0 4px;
    color: #e2e8f0;
    line-height: 1.25;
    cursor: pointer;
}

.bm-set-score-reason[hidden] {
    display: none;
}

.bm-set-score-checkbox input {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.bm-set-score-preferences .bm-small-button {
    min-height: 42px;
    padding-left: 18px;
    padding-right: 18px;
}

#bm-set-score-message {
    grid-column: 1 / -1;
    min-height: 0;
    color: #93c5fd;
    font-size: 13px;
}

.bm-set-options-form {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.bm-set-option-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 170px;
}

.bm-set-option-group label {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

.bm-set-filter-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 170px repeat(4, minmax(130px, 150px)) auto;
    gap: 12px;
    margin-bottom: 22px;
    align-items: center;
}

.bm-set-missing-card {
    border-color: rgba(255, 176, 32, 0.32);
}

.bm-sets-table .bm-inventory-image,
.bm-set-parts-table .bm-inventory-image {
    width: 58px;
    height: 58px;
}

.bm-set-parts-table td:nth-child(2) {
    white-space: normal;
    min-width: 260px;
}

.bm-set-parts-table td:nth-child(2) span {
    color: #cbd5e1;
}

.bm-set-parts-table td:nth-child(2) em {
    color: #94a3b8;
    font-style: normal;
}

@media (max-width: 1300px) {
    .bm-set-kpi-grid {
        grid-template-columns: repeat(2, minmax(130px, 1fr));
    }

    .bm-set-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bm-set-score-preferences {
        grid-template-columns: minmax(230px, max-content) minmax(220px, 1fr) auto;
    }
}

@media (max-width: 800px) {
    .bm-set-summary-layout {
        grid-template-columns: 1fr;
    }

    .bm-set-summary-image {
        width: 100%;
    }

    .bm-set-kpi-grid,
    .bm-set-filter-grid,
    .bm-sets-toolbar {
        grid-template-columns: 1fr;
    }

    .bm-set-score-card {
        gap: 16px;
    }

    .bm-set-score-card .bm-card-header {
        align-items: stretch;
    }

    .bm-set-score-preferences {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    #bm-set-score-message {
        grid-column: auto;
    }

    .bm-set-barcode-modal {
        align-items: end;
        padding: 10px;
    }

    .bm-set-barcode-dialog {
        width: 100%;
        max-height: calc(100dvh - 20px);
        padding: 16px;
        border-radius: 18px;
    }

    .bm-set-barcode-camera {
        aspect-ratio: 3 / 4;
        max-height: 58dvh;
    }

    .bm-set-barcode-actions > * {
        min-height: 44px;
    }
}


/* =========================================================
   Brickognize Part Scanner
   ========================================================= */

.bm-table-actions-row {
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 14px;
    flex-wrap: wrap;
}

.bm-table-actions-row .bm-column-chooser {
    margin: 0;
}

.bm-scan-part-open {
    background: #0ea5e9;
}

.bm-scan-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 18px 32px;
    background: rgba(2, 6, 23, 0.72);
    overflow-y: auto;
}

.bm-scan-modal-overlay.open {
    display: flex;
}

.bm-scan-modal-box {
    width: min(980px, 100%);
    background: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 22px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    padding: 22px;
}

.bm-scan-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.bm-scan-modal-header h2 {
    margin: 0;
    font-size: 22px;
    color: #f8fafc;
}

.bm-scan-modal-header p {
    margin: 7px 0 0;
    color: #94a3b8;
}

.bm-scan-close {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    color: #e5e7eb;
    font-size: 22px;
    cursor: pointer;
}

.bm-scan-camera-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(2, 6, 23, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.bm-scan-camera-wrap video {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #020617;
}

.bm-scan-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-weight: 700;
}

.bm-scan-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.bm-scan-status {
    margin-top: 14px;
    min-height: 22px;
    color: #cbd5e1;
}

.bm-scan-status.success {
    color: #4ade80;
}

.bm-scan-status.error {
    color: #fca5a5;
}

.bm-scan-results {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.bm-scan-result-card {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.72);
}

.bm-scan-result-card img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.bm-scan-result-body strong,
.bm-scan-result-body span {
    display: block;
}

.bm-scan-result-body strong {
    color: #f8fafc;
    font-size: 15px;
    margin-bottom: 6px;
}

.bm-scan-result-body span {
    color: #94a3b8;
    margin-bottom: 12px;
}

.bm-scan-result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bm-scan-empty {
    padding: 16px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

@media (max-width: 700px) {
    .bm-scan-result-card {
        grid-template-columns: 1fr;
    }

    .bm-scan-result-card img {
        width: 120px;
        height: 120px;
    }
}


.bm-scan-result-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    padding: 7px 11px;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    font-size: 12px;
}

.bm-scan-result-button:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.bm-scan-result-button.secondary {
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.28);
}

.bm-scan-result-image-link {
    display: block;
    cursor: pointer;
}

.bm-scan-camera-select {
    height: 34px;
    border-radius: 8px;
    background: #0f172a;
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.28);
    padding: 0 10px;
}



/* =========================================================
   Brickognize create-in-BrickMetrics panel
   ========================================================= */

.bm-scan-create-panel {
    margin-top: 14px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(250, 204, 21, 0.32);
    background: rgba(113, 63, 18, 0.22);
    grid-column: 1 / -1;
}

.bm-scan-create-panel strong {
    display: block;
    color: #fef3c7;
    margin-bottom: 6px;
}

.bm-scan-create-panel p {
    margin: 0 0 10px 0;
    color: #dbe7f5;
    font-size: 13px;
    line-height: 1.4;
}

.bm-scan-create-colour {
    width: 100%;
    max-width: 360px;
    height: 38px;
    margin: 0 0 10px 0;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #0f172a;
    color: #e5e7eb;
}

.bm-scan-create-checks {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 700;
}

.bm-scan-create-checks label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.bm-scan-create-message {
    margin-top: 10px;
    font-size: 13px;
    color: #cbd5e1;
}

.bm-scan-create-message.success {
    color: #14f195;
}

.bm-scan-create-message.error {
    color: #fca5a5;
}

/* =========================================================
   Sets page status buttons
   ========================================================= */

.bm-status-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid rgba(148, 163, 184, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.bm-status-button:hover {
    transform: translateY(-1px);
    text-decoration: none;
    opacity: 0.96;
}

.bm-status-button.complete {
    background: rgba(20, 241, 149, 0.14);
    color: #14f195;
    border-color: rgba(20, 241, 149, 0.38);
    box-shadow: 0 8px 18px rgba(20, 241, 149, 0.08);
}

.bm-status-button.warning {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.40);
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.08);
}

.bm-status-button.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.42);
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.08);
}

.bm-status-button.info {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.42);
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.08);
}

.bm-sets-table .bm-status-button:visited {
    color: inherit;
}

.bm-sets-score-cell {
    text-align: center;
}

.bm-set-score-calculate,
.bm-set-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.bm-set-score-calculate,
.bm-set-score-calculate:visited {
    color: #dbeafe;
    border: 1px solid rgba(59, 130, 246, 0.58);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.32), rgba(37, 99, 235, 0.20));
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.16);
}

.bm-set-score-badge,
.bm-set-score-badge:visited {
    color: #a7f3d0;
    border: 1px solid rgba(20, 241, 149, 0.42);
    background: rgba(20, 241, 149, 0.12);
}

.bm-set-score-badge.excellent,
.bm-set-score-badge.excellent:visited { color: #34d399; border-color: rgba(52, 211, 153, 0.55); background: rgba(16, 185, 129, 0.14); }
.bm-set-score-badge.strong,
.bm-set-score-badge.strong:visited { color: #60a5fa; border-color: rgba(96, 165, 250, 0.55); background: rgba(59, 130, 246, 0.14); }
.bm-set-score-badge.consider,
.bm-set-score-badge.consider:visited { color: #fbbf24; border-color: rgba(251, 191, 36, 0.55); background: rgba(245, 158, 11, 0.14); }
.bm-set-score-badge.weak,
.bm-set-score-badge.weak:visited { color: #fb923c; border-color: rgba(251, 146, 60, 0.55); background: rgba(249, 115, 22, 0.14); }
.bm-set-score-badge.poor,
.bm-set-score-badge.poor:visited { color: #f87171; border-color: rgba(248, 113, 113, 0.55); background: rgba(239, 68, 68, 0.14); }

.bm-set-score-calculate:hover,
.bm-set-score-badge:hover {
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

.bm-set-score-calculate:hover {
    border-color: rgba(96, 165, 250, 0.85);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.48), rgba(37, 99, 235, 0.30));
    box-shadow: 0 9px 20px rgba(37, 99, 235, 0.24);
}

.bm-set-score-calculate:focus-visible,
.bm-set-score-badge:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}
/* =========================================================
   Sets page grouped New/Used one-line table layout
   ========================================================= */
.bm-sets-page .bm-card {
    padding-left: 20px;
    padding-right: 20px;
}

.bm-sets-page .bm-inventory-table-wrap {
    border-radius: 0 0 16px 16px;
}

.bm-sets-table-grouped {
    min-width: 1540px;
    table-layout: auto;
}

.bm-sets-table-grouped th,
.bm-sets-table-grouped td {
    padding-left: 9px;
    padding-right: 9px;
}

.bm-sets-table-grouped .bm-inventory-image {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
}

.bm-sets-group-row th {
    text-align: center;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .055em;
    text-transform: uppercase;
    padding: 12px 8px 11px;
    border-bottom: 0;
}

.bm-sets-group-spacer {
    background: transparent !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18) !important;
}

.bm-sets-group-new {
    color: #14f195 !important;
    background: rgba(20, 241, 149, 0.055) !important;
    border: 1px solid rgba(20, 241, 149, 0.42) !important;
    border-bottom: 0 !important;
    border-radius: 12px 12px 0 0;
}

.bm-sets-group-used {
    color: #ffb020 !important;
    background: rgba(255, 176, 32, 0.055) !important;
    border: 1px solid rgba(255, 176, 32, 0.42) !important;
    border-bottom: 0 !important;
    border-radius: 12px 12px 0 0;
}

.bm-sets-updated-head {
    text-align: center !important;
    vertical-align: middle;
    border-left: 1px solid rgba(148, 163, 184, 0.22) !important;
}

.bm-sets-column-row .bm-new-first,
.bm-sets-table-grouped td.bm-new-first {
    border-left: 1px solid rgba(20, 241, 149, 0.32) !important;
}

.bm-sets-column-row .bm-new-last,
.bm-sets-table-grouped td.bm-new-last {
    border-right: 1px solid rgba(20, 241, 149, 0.32) !important;
}

.bm-sets-column-row .bm-used-first,
.bm-sets-table-grouped td.bm-used-first {
    border-left: 1px solid rgba(255, 176, 32, 0.34) !important;
}

.bm-sets-column-row .bm-used-last,
.bm-sets-table-grouped td.bm-used-last {
    border-right: 1px solid rgba(255, 176, 32, 0.34) !important;
}

.bm-sets-table-grouped tbody tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

.bm-sets-table-grouped .bm-status-button {
    min-width: 74px;
    padding: 6px 10px;
}

.bm-sets-count-cell {
    text-align: center;
    font-weight: 800;
}

.bm-sets-count-cell.has-missing {
    color: #fbbf24;
}

.bm-sets-count-cell.has-stale {
    color: #fb923c;
}

.bm-sets-table-grouped td:nth-child(3) {
    min-width: 180px;
}

.bm-sets-table-grouped td:nth-child(21),
.bm-sets-table-grouped th.bm-sets-updated-head {
    min-width: 110px;
}

@media (max-width: 1400px) {
    .bm-sets-page .bm-card {
        padding-left: 14px;
        padding-right: 14px;
    }

    .bm-sets-table-grouped {
        min-width: 1480px;
    }

    .bm-sets-table-grouped th,
    .bm-sets-table-grouped td {
        padding-left: 7px;
        padding-right: 7px;
    }
}

/* =========================================================
   Sets grouped table v3: compact one-line rows + clearer groups
   ========================================================= */
.bm-sets-page .bm-inventory-table-wrap {
    border-radius: 0 0 16px 16px;
}

.bm-sets-page .bm-column-menu {
    width: min(520px, calc(100vw - 48px));
    max-height: min(560px, 70vh);
    overflow-y: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bm-sets-page .bm-column-menu[style*="block"] {
    display: grid !important;
}

.bm-sets-toolbar .bm-sets-score-stepper {
    min-width: 210px;
}

.bm-sets-toolbar .bm-sets-score-stepper input[type="number"] {
    width: auto !important;
    min-width: 0;
    height: 40px;
    padding: 0 4px;
    border: 0 !important;
    border-right: 1px solid rgba(96, 165, 250, 0.22) !important;
    border-left: 1px solid rgba(96, 165, 250, 0.22) !important;
    border-radius: 0 !important;
    background: transparent !important;
    text-align: center;
    font-weight: 800;
    -moz-appearance: textfield;
    appearance: textfield;
}

@media (max-width: 800px) {
    .bm-sets-page .bm-column-menu {
        grid-template-columns: 1fr;
    }

    .bm-sets-toolbar .bm-sets-score-stepper {
        width: 100%;
    }
}

.bm-sets-table-grouped {
    min-width: 1460px;
    border-collapse: separate;
    border-spacing: 0;
}

.bm-sets-table-grouped thead th {
    background: rgba(8, 18, 33, 0.92);
}

.bm-sets-table-grouped th,
.bm-sets-table-grouped td {
    padding-left: 8px;
    padding-right: 8px;
}

.bm-sets-table-grouped tbody td {
    height: 74px;
}

.bm-sets-table-grouped .bm-inventory-image {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
}

.bm-sets-set-head {
    min-width: 165px;
}

.bm-sets-set-cell {
    min-width: 175px;
}

.bm-sets-set-no,
.bm-sets-set-name {
    display: block;
    text-decoration: none;
    white-space: nowrap;
}

.bm-sets-set-no {
    color: #f8fafc;
    font-size: 18px;
    line-height: 1.05;
    font-weight: 900;
    margin-bottom: 5px;
}

.bm-sets-set-name {
    color: #38bdf8;
    font-size: 14px;
    line-height: 1.15;
    font-weight: 800;
    max-width: 215px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-sets-set-no:hover,
.bm-sets-set-name:hover {
    color: #ffffff;
    text-decoration: underline;
}

.bm-sets-group-row th {
    padding-top: 13px;
    padding-bottom: 10px;
    background: transparent;
}

.bm-sets-group-spacer {
    background: transparent !important;
    border: 0 !important;
}

.bm-sets-group-new {
    border: 1px solid rgba(20, 241, 149, 0.62) !important;
    border-bottom: 0 !important;
    border-radius: 10px 0 0 0 !important;
    background: linear-gradient(180deg, rgba(20, 241, 149, 0.105), rgba(20, 241, 149, 0.045)) !important;
    color: #14f195 !important;
}

.bm-sets-group-used {
    border: 1px solid rgba(255, 176, 32, 0.62) !important;
    border-bottom: 0 !important;
    border-radius: 0 10px 0 0 !important;
    background: linear-gradient(180deg, rgba(255, 176, 32, 0.105), rgba(255, 176, 32, 0.045)) !important;
    color: #ffb020 !important;
}

.bm-sets-column-row .bm-new-first {
    border-left: 1px solid rgba(20, 241, 149, 0.48) !important;
}

.bm-sets-column-row .bm-new-last {
    border-right: 1px solid rgba(20, 241, 149, 0.48) !important;
}

.bm-sets-column-row .bm-used-first {
    border-left: 1px solid rgba(255, 176, 32, 0.50) !important;
}

.bm-sets-column-row .bm-used-last {
    border-right: 1px solid rgba(255, 176, 32, 0.50) !important;
}

.bm-sets-table-grouped td.bm-new-first {
    border-left: 1px solid rgba(20, 241, 149, 0.28) !important;
}

.bm-sets-table-grouped td.bm-new-last {
    border-right: 1px solid rgba(20, 241, 149, 0.28) !important;
}

.bm-sets-table-grouped td.bm-used-first {
    border-left: 1px solid rgba(255, 176, 32, 0.30) !important;
}

.bm-sets-table-grouped td.bm-used-last {
    border-right: 1px solid rgba(255, 176, 32, 0.30) !important;
}

.bm-sets-updated-head {
    min-width: 112px;
    border-left: 0 !important;
    border-radius: 0 10px 0 0;
}

.bm-sets-table-grouped td:last-child {
    min-width: 112px;
}

.bm-sets-table-grouped .bm-status-button {
    min-width: 70px;
    padding: 6px 10px;
}

.bm-sets-count-cell {
    min-width: 42px;
}

.bm-sets-table-grouped td:nth-child(3) {
    min-width: 0;
}

@media (max-width: 1400px) {
    .bm-sets-table-grouped {
        min-width: 1420px;
    }

    .bm-sets-table-grouped th,
    .bm-sets-table-grouped td {
        padding-left: 7px;
        padding-right: 7px;
    }

    .bm-sets-set-cell {
        min-width: 160px;
    }

    .bm-sets-set-name {
        max-width: 180px;
    }
}

/* =========================================================
   Inventory suggested / locked pricing states
   ========================================================= */
.bm-my-price-wrap {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.bm-my-price-value {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 800;
    color: #f8fafc;
    white-space: nowrap;
}

.bm-price-lock-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    line-height: 1;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.bm-price-lock-toggle.locked {
    color: #fbbf24;
}

.bm-price-lock-toggle.unlocked {
    color: #f8fafc;
    opacity: 0.9;
    filter: grayscale(1);
}

.bm-price-lock-toggle:hover {
    transform: scale(1.14);
    opacity: 1;
}

.bm-price-lock-toggle:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

.bm-price-lock-toggle.bm-lock-just-toggled {
    animation: bmLockTogglePop 0.18s ease-out;
}

@keyframes bmLockTogglePop {
    0% { transform: scale(1); }
    50% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

.bm-apply-price-btn {
    border: 0;
    padding: 5px 9px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.bm-apply-price-btn.bm-suggested-up {
    background: #198754;
    color: #ffffff;
}

.bm-apply-price-btn.bm-suggested-up:hover {
    background: #157347;
}

.bm-apply-price-btn.bm-suggested-down {
    background: #dc3545;
    color: #ffffff;
}

.bm-apply-price-btn.bm-suggested-down:hover {
    background: #bb2d3b;
}

.bm-apply-price-btn.bm-suggested-same,
.bm-apply-price-btn.bm-suggested-neutral {
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
}

.bm-apply-price-btn.bm-suggested-locked {
    background: rgba(251, 191, 36, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fbbf24;
}

.bm-apply-price-btn:disabled {
    opacity: 1;
    cursor: not-allowed;
}

.bm-price-updated {
    background: #6c757d !important;
    color: #ffffff !important;
}


.bm-suggested-price-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.bm-suggested-explain-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(147, 197, 253, 0.28);
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
	opacity:.8;
    transition:opacity .15s ease, transform .15s ease;
}

.bm-suggested-explain-link:hover {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.30);
    border-color: rgba(147, 197, 253, 0.55);
    text-decoration: none;
    opacity:1;
    transform:scale(1.12);	
}

/* =========================================================
   Item metrics search toolbar polish
   Keeps the Exact Part control aligned with the search actions.
   ========================================================= */
.bm-item-search-form-enhanced,
.bm-item-search-form-enhanced * {
    font-family: Inter, Arial, Helvetica, sans-serif;
}

.bm-item-search-form-enhanced label,
.bm-item-search-form-enhanced .bm-filter-label,
.bm-item-search-form-enhanced .bm-search-label,
.bm-item-search-form-enhanced .bm-field-label,
.bm-exact-part-search-toggle {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    color: #9aa8bf;
}

.bm-item-search-form-enhanced input[name="q"] {
    font-size: 15px;
    font-weight: 500;
    color: #f8fafc;
}

.bm-search-top-row-enhanced,
.bm-search-actions-with-exact-part {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bm-search-top-row-enhanced {
    width: 100%;
}

.bm-search-field-with-exact-part {
    flex: 1 1 auto;
    min-width: 260px;
    max-width: calc(100% - 540px);
}

.bm-search-field-with-exact-part input[name="q"] {
    width: 100%;
}

.bm-exact-part-search-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 8px 0 4px;
    min-height: 42px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.bm-exact-part-search-toggle input {
    width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 16px;
    accent-color: #2563eb;
}

.bm-search-actions-with-exact-part button,
.bm-search-actions-with-exact-part input[type="submit"] {
    min-height: 42px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.bm-search-actions-with-exact-part button:not(:first-of-type),
.bm-search-actions-with-exact-part input[type="button"],
.bm-search-actions-with-exact-part a {
    font-size: 14px;
    font-weight: 800;
}

@media (max-width: 1200px) {
    .bm-search-field-with-exact-part {
        max-width: none;
    }
}

@media (max-width: 900px) {
    .bm-search-top-row-enhanced,
    .bm-search-actions-with-exact-part {
        flex-wrap: wrap;
        align-items: stretch;
    }

    .bm-exact-part-search-toggle {
        justify-content: flex-start;
        margin: 4px 0;
        min-height: 36px;
    }
}


/* Informational suggested price for OOS or not-yet-created lots */
.bm-suggested-potential {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 6px;
    background: rgba(100, 116, 139, 0.16);
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    cursor: default;
}

/* =========================================================
   Wanted Lists
   ========================================================= */
.bm-wanted-bulk-actions,.bm-wanted-detail-actions,.bm-wanted-export-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.bm-wanted-select-page{display:flex;align-items:center;gap:7px;color:#cbd5e1;font-size:12px;font-weight:700}
.bm-wanted-row-controls{display:flex;flex-direction:column;align-items:center;gap:5px;flex:0 0 26px}
.bm-wanted-row-select{width:15px;height:15px;cursor:pointer}
.bm-wanted-heart{border:0;background:transparent;color:#94a3b8;font-size:24px;line-height:1;cursor:pointer;padding:0;transition:transform .15s ease,color .15s ease}
.bm-wanted-heart:hover{transform:scale(1.12);color:#f87171}
.bm-wanted-heart.is-wanted{color:#ef4444}
.bm-wanted-modal-overlay{position:fixed;inset:0;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(2,6,23,.76);z-index:1000}
.bm-wanted-modal-overlay.open{display:flex}
.bm-wanted-modal{width:min(520px,100%);background:#0f172a;border:1px solid rgba(148,163,184,.25);border-radius:20px;padding:22px;box-shadow:0 24px 70px rgba(0,0,0,.45)}
.bm-wanted-modal-header,.bm-wanted-detail-header{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:18px}
.bm-wanted-modal-header h2,.bm-wanted-detail-header h2{margin:0}.bm-wanted-modal-header p,.bm-wanted-detail-header p{margin:6px 0 0;color:#94a3b8}
.bm-wanted-modal-close{border:0;background:transparent;color:#cbd5e1;font-size:28px;cursor:pointer}
.bm-wanted-modal-field{display:flex;flex-direction:column;gap:7px;color:#9dadc4;font-size:13px;font-weight:700}
.bm-wanted-modal-field select,.bm-wanted-new-list-row input,.bm-wanted-create input,.bm-wanted-xml{background:rgba(15,23,42,.75);border:1px solid rgba(148,163,184,.22);color:#e5e7eb;border-radius:12px;padding:11px 12px}
.bm-wanted-new-list-row,.bm-wanted-create{display:flex;gap:10px;margin-top:14px}.bm-wanted-new-list-row input,.bm-wanted-create input{flex:1;min-width:0}
.bm-wanted-modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}.bm-wanted-modal-message{min-height:20px;margin-top:10px;color:#fca5a5}.bm-wanted-memberships{margin-bottom:14px;color:#fca5a5;font-size:13px}
.bm-wanted-page{display:grid;grid-template-columns:300px minmax(0,1fr);gap:22px;align-items:start}.bm-wanted-list-panel,.bm-wanted-detail-panel{min-width:0}.bm-wanted-list-links{display:flex;flex-direction:column;gap:7px;margin-top:18px}.bm-wanted-list-link{display:flex;justify-content:space-between;gap:10px;padding:12px 13px;border-radius:11px;text-decoration:none;color:#dbeafe;background:rgba(255,255,255,.035);border:1px solid transparent}.bm-wanted-list-link:hover,.bm-wanted-list-link.active{background:rgba(37,99,235,.18);border-color:rgba(96,165,250,.35)}.bm-wanted-list-link small{color:#94a3b8}.bm-wanted-empty{color:#94a3b8}.bm-wanted-export-link{display:inline-flex;align-items:center;text-decoration:none}.bm-danger-button,.bm-wanted-remove{background:rgba(239,68,68,.14)!important;color:#fecaca!important;border:1px solid rgba(239,68,68,.35)!important}.bm-wanted-remove{padding:7px 10px;border-radius:9px;cursor:pointer}.bm-wanted-source{display:block;color:#64748b;margin-top:3px}.bm-wanted-xml{width:100%;min-height:560px;margin-top:18px;font-family:Consolas,monospace;line-height:1.45;resize:vertical}.bm-wanted-export-page{max-width:1100px}.bm-wanted-items-table{min-width:900px}
@media(max-width:950px){.bm-wanted-page{grid-template-columns:1fr}.bm-wanted-detail-header{flex-direction:column}.bm-wanted-modal-actions{justify-content:stretch}.bm-wanted-modal-actions button{flex:1}}

/* =========================================================
   Current-page bulk inventory actions
   ========================================================= */
.bm-bulk-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.bm-bulk-action-button {
    background: rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.28);
    color: #dbeafe;
}

.bm-bulk-action-button:hover:not(:disabled) {
    background: rgba(37, 99, 235, 0.34);
}

.bm-bulk-action-button:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.bm-bulk-modal-overlay {
    display: none;
}

body > .bm-bulk-modal-overlay.open,
.bm-bulk-modal-overlay.open {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(8px);
}

.bm-bulk-modal {
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.99), rgba(15, 23, 42, 0.96));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.bm-bulk-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.bm-bulk-modal-header h2 { margin: 0 0 8px; font-size: 28px; }
.bm-bulk-modal-header p { margin: 0; color: #a8b5ca; line-height: 1.45; }
.bm-bulk-modal-close { border: 0; background: transparent; color: #cbd5e1; font-size: 30px; cursor: pointer; }
.bm-bulk-modal-close:disabled { opacity: 0.35; cursor: not-allowed; }

.bm-bulk-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.bm-bulk-summary-card,
.bm-bulk-value-panel > div {
    padding: 15px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: rgba(30, 41, 59, 0.7);
}

.bm-bulk-summary-card span,
.bm-bulk-value-panel span { display: block; color: #94a3b8; font-size: 12px; margin-bottom: 7px; }
.bm-bulk-summary-card strong,
.bm-bulk-value-panel strong { color: #f8fafc; font-size: 20px; }

.bm-bulk-value-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

#bm-bulk-value-change.is-positive { color: #4ade80; }
#bm-bulk-value-change.is-negative { color: #f87171; }

.bm-bulk-confirm-panel,
.bm-bulk-progress-panel {
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.65);
}

.bm-bulk-confirm-panel p { margin: 0; line-height: 1.5; color: #d7dfeb; }
.bm-bulk-progress-topline { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.bm-bulk-progress-track { height: 12px; overflow: hidden; border-radius: 999px; background: rgba(148, 163, 184, 0.18); }
.bm-bulk-progress-bar { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #14f195); transition: width .2s ease; }
.bm-bulk-progress-counts { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 13px; color: #94a3b8; font-size: 12px; }
.bm-bulk-progress-counts strong { color: #f8fafc; }
.bm-bulk-current-item { margin-top: 12px; color: #cbd5e1; min-height: 20px; }
.bm-bulk-error-list { max-height: 150px; overflow-y: auto; margin-top: 12px; padding: 10px; border-radius: 10px; background: rgba(127, 29, 29, 0.25); color: #fecaca; font-size: 12px; }
.bm-bulk-error-list > div + div { margin-top: 6px; }
.bm-bulk-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

@media (max-width: 1200px) {
    .bm-bulk-toolbar-actions { width: 100%; margin-left: 0; }
}

@media (max-width: 700px) {
    .bm-bulk-summary-grid,
    .bm-bulk-value-panel { grid-template-columns: 1fr; }
    .bm-bulk-toolbar-actions .bm-small-button { flex: 1 1 calc(50% - 8px); }
}

/* Shared Inventory Lot modal (create/edit modes) */

.bm-inventory-image-edit { display:block; padding:0; border:0; background:transparent; cursor:pointer; }
.bm-inventory-image-edit img { display:block; }
.bm-inventory-image-edit:hover img, .bm-inventory-image-edit:focus-visible img { outline:2px solid rgba(56,189,248,.8); outline-offset:2px; }

.bm-inventory-lot-panel { max-width:920px; padding:18px 22px; }
.bm-inventory-lot-panel h3 { margin:0 0 4px; }
.bm-inventory-lot-panel .bm-transfer-modal-intro { margin:0 0 12px; }

.bm-inventory-lot-summary {
    display:grid;
    grid-template-columns:76px minmax(240px,1fr) minmax(120px,170px) minmax(105px,140px);
    gap:10px;
    align-items:stretch;
    margin-bottom:12px;
}
.bm-inventory-lot-summary-image,
.bm-inventory-lot-summary-main,
.bm-inventory-lot-summary-meta {
    border:1px solid rgba(96,165,250,.16);
    border-radius:13px;
    background:rgba(15,23,42,.44);
}
.bm-inventory-lot-summary-image { display:flex; align-items:center; justify-content:center; min-height:70px; padding:8px; }
.bm-inventory-lot-summary-image img { max-width:58px; max-height:58px; object-fit:contain; }
.bm-inventory-lot-summary-main,
.bm-inventory-lot-summary-meta { padding:10px 12px; min-height:70px; }
.bm-inventory-lot-summary span { display:block; margin-bottom:5px; color:#9ca3af; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; }
.bm-inventory-lot-summary strong { color:#f8fafc; font-weight:900; line-height:1.28; }
.bm-inventory-lot-summary-main strong { font-size:15px; }
.bm-inventory-lot-summary-meta strong { font-size:15px; }

.bm-edit-lot-soh-box { grid-column:1/-1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; padding:12px 14px; margin:6px 0 12px; border:1px solid rgba(56,189,248,.22); border-radius:14px; background:rgba(15,118,110,.14); }
.bm-edit-lot-soh-row { display:grid; grid-template-columns:1fr auto; align-items:center; gap:10px; margin:0; }
.bm-edit-lot-soh-row > span, .bm-edit-lot-suggested-row > span { color:#9ca3af; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; }
.bm-edit-lot-soh-current strong { display:inline-flex; min-width:62px; justify-content:center; padding:7px 12px; border-radius:999px; color:#e5e7eb; background:rgba(15,23,42,.72); border:1px solid rgba(148,163,184,.22); }
.bm-edit-lot-stepper { display:inline-flex; align-items:center; width:fit-content; overflow:hidden; border-radius:999px; border:1px solid rgba(96,165,250,.35); background:rgba(15,23,42,.84); }
.bm-edit-lot-stepper input { width:70px; min-height:34px; border:0!important; border-left:1px solid rgba(96,165,250,.22)!important; border-right:1px solid rgba(96,165,250,.22)!important; border-radius:0!important; text-align:center; color:#f8fafc; background:transparent!important; font-weight:800; }
.bm-edit-lot-stepper input::-webkit-outer-spin-button, .bm-edit-lot-stepper input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.bm-edit-lot-stepper input[type=number] { -moz-appearance:textfield; appearance:textfield; }
.bm-edit-lot-step { width:34px; min-height:34px; border:0; color:#dbeafe; background:rgba(37,99,235,.72); font-size:18px; font-weight:900; cursor:pointer; }
.bm-edit-lot-step:hover, .bm-edit-lot-step:focus-visible { background:rgba(34,197,94,.82); }

.bm-edit-lot-price-box { grid-column:1/-1; display:grid; gap:6px; margin-bottom:8px; }
.bm-edit-lot-price-field { margin-bottom:0; }
.bm-edit-lot-price-row { display:grid; grid-template-columns:1fr 46px; gap:8px; align-items:center; }
.bm-edit-lot-lock-btn { min-height:42px; border-radius:12px; border:1px solid rgba(96,165,250,.45); background:rgba(37,99,235,.72); color:#fff; cursor:pointer; font-size:17px; }
.bm-edit-lot-lock-btn.locked { background:rgba(245,158,11,.18); border-color:rgba(245,158,11,.55); }
.bm-edit-lot-suggested-row { display:flex; align-items:center; gap:12px; min-height:36px; padding:7px 10px; border-radius:11px; background:rgba(15,23,42,.55); border:1px solid rgba(96,165,250,.18); }
.bm-edit-lot-suggested-row strong { color:#e5e7eb; min-width:72px; }
.bm-edit-lot-use-suggested { padding:6px 12px!important; min-height:30px!important; line-height:1!important; border-radius:999px!important; }
.bm-edit-lot-use-suggested[disabled] { opacity:.45; cursor:not-allowed; }
.bm-edit-lot-suggested-row strong.bm-suggested-up { color:#22c55e; }
.bm-edit-lot-suggested-row strong.bm-suggested-down { color:#f59e0b; }
.bm-edit-lot-suggested-row strong.bm-suggested-same { color:#cbd5e1; }

.bm-edit-lot-options-row {
    grid-column:1/-1;
    display:grid;
    grid-template-columns:auto auto minmax(150px,220px);
    align-items:end;
    gap:10px;
    margin:0 0 8px;
}
.bm-edit-lot-toggle {
    display:inline-flex;
    align-items:center;
    gap:8px;
    min-height:38px;
    padding:8px 12px;
    border-radius:999px;
    border:1px solid rgba(96,165,250,.22);
    background:rgba(15,23,42,.55);
    color:#e5e7eb;
    font-size:12px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.03em;
    cursor:pointer;
}
.bm-edit-lot-toggle input {
    width:16px;
    height:16px;
    accent-color:#22c55e;
}
.bm-edit-lot-stockroom-id {
    display:grid;
    gap:4px;
    margin:0;
}
.bm-edit-lot-stockroom-id > span {
    color:#9ca3af;
    font-size:11px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.03em;
}
.bm-edit-lot-stockroom-id input {
    min-height:38px;
}

#bm-edit-lot-form .bm-transfer-field { margin-bottom:6px; }
#bm-edit-lot-form textarea { min-height:54px; }
#bm-edit-lot-form .bm-transfer-warning { padding:10px 14px; margin-top:8px; }
#bm-edit-lot-form .bm-transfer-actions { position:sticky; bottom:0; padding-top:8px; background:linear-gradient(to bottom, rgba(15,23,42,0), rgba(15,23,42,.96) 30%); }

@media (max-width:860px) {
    .bm-inventory-lot-summary { grid-template-columns:70px 1fr 1fr; }
    .bm-inventory-lot-summary-main { grid-column:2 / -1; }
    .bm-edit-lot-soh-box { grid-template-columns:1fr; }
}
@media (max-width:680px) {
    .bm-inventory-lot-panel { padding:16px; }
    .bm-inventory-lot-summary { grid-template-columns:64px 1fr; }
    .bm-inventory-lot-summary-meta { min-height:auto; }
    .bm-edit-lot-suggested-row { flex-wrap:wrap; }
    .bm-edit-lot-options-row { grid-template-columns:1fr; align-items:stretch; }
}

.bm-inventory-lot-source-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0 0 12px; }
.bm-inventory-lot-source-summary > div { padding:10px 12px; border:1px solid rgba(96,165,250,.16); border-radius:13px; background:rgba(15,23,42,.44); }
.bm-inventory-lot-source-summary span, .bm-inventory-lot-create-qty-box > span { display:block; margin-bottom:5px; color:#9ca3af; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; }
.bm-inventory-lot-create-qty-box { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; margin:6px 0 12px; border:1px solid rgba(56,189,248,.22); border-radius:14px; background:rgba(15,118,110,.14); }
.bm-inventory-lot-create-qty-box > span { margin:0; }
.bm-inventory-lot-create-price-row { grid-template-columns:1fr; }
#bm-create-lot-form .bm-transfer-field, #bm-edit-lot-form .bm-transfer-field { margin-bottom:6px; }
#bm-create-lot-form textarea, #bm-edit-lot-form textarea { min-height:54px; }
#bm-create-lot-form .bm-transfer-actions, #bm-edit-lot-form .bm-transfer-actions { position:sticky; bottom:0; padding-top:8px; background:linear-gradient(to bottom, rgba(15,23,42,0), rgba(15,23,42,.96) 30%); }
@media (max-width:680px) { .bm-inventory-lot-source-summary { grid-template-columns:1fr; } }

/* Minifigure breakdown / POV */
.bm-minifig-breakdown-link { margin-left: 6px; text-decoration: none; font-size: 14px; opacity: .82; }
.bm-minifig-breakdown-link:hover { opacity: 1; }
.bm-mf-breakdown-header { align-items: flex-end; }
.bm-mf-breakdown-actions, .bm-mf-report-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bm-mf-breakdown-actions select, .bm-mf-report-filters select { min-height: 38px; border-radius: 8px; padding: 0 10px; }
.bm-mf-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.bm-mf-summary-card { padding: 20px; }
.bm-mf-summary-card span { display: block; color: #8ea0b8; font-size: 12px; margin-bottom: 8px; }
.bm-mf-summary-card strong { font-size: 25px; }
.bm-mf-summary-card.positive strong, .bm-positive { color: #14f195; }
.bm-mf-summary-card.negative strong, .bm-negative { color: #fb7185; }
.bm-mf-incomplete { margin: 0 0 18px; padding: 12px 15px; border: 1px solid rgba(245,158,11,.4); background: rgba(245,158,11,.1); border-radius: 10px; }
.bm-mf-breakdown-table td:first-child span { display: block; margin-left: 24px; color: #9fb0c8; font-size: 12px; }
.bm-mf-complete-row { background: rgba(59,130,246,.08); }
.bm-mf-complete-row td { border-bottom-color: rgba(59,130,246,.28); }
@media (max-width: 1000px) { .bm-mf-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 600px) { .bm-mf-summary-grid { grid-template-columns: 1fr; } }

/* Inventory/Parts list thumbnails
   Keep every thumbnail contained inside a clean white 48px tile. */
.bm-inventory-part-cell .bm-inventory-image {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    padding: 0;
    overflow: hidden;
    border-radius: 9px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.20);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.bm-inventory-part-cell .bm-inventory-image > button,
.bm-inventory-part-cell .bm-inventory-image > a {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 3px;
    border: 0;
    border-radius: inherit;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bm-inventory-part-cell .bm-inventory-image img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 6px;
    background: #ffffff;
}

.bm-inventory-part-cell .bm-inventory-image > button:hover,
.bm-inventory-part-cell .bm-inventory-image > button:focus-visible,
.bm-inventory-part-cell .bm-inventory-image > a:hover,
.bm-inventory-part-cell .bm-inventory-image > a:focus-visible {
    background: #ffffff;
    outline: 2px solid rgba(56, 189, 248, 0.8);
    outline-offset: 2px;
}

.bm-inventory-part-cell .bm-inventory-image-edit:hover img,
.bm-inventory-part-cell .bm-inventory-image-edit:focus-visible img {
    outline: 0;
}

.bm-item-search-filter-grid > .bm-item-search-field{min-width:0;width:100%;}
.bm-item-search-filter-grid select,.bm-item-search-filter-grid input,.bm-item-search-filter-grid .select2-container{width:100%!important;}
@media(max-width:1180px){.bm-item-search-filter-row-primary,.bm-item-search-filter-row-secondary{grid-template-columns:repeat(2,minmax(220px,1fr));}}
@media(max-width:650px){.bm-item-search-filter-row-primary,.bm-item-search-filter-row-secondary{grid-template-columns:1fr;}}
/* V3 pricing profiles and page hierarchy */
.bm-pricing-engine {
  scroll-behavior: smooth;
}

.bm-pe-anchor {
  position: absolute;
  transform: translateY(-110px);
}

.bm-pe-page-nav {
  position: relative;
  top: auto;
  z-index: 20;
  display: flex;
  gap: 8px;
  width: fit-content;
  margin: 0 0 22px;
  padding: 6px;
  border: 1px solid #2a3d58;
  border-radius: 999px;
  background: rgba(10, 22, 39, .94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .24);
  backdrop-filter: blur(10px);
}

.bm-pe-page-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: #b9c9dc;
  font-size: .86rem;
  font-weight: 800;
  text-decoration: none;
}

.bm-pe-page-nav a:hover,
.bm-pe-page-nav a:focus-visible {
  color: #fff;
  background: #2563eb;
}

.bm-pricing-engine .bm-btn:not(.bm-primary):not(.bm-danger),
.bm-pricing-engine button.bm-btn:not(.bm-primary):not(.bm-danger) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #38506f;
  border-radius: 12px;
  color: #e8eef8;
  background: linear-gradient(145deg, #17263b, #111e31);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .14);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.bm-pricing-engine .bm-btn:not(.bm-primary):not(.bm-danger):hover,
.bm-pricing-engine button.bm-btn:not(.bm-primary):not(.bm-danger):hover {
  border-color: #4f8de8;
  color: #fff;
  background: #1a3150;
  transform: translateY(-1px);
}

.bm-pe-profile-panel,
.bm-pe-rules-section {
  margin-bottom: 18px;
  border: 1px solid #2a3d58;
  border-radius: 18px;
  background: linear-gradient(145deg, #101d31, #0b1627);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .22);
}

.bm-pe-profile-panel {
  padding: 22px;
}

.bm-pe-profile-heading,
.bm-pe-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.bm-pe-profile-heading h2,
.bm-pe-section-heading h2 {
  margin: 3px 0 5px;
  color: #f8fbff;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.bm-pe-profile-heading p,
.bm-pe-section-heading p {
  margin: 0;
  max-width: 760px;
  color: #9dadc4;
}

.bm-pe-eyebrow {
  color: #68a4ff;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.bm-pe-default-badge,
.bm-pe-rule-count {
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid #1f8b60;
  border-radius: 999px;
  color: #91f5c4;
  background: rgba(16, 185, 129, .12);
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bm-pe-profile-grid {
  display: grid;
  grid-template-columns: minmax(230px, .7fr) minmax(420px, 1.3fr);
  gap: 14px;
  margin-top: 20px;
}

.bm-pe-profile-control {
  min-width: 0;
}

.bm-pe-profile-control > label {
  display: block;
  margin-bottom: 7px;
  color: #9dadc4;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bm-pe-inline-action,
.bm-pe-profile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bm-pe-inline-action {
  min-width: 0;
}

.bm-pe-inline-action .bm-input,
.bm-pe-inline-action .bm-inventory-select {
  min-width: 150px;
}

.bm-pe-profile-actions {
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #253650;
}

.bm-pe-profile-actions form:last-child {
  margin-left: auto;
}

.bm-pe-engine-settings {
  position: relative;
  overflow: visible;
}

.bm-pe-field-help {
  display: block;
  margin-top: 6px;
  color: #8295ad;
  font-size: .75rem;
  line-height: 1.35;
}

.bm-pe-engine-unlimited {
  align-self: center;
}

.bm-pe-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  color: #d9e4f2;
  font-weight: 800;
  cursor: pointer;
}

.bm-pe-check input {
  width: 18px !important;
  height: 18px;
  accent-color: #347ff0;
}

.bm-pricing-engine #engine-cap-percent:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.bm-pe-rules-section {
  padding: 20px;
}

.bm-pe-rules-section > .bm-acc:first-of-type {
  margin-top: 18px;
}

.bm-pe-rules-section .bm-acc {
  margin-bottom: 10px;
}

.bm-pe-rules-section .bm-acc > summary {
  min-height: 68px;
}

.bm-pricing-engine .bm-tester {
  border-width: 1px;
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .22);
}

.bm-pricing-engine .result-card #t-result {
  border-color: #347ff0;
  color: #fff;
  background: linear-gradient(135deg, rgba(37, 99, 235, .30), rgba(29, 78, 216, .12));
  font-size: 1.35rem;
  font-weight: 900;
}

@media (max-width: 900px) {
  .bm-pe-profile-grid {
    grid-template-columns: 1fr;
  }

  .bm-pe-profile-create .bm-pe-inline-action,
  .bm-pe-profile-actions,
  .bm-pe-profile-actions .bm-pe-inline-action {
    align-items: stretch;
    flex-direction: column;
  }

  .bm-pe-profile-actions form,
  .bm-pe-profile-actions form:last-child,
  .bm-pe-profile-actions .bm-input,
  .bm-pe-profile-actions .bm-inventory-select,
  .bm-pe-profile-actions .bm-btn {
    width: 100%;
    margin-left: 0;
  }
}

.bm-pricing-engine .bm-pe-custom-stack {
  width: min(720px, 100%);
  margin-top: 13px;
  padding: 14px;
  border: 1px solid #304968;
  border-radius: 13px;
  background: rgba(8, 20, 36, .48);
}

.bm-pricing-engine .bm-pe-custom-stack[hidden] {
  display: none !important;
}

.bm-pricing-engine .bm-stack-heading {
  margin-bottom: 10px;
}

.bm-pricing-engine .bm-stack-kicker {
  display: block;
  margin-bottom: 2px;
  color: #79adf8;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.bm-pricing-engine .bm-stack-heading h3 {
  margin: 0 0 3px;
  color: #f5f8ff;
  font-size: 1.05rem;
}

.bm-pricing-engine .bm-stack-heading p {
  margin: 0;
  color: #a9bad0;
  font-size: .79rem;
  line-height: 1.4;
}

.bm-pricing-engine .bm-stack-list {
  display: grid;
  gap: 6px;
}

.bm-pricing-engine .bm-stack-row {
  display: grid;
  grid-template-columns: 28px 18px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 44px;
  padding: 5px 7px 5px 9px;
  border: 1px solid #293e59;
  border-radius: 9px;
  background: #101e31;
}

.bm-pricing-engine .bm-stack-row:has(.bm-stack-enabled:checked) {
  border-color: rgba(59, 130, 246, .5);
  background: rgba(30, 64, 111, .34);
}

.bm-pricing-engine .bm-stack-position {
  display: inline-flex;
  width: 25px;
  height: 25px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #dbeafe;
  background: #274c7e;
  font-size: .72rem;
  font-weight: 900;
}

.bm-pricing-engine .bm-stack-enabled {
  width: 16px !important;
  height: 16px;
  margin: 0;
  accent-color: #347ff0;
}

.bm-pricing-engine .bm-stack-row label {
  min-width: 0;
  color: #edf4ff;
  font-size: .84rem;
  font-weight: 800;
  cursor: pointer;
}

.bm-pricing-engine .bm-stack-row label::after {
  content: "Not included";
  display: block;
  margin-top: 1px;
  color: #7f93ac;
  font-size: .65rem;
  font-weight: 700;
}

.bm-pricing-engine .bm-stack-enabled:checked + label::after {
  content: "Included";
  color: #86efac;
}

.bm-pricing-engine .bm-stack-move-actions {
  display: flex;
  gap: 5px;
}

.bm-pricing-engine .bm-stack-move {
  display: inline-flex;
  width: 31px;
  height: 31px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #3975c5;
  border-radius: 8px;
  color: #fff;
  background: #2563c7;
  cursor: pointer;
}

.bm-pricing-engine .bm-stack-move:hover,
.bm-pricing-engine .bm-stack-move:focus-visible {
  border-color: #79adf8;
  background: #347ff0;
}

.bm-pricing-engine .bm-stack-move:disabled {
  border-color: #2b3d54;
  color: #60738b;
  background: #142238;
  cursor: not-allowed;
  opacity: .65;
}

.bm-pricing-engine .bm-stack-move svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Final compact overrides follow the profile component definitions above. */
.bm-pricing-engine .bm-pe-page-nav { margin-bottom: 10px; padding: 4px; }
.bm-pricing-engine .bm-pe-page-nav a { padding: 6px 12px; }
.bm-pricing-engine .bm-pe-profile-panel { margin-bottom: 10px; padding: 14px; border-radius: 14px; }

.bm-pricing-engine .bm-pe-assignment-panel { margin-bottom: 10px; }
.bm-pricing-engine .bm-pe-assignment-form { display: grid; gap: 12px; justify-items: start; }
.bm-pricing-engine .bm-pe-assignment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    width: 100%;
}
.bm-pricing-engine .bm-pe-assignment-field { display: grid; gap: 5px; }
.bm-pricing-engine .bm-pe-assignment-field > span {
    color: #a9bad1;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}
.bm-pricing-engine .bm-pe-category-assignment {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(96, 165, 250, .2);
}
.bm-pricing-engine .bm-pe-assignment-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid rgba(96, 165, 250, .2);
    border-radius: 10px;
    background: rgba(15, 23, 42, .55);
}
@media (max-width: 760px) {
    .bm-pricing-engine .bm-pe-assignment-row { grid-template-columns: 1fr; }
}
.bm-pricing-engine .bm-pe-profile-heading { gap: 12px; }
.bm-pricing-engine .bm-pe-profile-heading h2 { margin: 0 0 2px; font-size: 1.25rem; }
.bm-pricing-engine .bm-pe-profile-heading p { font-size: .82rem; }
.bm-pricing-engine .bm-pe-profile-grid { gap: 10px; margin-top: 10px; }
.bm-pricing-engine .bm-pe-profile-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.bm-pricing-engine .bm-pe-profile-toolbar .bm-pe-profile-control {
  width: min(360px, 100%);
}
.bm-pricing-engine .bm-pe-profile-selection-group {
  display: flex;
  align-items: end;
  gap: 8px;
  min-width: 0;
}
.bm-pricing-engine .bm-pe-make-default-form { flex: 0 0 auto; }
.bm-pricing-engine .bm-pe-profile-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bm-pricing-engine .bm-pe-profile-dialog-card .bm-label {
  display: block;
  margin: 18px 0 7px;
}
.bm-pricing-engine .bm-pe-profile-dialog-card .bm-input { width: 100%; }
.bm-pricing-engine .bm-pe-profile-dialog-actions { flex-wrap: wrap; }
.bm-pricing-engine .bm-pe-profile-actions form:last-child { margin-left: 0; }
.bm-pricing-engine .bm-pe-profile-actions .bm-pe-delete-profile-form { margin-left: auto; }
.bm-pricing-engine .bm-pe-field-help a {
  margin-left: 5px;
  color: #7db7ff;
  font-weight: 800;
}
.bm-profile-filter-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid rgba(96, 165, 250, .34);
  border-radius: 11px;
  color: #cbdcf3;
  background: rgba(37, 99, 235, .11);
}
.bm-profile-filter-notice a { color: #7db7ff; font-weight: 800; }
.bm-pricing-engine .bm-pe-profile-actions .bm-danger:disabled {
  opacity: .48;
  cursor: not-allowed;
}
@media (max-width: 700px) {
  .bm-pricing-engine .bm-pe-profile-toolbar { align-items: stretch; flex-direction: column; }
  .bm-pricing-engine .bm-pe-profile-toolbar .bm-pe-profile-control { width: 100%; }
  .bm-pricing-engine .bm-pe-profile-selection-group { align-items: stretch; flex-wrap: wrap; }
  .bm-pricing-engine .bm-pe-profile-actions .bm-pe-delete-profile-form { margin-left: 0; }
}
.bm-pricing-engine .bm-pe-profile-control > label { margin-bottom: 4px; }
.bm-pricing-engine .bm-pe-profile-actions { gap: 6px; margin-top: 9px; padding-top: 9px; }
.bm-pricing-engine .bm-pe-rules-section { padding: 14px; border-radius: 14px; }
.bm-pricing-engine .bm-pe-rules-section > .bm-acc:first-of-type { margin-top: 10px; }

.bm-page-header-sticky {
  align-items: center;
  top: 0;
  margin: 8px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(79, 119, 166, .5);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(12, 29, 51, .97), rgba(7, 20, 38, .97));
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
}

.bm-page-header-sticky > div:first-child {
  min-width: 0;
}

.bm-page-header-sticky .bm-pe-page-nav {
  margin: 9px 0 0;
  padding: 4px;
  gap: 4px;
  border-color: rgba(96, 165, 250, .32);
  background: rgba(7, 18, 34, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
  flex-wrap: wrap;
}

.bm-page-header-sticky .bm-pe-page-nav a {
  padding: 6px 11px;
  color: #b9c9dc;
  font-size: .8rem;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.bm-page-header-sticky .bm-pe-page-nav a:hover,
.bm-page-header-sticky .bm-pe-page-nav a:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 5px 14px rgba(37, 99, 235, .28);
}

.bm-page-header-sticky > .bm-sync-status {
  padding: 8px 10px;
  border: 1px solid rgba(20, 241, 149, .18);
  border-radius: 12px;
  background: rgba(13, 50, 50, .24);
}

#pricing-profiles,
#pricing-assignments,
#pricing-method,
#pricing-rules,
#bmRuleTester {
  scroll-margin-top: 125px;
}

.bm-pricing-engine .bm-pipe-rounding-note {
  margin-top: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(245, 158, 11, .42);
  border-radius: 8px;
  background: rgba(120, 53, 15, .2);
  color: #fde68a;
  font-size: .82rem;
  font-weight: 800;
}

.bm-pricing-engine .bm-combo-value {
  margin: 5px 0 3px;
  color: #93c5fd;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.025em;
}

.bm-pricing-engine .bm-pipe-price {
  color: #93c5fd;
  font-weight: 900;
}

.bm-pricing-engine .bm-pipe-body {
  padding: 12px 14px 13px;
}

.bm-pricing-engine .bm-pipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 11px 20px;
  align-items: start;
}

.bm-pricing-engine .bm-pipe-grid > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.bm-pricing-engine .bm-pipe-label {
  display: block;
  color: #9fb1c8;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .045em;
  line-height: 1.2;
  text-transform: uppercase;
}

.bm-pricing-engine .bm-pipe-grid strong {
  color: #f4f8ff;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.bm-pricing-engine .bm-pipe-summary {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid rgba(147, 197, 253, .14);
  color: #c9d7e8;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .bm-pricing-engine .bm-pipe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .bm-pe-page-nav {
    top: auto;
    width: 100%;
    justify-content: center;
  }

  .bm-pe-page-nav a {
    flex: 1;
    padding-inline: 8px;
    text-align: center;
  }

  .bm-pe-profile-heading,
  .bm-pe-section-heading {
    flex-direction: column;
  }
}

/* Compact trial actions; retain the existing header and modal styling. */
.bm-trial-controls { display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:12px; }
.bm-trial-button { display:inline-flex; align-items:center; justify-content:center; padding:7px 10px; border:1px solid transparent; border-radius:10px; font:inherit; font-weight:700; line-height:1.3; text-decoration:none; cursor:pointer; white-space:nowrap; }
.bm-trial-upgrade { background:#15803d; color:#fff; }
.bm-trial-danger { background:#b91c1c; color:#fff; }
.bm-trial-secondary { background:#e2e8f0; color:#102033; border-color:#cbd5e1; }
.bm-trial-button:hover { filter:brightness(1.12); }
.bm-trial-button:focus-visible { outline:3px solid #60a5fa; outline-offset:3px; }
.bm-trial-end-modal { border:0; box-sizing:border-box; max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); overflow:auto; }
.bm-trial-end-modal::backdrop { background:rgba(8,21,38,.78); }
.bm-trial-modal-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px; margin:0; }
.bm-trial-modal-actions .bm-trial-button { min-height:44px; }
@media (max-width:900px) {
    .bm-topbar-with-trial { height:auto; flex-wrap:wrap; }
    .bm-topbar-with-trial .bm-topbar-right { width:100%; flex-wrap:wrap; }
    .bm-trial-controls { flex:1 1 100%; }
    .bm-trial-controls .bm-trial-button { min-height:36px; }
}
@media (max-width:480px) {
    .bm-trial-end-modal { padding:20px; }
    .bm-trial-modal-actions .bm-trial-button { flex:1 1 auto; }
}
.bm-wanted-list-tools{display:grid;gap:8px;margin-top:14px}.bm-wanted-list-tools>label{font-size:12px;color:#94a3b8}.bm-wanted-list-tools select{width:100%;min-width:0;padding:8px;border-radius:8px;background:#102d47;color:#dbeafe;border:1px solid #475569}.bm-wanted-selection{display:flex;align-items:center;justify-content:space-between;gap:8px}.bm-wanted-selection label{display:flex;align-items:center;gap:6px;font-size:13px}.bm-wanted-list-row{display:flex;align-items:center;gap:7px;min-width:0}.bm-wanted-list-row .bm-wanted-list-link{flex:1;min-width:0;flex-direction:column;gap:4px;padding:10px}.bm-wanted-list-row .bm-wanted-list-link span{overflow-wrap:anywhere}.bm-wanted-list-row .bm-wanted-list-link small{font-size:11px}.bm-wanted-list-delete{flex:none;border:0;background:transparent;color:#fca5a5;padding:7px;cursor:pointer;font-size:18px}.bm-wanted-list-delete:disabled{opacity:.4;cursor:default}.bm-wanted-item-link{color:inherit;text-decoration:underline;text-underline-offset:3px}.bm-wanted-list-check:focus-visible,.bm-wanted-list-delete:focus-visible,.bm-inventory-image-preview:focus-visible{outline:2px solid #60a5fa;outline-offset:3px}
